Merge changes If362e2ad,I1246175c,Ie4aa961e,I6e69dfcd
* changes:
Updated comments using https://source.android.com/setup/contribute/respectful-code
Updated comments using https://source.android.com/setup/contribute/respectful-code
Updated comments using https://source.android.com/setup/contribute/respectful-code
Updated comments using https://source.android.com/setup/contribute/respectful-code
diff --git a/apex/appsearch/service/java/com/android/server/appsearch/AppSearchConfig.java b/apex/appsearch/service/java/com/android/server/appsearch/AppSearchConfig.java
index c44fd40..29048b2 100644
--- a/apex/appsearch/service/java/com/android/server/appsearch/AppSearchConfig.java
+++ b/apex/appsearch/service/java/com/android/server/appsearch/AppSearchConfig.java
@@ -81,6 +81,14 @@
"sampling_interval_for_batch_call_stats";
public static final String KEY_SAMPLING_INTERVAL_FOR_PUT_DOCUMENT_STATS =
"sampling_interval_for_put_document_stats";
+ public static final String KEY_SAMPLING_INTERVAL_FOR_INITIALIZE_STATS =
+ "sampling_interval_for_initialize_stats";
+ public static final String KEY_SAMPLING_INTERVAL_FOR_SEARCH_STATS =
+ "sampling_interval_for_search_stats";
+ public static final String KEY_SAMPLING_INTERVAL_FOR_GLOBAL_SEARCH_STATS =
+ "sampling_interval_for_global_search_stats";
+ public static final String KEY_SAMPLING_INTERVAL_FOR_OPTIMIZE_STATS =
+ "sampling_interval_for_optimize_stats";
public static final String KEY_LIMIT_CONFIG_MAX_DOCUMENT_SIZE_BYTES =
"limit_config_max_document_size_bytes";
public static final String KEY_LIMIT_CONFIG_MAX_DOCUMENT_COUNT =
@@ -95,6 +103,10 @@
KEY_SAMPLING_INTERVAL_DEFAULT,
KEY_SAMPLING_INTERVAL_FOR_BATCH_CALL_STATS,
KEY_SAMPLING_INTERVAL_FOR_PUT_DOCUMENT_STATS,
+ KEY_SAMPLING_INTERVAL_FOR_INITIALIZE_STATS,
+ KEY_SAMPLING_INTERVAL_FOR_SEARCH_STATS,
+ KEY_SAMPLING_INTERVAL_FOR_GLOBAL_SEARCH_STATS,
+ KEY_SAMPLING_INTERVAL_FOR_OPTIMIZE_STATS,
KEY_LIMIT_CONFIG_MAX_DOCUMENT_SIZE_BYTES,
KEY_LIMIT_CONFIG_MAX_DOCUMENT_COUNT,
KEY_BYTES_OPTIMIZE_THRESHOLD,
@@ -245,6 +257,58 @@
}
}
+ /**
+ * Returns cached value for sampling interval for initialize.
+ *
+ * <p>For example, sampling_interval=10 means that one out of every 10 stats was logged.
+ */
+ public int getCachedSamplingIntervalForInitializeStats() {
+ synchronized (mLock) {
+ throwIfClosedLocked();
+ return mBundleLocked.getInt(KEY_SAMPLING_INTERVAL_FOR_INITIALIZE_STATS,
+ getCachedSamplingIntervalDefault());
+ }
+ }
+
+ /**
+ * Returns cached value for sampling interval for search.
+ *
+ * <p>For example, sampling_interval=10 means that one out of every 10 stats was logged.
+ */
+ public int getCachedSamplingIntervalForSearchStats() {
+ synchronized (mLock) {
+ throwIfClosedLocked();
+ return mBundleLocked.getInt(KEY_SAMPLING_INTERVAL_FOR_SEARCH_STATS,
+ getCachedSamplingIntervalDefault());
+ }
+ }
+
+ /**
+ * Returns cached value for sampling interval for globalSearch.
+ *
+ * <p>For example, sampling_interval=10 means that one out of every 10 stats was logged.
+ */
+ public int getCachedSamplingIntervalForGlobalSearchStats() {
+ synchronized (mLock) {
+ throwIfClosedLocked();
+ return mBundleLocked.getInt(KEY_SAMPLING_INTERVAL_FOR_GLOBAL_SEARCH_STATS,
+ getCachedSamplingIntervalDefault());
+ }
+ }
+
+ /**
+ * Returns cached value for sampling interval for optimize.
+ *
+ * <p>For example, sampling_interval=10 means that one out of every 10 stats was logged.
+ */
+ public int getCachedSamplingIntervalForOptimizeStats() {
+ synchronized (mLock) {
+ throwIfClosedLocked();
+ return mBundleLocked.getInt(KEY_SAMPLING_INTERVAL_FOR_OPTIMIZE_STATS,
+ getCachedSamplingIntervalDefault());
+ }
+ }
+
/** Returns the maximum serialized size an indexed document can be, in bytes. */
public int getCachedLimitConfigMaxDocumentSizeBytes() {
synchronized (mLock) {
@@ -343,6 +407,10 @@
case KEY_SAMPLING_INTERVAL_DEFAULT:
case KEY_SAMPLING_INTERVAL_FOR_BATCH_CALL_STATS:
case KEY_SAMPLING_INTERVAL_FOR_PUT_DOCUMENT_STATS:
+ case KEY_SAMPLING_INTERVAL_FOR_INITIALIZE_STATS:
+ case KEY_SAMPLING_INTERVAL_FOR_SEARCH_STATS:
+ case KEY_SAMPLING_INTERVAL_FOR_GLOBAL_SEARCH_STATS:
+ case KEY_SAMPLING_INTERVAL_FOR_OPTIMIZE_STATS:
synchronized (mLock) {
mBundleLocked.putInt(key, properties.getInt(key, DEFAULT_SAMPLING_INTERVAL));
}
diff --git a/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java b/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java
index 1d66beb..db23a6d 100644
--- a/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java
+++ b/apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java
@@ -59,6 +59,7 @@
import com.android.server.LocalManagerRegistry;
import com.android.server.SystemService;
import com.android.server.appsearch.external.localstorage.stats.CallStats;
+import com.android.server.appsearch.external.localstorage.stats.OptimizeStats;
import com.android.server.appsearch.external.localstorage.visibilitystore.VisibilityStore;
import com.android.server.appsearch.stats.StatsCollector;
import com.android.server.appsearch.util.PackageUtil;
@@ -1479,20 +1480,42 @@
private void checkForOptimize(AppSearchUserInstance instance, int mutateBatchSize) {
EXECUTOR.execute(() -> {
+ long totalLatencyStartMillis = SystemClock.elapsedRealtime();
+ OptimizeStats.Builder builder = new OptimizeStats.Builder();
try {
- instance.getAppSearchImpl().checkForOptimize(mutateBatchSize);
+ instance.getAppSearchImpl().checkForOptimize(mutateBatchSize, builder);
} catch (AppSearchException e) {
Log.w(TAG, "Error occurred when check for optimize", e);
+ } finally {
+ OptimizeStats oStats = builder
+ .setTotalLatencyMillis(
+ (int) (SystemClock.elapsedRealtime() - totalLatencyStartMillis))
+ .build();
+ if (oStats.getOriginalDocumentCount() > 0) {
+ // see if optimize has been run by checking originalDocumentCount
+ instance.getLogger().logStats(oStats);
+ }
}
});
}
private void checkForOptimize(AppSearchUserInstance instance) {
EXECUTOR.execute(() -> {
+ long totalLatencyStartMillis = SystemClock.elapsedRealtime();
+ OptimizeStats.Builder builder = new OptimizeStats.Builder();
try {
- instance.getAppSearchImpl().checkForOptimize();
+ instance.getAppSearchImpl().checkForOptimize(builder);
} catch (AppSearchException e) {
Log.w(TAG, "Error occurred when check for optimize", e);
+ } finally {
+ OptimizeStats oStats = builder
+ .setTotalLatencyMillis(
+ (int) (SystemClock.elapsedRealtime() - totalLatencyStartMillis))
+ .build();
+ if (oStats.getOriginalDocumentCount() > 0) {
+ // see if optimize has been run by checking originalDocumentCount
+ instance.getLogger().logStats(oStats);
+ }
}
});
}
diff --git a/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/AppSearchImpl.java b/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/AppSearchImpl.java
index 830e76c..15916cc 100644
--- a/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/AppSearchImpl.java
+++ b/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/AppSearchImpl.java
@@ -55,6 +55,7 @@
import com.android.server.appsearch.external.localstorage.converter.SetSchemaResponseToProtoConverter;
import com.android.server.appsearch.external.localstorage.converter.TypePropertyPathToProtoConverter;
import com.android.server.appsearch.external.localstorage.stats.InitializeStats;
+import com.android.server.appsearch.external.localstorage.stats.OptimizeStats;
import com.android.server.appsearch.external.localstorage.stats.PutDocumentStats;
import com.android.server.appsearch.external.localstorage.stats.RemoveStats;
import com.android.server.appsearch.external.localstorage.stats.SearchStats;
@@ -145,6 +146,9 @@
public final class AppSearchImpl implements Closeable {
private static final String TAG = "AppSearchImpl";
+ /** A value 0 means that there're no more pages in the search results. */
+ private static final long EMPTY_PAGE_TOKEN = 0;
+
@VisibleForTesting static final int CHECK_OPTIMIZE_INTERVAL = 100;
private final ReadWriteLock mReadWriteLock = new ReentrantReadWriteLock();
@@ -284,6 +288,9 @@
// Log the time it took to read the data that goes into the cache maps
if (initStatsBuilder != null) {
+ // In case there is some error for getAllNamespaces, we can still
+ // set the latency for preparation.
+ // If there is no error, the value will be overridden by the actual one later.
initStatsBuilder
.setStatusCode(
statusProtoToResultCode(
@@ -1135,6 +1142,16 @@
searchResultProto.getResultsCount(),
searchResultProto);
checkSuccess(searchResultProto.getStatus());
+ if (nextPageToken != EMPTY_PAGE_TOKEN
+ && searchResultProto.getNextPageToken() == EMPTY_PAGE_TOKEN) {
+ // At this point, we're guaranteed that this nextPageToken exists for this package,
+ // otherwise checkNextPageToken would've thrown an exception.
+ // Since the new token is 0, this is the last page. We should remove the old token
+ // from our cache since it no longer refers to this query.
+ synchronized (mNextPageTokensLocked) {
+ mNextPageTokensLocked.get(packageName).remove(nextPageToken);
+ }
+ }
return rewriteSearchResultProto(searchResultProto, mSchemaMapLocked);
} finally {
mReadWriteLock.readLock().unlock();
@@ -1326,8 +1343,7 @@
deleteResultProto.getStatus(), StatusProto.Code.OK, StatusProto.Code.NOT_FOUND);
// Update derived maps
- int numDocumentsDeleted =
- deleteResultProto.getDeleteStats().getNumDocumentsDeleted();
+ int numDocumentsDeleted = deleteResultProto.getDeleteStats().getNumDocumentsDeleted();
updateDocumentCountAfterRemovalLocked(packageName, numDocumentsDeleted);
} finally {
mReadWriteLock.writeLock().unlock();
@@ -2056,6 +2072,10 @@
}
private void addNextPageToken(String packageName, long nextPageToken) {
+ if (nextPageToken == EMPTY_PAGE_TOKEN) {
+ // There is no more pages. No need to add it.
+ return;
+ }
synchronized (mNextPageTokensLocked) {
Set<Long> tokens = mNextPageTokensLocked.get(packageName);
if (tokens == null) {
@@ -2068,6 +2088,11 @@
private void checkNextPageToken(String packageName, long nextPageToken)
throws AppSearchException {
+ if (nextPageToken == EMPTY_PAGE_TOKEN) {
+ // Swallow the check for empty page token, token = 0 means there is no more page and it
+ // won't return anything from Icing.
+ return;
+ }
synchronized (mNextPageTokensLocked) {
Set<Long> nextPageTokens = mNextPageTokensLocked.get(packageName);
if (nextPageTokens == null || !nextPageTokens.contains(nextPageToken)) {
@@ -2162,12 +2187,13 @@
* #CHECK_OPTIMIZE_INTERVAL}, {@link IcingSearchEngine#getOptimizeInfo()} will be triggered
* and the counter will be reset.
*/
- public void checkForOptimize(int mutationSize) throws AppSearchException {
+ public void checkForOptimize(int mutationSize, @Nullable OptimizeStats.Builder builder)
+ throws AppSearchException {
mReadWriteLock.writeLock().lock();
try {
mOptimizeIntervalCountLocked += mutationSize;
if (mOptimizeIntervalCountLocked >= CHECK_OPTIMIZE_INTERVAL) {
- checkForOptimize();
+ checkForOptimize(builder);
}
} finally {
mReadWriteLock.writeLock().unlock();
@@ -2183,14 +2209,15 @@
* <p>{@link IcingSearchEngine#optimize()} should be called only if {@link
* OptimizeStrategy#shouldOptimize(GetOptimizeInfoResultProto)} return true.
*/
- public void checkForOptimize() throws AppSearchException {
+ public void checkForOptimize(@Nullable OptimizeStats.Builder builder)
+ throws AppSearchException {
mReadWriteLock.writeLock().lock();
try {
GetOptimizeInfoResultProto optimizeInfo = getOptimizeInfoResultLocked();
checkSuccess(optimizeInfo.getStatus());
mOptimizeIntervalCountLocked = 0;
if (mOptimizeStrategy.shouldOptimize(optimizeInfo)) {
- optimize();
+ optimize(builder);
}
} finally {
mReadWriteLock.writeLock().unlock();
@@ -2201,13 +2228,18 @@
}
/** Triggers {@link IcingSearchEngine#optimize()} directly. */
- public void optimize() throws AppSearchException {
+ public void optimize(@Nullable OptimizeStats.Builder builder) throws AppSearchException {
mReadWriteLock.writeLock().lock();
try {
mLogUtil.piiTrace("optimize, request");
OptimizeResultProto optimizeResultProto = mIcingSearchEngineLocked.optimize();
mLogUtil.piiTrace(
"optimize, response", optimizeResultProto.getStatus(), optimizeResultProto);
+ if (builder != null) {
+ builder.setStatusCode(statusProtoToResultCode(optimizeResultProto.getStatus()));
+ AppSearchLoggerHelper.copyNativeStats(
+ optimizeResultProto.getOptimizeStats(), builder);
+ }
checkSuccess(optimizeResultProto.getStatus());
} finally {
mReadWriteLock.writeLock().unlock();
diff --git a/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/AppSearchLogger.java b/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/AppSearchLogger.java
index d92f4f0..98cedc7 100644
--- a/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/AppSearchLogger.java
+++ b/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/AppSearchLogger.java
@@ -17,10 +17,10 @@
package com.android.server.appsearch.external.localstorage;
import android.annotation.NonNull;
-import android.app.appsearch.exceptions.AppSearchException;
import com.android.server.appsearch.external.localstorage.stats.CallStats;
import com.android.server.appsearch.external.localstorage.stats.InitializeStats;
+import com.android.server.appsearch.external.localstorage.stats.OptimizeStats;
import com.android.server.appsearch.external.localstorage.stats.PutDocumentStats;
import com.android.server.appsearch.external.localstorage.stats.RemoveStats;
import com.android.server.appsearch.external.localstorage.stats.SearchStats;
@@ -37,19 +37,22 @@
*/
public interface AppSearchLogger {
/** Logs {@link CallStats} */
- void logStats(@NonNull CallStats stats) throws AppSearchException;
+ void logStats(@NonNull CallStats stats);
/** Logs {@link PutDocumentStats} */
- void logStats(@NonNull PutDocumentStats stats) throws AppSearchException;
+ void logStats(@NonNull PutDocumentStats stats);
/** Logs {@link InitializeStats} */
- void logStats(@NonNull InitializeStats stats) throws AppSearchException;
+ void logStats(@NonNull InitializeStats stats);
/** Logs {@link SearchStats} */
- void logStats(@NonNull SearchStats stats) throws AppSearchException;
+ void logStats(@NonNull SearchStats stats);
/** Logs {@link RemoveStats} */
- void logStats(@NonNull RemoveStats stats) throws AppSearchException;
+ void logStats(@NonNull RemoveStats stats);
+
+ /** Logs {@link OptimizeStats} */
+ void logStats(@NonNull OptimizeStats stats);
// TODO(b/173532925) Add remaining logStats once we add all the stats.
}
diff --git a/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/AppSearchLoggerHelper.java b/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/AppSearchLoggerHelper.java
index aa9200a..cd653e5 100644
--- a/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/AppSearchLoggerHelper.java
+++ b/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/AppSearchLoggerHelper.java
@@ -19,12 +19,14 @@
import android.annotation.NonNull;
import com.android.server.appsearch.external.localstorage.stats.InitializeStats;
+import com.android.server.appsearch.external.localstorage.stats.OptimizeStats;
import com.android.server.appsearch.external.localstorage.stats.PutDocumentStats;
import com.android.server.appsearch.external.localstorage.stats.RemoveStats;
import com.android.server.appsearch.external.localstorage.stats.SearchStats;
import com.google.android.icing.proto.DeleteStatsProto;
import com.google.android.icing.proto.InitializeStatsProto;
+import com.google.android.icing.proto.OptimizeStatsProto;
import com.google.android.icing.proto.PutDocumentStatsProto;
import com.google.android.icing.proto.QueryStatsProto;
@@ -92,8 +94,8 @@
.setSchemaTypeCount(fromNativeStats.getNumSchemaTypes());
}
- /*
- * Copy native Query stats to buiilder.
+ /**
+ * Copies native Query stats to builder.
*
* @param fromNativeStats Stats copied from.
* @param toStatsBuilder Stats copied to.
@@ -122,8 +124,8 @@
fromNativeStats.getDocumentRetrievalLatencyMs());
}
- /*
- * Copy native Query stats to buiilder.
+ /**
+ * Copies native Delete stats to builder.
*
* @param fromNativeStats Stats copied from.
* @param toStatsBuilder Stats copied to.
@@ -138,4 +140,28 @@
.setDeleteType(fromNativeStats.getDeleteType().getNumber())
.setDeletedDocumentCount(fromNativeStats.getNumDocumentsDeleted());
}
+
+ /**
+ * Copies native {@link OptimizeStatsProto} to builder.
+ *
+ * @param fromNativeStats Stats copied from.
+ * @param toStatsBuilder Stats copied to.
+ */
+ static void copyNativeStats(
+ @NonNull OptimizeStatsProto fromNativeStats,
+ @NonNull OptimizeStats.Builder toStatsBuilder) {
+ Objects.requireNonNull(fromNativeStats);
+ Objects.requireNonNull(toStatsBuilder);
+ toStatsBuilder
+ .setNativeLatencyMillis(fromNativeStats.getLatencyMs())
+ .setDocumentStoreOptimizeLatencyMillis(
+ fromNativeStats.getDocumentStoreOptimizeLatencyMs())
+ .setIndexRestorationLatencyMillis(fromNativeStats.getIndexRestorationLatencyMs())
+ .setOriginalDocumentCount(fromNativeStats.getNumOriginalDocuments())
+ .setDeletedDocumentCount(fromNativeStats.getNumDeletedDocuments())
+ .setExpiredDocumentCount(fromNativeStats.getNumExpiredDocuments())
+ .setStorageSizeBeforeBytes(fromNativeStats.getStorageSizeBefore())
+ .setStorageSizeAfterBytes(fromNativeStats.getStorageSizeAfter())
+ .setTimeSinceLastOptimizeMillis(fromNativeStats.getTimeSinceLastOptimizeMs());
+ }
}
diff --git a/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/stats/OptimizeStats.java b/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/stats/OptimizeStats.java
new file mode 100644
index 0000000..83bd50f
--- /dev/null
+++ b/apex/appsearch/service/java/com/android/server/appsearch/external/localstorage/stats/OptimizeStats.java
@@ -0,0 +1,243 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.appsearch.external.localstorage.stats;
+
+import android.annotation.NonNull;
+import android.app.appsearch.AppSearchResult;
+
+import java.util.Objects;
+
+/**
+ * Class holds detailed stats for Optimize.
+ *
+ * @hide
+ */
+public final class OptimizeStats {
+ /**
+ * The status code returned by {@link AppSearchResult#getResultCode()} for the call or internal
+ * state.
+ */
+ @AppSearchResult.ResultCode private final int mStatusCode;
+
+ private final int mTotalLatencyMillis;
+ private final int mNativeLatencyMillis;
+
+ // Time used to optimize the document store in millis.
+ private final int mNativeDocumentStoreOptimizeLatencyMillis;
+
+ // Time used to restore the index in millis.
+ private final int mNativeIndexRestorationLatencyMillis;
+
+ // Number of documents before the optimization.
+ private final int mNativeOriginalDocumentCount;
+
+ // Number of documents deleted during the optimization.
+ private final int mNativeDeletedDocumentCount;
+
+ // Number of documents expired during the optimization.
+ private final int mNativeExpiredDocumentCount;
+
+ // Size of storage in bytes before the optimization.
+ private final long mNativeStorageSizeBeforeBytes;
+
+ // Size of storage in bytes after the optimization.
+ private final long mNativeStorageSizeAfterBytes;
+
+ // The amount of time in millis since the last optimization ran calculated using wall clock time
+ private final long mNativeTimeSinceLastOptimizeMillis;
+
+ OptimizeStats(@NonNull Builder builder) {
+ Objects.requireNonNull(builder);
+ mStatusCode = builder.mStatusCode;
+ mTotalLatencyMillis = builder.mTotalLatencyMillis;
+ mNativeLatencyMillis = builder.mNativeLatencyMillis;
+ mNativeDocumentStoreOptimizeLatencyMillis =
+ builder.mNativeDocumentStoreOptimizeLatencyMillis;
+ mNativeIndexRestorationLatencyMillis = builder.mNativeIndexRestorationLatencyMillis;
+ mNativeOriginalDocumentCount = builder.mNativeOriginalDocumentCount;
+ mNativeDeletedDocumentCount = builder.mNativeDeletedDocumentCount;
+ mNativeExpiredDocumentCount = builder.mNativeExpiredDocumentCount;
+ mNativeStorageSizeBeforeBytes = builder.mNativeStorageSizeBeforeBytes;
+ mNativeStorageSizeAfterBytes = builder.mNativeStorageSizeAfterBytes;
+ mNativeTimeSinceLastOptimizeMillis = builder.mNativeTimeSinceLastOptimizeMillis;
+ }
+
+ /** Returns status code for this optimization. */
+ @AppSearchResult.ResultCode
+ public int getStatusCode() {
+ return mStatusCode;
+ }
+
+ /** Returns total latency of this optimization in millis. */
+ public int getTotalLatencyMillis() {
+ return mTotalLatencyMillis;
+ }
+
+ /** Returns how much time in millis spent in the native code. */
+ public int getNativeLatencyMillis() {
+ return mNativeLatencyMillis;
+ }
+
+ /** Returns time used to optimize the document store in millis. */
+ public int getDocumentStoreOptimizeLatencyMillis() {
+ return mNativeDocumentStoreOptimizeLatencyMillis;
+ }
+
+ /** Returns time used to restore the index in millis. */
+ public int getIndexRestorationLatencyMillis() {
+ return mNativeIndexRestorationLatencyMillis;
+ }
+
+ /** Returns number of documents before the optimization. */
+ public int getOriginalDocumentCount() {
+ return mNativeOriginalDocumentCount;
+ }
+
+ /** Returns number of documents deleted during the optimization. */
+ public int getDeletedDocumentCount() {
+ return mNativeDeletedDocumentCount;
+ }
+
+ /** Returns number of documents expired during the optimization. */
+ public int getExpiredDocumentCount() {
+ return mNativeExpiredDocumentCount;
+ }
+
+ /** Returns size of storage in bytes before the optimization. */
+ public long getStorageSizeBeforeBytes() {
+ return mNativeStorageSizeBeforeBytes;
+ }
+
+ /** Returns size of storage in bytes after the optimization. */
+ public long getStorageSizeAfterBytes() {
+ return mNativeStorageSizeAfterBytes;
+ }
+
+ /**
+ * Returns the amount of time in millis since the last optimization ran calculated using wall
+ * clock time.
+ */
+ public long getTimeSinceLastOptimizeMillis() {
+ return mNativeTimeSinceLastOptimizeMillis;
+ }
+
+ /** Builder for {@link RemoveStats}. */
+ public static class Builder {
+ /**
+ * The status code returned by {@link AppSearchResult#getResultCode()} for the call or
+ * internal state.
+ */
+ @AppSearchResult.ResultCode int mStatusCode;
+
+ int mTotalLatencyMillis;
+ int mNativeLatencyMillis;
+ int mNativeDocumentStoreOptimizeLatencyMillis;
+ int mNativeIndexRestorationLatencyMillis;
+ int mNativeOriginalDocumentCount;
+ int mNativeDeletedDocumentCount;
+ int mNativeExpiredDocumentCount;
+ long mNativeStorageSizeBeforeBytes;
+ long mNativeStorageSizeAfterBytes;
+ long mNativeTimeSinceLastOptimizeMillis;
+
+ /** Sets the status code. */
+ @NonNull
+ public Builder setStatusCode(@AppSearchResult.ResultCode int statusCode) {
+ mStatusCode = statusCode;
+ return this;
+ }
+
+ /** Sets total latency in millis. */
+ @NonNull
+ public Builder setTotalLatencyMillis(int totalLatencyMillis) {
+ mTotalLatencyMillis = totalLatencyMillis;
+ return this;
+ }
+
+ /** Sets native latency in millis. */
+ @NonNull
+ public Builder setNativeLatencyMillis(int nativeLatencyMillis) {
+ mNativeLatencyMillis = nativeLatencyMillis;
+ return this;
+ }
+
+ /** Sets time used to optimize the document store. */
+ @NonNull
+ public Builder setDocumentStoreOptimizeLatencyMillis(
+ int documentStoreOptimizeLatencyMillis) {
+ mNativeDocumentStoreOptimizeLatencyMillis = documentStoreOptimizeLatencyMillis;
+ return this;
+ }
+
+ /** Sets time used to restore the index. */
+ @NonNull
+ public Builder setIndexRestorationLatencyMillis(int indexRestorationLatencyMillis) {
+ mNativeIndexRestorationLatencyMillis = indexRestorationLatencyMillis;
+ return this;
+ }
+
+ /** Sets number of documents before the optimization. */
+ @NonNull
+ public Builder setOriginalDocumentCount(int originalDocumentCount) {
+ mNativeOriginalDocumentCount = originalDocumentCount;
+ return this;
+ }
+
+ /** Sets number of documents deleted during the optimization. */
+ @NonNull
+ public Builder setDeletedDocumentCount(int deletedDocumentCount) {
+ mNativeDeletedDocumentCount = deletedDocumentCount;
+ return this;
+ }
+
+ /** Sets number of documents expired during the optimization. */
+ @NonNull
+ public Builder setExpiredDocumentCount(int expiredDocumentCount) {
+ mNativeExpiredDocumentCount = expiredDocumentCount;
+ return this;
+ }
+
+ /** Sets Storage size in bytes before optimization. */
+ @NonNull
+ public Builder setStorageSizeBeforeBytes(long storageSizeBeforeBytes) {
+ mNativeStorageSizeBeforeBytes = storageSizeBeforeBytes;
+ return this;
+ }
+
+ /** Sets storage size in bytes after optimization. */
+ @NonNull
+ public Builder setStorageSizeAfterBytes(long storageSizeAfterBytes) {
+ mNativeStorageSizeAfterBytes = storageSizeAfterBytes;
+ return this;
+ }
+
+ /**
+ * Sets the amount the time since the last optimize ran calculated using wall clock time.
+ */
+ @NonNull
+ public Builder setTimeSinceLastOptimizeMillis(long timeSinceLastOptimizeMillis) {
+ mNativeTimeSinceLastOptimizeMillis = timeSinceLastOptimizeMillis;
+ return this;
+ }
+
+ /** Creates a {@link OptimizeStats}. */
+ @NonNull
+ public OptimizeStats build() {
+ return new OptimizeStats(/* builder= */ this);
+ }
+ }
+}
diff --git a/apex/appsearch/service/java/com/android/server/appsearch/stats/PlatformLogger.java b/apex/appsearch/service/java/com/android/server/appsearch/stats/PlatformLogger.java
index 2cbce10..fdf6a00 100644
--- a/apex/appsearch/service/java/com/android/server/appsearch/stats/PlatformLogger.java
+++ b/apex/appsearch/service/java/com/android/server/appsearch/stats/PlatformLogger.java
@@ -32,6 +32,7 @@
import com.android.server.appsearch.external.localstorage.AppSearchLogger;
import com.android.server.appsearch.external.localstorage.stats.CallStats;
import com.android.server.appsearch.external.localstorage.stats.InitializeStats;
+import com.android.server.appsearch.external.localstorage.stats.OptimizeStats;
import com.android.server.appsearch.external.localstorage.stats.PutDocumentStats;
import com.android.server.appsearch.external.localstorage.stats.RemoveStats;
import com.android.server.appsearch.external.localstorage.stats.SearchStats;
@@ -145,7 +146,7 @@
}
@Override
- public void logStats(@NonNull InitializeStats stats) throws AppSearchException {
+ public void logStats(@NonNull InitializeStats stats) {
Objects.requireNonNull(stats);
synchronized (mLock) {
if (shouldLogForTypeLocked(CallStats.CALL_TYPE_INITIALIZE)) {
@@ -155,7 +156,7 @@
}
@Override
- public void logStats(@NonNull SearchStats stats) throws AppSearchException {
+ public void logStats(@NonNull SearchStats stats) {
Objects.requireNonNull(stats);
synchronized (mLock) {
if (shouldLogForTypeLocked(CallStats.CALL_TYPE_SEARCH)) {
@@ -165,10 +166,20 @@
}
@Override
- public void logStats(@NonNull RemoveStats stats) throws AppSearchException {
+ public void logStats(@NonNull RemoveStats stats) {
// TODO(b/173532925): Log stats
}
+ @Override
+ public void logStats(@NonNull OptimizeStats stats) {
+ Objects.requireNonNull(stats);
+ synchronized (mLock) {
+ if (shouldLogForTypeLocked(CallStats.CALL_TYPE_OPTIMIZE)) {
+ logStatsImplLocked(stats);
+ }
+ }
+ }
+
/**
* Removes cached UID for package.
*
@@ -326,6 +337,27 @@
stats.getResetStatusCode());
}
+ @GuardedBy("mLock")
+ private void logStatsImplLocked(@NonNull OptimizeStats stats) {
+ mLastPushTimeMillisLocked = SystemClock.elapsedRealtime();
+ ExtraStats extraStats = createExtraStatsLocked(/*packageName=*/ null,
+ CallStats.CALL_TYPE_OPTIMIZE);
+ AppSearchStatsLog.write(AppSearchStatsLog.APP_SEARCH_OPTIMIZE_STATS_REPORTED,
+ extraStats.mSamplingInterval,
+ extraStats.mSkippedSampleCount,
+ stats.getStatusCode(),
+ stats.getTotalLatencyMillis(),
+ stats.getNativeLatencyMillis(),
+ stats.getDocumentStoreOptimizeLatencyMillis(),
+ stats.getIndexRestorationLatencyMillis(),
+ stats.getOriginalDocumentCount(),
+ stats.getDeletedDocumentCount(),
+ stats.getExpiredDocumentCount(),
+ stats.getStorageSizeBeforeBytes(),
+ stats.getStorageSizeAfterBytes(),
+ stats.getTimeSinceLastOptimizeMillis());
+ }
+
/**
* Calculate the hash code as an integer by returning the last four bytes of its MD5.
*
@@ -464,15 +496,19 @@
return mConfig.getCachedSamplingIntervalForBatchCallStats();
case CallStats.CALL_TYPE_PUT_DOCUMENT:
return mConfig.getCachedSamplingIntervalForPutDocumentStats();
- case CallStats.CALL_TYPE_UNKNOWN:
case CallStats.CALL_TYPE_INITIALIZE:
+ return mConfig.getCachedSamplingIntervalForInitializeStats();
+ case CallStats.CALL_TYPE_SEARCH:
+ return mConfig.getCachedSamplingIntervalForSearchStats();
+ case CallStats.CALL_TYPE_GLOBAL_SEARCH:
+ return mConfig.getCachedSamplingIntervalForGlobalSearchStats();
+ case CallStats.CALL_TYPE_OPTIMIZE:
+ return mConfig.getCachedSamplingIntervalForOptimizeStats();
+ case CallStats.CALL_TYPE_UNKNOWN:
case CallStats.CALL_TYPE_SET_SCHEMA:
case CallStats.CALL_TYPE_GET_DOCUMENT:
case CallStats.CALL_TYPE_REMOVE_DOCUMENT_BY_ID:
- case CallStats.CALL_TYPE_SEARCH:
- case CallStats.CALL_TYPE_OPTIMIZE:
case CallStats.CALL_TYPE_FLUSH:
- case CallStats.CALL_TYPE_GLOBAL_SEARCH:
case CallStats.CALL_TYPE_REMOVE_DOCUMENT_BY_SEARCH:
// TODO(b/173532925) Some of them above will have dedicated sampling ratio config
default:
diff --git a/apex/appsearch/synced_jetpack_changeid.txt b/apex/appsearch/synced_jetpack_changeid.txt
index 6555107..a81d7d80 100644
--- a/apex/appsearch/synced_jetpack_changeid.txt
+++ b/apex/appsearch/synced_jetpack_changeid.txt
@@ -1 +1 @@
-c7387d9b58726a23a0608a9365fb3a1b57b7b8a1
+Ie04f1ecc033faae8085afcb51eb9e40a298998d5
diff --git a/apex/jobscheduler/framework/java/android/app/tare/IEconomyManager.aidl b/apex/jobscheduler/framework/java/android/app/tare/IEconomyManager.aidl
new file mode 100644
index 0000000..bb15011
--- /dev/null
+++ b/apex/jobscheduler/framework/java/android/app/tare/IEconomyManager.aidl
@@ -0,0 +1,24 @@
+/**
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.app.tare;
+
+ /**
+ * IPC interface that supports the app-facing {@link #EconomyManager} api.
+ * {@hide}
+ */
+interface IEconomyManager {
+}
diff --git a/apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java b/apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java
index 98e963e..86fa06c 100644
--- a/apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java
+++ b/apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java
@@ -2052,10 +2052,11 @@
+ " -- package not allowed to start");
return;
}
+ final int callerProcState = mActivityManagerInternal.getUidProcessState(callingUid);
removeLocked(operation, directReceiver, REMOVE_REASON_UNDEFINED);
incrementAlarmCount(a.uid);
setImplLocked(a);
- MetricsHelper.pushAlarmScheduled(a);
+ MetricsHelper.pushAlarmScheduled(a, callerProcState);
}
/**
diff --git a/apex/jobscheduler/service/java/com/android/server/alarm/MetricsHelper.java b/apex/jobscheduler/service/java/com/android/server/alarm/MetricsHelper.java
index 4e7311f..4c2f8d1 100644
--- a/apex/jobscheduler/service/java/com/android/server/alarm/MetricsHelper.java
+++ b/apex/jobscheduler/service/java/com/android/server/alarm/MetricsHelper.java
@@ -22,6 +22,7 @@
import static com.android.internal.util.FrameworkStatsLog.ALARM_SCHEDULED__EXACT_ALARM_ALLOWED_REASON__PERMISSION;
import static com.android.server.alarm.AlarmManagerService.INDEFINITE_DELAY;
+import android.app.ActivityManager;
import android.app.AlarmManager;
import android.app.StatsManager;
import android.content.Context;
@@ -93,7 +94,7 @@
}
}
- static void pushAlarmScheduled(Alarm a) {
+ static void pushAlarmScheduled(Alarm a, int callerProcState) {
FrameworkStatsLog.write(
FrameworkStatsLog.ALARM_SCHEDULED,
a.uid,
@@ -103,7 +104,8 @@
a.alarmClock != null,
a.repeatInterval != 0,
reasonToStatsReason(a.mExactAllowReason),
- AlarmManagerService.isRtc(a.type));
+ AlarmManagerService.isRtc(a.type),
+ ActivityManager.processStateAmToProto(callerProcState));
}
static void pushAlarmBatchDelivered(int numAlarms, int wakeups) {
diff --git a/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java b/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java
index 2ebd1ad..986b2d9 100644
--- a/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java
+++ b/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java
@@ -116,6 +116,16 @@
@VisibleForTesting
int mVerb;
private boolean mCancelled;
+ /**
+ * True if the previous job on this context successfully finished (ie. called jobFinished or
+ * dequeueWork with no work left).
+ */
+ private boolean mPreviousJobHadSuccessfulFinish;
+ /**
+ * The last time a job on this context didn't finish successfully, in the elapsed realtime
+ * timebase.
+ */
+ private long mLastUnsuccessfulFinishElapsed;
/**
* All the information maintained about the job currently being executed.
@@ -447,7 +457,9 @@
final long ident = Binder.clearCallingIdentity();
try {
synchronized (mLock) {
- assertCallerLocked(cb);
+ if (!assertCallerLocked(cb)) {
+ return null;
+ }
if (mVerb == VERB_STOPPING || mVerb == VERB_FINISHED) {
// This job is either all done, or on its way out. Either way, it
// should not dispatch any more work. We will pick up any remaining
@@ -473,7 +485,11 @@
final long ident = Binder.clearCallingIdentity();
try {
synchronized (mLock) {
- assertCallerLocked(cb);
+ if (!assertCallerLocked(cb)) {
+ // Return true instead of false here so we don't just kick the
+ // Exception-throwing-can down the road to JobParameters.completeWork >:(
+ return true;
+ }
return mRunningJob.completeWorkLocked(workId);
}
} finally {
@@ -530,18 +546,34 @@
return true;
}
- private void assertCallerLocked(JobCallback cb) {
+ /**
+ * Will throw a {@link SecurityException} if the callback is not for the currently running job,
+ * but may decide not to throw an exception if the call from the previous job appears to be an
+ * accident.
+ *
+ * @return true if the callback is for the current job, false otherwise
+ */
+ private boolean assertCallerLocked(JobCallback cb) {
if (!verifyCallerLocked(cb)) {
+ final long nowElapsed = sElapsedRealtimeClock.millis();
+ if (!mPreviousJobHadSuccessfulFinish
+ && (nowElapsed - mLastUnsuccessfulFinishElapsed) < 15_000L) {
+ // Don't punish apps for race conditions
+ return false;
+ }
+ // It's been long enough that the app should really not be calling into JS for the
+ // stopped job.
StringBuilder sb = new StringBuilder(128);
sb.append("Caller no longer running");
if (cb.mStoppedReason != null) {
sb.append(", last stopped ");
- TimeUtils.formatDuration(sElapsedRealtimeClock.millis() - cb.mStoppedTime, sb);
+ TimeUtils.formatDuration(nowElapsed - cb.mStoppedTime, sb);
sb.append(" because: ");
sb.append(cb.mStoppedReason);
}
throw new SecurityException(sb.toString());
}
+ return true;
}
/**
@@ -887,6 +919,11 @@
applyStoppedReasonLocked(reason);
completedJob = mRunningJob;
final int internalStopReason = mParams.getInternalStopReasonCode();
+ mPreviousJobHadSuccessfulFinish =
+ (internalStopReason == JobParameters.INTERNAL_STOP_REASON_SUCCESSFUL_FINISH);
+ if (!mPreviousJobHadSuccessfulFinish) {
+ mLastUnsuccessfulFinishElapsed = sElapsedRealtimeClock.millis();
+ }
mJobPackageTracker.noteInactive(completedJob, internalStopReason, reason);
FrameworkStatsLog.write_non_chained(FrameworkStatsLog.SCHEDULED_JOB_STATE_CHANGED,
completedJob.getSourceUid(), null, completedJob.getBatteryName(),
diff --git a/apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java b/apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java
index fda57f7..76836e4 100644
--- a/apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java
+++ b/apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java
@@ -92,7 +92,6 @@
static final int CONSTRAINT_CONTENT_TRIGGER = 1<<26;
static final int CONSTRAINT_DEVICE_NOT_DOZING = 1 << 25; // Implicit constraint
static final int CONSTRAINT_WITHIN_QUOTA = 1 << 24; // Implicit constraint
- static final int CONSTRAINT_WITHIN_EXPEDITED_QUOTA = 1 << 23; // Implicit constraint
static final int CONSTRAINT_BACKGROUND_NOT_RESTRICTED = 1 << 22; // Implicit constraint
// The following set of dynamic constraints are for specific use cases (as explained in their
@@ -148,8 +147,7 @@
| CONSTRAINT_DEADLINE
| CONSTRAINT_IDLE
| CONSTRAINT_TIMING_DELAY
- | CONSTRAINT_WITHIN_QUOTA
- | CONSTRAINT_WITHIN_EXPEDITED_QUOTA;
+ | CONSTRAINT_WITHIN_QUOTA;
// TODO(b/129954980)
private static final boolean STATS_LOG_ENABLED = false;
@@ -393,6 +391,11 @@
private long mTotalNetworkUploadBytes = JobInfo.NETWORK_BYTES_UNKNOWN;
private long mMinimumNetworkChunkBytes = JobInfo.NETWORK_BYTES_UNKNOWN;
+ /**
+ * Whether or not this job is approved to be treated as expedited per quota policy.
+ */
+ private boolean mExpeditedQuotaApproved;
+
/////// Booleans that track if a job is ready to run. They should be updated whenever dependent
/////// states change.
@@ -418,9 +421,6 @@
/** The job is within its quota based on its standby bucket. */
private boolean mReadyWithinQuota;
- /** The job is an expedited job with sufficient quota to run as an expedited job. */
- private boolean mReadyWithinExpeditedQuota;
-
/** The job's dynamic requirements have been satisfied. */
private boolean mReadyDynamicSatisfied;
@@ -1132,7 +1132,7 @@
* treated as an expedited job.
*/
public boolean shouldTreatAsExpeditedJob() {
- return mReadyWithinExpeditedQuota && isRequestedExpeditedJob();
+ return mExpeditedQuotaApproved && isRequestedExpeditedJob();
}
/**
@@ -1230,19 +1230,27 @@
return false;
}
- /** @return true if the constraint was changed, false otherwise. */
- boolean setExpeditedJobQuotaConstraintSatisfied(final long nowElapsed, boolean state) {
- if (setConstraintSatisfied(CONSTRAINT_WITHIN_EXPEDITED_QUOTA, nowElapsed, state)) {
- // The constraint was changed. Update the ready flag.
- mReadyWithinExpeditedQuota = state;
- // DeviceIdleJobsController currently only tracks jobs with the WILL_BE_FOREGROUND flag.
- // Making it also track requested-expedited jobs would add unnecessary hops since the
- // controller would then defer to canRunInDoze. Avoid the hops and just update
- // mReadyNotDozing directly.
- mReadyNotDozing = isConstraintSatisfied(CONSTRAINT_DEVICE_NOT_DOZING) || canRunInDoze();
- return true;
+ /**
+ * Sets whether or not this job is approved to be treated as an expedited job based on quota
+ * policy.
+ *
+ * @return true if the approval bit was changed, false otherwise.
+ */
+ boolean setExpeditedJobQuotaApproved(final long nowElapsed, boolean state) {
+ if (mExpeditedQuotaApproved == state) {
+ return false;
}
- return false;
+ mExpeditedQuotaApproved = state;
+ updateExpeditedDependencies();
+ return true;
+ }
+
+ private void updateExpeditedDependencies() {
+ // DeviceIdleJobsController currently only tracks jobs with the WILL_BE_FOREGROUND flag.
+ // Making it also track requested-expedited jobs would add unnecessary hops since the
+ // controller would then defer to canRunInDoze. Avoid the hops and just update
+ // mReadyNotDozing directly.
+ mReadyNotDozing = isConstraintSatisfied(CONSTRAINT_DEVICE_NOT_DOZING) || canRunInDoze();
}
/** @return true if the state was changed, false otherwise. */
@@ -1346,7 +1354,6 @@
return JobParameters.STOP_REASON_DEVICE_STATE;
case CONSTRAINT_WITHIN_QUOTA:
- case CONSTRAINT_WITHIN_EXPEDITED_QUOTA:
return JobParameters.STOP_REASON_QUOTA;
// These should never be stop reasons since they can never go from true to false.
@@ -1363,6 +1370,10 @@
return (satisfiedConstraints&constraint) != 0;
}
+ boolean isExpeditedQuotaApproved() {
+ return mExpeditedQuotaApproved;
+ }
+
boolean clearTrackingController(int which) {
if ((trackingControllers&which) != 0) {
trackingControllers &= ~which;
@@ -1465,10 +1476,6 @@
oldValue = mReadyWithinQuota;
mReadyWithinQuota = value;
break;
- case CONSTRAINT_WITHIN_EXPEDITED_QUOTA:
- oldValue = mReadyWithinExpeditedQuota;
- mReadyWithinExpeditedQuota = value;
- break;
default:
if (value) {
satisfied |= constraint;
@@ -1496,9 +1503,6 @@
case CONSTRAINT_WITHIN_QUOTA:
mReadyWithinQuota = oldValue;
break;
- case CONSTRAINT_WITHIN_EXPEDITED_QUOTA:
- mReadyWithinExpeditedQuota = oldValue;
- break;
default:
mReadyDynamicSatisfied = mDynamicConstraints != 0
&& mDynamicConstraints == (satisfiedConstraints & mDynamicConstraints);
@@ -1726,9 +1730,6 @@
if ((constraints & CONSTRAINT_WITHIN_QUOTA) != 0) {
pw.print(" WITHIN_QUOTA");
}
- if ((constraints & CONSTRAINT_WITHIN_EXPEDITED_QUOTA) != 0) {
- pw.print(" WITHIN_EXPEDITED_QUOTA");
- }
if (constraints != 0) {
pw.print(" [0x");
pw.print(Integer.toHexString(constraints));
@@ -1801,9 +1802,6 @@
if ((constraints & CONSTRAINT_BACKGROUND_NOT_RESTRICTED) != 0) {
proto.write(fieldId, JobServerProtoEnums.CONSTRAINT_BACKGROUND_NOT_RESTRICTED);
}
- if ((constraints & CONSTRAINT_WITHIN_EXPEDITED_QUOTA) != 0) {
- proto.write(fieldId, JobServerProtoEnums.CONSTRAINT_WITHIN_EXPEDITED_JOB_QUOTA);
- }
}
private void dumpJobWorkItem(IndentingPrintWriter pw, JobWorkItem work, int index) {
@@ -2050,8 +2048,8 @@
pw.print("readyComponentEnabled: ");
pw.println(serviceInfo != null);
if ((getFlags() & JobInfo.FLAG_EXPEDITED) != 0) {
- pw.print("readyWithinExpeditedQuota: ");
- pw.print(mReadyWithinExpeditedQuota);
+ pw.print("expeditedQuotaApproved: ");
+ pw.print(mExpeditedQuotaApproved);
pw.print(" (started as EJ: ");
pw.print(startedAsExpeditedJob);
pw.println(")");
diff --git a/apex/jobscheduler/service/java/com/android/server/job/controllers/QuotaController.java b/apex/jobscheduler/service/java/com/android/server/job/controllers/QuotaController.java
index f7181a4..36afac8 100644
--- a/apex/jobscheduler/service/java/com/android/server/job/controllers/QuotaController.java
+++ b/apex/jobscheduler/service/java/com/android/server/job/controllers/QuotaController.java
@@ -634,11 +634,12 @@
jobs.add(jobStatus);
jobStatus.setTrackingController(JobStatus.TRACKING_QUOTA);
final boolean isWithinQuota = isWithinQuotaLocked(jobStatus);
- setConstraintSatisfied(jobStatus, nowElapsed, isWithinQuota);
+ final boolean isWithinEJQuota =
+ jobStatus.isRequestedExpeditedJob() && isWithinEJQuotaLocked(jobStatus);
+ setConstraintSatisfied(jobStatus, nowElapsed, isWithinQuota || isWithinEJQuota);
final boolean outOfEJQuota;
if (jobStatus.isRequestedExpeditedJob()) {
- final boolean isWithinEJQuota = isWithinEJQuotaLocked(jobStatus);
- setExpeditedConstraintSatisfied(jobStatus, nowElapsed, isWithinEJQuota);
+ setExpeditedQuotaApproved(jobStatus, nowElapsed, isWithinEJQuota);
outOfEJQuota = !isWithinEJQuota;
} else {
outOfEJQuota = false;
@@ -1614,6 +1615,8 @@
boolean changed = false;
for (int i = jobs.size() - 1; i >= 0; --i) {
final JobStatus js = jobs.valueAt(i);
+ final boolean isWithinEJQuota =
+ js.isRequestedExpeditedJob() && isWithinEJQuotaLocked(js);
if (isTopStartedJobLocked(js)) {
// Job was started while the app was in the TOP state so we should allow it to
// finish.
@@ -1623,15 +1626,15 @@
// An app in the ACTIVE bucket may be out of quota while the job could be in quota
// for some reason. Therefore, avoid setting the real value here and check each job
// individually.
- changed |= setConstraintSatisfied(js, nowElapsed, realInQuota);
+ changed |= setConstraintSatisfied(js, nowElapsed, isWithinEJQuota || realInQuota);
} else {
// This job is somehow exempted. Need to determine its own quota status.
- changed |= setConstraintSatisfied(js, nowElapsed, isWithinQuotaLocked(js));
+ changed |= setConstraintSatisfied(js, nowElapsed,
+ isWithinEJQuota || isWithinQuotaLocked(js));
}
if (js.isRequestedExpeditedJob()) {
- boolean isWithinEJQuota = isWithinEJQuotaLocked(js);
- changed |= setExpeditedConstraintSatisfied(js, nowElapsed, isWithinEJQuota);
+ changed |= setExpeditedQuotaApproved(js, nowElapsed, isWithinEJQuota);
outOfEJQuota |= !isWithinEJQuota;
}
}
@@ -1659,26 +1662,24 @@
@Override
public void accept(JobStatus jobStatus) {
- if (setConstraintSatisfied(
- jobStatus, mUpdateTimeElapsed, isWithinQuotaLocked(jobStatus))) {
+ final boolean isWithinEJQuota;
+ if (jobStatus.isRequestedExpeditedJob()) {
+ isWithinEJQuota = isWithinEJQuotaLocked(jobStatus);
+ } else {
+ isWithinEJQuota = false;
+ }
+ if (setConstraintSatisfied(jobStatus, mUpdateTimeElapsed,
+ isWithinEJQuota || isWithinQuotaLocked(jobStatus))) {
changedJobs.add(jobStatus);
}
- final boolean outOfEJQuota;
- if (jobStatus.isRequestedExpeditedJob()) {
- final boolean isWithinEJQuota = isWithinEJQuotaLocked(jobStatus);
- if (setExpeditedConstraintSatisfied(
- jobStatus, mUpdateTimeElapsed, isWithinEJQuota)) {
- changedJobs.add(jobStatus);
- }
- outOfEJQuota = !isWithinEJQuota;
- } else {
- outOfEJQuota = false;
+ if (setExpeditedQuotaApproved(jobStatus, mUpdateTimeElapsed, isWithinEJQuota)) {
+ changedJobs.add(jobStatus);
}
final int userId = jobStatus.getSourceUserId();
final String packageName = jobStatus.getSourcePackageName();
final int realStandbyBucket = jobStatus.getStandbyBucket();
- if (isWithinQuotaLocked(userId, packageName, realStandbyBucket) && !outOfEJQuota) {
+ if (isWithinQuotaLocked(userId, packageName, realStandbyBucket) && isWithinEJQuota) {
// TODO(141645789): we probably shouldn't cancel the alarm until we've verified
// that all jobs for the userId-package are within quota.
mInQuotaAlarmListener.removeAlarmLocked(userId, packageName);
@@ -1827,9 +1828,9 @@
* If the satisfaction changes, this will tell connectivity & background jobs controller to
* also re-evaluate their state.
*/
- private boolean setExpeditedConstraintSatisfied(@NonNull JobStatus jobStatus, long nowElapsed,
+ private boolean setExpeditedQuotaApproved(@NonNull JobStatus jobStatus, long nowElapsed,
boolean isWithinQuota) {
- if (jobStatus.setExpeditedJobQuotaConstraintSatisfied(nowElapsed, isWithinQuota)) {
+ if (jobStatus.setExpeditedJobQuotaApproved(nowElapsed, isWithinQuota)) {
mBackgroundJobsController.evaluateStateLocked(jobStatus);
mConnectivityController.evaluateStateLocked(jobStatus);
if (isWithinQuota && jobStatus.isReady()) {
@@ -4330,7 +4331,7 @@
js.isRequestedExpeditedJob());
proto.write(
StateControllerProto.QuotaController.TrackedJob.IS_WITHIN_FG_JOB_QUOTA,
- js.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
+ js.isExpeditedQuotaApproved());
proto.end(jsToken);
}
});
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 cfc6645..0bbb802 100644
--- a/apex/jobscheduler/service/java/com/android/server/tare/InternalResourceService.java
+++ b/apex/jobscheduler/service/java/com/android/server/tare/InternalResourceService.java
@@ -22,6 +22,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.AlarmManager;
+import android.app.tare.IEconomyManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -30,6 +31,7 @@
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.BatteryManagerInternal;
+import android.os.Binder;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
@@ -37,14 +39,19 @@
import android.os.SystemClock;
import android.os.UserHandle;
import android.util.ArraySet;
+import android.util.IndentingPrintWriter;
import android.util.Log;
import android.util.Slog;
import android.util.SparseSetArray;
import com.android.internal.annotations.GuardedBy;
+import com.android.internal.util.ArrayUtils;
+import com.android.internal.util.DumpUtils;
import com.android.server.LocalServices;
import com.android.server.SystemService;
+import java.io.FileDescriptor;
+import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
@@ -72,8 +79,9 @@
private final BatteryManagerInternal mBatteryManagerInternal;
private final PackageManager mPackageManager;
- private final CompleteEconomicPolicy mCompleteEconomicPolicy;
private final Agent mAgent;
+ private final CompleteEconomicPolicy mCompleteEconomicPolicy;
+ private final EconomyManagerStub mEconomyManagerStub;
@NonNull
@GuardedBy("mLock")
@@ -173,6 +181,7 @@
mHandler = new IrsHandler(TareHandlerThread.get().getLooper());
mBatteryManagerInternal = LocalServices.getService(BatteryManagerInternal.class);
mPackageManager = context.getPackageManager();
+ mEconomyManagerStub = new EconomyManagerStub();
mCompleteEconomicPolicy = new CompleteEconomicPolicy(this);
mAgent = new Agent(this, mCompleteEconomicPolicy);
@@ -194,7 +203,7 @@
@Override
public void onStart() {
-
+ publishBinderService(Context.RESOURCE_ECONOMY_SERVICE, mEconomyManagerStub);
}
@Override
@@ -428,6 +437,37 @@
}
}
+ /**
+ * Binder stub trampoline implementation
+ */
+ final class EconomyManagerStub extends IEconomyManager.Stub {
+ /**
+ * "dumpsys" infrastructure
+ */
+ @Override
+ public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+ if (!DumpUtils.checkDumpAndUsageStatsPermission(getContext(), TAG, pw)) return;
+
+ if (!ArrayUtils.isEmpty(args)) {
+ String arg = args[0];
+ if ("-h".equals(arg) || "--help".equals(arg)) {
+ dumpHelp(pw);
+ return;
+ } else if (arg.length() > 0 && arg.charAt(0) == '-') {
+ pw.println("Unknown option: " + arg);
+ return;
+ }
+ }
+
+ final long identityToken = Binder.clearCallingIdentity();
+ try {
+ dumpInternal(new IndentingPrintWriter(pw, " "));
+ } finally {
+ Binder.restoreCallingIdentity(identityToken);
+ }
+ }
+ }
+
private final class LocalService implements EconomyManagerInternal {
@Override
public void registerAffordabilityChangeListener(int userId, @NonNull String pkgName,
@@ -490,4 +530,23 @@
}
}
}
+
+ private static void dumpHelp(PrintWriter pw) {
+ pw.println("Resource Economy (economy) dump options:");
+ pw.println(" [-h|--help] [package] ...");
+ pw.println(" -h | --help: print this help");
+ pw.println(" [package] is an optional package name to limit the output to.");
+ }
+
+ private void dumpInternal(final IndentingPrintWriter pw) {
+ synchronized (mLock) {
+ pw.print("Current battery level: ");
+ pw.println(mCurrentBatteryLevel);
+
+ mCompleteEconomicPolicy.dump(pw);
+ pw.println();
+
+ mAgent.dumpLocked(pw);
+ }
+ }
}
diff --git a/core/java/Android.bp b/core/java/Android.bp
index 89d93ae..3a883d8 100644
--- a/core/java/Android.bp
+++ b/core/java/Android.bp
@@ -112,6 +112,8 @@
srcs: [
"android/os/Temperature.aidl",
"android/os/CoolingDevice.aidl",
+ "android/os/IHintManager.aidl",
+ "android/os/IHintSession.aidl",
"android/os/IThermalEventListener.aidl",
"android/os/IThermalStatusListener.aidl",
"android/os/IThermalService.aidl",
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index db5dcc5..eb913dd 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -61,7 +61,6 @@
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
-import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.media.AudioManager;
@@ -126,11 +125,9 @@
import android.view.WindowManager;
import android.view.WindowManagerGlobal;
import android.view.accessibility.AccessibilityEvent;
+import android.view.autofill.AutofillClientController;
import android.view.autofill.AutofillId;
-import android.view.autofill.AutofillManager;
import android.view.autofill.AutofillManager.AutofillClient;
-import android.view.autofill.AutofillPopupWindow;
-import android.view.autofill.IAutofillWindowPresenter;
import android.view.contentcapture.ContentCaptureContext;
import android.view.contentcapture.ContentCaptureManager;
import android.view.contentcapture.ContentCaptureManager.ContentCaptureClient;
@@ -159,7 +156,6 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -740,7 +736,7 @@
Window.Callback, KeyEvent.Callback,
OnCreateContextMenuListener, ComponentCallbacks2,
Window.OnWindowDismissedCallback,
- AutofillManager.AutofillClient, ContentCaptureManager.ContentCaptureClient {
+ ContentCaptureManager.ContentCaptureClient {
private static final String TAG = "Activity";
private static final boolean DEBUG_LIFECYCLE = false;
@@ -766,9 +762,7 @@
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
static final String FRAGMENTS_TAG = "android:fragments";
- private static final String LAST_AUTOFILL_ID = "android:lastAutofillId";
- private static final String AUTOFILL_RESET_NEEDED = "@android:autofillResetNeeded";
private static final String WINDOW_HIERARCHY_TAG = "android:viewHierarchyState";
private static final String SAVED_DIALOG_IDS_KEY = "android:savedDialogIds";
private static final String SAVED_DIALOGS_TAG = "android:savedDialogs";
@@ -778,7 +772,6 @@
"android:hasCurrentPermissionsRequest";
private static final String REQUEST_PERMISSIONS_WHO_PREFIX = "@android:requestPermissions:";
- private static final String AUTO_FILL_AUTH_WHO_PREFIX = "@android:autoFillAuth:";
private static final String KEYBOARD_SHORTCUTS_RECEIVER_PKG_NAME = "com.android.systemui";
private static final int LOG_AM_ON_CREATE_CALLED = 30057;
@@ -851,9 +844,6 @@
private SearchManager mSearchManager;
private MenuInflater mMenuInflater;
- /** The autofill manager. Always access via {@link #getAutofillManager()}. */
- @Nullable private AutofillManager mAutofillManager;
-
/** The content capture manager. Access via {@link #getContentCaptureManager()}. */
@Nullable private ContentCaptureManager mContentCaptureManager;
@@ -953,13 +943,8 @@
private boolean mHasCurrentPermissionsRequest;
- private boolean mAutoFillResetNeeded;
- private boolean mAutoFillIgnoreFirstResumePause;
-
- /** The last autofill id that was returned from {@link #getNextAutofillId()} */
- private int mLastAutofillId = View.LAST_APP_AUTOFILL_ID;
-
- private AutofillPopupWindow mAutofillPopupWindow;
+ /** The autofill client controller. Always access via {@link #getAutofillClientController()}. */
+ private AutofillClientController mAutofillClientController;
/** @hide */
boolean mEnterAnimationComplete;
@@ -1140,19 +1125,6 @@
}
/**
- * (Creates, sets and) returns the autofill manager
- *
- * @return The autofill manager
- */
- @NonNull private AutofillManager getAutofillManager() {
- if (mAutofillManager == null) {
- mAutofillManager = getSystemService(AutofillManager.class);
- }
-
- return mAutofillManager;
- }
-
- /**
* (Creates, sets, and ) returns the content capture manager
*
* @return The content capture manager
@@ -1250,7 +1222,7 @@
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(newBase);
if (newBase != null) {
- newBase.setAutofillClient(this);
+ newBase.setAutofillClient(getAutofillClient());
newBase.setContentCaptureOptions(getContentCaptureOptions());
}
}
@@ -1258,7 +1230,14 @@
/** @hide */
@Override
public final AutofillClient getAutofillClient() {
- return this;
+ return getAutofillClientController();
+ }
+
+ private AutofillClientController getAutofillClientController() {
+ if (mAutofillClientController == null) {
+ mAutofillClientController = new AutofillClientController(this);
+ }
+ return mAutofillClientController;
}
/** @hide */
@@ -1590,14 +1569,9 @@
mActionBar.setDefaultDisplayHomeAsUpEnabled(true);
}
}
- if (savedInstanceState != null) {
- mAutoFillResetNeeded = savedInstanceState.getBoolean(AUTOFILL_RESET_NEEDED, false);
- mLastAutofillId = savedInstanceState.getInt(LAST_AUTOFILL_ID,
- View.LAST_APP_AUTOFILL_ID);
- if (mAutoFillResetNeeded) {
- getAutofillManager().onCreate(savedInstanceState);
- }
+ if (savedInstanceState != null) {
+ getAutofillClientController().onActivityCreated(savedInstanceState);
Parcelable p = savedInstanceState.getParcelable(FRAGMENTS_TAG);
mFragments.restoreAllState(p, mLastNonConfigurationInstances != null
@@ -1877,9 +1851,7 @@
dispatchActivityStarted();
- if (mAutoFillResetNeeded) {
- getAutofillManager().onVisibleForAutofill();
- }
+ getAutofillClientController().onActivityStarted();
}
/**
@@ -1949,22 +1921,7 @@
if (DEBUG_LIFECYCLE) Slog.v(TAG, "onResume " + this);
dispatchActivityResumed();
mActivityTransitionState.onResume(this);
- enableAutofillCompatibilityIfNeeded();
- if (mAutoFillResetNeeded) {
- if (!mAutoFillIgnoreFirstResumePause) {
- View focus = getCurrentFocus();
- if (focus != null && focus.canNotifyAutofillEnterExitEvent()) {
- // TODO(b/148815880): Bring up keyboard if resumed from inline authentication.
- // TODO: in Activity killed/recreated case, i.e. SessionLifecycleTest#
- // testDatasetVisibleWhileAutofilledAppIsLifecycled: the View's initial
- // window visibility after recreation is INVISIBLE in onResume() and next frame
- // ViewRootImpl.performTraversals() changes window visibility to VISIBLE.
- // So we cannot call View.notifyEnterOrExited() which will do nothing
- // when View.isVisibleToUser() is false.
- getAutofillManager().notifyViewEntered(focus);
- }
- }
- }
+ getAutofillClientController().onActivityResumed();
notifyContentCaptureManagerIfNeeded(CONTENT_CAPTURE_RESUME);
@@ -2045,32 +2002,16 @@
}
/**
- * Gets the next autofill ID.
+ * Returns the next autofill ID that is unique in the activity
*
* <p>All IDs will be bigger than {@link View#LAST_APP_AUTOFILL_ID}. All IDs returned
* will be unique.
*
- * @return A ID that is unique in the activity
- *
* {@hide}
*/
@Override
public int getNextAutofillId() {
- if (mLastAutofillId == Integer.MAX_VALUE - 1) {
- mLastAutofillId = View.LAST_APP_AUTOFILL_ID;
- }
-
- mLastAutofillId++;
-
- return mLastAutofillId;
- }
-
- /**
- * @hide
- */
- @Override
- public AutofillId autofillClientGetNextAutofillId() {
- return new AutofillId(getNextAutofillId());
+ return getAutofillClientController().getNextAutofillId();
}
/**
@@ -2273,15 +2214,11 @@
protected void onSaveInstanceState(@NonNull Bundle outState) {
outState.putBundle(WINDOW_HIERARCHY_TAG, mWindow.saveHierarchyState());
- outState.putInt(LAST_AUTOFILL_ID, mLastAutofillId);
Parcelable p = mFragments.saveAllState();
if (p != null) {
outState.putParcelable(FRAGMENTS_TAG, p);
}
- if (mAutoFillResetNeeded) {
- outState.putBoolean(AUTOFILL_RESET_NEEDED, true);
- getAutofillManager().onSaveInstanceState(outState);
- }
+ getAutofillClientController().onSaveInstanceState(outState);
dispatchActivitySaveInstanceState(outState);
}
@@ -2380,19 +2317,7 @@
protected void onPause() {
if (DEBUG_LIFECYCLE) Slog.v(TAG, "onPause " + this);
dispatchActivityPaused();
- if (mAutoFillResetNeeded) {
- if (!mAutoFillIgnoreFirstResumePause) {
- if (DEBUG_LIFECYCLE) Slog.v(TAG, "autofill notifyViewExited " + this);
- View focus = getCurrentFocus();
- if (focus != null && focus.canNotifyAutofillEnterExitEvent()) {
- getAutofillManager().notifyViewExited(focus);
- }
- } else {
- // reset after first pause()
- if (DEBUG_LIFECYCLE) Slog.v(TAG, "autofill got first pause " + this);
- mAutoFillIgnoreFirstResumePause = false;
- }
- }
+ getAutofillClientController().onActivityPaused();
notifyContentCaptureManagerIfNeeded(CONTENT_CAPTURE_PAUSE);
mCalled = true;
@@ -2623,14 +2548,7 @@
mTranslucentCallback = null;
mCalled = true;
- if (mAutoFillResetNeeded) {
- // If stopped without changing the configurations, the response should expire.
- getAutofillManager().onInvisibleForAutofill(!mChangingConfigurations);
- } else if (mIntent != null
- && mIntent.hasExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN)
- && mIntent.hasExtra(AutofillManager.EXTRA_RESTORE_CROSS_ACTIVITY)) {
- restoreAutofillSaveUi();
- }
+ getAutofillClientController().onActivityStopped(mIntent, mChangingConfigurations);
mEnterAnimationComplete = false;
}
@@ -2667,9 +2585,7 @@
if (DEBUG_LIFECYCLE) Slog.v(TAG, "onDestroy " + this);
mCalled = true;
- if (isFinishing() && mAutoFillResetNeeded) {
- getAutofillManager().onActivityFinishing();
- }
+ getAutofillClientController().onActivityDestroyed();
// dismiss any dialogs we are managing.
if (mManagedDialogs != null) {
@@ -3908,11 +3824,7 @@
ActivityClient.getInstance().onBackPressedOnTaskRoot(mToken,
new RequestFinishCallback(new WeakReference<>(this)));
- // Activity was launched when user tapped a link in the Autofill Save UI - Save UI must
- // be restored now.
- if (mIntent != null && mIntent.hasExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN)) {
- restoreAutofillSaveUi();
- }
+ getAutofillClientController().onActivityBackPressed(mIntent);
}
/**
@@ -5602,6 +5514,18 @@
}
/**
+ * Like {@link #startIntentSenderForResult} but taking {@code who} as an additional identifier.
+ *
+ * @hide
+ */
+ public void startIntentSenderForResult(IntentSender intent, String who, int requestCode,
+ Intent fillInIntent, int flagsMask, int flagsValues, Bundle options)
+ throws IntentSender.SendIntentException {
+ startIntentSenderForResultInner(intent, who, requestCode, fillInIntent, flagsMask,
+ flagsValues, options);
+ }
+
+ /**
* Like {@link #startActivityForResult(Intent, int)}, but allowing you
* to use a IntentSender to describe the activity to be started. If
* the IntentSender is for an activity, that activity will be started
@@ -5643,7 +5567,10 @@
}
}
- private void startIntentSenderForResultInner(IntentSender intent, String who, int requestCode,
+ /**
+ * @hide
+ */
+ public void startIntentSenderForResultInner(IntentSender intent, String who, int requestCode,
Intent fillInIntent, int flagsMask, int flagsValues,
@Nullable Bundle options)
throws IntentSender.SendIntentException {
@@ -5725,21 +5652,7 @@
*/
@Override
public void startActivity(Intent intent, @Nullable Bundle options) {
- if (mIntent != null && mIntent.hasExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN)
- && mIntent.hasExtra(AutofillManager.EXTRA_RESTORE_CROSS_ACTIVITY)) {
- if (TextUtils.equals(getPackageName(),
- intent.resolveActivity(getPackageManager()).getPackageName())) {
- // Apply Autofill restore mechanism on the started activity by startActivity()
- final IBinder token =
- mIntent.getIBinderExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN);
- // Remove restore ability from current activity
- mIntent.removeExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN);
- mIntent.removeExtra(AutofillManager.EXTRA_RESTORE_CROSS_ACTIVITY);
- // Put restore token
- intent.putExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN, token);
- intent.putExtra(AutofillManager.EXTRA_RESTORE_CROSS_ACTIVITY, true);
- }
- }
+ getAutofillClientController().onStartActivity(intent, mIntent);
if (options != null) {
startActivityForResult(intent, -1, options);
} else {
@@ -6471,24 +6384,7 @@
mParent.finishFromChild(this);
}
- // Activity was launched when user tapped a link in the Autofill Save UI - Save UI must
- // be restored now.
- if (mIntent != null && mIntent.hasExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN)) {
- restoreAutofillSaveUi();
- }
- }
-
- /**
- * Restores Autofill Save UI
- */
- private void restoreAutofillSaveUi() {
- final IBinder token =
- mIntent.getIBinderExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN);
- // Make only restore Autofill once
- mIntent.removeExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN);
- mIntent.removeExtra(AutofillManager.EXTRA_RESTORE_CROSS_ACTIVITY);
- getAutofillManager().onPendingSaveUi(AutofillManager.PENDING_UI_OPERATION_RESTORE,
- token);
+ getAutofillClientController().onActivityFinish(mIntent);
}
/**
@@ -6805,12 +6701,6 @@
/** @hide */
@Override
- public final ComponentName autofillClientGetComponentName() {
- return getComponentName();
- }
-
- /** @hide */
- @Override
public final ComponentName contentCaptureClientGetComponentName() {
return getComponentName();
}
@@ -7134,12 +7024,6 @@
}
}
- /** @hide */
- @Override
- public final void autofillClientRunOnUiThread(Runnable action) {
- runOnUiThread(action);
- }
-
/**
* Standard implementation of
* {@link android.view.LayoutInflater.Factory#onCreateView} used when
@@ -7198,7 +7082,7 @@
// Handle special cases
switch (args[0]) {
case "--autofill":
- dumpAutofillManager(prefix, writer);
+ getAutofillClientController().dumpAutofillManager(prefix, writer);
return;
case "--contentcapture":
dumpContentCaptureManager(prefix, writer);
@@ -7244,24 +7128,13 @@
mHandler.getLooper().dump(new PrintWriterPrinter(writer), prefix);
- dumpAutofillManager(prefix, writer);
+ getAutofillClientController().dumpAutofillManager(prefix, writer);
dumpContentCaptureManager(prefix, writer);
dumpUiTranslation(prefix, writer);
ResourcesManager.getInstance().dump(prefix, writer);
}
- void dumpAutofillManager(String prefix, PrintWriter writer) {
- final AutofillManager afm = getAutofillManager();
- if (afm != null) {
- afm.dump(prefix, writer);
- writer.print(prefix); writer.print("Autofill Compat Mode: ");
- writer.println(isAutofillCompatibilityEnabled());
- } else {
- writer.print(prefix); writer.println("No AutofillManager");
- }
- }
-
void dumpContentCaptureManager(String prefix, PrintWriter writer) {
final ContentCaptureManager cm = getContentCaptureManager();
if (cm != null) {
@@ -7992,19 +7865,10 @@
mWindow.setPreferMinimalPostProcessing(
(info.flags & ActivityInfo.FLAG_PREFER_MINIMAL_POST_PROCESSING) != 0);
- setAutofillOptions(application.getAutofillOptions());
+ getAutofillClientController().onActivityAttached(application);
setContentCaptureOptions(application.getContentCaptureOptions());
}
- private void enableAutofillCompatibilityIfNeeded() {
- if (isAutofillCompatibilityEnabled()) {
- final AutofillManager afm = getSystemService(AutofillManager.class);
- if (afm != null) {
- afm.enableCompatibilityMode();
- }
- }
- }
-
/** @hide */
@UnsupportedAppUsage
public final IBinder getActivityToken() {
@@ -8176,15 +8040,7 @@
mLastNonConfigurationInstances = null;
- if (mAutoFillResetNeeded) {
- // When Activity is destroyed in paused state, and relaunch activity, there will be
- // extra onResume and onPause event, ignore the first onResume and onPause.
- // see ActivityThread.handleRelaunchActivity()
- mAutoFillIgnoreFirstResumePause = followedByPause;
- if (mAutoFillIgnoreFirstResumePause && DEBUG_LIFECYCLE) {
- Slog.v(TAG, "autofill will ignore first pause when relaunching " + this);
- }
- }
+ getAutofillClientController().onActivityPerformResume(followedByPause);
mCalled = false;
// mResumed is set by the instrumentation
@@ -8196,7 +8052,7 @@
" did not call through to super.onResume()");
}
- // invisible activities must be finished before onResume() completes
+ // invisible activities must be finished before onResume) completes
if (!mVisibleFromClient && !mFinished) {
Log.w(TAG, "An activity without a UI must call finish() before onResume() completes");
if (getApplicationInfo().targetSdkVersion
@@ -8400,9 +8256,8 @@
return;
}
}
- } else if (who.startsWith(AUTO_FILL_AUTH_WHO_PREFIX)) {
- Intent resultData = (resultCode == Activity.RESULT_OK) ? data : null;
- getAutofillManager().onAuthenticationResult(requestCode, resultData, getCurrentFocus());
+ } else if (who.startsWith(AutofillClientController.AUTO_FILL_AUTH_WHO_PREFIX)) {
+ getAutofillClientController().onDispatchActivityResult(requestCode, resultCode, data);
} else {
Fragment frag = mFragments.findFragmentByWho(who);
if (frag != null) {
@@ -8539,184 +8394,11 @@
fragment.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
- /** @hide */
- @Override
- public final void autofillClientAuthenticate(int authenticationId, IntentSender intent,
- Intent fillInIntent, boolean authenticateInline) {
- try {
- startIntentSenderForResultInner(intent, AUTO_FILL_AUTH_WHO_PREFIX,
- authenticationId, fillInIntent, 0, 0, null);
- } catch (IntentSender.SendIntentException e) {
- Log.e(TAG, "authenticate() failed for intent:" + intent, e);
- }
- }
-
- /** @hide */
- @Override
- public final void autofillClientResetableStateAvailable() {
- mAutoFillResetNeeded = true;
- }
-
- /** @hide */
- @Override
- public final boolean autofillClientRequestShowFillUi(@NonNull View anchor, int width,
- int height, @Nullable Rect anchorBounds, IAutofillWindowPresenter presenter) {
- final boolean wasShowing;
-
- if (mAutofillPopupWindow == null) {
- wasShowing = false;
- mAutofillPopupWindow = new AutofillPopupWindow(presenter);
- } else {
- wasShowing = mAutofillPopupWindow.isShowing();
- }
- mAutofillPopupWindow.update(anchor, 0, 0, width, height, anchorBounds);
-
- return !wasShowing && mAutofillPopupWindow.isShowing();
- }
-
- /** @hide */
- @Override
- public final void autofillClientDispatchUnhandledKey(@NonNull View anchor,
- @NonNull KeyEvent keyEvent) {
- ViewRootImpl rootImpl = anchor.getViewRootImpl();
- if (rootImpl != null) {
- // dont care if anchorView is current focus, for example a custom view may only receive
- // touchEvent, not focusable but can still trigger autofill window. The Key handling
- // might be inside parent of the custom view.
- rootImpl.dispatchKeyFromAutofill(keyEvent);
- }
- }
-
- /** @hide */
- @Override
- public final boolean autofillClientRequestHideFillUi() {
- if (mAutofillPopupWindow == null) {
- return false;
- }
- mAutofillPopupWindow.dismiss();
- mAutofillPopupWindow = null;
- return true;
- }
-
- /** @hide */
- @Override
- public final boolean autofillClientIsFillUiShowing() {
- return mAutofillPopupWindow != null && mAutofillPopupWindow.isShowing();
- }
-
- /** @hide */
- @Override
- @NonNull
- public final View[] autofillClientFindViewsByAutofillIdTraversal(
- @NonNull AutofillId[] autofillId) {
- final View[] views = new View[autofillId.length];
- final ArrayList<ViewRootImpl> roots =
- WindowManagerGlobal.getInstance().getRootViews(getActivityToken());
-
- for (int rootNum = 0; rootNum < roots.size(); rootNum++) {
- final View rootView = roots.get(rootNum).getView();
-
- if (rootView != null) {
- final int viewCount = autofillId.length;
- for (int viewNum = 0; viewNum < viewCount; viewNum++) {
- if (views[viewNum] == null) {
- views[viewNum] = rootView.findViewByAutofillIdTraversal(
- autofillId[viewNum].getViewId());
- }
- }
- }
- }
-
- return views;
- }
-
- /** @hide */
- @Nullable
- public View findViewByAutofillIdTraversal(@NonNull AutofillId autofillId) {
- final ArrayList<ViewRootImpl> roots =
- WindowManagerGlobal.getInstance().getRootViews(getActivityToken());
- for (int rootNum = 0; rootNum < roots.size(); rootNum++) {
- final View rootView = roots.get(rootNum).getView();
-
- if (rootView != null) {
- final View view = rootView.findViewByAutofillIdTraversal(autofillId.getViewId());
- if (view != null) {
- return view;
- }
- }
- }
- return null;
- }
-
- /** @hide */
- @Override
- @Nullable
- public final View autofillClientFindViewByAutofillIdTraversal(AutofillId autofillId) {
- return findViewByAutofillIdTraversal(autofillId);
- }
-
- /** @hide */
- @Override
- public final @NonNull boolean[] autofillClientGetViewVisibility(
- @NonNull AutofillId[] autofillIds) {
- final int autofillIdCount = autofillIds.length;
- final boolean[] visible = new boolean[autofillIdCount];
- for (int i = 0; i < autofillIdCount; i++) {
- final AutofillId autofillId = autofillIds[i];
- final View view = autofillClientFindViewByAutofillIdTraversal(autofillId);
- if (view != null) {
- if (!autofillId.isVirtualInt()) {
- visible[i] = view.isVisibleToUser();
- } else {
- visible[i] = view.isVisibleToUserForAutofill(autofillId.getVirtualChildIntId());
- }
- }
- }
- if (android.view.autofill.Helper.sVerbose) {
- Log.v(TAG, "autofillClientGetViewVisibility(): " + Arrays.toString(visible));
- }
- return visible;
- }
-
- /** @hide */
- public final @Nullable View autofillClientFindViewByAccessibilityIdTraversal(int viewId,
- int windowId) {
- final ArrayList<ViewRootImpl> roots = WindowManagerGlobal.getInstance()
- .getRootViews(getActivityToken());
- for (int rootNum = 0; rootNum < roots.size(); rootNum++) {
- final View rootView = roots.get(rootNum).getView();
- if (rootView != null && rootView.getAccessibilityWindowId() == windowId) {
- final View view = rootView.findViewByAccessibilityIdTraversal(viewId);
- if (view != null) {
- return view;
- }
- }
- }
- return null;
- }
-
- /** @hide */
- @Override
- public final @Nullable IBinder autofillClientGetActivityToken() {
- return getActivityToken();
- }
-
- /** @hide */
- @Override
- public final boolean autofillClientIsVisibleForAutofill() {
- return !mStopped;
- }
-
- /** @hide */
- @Override
- public final boolean autofillClientIsCompatibilityModeEnabled() {
- return isAutofillCompatibilityEnabled();
- }
-
- /** @hide */
- @Override
- public final boolean isDisablingEnterExitEventForAutofill() {
- return mAutoFillIgnoreFirstResumePause || !mResumed;
+ /**
+ * @hide
+ */
+ public final boolean isStopped() {
+ return mStopped;
}
/**
diff --git a/core/java/android/app/Application.java b/core/java/android/app/Application.java
index 618eda8..f58ca6a 100644
--- a/core/java/android/app/Application.java
+++ b/core/java/android/app/Application.java
@@ -613,7 +613,7 @@
if (android.view.autofill.Helper.sVerbose) {
Log.v(TAG, "getAutofillClient(): found activity for " + this + ": " + activity);
}
- return activity;
+ return activity.getAutofillClient();
}
}
if (android.view.autofill.Helper.sVerbose) {
diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java
index 245baf0..b81a8d3 100644
--- a/core/java/android/app/ApplicationPackageManager.java
+++ b/core/java/android/app/ApplicationPackageManager.java
@@ -1061,7 +1061,7 @@
throws NameNotFoundException {
try {
int uid = mPM.getUidForSharedUser(sharedUserName);
- if(uid != -1) {
+ if (uid != Process.INVALID_UID) {
return uid;
}
} catch (RemoteException e) {
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 249a606..7114d73 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -26,6 +26,7 @@
import android.annotation.Nullable;
import android.annotation.UiContext;
import android.compat.annotation.UnsupportedAppUsage;
+import android.content.AttributionSource;
import android.content.AutofillOptions;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
@@ -60,7 +61,6 @@
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.net.Uri;
-import android.content.AttributionSource;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
@@ -3123,6 +3123,7 @@
mForceDisplayOverrideInResources = container.mForceDisplayOverrideInResources;
mIsConfigurationBasedContext = container.mIsConfigurationBasedContext;
mContextType = container.mContextType;
+ mContentCaptureOptions = container.mContentCaptureOptions;
} else {
mBasePackageName = packageInfo.mPackageName;
ApplicationInfo ainfo = packageInfo.getApplicationInfo();
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index 871d48b..32ea41b 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -158,7 +158,6 @@
import android.os.IBinder;
import android.os.IDumpstate;
import android.os.IHardwarePropertiesManager;
-import android.os.IHintManager;
import android.os.IPowerManager;
import android.os.IRecoverySystem;
import android.os.ISystemUpdateManager;
@@ -600,10 +599,7 @@
@Override
public PerformanceHintManager createService(ContextImpl ctx)
throws ServiceNotFoundException {
- IBinder hintBinder = ServiceManager.getServiceOrThrow(
- Context.PERFORMANCE_HINT_SERVICE);
- IHintManager hintService = IHintManager.Stub.asInterface(hintBinder);
- return new PerformanceHintManager(hintService);
+ return PerformanceHintManager.create();
}});
registerService(Context.RECOVERY_SERVICE, RecoverySystem.class,
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index 2724166..2ed26a9f 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -3526,22 +3526,22 @@
}
/**
- * Determines whether a String Bluetooth address, such as "00:43:A8:23:10:F0"
+ * Determines whether a String Bluetooth address, such as "F0:43:A8:23:10:00"
* is a RANDOM STATIC address.
*
- * RANDOM STATIC: (addr & 0b11) == 0b11
- * RANDOM RESOLVABLE: (addr & 0b11) == 0b10
- * RANDOM non-RESOLVABLE: (addr & 0b11) == 0b00
+ * RANDOM STATIC: (addr & 0xC0) == 0xC0
+ * RANDOM RESOLVABLE: (addr & 0xC0) == 0x40
+ * RANDOM non-RESOLVABLE: (addr & 0xC0) == 0x00
*
* @param address Bluetooth address as string
- * @return true if the 2 Least Significant Bits of the address equals 0b11.
+ * @return true if the 2 Most Significant Bits of the address equals 0xC0.
*
* @hide
*/
public static boolean isAddressRandomStatic(@NonNull String address) {
requireNonNull(address);
return checkBluetoothAddress(address)
- && (Integer.parseInt(address.split(":")[5], 16) & 0b11) == 0b11;
+ && (Integer.parseInt(address.split(":")[0], 16) & 0xC0) == 0xC0;
}
/** {@hide} */
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index c02dcfd..ac88c7b 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -5229,6 +5229,15 @@
public static final String JOB_SCHEDULER_SERVICE = "jobscheduler";
/**
+ * Use with {@link #getSystemService(String)} to retrieve a
+ * {@link android.app.tare.EconomyManager} instance for understanding economic standing.
+ * @see #getSystemService(String)
+ * @hide
+ * @see android.app.tare.EconomyManager
+ */
+ public static final String RESOURCE_ECONOMY_SERVICE = "tare";
+
+ /**
* Use with {@link #getSystemService(String)} to retrieve a {@link
* android.service.persistentdata.PersistentDataBlockManager} instance
* for interacting with a storage device that lives across factory resets.
diff --git a/core/java/android/content/pm/parsing/PackageInfoWithoutStateUtils.java b/core/java/android/content/pm/parsing/PackageInfoWithoutStateUtils.java
index 12ed0e0..9fee7bb 100644
--- a/core/java/android/content/pm/parsing/PackageInfoWithoutStateUtils.java
+++ b/core/java/android/content/pm/parsing/PackageInfoWithoutStateUtils.java
@@ -273,16 +273,16 @@
pi.requestedPermissionsFlags = new int[size];
for (int i = 0; i < size; i++) {
final ParsedUsesPermission usesPermission = usesPermissions.get(i);
- pi.requestedPermissions[i] = usesPermission.name;
+ pi.requestedPermissions[i] = usesPermission.getName();
// The notion of required permissions is deprecated but for compatibility.
pi.requestedPermissionsFlags[i] |=
PackageInfo.REQUESTED_PERMISSION_REQUIRED;
if (grantedPermissions != null
- && grantedPermissions.contains(usesPermission.name)) {
+ && grantedPermissions.contains(usesPermission.getName())) {
pi.requestedPermissionsFlags[i] |=
PackageInfo.REQUESTED_PERMISSION_GRANTED;
}
- if ((usesPermission.usesPermissionFlags
+ if ((usesPermission.getUsesPermissionFlags()
& ParsedUsesPermission.FLAG_NEVER_FOR_LOCATION) != 0) {
pi.requestedPermissionsFlags[i] |=
PackageInfo.REQUESTED_PERMISSION_NEVER_FOR_LOCATION;
@@ -750,7 +750,7 @@
@Nullable
public static Attribution generateAttribution(ParsedAttribution pa) {
if (pa == null) return null;
- return new Attribution(pa.tag, pa.label);
+ return new Attribution(pa.getTag(), pa.getLabel());
}
private static boolean checkUseInstalledOrHidden(int flags, @NonNull PackageUserState state,
diff --git a/core/java/android/content/pm/parsing/ParsingPackageImpl.java b/core/java/android/content/pm/parsing/ParsingPackageImpl.java
index 34a57f3..0db6546 100644
--- a/core/java/android/content/pm/parsing/ParsingPackageImpl.java
+++ b/core/java/android/content/pm/parsing/ParsingPackageImpl.java
@@ -716,7 +716,8 @@
// Continue populating legacy data structures to avoid performance
// issues until all that code can be migrated
- this.requestedPermissions = CollectionUtils.add(this.requestedPermissions, permission.name);
+ this.requestedPermissions = CollectionUtils.add(this.requestedPermissions,
+ permission.getName());
return this;
}
diff --git a/core/java/android/content/pm/parsing/ParsingPackageUtils.java b/core/java/android/content/pm/parsing/ParsingPackageUtils.java
index 0040e2f..fc4aa5e 100644
--- a/core/java/android/content/pm/parsing/ParsingPackageUtils.java
+++ b/core/java/android/content/pm/parsing/ParsingPackageUtils.java
@@ -1307,8 +1307,8 @@
final int size = usesPermissions.size();
for (int i = 0; i < size; i++) {
final ParsedUsesPermission usesPermission = usesPermissions.get(i);
- if (Objects.equals(usesPermission.name, name)) {
- if (usesPermission.usesPermissionFlags != usesPermissionFlags) {
+ if (Objects.equals(usesPermission.getName(), name)) {
+ if (usesPermission.getUsesPermissionFlags() != usesPermissionFlags) {
return input.error("Conflicting uses-permissions flags: "
+ name + " in package: " + pkg.getPackageName() + " at: "
+ parser.getPositionDescription());
@@ -2807,8 +2807,8 @@
if (pkg.getTargetSdkVersion() >= info.sdkVersion) {
break;
}
- if (!pkg.getRequestedPermissions().contains(info.name)) {
- pkg.addImplicitPermission(info.name);
+ if (!pkg.getRequestedPermissions().contains(info.getName())) {
+ pkg.addImplicitPermission(info.getName());
}
}
}
diff --git a/core/java/android/content/pm/parsing/component/ComponentParseUtils.java b/core/java/android/content/pm/parsing/component/ComponentParseUtils.java
index 0403a25..e5d030c 100644
--- a/core/java/android/content/pm/parsing/component/ComponentParseUtils.java
+++ b/core/java/android/content/pm/parsing/component/ComponentParseUtils.java
@@ -152,7 +152,7 @@
@Nullable
public static CharSequence getNonLocalizedLabel(
ParsedComponent component) {
- return component.nonLocalizedLabel;
+ return component.getNonLocalizedLabel();
}
/**
@@ -161,7 +161,7 @@
* This is a method of the utility class to discourage use.
*/
public static int getIcon(ParsedComponent component) {
- return component.icon;
+ return component.getIcon();
}
public static boolean isMatch(PackageUserState state, boolean isSystem,
diff --git a/core/java/android/content/pm/parsing/component/ParsedActivity.java b/core/java/android/content/pm/parsing/component/ParsedActivity.java
index 6f478ac..73ee132 100644
--- a/core/java/android/content/pm/parsing/component/ParsedActivity.java
+++ b/core/java/android/content/pm/parsing/component/ParsedActivity.java
@@ -38,8 +38,8 @@
/** @hide **/
public class ParsedActivity extends ParsedMainComponent {
- int theme;
- int uiOptions;
+ private int theme;
+ private int uiOptions;
@Nullable
@DataClass.ParcelWith(ForInternedString.class)
@@ -49,22 +49,22 @@
@DataClass.ParcelWith(ForInternedString.class)
private String parentActivityName;
@Nullable
- String taskAffinity;
- int privateFlags;
+ private String taskAffinity;
+ private int privateFlags;
@Nullable
@DataClass.ParcelWith(ForInternedString.class)
private String permission;
- int launchMode;
- int documentLaunchMode;
- int maxRecents;
- int configChanges;
- int softInputMode;
- int persistableMode;
- int lockTaskLaunchMode;
+ private int launchMode;
+ private int documentLaunchMode;
+ private int maxRecents;
+ private int configChanges;
+ private int softInputMode;
+ private int persistableMode;
+ private int lockTaskLaunchMode;
- int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
- int resizeMode = ActivityInfo.RESIZE_MODE_RESIZEABLE;
+ private int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
+ private int resizeMode = ActivityInfo.RESIZE_MODE_RESIZEABLE;
@Nullable
private Float maxAspectRatio;
@@ -75,12 +75,12 @@
private boolean supportsSizeChanges;
@Nullable
- String requestedVrComponent;
- int rotationAnimation = -1;
- int colorMode;
+ private String requestedVrComponent;
+ private int rotationAnimation = -1;
+ private int colorMode;
@Nullable
- ActivityInfo.WindowLayout windowLayout;
+ private ActivityInfo.WindowLayout windowLayout;
public ParsedActivity(ParsedActivity other) {
super(other);
@@ -188,6 +188,35 @@
// alias.metaData = target.metaData;
}
+ public boolean isSupportsSizeChanges() {
+ return supportsSizeChanges;
+ }
+
+ public ParsedActivity setColorMode(int colorMode) {
+ this.colorMode = colorMode;
+ return this;
+ }
+
+ public ParsedActivity setConfigChanges(int configChanges) {
+ this.configChanges = configChanges;
+ return this;
+ }
+
+ public ParsedActivity setDocumentLaunchMode(int documentLaunchMode) {
+ this.documentLaunchMode = documentLaunchMode;
+ return this;
+ }
+
+ public ParsedActivity setLaunchMode(int launchMode) {
+ this.launchMode = launchMode;
+ return this;
+ }
+
+ public ParsedActivity setLockTaskLaunchMode(int lockTaskLaunchMode) {
+ this.lockTaskLaunchMode = lockTaskLaunchMode;
+ return this;
+ }
+
public ParsedActivity setMaxAspectRatio(int resizeMode, float maxAspectRatio) {
if (resizeMode == ActivityInfo.RESIZE_MODE_RESIZEABLE
|| resizeMode == ActivityInfo.RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION) {
@@ -204,6 +233,16 @@
return this;
}
+ public ParsedActivity setMaxAspectRatio(Float maxAspectRatio) {
+ this.maxAspectRatio = maxAspectRatio;
+ return this;
+ }
+
+ public ParsedActivity setMaxRecents(int maxRecents) {
+ this.maxRecents = maxRecents;
+ return this;
+ }
+
public ParsedActivity setMinAspectRatio(int resizeMode, float minAspectRatio) {
if (resizeMode == RESIZE_MODE_RESIZEABLE
|| resizeMode == RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION) {
@@ -220,13 +259,48 @@
return this;
}
- public ParsedActivity setSupportsSizeChanges(boolean supportsSizeChanges) {
- this.supportsSizeChanges = supportsSizeChanges;
+ public ParsedActivity setMinAspectRatio(Float minAspectRatio) {
+ this.minAspectRatio = minAspectRatio;
return this;
}
- public ParsedActivity setFlags(int flags) {
- this.flags = flags;
+ public ParsedActivity setParentActivityName(String parentActivityName) {
+ this.parentActivityName = parentActivityName;
+ return this;
+ }
+
+ public ParsedActivity setPersistableMode(int persistableMode) {
+ this.persistableMode = persistableMode;
+ return this;
+ }
+
+ public ParsedActivity setPrivateFlags(int privateFlags) {
+ this.privateFlags = privateFlags;
+ return this;
+ }
+
+ public ParsedActivity setRequestedVrComponent(String requestedVrComponent) {
+ this.requestedVrComponent = requestedVrComponent;
+ return this;
+ }
+
+ public ParsedActivity setRotationAnimation(int rotationAnimation) {
+ this.rotationAnimation = rotationAnimation;
+ return this;
+ }
+
+ public ParsedActivity setScreenOrientation(int screenOrientation) {
+ this.screenOrientation = screenOrientation;
+ return this;
+ }
+
+ public ParsedActivity setSoftInputMode(int softInputMode) {
+ this.softInputMode = softInputMode;
+ return this;
+ }
+
+ public ParsedActivity setSupportsSizeChanges(boolean supportsSizeChanges) {
+ this.supportsSizeChanges = supportsSizeChanges;
return this;
}
@@ -240,17 +314,32 @@
return this;
}
- public ParsedActivity setParentActivity(String parentActivity) {
- this.parentActivityName = TextUtils.safeIntern(parentActivity);
- return this;
- }
-
public ParsedActivity setPermission(String permission) {
// Empty string must be converted to null
this.permission = TextUtils.isEmpty(permission) ? null : permission.intern();
return this;
}
+ public ParsedActivity setTaskAffinity(String taskAffinity) {
+ this.taskAffinity = taskAffinity;
+ return this;
+ }
+
+ public ParsedActivity setTheme(int theme) {
+ this.theme = theme;
+ return this;
+ }
+
+ public ParsedActivity setUiOptions(int uiOptions) {
+ this.uiOptions = uiOptions;
+ return this;
+ }
+
+ public ParsedActivity setWindowLayout(ActivityInfo.WindowLayout windowLayout) {
+ this.windowLayout = windowLayout;
+ return this;
+ }
+
public String toString() {
StringBuilder sb = new StringBuilder(128);
sb.append("Activity{");
diff --git a/core/java/android/content/pm/parsing/component/ParsedActivityUtils.java b/core/java/android/content/pm/parsing/component/ParsedActivityUtils.java
index 92a90e9..ac6bcd0 100644
--- a/core/java/android/content/pm/parsing/component/ParsedActivityUtils.java
+++ b/core/java/android/content/pm/parsing/component/ParsedActivityUtils.java
@@ -120,58 +120,58 @@
// Multi-lining them to fit within the column restriction makes it hard to tell what
// field is assigned where.
// @formatter:off
- activity.theme = sa.getResourceId(R.styleable.AndroidManifestActivity_theme, 0);
- activity.uiOptions = sa.getInt(R.styleable.AndroidManifestActivity_uiOptions, pkg.getUiOptions());
+ activity.setTheme(sa.getResourceId(R.styleable.AndroidManifestActivity_theme, 0))
+ .setUiOptions(sa.getInt(R.styleable.AndroidManifestActivity_uiOptions, pkg.getUiOptions()));
- activity.flags |= flag(ActivityInfo.FLAG_ALLOW_TASK_REPARENTING, R.styleable.AndroidManifestActivity_allowTaskReparenting, pkg.isAllowTaskReparenting(), sa)
- | flag(ActivityInfo.FLAG_ALWAYS_RETAIN_TASK_STATE, R.styleable.AndroidManifestActivity_alwaysRetainTaskState, sa)
- | flag(ActivityInfo.FLAG_CLEAR_TASK_ON_LAUNCH, R.styleable.AndroidManifestActivity_clearTaskOnLaunch, sa)
- | flag(ActivityInfo.FLAG_EXCLUDE_FROM_RECENTS, R.styleable.AndroidManifestActivity_excludeFromRecents, sa)
- | flag(ActivityInfo.FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS, R.styleable.AndroidManifestActivity_finishOnCloseSystemDialogs, sa)
- | flag(ActivityInfo.FLAG_FINISH_ON_TASK_LAUNCH, R.styleable.AndroidManifestActivity_finishOnTaskLaunch, sa)
- | flag(ActivityInfo.FLAG_IMMERSIVE, R.styleable.AndroidManifestActivity_immersive, sa)
- | flag(ActivityInfo.FLAG_MULTIPROCESS, R.styleable.AndroidManifestActivity_multiprocess, sa)
- | flag(ActivityInfo.FLAG_NO_HISTORY, R.styleable.AndroidManifestActivity_noHistory, sa)
- | flag(ActivityInfo.FLAG_SHOW_FOR_ALL_USERS, R.styleable.AndroidManifestActivity_showForAllUsers, sa)
- | flag(ActivityInfo.FLAG_SHOW_FOR_ALL_USERS, R.styleable.AndroidManifestActivity_showOnLockScreen, sa)
- | flag(ActivityInfo.FLAG_STATE_NOT_NEEDED, R.styleable.AndroidManifestActivity_stateNotNeeded, sa)
- | flag(ActivityInfo.FLAG_SYSTEM_USER_ONLY, R.styleable.AndroidManifestActivity_systemUserOnly, sa);
+ activity.setFlags(activity.getFlags() | (flag(ActivityInfo.FLAG_ALLOW_TASK_REPARENTING, R.styleable.AndroidManifestActivity_allowTaskReparenting, pkg.isAllowTaskReparenting(), sa)
+ | flag(ActivityInfo.FLAG_ALWAYS_RETAIN_TASK_STATE, R.styleable.AndroidManifestActivity_alwaysRetainTaskState, sa)
+ | flag(ActivityInfo.FLAG_CLEAR_TASK_ON_LAUNCH, R.styleable.AndroidManifestActivity_clearTaskOnLaunch, sa)
+ | flag(ActivityInfo.FLAG_EXCLUDE_FROM_RECENTS, R.styleable.AndroidManifestActivity_excludeFromRecents, sa)
+ | flag(ActivityInfo.FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS, R.styleable.AndroidManifestActivity_finishOnCloseSystemDialogs, sa)
+ | flag(ActivityInfo.FLAG_FINISH_ON_TASK_LAUNCH, R.styleable.AndroidManifestActivity_finishOnTaskLaunch, sa)
+ | flag(ActivityInfo.FLAG_IMMERSIVE, R.styleable.AndroidManifestActivity_immersive, sa)
+ | flag(ActivityInfo.FLAG_MULTIPROCESS, R.styleable.AndroidManifestActivity_multiprocess, sa)
+ | flag(ActivityInfo.FLAG_NO_HISTORY, R.styleable.AndroidManifestActivity_noHistory, sa)
+ | flag(ActivityInfo.FLAG_SHOW_FOR_ALL_USERS, R.styleable.AndroidManifestActivity_showForAllUsers, sa)
+ | flag(ActivityInfo.FLAG_SHOW_FOR_ALL_USERS, R.styleable.AndroidManifestActivity_showOnLockScreen, sa)
+ | flag(ActivityInfo.FLAG_STATE_NOT_NEEDED, R.styleable.AndroidManifestActivity_stateNotNeeded, sa)
+ | flag(ActivityInfo.FLAG_SYSTEM_USER_ONLY, R.styleable.AndroidManifestActivity_systemUserOnly, sa)));
if (!receiver) {
- activity.flags |= flag(ActivityInfo.FLAG_HARDWARE_ACCELERATED, R.styleable.AndroidManifestActivity_hardwareAccelerated, pkg.isBaseHardwareAccelerated(), sa)
- | flag(ActivityInfo.FLAG_ALLOW_EMBEDDED, R.styleable.AndroidManifestActivity_allowEmbedded, sa)
- | flag(ActivityInfo.FLAG_ALWAYS_FOCUSABLE, R.styleable.AndroidManifestActivity_alwaysFocusable, sa)
- | flag(ActivityInfo.FLAG_AUTO_REMOVE_FROM_RECENTS, R.styleable.AndroidManifestActivity_autoRemoveFromRecents, sa)
- | flag(ActivityInfo.FLAG_RELINQUISH_TASK_IDENTITY, R.styleable.AndroidManifestActivity_relinquishTaskIdentity, sa)
- | flag(ActivityInfo.FLAG_RESUME_WHILE_PAUSING, R.styleable.AndroidManifestActivity_resumeWhilePausing, sa)
- | flag(ActivityInfo.FLAG_SHOW_WHEN_LOCKED, R.styleable.AndroidManifestActivity_showWhenLocked, sa)
- | flag(ActivityInfo.FLAG_SUPPORTS_PICTURE_IN_PICTURE, R.styleable.AndroidManifestActivity_supportsPictureInPicture, sa)
- | flag(ActivityInfo.FLAG_TURN_SCREEN_ON, R.styleable.AndroidManifestActivity_turnScreenOn, sa)
- | flag(ActivityInfo.FLAG_PREFER_MINIMAL_POST_PROCESSING, R.styleable.AndroidManifestActivity_preferMinimalPostProcessing, sa);
+ activity.setFlags(activity.getFlags() | (flag(ActivityInfo.FLAG_HARDWARE_ACCELERATED, R.styleable.AndroidManifestActivity_hardwareAccelerated, pkg.isBaseHardwareAccelerated(), sa)
+ | flag(ActivityInfo.FLAG_ALLOW_EMBEDDED, R.styleable.AndroidManifestActivity_allowEmbedded, sa)
+ | flag(ActivityInfo.FLAG_ALWAYS_FOCUSABLE, R.styleable.AndroidManifestActivity_alwaysFocusable, sa)
+ | flag(ActivityInfo.FLAG_AUTO_REMOVE_FROM_RECENTS, R.styleable.AndroidManifestActivity_autoRemoveFromRecents, sa)
+ | flag(ActivityInfo.FLAG_RELINQUISH_TASK_IDENTITY, R.styleable.AndroidManifestActivity_relinquishTaskIdentity, sa)
+ | flag(ActivityInfo.FLAG_RESUME_WHILE_PAUSING, R.styleable.AndroidManifestActivity_resumeWhilePausing, sa)
+ | flag(ActivityInfo.FLAG_SHOW_WHEN_LOCKED, R.styleable.AndroidManifestActivity_showWhenLocked, sa)
+ | flag(ActivityInfo.FLAG_SUPPORTS_PICTURE_IN_PICTURE, R.styleable.AndroidManifestActivity_supportsPictureInPicture, sa)
+ | flag(ActivityInfo.FLAG_TURN_SCREEN_ON, R.styleable.AndroidManifestActivity_turnScreenOn, sa)
+ | flag(ActivityInfo.FLAG_PREFER_MINIMAL_POST_PROCESSING, R.styleable.AndroidManifestActivity_preferMinimalPostProcessing, sa)));
- activity.privateFlags |= flag(ActivityInfo.FLAG_INHERIT_SHOW_WHEN_LOCKED,
- R.styleable.AndroidManifestActivity_inheritShowWhenLocked, sa)
- | flag(ActivityInfo.PRIVATE_FLAG_HOME_TRANSITION_SOUND,
- R.styleable.AndroidManifestActivity_playHomeTransitionSound, true, sa);
+ activity.setPrivateFlags(activity.getPrivateFlags() | (flag(ActivityInfo.FLAG_INHERIT_SHOW_WHEN_LOCKED,
+ R.styleable.AndroidManifestActivity_inheritShowWhenLocked, sa)
+ | flag(ActivityInfo.PRIVATE_FLAG_HOME_TRANSITION_SOUND,
+ R.styleable.AndroidManifestActivity_playHomeTransitionSound, true, sa)));
- activity.colorMode = sa.getInt(R.styleable.AndroidManifestActivity_colorMode, ActivityInfo.COLOR_MODE_DEFAULT);
- activity.documentLaunchMode = sa.getInt(R.styleable.AndroidManifestActivity_documentLaunchMode, ActivityInfo.DOCUMENT_LAUNCH_NONE);
- activity.launchMode = sa.getInt(R.styleable.AndroidManifestActivity_launchMode, ActivityInfo.LAUNCH_MULTIPLE);
- activity.lockTaskLaunchMode = sa.getInt(R.styleable.AndroidManifestActivity_lockTaskMode, 0);
- activity.maxRecents = sa.getInt(R.styleable.AndroidManifestActivity_maxRecents, ActivityTaskManager.getDefaultAppRecentsLimitStatic());
- activity.persistableMode = sa.getInteger(R.styleable.AndroidManifestActivity_persistableMode, ActivityInfo.PERSIST_ROOT_ONLY);
- activity.requestedVrComponent = sa.getString(R.styleable.AndroidManifestActivity_enableVrMode);
- activity.rotationAnimation = sa.getInt(R.styleable.AndroidManifestActivity_rotationAnimation, WindowManager.LayoutParams.ROTATION_ANIMATION_UNSPECIFIED);
- activity.softInputMode = sa.getInt(R.styleable.AndroidManifestActivity_windowSoftInputMode, 0);
-
- activity.configChanges = getActivityConfigChanges(
- sa.getInt(R.styleable.AndroidManifestActivity_configChanges, 0),
- sa.getInt(R.styleable.AndroidManifestActivity_recreateOnConfigChanges, 0));
+ activity.setColorMode(sa.getInt(R.styleable.AndroidManifestActivity_colorMode, ActivityInfo.COLOR_MODE_DEFAULT))
+ .setDocumentLaunchMode(sa.getInt(R.styleable.AndroidManifestActivity_documentLaunchMode, ActivityInfo.DOCUMENT_LAUNCH_NONE))
+ .setLaunchMode(sa.getInt(R.styleable.AndroidManifestActivity_launchMode, ActivityInfo.LAUNCH_MULTIPLE))
+ .setLockTaskLaunchMode(sa.getInt(R.styleable.AndroidManifestActivity_lockTaskMode, 0))
+ .setMaxRecents(sa.getInt(R.styleable.AndroidManifestActivity_maxRecents, ActivityTaskManager.getDefaultAppRecentsLimitStatic()))
+ .setPersistableMode(sa.getInteger(R.styleable.AndroidManifestActivity_persistableMode, ActivityInfo.PERSIST_ROOT_ONLY))
+ .setRequestedVrComponent(sa.getString(R.styleable.AndroidManifestActivity_enableVrMode))
+ .setRotationAnimation(sa.getInt(R.styleable.AndroidManifestActivity_rotationAnimation, WindowManager.LayoutParams.ROTATION_ANIMATION_UNSPECIFIED))
+ .setSoftInputMode(sa.getInt(R.styleable.AndroidManifestActivity_windowSoftInputMode, 0))
+ .setConfigChanges(getActivityConfigChanges(
+ sa.getInt(R.styleable.AndroidManifestActivity_configChanges, 0),
+ sa.getInt(R.styleable.AndroidManifestActivity_recreateOnConfigChanges, 0))
+ );
int screenOrientation = sa.getInt(R.styleable.AndroidManifestActivity_screenOrientation, SCREEN_ORIENTATION_UNSPECIFIED);
int resizeMode = getActivityResizeMode(pkg, sa, screenOrientation);
- activity.screenOrientation = screenOrientation;
- activity.resizeMode = resizeMode;
+ activity.setScreenOrientation(screenOrientation)
+ .setResizeMode(resizeMode);
if (sa.hasValue(R.styleable.AndroidManifestActivity_maxAspectRatio)
&& sa.getType(R.styleable.AndroidManifestActivity_maxAspectRatio)
@@ -189,9 +189,9 @@
0 /*default*/));
}
} else {
- activity.launchMode = ActivityInfo.LAUNCH_MULTIPLE;
- activity.configChanges = 0;
- activity.flags |= flag(ActivityInfo.FLAG_SINGLE_USER, R.styleable.AndroidManifestActivity_singleUser, sa);
+ activity.setLaunchMode(ActivityInfo.LAUNCH_MULTIPLE)
+ .setConfigChanges(0)
+ .setFlags(activity.getFlags()|flag(ActivityInfo.FLAG_SINGLE_USER, R.styleable.AndroidManifestActivity_singleUser, sa));
}
// @formatter:on
@@ -205,11 +205,11 @@
return input.error(affinityNameResult);
}
- activity.taskAffinity = affinityNameResult.getResult();
+ activity.setTaskAffinity(affinityNameResult.getResult());
boolean visibleToEphemeral = sa.getBoolean(R.styleable.AndroidManifestActivity_visibleToInstantApps, false);
if (visibleToEphemeral) {
- activity.flags |= ActivityInfo.FLAG_VISIBLE_TO_INSTANT_APP;
+ activity.setFlags(activity.getFlags() | ActivityInfo.FLAG_VISIBLE_TO_INSTANT_APP);
pkg.setVisibleToInstantApps(true);
}
@@ -320,7 +320,7 @@
Log.e(TAG, "Activity " + activity.getName()
+ " specified invalid parentActivityName " + parentActivityName);
} else {
- activity.setParentActivity(parentClassName);
+ activity.setParentActivityName(parentClassName);
}
}
@@ -336,7 +336,7 @@
final boolean setExported = array.hasValue(exportedAttr);
if (setExported) {
- activity.exported = array.getBoolean(exportedAttr, false);
+ activity.setExported(array.getBoolean(exportedAttr, false));
}
final int depth = parser.getDepth();
@@ -355,7 +355,7 @@
if (intentResult.isSuccess()) {
ParsedIntentInfo intent = intentResult.getResult();
if (intent != null) {
- activity.order = Math.max(intent.getOrder(), activity.order);
+ activity.setOrder(Math.max(intent.getOrder(), activity.getOrder()));
activity.addIntent(intent);
if (LOG_UNSAFE_BROADCASTS && isReceiver
&& pkg.getTargetSdkVersion() >= Build.VERSION_CODES.O) {
@@ -396,7 +396,7 @@
ParseResult<ActivityInfo.WindowLayout> layoutResult =
parseActivityWindowLayout(resources, parser, input);
if (layoutResult.isSuccess()) {
- activity.windowLayout = layoutResult.getResult();
+ activity.setWindowLayout(layoutResult.getResult());
}
result = layoutResult;
} else {
@@ -408,13 +408,13 @@
}
}
- if (!isAlias && activity.launchMode != LAUNCH_SINGLE_INSTANCE_PER_TASK
- && activity.metaData != null && activity.metaData.containsKey(
+ if (!isAlias && activity.getLaunchMode() != LAUNCH_SINGLE_INSTANCE_PER_TASK
+ && activity.getMetaData() != null && activity.getMetaData().containsKey(
ParsingPackageUtils.METADATA_ACTIVITY_LAUNCH_MODE)) {
- final String launchMode = activity.metaData.getString(
+ final String launchMode = activity.getMetaData().getString(
ParsingPackageUtils.METADATA_ACTIVITY_LAUNCH_MODE);
if (launchMode != null && launchMode.equals("singleInstancePerTask")) {
- activity.launchMode = LAUNCH_SINGLE_INSTANCE_PER_TASK;
+ activity.setLaunchMode(LAUNCH_SINGLE_INSTANCE_PER_TASK);
}
}
@@ -423,7 +423,7 @@
if (layoutResult.isError()) {
return input.error(layoutResult);
}
- activity.windowLayout = layoutResult.getResult();
+ activity.setWindowLayout(layoutResult.getResult());
if (!setExported) {
boolean hasIntentFilters = activity.getIntents().size() > 0;
@@ -437,7 +437,7 @@
return input.error(exportedCheckResult);
}
}
- activity.exported = hasIntentFilters;
+ activity.setExported(hasIntentFilters);
}
return input.success(activity);
@@ -459,10 +459,11 @@
ParsedIntentInfo intent = result.getResult();
if (intent != null) {
if (intent.isVisibleToInstantApp()) {
- activity.flags |= ActivityInfo.FLAG_VISIBLE_TO_INSTANT_APP;
+ activity.setFlags(activity.getFlags() | ActivityInfo.FLAG_VISIBLE_TO_INSTANT_APP);
}
if (intent.isImplicitlyVisibleToInstantApp()) {
- activity.flags |= ActivityInfo.FLAG_IMPLICITLY_VISIBLE_TO_INSTANT_APP;
+ activity.setFlags(
+ activity.getFlags() | ActivityInfo.FLAG_IMPLICITLY_VISIBLE_TO_INSTANT_APP);
}
}
@@ -553,19 +554,19 @@
private static ParseResult<ActivityInfo.WindowLayout> resolveActivityWindowLayout(
ParsedActivity activity, ParseInput input) {
// There isn't a metadata for us to fall back. Whatever is in layout is correct.
- if (activity.metaData == null || !activity.metaData.containsKey(
+ if (activity.getMetaData() == null || !activity.getMetaData().containsKey(
ParsingPackageUtils.METADATA_ACTIVITY_WINDOW_LAYOUT_AFFINITY)) {
- return input.success(activity.windowLayout);
+ return input.success(activity.getWindowLayout());
}
// Layout already specifies a value. We should just use that one.
- if (activity.windowLayout != null && activity.windowLayout.windowLayoutAffinity != null) {
- return input.success(activity.windowLayout);
+ if (activity.getWindowLayout() != null && activity.getWindowLayout().windowLayoutAffinity != null) {
+ return input.success(activity.getWindowLayout());
}
- String windowLayoutAffinity = activity.metaData.getString(
+ String windowLayoutAffinity = activity.getMetaData().getString(
ParsingPackageUtils.METADATA_ACTIVITY_WINDOW_LAYOUT_AFFINITY);
- ActivityInfo.WindowLayout layout = activity.windowLayout;
+ ActivityInfo.WindowLayout layout = activity.getWindowLayout();
if (layout == null) {
layout = new ActivityInfo.WindowLayout(-1 /* width */, -1 /* widthFraction */,
-1 /* height */, -1 /* heightFraction */, Gravity.NO_GRAVITY,
diff --git a/core/java/android/content/pm/parsing/component/ParsedAttribution.java b/core/java/android/content/pm/parsing/component/ParsedAttribution.java
index 4ec2e73..db3a1c4 100644
--- a/core/java/android/content/pm/parsing/component/ParsedAttribution.java
+++ b/core/java/android/content/pm/parsing/component/ParsedAttribution.java
@@ -34,7 +34,7 @@
*
* @hide
*/
-@DataClass(genAidl = false)
+@DataClass(genAidl = false, genSetters = true, genBuilder = false)
public class ParsedAttribution implements Parcelable {
/** Maximum length of attribution tag */
public static final int MAX_ATTRIBUTION_TAG_LEN = 50;
@@ -43,13 +43,15 @@
private static final int MAX_NUM_ATTRIBUTIONS = 10000;
/** Tag of the attribution */
- public final @NonNull String tag;
+ private @NonNull String tag;
/** User visible label fo the attribution */
- public final @StringRes int label;
+ private @StringRes int label;
/** Ids of previously declared attributions this attribution inherits from */
- public final @NonNull List<String> inheritFrom;
+ private @NonNull List<String> inheritFrom;
+
+ public ParsedAttribution() {}
/**
* @return Is this set of attributions a valid combination for a single package?
@@ -160,6 +162,63 @@
// onConstructed(); // You can define this method to get a callback
}
+ /**
+ * Tag of the attribution
+ */
+ @DataClass.Generated.Member
+ public @NonNull String getTag() {
+ return tag;
+ }
+
+ /**
+ * User visible label fo the attribution
+ */
+ @DataClass.Generated.Member
+ public @StringRes int getLabel() {
+ return label;
+ }
+
+ /**
+ * Ids of previously declared attributions this attribution inherits from
+ */
+ @DataClass.Generated.Member
+ public @NonNull List<String> getInheritFrom() {
+ return inheritFrom;
+ }
+
+ /**
+ * Tag of the attribution
+ */
+ @DataClass.Generated.Member
+ public @NonNull ParsedAttribution setTag(@NonNull String value) {
+ tag = value;
+ com.android.internal.util.AnnotationValidations.validate(
+ NonNull.class, null, tag);
+ return this;
+ }
+
+ /**
+ * User visible label fo the attribution
+ */
+ @DataClass.Generated.Member
+ public @NonNull ParsedAttribution setLabel(@StringRes int value) {
+ label = value;
+ com.android.internal.util.AnnotationValidations.validate(
+ StringRes.class, null, label);
+ return this;
+ }
+
+ /**
+ * Ids of previously declared attributions this attribution inherits from
+ */
+ @DataClass.Generated.Member
+ public @NonNull ParsedAttribution setInheritFrom(@NonNull List<String> value) {
+ inheritFrom = value;
+ com.android.internal.util.AnnotationValidations.validate(
+ NonNull.class, null, inheritFrom);
+ return this;
+ }
+
@Override
@DataClass.Generated.Member
public void writeToParcel(@NonNull Parcel dest, int flags) {
@@ -215,10 +274,10 @@
};
@DataClass.Generated(
- time = 1618351459610L,
+ time = 1624050667337L,
codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/content/pm/parsing/component/ParsedAttribution.java",
- inputSignatures = "public static final int MAX_ATTRIBUTION_TAG_LEN\nprivate static final int MAX_NUM_ATTRIBUTIONS\npublic final @android.annotation.NonNull java.lang.String tag\npublic final @android.annotation.StringRes int label\npublic final @android.annotation.NonNull java.util.List<java.lang.String> inheritFrom\npublic static boolean isCombinationValid(java.util.List<android.content.pm.parsing.component.ParsedAttribution>)\nclass ParsedAttribution extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genAidl=false)")
+ inputSignatures = "public static final int MAX_ATTRIBUTION_TAG_LEN\nprivate static final int MAX_NUM_ATTRIBUTIONS\nprivate @android.annotation.NonNull java.lang.String tag\nprivate @android.annotation.StringRes int label\nprivate @android.annotation.NonNull java.util.List<java.lang.String> inheritFrom\npublic static boolean isCombinationValid(java.util.List<android.content.pm.parsing.component.ParsedAttribution>)\nclass ParsedAttribution extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genAidl=false, genSetters=true, genBuilder=false)")
@Deprecated
private void __metadata() {}
diff --git a/core/java/android/content/pm/parsing/component/ParsedComponent.java b/core/java/android/content/pm/parsing/component/ParsedComponent.java
index 9d830ec..3c0f097 100644
--- a/core/java/android/content/pm/parsing/component/ParsedComponent.java
+++ b/core/java/android/content/pm/parsing/component/ParsedComponent.java
@@ -48,33 +48,33 @@
@NonNull
@DataClass.ParcelWith(ForInternedString.class)
- private String name;
- int icon;
- int labelRes;
+ protected String name;
+ protected int icon;
+ protected int labelRes;
@Nullable
- CharSequence nonLocalizedLabel;
- int logo;
- int banner;
- int descriptionRes;
+ protected CharSequence nonLocalizedLabel;
+ protected int logo;
+ protected int banner;
+ protected int descriptionRes;
// TODO(b/135203078): Replace flags with individual booleans, scoped by subclass
- int flags;
+ protected int flags;
@NonNull
@DataClass.ParcelWith(ForInternedString.class)
- private String packageName;
+ protected String packageName;
@Nullable
@DataClass.PluralOf("intent")
@DataClass.ParcelWith(ParsedIntentInfo.ListParceler.class)
- private List<ParsedIntentInfo> intents;
+ protected List<ParsedIntentInfo> intents;
- private ComponentName componentName;
+ protected ComponentName componentName;
@Nullable
protected Bundle metaData;
- private Map<String, Property> mProperties = emptyMap();
+ protected Map<String, Property> mProperties = emptyMap();
ParsedComponent() {
@@ -112,11 +112,51 @@
return intents != null ? intents : Collections.emptyList();
}
+ public ParsedComponent setBanner(int banner) {
+ this.banner = banner;
+ return this;
+ }
+
+ public ParsedComponent setDescriptionRes(int descriptionRes) {
+ this.descriptionRes = descriptionRes;
+ return this;
+ }
+
+ public ParsedComponent setFlags(int flags) {
+ this.flags = flags;
+ return this;
+ }
+
+ public ParsedComponent setIcon(int icon) {
+ this.icon = icon;
+ return this;
+ }
+
+ public ParsedComponent setLabelRes(int labelRes) {
+ this.labelRes = labelRes;
+ return this;
+ }
+
+ public ParsedComponent setLogo(int logo) {
+ this.logo = logo;
+ return this;
+ }
+
+ public ParsedComponent setMetaData(Bundle metaData) {
+ this.metaData = metaData;
+ return this;
+ }
+
public ParsedComponent setName(String name) {
this.name = TextUtils.safeIntern(name);
return this;
}
+ public ParsedComponent setNonLocalizedLabel(CharSequence nonLocalizedLabel) {
+ this.nonLocalizedLabel = nonLocalizedLabel;
+ return this;
+ }
+
@CallSuper
public void setPackageName(@NonNull String packageName) {
this.packageName = TextUtils.safeIntern(packageName);
diff --git a/core/java/android/content/pm/parsing/component/ParsedComponentUtils.java b/core/java/android/content/pm/parsing/component/ParsedComponentUtils.java
index 46b9419..ab596d3 100644
--- a/core/java/android/content/pm/parsing/component/ParsedComponentUtils.java
+++ b/core/java/android/content/pm/parsing/component/ParsedComponentUtils.java
@@ -56,40 +56,40 @@
}
//noinspection ConstantConditions; null check done above with isEmpty
- component.setName(className);
- component.setPackageName(packageName);
+ component.setName(className)
+ .setPackageName(packageName);
int roundIconVal = useRoundIcon ? array.getResourceId(roundIconAttr, 0) : 0;
if (roundIconVal != 0) {
- component.icon = roundIconVal;
- component.nonLocalizedLabel = null;
+ component.setIcon(roundIconVal)
+ .setNonLocalizedLabel(null);
} else {
int iconVal = array.getResourceId(iconAttr, 0);
if (iconVal != 0) {
- component.icon = iconVal;
- component.nonLocalizedLabel = null;
+ component.setIcon(iconVal);
+ component.setNonLocalizedLabel(null);
}
}
int logoVal = array.getResourceId(logoAttr, 0);
if (logoVal != 0) {
- component.logo = logoVal;
+ component.setLogo(logoVal);
}
int bannerVal = array.getResourceId(bannerAttr, 0);
if (bannerVal != 0) {
- component.banner = bannerVal;
+ component.setBanner(bannerVal);
}
if (descriptionAttr != null) {
- component.descriptionRes = array.getResourceId(descriptionAttr, 0);
+ component.setDescriptionRes(array.getResourceId(descriptionAttr, 0));
}
TypedValue v = array.peekValue(labelAttr);
if (v != null) {
- component.labelRes = v.resourceId;
+ component.setLabelRes(v.resourceId);
if (v.resourceId == 0) {
- component.nonLocalizedLabel = v.coerceToString();
+ component.setNonLocalizedLabel(v.coerceToString());
}
}
@@ -105,9 +105,9 @@
}
final Property property = result.getResult();
if (property != null) {
- component.metaData = property.toBundle(component.metaData);
+ component.setMetaData(property.toBundle(component.getMetaData()));
}
- return input.success(component.metaData);
+ return input.success(component.getMetaData());
}
static ParseResult<Property> addProperty(ParsedComponent component, ParsingPackage pkg,
diff --git a/core/java/android/content/pm/parsing/component/ParsedInstrumentation.java b/core/java/android/content/pm/parsing/component/ParsedInstrumentation.java
index aa33e79..65ff472 100644
--- a/core/java/android/content/pm/parsing/component/ParsedInstrumentation.java
+++ b/core/java/android/content/pm/parsing/component/ParsedInstrumentation.java
@@ -36,18 +36,30 @@
@Nullable
@DataClass.ParcelWith(ForInternedString.class)
private String targetProcesses;
- boolean handleProfiling;
- boolean functionalTest;
+ private boolean handleProfiling;
+ private boolean functionalTest;
public ParsedInstrumentation() {
}
- public void setTargetPackage(@Nullable String targetPackage) {
- this.targetPackage = TextUtils.safeIntern(targetPackage);
+ public ParsedInstrumentation setFunctionalTest(boolean functionalTest) {
+ this.functionalTest = functionalTest;
+ return this;
}
- public void setTargetProcesses(@Nullable String targetProcesses) {
+ public ParsedInstrumentation setHandleProfiling(boolean handleProfiling) {
+ this.handleProfiling = handleProfiling;
+ return this;
+ }
+
+ public ParsedInstrumentation setTargetPackage(@Nullable String targetPackage) {
+ this.targetPackage = TextUtils.safeIntern(targetPackage);
+ return this;
+ }
+
+ public ParsedInstrumentation setTargetProcesses(@Nullable String targetProcesses) {
this.targetProcesses = TextUtils.safeIntern(targetProcesses);
+ return this;
}
public String toString() {
diff --git a/core/java/android/content/pm/parsing/component/ParsedInstrumentationUtils.java b/core/java/android/content/pm/parsing/component/ParsedInstrumentationUtils.java
index 89645fc..5977c83 100644
--- a/core/java/android/content/pm/parsing/component/ParsedInstrumentationUtils.java
+++ b/core/java/android/content/pm/parsing/component/ParsedInstrumentationUtils.java
@@ -59,10 +59,10 @@
// @formatter:off
// Note: don't allow this value to be a reference to a resource
// that may change.
- instrumentation.setTargetPackage(sa.getNonResourceString(R.styleable.AndroidManifestInstrumentation_targetPackage));
- instrumentation.setTargetProcesses(sa.getNonResourceString(R.styleable.AndroidManifestInstrumentation_targetProcesses));
- instrumentation.handleProfiling = sa.getBoolean(R.styleable.AndroidManifestInstrumentation_handleProfiling, false);
- instrumentation.functionalTest = sa.getBoolean(R.styleable.AndroidManifestInstrumentation_functionalTest, false);
+ instrumentation.setTargetPackage(sa.getNonResourceString(R.styleable.AndroidManifestInstrumentation_targetPackage))
+ .setTargetProcesses(sa.getNonResourceString(R.styleable.AndroidManifestInstrumentation_targetProcesses))
+ .setHandleProfiling(sa.getBoolean(R.styleable.AndroidManifestInstrumentation_handleProfiling, false))
+ .setFunctionalTest(sa.getBoolean(R.styleable.AndroidManifestInstrumentation_functionalTest, false));
// @formatter:on
} finally {
sa.recycle();
diff --git a/core/java/android/content/pm/parsing/component/ParsedIntentInfo.java b/core/java/android/content/pm/parsing/component/ParsedIntentInfo.java
index 463a181..01ee0f4 100644
--- a/core/java/android/content/pm/parsing/component/ParsedIntentInfo.java
+++ b/core/java/android/content/pm/parsing/component/ParsedIntentInfo.java
@@ -31,6 +31,26 @@
public static final Parceler PARCELER = new Parceler();
+ public ParsedIntentInfo setHasDefault(boolean hasDefault) {
+ this.hasDefault = hasDefault;
+ return this;
+ }
+
+ public ParsedIntentInfo setIcon(int icon) {
+ this.icon = icon;
+ return this;
+ }
+
+ public ParsedIntentInfo setLabelRes(int labelRes) {
+ this.labelRes = labelRes;
+ return this;
+ }
+
+ public ParsedIntentInfo setNonLocalizedLabel(CharSequence nonLocalizedLabel) {
+ this.nonLocalizedLabel = nonLocalizedLabel;
+ return this;
+ }
+
public static class Parceler implements Parcelling<ParsedIntentInfo> {
@Override
@@ -135,11 +155,11 @@
}
}
- boolean hasDefault;
- int labelRes;
+ private boolean hasDefault;
+ private int labelRes;
@Nullable
- CharSequence nonLocalizedLabel;
- int icon;
+ private CharSequence nonLocalizedLabel;
+ private int icon;
public ParsedIntentInfo() {
}
diff --git a/core/java/android/content/pm/parsing/component/ParsedIntentInfoUtils.java b/core/java/android/content/pm/parsing/component/ParsedIntentInfoUtils.java
index 939e77f..dd71fa4 100644
--- a/core/java/android/content/pm/parsing/component/ParsedIntentInfoUtils.java
+++ b/core/java/android/content/pm/parsing/component/ParsedIntentInfoUtils.java
@@ -60,19 +60,20 @@
TypedValue v = sa.peekValue(R.styleable.AndroidManifestIntentFilter_label);
if (v != null) {
- intentInfo.labelRes = v.resourceId;
+ intentInfo.setLabelRes(v.resourceId);
if (v.resourceId == 0) {
- intentInfo.nonLocalizedLabel = v.coerceToString();
+ intentInfo.setNonLocalizedLabel(v.coerceToString());
}
}
if (ParsingPackageUtils.sUseRoundIcon) {
- intentInfo.icon = sa.getResourceId(
- R.styleable.AndroidManifestIntentFilter_roundIcon, 0);
+ intentInfo.setIcon(sa.getResourceId(
+ R.styleable.AndroidManifestIntentFilter_roundIcon, 0));
}
- if (intentInfo.icon == 0) {
- intentInfo.icon = sa.getResourceId(R.styleable.AndroidManifestIntentFilter_icon, 0);
+ if (intentInfo.getIcon() == 0) {
+ intentInfo.setIcon(
+ sa.getResourceId(R.styleable.AndroidManifestIntentFilter_icon, 0));
}
if (allowAutoVerify) {
@@ -140,7 +141,7 @@
}
}
- intentInfo.hasDefault = intentInfo.hasCategory(Intent.CATEGORY_DEFAULT);
+ intentInfo.setHasDefault(intentInfo.hasCategory(Intent.CATEGORY_DEFAULT));
if (DEBUG) {
final StringBuilder cats = new StringBuilder("Intent d=");
diff --git a/core/java/android/content/pm/parsing/component/ParsedMainComponent.java b/core/java/android/content/pm/parsing/component/ParsedMainComponent.java
index 033e30f..433bfd3 100644
--- a/core/java/android/content/pm/parsing/component/ParsedMainComponent.java
+++ b/core/java/android/content/pm/parsing/component/ParsedMainComponent.java
@@ -31,16 +31,16 @@
@Nullable
@DataClass.ParcelWith(ForInternedString.class)
- private String processName;
- boolean directBootAware;
- boolean enabled = true;
- boolean exported;
- int order;
+ protected String processName;
+ protected boolean directBootAware;
+ protected boolean enabled = true;
+ protected boolean exported;
+ protected int order;
@Nullable
- String splitName;
+ protected String splitName;
@Nullable
- String[] attributionTags;
+ protected String[] attributionTags;
public ParsedMainComponent() {
}
@@ -56,6 +56,11 @@
this.attributionTags = other.attributionTags;
}
+ public ParsedMainComponent setOrder(int order) {
+ this.order = order;
+ return this;
+ }
+
public ParsedMainComponent setProcessName(String processName) {
this.processName = TextUtils.safeIntern(processName);
return this;
diff --git a/core/java/android/content/pm/parsing/component/ParsedMainComponentUtils.java b/core/java/android/content/pm/parsing/component/ParsedMainComponentUtils.java
index 54bcbdd..7ccca93 100644
--- a/core/java/android/content/pm/parsing/component/ParsedMainComponentUtils.java
+++ b/core/java/android/content/pm/parsing/component/ParsedMainComponentUtils.java
@@ -58,14 +58,14 @@
}
if (directBootAwareAttr != null) {
- component.directBootAware = array.getBoolean(directBootAwareAttr, false);
+ component.setDirectBootAware(array.getBoolean(directBootAwareAttr, false));
if (component.isDirectBootAware()) {
pkg.setPartiallyDirectBootAware(true);
}
}
if (enabledAttr != null) {
- component.enabled = array.getBoolean(enabledAttr, true);
+ component.setEnabled(array.getBoolean(enabledAttr, true));
}
if (processAttr != null) {
@@ -92,13 +92,13 @@
}
if (splitNameAttr != null) {
- component.splitName = array.getNonConfigurationString(splitNameAttr, 0);
+ component.setSplitName(array.getNonConfigurationString(splitNameAttr, 0));
}
if (attributionTagsAttr != null) {
final String attributionTags = array.getNonConfigurationString(attributionTagsAttr, 0);
if (attributionTags != null) {
- component.attributionTags = attributionTags.split("\\|");
+ component.setAttributionTags(attributionTags.split("\\|"));
}
}
diff --git a/core/java/android/content/pm/parsing/component/ParsedPermission.java b/core/java/android/content/pm/parsing/component/ParsedPermission.java
index 37e0e87..50bc3d9 100644
--- a/core/java/android/content/pm/parsing/component/ParsedPermission.java
+++ b/core/java/android/content/pm/parsing/component/ParsedPermission.java
@@ -38,17 +38,17 @@
private static ForStringSet sForStringSet = Parcelling.Cache.getOrCreate(ForStringSet.class);
@Nullable
- String backgroundPermission;
+ private String backgroundPermission;
@Nullable
@DataClass.ParcelWith(ForInternedString.class)
private String group;
- int requestRes;
- int protectionLevel;
- boolean tree;
+ private int requestRes;
+ private int protectionLevel;
+ private boolean tree;
@Nullable
private ParsedPermissionGroup parsedPermissionGroup;
@Nullable
- Set<String> knownCerts;
+ private Set<String> knownCerts;
@VisibleForTesting
public ParsedPermission() {
@@ -64,13 +64,13 @@
this.parsedPermissionGroup = other.parsedPermissionGroup;
}
- public ParsedPermission setGroup(String group) {
- this.group = TextUtils.safeIntern(group);
+ public ParsedPermission setBackgroundPermission(String backgroundPermission) {
+ this.backgroundPermission = backgroundPermission;
return this;
}
- public ParsedPermission setFlags(int flags) {
- this.flags = flags;
+ public ParsedPermission setGroup(String group) {
+ this.group = TextUtils.safeIntern(group);
return this;
}
@@ -116,6 +116,21 @@
return size;
}
+ public ParsedPermission setKnownCerts(Set<String> knownCerts) {
+ this.knownCerts = knownCerts;
+ return this;
+ }
+
+ public ParsedPermission setRequestRes(int requestRes) {
+ this.requestRes = requestRes;
+ return this;
+ }
+
+ public ParsedPermission setTree(boolean tree) {
+ this.tree = tree;
+ return this;
+ }
+
public String toString() {
return "Permission{"
+ Integer.toHexString(System.identityHashCode(this))
diff --git a/core/java/android/content/pm/parsing/component/ParsedPermissionGroup.java b/core/java/android/content/pm/parsing/component/ParsedPermissionGroup.java
index 741c00c..9fb95c4 100644
--- a/core/java/android/content/pm/parsing/component/ParsedPermissionGroup.java
+++ b/core/java/android/content/pm/parsing/component/ParsedPermissionGroup.java
@@ -22,17 +22,15 @@
import com.android.internal.util.DataClass;
/** @hide */
+@DataClass(genGetters = true, genSetters = true, genBuilder = false, genParcelable = true,
+ genAidl = false)
public class ParsedPermissionGroup extends ParsedComponent {
- int requestDetailResourceId;
- int backgroundRequestResourceId;
- int backgroundRequestDetailResourceId;
- int requestRes;
- int priority;
-
- public void setPriority(int priority) {
- this.priority = priority;
- }
+ private int requestDetailResourceId;
+ private int backgroundRequestResourceId;
+ private int backgroundRequestDetailResourceId;
+ private int requestRes;
+ private int priority;
public String toString() {
return "PermissionGroup{"
@@ -40,63 +38,162 @@
+ " " + getName() + "}";
}
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- super.writeToParcel(dest, flags);
- dest.writeInt(this.requestDetailResourceId);
- dest.writeInt(this.backgroundRequestResourceId);
- dest.writeInt(this.backgroundRequestDetailResourceId);
- dest.writeInt(this.requestRes);
- dest.writeInt(this.priority);
- }
-
public ParsedPermissionGroup() {
}
- protected ParsedPermissionGroup(Parcel in) {
- super(in);
- this.requestDetailResourceId = in.readInt();
- this.backgroundRequestResourceId = in.readInt();
- this.backgroundRequestDetailResourceId = in.readInt();
- this.requestRes = in.readInt();
- this.priority = in.readInt();
+
+
+ // Code below generated by codegen v1.0.23.
+ //
+ // DO NOT MODIFY!
+ // CHECKSTYLE:OFF Generated code
+ //
+ // To regenerate run:
+ // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/content/pm/parsing/component/ParsedPermissionGroup.java
+ //
+ // To exclude the generated code from IntelliJ auto-formatting enable (one-time):
+ // Settings > Editor > Code Style > Formatter Control
+ //@formatter:off
+
+
+ @DataClass.Generated.Member
+ public ParsedPermissionGroup(
+ int requestDetailResourceId,
+ int backgroundRequestResourceId,
+ int backgroundRequestDetailResourceId,
+ int requestRes,
+ int priority) {
+ this.requestDetailResourceId = requestDetailResourceId;
+ this.backgroundRequestResourceId = backgroundRequestResourceId;
+ this.backgroundRequestDetailResourceId = backgroundRequestDetailResourceId;
+ this.requestRes = requestRes;
+ this.priority = priority;
+
+ // onConstructed(); // You can define this method to get a callback
}
- public static final Parcelable.Creator<ParsedPermissionGroup> CREATOR =
- new Parcelable.Creator<ParsedPermissionGroup>() {
- @Override
- public ParsedPermissionGroup createFromParcel(Parcel source) {
- return new ParsedPermissionGroup(source);
- }
-
- @Override
- public ParsedPermissionGroup[] newArray(int size) {
- return new ParsedPermissionGroup[size];
- }
- };
-
+ @DataClass.Generated.Member
public int getRequestDetailResourceId() {
return requestDetailResourceId;
}
+ @DataClass.Generated.Member
public int getBackgroundRequestResourceId() {
return backgroundRequestResourceId;
}
+ @DataClass.Generated.Member
public int getBackgroundRequestDetailResourceId() {
return backgroundRequestDetailResourceId;
}
+ @DataClass.Generated.Member
public int getRequestRes() {
return requestRes;
}
+ @DataClass.Generated.Member
public int getPriority() {
return priority;
}
+
+ @DataClass.Generated.Member
+ public @android.annotation.NonNull ParsedPermissionGroup setRequestDetailResourceId( int value) {
+ requestDetailResourceId = value;
+ return this;
+ }
+
+ @DataClass.Generated.Member
+ public @android.annotation.NonNull ParsedPermissionGroup setBackgroundRequestResourceId( int value) {
+ backgroundRequestResourceId = value;
+ return this;
+ }
+
+ @DataClass.Generated.Member
+ public @android.annotation.NonNull ParsedPermissionGroup setBackgroundRequestDetailResourceId( int value) {
+ backgroundRequestDetailResourceId = value;
+ return this;
+ }
+
+ @DataClass.Generated.Member
+ public @android.annotation.NonNull ParsedPermissionGroup setRequestRes( int value) {
+ requestRes = value;
+ return this;
+ }
+
+ @DataClass.Generated.Member
+ public @android.annotation.NonNull ParsedPermissionGroup setPriority( int value) {
+ priority = value;
+ return this;
+ }
+
+ @Override
+ @DataClass.Generated.Member
+ public void writeToParcel(@android.annotation.NonNull Parcel dest, int flags) {
+ // You can override field parcelling by defining methods like:
+ // void parcelFieldName(Parcel dest, int flags) { ... }
+
+ super.writeToParcel(dest, flags);
+
+ dest.writeInt(requestDetailResourceId);
+ dest.writeInt(backgroundRequestResourceId);
+ dest.writeInt(backgroundRequestDetailResourceId);
+ dest.writeInt(requestRes);
+ dest.writeInt(priority);
+ }
+
+ @Override
+ @DataClass.Generated.Member
+ public int describeContents() { return 0; }
+
+ /** @hide */
+ @SuppressWarnings({"unchecked", "RedundantCast"})
+ @DataClass.Generated.Member
+ protected ParsedPermissionGroup(@android.annotation.NonNull Parcel in) {
+ // You can override field unparcelling by defining methods like:
+ // static FieldType unparcelFieldName(Parcel in) { ... }
+
+ super(in);
+
+ int _requestDetailResourceId = in.readInt();
+ int _backgroundRequestResourceId = in.readInt();
+ int _backgroundRequestDetailResourceId = in.readInt();
+ int _requestRes = in.readInt();
+ int _priority = in.readInt();
+
+ this.requestDetailResourceId = _requestDetailResourceId;
+ this.backgroundRequestResourceId = _backgroundRequestResourceId;
+ this.backgroundRequestDetailResourceId = _backgroundRequestDetailResourceId;
+ this.requestRes = _requestRes;
+ this.priority = _priority;
+
+ // onConstructed(); // You can define this method to get a callback
+ }
+
+ @DataClass.Generated.Member
+ public static final @android.annotation.NonNull Parcelable.Creator<ParsedPermissionGroup> CREATOR
+ = new Parcelable.Creator<ParsedPermissionGroup>() {
+ @Override
+ public ParsedPermissionGroup[] newArray(int size) {
+ return new ParsedPermissionGroup[size];
+ }
+
+ @Override
+ public ParsedPermissionGroup createFromParcel(@android.annotation.NonNull Parcel in) {
+ return new ParsedPermissionGroup(in);
+ }
+ };
+
+ @DataClass.Generated(
+ time = 1624052057830L,
+ codegenVersion = "1.0.23",
+ sourceFile = "frameworks/base/core/java/android/content/pm/parsing/component/ParsedPermissionGroup.java",
+ inputSignatures = "private int requestDetailResourceId\nprivate int backgroundRequestResourceId\nprivate int backgroundRequestDetailResourceId\nprivate int requestRes\nprivate int priority\npublic java.lang.String toString()\nclass ParsedPermissionGroup extends android.content.pm.parsing.component.ParsedComponent implements []\n@com.android.internal.util.DataClass(genGetters=true, genSetters=true, genBuilder=false, genParcelable=true, genAidl=false)")
+ @Deprecated
+ private void __metadata() {}
+
+
+ //@formatter:on
+ // End of generated code
+
}
diff --git a/core/java/android/content/pm/parsing/component/ParsedPermissionUtils.java b/core/java/android/content/pm/parsing/component/ParsedPermissionUtils.java
index 8afa70e..eec333c 100644
--- a/core/java/android/content/pm/parsing/component/ParsedPermissionUtils.java
+++ b/core/java/android/content/pm/parsing/component/ParsedPermissionUtils.java
@@ -66,9 +66,8 @@
if (sa.hasValue(
R.styleable.AndroidManifestPermission_backgroundPermission)) {
if ("android".equals(packageName)) {
- permission.backgroundPermission = sa.getNonResourceString(
- R.styleable
- .AndroidManifestPermission_backgroundPermission);
+ permission.setBackgroundPermission(sa.getNonResourceString(
+ R.styleable.AndroidManifestPermission_backgroundPermission));
} else {
Slog.w(TAG, packageName + " defines a background permission. Only the "
+ "'android' package can do that.");
@@ -78,17 +77,14 @@
// Note: don't allow this value to be a reference to a resource
// that may change.
permission.setGroup(sa.getNonResourceString(
- R.styleable.AndroidManifestPermission_permissionGroup));
-
- permission.requestRes = sa.getResourceId(
- R.styleable.AndroidManifestPermission_request, 0);
-
- permission.protectionLevel = sa.getInt(
- R.styleable.AndroidManifestPermission_protectionLevel,
- PermissionInfo.PROTECTION_NORMAL);
-
- permission.flags = sa.getInt(
- R.styleable.AndroidManifestPermission_permissionFlags, 0);
+ R.styleable.AndroidManifestPermission_permissionGroup))
+ .setRequestRes(sa.getResourceId(
+ R.styleable.AndroidManifestPermission_request, 0))
+ .setProtectionLevel(sa.getInt(
+ R.styleable.AndroidManifestPermission_protectionLevel,
+ PermissionInfo.PROTECTION_NORMAL))
+ .setFlags(sa.getInt(
+ R.styleable.AndroidManifestPermission_permissionFlags, 0));
final int knownCertsResource = sa.getResourceId(
R.styleable.AndroidManifestPermission_knownCerts, 0);
@@ -108,7 +104,7 @@
permission.setKnownCert(knownCert);
}
}
- if (permission.knownCerts == null) {
+ if (permission.getKnownCerts() == null) {
Slog.w(TAG, packageName + " defines a knownSigner permission but"
+ " the provided knownCerts resource is null");
}
@@ -124,12 +120,12 @@
// For now only platform runtime permissions can be restricted
if (!permission.isRuntime() || !"android".equals(permission.getPackageName())) {
- permission.flags &= ~PermissionInfo.FLAG_HARD_RESTRICTED;
- permission.flags &= ~PermissionInfo.FLAG_SOFT_RESTRICTED;
+ permission.setFlags(permission.getFlags() & ~PermissionInfo.FLAG_HARD_RESTRICTED);
+ permission.setFlags(permission.getFlags() & ~PermissionInfo.FLAG_SOFT_RESTRICTED);
} else {
// The platform does not get to specify conflicting permissions
- if ((permission.flags & PermissionInfo.FLAG_HARD_RESTRICTED) != 0
- && (permission.flags & PermissionInfo.FLAG_SOFT_RESTRICTED) != 0) {
+ if ((permission.getFlags() & PermissionInfo.FLAG_HARD_RESTRICTED) != 0
+ && (permission.getFlags() & PermissionInfo.FLAG_SOFT_RESTRICTED) != 0) {
throw new IllegalStateException("Permission cannot be both soft and hard"
+ " restricted: " + permission.getName());
}
@@ -138,7 +134,8 @@
sa.recycle();
}
- permission.protectionLevel = PermissionInfo.fixProtectionLevel(permission.protectionLevel);
+ permission.setProtectionLevel(
+ PermissionInfo.fixProtectionLevel(permission.getProtectionLevel()));
final int otherProtectionFlags = permission.getProtectionFlags()
& ~(PermissionInfo.PROTECTION_FLAG_APPOP | PermissionInfo.PROTECTION_FLAG_INSTANT
@@ -188,8 +185,8 @@
+ permission.getName());
}
- permission.protectionLevel = PermissionInfo.PROTECTION_NORMAL;
- permission.tree = true;
+ permission.setProtectionLevel(PermissionInfo.PROTECTION_NORMAL)
+ .setTree(true);
return ComponentParseUtils.parseAllMetaData(pkg, res, parser, tag, permission,
input);
@@ -219,12 +216,12 @@
}
// @formatter:off
- permissionGroup.requestDetailResourceId = sa.getResourceId(R.styleable.AndroidManifestPermissionGroup_requestDetail, 0);
- permissionGroup.backgroundRequestResourceId = sa.getResourceId(R.styleable.AndroidManifestPermissionGroup_backgroundRequest, 0);
- permissionGroup.backgroundRequestDetailResourceId = sa.getResourceId(R.styleable.AndroidManifestPermissionGroup_backgroundRequestDetail, 0);
- permissionGroup.requestRes = sa.getResourceId(R.styleable.AndroidManifestPermissionGroup_request, 0);
- permissionGroup.flags = sa.getInt(R.styleable.AndroidManifestPermissionGroup_permissionGroupFlags,0);
- permissionGroup.priority = sa.getInt(R.styleable.AndroidManifestPermissionGroup_priority, 0);
+ permissionGroup.setRequestDetailResourceId(sa.getResourceId(R.styleable.AndroidManifestPermissionGroup_requestDetail, 0))
+ .setBackgroundRequestResourceId(sa.getResourceId(R.styleable.AndroidManifestPermissionGroup_backgroundRequest, 0))
+ .setBackgroundRequestDetailResourceId(sa.getResourceId(R.styleable.AndroidManifestPermissionGroup_backgroundRequestDetail, 0))
+ .setRequestRes(sa.getResourceId(R.styleable.AndroidManifestPermissionGroup_request, 0))
+ .setPriority(sa.getInt(R.styleable.AndroidManifestPermissionGroup_priority, 0))
+ .setFlags(sa.getInt(R.styleable.AndroidManifestPermissionGroup_permissionGroupFlags,0));
// @formatter:on
} finally {
sa.recycle();
diff --git a/core/java/android/content/pm/parsing/component/ParsedProcess.java b/core/java/android/content/pm/parsing/component/ParsedProcess.java
index 54a60d3..c39d6b1 100644
--- a/core/java/android/content/pm/parsing/component/ParsedProcess.java
+++ b/core/java/android/content/pm/parsing/component/ParsedProcess.java
@@ -32,22 +32,22 @@
import java.util.Set;
/** @hide */
-@DataClass(genGetters = true, genSetters = false, genParcelable = true, genAidl = false,
+@DataClass(genGetters = true, genSetters = true, genParcelable = true, genAidl = false,
genBuilder = false)
public class ParsedProcess implements Parcelable {
@NonNull
- protected String name;
+ private String name;
@NonNull
@DataClass.ParcelWith(Parcelling.BuiltIn.ForInternedStringSet.class)
- protected Set<String> deniedPermissions = emptySet();
+ private Set<String> deniedPermissions = emptySet();
@ApplicationInfo.GwpAsanMode
- protected int gwpAsanMode = ApplicationInfo.GWP_ASAN_DEFAULT;
+ private int gwpAsanMode = ApplicationInfo.GWP_ASAN_DEFAULT;
@ApplicationInfo.MemtagMode
- protected int memtagMode = ApplicationInfo.MEMTAG_DEFAULT;
+ private int memtagMode = ApplicationInfo.MEMTAG_DEFAULT;
@ApplicationInfo.NativeHeapZeroInitialized
- protected int nativeHeapZeroInitialized = ApplicationInfo.ZEROINIT_DEFAULT;
+ private int nativeHeapZeroInitialized = ApplicationInfo.ZEROINIT_DEFAULT;
public ParsedProcess() {
}
@@ -63,7 +63,7 @@
- // Code below generated by codegen v1.0.22.
+ // Code below generated by codegen v1.0.23.
//
// DO NOT MODIFY!
// CHECKSTYLE:OFF Generated code
@@ -128,6 +128,46 @@
}
@DataClass.Generated.Member
+ public @NonNull ParsedProcess setName(@NonNull String value) {
+ name = value;
+ com.android.internal.util.AnnotationValidations.validate(
+ NonNull.class, null, name);
+ return this;
+ }
+
+ @DataClass.Generated.Member
+ public @NonNull ParsedProcess setDeniedPermissions(@NonNull Set<String> value) {
+ deniedPermissions = value;
+ com.android.internal.util.AnnotationValidations.validate(
+ NonNull.class, null, deniedPermissions);
+ return this;
+ }
+
+ @DataClass.Generated.Member
+ public @NonNull ParsedProcess setGwpAsanMode(@ApplicationInfo.GwpAsanMode int value) {
+ gwpAsanMode = value;
+ com.android.internal.util.AnnotationValidations.validate(
+ ApplicationInfo.GwpAsanMode.class, null, gwpAsanMode);
+ return this;
+ }
+
+ @DataClass.Generated.Member
+ public @NonNull ParsedProcess setMemtagMode(@ApplicationInfo.MemtagMode int value) {
+ memtagMode = value;
+ com.android.internal.util.AnnotationValidations.validate(
+ ApplicationInfo.MemtagMode.class, null, memtagMode);
+ return this;
+ }
+
+ @DataClass.Generated.Member
+ public @NonNull ParsedProcess setNativeHeapZeroInitialized(@ApplicationInfo.NativeHeapZeroInitialized int value) {
+ nativeHeapZeroInitialized = value;
+ com.android.internal.util.AnnotationValidations.validate(
+ ApplicationInfo.NativeHeapZeroInitialized.class, null, nativeHeapZeroInitialized);
+ return this;
+ }
+
+ @DataClass.Generated.Member
static Parcelling<Set<String>> sParcellingForDeniedPermissions =
Parcelling.Cache.get(
Parcelling.BuiltIn.ForInternedStringSet.class);
@@ -202,10 +242,10 @@
};
@DataClass.Generated(
- time = 1615850515058L,
- codegenVersion = "1.0.22",
+ time = 1623692988845L,
+ codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/content/pm/parsing/component/ParsedProcess.java",
- inputSignatures = "protected @android.annotation.NonNull java.lang.String name\nprotected @android.annotation.NonNull @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForInternedStringSet.class) java.util.Set<java.lang.String> deniedPermissions\nprotected @android.content.pm.ApplicationInfo.GwpAsanMode int gwpAsanMode\nprotected @android.content.pm.ApplicationInfo.MemtagMode int memtagMode\nprotected @android.content.pm.ApplicationInfo.NativeHeapZeroInitialized int nativeHeapZeroInitialized\npublic void addStateFrom(android.content.pm.parsing.component.ParsedProcess)\nclass ParsedProcess extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genGetters=true, genSetters=false, genParcelable=true, genAidl=false, genBuilder=false)")
+ inputSignatures = "private @android.annotation.NonNull java.lang.String name\nprivate @android.annotation.NonNull @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForInternedStringSet.class) java.util.Set<java.lang.String> deniedPermissions\nprivate @android.content.pm.ApplicationInfo.GwpAsanMode int gwpAsanMode\nprivate @android.content.pm.ApplicationInfo.MemtagMode int memtagMode\nprivate @android.content.pm.ApplicationInfo.NativeHeapZeroInitialized int nativeHeapZeroInitialized\npublic void addStateFrom(android.content.pm.parsing.component.ParsedProcess)\nclass ParsedProcess extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genGetters=true, genSetters=true, genParcelable=true, genAidl=false, genBuilder=false)")
@Deprecated
private void __metadata() {}
diff --git a/core/java/android/content/pm/parsing/component/ParsedProcessUtils.java b/core/java/android/content/pm/parsing/component/ParsedProcessUtils.java
index e417e74..d4e19af 100644
--- a/core/java/android/content/pm/parsing/component/ParsedProcessUtils.java
+++ b/core/java/android/content/pm/parsing/component/ParsedProcessUtils.java
@@ -85,31 +85,26 @@
TypedArray sa = res.obtainAttributes(parser, R.styleable.AndroidManifestProcess);
try {
if (perms != null) {
- proc.deniedPermissions = new ArraySet<>(perms);
+ proc.setDeniedPermissions(new ArraySet<>(perms));
}
- proc.name = sa.getNonConfigurationString(
+ String processName = sa.getNonConfigurationString(
R.styleable.AndroidManifestProcess_process, 0);
ParseResult<String> processNameResult = ComponentParseUtils.buildProcessName(
- pkg.getPackageName(), pkg.getPackageName(), proc.name, flags, separateProcesses,
+ pkg.getPackageName(), pkg.getPackageName(), processName, flags, separateProcesses,
input);
if (processNameResult.isError()) {
return input.error(processNameResult);
}
- proc.name = processNameResult.getResult();
-
- if (proc.name == null || proc.name.length() <= 0) {
- return input.error("<process> does not specify android:process");
- }
-
- proc.gwpAsanMode = sa.getInt(R.styleable.AndroidManifestProcess_gwpAsanMode, -1);
- proc.memtagMode = sa.getInt(R.styleable.AndroidManifestProcess_memtagMode, -1);
+ proc.setName(processNameResult.getResult());
+ proc.setGwpAsanMode(sa.getInt(R.styleable.AndroidManifestProcess_gwpAsanMode, -1));
+ proc.setMemtagMode(sa.getInt(R.styleable.AndroidManifestProcess_memtagMode, -1));
if (sa.hasValue(R.styleable.AndroidManifestProcess_nativeHeapZeroInitialized)) {
Boolean v = sa.getBoolean(
R.styleable.AndroidManifestProcess_nativeHeapZeroInitialized, false);
- proc.nativeHeapZeroInitialized =
- v ? ApplicationInfo.ZEROINIT_ENABLED : ApplicationInfo.ZEROINIT_DISABLED;
+ proc.setNativeHeapZeroInitialized(
+ v ? ApplicationInfo.ZEROINIT_ENABLED : ApplicationInfo.ZEROINIT_DISABLED);
}
} finally {
sa.recycle();
@@ -129,18 +124,18 @@
switch (tagName) {
case "deny-permission":
ParseResult<Set<String>> denyResult = parseDenyPermission(
- proc.deniedPermissions, res, parser, input);
+ proc.getDeniedPermissions(), res, parser, input);
result = denyResult;
if (denyResult.isSuccess()) {
- proc.deniedPermissions = denyResult.getResult();
+ proc.setDeniedPermissions(denyResult.getResult());
}
break;
case "allow-permission":
ParseResult<Set<String>> allowResult = parseAllowPermission(
- proc.deniedPermissions, res, parser, input);
+ proc.getDeniedPermissions(), res, parser, input);
result = allowResult;
if (allowResult.isSuccess()) {
- proc.deniedPermissions = allowResult.getResult();
+ proc.setDeniedPermissions(allowResult.getResult());
}
break;
default:
@@ -198,9 +193,9 @@
result = processResult;
if (processResult.isSuccess()) {
ParsedProcess process = processResult.getResult();
- if (processes.put(process.name, process) != null) {
+ if (processes.put(process.getName(), process) != null) {
result = input.error(
- "<process> specified existing name '" + process.name + "'");
+ "<process> specified existing name '" + process.getName() + "'");
}
}
break;
diff --git a/core/java/android/content/pm/parsing/component/ParsedProvider.java b/core/java/android/content/pm/parsing/component/ParsedProvider.java
index fcf6e87..ebf85f7 100644
--- a/core/java/android/content/pm/parsing/component/ParsedProvider.java
+++ b/core/java/android/content/pm/parsing/component/ParsedProvider.java
@@ -36,21 +36,21 @@
@NonNull
@DataClass.ParcelWith(ForInternedString.class)
private String authority;
- boolean syncable;
+ private boolean syncable;
@Nullable
@DataClass.ParcelWith(ForInternedString.class)
private String readPermission;
@Nullable
@DataClass.ParcelWith(ForInternedString.class)
private String writePermission;
- boolean grantUriPermissions;
- boolean forceUriPermissions;
- boolean multiProcess;
- int initOrder;
+ private boolean grantUriPermissions;
+ private boolean forceUriPermissions;
+ private boolean multiProcess;
+ private int initOrder;
@Nullable
- PatternMatcher[] uriPermissionPatterns;
+ private PatternMatcher[] uriPermissionPatterns;
@Nullable
- PathPermission[] pathPermissions;
+ private PathPermission[] pathPermissions;
public ParsedProvider(ParsedProvider other) {
super(other);
@@ -67,24 +67,58 @@
this.pathPermissions = other.pathPermissions;
}
- public void setAuthority(String authority) {
+ public ParsedProvider setAuthority(String authority) {
this.authority = TextUtils.safeIntern(authority);
+ return this;
}
- public void setSyncable(boolean syncable) {
+ public ParsedProvider setForceUriPermissions(boolean forceUriPermissions) {
+ this.forceUriPermissions = forceUriPermissions;
+ return this;
+ }
+
+ public ParsedProvider setGrantUriPermissions(boolean grantUriPermissions) {
+ this.grantUriPermissions = grantUriPermissions;
+ return this;
+ }
+
+ public ParsedProvider setInitOrder(int initOrder) {
+ this.initOrder = initOrder;
+ return this;
+ }
+
+ public ParsedProvider setMultiProcess(boolean multiProcess) {
+ this.multiProcess = multiProcess;
+ return this;
+ }
+
+ public ParsedProvider setPathPermissions(PathPermission[] pathPermissions) {
+ this.pathPermissions = pathPermissions;
+ return this;
+ }
+
+ public ParsedProvider setSyncable(boolean syncable) {
this.syncable = syncable;
+ return this;
}
- public void setReadPermission(String readPermission) {
+ public ParsedProvider setReadPermission(String readPermission) {
// Empty string must be converted to null
this.readPermission = TextUtils.isEmpty(readPermission)
? null : readPermission.intern();
+ return this;
}
- public void setWritePermission(String writePermission) {
+ public ParsedProvider setUriPermissionPatterns(PatternMatcher[] uriPermissionPatterns) {
+ this.uriPermissionPatterns = uriPermissionPatterns;
+ return this;
+ }
+
+ public ParsedProvider setWritePermission(String writePermission) {
// Empty string must be converted to null
this.writePermission = TextUtils.isEmpty(writePermission)
? null : writePermission.intern();
+ return this;
}
public String toString() {
diff --git a/core/java/android/content/pm/parsing/component/ParsedProviderUtils.java b/core/java/android/content/pm/parsing/component/ParsedProviderUtils.java
index 28fd919..0b03567 100644
--- a/core/java/android/content/pm/parsing/component/ParsedProviderUtils.java
+++ b/core/java/android/content/pm/parsing/component/ParsedProviderUtils.java
@@ -85,10 +85,10 @@
// For compatibility, applications targeting API level 16 or lower
// should have their content providers exported by default, unless they
// specify otherwise.
- provider.exported = sa.getBoolean(R.styleable.AndroidManifestProvider_exported,
- targetSdkVersion < Build.VERSION_CODES.JELLY_BEAN_MR1);
-
- provider.syncable = sa.getBoolean(R.styleable.AndroidManifestProvider_syncable, false);
+ provider.setSyncable(sa.getBoolean(
+ R.styleable.AndroidManifestProvider_syncable, false))
+ .setExported(sa.getBoolean(R.styleable.AndroidManifestProvider_exported,
+ targetSdkVersion < Build.VERSION_CODES.JELLY_BEAN_MR1));
String permission = sa.getNonConfigurationString(
R.styleable.AndroidManifestProvider_permission, 0);
@@ -113,16 +113,21 @@
provider.setWritePermission(writePermission);
}
- provider.grantUriPermissions = sa.getBoolean(R.styleable.AndroidManifestProvider_grantUriPermissions, false);
- provider.forceUriPermissions = sa.getBoolean(R.styleable.AndroidManifestProvider_forceUriPermissions, false);
- provider.multiProcess = sa.getBoolean(R.styleable.AndroidManifestProvider_multiprocess, false);
- provider.initOrder = sa.getInt(R.styleable.AndroidManifestProvider_initOrder, 0);
+ provider.setGrantUriPermissions(
+ sa.getBoolean(R.styleable.AndroidManifestProvider_grantUriPermissions, false))
+ .setForceUriPermissions(
+ sa.getBoolean(R.styleable.AndroidManifestProvider_forceUriPermissions,
+ false))
+ .setMultiProcess(
+ sa.getBoolean(R.styleable.AndroidManifestProvider_multiprocess, false))
+ .setInitOrder(sa.getInt(R.styleable.AndroidManifestProvider_initOrder, 0))
+ .setFlags(provider.getFlags() | flag(ProviderInfo.FLAG_SINGLE_USER,
+ R.styleable.AndroidManifestProvider_singleUser, sa));
- provider.flags |= flag(ProviderInfo.FLAG_SINGLE_USER, R.styleable.AndroidManifestProvider_singleUser, sa);
-
- visibleToEphemeral = sa.getBoolean(R.styleable.AndroidManifestProvider_visibleToInstantApps, false);
+ visibleToEphemeral = sa.getBoolean(
+ R.styleable.AndroidManifestProvider_visibleToInstantApps, false);
if (visibleToEphemeral) {
- provider.flags |= ProviderInfo.FLAG_VISIBLE_TO_INSTANT_APP;
+ provider.setFlags(provider.getFlags() | ProviderInfo.FLAG_VISIBLE_TO_INSTANT_APP);
pkg.setVisibleToInstantApps(true);
}
} finally {
@@ -174,7 +179,7 @@
result = intentResult;
if (intentResult.isSuccess()) {
ParsedIntentInfo intent = intentResult.getResult();
- provider.order = Math.max(intent.getOrder(), provider.order);
+ provider.setOrder(Math.max(intent.getOrder(), provider.getOrder()));
provider.addIntent(intent);
}
break;
@@ -245,17 +250,17 @@
}
if (pa != null) {
- if (provider.uriPermissionPatterns == null) {
- provider.uriPermissionPatterns = new PatternMatcher[1];
- provider.uriPermissionPatterns[0] = pa;
+ if (provider.getUriPermissionPatterns() == null) {
+ provider.setUriPermissionPatterns(new PatternMatcher[1]);
+ provider.getUriPermissionPatterns()[0] = pa;
} else {
- final int N = provider.uriPermissionPatterns.length;
+ final int N = provider.getUriPermissionPatterns().length;
PatternMatcher[] newp = new PatternMatcher[N + 1];
- System.arraycopy(provider.uriPermissionPatterns, 0, newp, 0, N);
+ System.arraycopy(provider.getUriPermissionPatterns(), 0, newp, 0, N);
newp[N] = pa;
- provider.uriPermissionPatterns = newp;
+ provider.setUriPermissionPatterns(newp);
}
- provider.grantUriPermissions = true;
+ provider.setGrantUriPermissions(true);
} else {
if (PackageParser.RIGID_PARSER) {
return input.error("No path, pathPrefix, or pathPattern for <path-permission>");
@@ -349,15 +354,15 @@
}
if (pa != null) {
- if (provider.pathPermissions == null) {
- provider.pathPermissions = new PathPermission[1];
- provider.pathPermissions[0] = pa;
+ if (provider.getPathPermissions() == null) {
+ provider.setPathPermissions(new PathPermission[1]);
+ provider.getPathPermissions()[0] = pa;
} else {
- final int N = provider.pathPermissions.length;
+ final int N = provider.getPathPermissions().length;
PathPermission[] newp = new PathPermission[N + 1];
- System.arraycopy(provider.pathPermissions, 0, newp, 0, N);
+ System.arraycopy(provider.getPathPermissions(), 0, newp, 0, N);
newp[N] = pa;
- provider.pathPermissions = newp;
+ provider.setPathPermissions(newp);
}
} else {
if (PackageParser.RIGID_PARSER) {
diff --git a/core/java/android/content/pm/parsing/component/ParsedService.java b/core/java/android/content/pm/parsing/component/ParsedService.java
index 7adb262..471d346 100644
--- a/core/java/android/content/pm/parsing/component/ParsedService.java
+++ b/core/java/android/content/pm/parsing/component/ParsedService.java
@@ -30,7 +30,7 @@
/** @hide **/
public class ParsedService extends ParsedMainComponent {
- int foregroundServiceType;
+ private int foregroundServiceType;
@Nullable
@DataClass.ParcelWith(ForInternedString.class)
private String permission;
@@ -41,6 +41,11 @@
this.permission = other.permission;
}
+ public ParsedService setForegroundServiceType(int foregroundServiceType) {
+ this.foregroundServiceType = foregroundServiceType;
+ return this;
+ }
+
public ParsedMainComponent setPermission(String permission) {
// Empty string must be converted to null
this.permission = TextUtils.isEmpty(permission) ? null : permission.intern();
diff --git a/core/java/android/content/pm/parsing/component/ParsedServiceUtils.java b/core/java/android/content/pm/parsing/component/ParsedServiceUtils.java
index ae107ce..59267f9 100644
--- a/core/java/android/content/pm/parsing/component/ParsedServiceUtils.java
+++ b/core/java/android/content/pm/parsing/component/ParsedServiceUtils.java
@@ -78,33 +78,32 @@
setExported = sa.hasValue(R.styleable.AndroidManifestService_exported);
if (setExported) {
- service.exported = sa.getBoolean(R.styleable.AndroidManifestService_exported,
- false);
+ service.setExported(sa.getBoolean(R.styleable.AndroidManifestService_exported,
+ false));
}
String permission = sa.getNonConfigurationString(
R.styleable.AndroidManifestService_permission, 0);
service.setPermission(permission != null ? permission : pkg.getPermission());
- service.foregroundServiceType = sa.getInt(
+ service.setForegroundServiceType(sa.getInt(
R.styleable.AndroidManifestService_foregroundServiceType,
- ServiceInfo.FOREGROUND_SERVICE_TYPE_NONE);
-
- service.flags |= flag(ServiceInfo.FLAG_STOP_WITH_TASK,
- R.styleable.AndroidManifestService_stopWithTask, sa)
- | flag(ServiceInfo.FLAG_ISOLATED_PROCESS,
- R.styleable.AndroidManifestService_isolatedProcess, sa)
- | flag(ServiceInfo.FLAG_EXTERNAL_SERVICE,
- R.styleable.AndroidManifestService_externalService, sa)
- | flag(ServiceInfo.FLAG_USE_APP_ZYGOTE,
- R.styleable.AndroidManifestService_useAppZygote, sa)
- | flag(ServiceInfo.FLAG_SINGLE_USER,
- R.styleable.AndroidManifestService_singleUser, sa);
+ ServiceInfo.FOREGROUND_SERVICE_TYPE_NONE))
+ .setFlags(service.getFlags() | (flag(ServiceInfo.FLAG_STOP_WITH_TASK,
+ R.styleable.AndroidManifestService_stopWithTask, sa)
+ | flag(ServiceInfo.FLAG_ISOLATED_PROCESS,
+ R.styleable.AndroidManifestService_isolatedProcess, sa)
+ | flag(ServiceInfo.FLAG_EXTERNAL_SERVICE,
+ R.styleable.AndroidManifestService_externalService, sa)
+ | flag(ServiceInfo.FLAG_USE_APP_ZYGOTE,
+ R.styleable.AndroidManifestService_useAppZygote, sa)
+ | flag(ServiceInfo.FLAG_SINGLE_USER,
+ R.styleable.AndroidManifestService_singleUser, sa)));
visibleToEphemeral = sa.getBoolean(
R.styleable.AndroidManifestService_visibleToInstantApps, false);
if (visibleToEphemeral) {
- service.flags |= ActivityInfo.FLAG_VISIBLE_TO_INSTANT_APP;
+ service.setFlags(service.getFlags() | ActivityInfo.FLAG_VISIBLE_TO_INSTANT_APP);
pkg.setVisibleToInstantApps(true);
}
} finally {
@@ -139,7 +138,7 @@
parseResult = intentResult;
if (intentResult.isSuccess()) {
ParsedIntentInfo intent = intentResult.getResult();
- service.order = Math.max(intent.getOrder(), service.order);
+ service.setOrder(Math.max(intent.getOrder(), service.getOrder()));
service.addIntent(intent);
}
break;
@@ -172,7 +171,7 @@
return input.error(exportedCheckResult);
}
}
- service.exported = hasIntentFilters;
+ service.setExported(hasIntentFilters);
}
return input.success(service);
diff --git a/core/java/android/content/pm/parsing/component/ParsedUsesPermission.java b/core/java/android/content/pm/parsing/component/ParsedUsesPermission.java
index adf8da0..020784d 100644
--- a/core/java/android/content/pm/parsing/component/ParsedUsesPermission.java
+++ b/core/java/android/content/pm/parsing/component/ParsedUsesPermission.java
@@ -24,6 +24,9 @@
import android.os.Parcel;
import android.os.Parcelable;
+import com.android.internal.util.DataClass;
+import com.android.internal.util.Parcelling;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -33,50 +36,135 @@
*
* @hide
*/
+@DataClass(genGetters = true, genSetters = true, genBuilder = false, genParcelable = true,
+ genAidl = false)
public class ParsedUsesPermission implements Parcelable {
- /** Name of the permission requested */
- public @NonNull String name;
- /** Set of flags that should apply to this permission request. */
- public @UsesPermissionFlags int usesPermissionFlags;
+ @DataClass.ParcelWith(Parcelling.BuiltIn.ForInternedString.class)
+ @NonNull
+ private String name;
+
+ @UsesPermissionFlags
+ private int usesPermissionFlags;
/**
- * Strong assertion by a developer that they will never use this permission
- * to derive the physical location of the device, regardless of
- * ACCESS_FINE_LOCATION and/or ACCESS_COARSE_LOCATION being granted.
+ * Strong assertion by a developer that they will never use this permission to derive the
+ * physical location of the device, regardless of ACCESS_FINE_LOCATION and/or
+ * ACCESS_COARSE_LOCATION being granted.
*/
public static final int FLAG_NEVER_FOR_LOCATION =
PackageInfo.REQUESTED_PERMISSION_NEVER_FOR_LOCATION;
- /** @hide */
+ /**
+ * @hide
+ */
@Retention(RetentionPolicy.SOURCE)
@IntDef(flag = true, prefix = { "FLAG_" }, value = {
FLAG_NEVER_FOR_LOCATION
})
public @interface UsesPermissionFlags {}
- public ParsedUsesPermission(@NonNull String name,
+
+
+ // Code below generated by codegen v1.0.23.
+ //
+ // DO NOT MODIFY!
+ // CHECKSTYLE:OFF Generated code
+ //
+ // To regenerate run:
+ // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/content/pm/parsing/component/ParsedUsesPermission.java
+ //
+ // To exclude the generated code from IntelliJ auto-formatting enable (one-time):
+ // Settings > Editor > Code Style > Formatter Control
+ //@formatter:off
+
+
+ @DataClass.Generated.Member
+ public ParsedUsesPermission(
+ @NonNull String name,
@UsesPermissionFlags int usesPermissionFlags) {
- this.name = name.intern();
+ this.name = name;
+ com.android.internal.util.AnnotationValidations.validate(
+ NonNull.class, null, name);
this.usesPermissionFlags = usesPermissionFlags;
+ com.android.internal.util.AnnotationValidations.validate(
+ UsesPermissionFlags.class, null, usesPermissionFlags);
+
+ // onConstructed(); // You can define this method to get a callback
+ }
+
+ @DataClass.Generated.Member
+ public @NonNull String getName() {
+ return name;
+ }
+
+ @DataClass.Generated.Member
+ public @UsesPermissionFlags int getUsesPermissionFlags() {
+ return usesPermissionFlags;
+ }
+
+ @DataClass.Generated.Member
+ public @NonNull ParsedUsesPermission setName(@NonNull String value) {
+ name = value;
+ com.android.internal.util.AnnotationValidations.validate(
+ NonNull.class, null, name);
+ return this;
+ }
+
+ @DataClass.Generated.Member
+ public @NonNull ParsedUsesPermission setUsesPermissionFlags(@UsesPermissionFlags int value) {
+ usesPermissionFlags = value;
+ com.android.internal.util.AnnotationValidations.validate(
+ UsesPermissionFlags.class, null, usesPermissionFlags);
+ return this;
+ }
+
+ @DataClass.Generated.Member
+ static Parcelling<String> sParcellingForName =
+ Parcelling.Cache.get(
+ Parcelling.BuiltIn.ForInternedString.class);
+ static {
+ if (sParcellingForName == null) {
+ sParcellingForName = Parcelling.Cache.put(
+ new Parcelling.BuiltIn.ForInternedString());
+ }
}
@Override
+ @DataClass.Generated.Member
public void writeToParcel(@NonNull Parcel dest, int flags) {
- sForInternedString.parcel(this.name, dest, flags);
+ // You can override field parcelling by defining methods like:
+ // void parcelFieldName(Parcel dest, int flags) { ... }
+
+ sParcellingForName.parcel(name, dest, flags);
dest.writeInt(usesPermissionFlags);
}
@Override
- public int describeContents() {
- return 0;
- }
+ @DataClass.Generated.Member
+ public int describeContents() { return 0; }
+ /** @hide */
+ @SuppressWarnings({"unchecked", "RedundantCast"})
+ @DataClass.Generated.Member
protected ParsedUsesPermission(@NonNull Parcel in) {
- this.name = sForInternedString.unparcel(in);
- this.usesPermissionFlags = in.readInt();
+ // You can override field unparcelling by defining methods like:
+ // static FieldType unparcelFieldName(Parcel in) { ... }
+
+ String _name = sParcellingForName.unparcel(in);
+ int _usesPermissionFlags = in.readInt();
+
+ this.name = _name;
+ com.android.internal.util.AnnotationValidations.validate(
+ NonNull.class, null, name);
+ this.usesPermissionFlags = _usesPermissionFlags;
+ com.android.internal.util.AnnotationValidations.validate(
+ UsesPermissionFlags.class, null, usesPermissionFlags);
+
+ // onConstructed(); // You can define this method to get a callback
}
+ @DataClass.Generated.Member
public static final @NonNull Parcelable.Creator<ParsedUsesPermission> CREATOR
= new Parcelable.Creator<ParsedUsesPermission>() {
@Override
@@ -89,4 +177,17 @@
return new ParsedUsesPermission(in);
}
};
+
+ @DataClass.Generated(
+ time = 1626207990753L,
+ codegenVersion = "1.0.23",
+ sourceFile = "frameworks/base/core/java/android/content/pm/parsing/component/ParsedUsesPermission.java",
+ inputSignatures = "private @com.android.internal.util.DataClass.ParcelWith(com.android.internal.util.Parcelling.BuiltIn.ForInternedString.class) @android.annotation.NonNull java.lang.String name\nprivate @android.content.pm.parsing.component.ParsedUsesPermission.UsesPermissionFlags int usesPermissionFlags\npublic static final int FLAG_NEVER_FOR_LOCATION\nclass ParsedUsesPermission extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genGetters=true, genSetters=true, genBuilder=false, genParcelable=true, genAidl=false)")
+ @Deprecated
+ private void __metadata() {}
+
+
+ //@formatter:on
+ // End of generated code
+
}
diff --git a/core/java/android/hardware/ISensorPrivacyManager.aidl b/core/java/android/hardware/ISensorPrivacyManager.aidl
index debc074..d69a9e1 100644
--- a/core/java/android/hardware/ISensorPrivacyManager.aidl
+++ b/core/java/android/hardware/ISensorPrivacyManager.aidl
@@ -48,4 +48,8 @@
void suppressIndividualSensorPrivacyReminders(int userId, int sensor, IBinder token,
boolean suppress);
+
+ void addUserGlobalIndividualSensorPrivacyListener(int sensor, in ISensorPrivacyListener listener);
+
+ void removeUserGlobalIndividualSensorPrivacyListener(int sensor, in ISensorPrivacyListener listener);
}
\ No newline at end of file
diff --git a/core/java/android/hardware/SensorPrivacyManager.java b/core/java/android/hardware/SensorPrivacyManager.java
index b7d95e7..4526ab77 100644
--- a/core/java/android/hardware/SensorPrivacyManager.java
+++ b/core/java/android/hardware/SensorPrivacyManager.java
@@ -24,6 +24,7 @@
import android.annotation.SystemService;
import android.annotation.TestApi;
import android.annotation.UserIdInt;
+import android.app.ActivityManager;
import android.content.Context;
import android.os.Binder;
import android.os.IBinder;
@@ -247,8 +248,7 @@
@RequiresPermission(Manifest.permission.OBSERVE_SENSOR_PRIVACY)
public void addSensorPrivacyListener(@Sensors.Sensor int sensor,
@NonNull OnSensorPrivacyChangedListener listener) {
- addSensorPrivacyListener(sensor, mContext.getUserId(), mContext.getMainExecutor(),
- listener);
+ addSensorPrivacyListener(sensor, mContext.getMainExecutor(), listener);
}
/**
@@ -283,7 +283,25 @@
@RequiresPermission(Manifest.permission.OBSERVE_SENSOR_PRIVACY)
public void addSensorPrivacyListener(@Sensors.Sensor int sensor, @NonNull Executor executor,
@NonNull OnSensorPrivacyChangedListener listener) {
- addSensorPrivacyListener(sensor, mContext.getUserId(), executor, listener);
+ Pair<OnSensorPrivacyChangedListener, Integer> key = new Pair<>(listener, sensor);
+ synchronized (mIndividualListeners) {
+ ISensorPrivacyListener iListener = mIndividualListeners.get(key);
+ if (iListener == null) {
+ iListener = new ISensorPrivacyListener.Stub() {
+ @Override
+ public void onSensorPrivacyChanged(boolean enabled) {
+ executor.execute(() -> listener.onSensorPrivacyChanged(sensor, enabled));
+ }
+ };
+ mIndividualListeners.put(key, iListener);
+ }
+
+ try {
+ mService.addUserGlobalIndividualSensorPrivacyListener(sensor, iListener);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
}
/**
@@ -361,7 +379,7 @@
@SystemApi
@RequiresPermission(Manifest.permission.OBSERVE_SENSOR_PRIVACY)
public boolean isSensorPrivacyEnabled(@Sensors.Sensor int sensor) {
- return isSensorPrivacyEnabled(sensor, mContext.getUserId());
+ return isSensorPrivacyEnabled(sensor, getCurrentUserId());
}
/**
@@ -392,7 +410,7 @@
@RequiresPermission(Manifest.permission.MANAGE_SENSOR_PRIVACY)
public void setSensorPrivacy(@Sources.Source int source, @Sensors.Sensor int sensor,
boolean enable) {
- setSensorPrivacy(source, sensor, enable, mContext.getUserId());
+ setSensorPrivacy(source, sensor, enable, getCurrentUserId());
}
/**
@@ -428,7 +446,7 @@
@RequiresPermission(Manifest.permission.MANAGE_SENSOR_PRIVACY)
public void setSensorPrivacyForProfileGroup(@Sources.Source int source,
@Sensors.Sensor int sensor, boolean enable) {
- setSensorPrivacyForProfileGroup(source , sensor, enable, mContext.getUserId());
+ setSensorPrivacyForProfileGroup(source , sensor, enable, getCurrentUserId());
}
/**
@@ -463,7 +481,7 @@
@RequiresPermission(Manifest.permission.MANAGE_SENSOR_PRIVACY)
public void suppressSensorPrivacyReminders(int sensor,
boolean suppress) {
- suppressSensorPrivacyReminders(sensor, suppress, mContext.getUserId());
+ suppressSensorPrivacyReminders(sensor, suppress, getCurrentUserId());
}
/**
@@ -590,4 +608,13 @@
throw e.rethrowFromSystemServer();
}
}
+
+ private int getCurrentUserId() {
+ try {
+ return ActivityManager.getService().getCurrentUserId();
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ return 0;
+ }
}
diff --git a/core/java/android/hardware/hdmi/HdmiControlManager.java b/core/java/android/hardware/hdmi/HdmiControlManager.java
index a3be415..dac1b49 100644
--- a/core/java/android/hardware/hdmi/HdmiControlManager.java
+++ b/core/java/android/hardware/hdmi/HdmiControlManager.java
@@ -36,12 +36,10 @@
import android.util.ArrayMap;
import android.util.Log;
-import com.android.internal.annotations.GuardedBy;
import com.android.internal.util.ConcurrentUtils;
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.Objects;
@@ -71,32 +69,6 @@
private static final int INVALID_PHYSICAL_ADDRESS = 0xFFFF;
/**
- * A cache of the current device's physical address. When device's HDMI out port
- * is not connected to any device, it is set to {@link #INVALID_PHYSICAL_ADDRESS}.
- *
- * <p>Otherwise it is updated by the {@link ClientHotplugEventListener} registered
- * with {@link com.android.server.hdmi.HdmiControlService} by the
- * {@link #addHotplugEventListener(HotplugEventListener)} and the address is from
- * {@link com.android.server.hdmi.HdmiControlService#getPortInfo()}
- */
- @GuardedBy("mLock")
- private int mLocalPhysicalAddress = INVALID_PHYSICAL_ADDRESS;
-
- private void setLocalPhysicalAddress(int physicalAddress) {
- synchronized (mLock) {
- mLocalPhysicalAddress = physicalAddress;
- }
- }
-
- private int getLocalPhysicalAddress() {
- synchronized (mLock) {
- return mLocalPhysicalAddress;
- }
- }
-
- private final Object mLock = new Object();
-
- /**
* Broadcast Action: Display OSD message.
* <p>Send when the service has a message to display on screen for events
* that need user's attention such as ARC status change.
@@ -972,37 +944,6 @@
mHasAudioSystemDevice = hasDeviceType(types, HdmiDeviceInfo.DEVICE_AUDIO_SYSTEM);
mHasSwitchDevice = hasDeviceType(types, HdmiDeviceInfo.DEVICE_PURE_CEC_SWITCH);
mIsSwitchDevice = HdmiProperties.is_switch().orElse(false);
- addHotplugEventListener(new ClientHotplugEventListener());
- }
-
- private final class ClientHotplugEventListener implements HotplugEventListener {
-
- @Override
- public void onReceived(HdmiHotplugEvent event) {
- List<HdmiPortInfo> ports = new ArrayList<>();
- try {
- ports = mService.getPortInfo();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- if (ports.isEmpty()) {
- Log.e(TAG, "Can't find port info, not updating connected status. "
- + "Hotplug event:" + event);
- return;
- }
- // If the HDMI OUT port is plugged or unplugged, update the mLocalPhysicalAddress
- for (HdmiPortInfo port : ports) {
- if (port.getId() == event.getPort()) {
- if (port.getType() == HdmiPortInfo.PORT_OUTPUT) {
- setLocalPhysicalAddress(
- event.isConnected()
- ? port.getAddress()
- : INVALID_PHYSICAL_ADDRESS);
- }
- break;
- }
- }
- }
}
private static boolean hasDeviceType(int[] types, int type) {
@@ -1404,7 +1345,11 @@
*/
@SystemApi
public int getPhysicalAddress() {
- return getLocalPhysicalAddress();
+ try {
+ return mService.getPhysicalAddress();
+ } catch (RemoteException e) {
+ return INVALID_PHYSICAL_ADDRESS;
+ }
}
/**
@@ -1421,7 +1366,7 @@
@SystemApi
public boolean isDeviceConnected(@NonNull HdmiDeviceInfo targetDevice) {
Objects.requireNonNull(targetDevice);
- int physicalAddress = getLocalPhysicalAddress();
+ int physicalAddress = getPhysicalAddress();
if (physicalAddress == INVALID_PHYSICAL_ADDRESS) {
return false;
}
@@ -1442,7 +1387,7 @@
@SystemApi
public boolean isRemoteDeviceConnected(@NonNull HdmiDeviceInfo targetDevice) {
Objects.requireNonNull(targetDevice);
- int physicalAddress = getLocalPhysicalAddress();
+ int physicalAddress = getPhysicalAddress();
if (physicalAddress == INVALID_PHYSICAL_ADDRESS) {
return false;
}
diff --git a/core/java/android/os/PerformanceHintManager.java b/core/java/android/os/PerformanceHintManager.java
index 6791844..a75b5ef 100644
--- a/core/java/android/os/PerformanceHintManager.java
+++ b/core/java/android/os/PerformanceHintManager.java
@@ -24,24 +24,23 @@
import com.android.internal.util.Preconditions;
import java.io.Closeable;
-import java.util.ArrayList;
/** The PerformanceHintManager allows apps to send performance hint to system. */
@SystemService(Context.PERFORMANCE_HINT_SERVICE)
public final class PerformanceHintManager {
- private static final String TAG = "PerformanceHintManager";
- private final IHintManager mService;
- // HAL preferred update rate
- private final long mPreferredRate;
+ private final long mNativeManagerPtr;
/** @hide */
- public PerformanceHintManager(IHintManager service) {
- mService = service;
- try {
- mPreferredRate = mService.getHintSessionPreferredRate();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
+ public static PerformanceHintManager create() throws ServiceManager.ServiceNotFoundException {
+ long nativeManagerPtr = nativeAcquireManager();
+ if (nativeManagerPtr == 0) {
+ throw new ServiceManager.ServiceNotFoundException(Context.PERFORMANCE_HINT_SERVICE);
}
+ return new PerformanceHintManager(nativeManagerPtr);
+ }
+
+ private PerformanceHintManager(long nativeManagerPtr) {
+ mNativeManagerPtr = nativeManagerPtr;
}
/**
@@ -57,16 +56,13 @@
*/
@Nullable
public Session createHintSession(@NonNull int[] tids, long initialTargetWorkDurationNanos) {
- try {
- IBinder token = new Binder();
- IHintSession session = mService.createHintSession(token, tids,
- initialTargetWorkDurationNanos);
- if (session == null) return null;
- return new Session(session, sNanoClock, mPreferredRate,
- initialTargetWorkDurationNanos);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ Preconditions.checkNotNull(tids, "tids cannot be null");
+ Preconditions.checkArgumentPositive(initialTargetWorkDurationNanos,
+ "the hint target duration should be positive.");
+ long nativeSessionPtr = nativeCreateSession(mNativeManagerPtr, tids,
+ initialTargetWorkDurationNanos);
+ if (nativeSessionPtr == 0) return null;
+ return new Session(nativeSessionPtr);
}
/**
@@ -75,7 +71,7 @@
* @return the preferred update rate supported by device software.
*/
public long getPreferredUpdateRateNanos() {
- return mPreferredRate;
+ return nativeGetPreferredUpdateRateNanos(mNativeManagerPtr);
}
/**
@@ -101,28 +97,21 @@
* <p>All timings should be in {@link SystemClock#elapsedRealtimeNanos()}.</p>
*/
public static class Session implements Closeable {
- private final IHintSession mSession;
- private final NanoClock mElapsedRealtimeClock;
- // Target duration for choosing update rate
- private long mTargetDurationInNanos;
- // HAL preferred update rate
- private long mPreferredRate;
- // Last update timestamp
- private long mLastUpdateTimeStamp = -1L;
- // Cached samples
- private final ArrayList<Long> mActualDurationNanos;
- private final ArrayList<Long> mTimeStampNanos;
+ private long mNativeSessionPtr;
/** @hide */
- public Session(IHintSession session, NanoClock elapsedRealtimeClock, long preferredRate,
- long durationNanos) {
- mSession = session;
- mElapsedRealtimeClock = elapsedRealtimeClock;
- mTargetDurationInNanos = durationNanos;
- mPreferredRate = preferredRate;
- mActualDurationNanos = new ArrayList<Long>();
- mTimeStampNanos = new ArrayList<Long>();
- mLastUpdateTimeStamp = mElapsedRealtimeClock.nanos();
+ public Session(long nativeSessionPtr) {
+ mNativeSessionPtr = nativeSessionPtr;
+ }
+
+ /** @hide */
+ @Override
+ protected void finalize() throws Throwable {
+ try {
+ close();
+ } finally {
+ super.finalize();
+ }
}
/**
@@ -133,19 +122,7 @@
public void updateTargetWorkDuration(long targetDurationNanos) {
Preconditions.checkArgumentPositive(targetDurationNanos, "the hint target duration"
+ " should be positive.");
- try {
- mSession.updateTargetWorkDuration(targetDurationNanos);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- mTargetDurationInNanos = targetDurationNanos;
- /**
- * Most of the workload is target_duration dependent, so now clear the cached samples
- * as they are most likely obsolete.
- */
- mActualDurationNanos.clear();
- mTimeStampNanos.clear();
- mLastUpdateTimeStamp = mElapsedRealtimeClock.nanos();
+ nativeUpdateTargetWorkDuration(mNativeSessionPtr, targetDurationNanos);
}
/**
@@ -161,38 +138,7 @@
public void reportActualWorkDuration(long actualDurationNanos) {
Preconditions.checkArgumentPositive(actualDurationNanos, "the actual duration should"
+ " be positive.");
- final long now = mElapsedRealtimeClock.nanos();
- mActualDurationNanos.add(actualDurationNanos);
- mTimeStampNanos.add(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.
- */
- long rateLimit =
- actualDurationNanos > mTargetDurationInNanos ? mPreferredRate
- : 10 * mPreferredRate;
-
- if (now - mLastUpdateTimeStamp <= rateLimit) {
- return;
- }
- Preconditions.checkState(mActualDurationNanos.size() == mTimeStampNanos.size());
- final int size = mActualDurationNanos.size();
- long[] actualDurationArray = new long[size];
- long[] timeStampArray = new long[size];
- for (int i = 0; i < size; i++) {
- actualDurationArray[i] = mActualDurationNanos.get(i);
- timeStampArray[i] = mTimeStampNanos.get(i);
- }
- try {
- mSession.reportActualWorkDuration(actualDurationArray, timeStampArray);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- mActualDurationNanos.clear();
- mTimeStampNanos.clear();
- mLastUpdateTimeStamp = now;
+ nativeReportActualWorkDuration(mNativeSessionPtr, actualDurationNanos);
}
/**
@@ -201,26 +147,20 @@
* <p>Once called, you should not call anything else on this object.</p>
*/
public void close() {
- try {
- mSession.close();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
+ if (mNativeSessionPtr != 0) {
+ nativeCloseSession(mNativeSessionPtr);
+ mNativeSessionPtr = 0;
}
}
}
- /**
- * The interface is to make the FakeClock for testing.
- * @hide
- */
- public interface NanoClock {
- /** Gets the current nanosecond instant of the clock. */
- long nanos();
- }
-
- private static final NanoClock sNanoClock = new NanoClock() {
- public long nanos() {
- return SystemClock.elapsedRealtimeNanos();
- }
- };
+ private static native long nativeAcquireManager();
+ private static native long nativeGetPreferredUpdateRateNanos(long nativeManagerPtr);
+ private static native long nativeCreateSession(long nativeManagerPtr,
+ int[] tids, long initialTargetWorkDurationNanos);
+ private static native void nativeUpdateTargetWorkDuration(long nativeSessionPtr,
+ long targetDurationNanos);
+ private static native void nativeReportActualWorkDuration(long nativeSessionPtr,
+ long actualDurationNanos);
+ private static native void nativeCloseSession(long nativeSessionPtr);
}
diff --git a/core/java/android/provider/DeviceConfig.java b/core/java/android/provider/DeviceConfig.java
index 880d03a..ded598a 100644
--- a/core/java/android/provider/DeviceConfig.java
+++ b/core/java/android/provider/DeviceConfig.java
@@ -846,8 +846,8 @@
/**
* Delete a property with the provided name and value in the provided namespace
*
- * @param namespace The namespace containing the property to create or update.
- * @param name The name of the property to create or update.
+ * @param namespace The namespace containing the property to delete.
+ * @param name The name of the property to delete.
* @return True if the property was deleted or it did not exist in the first place.
* False if the storage implementation throws errors.
* @hide
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index d6d3412..d824226 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -4000,6 +4000,16 @@
public static final int ADVANCED_SETTINGS_DEFAULT = 0;
/**
+ * If the triple press gesture for toggling accessibility is enabled.
+ * Set to 1 for true and 0 for false.
+ *
+ * This setting is used only internally.
+ * @hide
+ */
+ public static final String WEAR_ACCESSIBILITY_GESTURE_ENABLED
+ = "wear_accessibility_gesture_enabled";
+
+ /**
* @deprecated Use {@link android.provider.Settings.Global#AIRPLANE_MODE_ON} instead
*/
@Deprecated
@@ -5261,6 +5271,7 @@
PRIVATE_SETTINGS.add(WIFI_USE_STATIC_IP);
PRIVATE_SETTINGS.add(END_BUTTON_BEHAVIOR);
PRIVATE_SETTINGS.add(ADVANCED_SETTINGS);
+ PRIVATE_SETTINGS.add(WEAR_ACCESSIBILITY_GESTURE_ENABLED);
PRIVATE_SETTINGS.add(SCREEN_AUTO_BRIGHTNESS_ADJ);
PRIVATE_SETTINGS.add(VIBRATE_INPUT_DEVICES);
PRIVATE_SETTINGS.add(VOLUME_MASTER);
@@ -6399,8 +6410,15 @@
public static final String DATA_ROAMING = Global.DATA_ROAMING;
/**
- * Setting to record the input method used by default, holding the ID
- * of the desired method.
+ * Stores {@link android.view.inputmethod.InputMethodInfo#getId()} of the input method
+ * service that is currently selected.
+ *
+ * <p>Although the name {@link #DEFAULT_INPUT_METHOD} implies that there is a concept of
+ * <i>default</i> input method, in reality this setting is no more or less than the
+ * <strong>currently selected</strong> input method. This setting can be updated at any
+ * time as a result of user-initiated and system-initiated input method switching.</p>
+ *
+ * <p>Use {@link ComponentName#unflattenFromString(String)} to parse the stored value.</p>
*/
@Readable
public static final String DEFAULT_INPUT_METHOD = "default_input_method";
@@ -9985,15 +10003,18 @@
/**
* Controls the accessibility button mode. System will force-set the value to {@link
- * #ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU} if {@link #NAVIGATION_MODE} is fully
- * gestural.
+ * #ACCESSIBILITY_BUTTON_MODE_GESTURE} if {@link #NAVIGATION_MODE} is button; force-set the
+ * value to {@link ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR} if {@link #NAVIGATION_MODE} is
+ * gestural; otherwise, remain the option.
* <ul>
* <li> 0 = button in navigation bar </li>
* <li> 1 = button floating on the display </li>
+ * <li> 2 = button using gesture to trigger </li>
* </ul>
*
* @see #ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR
* @see #ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU
+ * @see #ACCESSIBILITY_BUTTON_MODE_GESTURE
* @hide
*/
public static final String ACCESSIBILITY_BUTTON_MODE =
@@ -10016,6 +10037,14 @@
public static final int ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU = 0x1;
/**
+ * Accessibility button mode value that specifying the accessibility service or feature to
+ * be toggled via the gesture.
+ *
+ * @hide
+ */
+ public static final int ACCESSIBILITY_BUTTON_MODE_GESTURE = 0x2;
+
+ /**
* The size of the accessibility floating menu.
* <ul>
* <li> 0 = small size
diff --git a/core/java/android/service/voice/HotwordDetectionService.java b/core/java/android/service/voice/HotwordDetectionService.java
index a435239..e3bb589 100644
--- a/core/java/android/service/voice/HotwordDetectionService.java
+++ b/core/java/android/service/voice/HotwordDetectionService.java
@@ -72,8 +72,7 @@
@SystemApi
public abstract class HotwordDetectionService extends Service {
private static final String TAG = "HotwordDetectionService";
- // TODO (b/177502877): Set the Debug flag to false before shipping.
- private static final boolean DBG = true;
+ private static final boolean DBG = false;
private static final long UPDATE_TIMEOUT_MILLIS = 5000;
@@ -151,9 +150,7 @@
@Override
public void updateState(PersistableBundle options, SharedMemory sharedMemory,
IRemoteCallback callback) throws RemoteException {
- if (DBG) {
- Log.d(TAG, "#updateState");
- }
+ Log.v(TAG, "#updateState" + (callback != null ? " with callback" : ""));
HotwordDetectionService.this.onUpdateStateInternal(
options,
sharedMemory,
diff --git a/core/java/android/service/voice/SoftwareHotwordDetector.java b/core/java/android/service/voice/SoftwareHotwordDetector.java
index fb540b1..02294e5 100644
--- a/core/java/android/service/voice/SoftwareHotwordDetector.java
+++ b/core/java/android/service/voice/SoftwareHotwordDetector.java
@@ -47,7 +47,7 @@
**/
class SoftwareHotwordDetector extends AbstractHotwordDetector {
private static final String TAG = SoftwareHotwordDetector.class.getSimpleName();
- private static final boolean DEBUG = true;
+ private static final boolean DEBUG = false;
private final IVoiceInteractionManagerService mManagerService;
private final HotwordDetector.Callback mCallback;
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java
index fe1fcfc..7a61511 100644
--- a/core/java/android/service/wallpaper/WallpaperService.java
+++ b/core/java/android/service/wallpaper/WallpaperService.java
@@ -1033,6 +1033,9 @@
.build();
updateSurfaceDimming();
}
+ // Propagate transform hint from WM so we can use the right hint for the
+ // first frame.
+ mBbqSurfaceControl.setTransformHint(mSurfaceControl.getTransformHint());
Surface blastSurface = getOrCreateBLASTSurface(mSurfaceSize.x,
mSurfaceSize.y, mFormat);
// If blastSurface == null that means it hasn't changed since the last
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java
index b300f30..d6186d7 100644
--- a/core/java/android/view/SurfaceControl.java
+++ b/core/java/android/view/SurfaceControl.java
@@ -148,6 +148,8 @@
float width, float height, float vecX, float vecY,
float maxStretchAmountX, float maxStretchAmountY, float childRelativeLeft,
float childRelativeTop, float childRelativeRight, float childRelativeBottom);
+ private static native void nativeSetTrustedOverlay(long transactionObj, long nativeObject,
+ boolean isTrustedOverlay);
private static native boolean nativeClearContentFrameStats(long nativeObject);
private static native boolean nativeGetContentFrameStats(long nativeObject, WindowContentFrameStats outStats);
@@ -3435,6 +3437,17 @@
return this;
}
+ /**
+ * Sets the trusted overlay state on this SurfaceControl and it is inherited to all the
+ * children. The caller must hold the ACCESS_SURFACE_FLINGER permission.
+ * @hide
+ */
+ public Transaction setTrustedOverlay(SurfaceControl sc, boolean isTrustedOverlay) {
+ checkPreconditions(sc);
+ nativeSetTrustedOverlay(mNativeObject, sc.mNativeObject, isTrustedOverlay);
+ return this;
+ }
+
/**
* Merge the other transaction into this transaction, clearing the
* other transaction as if it had been applied.
diff --git a/core/java/android/view/TextureView.java b/core/java/android/view/TextureView.java
index fc0ec4c..b55ae1e 100644
--- a/core/java/android/view/TextureView.java
+++ b/core/java/android/view/TextureView.java
@@ -34,8 +34,8 @@
import android.util.Log;
/**
- * <p>A TextureView can be used to display a content stream. Such a content
- * stream can for instance be a video or an OpenGL scene. The content stream
+ * <p>A TextureView can be used to display a content stream, such as that
+ * coming from a camera preview, a video, or an OpenGL scene. The content stream
* can come from the application's process as well as a remote process.</p>
*
* <p>TextureView can only be used in a hardware accelerated window. When
@@ -43,56 +43,81 @@
*
* <p>Unlike {@link SurfaceView}, TextureView does not create a separate
* window but behaves as a regular View. This key difference allows a
- * TextureView to be moved, transformed, animated, etc. For instance, you
- * can make a TextureView semi-translucent by calling
- * <code>myView.setAlpha(0.5f)</code>.</p>
+ * TextureView to have translucency, arbitrary rotations, and complex
+ * clipping. For example, you can make a TextureView semi-translucent by
+ * calling <code>myView.setAlpha(0.5f)</code>.</p>
+ *
+ * <p>One implication of this integration of TextureView into the view
+ * hierarchy is that it may have slower performance than
+ * SurfaceView. TextureView contents must be copied, internally, from the
+ * underlying surface into the view displaying those contents. For
+ * that reason, SurfaceView is recommended as a more general solution
+ * to problems requiring rendering to surfaces.</p>
*
* <p>Using a TextureView is simple: all you need to do is get its
* {@link SurfaceTexture}. The {@link SurfaceTexture} can then be used to
- * render content. The following example demonstrates how to render the
- * camera preview into a TextureView:</p>
+ * render content. The following example demonstrates how to render a video
+ * into a TextureView:</p>
*
* <pre>
- * public class LiveCameraActivity extends Activity implements TextureView.SurfaceTextureListener {
- * private Camera mCamera;
+ * public class MyActivity extends Activity implements TextureView.SurfaceTextureListener {
+ * private MediaPlayer mMediaPlayer;
* private TextureView mTextureView;
*
* protected void onCreate(Bundle savedInstanceState) {
* super.onCreate(savedInstanceState);
*
+ * mMediaPlayer = new MediaPlayer();
+ *
* mTextureView = new TextureView(this);
* mTextureView.setSurfaceTextureListener(this);
- *
* setContentView(mTextureView);
* }
*
- * public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
- * mCamera = Camera.open();
- *
- * try {
- * mCamera.setPreviewTexture(surface);
- * mCamera.startPreview();
- * } catch (IOException ioe) {
- * // Something bad happened
- * }
+ * public void onSurfaceTextureAvailable(@NonNull SurfaceTexture surfaceTexture,
+ * int width, int height) {
+ * AssetFileDescriptor fileDescriptor = // get file descriptor
+ * mMediaPlayer.setDataSource(fileDescriptor);
+ * mMediaPlayer.setSurface(new Surface(surfaceTexture));
+ * mMediaPlayer.prepareAsync();
+ * mMediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
+ * @Override
+ * public void onPrepared(MediaPlayer mp) {
+ * mMediaPlayer.start();
+ * }
+ * });
+ * } catch (IOException e) {
+ * e.printStackTrace();
+ * }
* }
*
- * public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {
- * // Ignored, Camera does all the work for us
- * }
+ * @Override
+ * public void onSurfaceTextureSizeChanged(@NonNull SurfaceTexture surfaceTexture,
+ * int width, int height) {
+ * // Handle size change depending on media needs
+ * }
*
- * public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
- * mCamera.stopPreview();
- * mCamera.release();
- * return true;
- * }
+ * @Override
+ * public boolean onSurfaceTextureDestroyed(@NonNull SurfaceTexture surfaceTexture) {
+ * // Release unneeded resources
+ * mMediaPlayer.stop();
+ * mMediaPlayer.release();
+ * return true;
+ * }
*
- * public void onSurfaceTextureUpdated(SurfaceTexture surface) {
- * // Invoked every time there's a new Camera preview frame
- * }
+ * @Override
+ * public void onSurfaceTextureUpdated(@NonNull SurfaceTexture surfaceTexture) {
+ * // Invoked every time there's a new video frame
+ * }
+ *
* }
* </pre>
*
+ * <p>Similarly, TextureView can supply the surface needed for GL rendering or
+ * camera previews. Camera2 APIs require the surface created by TextureView,
+ * although developers are recommended to use the CameraX APIs instead, for which
+ * PreviewView creates its own TextureView or SurfaceView internally.</p>
+ *
* <p>A TextureView's SurfaceTexture can be obtained either by invoking
* {@link #getSurfaceTexture()} or by using a {@link SurfaceTextureListener}.
* It is important to know that a SurfaceTexture is available only after the
diff --git a/core/java/android/view/autofill/AutofillClientController.java b/core/java/android/view/autofill/AutofillClientController.java
new file mode 100644
index 0000000..d4cd968
--- /dev/null
+++ b/core/java/android/view/autofill/AutofillClientController.java
@@ -0,0 +1,483 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.view.autofill;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.app.Activity;
+import android.app.Application;
+import android.content.ComponentName;
+import android.content.Intent;
+import android.content.IntentSender;
+import android.graphics.Rect;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.text.TextUtils;
+import android.util.Log;
+import android.util.Slog;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.ViewRootImpl;
+import android.view.WindowManagerGlobal;
+
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+/**
+ * A controller to manage the autofill requests for the {@link Activity}.
+ *
+ * @hide
+ */
+public final class AutofillClientController implements AutofillManager.AutofillClient {
+
+ private static final String TAG = "AutofillClientController";
+
+ private static final String LOG_TAG = "autofill_client";
+ public static final boolean DEBUG = Log.isLoggable(LOG_TAG, Log.DEBUG);
+
+ public static final String LAST_AUTOFILL_ID = "android:lastAutofillId";
+ public static final String AUTOFILL_RESET_NEEDED = "@android:autofillResetNeeded";
+ public static final String AUTO_FILL_AUTH_WHO_PREFIX = "@android:autoFillAuth:";
+
+ /** The last autofill id that was returned from {@link #getNextAutofillId()} */
+ public int mLastAutofillId = View.LAST_APP_AUTOFILL_ID;
+
+ @NonNull
+ private final Activity mActivity;
+ /** The autofill manager. Always access via {@link #getAutofillManager()}. */
+ @Nullable
+ private AutofillManager mAutofillManager;
+ /** The autofill dropdown fill ui. */
+ @Nullable
+ private AutofillPopupWindow mAutofillPopupWindow;
+ private boolean mAutoFillResetNeeded;
+ private boolean mAutoFillIgnoreFirstResumePause;
+
+ /**
+ * AutofillClientController constructor.
+ */
+ public AutofillClientController(Activity activity) {
+ mActivity = activity;
+ }
+
+ private AutofillManager getAutofillManager() {
+ if (mAutofillManager == null) {
+ mAutofillManager = mActivity.getSystemService(AutofillManager.class);
+ }
+ return mAutofillManager;
+ }
+
+ // ------------------ Called for Activity events ------------------
+
+ /**
+ * Called when the Activity is attached.
+ */
+ public void onActivityAttached(Application application) {
+ mActivity.setAutofillOptions(application.getAutofillOptions());
+ }
+
+ /**
+ * Called when the {@link Activity#onCreate(Bundle)} is called.
+ */
+ public void onActivityCreated(@NonNull Bundle savedInstanceState) {
+ mAutoFillResetNeeded = savedInstanceState.getBoolean(AUTOFILL_RESET_NEEDED, false);
+ mLastAutofillId = savedInstanceState.getInt(LAST_AUTOFILL_ID, View.LAST_APP_AUTOFILL_ID);
+ if (mAutoFillResetNeeded) {
+ getAutofillManager().onCreate(savedInstanceState);
+ }
+ }
+
+ /**
+ * Called when the {@link Activity#onStart()} is called.
+ */
+ public void onActivityStarted() {
+ if (mAutoFillResetNeeded) {
+ getAutofillManager().onVisibleForAutofill();
+ }
+ }
+
+ /**
+ * Called when the {@link Activity#onResume()} is called.
+ */
+ public void onActivityResumed() {
+ enableAutofillCompatibilityIfNeeded();
+ if (mAutoFillResetNeeded) {
+ if (!mAutoFillIgnoreFirstResumePause) {
+ View focus = mActivity.getCurrentFocus();
+ if (focus != null && focus.canNotifyAutofillEnterExitEvent()) {
+ // TODO(b/148815880): Bring up keyboard if resumed from inline authentication.
+ // TODO: in Activity killed/recreated case, i.e. SessionLifecycleTest#
+ // testDatasetVisibleWhileAutofilledAppIsLifecycled: the View's initial
+ // window visibility after recreation is INVISIBLE in onResume() and next frame
+ // ViewRootImpl.performTraversals() changes window visibility to VISIBLE.
+ // So we cannot call View.notifyEnterOrExited() which will do nothing
+ // when View.isVisibleToUser() is false.
+ getAutofillManager().notifyViewEntered(focus);
+ }
+ }
+ }
+ }
+
+ /**
+ * Called when the Activity is performing resume.
+ */
+ public void onActivityPerformResume(boolean followedByPause) {
+ if (mAutoFillResetNeeded) {
+ // When Activity is destroyed in paused state, and relaunch activity, there will be
+ // extra onResume and onPause event, ignore the first onResume and onPause.
+ // see ActivityThread.handleRelaunchActivity()
+ mAutoFillIgnoreFirstResumePause = followedByPause;
+ if (mAutoFillIgnoreFirstResumePause && DEBUG) {
+ Slog.v(TAG, "autofill will ignore first pause when relaunching " + this);
+ }
+ }
+ }
+
+ /**
+ * Called when the {@link Activity#onPause()} is called.
+ */
+ public void onActivityPaused() {
+ if (mAutoFillResetNeeded) {
+ if (!mAutoFillIgnoreFirstResumePause) {
+ if (DEBUG) Log.v(TAG, "autofill notifyViewExited " + this);
+ View focus = mActivity.getCurrentFocus();
+ if (focus != null && focus.canNotifyAutofillEnterExitEvent()) {
+ getAutofillManager().notifyViewExited(focus);
+ }
+ } else {
+ // reset after first pause()
+ if (DEBUG) Log.v(TAG, "autofill got first pause " + this);
+ mAutoFillIgnoreFirstResumePause = false;
+ }
+ }
+ }
+
+ /**
+ * Called when the {@link Activity#onStop()} is called.
+ */
+ public void onActivityStopped(Intent intent, boolean changingConfigurations) {
+ if (mAutoFillResetNeeded) {
+ // If stopped without changing the configurations, the response should expire.
+ getAutofillManager().onInvisibleForAutofill(!changingConfigurations);
+ } else if (intent != null
+ && intent.hasExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN)
+ && intent.hasExtra(AutofillManager.EXTRA_RESTORE_CROSS_ACTIVITY)) {
+ restoreAutofillSaveUi(intent);
+ }
+ }
+
+ /**
+ * Called when the {@link Activity#onDestroy()} is called.
+ */
+ public void onActivityDestroyed() {
+ if (mActivity.isFinishing() && mAutoFillResetNeeded) {
+ getAutofillManager().onActivityFinishing();
+ }
+ }
+
+ /**
+ * Called when the {@link Activity#onSaveInstanceState(Bundle)} is called.
+ */
+ public void onSaveInstanceState(Bundle outState) {
+ outState.putInt(LAST_AUTOFILL_ID, mLastAutofillId);
+ if (mAutoFillResetNeeded) {
+ outState.putBoolean(AUTOFILL_RESET_NEEDED, true);
+ getAutofillManager().onSaveInstanceState(outState);
+ }
+ }
+
+ /**
+ * Called when the {@link Activity#finish()} is called.
+ */
+ public void onActivityFinish(Intent intent) {
+ // Activity was launched when user tapped a link in the Autofill Save UI - Save UI must
+ // be restored now.
+ if (intent != null && intent.hasExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN)) {
+ restoreAutofillSaveUi(intent);
+ }
+ }
+
+ /**
+ * Called when the {@link Activity#onBackPressed()} is called.
+ */
+ public void onActivityBackPressed(Intent intent) {
+ // Activity was launched when user tapped a link in the Autofill Save UI - Save UI must
+ // be restored now.
+ if (intent != null && intent.hasExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN)) {
+ restoreAutofillSaveUi(intent);
+ }
+ }
+
+ /**
+ * Called when the Activity is dispatching the result.
+ */
+ public void onDispatchActivityResult(int requestCode, int resultCode, Intent data) {
+ Intent resultData = (resultCode == Activity.RESULT_OK) ? data : null;
+ getAutofillManager().onAuthenticationResult(requestCode, resultData,
+ mActivity.getCurrentFocus());
+ }
+
+ /**
+ * Called when the {@link Activity#startActivity(Intent, Bundle)} is called.
+ */
+ public void onStartActivity(Intent startIntent, Intent cachedIntent) {
+ if (cachedIntent != null
+ && cachedIntent.hasExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN)
+ && cachedIntent.hasExtra(AutofillManager.EXTRA_RESTORE_CROSS_ACTIVITY)) {
+ if (TextUtils.equals(mActivity.getPackageName(),
+ startIntent.resolveActivity(mActivity.getPackageManager()).getPackageName())) {
+ // Apply Autofill restore mechanism on the started activity by startActivity()
+ final IBinder token =
+ cachedIntent.getIBinderExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN);
+ // Remove restore ability from current activity
+ cachedIntent.removeExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN);
+ cachedIntent.removeExtra(AutofillManager.EXTRA_RESTORE_CROSS_ACTIVITY);
+ // Put restore token
+ startIntent.putExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN, token);
+ startIntent.putExtra(AutofillManager.EXTRA_RESTORE_CROSS_ACTIVITY, true);
+ }
+ }
+ }
+
+ /**
+ * Restore the autofill save ui.
+ */
+ public void restoreAutofillSaveUi(Intent intent) {
+ final IBinder token =
+ intent.getIBinderExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN);
+ // Make only restore Autofill once
+ intent.removeExtra(AutofillManager.EXTRA_RESTORE_SESSION_TOKEN);
+ intent.removeExtra(AutofillManager.EXTRA_RESTORE_CROSS_ACTIVITY);
+ getAutofillManager().onPendingSaveUi(AutofillManager.PENDING_UI_OPERATION_RESTORE,
+ token);
+ }
+
+ /**
+ * Enable autofill compatibility mode for the Activity if the compatibility mode is enabled
+ * for the package.
+ */
+ public void enableAutofillCompatibilityIfNeeded() {
+ if (mActivity.isAutofillCompatibilityEnabled()) {
+ final AutofillManager afm = mActivity.getSystemService(AutofillManager.class);
+ if (afm != null) {
+ afm.enableCompatibilityMode();
+ }
+ }
+ }
+
+ /**
+ * Prints autofill related information for the Activity.
+ */
+ public void dumpAutofillManager(String prefix, PrintWriter writer) {
+ final AutofillManager afm = getAutofillManager();
+ if (afm != null) {
+ afm.dump(prefix, writer);
+ writer.print(prefix); writer.print("Autofill Compat Mode: ");
+ writer.println(mActivity.isAutofillCompatibilityEnabled());
+ } else {
+ writer.print(prefix); writer.println("No AutofillManager");
+ }
+ }
+
+ /**
+ * Returns the next autofill ID that is unique in the activity
+ *
+ * <p>All IDs will be bigger than {@link View#LAST_APP_AUTOFILL_ID}. All IDs returned
+ * will be unique.
+ */
+ public int getNextAutofillId() {
+ if (mLastAutofillId == Integer.MAX_VALUE - 1) {
+ mLastAutofillId = View.LAST_APP_AUTOFILL_ID;
+ }
+
+ mLastAutofillId++;
+
+ return mLastAutofillId;
+ }
+
+ // ------------------ AutofillClient implementation ------------------
+
+ @Override
+ public AutofillId autofillClientGetNextAutofillId() {
+ return new AutofillId(getNextAutofillId());
+ }
+
+ @Override
+ public boolean autofillClientIsCompatibilityModeEnabled() {
+ return mActivity.isAutofillCompatibilityEnabled();
+ }
+
+ @Override
+ public boolean autofillClientIsVisibleForAutofill() {
+ return !mActivity.isStopped();
+ }
+
+ @Override
+ public ComponentName autofillClientGetComponentName() {
+ return mActivity.getComponentName();
+ }
+
+ @Override
+ public IBinder autofillClientGetActivityToken() {
+ return mActivity.getActivityToken();
+ }
+
+ @Override
+ public boolean[] autofillClientGetViewVisibility(AutofillId[] autofillIds) {
+ final int autofillIdCount = autofillIds.length;
+ final boolean[] visible = new boolean[autofillIdCount];
+ for (int i = 0; i < autofillIdCount; i++) {
+ final AutofillId autofillId = autofillIds[i];
+ final View view = autofillClientFindViewByAutofillIdTraversal(autofillId);
+ if (view != null) {
+ if (!autofillId.isVirtualInt()) {
+ visible[i] = view.isVisibleToUser();
+ } else {
+ visible[i] = view.isVisibleToUserForAutofill(autofillId.getVirtualChildIntId());
+ }
+ }
+ }
+ if (android.view.autofill.Helper.sVerbose) {
+ Log.v(TAG, "autofillClientGetViewVisibility(): " + Arrays.toString(visible));
+ }
+ return visible;
+ }
+
+ @Override
+ public View autofillClientFindViewByAccessibilityIdTraversal(int viewId, int windowId) {
+ final ArrayList<ViewRootImpl> roots = WindowManagerGlobal.getInstance()
+ .getRootViews(mActivity.getActivityToken());
+ for (int rootNum = 0; rootNum < roots.size(); rootNum++) {
+ final View rootView = roots.get(rootNum).getView();
+ if (rootView != null && rootView.getAccessibilityWindowId() == windowId) {
+ final View view = rootView.findViewByAccessibilityIdTraversal(viewId);
+ if (view != null) {
+ return view;
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public View autofillClientFindViewByAutofillIdTraversal(AutofillId autofillId) {
+ final ArrayList<ViewRootImpl> roots =
+ WindowManagerGlobal.getInstance().getRootViews(mActivity.getActivityToken());
+ for (int rootNum = 0; rootNum < roots.size(); rootNum++) {
+ final View rootView = roots.get(rootNum).getView();
+
+ if (rootView != null) {
+ final View view = rootView.findViewByAutofillIdTraversal(autofillId.getViewId());
+ if (view != null) {
+ return view;
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public View[] autofillClientFindViewsByAutofillIdTraversal(AutofillId[] autofillIds) {
+ final View[] views = new View[autofillIds.length];
+ final ArrayList<ViewRootImpl> roots =
+ WindowManagerGlobal.getInstance().getRootViews(mActivity.getActivityToken());
+
+ for (int rootNum = 0; rootNum < roots.size(); rootNum++) {
+ final View rootView = roots.get(rootNum).getView();
+
+ if (rootView != null) {
+ final int viewCount = autofillIds.length;
+ for (int viewNum = 0; viewNum < viewCount; viewNum++) {
+ if (views[viewNum] == null) {
+ views[viewNum] = rootView.findViewByAutofillIdTraversal(
+ autofillIds[viewNum].getViewId());
+ }
+ }
+ }
+ }
+ return views;
+ }
+
+ @Override
+ public boolean autofillClientIsFillUiShowing() {
+ return mAutofillPopupWindow != null && mAutofillPopupWindow.isShowing();
+ }
+
+ @Override
+ public boolean autofillClientRequestHideFillUi() {
+ if (mAutofillPopupWindow == null) {
+ return false;
+ }
+ mAutofillPopupWindow.dismiss();
+ mAutofillPopupWindow = null;
+ return true;
+ }
+
+ @Override
+ public boolean autofillClientRequestShowFillUi(@NonNull View anchor, int width,
+ int height, @Nullable Rect anchorBounds, IAutofillWindowPresenter presenter) {
+ final boolean wasShowing;
+
+ if (mAutofillPopupWindow == null) {
+ wasShowing = false;
+ mAutofillPopupWindow = new AutofillPopupWindow(presenter);
+ } else {
+ wasShowing = mAutofillPopupWindow.isShowing();
+ }
+ mAutofillPopupWindow.update(anchor, 0, 0, width, height, anchorBounds);
+
+ return !wasShowing && mAutofillPopupWindow.isShowing();
+ }
+
+ @Override
+ public void autofillClientDispatchUnhandledKey(View anchor, KeyEvent keyEvent) {
+ ViewRootImpl rootImpl = anchor.getViewRootImpl();
+ if (rootImpl != null) {
+ // don't care if anchorView is current focus, for example a custom view may only receive
+ // touchEvent, not focusable but can still trigger autofill window. The Key handling
+ // might be inside parent of the custom view.
+ rootImpl.dispatchKeyFromAutofill(keyEvent);
+ }
+ }
+
+ @Override
+ public boolean isDisablingEnterExitEventForAutofill() {
+ return mAutoFillIgnoreFirstResumePause || !mActivity.isResumed();
+ }
+
+ @Override
+ public void autofillClientResetableStateAvailable() {
+ mAutoFillResetNeeded = true;
+ }
+
+ @Override
+ public void autofillClientRunOnUiThread(Runnable action) {
+ mActivity.runOnUiThread(action);
+ }
+
+ @Override
+ public void autofillClientAuthenticate(int authenticationId, IntentSender intent,
+ Intent fillInIntent, boolean authenticateInline) {
+ try {
+ mActivity.startIntentSenderForResult(intent, AUTO_FILL_AUTH_WHO_PREFIX,
+ authenticationId, fillInIntent, 0, 0, null);
+ } catch (IntentSender.SendIntentException e) {
+ Log.e(TAG, "authenticate() failed for intent:" + intent, e);
+ }
+ }
+}
diff --git a/core/java/android/view/inputmethod/InputConnection.java b/core/java/android/view/inputmethod/InputConnection.java
index 38019c9..5f036a3 100644
--- a/core/java/android/view/inputmethod/InputConnection.java
+++ b/core/java/android/view/inputmethod/InputConnection.java
@@ -1013,8 +1013,10 @@
*
* @param imeConsumesInput {@code true} when the IME is consuming input and the cursor should be
* hidden, {@code false} when input to the editor resumes and the cursor should be shown again.
- * @return {@code true} on success, {@code false} if the input connection is no longer valid, or
- * the protocol is not supported.
+ * @return For editor authors, the return value will always be ignored. For IME authors, this
+ * method returns {@code true} if the request was sent (whether or not the associated
+ * editor does something based on this request), {@code false} if the input connection
+ * is no longer valid.
*/
default boolean setImeConsumesInput(boolean imeConsumesInput) {
return false;
diff --git a/core/java/android/view/inputmethod/InputMethodInfo.java b/core/java/android/view/inputmethod/InputMethodInfo.java
index 9b463bb..96198c6 100644
--- a/core/java/android/view/inputmethod/InputMethodInfo.java
+++ b/core/java/android/view/inputmethod/InputMethodInfo.java
@@ -418,8 +418,9 @@
}
/**
- * Return a unique ID for this input method. The ID is generated from
- * the package and class name implementing the method.
+ * @return a unique ID for this input method, which is guaranteed to be the same as the result
+ * of {@code getComponent().flattenToShortString()}.
+ * @see ComponentName#unflattenFromString(String)
*/
public String getId() {
return mId;
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index ce92309..e8e5630 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -95,7 +95,6 @@
import com.android.internal.inputmethod.UnbindReason;
import com.android.internal.os.SomeArgs;
import com.android.internal.view.IInputConnectionWrapper;
-import com.android.internal.view.IInputContext;
import com.android.internal.view.IInputMethodClient;
import com.android.internal.view.IInputMethodManager;
import com.android.internal.view.IInputMethodSession;
@@ -366,7 +365,7 @@
final H mH;
// Our generic input connection if the current target does not have its own.
- private final IInputConnectionWrapper mIInputContext;
+ private final IInputConnectionWrapper mFallbackInputConnection;
private final int mDisplayId;
@@ -408,7 +407,7 @@
/**
* The InputConnection that was last retrieved from the served view.
*/
- IInputConnectionWrapper mServedInputConnectionWrapper;
+ IInputConnectionWrapper mServedInputConnection;
/**
* The completions that were last provided by the served view.
*/
@@ -697,8 +696,8 @@
*/
@Override
public void finishComposingText() {
- if (mServedInputConnectionWrapper != null) {
- mServedInputConnectionWrapper.finishComposingText();
+ if (mServedInputConnection != null) {
+ mServedInputConnection.finishComposingText();
}
}
@@ -752,9 +751,9 @@
return false;
}
- return mServedInputConnectionWrapper != null
- && mServedInputConnectionWrapper.isActive()
- && mServedInputConnectionWrapper.getServedView() == view;
+ return mServedInputConnection != null
+ && mServedInputConnection.isActive()
+ && mServedInputConnection.getServedView() == view;
}
}
}
@@ -921,7 +920,7 @@
mRestartOnNextWindowFocus = true;
// Note that finishComposingText() is allowed to run
// even when we are not active.
- mIInputContext.finishComposingText();
+ mFallbackInputConnection.finishComposingText();
}
// Check focus again in case that "onWindowFocus" is called before
// handling this message.
@@ -953,9 +952,8 @@
final boolean fullscreen = msg.arg1 != 0;
InputConnection ic = null;
synchronized (mH) {
- if (mFullscreenMode != fullscreen
- && mServedInputConnectionWrapper != null) {
- ic = mServedInputConnectionWrapper.getInputConnection();
+ if (mFullscreenMode != fullscreen && mServedInputConnection != null) {
+ ic = mServedInputConnection.getInputConnection();
mFullscreenMode = fullscreen;
}
}
@@ -1029,8 +1027,6 @@
}
};
- final InputConnection mDummyInputConnection = new BaseInputConnection(this, false);
-
/**
* For layoutlib to clean up static objects inside {@link InputMethodManager}.
*/
@@ -1079,7 +1075,7 @@
// 1) doing so has no effect for A and 2) doing so is sufficient for B.
final long identity = Binder.clearCallingIdentity();
try {
- service.addClient(imm.mClient, imm.mIInputContext, displayId);
+ service.addClient(imm.mClient, imm.mFallbackInputConnection, displayId);
} catch (RemoteException e) {
e.rethrowFromSystemServer();
} finally {
@@ -1124,7 +1120,8 @@
mMainLooper = looper;
mH = new H(looper);
mDisplayId = displayId;
- mIInputContext = new IInputConnectionWrapper(looper, mDummyInputConnection, this, null);
+ mFallbackInputConnection = new IInputConnectionWrapper(looper,
+ new BaseInputConnection(this, false), this, null);
}
/**
@@ -1214,19 +1211,6 @@
}
/**
- * No longer used. Do not use.
- *
- * TODO(b/192412909) Remove this method.
- *
- * @deprecated Was kept due to {@link UnsupportedAppUsage}. Will be removed soon.
- * @hide
- */
- @Deprecated
- public IInputContext getInputContext() {
- return mIInputContext;
- }
-
- /**
* Returns the list of installed input methods.
*
* <p>On multi user environment, this API returns a result for the calling process user.</p>
@@ -1409,8 +1393,8 @@
public boolean isAcceptingText() {
checkFocus();
synchronized (mH) {
- return mServedInputConnectionWrapper != null
- && mServedInputConnectionWrapper.getInputConnection() != null;
+ return mServedInputConnection != null
+ && mServedInputConnection.getInputConnection() != null;
}
}
@@ -1464,9 +1448,9 @@
*/
void clearConnectionLocked() {
mCurrentTextBoxAttribute = null;
- if (mServedInputConnectionWrapper != null) {
- mServedInputConnectionWrapper.deactivate();
- mServedInputConnectionWrapper = null;
+ if (mServedInputConnection != null) {
+ mServedInputConnection.deactivate();
+ mServedInputConnection = null;
}
}
@@ -1962,11 +1946,11 @@
mCurrentTextBoxAttribute = tba;
mServedConnecting = false;
- if (mServedInputConnectionWrapper != null) {
- mServedInputConnectionWrapper.deactivate();
- mServedInputConnectionWrapper = null;
+ if (mServedInputConnection != null) {
+ mServedInputConnection.deactivate();
+ mServedInputConnection = null;
}
- IInputConnectionWrapper servedContext;
+ IInputConnectionWrapper servedInputConnection;
final int missingMethodFlags;
if (ic != null) {
mCursorSelStart = tba.initialSelStart;
@@ -1983,14 +1967,14 @@
} else {
icHandler = ic.getHandler();
}
- servedContext = new IInputConnectionWrapper(
+ servedInputConnection = new IInputConnectionWrapper(
icHandler != null ? icHandler.getLooper() : vh.getLooper(), ic, this, view);
} else {
- servedContext = null;
+ servedInputConnection = null;
missingMethodFlags = 0;
icHandler = null;
}
- mServedInputConnectionWrapper = servedContext;
+ mServedInputConnection = servedInputConnection;
if (DEBUG) {
Log.v(TAG, "START INPUT: view=" + dumpViewInfo(view) + " ic="
@@ -2000,7 +1984,7 @@
try {
res = mService.startInputOrWindowGainedFocus(
startInputReason, mClient, windowGainingFocus, startInputFlags,
- softInputMode, windowFlags, tba, servedContext, missingMethodFlags,
+ softInputMode, windowFlags, tba, servedInputConnection, missingMethodFlags,
view.getContext().getApplicationInfo().targetSdkVersion);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
@@ -3095,7 +3079,7 @@
p.println(" mService=" + mService);
p.println(" mMainLooper=" + mMainLooper);
- p.println(" mIInputContext=" + mIInputContext);
+ p.println(" mFallbackInputConnection=" + mFallbackInputConnection);
p.println(" mActive=" + mActive
+ " mRestartOnNextWindowFocus=" + mRestartOnNextWindowFocus
+ " mBindSequence=" + mBindSequence
@@ -3116,7 +3100,7 @@
} else {
p.println(" mCurrentTextBoxAttribute: null");
}
- p.println(" mServedInputConnectionWrapper=" + mServedInputConnectionWrapper);
+ p.println(" mServedInputConnection=" + mServedInputConnection);
p.println(" mCompletions=" + Arrays.toString(mCompletions));
p.println(" mCursorRect=" + mCursorRect);
p.println(" mCursorSelStart=" + mCursorSelStart
@@ -3242,8 +3226,8 @@
if (mImeInsetsConsumer != null) {
mImeInsetsConsumer.dumpDebug(proto, IME_INSETS_SOURCE_CONSUMER);
}
- if (mServedInputConnectionWrapper != null) {
- mServedInputConnectionWrapper.dumpDebug(proto, INPUT_CONNECTION);
+ if (mServedInputConnection != null) {
+ mServedInputConnection.dumpDebug(proto, INPUT_CONNECTION);
}
if (icProto != null) {
proto.write(INPUT_CONNECTION_CALL, icProto);
diff --git a/core/java/android/window/StartingWindowInfo.java b/core/java/android/window/StartingWindowInfo.java
index 566f154..8c64474 100644
--- a/core/java/android/window/StartingWindowInfo.java
+++ b/core/java/android/window/StartingWindowInfo.java
@@ -22,6 +22,7 @@
import android.annotation.TestApi;
import android.app.ActivityManager;
import android.app.TaskInfo;
+import android.content.pm.ActivityInfo;
import android.os.Parcel;
import android.os.Parcelable;
import android.view.InsetsState;
@@ -78,6 +79,14 @@
public ActivityManager.RunningTaskInfo taskInfo;
/**
+ * The {@link ActivityInfo} of the target activity which to create the starting window.
+ * It can be null if the info is the same as the top in task info.
+ * @hide
+ */
+ @Nullable
+ public ActivityInfo targetActivityInfo;
+
+ /**
* InsetsState of TopFullscreenOpaqueWindow
* @hide
*/
@@ -174,6 +183,7 @@
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeTypedObject(taskInfo, flags);
+ dest.writeTypedObject(targetActivityInfo, flags);
dest.writeInt(startingWindowTypeParameter);
dest.writeTypedObject(topOpaqueWindowInsetsState, flags);
dest.writeTypedObject(topOpaqueWindowLayoutParams, flags);
@@ -185,6 +195,7 @@
void readFromParcel(@NonNull Parcel source) {
taskInfo = source.readTypedObject(ActivityManager.RunningTaskInfo.CREATOR);
+ targetActivityInfo = source.readTypedObject(ActivityInfo.CREATOR);
startingWindowTypeParameter = source.readInt();
topOpaqueWindowInsetsState = source.readTypedObject(InsetsState.CREATOR);
topOpaqueWindowLayoutParams = source.readTypedObject(
@@ -198,6 +209,7 @@
@Override
public String toString() {
return "StartingWindowInfo{taskId=" + taskInfo.taskId
+ + " targetActivityInfo=" + targetActivityInfo
+ " displayId=" + taskInfo.displayId
+ " topActivityType=" + taskInfo.topActivityType
+ " preferredStartingWindowType="
diff --git a/core/java/android/window/TaskFragmentInfo.java b/core/java/android/window/TaskFragmentInfo.java
index 45975db..fe25e57 100644
--- a/core/java/android/window/TaskFragmentInfo.java
+++ b/core/java/android/window/TaskFragmentInfo.java
@@ -38,8 +38,8 @@
public final class TaskFragmentInfo implements Parcelable {
/**
- * Client assigned unique token in {@link TaskFragmentCreationParams#mFragmentToken} to create
- * this TaskFragment with.
+ * Client assigned unique token in {@link TaskFragmentCreationParams#getFragmentToken()} to
+ * create this TaskFragment with.
*/
@NonNull
private final IBinder mFragmentToken;
@@ -50,9 +50,12 @@
@NonNull
private final Configuration mConfiguration = new Configuration();
- /** Whether the TaskFragment contains any child Activity. */
+ /** Whether the TaskFragment contains any child Window Container. */
private final boolean mIsEmpty;
+ /** Whether the TaskFragment contains any running Activity. */
+ private final boolean mHasRunningActivity;
+
/** Whether this TaskFragment is visible on the window hierarchy. */
private final boolean mIsVisible;
@@ -67,12 +70,13 @@
public TaskFragmentInfo(
@NonNull IBinder fragmentToken, @NonNull WindowContainerToken token,
- @NonNull Configuration configuration, boolean isEmpty, boolean isVisible,
- List<IBinder> activities, @NonNull Point positionInParent) {
+ @NonNull Configuration configuration, boolean isEmpty, boolean hasRunningActivity,
+ boolean isVisible, @NonNull List<IBinder> activities, @NonNull Point positionInParent) {
mFragmentToken = requireNonNull(fragmentToken);
mToken = requireNonNull(token);
mConfiguration.setTo(configuration);
mIsEmpty = isEmpty;
+ mHasRunningActivity = hasRunningActivity;
mIsVisible = isVisible;
mActivities.addAll(activities);
mPositionInParent = requireNonNull(positionInParent);
@@ -94,6 +98,10 @@
return mIsEmpty;
}
+ public boolean hasRunningActivity() {
+ return mHasRunningActivity;
+ }
+
public boolean isVisible() {
return mIsVisible;
}
@@ -125,6 +133,7 @@
return mFragmentToken.equals(that.mFragmentToken)
&& mToken.equals(that.mToken)
&& mIsEmpty == that.mIsEmpty
+ && mHasRunningActivity == that.mHasRunningActivity
&& mIsVisible == that.mIsVisible
&& getWindowingMode() == that.getWindowingMode()
&& mActivities.equals(that.mActivities)
@@ -136,6 +145,7 @@
mToken = in.readTypedObject(WindowContainerToken.CREATOR);
mConfiguration.readFromParcel(in);
mIsEmpty = in.readBoolean();
+ mHasRunningActivity = in.readBoolean();
mIsVisible = in.readBoolean();
in.readBinderList(mActivities);
mPositionInParent = requireNonNull(in.readTypedObject(Point.CREATOR));
@@ -147,6 +157,7 @@
dest.writeTypedObject(mToken, flags);
mConfiguration.writeToParcel(dest, flags);
dest.writeBoolean(mIsEmpty);
+ dest.writeBoolean(mHasRunningActivity);
dest.writeBoolean(mIsVisible);
dest.writeBinderList(mActivities);
dest.writeTypedObject(mPositionInParent, flags);
@@ -172,6 +183,7 @@
+ " fragmentToken=" + mFragmentToken
+ " token=" + mToken
+ " isEmpty=" + mIsEmpty
+ + " hasRunningActivity=" + mHasRunningActivity
+ " isVisible=" + mIsVisible
+ " positionInParent=" + mPositionInParent
+ "}";
diff --git a/core/java/android/window/WindowContainerTransaction.java b/core/java/android/window/WindowContainerTransaction.java
index 3c360fb..380032b 100644
--- a/core/java/android/window/WindowContainerTransaction.java
+++ b/core/java/android/window/WindowContainerTransaction.java
@@ -442,7 +442,8 @@
/**
* Starts an activity in the TaskFragment.
* @param fragmentToken client assigned unique token to create TaskFragment with specified in
- * {@link TaskFragmentCreationParams#fragmentToken}.
+ * {@link TaskFragmentCreationParams#getFragmentToken()}.
+ * @param callerToken the activity token that initialized the activity launch.
* @param activityIntent intent to start the activity.
* @param activityOptions ActivityOptions to start the activity with.
* @see android.content.Context#startActivity(Intent, Bundle).
@@ -450,12 +451,13 @@
*/
@NonNull
public WindowContainerTransaction startActivityInTaskFragment(
- @NonNull IBinder fragmentToken, @NonNull Intent activityIntent,
- @Nullable Bundle activityOptions) {
+ @NonNull IBinder fragmentToken, @NonNull IBinder callerToken,
+ @NonNull Intent activityIntent, @Nullable Bundle activityOptions) {
final HierarchyOp hierarchyOp =
new HierarchyOp.Builder(
HierarchyOp.HIERARCHY_OP_TYPE_START_ACTIVITY_IN_TASK_FRAGMENT)
.setContainer(fragmentToken)
+ .setReparentContainer(callerToken)
.setActivityIntent(activityIntent)
.setLaunchOptions(activityOptions)
.build();
@@ -466,7 +468,7 @@
/**
* Moves an activity into the TaskFragment.
* @param fragmentToken client assigned unique token to create TaskFragment with specified in
- * {@link TaskFragmentCreationParams#fragmentToken}.
+ * {@link TaskFragmentCreationParams#getFragmentToken()}.
* @param activityToken activity to be reparented.
* @hide
*/
@@ -504,6 +506,30 @@
}
/**
+ * Sets to TaskFragments adjacent to each other. Containers below two visible adjacent
+ * TaskFragments will be made invisible. This is similar to
+ * {@link #setAdjacentRoots(WindowContainerToken, WindowContainerToken)}, but can be used with
+ * fragmentTokens when that TaskFragments haven't been created (but will be created in the same
+ * {@link WindowContainerTransaction}).
+ * @param fragmentToken1 client assigned unique token to create TaskFragment with specified
+ * in {@link TaskFragmentCreationParams#getFragmentToken()}.
+ * @param fragmentToken2 client assigned unique token to create TaskFragment with specified
+ * in {@link TaskFragmentCreationParams#getFragmentToken()}.
+ * @hide
+ */
+ @NonNull
+ public WindowContainerTransaction setAdjacentTaskFragments(
+ @NonNull IBinder fragmentToken1, @NonNull IBinder fragmentToken2) {
+ final HierarchyOp hierarchyOp =
+ new HierarchyOp.Builder(HierarchyOp.HIERARCHY_OP_TYPE_SET_ADJACENT_TASK_FRAGMENTS)
+ .setContainer(fragmentToken1)
+ .setReparentContainer(fragmentToken2)
+ .build();
+ mHierarchyOps.add(hierarchyOp);
+ return this;
+ }
+
+ /**
* When this {@link WindowContainerTransaction} failed to finish on the server side, it will
* trigger callback with this {@param errorCallbackToken}.
* @param errorCallbackToken client provided token that will be passed back as parameter in
@@ -906,6 +932,7 @@
public static final int HIERARCHY_OP_TYPE_REPARENT_ACTIVITY_TO_TASK_FRAGMENT = 10;
public static final int HIERARCHY_OP_TYPE_REPARENT_CHILDREN = 11;
public static final int HIERARCHY_OP_TYPE_PENDING_INTENT = 12;
+ public static final int HIERARCHY_OP_TYPE_SET_ADJACENT_TASK_FRAGMENTS = 13;
// The following key(s) are for use with mLaunchOptions:
// When launching a task (eg. from recents), this is the taskId to be launched.
@@ -1060,6 +1087,11 @@
return mReparent;
}
+ @NonNull
+ public IBinder getCallingActivity() {
+ return mReparent;
+ }
+
public boolean getToTop() {
return mToTop;
}
@@ -1129,6 +1161,9 @@
case HIERARCHY_OP_TYPE_REPARENT_CHILDREN:
return "{ReparentChildren: oldParent=" + mContainer + " newParent=" + mReparent
+ "}";
+ case HIERARCHY_OP_TYPE_SET_ADJACENT_TASK_FRAGMENTS:
+ return "{SetAdjacentTaskFragments: container=" + mContainer
+ + " adjacentContainer=" + mReparent + "}";
default:
return "{mType=" + mType + " container=" + mContainer + " reparent=" + mReparent
+ " mToTop=" + mToTop + " mWindowingMode=" + mWindowingModes
diff --git a/core/java/com/android/internal/accessibility/util/AccessibilityStatsLogUtils.java b/core/java/com/android/internal/accessibility/util/AccessibilityStatsLogUtils.java
index c57afbc..179ac8b 100644
--- a/core/java/com/android/internal/accessibility/util/AccessibilityStatsLogUtils.java
+++ b/core/java/com/android/internal/accessibility/util/AccessibilityStatsLogUtils.java
@@ -17,6 +17,7 @@
package com.android.internal.accessibility.util;
import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU;
+import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_GESTURE;
import static android.provider.Settings.Secure.ACCESSIBILITY_MAGNIFICATION_MODE_ALL;
import static android.provider.Settings.Secure.ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN;
import static android.provider.Settings.Secure.ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW;
@@ -30,6 +31,7 @@
import static com.android.internal.util.FrameworkStatsLog.ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__A11Y_BUTTON;
import static com.android.internal.util.FrameworkStatsLog.ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__A11Y_BUTTON_LONG_PRESS;
import static com.android.internal.util.FrameworkStatsLog.ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__A11Y_FLOATING_MENU;
+import static com.android.internal.util.FrameworkStatsLog.ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__A11Y_GESTURE;
import static com.android.internal.util.FrameworkStatsLog.ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__TRIPLE_TAP;
import static com.android.internal.util.FrameworkStatsLog.ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__UNKNOWN_TYPE;
import static com.android.internal.util.FrameworkStatsLog.ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__VOLUME_KEY;
@@ -152,19 +154,29 @@
convertToLoggingMagnificationMode(mode));
}
- private static boolean isFloatingMenuEnabled(Context context) {
+ private static boolean isAccessibilityFloatingMenuEnabled(Context context) {
return Settings.Secure.getInt(context.getContentResolver(),
Settings.Secure.ACCESSIBILITY_BUTTON_MODE, /* def= */ -1)
== ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU;
}
+ private static boolean isAccessibilityGestureEnabled(Context context) {
+ return Settings.Secure.getInt(context.getContentResolver(),
+ Settings.Secure.ACCESSIBILITY_BUTTON_MODE, /* def= */ -1)
+ == ACCESSIBILITY_BUTTON_MODE_GESTURE;
+ }
+
private static int convertToLoggingShortcutType(Context context,
@ShortcutType int shortcutType) {
switch (shortcutType) {
case ACCESSIBILITY_BUTTON:
- return isFloatingMenuEnabled(context)
- ? ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__A11Y_FLOATING_MENU
- : ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__A11Y_BUTTON;
+ if (isAccessibilityFloatingMenuEnabled(context)) {
+ return ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__A11Y_FLOATING_MENU;
+ } else if (isAccessibilityGestureEnabled(context)) {
+ return ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__A11Y_GESTURE;
+ } else {
+ return ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__A11Y_BUTTON;
+ }
case ACCESSIBILITY_SHORTCUT_KEY:
return ACCESSIBILITY_SHORTCUT_REPORTED__SHORTCUT_TYPE__VOLUME_KEY;
}
diff --git a/core/java/com/android/internal/app/AbstractResolverComparator.java b/core/java/com/android/internal/app/AbstractResolverComparator.java
index 40ada0b..c00d16c 100644
--- a/core/java/com/android/internal/app/AbstractResolverComparator.java
+++ b/core/java/com/android/internal/app/AbstractResolverComparator.java
@@ -22,6 +22,7 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
+import android.os.BadParcelableException;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
@@ -109,17 +110,22 @@
// get annotations of content from intent.
private void getContentAnnotations(Intent intent) {
- ArrayList<String> annotations = intent.getStringArrayListExtra(
- Intent.EXTRA_CONTENT_ANNOTATIONS);
- if (annotations != null) {
- int size = annotations.size();
- if (size > NUM_OF_TOP_ANNOTATIONS_TO_USE) {
- size = NUM_OF_TOP_ANNOTATIONS_TO_USE;
+ try {
+ ArrayList<String> annotations = intent.getStringArrayListExtra(
+ Intent.EXTRA_CONTENT_ANNOTATIONS);
+ if (annotations != null) {
+ int size = annotations.size();
+ if (size > NUM_OF_TOP_ANNOTATIONS_TO_USE) {
+ size = NUM_OF_TOP_ANNOTATIONS_TO_USE;
+ }
+ mAnnotations = new String[size];
+ for (int i = 0; i < size; i++) {
+ mAnnotations[i] = annotations.get(i);
+ }
}
- mAnnotations = new String[size];
- for (int i = 0; i < size; i++) {
- mAnnotations[i] = annotations.get(i);
- }
+ } catch (BadParcelableException e) {
+ Log.i(TAG, "Couldn't unparcel intent annotations. Ignoring.");
+ mAnnotations = new String[0];
}
}
diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java
index eeceafa..786af5f 100644
--- a/core/java/com/android/internal/app/ChooserActivity.java
+++ b/core/java/com/android/internal/app/ChooserActivity.java
@@ -1269,7 +1269,8 @@
SELECTION_TYPE_NEARBY,
"",
-1);
- safelyStartActivity(ti);
+ // Action bar is user-independent, always start as primary
+ safelyStartActivityAsUser(ti, getPersonalProfileUserHandle());
finish();
}
);
@@ -1290,7 +1291,8 @@
SELECTION_TYPE_EDIT,
"",
-1);
- safelyStartActivity(ti);
+ // Action bar is user-independent, always start as primary
+ safelyStartActivityAsUser(ti, getPersonalProfileUserHandle());
finish();
}
);
@@ -3452,8 +3454,6 @@
private View createProfileView(ViewGroup parent) {
View profileRow = mLayoutInflater.inflate(R.layout.chooser_profile_row, parent, false);
- profileRow.setBackground(
- getResources().getDrawable(R.drawable.chooser_row_layer_list, null));
mProfileView = profileRow.findViewById(R.id.profile_button);
mProfileView.setOnClickListener(ChooserActivity.this::onProfileClick);
updateProfileViewButton();
@@ -3599,10 +3599,6 @@
final ViewGroup viewGroup = (ViewGroup) holder.itemView;
int start = getListPosition(position);
int startType = getRowType(start);
- if (viewGroup.getForeground() == null && position > 0) {
- viewGroup.setForeground(
- getResources().getDrawable(R.drawable.chooser_row_layer_list, null));
- }
int columnCount = holder.getColumnCount();
int end = start + columnCount - 1;
diff --git a/core/java/com/android/internal/app/ResolverActivity.java b/core/java/com/android/internal/app/ResolverActivity.java
index 6f9da6f..d08f21c 100644
--- a/core/java/com/android/internal/app/ResolverActivity.java
+++ b/core/java/com/android/internal/app/ResolverActivity.java
@@ -1257,13 +1257,32 @@
// don't kill ourselves.
StrictMode.disableDeathOnFileUriExposure();
try {
- safelyStartActivityInternal(cti);
+ UserHandle currentUserHandle = mMultiProfilePagerAdapter.getCurrentUserHandle();
+ safelyStartActivityInternal(cti, currentUserHandle);
} finally {
StrictMode.enableDeathOnFileUriExposure();
}
}
- private void safelyStartActivityInternal(TargetInfo cti) {
+ /**
+ * Start activity as a fixed user handle.
+ * @param cti TargetInfo to be launched.
+ * @param user User to launch this activity as.
+ */
+ @VisibleForTesting
+ public void safelyStartActivityAsUser(TargetInfo cti, UserHandle user) {
+ // We're dispatching intents that might be coming from legacy apps, so
+ // don't kill ourselves.
+ StrictMode.disableDeathOnFileUriExposure();
+ try {
+ safelyStartActivityInternal(cti, user);
+ } finally {
+ StrictMode.enableDeathOnFileUriExposure();
+ }
+ }
+
+
+ private void safelyStartActivityInternal(TargetInfo cti, UserHandle user) {
// If the target is suspended, the activity will not be successfully launched.
// Do not unregister from package manager updates in this case
if (!cti.isSuspended() && mRegistered) {
@@ -1280,18 +1299,17 @@
if (mProfileSwitchMessageId != -1) {
Toast.makeText(this, getString(mProfileSwitchMessageId), Toast.LENGTH_LONG).show();
}
- UserHandle currentUserHandle = mMultiProfilePagerAdapter.getCurrentUserHandle();
if (!mSafeForwardingMode) {
- if (cti.startAsUser(this, null, currentUserHandle)) {
+ if (cti.startAsUser(this, null, user)) {
onActivityStarted(cti);
- maybeLogCrossProfileTargetLaunch(cti, currentUserHandle);
+ maybeLogCrossProfileTargetLaunch(cti, user);
}
return;
}
try {
- if (cti.startAsCaller(this, null, currentUserHandle.getIdentifier())) {
+ if (cti.startAsCaller(this, null, user.getIdentifier())) {
onActivityStarted(cti);
- maybeLogCrossProfileTargetLaunch(cti, currentUserHandle);
+ maybeLogCrossProfileTargetLaunch(cti, user);
}
} catch (RuntimeException e) {
Slog.wtf(TAG, "Unable to launch as uid " + mLaunchedFromUid
diff --git a/core/java/com/android/internal/display/BrightnessSynchronizer.java b/core/java/com/android/internal/display/BrightnessSynchronizer.java
index c9a9e51..55a2052 100644
--- a/core/java/com/android/internal/display/BrightnessSynchronizer.java
+++ b/core/java/com/android/internal/display/BrightnessSynchronizer.java
@@ -16,9 +16,11 @@
package com.android.internal.display;
+import android.annotation.NonNull;
import android.content.ContentResolver;
import android.content.Context;
import android.database.ContentObserver;
+import android.hardware.display.BrightnessInfo;
import android.hardware.display.DisplayManager;
import android.hardware.display.DisplayManager.DisplayListener;
import android.net.Uri;
@@ -61,10 +63,10 @@
updateBrightnessFloatFromInt(msg.arg1);
break;
case MSG_UPDATE_INT:
- updateBrightnessIntFromFloat(Float.intBitsToFloat(msg.arg1));
+ updateBrightnessIntFromFloat((BrightnessInfo) msg.obj);
break;
case MSG_UPDATE_BOTH:
- updateBoth(Float.intBitsToFloat(msg.arg1));
+ updateBoth((BrightnessInfo) msg.obj, Float.intBitsToFloat(msg.arg1));
break;
default:
super.handleMessage(msg);
@@ -95,11 +97,11 @@
brightnessSyncObserver = new BrightnessSyncObserver();
brightnessSyncObserver.startObserving();
- final float currentFloatBrightness = getScreenBrightnessFloat();
+ final BrightnessInfo brightnessInfo = getBrightnessInfo();
final int currentIntBrightness = getScreenBrightnessInt(mContext);
- if (!Float.isNaN(currentFloatBrightness)) {
- updateBrightnessIntFromFloat(currentFloatBrightness);
+ if (brightnessInfo != null && !Float.isNaN(brightnessInfo.brightness)) {
+ updateBrightnessIntFromFloat(brightnessInfo);
} else if (currentIntBrightness != -1) {
updateBrightnessFloatFromInt(currentIntBrightness);
} else {
@@ -112,15 +114,23 @@
/**
* Converts between the int brightness system and the float brightness system.
+ *
+ * @param brightnessInt The int brightness value to convert.
*/
public static float brightnessIntToFloat(int brightnessInt) {
+ return brightnessIntToFloat(brightnessInt, null);
+ }
+
+ private static float brightnessIntToFloat(int brightnessInt, BrightnessInfo info) {
if (brightnessInt == PowerManager.BRIGHTNESS_OFF) {
return PowerManager.BRIGHTNESS_OFF_FLOAT;
} else if (brightnessInt == PowerManager.BRIGHTNESS_INVALID) {
return PowerManager.BRIGHTNESS_INVALID_FLOAT;
} else {
- final float minFloat = PowerManager.BRIGHTNESS_MIN;
- final float maxFloat = PowerManager.BRIGHTNESS_MAX;
+ final float minFloat = info != null
+ ? info.brightnessMinimum : PowerManager.BRIGHTNESS_MIN;
+ final float maxFloat = info != null
+ ? info.brightnessMaximum : PowerManager.BRIGHTNESS_MAX;
final float minInt = PowerManager.BRIGHTNESS_OFF + 1;
final float maxInt = PowerManager.BRIGHTNESS_ON;
return MathUtils.constrainedMap(minFloat, maxFloat, minInt, maxInt, brightnessInt);
@@ -128,29 +138,28 @@
}
/**
- * Converts between the float brightness system and the int brightness system.
- */
- public static int brightnessFloatToInt(float brightnessFloat) {
- return Math.round(brightnessFloatToIntRange(brightnessFloat));
- }
-
- /**
* Translates specified value from the float brightness system to the int brightness system,
* given the min/max of each range. Accounts for special values such as OFF and invalid values.
* Value returned as a float primitive (to preserve precision), but is a value within the
* int-system range.
+ *
+ * @param brightnessFloat The float brightness value to convert.
+ * @param info Brightness information to use in the conversion.
*/
- public static float brightnessFloatToIntRange(float brightnessFloat) {
+ public static int brightnessFloatToInt(float brightnessFloat, BrightnessInfo info) {
if (floatEquals(brightnessFloat, PowerManager.BRIGHTNESS_OFF_FLOAT)) {
return PowerManager.BRIGHTNESS_OFF;
} else if (Float.isNaN(brightnessFloat)) {
return PowerManager.BRIGHTNESS_INVALID;
} else {
- final float minFloat = PowerManager.BRIGHTNESS_MIN;
- final float maxFloat = PowerManager.BRIGHTNESS_MAX;
+ final float minFloat = info != null
+ ? info.brightnessMinimum : PowerManager.BRIGHTNESS_MIN;
+ final float maxFloat = info != null
+ ? info.brightnessMaximum : PowerManager.BRIGHTNESS_MAX;
final float minInt = PowerManager.BRIGHTNESS_OFF + 1;
final float maxInt = PowerManager.BRIGHTNESS_ON;
- return MathUtils.constrainedMap(minInt, maxInt, minFloat, maxFloat, brightnessFloat);
+ return Math.round(MathUtils.constrainedMap(minInt, maxInt, minFloat, maxFloat,
+ brightnessFloat));
}
}
@@ -185,35 +194,37 @@
* @param value Brightness value as int to store in the float setting.
*/
private void updateBrightnessFloatFromInt(int value) {
- if (brightnessFloatToInt(mPreferredSettingValue) == value) {
+ final BrightnessInfo info = getBrightnessInfo();
+ if (brightnessFloatToInt(mPreferredSettingValue, info) == value) {
return;
}
- mPreferredSettingValue = brightnessIntToFloat(value);
+ mPreferredSettingValue = brightnessIntToFloat(value, info);
final int newBrightnessAsIntBits = Float.floatToIntBits(mPreferredSettingValue);
mHandler.removeMessages(MSG_UPDATE_BOTH);
mHandler.obtainMessage(MSG_UPDATE_BOTH, newBrightnessAsIntBits, 0).sendToTarget();
}
/**
- * Updates the settings based on a passed in float value. This is called whenever the float
- * setting changes. mPreferredSettingValue holds the most recently updated brightness value
- * as a float that we would like the display to be set to.
+ * Updates the settings from the specified {@link BrightnessInfo}. This is called whenever the
+ * float brightness changed from DisplayManager. mPreferredSettingValue holds the most recently
+ * updated brightness value as a float that we would like the display to be set to.
*
* We then schedule an update to both the int and float settings, but, remove all the other
* messages to update all, to prevent us getting stuck in a loop.
*
- * @param value Brightness setting as float to store in int setting.
+ * @param brightnessInfo Current brightness information
*/
- private void updateBrightnessIntFromFloat(float value) {
+ private void updateBrightnessIntFromFloat(@NonNull BrightnessInfo brightnessInfo) {
+ final float value = brightnessInfo.brightness;
if (floatEquals(mPreferredSettingValue, value)) {
return;
}
mPreferredSettingValue = value;
- final int newBrightnessAsIntBits = Float.floatToIntBits(mPreferredSettingValue);
mHandler.removeMessages(MSG_UPDATE_BOTH);
- mHandler.obtainMessage(MSG_UPDATE_BOTH, newBrightnessAsIntBits, 0).sendToTarget();
+ mHandler.obtainMessage(MSG_UPDATE_BOTH, Float.floatToIntBits(value), 0, brightnessInfo)
+ .sendToTarget();
}
@@ -222,16 +233,24 @@
* mDisplayManager.setBrightness automatically checks for changes
* Settings.System.putIntForUser needs to be checked, to prevent an extra callback to this class
*
+ * @param brightnessInfo Brightness information, takes precedent over newBrightnessFloat
* @param newBrightnessFloat Brightness setting as float to store in both settings
*/
- private void updateBoth(float newBrightnessFloat) {
- int newBrightnessInt = brightnessFloatToInt(newBrightnessFloat);
+ private void updateBoth(BrightnessInfo brightnessInfo, float newBrightnessFloat) {
+ int newBrightnessInt = brightnessFloatToInt(newBrightnessFloat, brightnessInfo);
mDisplayManager.setBrightness(Display.DEFAULT_DISPLAY, newBrightnessFloat);
if (getScreenBrightnessInt(mContext) != newBrightnessInt) {
Settings.System.putIntForUser(mContext.getContentResolver(),
Settings.System.SCREEN_BRIGHTNESS, newBrightnessInt, UserHandle.USER_CURRENT);
}
+ }
+ private BrightnessInfo getBrightnessInfo() {
+ final Display display = mDisplayManager.getDisplay(Display.DEFAULT_DISPLAY);
+ if (display != null) {
+ return display.getBrightnessInfo();
+ }
+ return null;
}
/**
@@ -263,10 +282,15 @@
@Override
public void onDisplayChanged(int displayId) {
- float currentFloat = getScreenBrightnessFloat();
- int toSend = Float.floatToIntBits(currentFloat);
- mHandler.removeMessages(MSG_UPDATE_INT);
- mHandler.obtainMessage(MSG_UPDATE_INT, toSend, 0).sendToTarget();
+ if (displayId != Display.DEFAULT_DISPLAY) {
+ return;
+ }
+
+ final BrightnessInfo info = getBrightnessInfo();
+ if (info != null) {
+ mHandler.removeMessages(MSG_UPDATE_INT);
+ mHandler.obtainMessage(MSG_UPDATE_INT, info).sendToTarget();
+ }
}
};
diff --git a/core/java/com/android/internal/inputmethod/CallbackUtils.java b/core/java/com/android/internal/inputmethod/CallbackUtils.java
index 1933c54..2b9556d 100644
--- a/core/java/com/android/internal/inputmethod/CallbackUtils.java
+++ b/core/java/com/android/internal/inputmethod/CallbackUtils.java
@@ -17,7 +17,11 @@
package com.android.internal.inputmethod;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.os.RemoteException;
+import android.util.Log;
+import android.view.inputmethod.ExtractedText;
+import android.view.inputmethod.SurroundingText;
import java.util.function.BooleanSupplier;
import java.util.function.IntSupplier;
@@ -112,13 +116,13 @@
}
/**
- * A utility method using given {@link IIInputContentUriTokenResultCallback} to callback the
+ * A utility method using given {@link IInputContentUriTokenResultCallback} to callback the
* result.
*
- * @param callback {@link IIInputContentUriTokenResultCallback} to be called back.
+ * @param callback {@link IInputContentUriTokenResultCallback} to be called back.
* @param resultSupplier the supplier from which the result is provided.
*/
- public static void onResult(@NonNull IIInputContentUriTokenResultCallback callback,
+ public static void onResult(@NonNull IInputContentUriTokenResultCallback callback,
@NonNull Supplier<IInputContentUriToken> resultSupplier) {
IInputContentUriToken result = null;
Throwable exception = null;
@@ -137,4 +141,143 @@
callback.onResult(result);
} catch (RemoteException ignored) { }
}
+
+ /**
+ * A utility method to reply associated with {@link InputConnectionCommand}.
+ *
+ * @param command {@link InputConnectionCommand} to be replied.
+ * @param result a {@link String} value to be replied.
+ * @param tag tag name to be used for debug output when the invocation fails.
+ */
+ public static void onResult(@NonNull InputConnectionCommand command, boolean result,
+ @Nullable String tag) {
+ if (command.mResultCallbackType != InputConnectionCommand.ResultCallbackType.BOOLEAN) {
+ if (tag != null) {
+ Log.e(tag, InputMethodDebug.inputConnectionCommandTypeToString(command.mCommandType)
+ + ": Failed to return result=" + result + " due to callback type mismatch."
+ + " expected=String actual=" + command.mResultCallbackType);
+ }
+ return;
+ }
+ try {
+ IBooleanResultCallback.Stub.asInterface(command.mResultCallback).onResult(result);
+ } catch (Throwable e) {
+ if (tag != null) {
+ Log.e(tag, InputMethodDebug.inputConnectionCommandTypeToString(command.mCommandType)
+ + ": Failed to return result=" + result, e);
+ }
+ }
+ }
+
+ /**
+ * A utility method to reply associated with {@link InputConnectionCommand}.
+ *
+ * @param command {@link InputConnectionCommand} to be replied.
+ * @param result an int result value to be replied.
+ * @param tag tag name to be used for debug output when the invocation fails.
+ */
+ public static void onResult(@NonNull InputConnectionCommand command, int result,
+ @Nullable String tag) {
+ if (command.mResultCallbackType != InputConnectionCommand.ResultCallbackType.INT) {
+ if (tag != null) {
+ Log.e(tag, InputMethodDebug.inputConnectionCommandTypeToString(command.mCommandType)
+ + ": Failed to return result=" + result + " due to callback type mismatch."
+ + " expected=int actual=" + command.mResultCallbackType);
+ }
+ return;
+ }
+ try {
+ IIntResultCallback.Stub.asInterface(command.mResultCallback).onResult(result);
+ } catch (Throwable e) {
+ if (tag != null) {
+ Log.e(tag, InputMethodDebug.inputConnectionCommandTypeToString(command.mCommandType)
+ + ": Failed to return result=" + result, e);
+ }
+ }
+ }
+
+ /**
+ * A utility method to reply associated with {@link InputConnectionCommand}.
+ *
+ * @param command {@link InputConnectionCommand} to be replied.
+ * @param result a {@link CharSequence} result value to be replied.
+ * @param tag tag name to be used for debug output when the invocation fails.
+ */
+ public static void onResult(@NonNull InputConnectionCommand command,
+ @Nullable CharSequence result, @Nullable String tag) {
+ if (command.mResultCallbackType
+ != InputConnectionCommand.ResultCallbackType.CHAR_SEQUENCE) {
+ if (tag != null) {
+ Log.e(tag, InputMethodDebug.inputConnectionCommandTypeToString(command.mCommandType)
+ + ": Failed to return result=" + result + " due to callback type mismatch."
+ + " expected=CharSequence actual=" + command.mResultCallbackType);
+ }
+ return;
+ }
+ try {
+ ICharSequenceResultCallback.Stub.asInterface(command.mResultCallback).onResult(result);
+ } catch (Throwable e) {
+ if (tag != null) {
+ Log.e(tag, InputMethodDebug.inputConnectionCommandTypeToString(command.mCommandType)
+ + ": Failed to return result=" + result, e);
+ }
+ }
+ }
+
+ /**
+ * A utility method to reply associated with {@link InputConnectionCommand}.
+ *
+ * @param command {@link InputConnectionCommand} to be replied.
+ * @param result a {@link ExtractedText} result value to be replied.
+ * @param tag tag name to be used for debug output when the invocation fails.
+ */
+ public static void onResult(@NonNull InputConnectionCommand command,
+ @Nullable ExtractedText result, @Nullable String tag) {
+ if (command.mResultCallbackType
+ != InputConnectionCommand.ResultCallbackType.EXTRACTED_TEXT) {
+ if (tag != null) {
+ Log.e(tag, InputMethodDebug.inputConnectionCommandTypeToString(command.mCommandType)
+ + ": Failed to return result=" + result + " due to callback type mismatch."
+ + " expected=ExtractedText actual=" + command.mResultCallbackType);
+ }
+ return;
+ }
+ try {
+ IExtractedTextResultCallback.Stub.asInterface(command.mResultCallback).onResult(result);
+ } catch (Throwable e) {
+ if (tag != null) {
+ Log.e(tag, InputMethodDebug.inputConnectionCommandTypeToString(command.mCommandType)
+ + ": Failed to return result=" + result, e);
+ }
+ }
+ }
+
+ /**
+ * A utility method to reply associated with {@link InputConnectionCommand}.
+ *
+ * @param command {@link InputConnectionCommand} to be replied.
+ * @param result a {@link SurroundingText} result value to be replied.
+ * @param tag tag name to be used for debug output when the invocation fails.
+ */
+ public static void onResult(@NonNull InputConnectionCommand command,
+ @Nullable SurroundingText result, @Nullable String tag) {
+ if (command.mResultCallbackType
+ != InputConnectionCommand.ResultCallbackType.SURROUNDING_TEXT) {
+ if (tag != null) {
+ Log.e(tag, InputMethodDebug.inputConnectionCommandTypeToString(command.mCommandType)
+ + ": Failed to return result=" + result + " due to callback type mismatch."
+ + " expected=SurroundingText actual=" + command.mResultCallbackType);
+ }
+ return;
+ }
+ try {
+ ISurroundingTextResultCallback.Stub.asInterface(command.mResultCallback)
+ .onResult(result);
+ } catch (Throwable e) {
+ if (tag != null) {
+ Log.e(tag, InputMethodDebug.inputConnectionCommandTypeToString(command.mCommandType)
+ + ": Failed to return result=" + result, e);
+ }
+ }
+ }
}
diff --git a/core/java/com/android/internal/inputmethod/Completable.java b/core/java/com/android/internal/inputmethod/Completable.java
index b419e26..132272c 100644
--- a/core/java/com/android/internal/inputmethod/Completable.java
+++ b/core/java/com/android/internal/inputmethod/Completable.java
@@ -23,12 +23,10 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.util.Log;
-import android.view.inputmethod.InputMethodSubtype;
import com.android.internal.annotations.GuardedBy;
import java.lang.annotation.Retention;
-import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -416,34 +414,6 @@
}
/**
- * @return an instance of {@link Completable.InputBindResult}.
- */
- public static Completable.InputBindResult createInputBindResult() {
- return new Completable.InputBindResult();
- }
-
- /**
- * @return an instance of {@link Completable.InputMethodSubtype}.
- */
- public static Completable.InputMethodSubtype createInputMethodSubtype() {
- return new Completable.InputMethodSubtype();
- }
-
- /**
- * @return an instance of {@link Completable.InputMethodSubtypeList}.
- */
- public static Completable.InputMethodSubtypeList createInputMethodSubtypeList() {
- return new Completable.InputMethodSubtypeList();
- }
-
- /**
- * @return an instance of {@link Completable.InputMethodInfoList}.
- */
- public static Completable.InputMethodInfoList createInputMethodInfoList() {
- return new Completable.InputMethodInfoList();
- }
-
- /**
* @return an instance of {@link Completable.IInputContentUriToken}.
*/
public static Completable.IInputContentUriToken createIInputContentUriToken() {
@@ -480,30 +450,6 @@
extends Values<android.view.inputmethod.SurroundingText> { }
/**
- * Completable object of {@link com.android.internal.view.InputBindResult}.
- */
- public static final class InputBindResult
- extends Values<com.android.internal.view.InputBindResult> { }
-
- /**
- * Completable object of {@link android.view.inputmethod.InputMethodSubtype}.
- */
- public static final class InputMethodSubtype
- extends Values<android.view.inputmethod.InputMethodSubtype> { }
-
- /**
- * Completable object of {@link List<android.view.inputmethod.InputMethodSubtype>}.
- */
- public static final class InputMethodSubtypeList
- extends Values<List<android.view.inputmethod.InputMethodSubtype>> { }
-
- /**
- * Completable object of {@link List<android.view.inputmethod.InputMethodInfo>}.
- */
- public static final class InputMethodInfoList
- extends Values<List<android.view.inputmethod.InputMethodInfo>> { }
-
- /**
* Completable object of {@link IInputContentUriToken>}.
*/
public static final class IInputContentUriToken
diff --git a/core/java/com/android/internal/inputmethod/IIInputContentUriTokenResultCallback.aidl b/core/java/com/android/internal/inputmethod/IInputContentUriTokenResultCallback.aidl
similarity index 94%
rename from core/java/com/android/internal/inputmethod/IIInputContentUriTokenResultCallback.aidl
rename to core/java/com/android/internal/inputmethod/IInputContentUriTokenResultCallback.aidl
index 2e6d224..779acb5 100644
--- a/core/java/com/android/internal/inputmethod/IIInputContentUriTokenResultCallback.aidl
+++ b/core/java/com/android/internal/inputmethod/IInputContentUriTokenResultCallback.aidl
@@ -19,7 +19,7 @@
import com.android.internal.inputmethod.IInputContentUriToken;
import com.android.internal.inputmethod.ThrowableHolder;
-oneway interface IIInputContentUriTokenResultCallback {
+oneway interface IInputContentUriTokenResultCallback {
void onResult(in IInputContentUriToken result);
void onError(in ThrowableHolder exception);
}
\ No newline at end of file
diff --git a/core/java/com/android/internal/inputmethod/IInputContextInvoker.java b/core/java/com/android/internal/inputmethod/IInputContextInvoker.java
index 977f9a5..7a43a55 100644
--- a/core/java/com/android/internal/inputmethod/IInputContextInvoker.java
+++ b/core/java/com/android/internal/inputmethod/IInputContextInvoker.java
@@ -18,6 +18,7 @@
import android.annotation.AnyThread;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.os.Bundle;
import android.os.RemoteException;
import android.view.KeyEvent;
@@ -32,7 +33,7 @@
/**
* A stateless wrapper of {@link com.android.internal.view.IInputContext} to encapsulate boilerplate
- * code around {@link Completable} and {@link RemoteException}.
+ * code around {@link InputConnectionCommand}, {@link Completable} and {@link RemoteException}.
*/
public final class IInputContextInvoker {
@@ -55,8 +56,7 @@
}
/**
- * Invokes {@link IInputContext#getTextAfterCursor(int, int,
- * com.android.internal.inputmethod.ICharSequenceResultCallback)}.
+ * Implements {@link android.view.inputmethod.InputConnection#getTextAfterCursor(int, int)}.
*
* @param length {@code length} parameter to be passed.
* @param flags {@code flags} parameter to be passed.
@@ -67,8 +67,9 @@
@NonNull
public Completable.CharSequence getTextAfterCursor(int length, int flags) {
final Completable.CharSequence value = Completable.createCharSequence();
+ final InputConnectionCommand command = Commands.getTextAfterCursor(length, flags, value);
try {
- mIInputContext.getTextAfterCursor(length, flags, ResultCallbacks.of(value));
+ mIInputContext.doEdit(command);
} catch (RemoteException e) {
value.onError(ThrowableHolder.of(e));
}
@@ -76,7 +77,7 @@
}
/**
- * Invokes {@link IInputContext#getTextBeforeCursor(int, int, ICharSequenceResultCallback)}.
+ * Implements {@link android.view.inputmethod.InputConnection#getTextBeforeCursor(int, int)}.
*
* @param length {@code length} parameter to be passed.
* @param flags {@code flags} parameter to be passed.
@@ -87,8 +88,9 @@
@NonNull
public Completable.CharSequence getTextBeforeCursor(int length, int flags) {
final Completable.CharSequence value = Completable.createCharSequence();
+ final InputConnectionCommand command = Commands.getTextBeforeCursor(length, flags, value);
try {
- mIInputContext.getTextBeforeCursor(length, flags, ResultCallbacks.of(value));
+ mIInputContext.doEdit(command);
} catch (RemoteException e) {
value.onError(ThrowableHolder.of(e));
}
@@ -96,7 +98,7 @@
}
/**
- * Invokes {@link IInputContext#getSelectedText(int, ICharSequenceResultCallback)}.
+ * Implements {@link android.view.inputmethod.InputConnection#getSelectedText(int)}.
*
* @param flags {@code flags} parameter to be passed.
* @return {@link Completable.CharSequence} that can be used to retrieve the invocation result.
@@ -106,8 +108,9 @@
@NonNull
public Completable.CharSequence getSelectedText(int flags) {
final Completable.CharSequence value = Completable.createCharSequence();
+ final InputConnectionCommand command = Commands.getSelectedText(flags, value);
try {
- mIInputContext.getSelectedText(flags, ResultCallbacks.of(value));
+ mIInputContext.doEdit(command);
} catch (RemoteException e) {
value.onError(ThrowableHolder.of(e));
}
@@ -115,8 +118,8 @@
}
/**
- * Invokes
- * {@link IInputContext#getSurroundingText(int, int, int, ISurroundingTextResultCallback)}.
+ * Implements
+ * {@link android.view.inputmethod.InputConnection#getSurroundingText(int, int, int)}.
*
* @param beforeLength {@code beforeLength} parameter to be passed.
* @param afterLength {@code afterLength} parameter to be passed.
@@ -129,9 +132,10 @@
public Completable.SurroundingText getSurroundingText(int beforeLength, int afterLength,
int flags) {
final Completable.SurroundingText value = Completable.createSurroundingText();
+ final InputConnectionCommand command =
+ Commands.getSurroundingText(beforeLength, afterLength, flags, value);
try {
- mIInputContext.getSurroundingText(beforeLength, afterLength, flags,
- ResultCallbacks.of(value));
+ mIInputContext.doEdit(command);
} catch (RemoteException e) {
value.onError(ThrowableHolder.of(e));
}
@@ -139,7 +143,7 @@
}
/**
- * Invokes {@link IInputContext#getCursorCapsMode(int, IIntResultCallback)}.
+ * Implements {@link android.view.inputmethod.InputConnection#getCursorCapsMode(int)}.
*
* @param reqModes {@code reqModes} parameter to be passed.
* @return {@link Completable.Int} that can be used to retrieve the invocation result.
@@ -149,8 +153,9 @@
@NonNull
public Completable.Int getCursorCapsMode(int reqModes) {
final Completable.Int value = Completable.createInt();
+ final InputConnectionCommand command = Commands.getCursorCapsMode(reqModes, value);
try {
- mIInputContext.getCursorCapsMode(reqModes, ResultCallbacks.of(value));
+ mIInputContext.doEdit(command);
} catch (RemoteException e) {
value.onError(ThrowableHolder.of(e));
}
@@ -158,8 +163,8 @@
}
/**
- * Invokes {@link IInputContext#getExtractedText(ExtractedTextRequest, int,
- * IExtractedTextResultCallback)}.
+ * Implements
+ * {@link android.view.inputmethod.InputConnection#getExtractedText(ExtractedTextRequest, int)}.
*
* @param request {@code request} parameter to be passed.
* @param flags {@code flags} parameter to be passed.
@@ -170,8 +175,9 @@
@NonNull
public Completable.ExtractedText getExtractedText(ExtractedTextRequest request, int flags) {
final Completable.ExtractedText value = Completable.createExtractedText();
+ final InputConnectionCommand command = Commands.getExtractedText(request, flags, value);
try {
- mIInputContext.getExtractedText(request, flags, ResultCallbacks.of(value));
+ mIInputContext.doEdit(command);
} catch (RemoteException e) {
value.onError(ThrowableHolder.of(e));
}
@@ -179,7 +185,7 @@
}
/**
- * Invokes {@link IInputContext#commitText(CharSequence, int)}.
+ * Implements {@link android.view.inputmethod.InputConnection#commitText(CharSequence, int)}.
*
* @param text {@code text} parameter to be passed.
* @param newCursorPosition {@code newCursorPosition} parameter to be passed.
@@ -188,8 +194,9 @@
*/
@AnyThread
public boolean commitText(CharSequence text, int newCursorPosition) {
+ final InputConnectionCommand command = Commands.commitText(text, newCursorPosition);
try {
- mIInputContext.commitText(text, newCursorPosition);
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
@@ -197,7 +204,7 @@
}
/**
- * Invokes {@link IInputContext#commitCompletion(CompletionInfo)}.
+ * Implements {@link android.view.inputmethod.InputConnection#commitCompletion(CompletionInfo)}.
*
* @param text {@code text} parameter to be passed.
* @return {@code true} if the invocation is completed without {@link RemoteException}.
@@ -205,8 +212,9 @@
*/
@AnyThread
public boolean commitCompletion(CompletionInfo text) {
+ final InputConnectionCommand command = Commands.commitCompletion(text);
try {
- mIInputContext.commitCompletion(text);
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
@@ -214,7 +222,7 @@
}
/**
- * Invokes {@link IInputContext#commitCorrection(CorrectionInfo)}.
+ * Implements {@link android.view.inputmethod.InputConnection#commitCorrection(CorrectionInfo)}.
*
* @param correctionInfo {@code correctionInfo} parameter to be passed.
* @return {@code true} if the invocation is completed without {@link RemoteException}.
@@ -222,8 +230,9 @@
*/
@AnyThread
public boolean commitCorrection(CorrectionInfo correctionInfo) {
+ final InputConnectionCommand command = Commands.commitCorrection(correctionInfo);
try {
- mIInputContext.commitCorrection(correctionInfo);
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
@@ -231,7 +240,7 @@
}
/**
- * Invokes {@link IInputContext#setSelection(int, int)}.
+ * Implements {@link android.view.inputmethod.InputConnection#setSelection(int, int)}.
*
* @param start {@code start} parameter to be passed.
* @param end {@code start} parameter to be passed.
@@ -240,8 +249,9 @@
*/
@AnyThread
public boolean setSelection(int start, int end) {
+ final InputConnectionCommand command = Commands.setSelection(start, end);
try {
- mIInputContext.setSelection(start, end);
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
@@ -249,7 +259,7 @@
}
/**
- * Invokes {@link IInputContext#performEditorAction(int)}.
+ * Implements {@link android.view.inputmethod.InputConnection#performEditorAction(int)}.
*
* @param actionCode {@code start} parameter to be passed.
* @return {@code true} if the invocation is completed without {@link RemoteException}.
@@ -257,8 +267,9 @@
*/
@AnyThread
public boolean performEditorAction(int actionCode) {
+ final InputConnectionCommand command = Commands.performEditorAction(actionCode);
try {
- mIInputContext.performEditorAction(actionCode);
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
@@ -266,7 +277,7 @@
}
/**
- * Invokes {@link IInputContext#performContextMenuAction(id)}.
+ * Implements {@link android.view.inputmethod.InputConnection#performContextMenuAction(int)}.
*
* @param id {@code id} parameter to be passed.
* @return {@code true} if the invocation is completed without {@link RemoteException}.
@@ -274,8 +285,9 @@
*/
@AnyThread
public boolean performContextMenuAction(int id) {
+ final InputConnectionCommand command = Commands.performContextMenuAction(id);
try {
- mIInputContext.performContextMenuAction(id);
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
@@ -283,7 +295,7 @@
}
/**
- * Invokes {@link IInputContext#setComposingRegion(int, int)}.
+ * Implements {@link android.view.inputmethod.InputConnection#setComposingRegion(int, int)}.
*
* @param start {@code id} parameter to be passed.
* @param end {@code id} parameter to be passed.
@@ -292,8 +304,9 @@
*/
@AnyThread
public boolean setComposingRegion(int start, int end) {
+ final InputConnectionCommand command = Commands.setComposingRegion(start, end);
try {
- mIInputContext.setComposingRegion(start, end);
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
@@ -301,7 +314,8 @@
}
/**
- * Invokes {@link IInputContext#setComposingText(CharSequence, int)}.
+ * Implements
+ * {@link android.view.inputmethod.InputConnection#setComposingText(CharSequence, int)}.
*
* @param text {@code text} parameter to be passed.
* @param newCursorPosition {@code newCursorPosition} parameter to be passed.
@@ -310,8 +324,9 @@
*/
@AnyThread
public boolean setComposingText(CharSequence text, int newCursorPosition) {
+ final InputConnectionCommand command = Commands.setComposingText(text, newCursorPosition);
try {
- mIInputContext.setComposingText(text, newCursorPosition);
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
@@ -319,15 +334,16 @@
}
/**
- * Invokes {@link IInputContext#finishComposingText()}.
+ * Implements {@link android.view.inputmethod.InputConnection#finishComposingText()}.
*
* @return {@code true} if the invocation is completed without {@link RemoteException}.
* {@code false} otherwise.
*/
@AnyThread
public boolean finishComposingText() {
+ final InputConnectionCommand command = Commands.finishComposingText();
try {
- mIInputContext.finishComposingText();
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
@@ -335,15 +351,16 @@
}
/**
- * Invokes {@link IInputContext#beginBatchEdit()}.
+ * Implements {@link android.view.inputmethod.InputConnection#beginBatchEdit()}.
*
* @return {@code true} if the invocation is completed without {@link RemoteException}.
* {@code false} otherwise.
*/
@AnyThread
public boolean beginBatchEdit() {
+ final InputConnectionCommand command = Commands.beginBatchEdit();
try {
- mIInputContext.beginBatchEdit();
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
@@ -351,15 +368,16 @@
}
/**
- * Invokes {@link IInputContext#endBatchEdit()}.
+ * Implements {@link android.view.inputmethod.InputConnection#endBatchEdit()}.
*
* @return {@code true} if the invocation is completed without {@link RemoteException}.
* {@code false} otherwise.
*/
@AnyThread
public boolean endBatchEdit() {
+ final InputConnectionCommand command = Commands.endBatchEdit();
try {
- mIInputContext.endBatchEdit();
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
@@ -367,7 +385,7 @@
}
/**
- * Invokes {@link IInputContext#sendKeyEvent(KeyEvent)}.
+ * Implements {@link android.view.inputmethod.InputConnection#sendKeyEvent(KeyEvent)}.
*
* @param event {@code event} parameter to be passed.
* @return {@code true} if the invocation is completed without {@link RemoteException}.
@@ -375,8 +393,9 @@
*/
@AnyThread
public boolean sendKeyEvent(KeyEvent event) {
+ final InputConnectionCommand command = Commands.sendKeyEvent(event);
try {
- mIInputContext.sendKeyEvent(event);
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
@@ -384,7 +403,7 @@
}
/**
- * Invokes {@link IInputContext#clearMetaKeyStates(int)}.
+ * Implements {@link android.view.inputmethod.InputConnection#clearMetaKeyStates(int)}.
*
* @param states {@code states} parameter to be passed.
* @return {@code true} if the invocation is completed without {@link RemoteException}.
@@ -392,8 +411,9 @@
*/
@AnyThread
public boolean clearMetaKeyStates(int states) {
+ final InputConnectionCommand command = Commands.clearMetaKeyStates(states);
try {
- mIInputContext.clearMetaKeyStates(states);
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
@@ -401,7 +421,7 @@
}
/**
- * Invokes {@link IInputContext#deleteSurroundingText(int, int)}.
+ * Implements {@link android.view.inputmethod.InputConnection#deleteSurroundingText(int, int)}.
*
* @param beforeLength {@code beforeLength} parameter to be passed.
* @param afterLength {@code afterLength} parameter to be passed.
@@ -410,8 +430,10 @@
*/
@AnyThread
public boolean deleteSurroundingText(int beforeLength, int afterLength) {
+ final InputConnectionCommand command =
+ Commands.deleteSurroundingText(beforeLength, afterLength);
try {
- mIInputContext.deleteSurroundingText(beforeLength, afterLength);
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
@@ -419,7 +441,8 @@
}
/**
- * Invokes {@link IInputContext#deleteSurroundingTextInCodePoints(int, int)}.
+ * Implements
+ * {@link android.view.inputmethod.InputConnection#deleteSurroundingTextInCodePoints(int, int)}.
*
* @param beforeLength {@code beforeLength} parameter to be passed.
* @param afterLength {@code afterLength} parameter to be passed.
@@ -428,8 +451,10 @@
*/
@AnyThread
public boolean deleteSurroundingTextInCodePoints(int beforeLength, int afterLength) {
+ final InputConnectionCommand command =
+ Commands.deleteSurroundingTextInCodePoints(beforeLength, afterLength);
try {
- mIInputContext.deleteSurroundingTextInCodePoints(beforeLength, afterLength);
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
@@ -437,15 +462,16 @@
}
/**
- * Invokes {@link IInputContext#performSpellCheck()}.
+ * Implements {@link android.view.inputmethod.InputConnection#performSpellCheck()}.
*
* @return {@code true} if the invocation is completed without {@link RemoteException}.
* {@code false} otherwise.
*/
@AnyThread
public boolean performSpellCheck() {
+ final InputConnectionCommand command = Commands.performSpellCheck();
try {
- mIInputContext.performSpellCheck();
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
@@ -453,7 +479,8 @@
}
/**
- * Invokes {@link IInputContext#performPrivateCommand(String, Bundle)}.
+ * Implements
+ * {@link android.view.inputmethod.InputConnection#performPrivateCommand(String, Bundle)}.
*
* @param action {@code action} parameter to be passed.
* @param data {@code data} parameter to be passed.
@@ -462,8 +489,9 @@
*/
@AnyThread
public boolean performPrivateCommand(String action, Bundle data) {
+ final InputConnectionCommand command = Commands.performPrivateCommand(action, data);
try {
- mIInputContext.performPrivateCommand(action, data);
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
@@ -471,7 +499,7 @@
}
/**
- * Invokes {@link IInputContext#requestCursorUpdates(int, IIntResultCallback)}.
+ * Implements {@link android.view.inputmethod.InputConnection#requestCursorUpdates(int)}.
*
* @param cursorUpdateMode {@code cursorUpdateMode} parameter to be passed.
* @return {@link Completable.Boolean} that can be used to retrieve the invocation result.
@@ -481,8 +509,10 @@
@NonNull
public Completable.Boolean requestCursorUpdates(int cursorUpdateMode) {
final Completable.Boolean value = Completable.createBoolean();
+ final InputConnectionCommand command =
+ Commands.requestCursorUpdates(cursorUpdateMode, value);
try {
- mIInputContext.requestCursorUpdates(cursorUpdateMode, ResultCallbacks.of(value));
+ mIInputContext.doEdit(command);
} catch (RemoteException e) {
value.onError(ThrowableHolder.of(e));
}
@@ -490,8 +520,8 @@
}
/**
- * Invokes
- * {@link IInputContext#commitContent(InputContentInfo, int, Bundle, IIntResultCallback)}.
+ * Implements {@link android.view.inputmethod.InputConnection#commitContent(InputContentInfo,
+ * int, Bundle)}.
*
* @param inputContentInfo {@code inputContentInfo} parameter to be passed.
* @param flags {@code flags} parameter to be passed.
@@ -504,8 +534,10 @@
public Completable.Boolean commitContent(InputContentInfo inputContentInfo, int flags,
Bundle opts) {
final Completable.Boolean value = Completable.createBoolean();
+ final InputConnectionCommand command =
+ Commands.commitContent(inputContentInfo, flags, opts, value);
try {
- mIInputContext.commitContent(inputContentInfo, flags, opts, ResultCallbacks.of(value));
+ mIInputContext.doEdit(command);
} catch (RemoteException e) {
value.onError(ThrowableHolder.of(e));
}
@@ -513,7 +545,7 @@
}
/**
- * Invokes {@link IInputContext#setImeConsumesInput(boolean)}.
+ * Implements {@link android.view.inputmethod.InputConnection#setImeConsumesInput(boolean)}.
*
* @param imeConsumesInput {@code imeConsumesInput} parameter to be passed.
* @return {@code true} if the invocation is completed without {@link RemoteException}.
@@ -521,11 +553,341 @@
*/
@AnyThread
public boolean setImeConsumesInput(boolean imeConsumesInput) {
+ final InputConnectionCommand command = Commands.setImeConsumesInput(imeConsumesInput);
try {
- mIInputContext.setImeConsumesInput(imeConsumesInput);
+ mIInputContext.doEdit(command);
return true;
} catch (RemoteException e) {
return false;
}
}
+
+ /**
+ * Defines the data packing rules from {@link android.view.inputmethod.InputConnection} API
+ * params into {@link InputConnectionCommand} fields.
+ *
+ * Rules need to be in sync with {@link com.android.internal.view.IInputConnectionWrapper} and
+ * {@link InputMethodDebug#dumpInputConnectionCommand(InputConnectionCommand)}.
+ */
+ private static final class Commands {
+ /**
+ * Not intended to be instantiated.
+ */
+ private Commands() { }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand getTextAfterCursor(int n, int flags,
+ @NonNull Completable.CharSequence returnValue) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.GET_TEXT_AFTER_CURSOR,
+ n,
+ 0,
+ flags,
+ null,
+ null,
+ null,
+ InputConnectionCommand.ParcelableType.NULL,
+ null,
+ returnValue);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand getTextBeforeCursor(int n, int flags,
+ @NonNull Completable.CharSequence returnValue) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.GET_TEXT_BEFORE_CURSOR,
+ n,
+ 0,
+ flags,
+ null,
+ null,
+ null,
+ InputConnectionCommand.ParcelableType.NULL,
+ null,
+ returnValue);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand getSelectedText(int flags,
+ @NonNull Completable.CharSequence returnValue) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.GET_SELECTED_TEXT,
+ 0,
+ 0,
+ flags,
+ null,
+ null,
+ null,
+ InputConnectionCommand.ParcelableType.NULL,
+ null,
+ returnValue);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand getSurroundingText(int beforeLength, int afterLength,
+ int flags, @NonNull Completable.SurroundingText returnValue) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.GET_SURROUNDING_TEXT,
+ beforeLength,
+ afterLength,
+ flags,
+ null,
+ null,
+ null,
+ InputConnectionCommand.ParcelableType.NULL,
+ null,
+ returnValue);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand getCursorCapsMode(int reqModes,
+ @NonNull Completable.Int returnValue) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.GET_CURSOR_CAPS_MODE,
+ reqModes,
+ 0,
+ 0,
+ null,
+ null,
+ null,
+ InputConnectionCommand.ParcelableType.NULL,
+ null,
+ returnValue);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand getExtractedText(@Nullable ExtractedTextRequest request,
+ int flags, @NonNull Completable.ExtractedText returnValue) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.GET_EXTRACTED_TEXT,
+ 0,
+ 0,
+ flags,
+ null,
+ null,
+ null,
+ InputConnectionCommand.ParcelableType.EXTRACTED_TEXT_REQUEST,
+ request,
+ returnValue);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand commitText(@Nullable CharSequence text,
+ int newCursorPosition) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.COMMIT_TEXT,
+ newCursorPosition,
+ 0,
+ 0,
+ text);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand commitCompletion(@Nullable CompletionInfo text) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.COMMIT_COMPLETION,
+ 0,
+ 0,
+ 0,
+ null,
+ null,
+ null,
+ InputConnectionCommand.ParcelableType.COMPLETION_INFO,
+ text);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand commitCorrection(@Nullable CorrectionInfo correctionInfo) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.COMMIT_CORRECTION,
+ 0,
+ 0,
+ 0,
+ null,
+ null,
+ null,
+ InputConnectionCommand.ParcelableType.CORRECTION_INFO,
+ correctionInfo);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand setSelection(int start, int end) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.SET_SELECTION,
+ start,
+ end);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand performEditorAction(int actionCode) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.PERFORM_EDITOR_ACTION,
+ actionCode);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand performContextMenuAction(int id) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.PERFORM_CONTEXT_MENU_ACTION,
+ id);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand setComposingRegion(int start, int end) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.SET_COMPOSING_REGION,
+ start,
+ end);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand setComposingText(@Nullable CharSequence text,
+ int newCursorPosition) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.SET_COMPOSING_TEXT,
+ newCursorPosition,
+ 0,
+ 0,
+ text);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand finishComposingText() {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.FINISH_COMPOSING_TEXT);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand beginBatchEdit() {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.BEGIN_BATCH_EDIT);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand endBatchEdit() {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.END_BATCH_EDIT);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand sendKeyEvent(@Nullable KeyEvent event) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.SEND_KEY_EVENT,
+ 0,
+ 0,
+ 0,
+ null,
+ null,
+ null,
+ InputConnectionCommand.ParcelableType.KEY_EVENT,
+ event);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand clearMetaKeyStates(int states) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.CLEAR_META_KEY_STATES,
+ states);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand deleteSurroundingText(int beforeLength, int afterLength) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.DELETE_SURROUNDING_TEXT,
+ beforeLength,
+ afterLength);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand deleteSurroundingTextInCodePoints(int beforeLength,
+ int afterLength) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.DELETE_SURROUNDING_TEXT_IN_CODE_POINTS,
+ beforeLength,
+ afterLength);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand performSpellCheck() {
+ return InputConnectionCommand.create(InputConnectionCommandType.PERFORM_SPELL_CHECK);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand performPrivateCommand(@Nullable String action,
+ @Nullable Bundle data) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.PERFORM_PRIVATE_COMMAND,
+ 0,
+ 0,
+ 0,
+ null,
+ action,
+ data);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand requestCursorUpdates(int cursorUpdateMode,
+ @NonNull Completable.Boolean returnValue) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.REQUEST_CURSOR_UPDATES,
+ cursorUpdateMode,
+ 0,
+ 0,
+ null,
+ null,
+ null,
+ InputConnectionCommand.ParcelableType.NULL,
+ null,
+ returnValue);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand commitContent(@Nullable InputContentInfo inputContentInfo,
+ int flags, @Nullable Bundle opts, @NonNull Completable.Boolean returnValue) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.COMMIT_CONTENT,
+ 0,
+ 0,
+ flags,
+ null,
+ null,
+ opts,
+ InputConnectionCommand.ParcelableType.INPUT_CONTENT_INFO,
+ inputContentInfo,
+ returnValue);
+ }
+
+ @AnyThread
+ @NonNull
+ static InputConnectionCommand setImeConsumesInput(boolean imeConsumesInput) {
+ return InputConnectionCommand.create(
+ InputConnectionCommandType.SET_IME_CONSUMES_INPUT,
+ imeConsumesInput ? 1 : 0);
+ }
+ }
}
diff --git a/core/java/com/android/internal/inputmethod/IInputMethodPrivilegedOperations.aidl b/core/java/com/android/internal/inputmethod/IInputMethodPrivilegedOperations.aidl
index 11df5a8..36943e3 100644
--- a/core/java/com/android/internal/inputmethod/IInputMethodPrivilegedOperations.aidl
+++ b/core/java/com/android/internal/inputmethod/IInputMethodPrivilegedOperations.aidl
@@ -21,7 +21,7 @@
import com.android.internal.inputmethod.IBooleanResultCallback;
import com.android.internal.inputmethod.IInputContentUriToken;
-import com.android.internal.inputmethod.IIInputContentUriTokenResultCallback;
+import com.android.internal.inputmethod.IInputContentUriTokenResultCallback;
import com.android.internal.inputmethod.IVoidResultCallback;
/**
@@ -32,7 +32,7 @@
void setImeWindowStatusAsync(int vis, int backDisposition);
void reportStartInputAsync(in IBinder startInputToken);
void createInputContentUriToken(in Uri contentUri, in String packageName,
- in IIInputContentUriTokenResultCallback resultCallback);
+ in IInputContentUriTokenResultCallback resultCallback);
void reportFullscreenModeAsync(boolean fullscreen);
void setInputMethod(String id, in IVoidResultCallback resultCallback);
void setInputMethodAndSubtype(String id, in InputMethodSubtype subtype,
diff --git a/core/java/com/android/internal/inputmethod/IIInputContentUriTokenResultCallback.aidl b/core/java/com/android/internal/inputmethod/InputConnectionCommand.aidl
similarity index 64%
copy from core/java/com/android/internal/inputmethod/IIInputContentUriTokenResultCallback.aidl
copy to core/java/com/android/internal/inputmethod/InputConnectionCommand.aidl
index 2e6d224..c7c2ad8 100644
--- a/core/java/com/android/internal/inputmethod/IIInputContentUriTokenResultCallback.aidl
+++ b/core/java/com/android/internal/inputmethod/InputConnectionCommand.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2020 The Android Open Source Project
+ * Copyright (C) 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,10 +16,4 @@
package com.android.internal.inputmethod;
-import com.android.internal.inputmethod.IInputContentUriToken;
-import com.android.internal.inputmethod.ThrowableHolder;
-
-oneway interface IIInputContentUriTokenResultCallback {
- void onResult(in IInputContentUriToken result);
- void onError(in ThrowableHolder exception);
-}
\ No newline at end of file
+parcelable InputConnectionCommand;
diff --git a/core/java/com/android/internal/inputmethod/InputConnectionCommand.java b/core/java/com/android/internal/inputmethod/InputConnectionCommand.java
new file mode 100644
index 0000000..4116b02
--- /dev/null
+++ b/core/java/com/android/internal/inputmethod/InputConnectionCommand.java
@@ -0,0 +1,460 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.inputmethod;
+
+import static java.lang.annotation.RetentionPolicy.SOURCE;
+
+import android.annotation.AnyThread;
+import android.annotation.IntDef;
+import android.annotation.IntRange;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.inputmethod.CompletionInfo;
+import android.view.inputmethod.CorrectionInfo;
+import android.view.inputmethod.ExtractedTextRequest;
+import android.view.inputmethod.InputContentInfo;
+
+import java.lang.annotation.Retention;
+
+/**
+ * Defines the command message to be used for IMEs to remotely invoke
+ * {@link android.view.inputmethod.InputConnection} APIs in the IME client process then receive
+ * results.
+ */
+public final class InputConnectionCommand implements Parcelable {
+ private static final String TAG = "InputConnectionCommand";
+
+ @Retention(SOURCE)
+ @IntDef(value = {
+ ResultCallbackType.NULL,
+ ResultCallbackType.BOOLEAN,
+ ResultCallbackType.INT,
+ ResultCallbackType.CHAR_SEQUENCE,
+ ResultCallbackType.EXTRACTED_TEXT,
+ ResultCallbackType.SURROUNDING_TEXT,
+ })
+ @interface ResultCallbackType {
+ int NULL = 0;
+ int BOOLEAN = 1;
+ int INT = 2;
+ int CHAR_SEQUENCE = 3;
+ int EXTRACTED_TEXT = 4;
+ int SURROUNDING_TEXT = 5;
+ }
+
+ @Retention(SOURCE)
+ @IntDef(value = {
+ ParcelableType.NULL,
+ ParcelableType.EXTRACTED_TEXT_REQUEST,
+ ParcelableType.COMPLETION_INFO,
+ ParcelableType.CORRECTION_INFO,
+ ParcelableType.KEY_EVENT,
+ ParcelableType.INPUT_CONTENT_INFO,
+ })
+ @interface ParcelableType {
+ int NULL = 0;
+ int EXTRACTED_TEXT_REQUEST = 1;
+ int COMPLETION_INFO = 2;
+ int CORRECTION_INFO = 3;
+ int KEY_EVENT = 4;
+ int INPUT_CONTENT_INFO = 5;
+ }
+
+ @Retention(SOURCE)
+ @IntDef(flag = true, value = {
+ FieldMask.INT_ARG0,
+ FieldMask.INT_ARG1,
+ FieldMask.FLAGS,
+ FieldMask.CHAR_SEQUENCE,
+ FieldMask.STRING,
+ FieldMask.BUNDLE,
+ FieldMask.PARCELABLE,
+ FieldMask.CALLBACK,
+ })
+ @interface FieldMask {
+ int INT_ARG0 = 1 << 0;
+ int INT_ARG1 = 1 << 1;
+ int FLAGS = 1 << 2;
+ int CHAR_SEQUENCE = 1 << 3;
+ int STRING = 1 << 4;
+ int BUNDLE = 1 << 5;
+ int PARCELABLE = 1 << 6;
+ int CALLBACK = 1 << 7;
+ }
+
+ @IntRange(from = InputConnectionCommandType.FIRST_COMMAND,
+ to = InputConnectionCommandType.LAST_COMMAND)
+ @InputConnectionCommandType
+ public final int mCommandType;
+ public final int mIntArg0;
+ public final int mIntArg1;
+ public final int mFlags;
+ public final CharSequence mCharSequence;
+ public final String mString;
+ public final Bundle mBundle;
+ @ParcelableType
+ public final int mParcelableType;
+ public final Parcelable mParcelable;
+ @ResultCallbackType
+ public final int mResultCallbackType;
+ public final IBinder mResultCallback;
+
+ private InputConnectionCommand(
+ @IntRange(
+ from = InputConnectionCommandType.FIRST_COMMAND,
+ to = InputConnectionCommandType.LAST_COMMAND)
+ @InputConnectionCommandType int type, int intArg0, int intArg1, int flags,
+ @Nullable CharSequence charSequence, @Nullable String string, @Nullable Bundle bundle,
+ @ParcelableType int parcelableType, @Nullable Parcelable parcelable,
+ @ResultCallbackType int resultCallbackType, @Nullable IBinder resultCallback) {
+ if (type < InputConnectionCommandType.FIRST_COMMAND
+ || InputConnectionCommandType.LAST_COMMAND < type) {
+ throw new IllegalArgumentException("Unknown type=" + type);
+ }
+ mCommandType = type;
+ mIntArg0 = intArg0;
+ mIntArg1 = intArg1;
+ mFlags = flags;
+ mCharSequence = charSequence;
+ mString = string;
+ mBundle = bundle;
+ mParcelableType = parcelableType;
+ mParcelable = parcelable;
+ mResultCallbackType = resultCallbackType;
+ mResultCallback = resultCallback;
+ }
+
+ /**
+ * Creates {@link InputConnectionCommand} with the given {@link InputConnectionCommandType}.
+ *
+ * @param type {@link InputConnectionCommandType} to be set.
+ * @return An {@link InputConnectionCommand} that is initialized with {@code type}.
+ */
+ @NonNull
+ public static InputConnectionCommand create(
+ @IntRange(
+ from = InputConnectionCommandType.FIRST_COMMAND,
+ to = InputConnectionCommandType.LAST_COMMAND)
+ @InputConnectionCommandType int type) {
+ return create(type, 0);
+ }
+
+ @NonNull
+ static InputConnectionCommand create(
+ @IntRange(
+ from = InputConnectionCommandType.FIRST_COMMAND,
+ to = InputConnectionCommandType.LAST_COMMAND)
+ @InputConnectionCommandType int type, int intArg0) {
+ return create(type, intArg0, 0);
+ }
+
+ @NonNull
+ static InputConnectionCommand create(
+ @IntRange(
+ from = InputConnectionCommandType.FIRST_COMMAND,
+ to = InputConnectionCommandType.LAST_COMMAND)
+ @InputConnectionCommandType int type, int intArg0, int intArg1) {
+ return create(type, intArg0, intArg1, 0, null);
+ }
+
+ @NonNull
+ static InputConnectionCommand create(
+ @IntRange(
+ from = InputConnectionCommandType.FIRST_COMMAND,
+ to = InputConnectionCommandType.LAST_COMMAND)
+ @InputConnectionCommandType int type, int intArg0,
+ int intArg1, int flags, @Nullable CharSequence charSequence) {
+ return create(type, intArg0, intArg1, flags, charSequence, null, null);
+ }
+
+ @NonNull
+ static InputConnectionCommand create(
+ @IntRange(
+ from = InputConnectionCommandType.FIRST_COMMAND,
+ to = InputConnectionCommandType.LAST_COMMAND)
+ @InputConnectionCommandType int type,
+ int intArg0, int intArg1, int flags, @Nullable CharSequence charSequence,
+ @Nullable String string, @Nullable Bundle bundle) {
+ return create(type, intArg0, intArg1, flags, charSequence, string,
+ bundle, ParcelableType.NULL, null);
+ }
+
+ @NonNull
+ static InputConnectionCommand create(
+ @IntRange(
+ from = InputConnectionCommandType.FIRST_COMMAND,
+ to = InputConnectionCommandType.LAST_COMMAND)
+ @InputConnectionCommandType int type,
+ int intArg0, int intArg1, int flags, @Nullable CharSequence charSequence,
+ @Nullable String string, @Nullable Bundle bundle,
+ @ParcelableType int parcelableType, @Nullable Parcelable parcelable) {
+ return new InputConnectionCommand(type, intArg0, intArg1, flags, charSequence, string,
+ bundle, parcelableType, parcelable, ResultCallbackType.NULL, null);
+ }
+
+ @NonNull
+ static InputConnectionCommand create(
+ @IntRange(
+ from = InputConnectionCommandType.FIRST_COMMAND,
+ to = InputConnectionCommandType.LAST_COMMAND)
+ @InputConnectionCommandType int type,
+ int intArg0, int intArg1, int flags, @Nullable CharSequence charSequence,
+ @Nullable String string, @Nullable Bundle bundle,
+ @ParcelableType int parcelableType, @Nullable Parcelable parcelable,
+ @NonNull Completable.Boolean returnValue) {
+ return new InputConnectionCommand(type, intArg0, intArg1, flags, charSequence, string,
+ bundle, parcelableType, parcelable,
+ ResultCallbackType.BOOLEAN, ResultCallbacks.of(returnValue));
+ }
+
+ @NonNull
+ static InputConnectionCommand create(
+ @IntRange(
+ from = InputConnectionCommandType.FIRST_COMMAND,
+ to = InputConnectionCommandType.LAST_COMMAND)
+ @InputConnectionCommandType int type,
+ int intArg0, int intArg1, int flags, @Nullable CharSequence charSequence,
+ @Nullable String string, @Nullable Bundle bundle,
+ @ParcelableType int parcelableType, @Nullable Parcelable parcelable,
+ @NonNull Completable.Int returnValue) {
+ return new InputConnectionCommand(type, intArg0, intArg1, flags, charSequence, string,
+ bundle, parcelableType, parcelable,
+ ResultCallbackType.INT, ResultCallbacks.of(returnValue));
+ }
+
+ @NonNull
+ static InputConnectionCommand create(
+ @IntRange(
+ from = InputConnectionCommandType.FIRST_COMMAND,
+ to = InputConnectionCommandType.LAST_COMMAND)
+ @InputConnectionCommandType int type,
+ int intArg0, int intArg1, int flags, @Nullable CharSequence charSequence,
+ @Nullable String string, @Nullable Bundle bundle,
+ @ParcelableType int parcelableType, @Nullable Parcelable parcelable,
+ @NonNull Completable.CharSequence returnValue) {
+ return new InputConnectionCommand(type, intArg0, intArg1, flags, charSequence, string,
+ bundle, parcelableType, parcelable,
+ ResultCallbackType.CHAR_SEQUENCE, ResultCallbacks.of(returnValue));
+ }
+
+ @NonNull
+ static InputConnectionCommand create(
+ @IntRange(
+ from = InputConnectionCommandType.FIRST_COMMAND,
+ to = InputConnectionCommandType.LAST_COMMAND)
+ @InputConnectionCommandType int type,
+ int intArg0, int intArg1, int flags, @Nullable CharSequence charSequence,
+ @Nullable String string, @Nullable Bundle bundle,
+ @ParcelableType int parcelableType, @Nullable Parcelable parcelable,
+ @NonNull Completable.ExtractedText returnValue) {
+ return new InputConnectionCommand(type, intArg0, intArg1, flags, charSequence, string,
+ bundle, parcelableType, parcelable,
+ ResultCallbackType.EXTRACTED_TEXT, ResultCallbacks.of(returnValue));
+ }
+
+ @NonNull
+ static InputConnectionCommand create(
+ @IntRange(
+ from = InputConnectionCommandType.FIRST_COMMAND,
+ to = InputConnectionCommandType.LAST_COMMAND)
+ @InputConnectionCommandType int type,
+ int intArg0, int intArg1, int flags, @Nullable CharSequence charSequence,
+ @Nullable String string, @Nullable Bundle bundle,
+ @ParcelableType int parcelableType, @Nullable Parcelable parcelable,
+ @NonNull Completable.SurroundingText returnValue) {
+ return new InputConnectionCommand(type, intArg0, intArg1, flags, charSequence, string,
+ bundle, parcelableType, parcelable,
+ ResultCallbackType.SURROUNDING_TEXT, ResultCallbacks.of(returnValue));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @AnyThread
+ @Override
+ public int describeContents() {
+ int result = 0;
+ if (mBundle != null) {
+ result |= mBundle.describeContents();
+ }
+ if (mParcelable != null) {
+ result |= mParcelable.describeContents();
+ }
+ // Here we assume other objects will never contain FDs to be parcelled.
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @AnyThread
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(mCommandType);
+
+ @FieldMask final int fieldMask = getFieldMask();
+ dest.writeInt(fieldMask);
+ if ((fieldMask & FieldMask.INT_ARG0) != 0) {
+ dest.writeInt(mIntArg0);
+ }
+ if ((fieldMask & FieldMask.INT_ARG1) != 0) {
+ dest.writeInt(mIntArg1);
+ }
+ if ((fieldMask & FieldMask.FLAGS) != 0) {
+ dest.writeInt(mFlags);
+ }
+ if ((fieldMask & FieldMask.CHAR_SEQUENCE) != 0) {
+ TextUtils.writeToParcel(mCharSequence, dest, flags);
+ }
+ if ((fieldMask & FieldMask.STRING) != 0) {
+ dest.writeString(mString);
+ }
+ if ((fieldMask & FieldMask.BUNDLE) != 0) {
+ dest.writeBundle(mBundle);
+ }
+ if ((fieldMask & FieldMask.PARCELABLE) != 0) {
+ dest.writeInt(mParcelableType);
+ dest.writeTypedObject(mParcelable, flags);
+ }
+ if ((fieldMask & FieldMask.CALLBACK) != 0) {
+ dest.writeInt(mResultCallbackType);
+ dest.writeStrongBinder(mResultCallback);
+ }
+ }
+
+ @FieldMask
+ @AnyThread
+ private int getFieldMask() {
+ return (mIntArg0 != 0 ? FieldMask.INT_ARG0 : 0)
+ | (mIntArg1 != 0 ? FieldMask.INT_ARG1 : 0)
+ | (mFlags != 0 ? FieldMask.FLAGS : 0)
+ | (mCharSequence != null ? FieldMask.CHAR_SEQUENCE : 0)
+ | (mString != null ? FieldMask.STRING : 0)
+ | (mBundle != null ? FieldMask.BUNDLE : 0)
+ | (mParcelableType != ParcelableType.NULL ? FieldMask.PARCELABLE : 0)
+ | (mResultCallbackType != ResultCallbackType.NULL ? FieldMask.CALLBACK : 0);
+ }
+
+ @AnyThread
+ @Nullable
+ private static InputConnectionCommand createFromParcel(@NonNull Parcel source) {
+ final int type = source.readInt();
+ if (type < InputConnectionCommandType.FIRST_COMMAND
+ || InputConnectionCommandType.LAST_COMMAND < type) {
+ Log.e(TAG, "Invalid InputConnectionCommand type=" + type);
+ return null;
+ }
+
+ @FieldMask final int fieldMask = source.readInt();
+ final int intArg0 = (fieldMask & FieldMask.INT_ARG0) != 0 ? source.readInt() : 0;
+ final int intArg1 = (fieldMask & FieldMask.INT_ARG1) != 0 ? source.readInt() : 0;
+ final int flags = (fieldMask & FieldMask.FLAGS) != 0 ? source.readInt() : 0;
+ final CharSequence charSequence = (fieldMask & FieldMask.CHAR_SEQUENCE) != 0
+ ? TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source) : null;
+ final String string = (fieldMask & FieldMask.STRING) != 0 ? source.readString() : null;
+ final Bundle bundle = (fieldMask & FieldMask.BUNDLE) != 0 ? source.readBundle() : null;
+
+ @ParcelableType final int parcelableType;
+ final Parcelable parcelable;
+ if ((fieldMask & FieldMask.PARCELABLE) != 0) {
+ parcelableType = source.readInt();
+ switch (parcelableType) {
+ case ParcelableType.NULL:
+ Log.e(TAG, "Unexpected ParcelableType=NULL");
+ return null;
+ case ParcelableType.EXTRACTED_TEXT_REQUEST:
+ parcelable = source.readTypedObject(ExtractedTextRequest.CREATOR);
+ break;
+ case ParcelableType.COMPLETION_INFO:
+ parcelable = source.readTypedObject(CompletionInfo.CREATOR);
+ break;
+ case ParcelableType.CORRECTION_INFO:
+ parcelable = source.readTypedObject(CorrectionInfo.CREATOR);
+ break;
+ case ParcelableType.KEY_EVENT:
+ parcelable = source.readTypedObject(KeyEvent.CREATOR);
+ break;
+ case ParcelableType.INPUT_CONTENT_INFO:
+ parcelable = source.readTypedObject(InputContentInfo.CREATOR);
+ break;
+ default:
+ Log.e(TAG, "Unknown ParcelableType=" + parcelableType);
+ return null;
+ }
+ } else {
+ parcelableType = ParcelableType.NULL;
+ parcelable = null;
+ }
+ @ResultCallbackType final int resultCallbackType;
+ final IBinder resultCallback;
+ if ((fieldMask & FieldMask.CALLBACK) != 0) {
+ resultCallbackType = source.readInt();
+ switch (resultCallbackType) {
+ case ResultCallbackType.NULL:
+ Log.e(TAG, "Unexpected ResultCallbackType=NULL");
+ return null;
+ case ResultCallbackType.BOOLEAN:
+ case ResultCallbackType.INT:
+ case ResultCallbackType.CHAR_SEQUENCE:
+ case ResultCallbackType.EXTRACTED_TEXT:
+ case ResultCallbackType.SURROUNDING_TEXT:
+ resultCallback = source.readStrongBinder();
+ break;
+ default:
+ Log.e(TAG, "Unknown ResultCallbackType=" + resultCallbackType);
+ return null;
+ }
+ } else {
+ resultCallbackType = ResultCallbackType.NULL;
+ resultCallback = null;
+ }
+ return new InputConnectionCommand(type, intArg0, intArg1, flags, charSequence, string,
+ bundle, parcelableType, parcelable, resultCallbackType, resultCallback);
+ }
+
+ /**
+ * Used to make this class parcelable.
+ */
+ public static final Parcelable.Creator<InputConnectionCommand> CREATOR =
+ new Parcelable.Creator<InputConnectionCommand>() {
+ @AnyThread
+ @Nullable
+ @Override
+ public InputConnectionCommand createFromParcel(Parcel source) {
+ try {
+ return InputConnectionCommand.createFromParcel(source);
+ } catch (Exception e) {
+ Log.e(TAG, "Returning null due to exception.", e);
+ return null;
+ }
+ }
+
+ @AnyThread
+ @NonNull
+ @Override
+ public InputConnectionCommand[] newArray(int size) {
+ return new InputConnectionCommand[size];
+ }
+ };
+}
diff --git a/core/java/com/android/internal/inputmethod/InputConnectionCommandType.java b/core/java/com/android/internal/inputmethod/InputConnectionCommandType.java
new file mode 100644
index 0000000..1eb0101
--- /dev/null
+++ b/core/java/com/android/internal/inputmethod/InputConnectionCommandType.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.inputmethod;
+
+import static java.lang.annotation.RetentionPolicy.SOURCE;
+
+import android.annotation.IntDef;
+
+import java.lang.annotation.Retention;
+
+@Retention(SOURCE)
+@IntDef(value = {
+ InputConnectionCommandType.BEGIN_BATCH_EDIT,
+ InputConnectionCommandType.CLEAR_META_KEY_STATES,
+ InputConnectionCommandType.COMMIT_COMPLETION,
+ InputConnectionCommandType.COMMIT_CONTENT,
+ InputConnectionCommandType.COMMIT_CORRECTION,
+ InputConnectionCommandType.COMMIT_TEXT,
+ InputConnectionCommandType.DELETE_SURROUNDING_TEXT,
+ InputConnectionCommandType.DELETE_SURROUNDING_TEXT_IN_CODE_POINTS,
+ InputConnectionCommandType.END_BATCH_EDIT,
+ InputConnectionCommandType.FINISH_COMPOSING_TEXT,
+ InputConnectionCommandType.GET_CURSOR_CAPS_MODE,
+ InputConnectionCommandType.GET_EXTRACTED_TEXT,
+ InputConnectionCommandType.GET_SELECTED_TEXT,
+ InputConnectionCommandType.GET_SURROUNDING_TEXT,
+ InputConnectionCommandType.GET_TEXT_AFTER_CURSOR,
+ InputConnectionCommandType.GET_TEXT_BEFORE_CURSOR,
+ InputConnectionCommandType.PERFORM_CONTEXT_MENU_ACTION,
+ InputConnectionCommandType.PERFORM_EDITOR_ACTION,
+ InputConnectionCommandType.PERFORM_SPELL_CHECK,
+ InputConnectionCommandType.REQUEST_CURSOR_UPDATES,
+ InputConnectionCommandType.SEND_KEY_EVENT,
+ InputConnectionCommandType.SET_COMPOSING_REGION,
+ InputConnectionCommandType.SET_COMPOSING_TEXT,
+ InputConnectionCommandType.SET_IME_CONSUMES_INPUT,
+ InputConnectionCommandType.SET_SELECTION,
+})
+public @interface InputConnectionCommandType {
+ int FIRST_COMMAND = 1;
+
+ int BEGIN_BATCH_EDIT = FIRST_COMMAND;
+ int CLEAR_META_KEY_STATES = 2;
+ int COMMIT_COMPLETION = 3;
+ int COMMIT_CONTENT = 4;
+ int COMMIT_CORRECTION = 5;
+ int COMMIT_TEXT = 6;
+ int DELETE_SURROUNDING_TEXT = 7;
+ int DELETE_SURROUNDING_TEXT_IN_CODE_POINTS = 8;
+ int END_BATCH_EDIT = 9;
+ int FINISH_COMPOSING_TEXT = 10;
+ int GET_CURSOR_CAPS_MODE = 11;
+ int GET_EXTRACTED_TEXT = 12;
+ int GET_SELECTED_TEXT = 13;
+ int GET_SURROUNDING_TEXT = 14;
+ int GET_TEXT_AFTER_CURSOR = 15;
+ int GET_TEXT_BEFORE_CURSOR = 16;
+ int PERFORM_CONTEXT_MENU_ACTION = 17;
+ int PERFORM_EDITOR_ACTION = 18;
+ int PERFORM_SPELL_CHECK = 19;
+ int PERFORM_PRIVATE_COMMAND = 20;
+ int REQUEST_CURSOR_UPDATES = 21;
+ int SEND_KEY_EVENT = 22;
+ int SET_COMPOSING_REGION = 23;
+ int SET_COMPOSING_TEXT = 24;
+ int SET_IME_CONSUMES_INPUT = 25;
+ int SET_SELECTION = 26;
+
+ int LAST_COMMAND = SET_SELECTION;
+}
diff --git a/core/java/com/android/internal/inputmethod/InputMethodDebug.java b/core/java/com/android/internal/inputmethod/InputMethodDebug.java
index a00b993..0475ed0 100644
--- a/core/java/com/android/internal/inputmethod/InputMethodDebug.java
+++ b/core/java/com/android/internal/inputmethod/InputMethodDebug.java
@@ -18,6 +18,7 @@
import android.annotation.AnyThread;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams.SoftInputModeFlags;
@@ -242,6 +243,133 @@
}
/**
+ * Converts {@link InputConnectionCommandType} to human readable {@link String}.
+ */
+ public static String inputConnectionCommandTypeToString(@InputConnectionCommandType int type) {
+ switch (type) {
+ case InputConnectionCommandType.BEGIN_BATCH_EDIT:
+ return "beginBatchEdit";
+ case InputConnectionCommandType.CLEAR_META_KEY_STATES:
+ return "clearMetaKeyStates";
+ case InputConnectionCommandType.COMMIT_COMPLETION:
+ return "commitCompletion";
+ case InputConnectionCommandType.COMMIT_CONTENT:
+ return "commitContent";
+ case InputConnectionCommandType.COMMIT_CORRECTION:
+ return "commitCorrection";
+ case InputConnectionCommandType.COMMIT_TEXT:
+ return "commitText";
+ case InputConnectionCommandType.DELETE_SURROUNDING_TEXT:
+ return "deleteSurroundingText";
+ case InputConnectionCommandType.DELETE_SURROUNDING_TEXT_IN_CODE_POINTS:
+ return "deleteSurroundingTextInCodePoints";
+ case InputConnectionCommandType.END_BATCH_EDIT:
+ return "endBatchEdit";
+ case InputConnectionCommandType.FINISH_COMPOSING_TEXT:
+ return "finishComposingText";
+ case InputConnectionCommandType.GET_CURSOR_CAPS_MODE:
+ return "getCursorCapsMode";
+ case InputConnectionCommandType.GET_EXTRACTED_TEXT:
+ return "getExtractedText";
+ case InputConnectionCommandType.GET_SELECTED_TEXT:
+ return "getSelectedText";
+ case InputConnectionCommandType.GET_SURROUNDING_TEXT:
+ return "getSurroundingText";
+ case InputConnectionCommandType.GET_TEXT_AFTER_CURSOR:
+ return "getTextAfterCursor";
+ case InputConnectionCommandType.GET_TEXT_BEFORE_CURSOR:
+ return "getTextBeforeCursor";
+ case InputConnectionCommandType.PERFORM_CONTEXT_MENU_ACTION:
+ return "performContextMenuAction";
+ case InputConnectionCommandType.PERFORM_EDITOR_ACTION:
+ return "performEditorAction";
+ case InputConnectionCommandType.PERFORM_SPELL_CHECK:
+ return "performSpellCheck";
+ case InputConnectionCommandType.REQUEST_CURSOR_UPDATES:
+ return "requestCursorUpdates";
+ case InputConnectionCommandType.SEND_KEY_EVENT:
+ return "sendKeyEvent";
+ case InputConnectionCommandType.SET_COMPOSING_REGION:
+ return "setComposingRegion";
+ case InputConnectionCommandType.SET_COMPOSING_TEXT:
+ return "setComposingText";
+ case InputConnectionCommandType.SET_IME_CONSUMES_INPUT:
+ return "setImeConsumesInput";
+ case InputConnectionCommandType.SET_SELECTION:
+ return "setSelection";
+ default:
+ return "Unknown=" + type;
+ }
+ }
+
+ /**
+ * Converts {@link InputConnectionCommand} to human readable {@link String}.
+ */
+ @NonNull
+ public static String dumpInputConnectionCommand(@Nullable InputConnectionCommand command) {
+ if (command == null) {
+ return "null";
+ }
+ switch (command.mCommandType) {
+ case InputConnectionCommandType.BEGIN_BATCH_EDIT:
+ return "beginBatchEdit()";
+ case InputConnectionCommandType.CLEAR_META_KEY_STATES:
+ return "clearMetaKeyStates(" + command.mIntArg0 + ")";
+ case InputConnectionCommandType.COMMIT_COMPLETION:
+ return "commitCompletion(" + command.mParcelable + ")";
+ case InputConnectionCommandType.COMMIT_CONTENT:
+ return "commitContent(" + command.mParcelable + ", " + command.mFlags + ", "
+ + command.mBundle + ")";
+ case InputConnectionCommandType.COMMIT_CORRECTION:
+ return "commitCorrection(" + command.mParcelable + ")";
+ case InputConnectionCommandType.COMMIT_TEXT:
+ return "commitText(" + command.mCharSequence + ", " + command.mIntArg0 + ")";
+ case InputConnectionCommandType.DELETE_SURROUNDING_TEXT:
+ return "deleteSurroundingText(" + command.mIntArg0 + ", " + command.mIntArg1 + ")";
+ case InputConnectionCommandType.DELETE_SURROUNDING_TEXT_IN_CODE_POINTS:
+ return "deleteSurroundingTextInCodePoints(" + command.mIntArg0 + ", "
+ + command.mIntArg1 + ")";
+ case InputConnectionCommandType.END_BATCH_EDIT:
+ return "endBatchEdit()";
+ case InputConnectionCommandType.FINISH_COMPOSING_TEXT:
+ return "finishComposingText()";
+ case InputConnectionCommandType.GET_CURSOR_CAPS_MODE:
+ return "getCursorCapsMode(" + command.mIntArg0 + ")";
+ case InputConnectionCommandType.GET_EXTRACTED_TEXT:
+ return "getExtractedText(" + command.mParcelable + ", " + command.mFlags + ")";
+ case InputConnectionCommandType.GET_SELECTED_TEXT:
+ return "getSelectedText(" + command.mFlags + ")";
+ case InputConnectionCommandType.GET_SURROUNDING_TEXT:
+ return "getSurroundingText(" + command.mIntArg0 + ", " + command.mIntArg1 + ", "
+ + command.mFlags + ")";
+ case InputConnectionCommandType.GET_TEXT_AFTER_CURSOR:
+ return "getTextAfterCursor(" + command.mIntArg0 + ", " + command.mFlags + ")";
+ case InputConnectionCommandType.GET_TEXT_BEFORE_CURSOR:
+ return "getTextBeforeCursor(" + command.mIntArg0 + ", " + command.mFlags + ")";
+ case InputConnectionCommandType.PERFORM_CONTEXT_MENU_ACTION:
+ return "performContextMenuAction(" + command.mIntArg0 + ")";
+ case InputConnectionCommandType.PERFORM_EDITOR_ACTION:
+ return "performEditorAction(" + command.mIntArg0 + ")";
+ case InputConnectionCommandType.PERFORM_SPELL_CHECK:
+ return "performSpellCheck()";
+ case InputConnectionCommandType.REQUEST_CURSOR_UPDATES:
+ return "requestCursorUpdates(" + command.mIntArg0 + ")";
+ case InputConnectionCommandType.SEND_KEY_EVENT:
+ return "sendKeyEvent(" + command.mParcelable + ")";
+ case InputConnectionCommandType.SET_COMPOSING_REGION:
+ return "setComposingRegion(" + command.mIntArg0 + ", " + command.mIntArg1 + ")";
+ case InputConnectionCommandType.SET_COMPOSING_TEXT:
+ return "setComposingText(" + command.mCharSequence + ", " + command.mIntArg0 + ")";
+ case InputConnectionCommandType.SET_IME_CONSUMES_INPUT:
+ return "setImeConsumesInput(" + (command.mIntArg0 != 0) + ")";
+ case InputConnectionCommandType.SET_SELECTION:
+ return "setSelection(" + command.mIntArg0 + ", " + command.mIntArg1 + ")";
+ default:
+ return "unknown(type=" + command.mCommandType + ")";
+ }
+ }
+
+ /**
* Return a fixed size string of the object.
* TODO(b/151575861): Take & return with StringBuilder to make more memory efficient.
*/
diff --git a/core/java/com/android/internal/inputmethod/InputMethodPrivilegedOperations.java b/core/java/com/android/internal/inputmethod/InputMethodPrivilegedOperations.java
index ed1fe1a..9fb0bb5 100644
--- a/core/java/com/android/internal/inputmethod/InputMethodPrivilegedOperations.java
+++ b/core/java/com/android/internal/inputmethod/InputMethodPrivilegedOperations.java
@@ -142,7 +142,7 @@
/**
* Calls {@link IInputMethodPrivilegedOperations#createInputContentUriToken(Uri, String,
- * IIInputContentUriTokenResultCallback)}.
+ * IInputContentUriTokenResultCallback)}.
*
* @param contentUri Content URI to which a temporary read permission should be granted
* @param packageName Indicates what package needs to have a temporary read permission
diff --git a/core/java/com/android/internal/inputmethod/ResultCallbacks.java b/core/java/com/android/internal/inputmethod/ResultCallbacks.java
index 6838cbd..343a6e6 100644
--- a/core/java/com/android/internal/inputmethod/ResultCallbacks.java
+++ b/core/java/com/android/internal/inputmethod/ResultCallbacks.java
@@ -223,20 +223,20 @@
}
/**
- * Creates {@link IIInputContentUriTokenResultCallback.Stub} that is to set
+ * Creates {@link IInputContentUriTokenResultCallback.Stub} that is to set
* {@link Completable.IInputContentUriToken} when receiving the result.
*
* @param value {@link Completable.IInputContentUriToken} to be set when receiving the result.
- * @return {@link IIInputContentUriTokenResultCallback.Stub} that can be passed as a binder IPC
+ * @return {@link IInputContentUriTokenResultCallback.Stub} that can be passed as a binder IPC
* parameter.
*/
@AnyThread
- public static IIInputContentUriTokenResultCallback.Stub of(
+ public static IInputContentUriTokenResultCallback.Stub of(
@NonNull Completable.IInputContentUriToken value) {
final AtomicReference<Completable.IInputContentUriToken>
atomicRef = new AtomicReference<>(value);
- return new IIInputContentUriTokenResultCallback.Stub() {
+ return new IInputContentUriTokenResultCallback.Stub() {
@BinderThread
@Override
public void onResult(IInputContentUriToken result) {
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index 434f617..4043060 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -196,7 +196,7 @@
public static final int RESET_REASON_FULL_CHARGE = 3;
public static final int RESET_REASON_MEASURED_ENERGY_BUCKETS_CHANGE = 4;
- protected Clocks mClocks;
+ protected Clock mClock;
private final AtomicFile mStatsFile;
public final AtomicFile mCheckinFile;
@@ -215,19 +215,15 @@
private final KernelWakelockStats mTmpWakelockStats = new KernelWakelockStats();
@VisibleForTesting
- protected KernelCpuUidUserSysTimeReader mCpuUidUserSysTimeReader =
- new KernelCpuUidUserSysTimeReader(true);
+ protected KernelCpuUidUserSysTimeReader mCpuUidUserSysTimeReader;
@VisibleForTesting
protected KernelCpuSpeedReader[] mKernelCpuSpeedReaders;
@VisibleForTesting
- protected KernelCpuUidFreqTimeReader mCpuUidFreqTimeReader =
- new KernelCpuUidFreqTimeReader(true);
+ protected KernelCpuUidFreqTimeReader mCpuUidFreqTimeReader;
@VisibleForTesting
- protected KernelCpuUidActiveTimeReader mCpuUidActiveTimeReader =
- new KernelCpuUidActiveTimeReader(true);
+ protected KernelCpuUidActiveTimeReader mCpuUidActiveTimeReader;
@VisibleForTesting
- protected KernelCpuUidClusterTimeReader mCpuUidClusterTimeReader =
- new KernelCpuUidClusterTimeReader(true);
+ protected KernelCpuUidClusterTimeReader mCpuUidClusterTimeReader;
@VisibleForTesting
protected KernelSingleUidTimeReader mKernelSingleUidTimeReader;
@VisibleForTesting
@@ -387,8 +383,8 @@
}
boolean changed = setChargingLocked(true);
if (changed) {
- final long uptimeMs = mClocks.uptimeMillis();
- final long elapsedRealtimeMs = mClocks.elapsedRealtime();
+ final long uptimeMs = mClock.uptimeMillis();
+ final long elapsedRealtimeMs = mClock.elapsedRealtime();
addHistoryRecordLocked(elapsedRealtimeMs, uptimeMs);
}
}
@@ -512,7 +508,7 @@
*/
@GuardedBy("this")
public void clearPendingRemovedUidsLocked() {
- long cutOffTimeMs = mClocks.elapsedRealtime() - mConstants.UID_REMOVE_DELAY_MS;
+ long cutOffTimeMs = mClock.elapsedRealtime() - mConstants.UID_REMOVE_DELAY_MS;
while (!mPendingRemovedUids.isEmpty()
&& mPendingRemovedUids.peek().getUidRemovalTimestamp() < cutOffTimeMs) {
mPendingRemovedUids.poll().removeLocked();
@@ -613,35 +609,6 @@
return true;
}
- public interface Clocks {
- /** Elapsed Realtime, see SystemClock.elapsedRealtime() */
- long elapsedRealtime();
-
- /** Uptime, see SystemClock.uptimeMillis() */
- long uptimeMillis();
-
- /** Wall-clock time as per System.currentTimeMillis() */
- long currentTimeMillis();
- }
-
- public static class SystemClocks implements Clocks {
-
- @Override
- public long elapsedRealtime() {
- return SystemClock.elapsedRealtime();
- }
-
- @Override
- public long uptimeMillis() {
- return SystemClock.uptimeMillis();
- }
-
- @Override
- public long currentTimeMillis() {
- return System.currentTimeMillis();
- }
- }
-
public interface ExternalStatsSync {
int UPDATE_CPU = 0x01;
int UPDATE_WIFI = 0x02;
@@ -1180,12 +1147,12 @@
}
public BatteryStatsImpl() {
- this(new SystemClocks());
+ this(Clock.SYSTEM_CLOCK);
}
- public BatteryStatsImpl(Clocks clocks) {
- init(clocks);
- mStartClockTimeMs = clocks.currentTimeMillis();
+ public BatteryStatsImpl(Clock clock) {
+ init(clock);
+ mStartClockTimeMs = clock.currentTimeMillis();
mStatsFile = null;
mCheckinFile = null;
mDailyFile = null;
@@ -1198,8 +1165,12 @@
clearHistoryLocked();
}
- private void init(Clocks clocks) {
- mClocks = clocks;
+ private void init(Clock clock) {
+ mClock = clock;
+ mCpuUidUserSysTimeReader = new KernelCpuUidUserSysTimeReader(true, clock);
+ mCpuUidFreqTimeReader = new KernelCpuUidFreqTimeReader(true, clock);
+ mCpuUidActiveTimeReader = new KernelCpuUidActiveTimeReader(true, clock);
+ mCpuUidClusterTimeReader = new KernelCpuUidClusterTimeReader(true, clock);
}
/**
@@ -1755,7 +1726,7 @@
* State for keeping track of timing information.
*/
public static abstract class Timer extends BatteryStats.Timer implements TimeBaseObs {
- protected final Clocks mClocks;
+ protected final Clock mClock;
protected final int mType;
protected final TimeBase mTimeBase;
@@ -1783,8 +1754,8 @@
* @param timeBase
* @param in
*/
- public Timer(Clocks clocks, int type, TimeBase timeBase, Parcel in) {
- mClocks = clocks;
+ public Timer(Clock clock, int type, TimeBase timeBase, Parcel in) {
+ mClock = clock;
mType = type;
mTimeBase = timeBase;
@@ -1795,8 +1766,8 @@
if (DEBUG) Log.i(TAG, "**** READ TIMER #" + mType + ": mTotalTime=" + mTotalTimeUs);
}
- public Timer(Clocks clocks, int type, TimeBase timeBase) {
- mClocks = clocks;
+ public Timer(Clock clock, int type, TimeBase timeBase) {
+ mClock = clock;
mType = type;
mTimeBase = timeBase;
timeBase.add(this);
@@ -1825,7 +1796,7 @@
*/
@Override
public boolean reset(boolean detachIfReset) {
- return reset(detachIfReset, mClocks.elapsedRealtime() * 1000);
+ return reset(detachIfReset, mClock.elapsedRealtime() * 1000);
}
@Override
@@ -1971,8 +1942,8 @@
int mUpdateVersion;
@VisibleForTesting
- public SamplingTimer(Clocks clocks, TimeBase timeBase, Parcel in) {
- super(clocks, 0, timeBase, in);
+ public SamplingTimer(Clock clock, TimeBase timeBase, Parcel in) {
+ super(clock, 0, timeBase, in);
mCurrentReportedCount = in.readInt();
mUnpluggedReportedCount = in.readInt();
mCurrentReportedTotalTimeUs = in.readLong();
@@ -1982,8 +1953,8 @@
}
@VisibleForTesting
- public SamplingTimer(Clocks clocks, TimeBase timeBase) {
- super(clocks, 0, timeBase);
+ public SamplingTimer(Clock clock, TimeBase timeBase) {
+ super(clock, 0, timeBase);
mTrackingReportedValues = false;
mTimeBaseRunning = timeBase.isRunning();
}
@@ -1993,7 +1964,7 @@
* be less than the values used for a previous invocation.
*/
public void endSample() {
- endSample(mClocks.elapsedRealtime() * 1000);
+ endSample(mClock.elapsedRealtime() * 1000);
}
/**
@@ -2028,7 +1999,7 @@
* @param count total number of times the event being sampled occurred.
*/
public void updated(long totalTimeUs, int count) {
- update(totalTimeUs, count, mClocks.elapsedRealtime() * 1000);
+ update(totalTimeUs, count, mClock.elapsedRealtime() * 1000);
}
/**
@@ -2058,7 +2029,7 @@
* @param deltaCount additional number of times the event being sampled occurred.
*/
public void add(long deltaTimeUs, int deltaCount) {
- add(deltaTimeUs, deltaCount, mClocks.elapsedRealtime() * 1000);
+ add(deltaTimeUs, deltaCount, mClock.elapsedRealtime() * 1000);
}
/**
@@ -2148,16 +2119,16 @@
*/
boolean mInDischarge;
- BatchTimer(Clocks clocks, Uid uid, int type, TimeBase timeBase, Parcel in) {
- super(clocks, type, timeBase, in);
+ BatchTimer(Clock clock, Uid uid, int type, TimeBase timeBase, Parcel in) {
+ super(clock, type, timeBase, in);
mUid = uid;
mLastAddedTimeUs = in.readLong();
mLastAddedDurationUs = in.readLong();
mInDischarge = timeBase.isRunning();
}
- BatchTimer(Clocks clocks, Uid uid, int type, TimeBase timeBase) {
- super(clocks, type, timeBase);
+ BatchTimer(Clock clock, Uid uid, int type, TimeBase timeBase) {
+ super(clock, type, timeBase);
mUid = uid;
mInDischarge = timeBase.isRunning();
}
@@ -2220,7 +2191,7 @@
}
public void addDuration(BatteryStatsImpl stats, long durationMs) {
- addDuration(stats, durationMs, mClocks.elapsedRealtime());
+ addDuration(stats, durationMs, mClock.elapsedRealtime());
}
public void addDuration(BatteryStatsImpl stats, long durationMs, long elapsedRealtimeMs) {
@@ -2235,7 +2206,7 @@
}
public void abortLastDuration(BatteryStatsImpl stats) {
- abortLastDuration(stats, mClocks.elapsedRealtime());
+ abortLastDuration(stats, mClock.elapsedRealtime());
}
public void abortLastDuration(BatteryStatsImpl stats, long elapsedRealtimeMs) {
@@ -2303,17 +2274,17 @@
*/
long mTotalDurationMs;
- public DurationTimer(Clocks clocks, Uid uid, int type, ArrayList<StopwatchTimer> timerPool,
+ public DurationTimer(Clock clock, Uid uid, int type, ArrayList<StopwatchTimer> timerPool,
TimeBase timeBase, Parcel in) {
- super(clocks, uid, type, timerPool, timeBase, in);
+ super(clock, uid, type, timerPool, timeBase, in);
mMaxDurationMs = in.readLong();
mTotalDurationMs = in.readLong();
mCurrentDurationMs = in.readLong();
}
- public DurationTimer(Clocks clocks, Uid uid, int type, ArrayList<StopwatchTimer> timerPool,
+ public DurationTimer(Clock clock, Uid uid, int type, ArrayList<StopwatchTimer> timerPool,
TimeBase timeBase) {
- super(clocks, uid, type, timerPool, timeBase);
+ super(clock, uid, type, timerPool, timeBase);
}
@Override
@@ -2514,17 +2485,17 @@
@VisibleForTesting
public boolean mInList;
- public StopwatchTimer(Clocks clocks, Uid uid, int type, ArrayList<StopwatchTimer> timerPool,
+ public StopwatchTimer(Clock clock, Uid uid, int type, ArrayList<StopwatchTimer> timerPool,
TimeBase timeBase, Parcel in) {
- super(clocks, type, timeBase, in);
+ super(clock, type, timeBase, in);
mUid = uid;
mTimerPool = timerPool;
mUpdateTimeUs = in.readLong();
}
- public StopwatchTimer(Clocks clocks, Uid uid, int type, ArrayList<StopwatchTimer> timerPool,
+ public StopwatchTimer(Clock clock, Uid uid, int type, ArrayList<StopwatchTimer> timerPool,
TimeBase timeBase) {
- super(clocks, type, timeBase);
+ super(clock, type, timeBase);
mUid = uid;
mTimerPool = timerPool;
}
@@ -2732,10 +2703,10 @@
* The mSubTimer is based on the given subTimeBase. The mSubTimer is not pooled, even if
* the main timer is.
*/
- public DualTimer(Clocks clocks, Uid uid, int type, ArrayList<StopwatchTimer> timerPool,
+ public DualTimer(Clock clock, Uid uid, int type, ArrayList<StopwatchTimer> timerPool,
TimeBase timeBase, TimeBase subTimeBase, Parcel in) {
- super(clocks, uid, type, timerPool, timeBase, in);
- mSubTimer = new DurationTimer(clocks, uid, type, null, subTimeBase, in);
+ super(clock, uid, type, timerPool, timeBase, in);
+ mSubTimer = new DurationTimer(clock, uid, type, null, subTimeBase, in);
}
/**
@@ -2744,10 +2715,10 @@
* The mSubTimer is based on the given subTimeBase. The mSubTimer is not pooled, even if
* the main timer is.
*/
- public DualTimer(Clocks clocks, Uid uid, int type, ArrayList<StopwatchTimer> timerPool,
+ public DualTimer(Clock clock, Uid uid, int type, ArrayList<StopwatchTimer> timerPool,
TimeBase timeBase, TimeBase subTimeBase) {
- super(clocks, uid, type, timerPool, timeBase);
- mSubTimer = new DurationTimer(clocks, uid, type, null, subTimeBase);
+ super(clock, uid, type, timerPool, timeBase);
+ mSubTimer = new DurationTimer(clock, uid, type, null, subTimeBase);
}
/** Get the secondary timer. */
@@ -3168,7 +3139,7 @@
public SamplingTimer getRpmTimerLocked(String name) {
SamplingTimer rpmt = mRpmStats.get(name);
if (rpmt == null) {
- rpmt = new SamplingTimer(mClocks, mOnBatteryTimeBase);
+ rpmt = new SamplingTimer(mClock, mOnBatteryTimeBase);
mRpmStats.put(name, rpmt);
}
return rpmt;
@@ -3178,7 +3149,7 @@
public SamplingTimer getScreenOffRpmTimerLocked(String name) {
SamplingTimer rpmt = mScreenOffRpmStats.get(name);
if (rpmt == null) {
- rpmt = new SamplingTimer(mClocks, mOnBatteryScreenOffTimeBase);
+ rpmt = new SamplingTimer(mClock, mOnBatteryScreenOffTimeBase);
mScreenOffRpmStats.put(name, rpmt);
}
return rpmt;
@@ -3191,7 +3162,7 @@
public SamplingTimer getWakeupReasonTimerLocked(String name) {
SamplingTimer timer = mWakeupReasonStats.get(name);
if (timer == null) {
- timer = new SamplingTimer(mClocks, mOnBatteryTimeBase);
+ timer = new SamplingTimer(mClock, mOnBatteryTimeBase);
mWakeupReasonStats.put(name, timer);
}
return timer;
@@ -3204,7 +3175,7 @@
public SamplingTimer getKernelWakelockTimerLocked(String name) {
SamplingTimer kwlt = mKernelWakelockStats.get(name);
if (kwlt == null) {
- kwlt = new SamplingTimer(mClocks, mOnBatteryScreenOffTimeBase);
+ kwlt = new SamplingTimer(mClock, mOnBatteryScreenOffTimeBase);
mKernelWakelockStats.put(name, kwlt);
}
return kwlt;
@@ -3213,7 +3184,7 @@
public SamplingTimer getKernelMemoryTimerLocked(long bucket) {
SamplingTimer kmt = mKernelMemoryStats.get(bucket);
if (kmt == null) {
- kmt = new SamplingTimer(mClocks, mOnBatteryTimeBase);
+ kmt = new SamplingTimer(mClock, mOnBatteryTimeBase);
mKernelMemoryStats.put(bucket, kmt);
}
return kmt;
@@ -3618,8 +3589,8 @@
}
public void createFakeHistoryEvents(long numEvents) {
- final long elapsedRealtimeMs = mClocks.elapsedRealtime();
- final long uptimeMs = mClocks.uptimeMillis();
+ final long elapsedRealtimeMs = mClock.elapsedRealtime();
+ final long uptimeMs = mClock.uptimeMillis();
for(long i = 0; i < numEvents; i++) {
noteLongPartialWakelockStart("name1", "historyName1", 1000,
elapsedRealtimeMs, uptimeMs);
@@ -3716,7 +3687,7 @@
if (dataSize == 0) {
// The history is currently empty; we need it to start with a time stamp.
- cur.currentTime = mClocks.currentTimeMillis();
+ cur.currentTime = mClock.currentTimeMillis();
addHistoryBufferLocked(elapsedRealtimeMs, HistoryItem.CMD_RESET, cur);
}
addHistoryBufferLocked(elapsedRealtimeMs, HistoryItem.CMD_UPDATE, cur);
@@ -3878,7 +3849,7 @@
public void addIsolatedUidLocked(int isolatedUid, int appUid) {
addIsolatedUidLocked(isolatedUid, appUid,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void addIsolatedUidLocked(int isolatedUid, int appUid,
@@ -3923,7 +3894,7 @@
}
public void noteEventLocked(int code, String name, int uid) {
- noteEventLocked(code, name, uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteEventLocked(code, name, uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteEventLocked(int code, String name, int uid,
@@ -3936,9 +3907,9 @@
}
public void noteCurrentTimeChangedLocked() {
- final long currentTime = mClocks.currentTimeMillis();
- final long elapsedRealtime = mClocks.elapsedRealtime();
- final long uptime = mClocks.uptimeMillis();
+ final long currentTime = mClock.currentTimeMillis();
+ final long elapsedRealtime = mClock.elapsedRealtime();
+ final long uptime = mClock.uptimeMillis();
noteCurrentTimeChangedLocked(currentTime, elapsedRealtime, uptime);
}
@@ -3948,7 +3919,7 @@
}
public void noteProcessStartLocked(String name, int uid) {
- noteProcessStartLocked(name, uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteProcessStartLocked(name, uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteProcessStartLocked(String name, int uid,
@@ -3968,7 +3939,7 @@
}
public void noteProcessCrashLocked(String name, int uid) {
- noteProcessCrashLocked(name, uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteProcessCrashLocked(name, uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteProcessCrashLocked(String name, int uid,
@@ -3981,7 +3952,7 @@
}
public void noteProcessAnrLocked(String name, int uid) {
- noteProcessAnrLocked(name, uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteProcessAnrLocked(name, uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteProcessAnrLocked(String name, int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -3993,7 +3964,7 @@
}
public void noteUidProcessStateLocked(int uid, int state) {
- noteUidProcessStateLocked(uid, state, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteUidProcessStateLocked(uid, state, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteUidProcessStateLocked(int uid, int state,
@@ -4014,7 +3985,7 @@
}
public void noteProcessFinishLocked(String name, int uid) {
- noteProcessFinishLocked(name, uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteProcessFinishLocked(name, uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteProcessFinishLocked(String name, int uid,
@@ -4031,7 +4002,7 @@
}
public void noteSyncStartLocked(String name, int uid) {
- noteSyncStartLocked(name, uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteSyncStartLocked(name, uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteSyncStartLocked(String name, int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -4045,7 +4016,7 @@
}
public void noteSyncFinishLocked(String name, int uid) {
- noteSyncFinishLocked(name, uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteSyncFinishLocked(name, uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteSyncFinishLocked(String name, int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -4060,7 +4031,7 @@
}
public void noteJobStartLocked(String name, int uid) {
- noteJobStartLocked(name, uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteJobStartLocked(name, uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteJobStartLocked(String name, int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -4075,7 +4046,7 @@
public void noteJobFinishLocked(String name, int uid, int stopReason) {
noteJobFinishLocked(name, uid, stopReason,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteJobFinishLocked(String name, int uid, int stopReason,
@@ -4091,7 +4062,7 @@
public void noteJobsDeferredLocked(int uid, int numDeferred, long sinceLast) {
noteJobsDeferredLocked(uid, numDeferred, sinceLast,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteJobsDeferredLocked(int uid, int numDeferred, long sinceLast,
@@ -4103,7 +4074,7 @@
public void noteAlarmStartLocked(String name, WorkSource workSource, int uid) {
noteAlarmStartLocked(name, workSource, uid,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteAlarmStartLocked(String name, WorkSource workSource, int uid,
@@ -4114,7 +4085,7 @@
public void noteAlarmFinishLocked(String name, WorkSource workSource, int uid) {
noteAlarmFinishLocked(name, workSource, uid,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteAlarmFinishLocked(String name, WorkSource workSource, int uid,
@@ -4126,7 +4097,7 @@
private void noteAlarmStartOrFinishLocked(int historyItem, String name, WorkSource workSource,
int uid) {
noteAlarmStartOrFinishLocked(historyItem, name, workSource, uid,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
private void noteAlarmStartOrFinishLocked(int historyItem, String name, WorkSource workSource,
@@ -4164,7 +4135,7 @@
public void noteWakupAlarmLocked(String packageName, int uid, WorkSource workSource,
String tag) {
noteWakupAlarmLocked(packageName, uid, workSource, tag,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWakupAlarmLocked(String packageName, int uid, WorkSource workSource,
@@ -4223,8 +4194,8 @@
HashMap<String, SparseIntArray> active = mActiveEvents.getStateForEvent(
HistoryItem.EVENT_PROC);
if (active != null) {
- long mSecRealtime = mClocks.elapsedRealtime();
- final long mSecUptime = mClocks.uptimeMillis();
+ long mSecRealtime = mClock.elapsedRealtime();
+ final long mSecUptime = mClock.uptimeMillis();
for (HashMap.Entry<String, SparseIntArray> ent : active.entrySet()) {
SparseIntArray uids = ent.getValue();
for (int j=0; j<uids.size(); j++) {
@@ -4238,8 +4209,8 @@
HashMap<String, SparseIntArray> active = mActiveEvents.getStateForEvent(
HistoryItem.EVENT_PROC);
if (active != null) {
- long mSecRealtime = mClocks.elapsedRealtime();
- final long mSecUptime = mClocks.uptimeMillis();
+ long mSecRealtime = mClock.elapsedRealtime();
+ final long mSecUptime = mClock.uptimeMillis();
for (HashMap.Entry<String, SparseIntArray> ent : active.entrySet()) {
SparseIntArray uids = ent.getValue();
for (int j=0; j<uids.size(); j++) {
@@ -4259,7 +4230,7 @@
if (mPretendScreenOff != pretendScreenOff) {
mPretendScreenOff = pretendScreenOff;
noteScreenStateLocked(pretendScreenOff ? Display.STATE_OFF : Display.STATE_ON,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis(), mClocks.currentTimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis(), mClock.currentTimeMillis());
}
}
@@ -4269,7 +4240,7 @@
public void noteStartWakeLocked(int uid, int pid, WorkChain wc, String name, String historyName,
int type, boolean unimportantForLogging) {
noteStartWakeLocked(uid, pid, wc, name, historyName, type, unimportantForLogging,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteStartWakeLocked(int uid, int pid, WorkChain wc, String name, String historyName,
@@ -4340,7 +4311,7 @@
public void noteStopWakeLocked(int uid, int pid, WorkChain wc, String name, String historyName,
int type) {
noteStopWakeLocked(uid, pid, wc, name, historyName, type,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteStopWakeLocked(int uid, int pid, WorkChain wc, String name, String historyName,
@@ -4423,7 +4394,7 @@
public void noteStartWakeFromSourceLocked(WorkSource ws, int pid, String name,
String historyName, int type, boolean unimportantForLogging) {
noteStartWakeFromSourceLocked(ws, pid, name, historyName, type, unimportantForLogging,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteStartWakeFromSourceLocked(WorkSource ws, int pid, String name,
@@ -4450,7 +4421,7 @@
String newHistoryName, int newType, boolean newUnimportantForLogging) {
noteChangeWakelockFromSourceLocked(ws, pid, name, historyName, type, newWs, newPid,
newName, newHistoryName, newType, newUnimportantForLogging,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteChangeWakelockFromSourceLocked(WorkSource ws, int pid, String name,
@@ -4502,7 +4473,7 @@
public void noteStopWakeFromSourceLocked(WorkSource ws, int pid, String name,
String historyName, int type) {
noteStopWakeFromSourceLocked(ws, pid, name, historyName, type,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteStopWakeFromSourceLocked(WorkSource ws, int pid, String name,
@@ -4525,7 +4496,7 @@
public void noteLongPartialWakelockStart(String name, String historyName, int uid) {
noteLongPartialWakelockStart(name, historyName, uid,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteLongPartialWakelockStart(String name, String historyName, int uid,
@@ -4537,7 +4508,7 @@
public void noteLongPartialWakelockStartFromSource(String name, String historyName,
WorkSource workSource) {
noteLongPartialWakelockStartFromSource(name, historyName, workSource,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteLongPartialWakelockStartFromSource(String name, String historyName,
@@ -4575,7 +4546,7 @@
public void noteLongPartialWakelockFinish(String name, String historyName, int uid) {
noteLongPartialWakelockFinish(name, historyName, uid,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteLongPartialWakelockFinish(String name, String historyName, int uid,
@@ -4587,7 +4558,7 @@
public void noteLongPartialWakelockFinishFromSource(String name, String historyName,
WorkSource workSource) {
noteLongPartialWakelockFinishFromSource(name, historyName, workSource,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteLongPartialWakelockFinishFromSource(String name, String historyName,
@@ -4635,7 +4606,7 @@
}
public void noteWakeupReasonLocked(String reason) {
- noteWakeupReasonLocked(reason, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteWakeupReasonLocked(reason, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWakeupReasonLocked(String reason, long elapsedRealtimeMs, long uptimeMs) {
@@ -4705,7 +4676,7 @@
int mSensorNesting;
public void noteStartSensorLocked(int uid, int sensor) {
- noteStartSensorLocked(uid, sensor, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteStartSensorLocked(uid, sensor, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteStartSensorLocked(int uid, int sensor, long elapsedRealtimeMs, long uptimeMs) {
@@ -4722,7 +4693,7 @@
}
public void noteStopSensorLocked(int uid, int sensor) {
- noteStopSensorLocked(uid, sensor, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteStopSensorLocked(uid, sensor, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteStopSensorLocked(int uid, int sensor, long elapsedRealtimeMs, long uptimeMs) {
@@ -4741,7 +4712,7 @@
int mGpsNesting;
public void noteGpsChangedLocked(WorkSource oldWs, WorkSource newWs) {
- noteGpsChangedLocked(oldWs, newWs, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteGpsChangedLocked(oldWs, newWs, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteGpsChangedLocked(WorkSource oldWs, WorkSource newWs,
@@ -4820,7 +4791,7 @@
}
public void noteGpsSignalQualityLocked(int signalLevel) {
- noteGpsSignalQualityLocked(signalLevel, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteGpsSignalQualityLocked(signalLevel, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteGpsSignalQualityLocked(int signalLevel, long elapsedRealtimeMs, long uptimeMs) {
@@ -4848,8 +4819,8 @@
@GuardedBy("this")
public void noteScreenStateLocked(int state) {
- noteScreenStateLocked(state, mClocks.elapsedRealtime(), mClocks.uptimeMillis(),
- mClocks.currentTimeMillis());
+ noteScreenStateLocked(state, mClock.elapsedRealtime(), mClock.uptimeMillis(),
+ mClock.currentTimeMillis());
}
@GuardedBy("this")
@@ -4949,7 +4920,7 @@
@UnsupportedAppUsage
public void noteScreenBrightnessLocked(int brightness) {
- noteScreenBrightnessLocked(brightness, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteScreenBrightnessLocked(brightness, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteScreenBrightnessLocked(int brightness, long elapsedRealtimeMs, long uptimeMs) {
@@ -4977,7 +4948,7 @@
@UnsupportedAppUsage
public void noteUserActivityLocked(int uid, int event) {
- noteUserActivityLocked(uid, event, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteUserActivityLocked(uid, event, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteUserActivityLocked(int uid, int event, long elapsedRealtimeMs, long uptimeMs) {
@@ -4988,7 +4959,7 @@
}
public void noteWakeUpLocked(String reason, int reasonUid) {
- noteWakeUpLocked(reason, reasonUid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteWakeUpLocked(reason, reasonUid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWakeUpLocked(String reason, int reasonUid,
@@ -4998,7 +4969,7 @@
}
public void noteInteractiveLocked(boolean interactive) {
- noteInteractiveLocked(interactive, mClocks.elapsedRealtime());
+ noteInteractiveLocked(interactive, mClock.elapsedRealtime());
}
public void noteInteractiveLocked(boolean interactive, long elapsedRealtimeMs) {
@@ -5015,7 +4986,7 @@
public void noteConnectivityChangedLocked(int type, String extra) {
noteConnectivityChangedLocked(type, extra,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteConnectivityChangedLocked(int type, String extra,
@@ -5038,7 +5009,7 @@
*/
public boolean noteMobileRadioPowerStateLocked(int powerState, long timestampNs, int uid) {
return noteMobileRadioPowerStateLocked(powerState, timestampNs, uid,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public boolean noteMobileRadioPowerStateLocked(int powerState, long timestampNs, int uid,
@@ -5086,7 +5057,7 @@
}
public void notePowerSaveModeLocked(boolean enabled) {
- notePowerSaveModeLocked(enabled, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ notePowerSaveModeLocked(enabled, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
/**
@@ -5133,7 +5104,7 @@
public void noteDeviceIdleModeLocked(final int mode, String activeReason, int activeUid) {
noteDeviceIdleModeLocked(mode, activeReason, activeUid,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteDeviceIdleModeLocked(final int mode, String activeReason, int activeUid,
@@ -5211,7 +5182,7 @@
public void notePackageInstalledLocked(String pkgName, long versionCode) {
notePackageInstalledLocked(pkgName, versionCode,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void notePackageInstalledLocked(String pkgName, long versionCode,
@@ -5227,7 +5198,7 @@
}
public void notePackageUninstalledLocked(String pkgName) {
- notePackageUninstalledLocked(pkgName, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ notePackageUninstalledLocked(pkgName, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void notePackageUninstalledLocked(String pkgName,
@@ -5248,7 +5219,7 @@
}
void stopAllGpsSignalQualityTimersLocked(int except) {
- stopAllGpsSignalQualityTimersLocked(except, mClocks.elapsedRealtime());
+ stopAllGpsSignalQualityTimersLocked(except, mClock.elapsedRealtime());
}
void stopAllGpsSignalQualityTimersLocked(int except, long elapsedRealtimeMs) {
@@ -5264,7 +5235,7 @@
@UnsupportedAppUsage
public void notePhoneOnLocked() {
- notePhoneOnLocked(mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ notePhoneOnLocked(mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void notePhoneOnLocked(long elapsedRealtimeMs, long uptimeMs) {
@@ -5280,7 +5251,7 @@
@UnsupportedAppUsage
public void notePhoneOffLocked() {
- notePhoneOffLocked(mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ notePhoneOffLocked(mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void notePhoneOffLocked(long elapsedRealtimeMs, long uptimeMs) {
@@ -5302,8 +5273,8 @@
public void onReceive(Context context, Intent intent) {
final boolean state = intent.getBooleanExtra(UsbManager.USB_CONNECTED, false);
synchronized (BatteryStatsImpl.this) {
- noteUsbConnectionStateLocked(state, mClocks.elapsedRealtime(),
- mClocks.uptimeMillis());
+ noteUsbConnectionStateLocked(state, mClock.elapsedRealtime(),
+ mClock.uptimeMillis());
}
}
}, usbStateFilter);
@@ -5312,8 +5283,8 @@
final Intent usbState = context.registerReceiver(null, usbStateFilter);
final boolean initState = usbState != null && usbState.getBooleanExtra(
UsbManager.USB_CONNECTED, false);
- noteUsbConnectionStateLocked(initState, mClocks.elapsedRealtime(),
- mClocks.uptimeMillis());
+ noteUsbConnectionStateLocked(initState, mClock.elapsedRealtime(),
+ mClock.uptimeMillis());
}
}
}
@@ -5453,7 +5424,7 @@
* @param state phone state from ServiceState.getState()
*/
public void notePhoneStateLocked(int state, int simState) {
- notePhoneStateLocked(state, simState, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ notePhoneStateLocked(state, simState, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void notePhoneStateLocked(int state, int simState,
@@ -5465,7 +5436,7 @@
@UnsupportedAppUsage
public void notePhoneSignalStrengthLocked(SignalStrength signalStrength) {
notePhoneSignalStrengthLocked(signalStrength,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void notePhoneSignalStrengthLocked(SignalStrength signalStrength,
@@ -5479,7 +5450,7 @@
@UnsupportedAppUsage
public void notePhoneDataConnectionStateLocked(int dataType, boolean hasData, int serviceType) {
notePhoneDataConnectionStateLocked(dataType, hasData, serviceType,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void notePhoneDataConnectionStateLocked(int dataType, boolean hasData, int serviceType,
@@ -5522,7 +5493,7 @@
}
public void noteWifiOnLocked() {
- noteWifiOnLocked(mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteWifiOnLocked(mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiOnLocked(long elapsedRealtimeMs, long uptimeMs) {
@@ -5538,7 +5509,7 @@
}
public void noteWifiOffLocked() {
- noteWifiOffLocked(mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteWifiOffLocked(mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiOffLocked(long elapsedRealtimeMs, long uptimeMs) {
@@ -5555,7 +5526,7 @@
@UnsupportedAppUsage
public void noteAudioOnLocked(int uid) {
- noteAudioOnLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteAudioOnLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteAudioOnLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -5574,7 +5545,7 @@
@UnsupportedAppUsage
public void noteAudioOffLocked(int uid) {
- noteAudioOffLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteAudioOffLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteAudioOffLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -5595,7 +5566,7 @@
@UnsupportedAppUsage
public void noteVideoOnLocked(int uid) {
- noteVideoOnLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteVideoOnLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteVideoOnLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -5614,7 +5585,7 @@
@UnsupportedAppUsage
public void noteVideoOffLocked(int uid) {
- noteVideoOffLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteVideoOffLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteVideoOffLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -5634,7 +5605,7 @@
}
public void noteResetAudioLocked() {
- noteResetAudioLocked(mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteResetAudioLocked(mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteResetAudioLocked(long elapsedRealtimeMs, long uptimeMs) {
@@ -5653,7 +5624,7 @@
}
public void noteResetVideoLocked() {
- noteResetVideoLocked(mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteResetVideoLocked(mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteResetVideoLocked(long elapsedRealtimeMs, long uptimeMs) {
@@ -5672,7 +5643,7 @@
}
public void noteActivityResumedLocked(int uid) {
- noteActivityResumedLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteActivityResumedLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteActivityResumedLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -5682,7 +5653,7 @@
}
public void noteActivityPausedLocked(int uid) {
- noteActivityPausedLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteActivityPausedLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteActivityPausedLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -5693,7 +5664,7 @@
public void noteVibratorOnLocked(int uid, long durationMillis) {
noteVibratorOnLocked(uid, durationMillis,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteVibratorOnLocked(int uid, long durationMillis,
@@ -5704,7 +5675,7 @@
}
public void noteVibratorOffLocked(int uid) {
- noteVibratorOffLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteVibratorOffLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteVibratorOffLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -5714,7 +5685,7 @@
}
public void noteFlashlightOnLocked(int uid) {
- noteFlashlightOnLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteFlashlightOnLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteFlashlightOnLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -5731,7 +5702,7 @@
}
public void noteFlashlightOffLocked(int uid) {
- noteFlashlightOffLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteFlashlightOffLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteFlashlightOffLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -5751,7 +5722,7 @@
}
public void noteCameraOnLocked(int uid) {
- noteCameraOnLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteCameraOnLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteCameraOnLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -5768,7 +5739,7 @@
}
public void noteCameraOffLocked(int uid) {
- noteCameraOffLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteCameraOffLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteCameraOffLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -5788,7 +5759,7 @@
}
public void noteResetCameraLocked() {
- noteResetCameraLocked(mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteResetCameraLocked(mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteResetCameraLocked(long elapsedRealtimeMs, long uptimeMs) {
@@ -5807,7 +5778,7 @@
}
public void noteResetFlashlightLocked() {
- noteResetFlashlightLocked(mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteResetFlashlightLocked(mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteResetFlashlightLocked(long elapsedRealtimeMs, long uptimeMs) {
@@ -5842,7 +5813,7 @@
public void noteBluetoothScanStartedFromSourceLocked(WorkSource ws, boolean isUnoptimized) {
noteBluetoothScanStartedFromSourceLocked(ws, isUnoptimized,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteBluetoothScanStartedFromSourceLocked(WorkSource ws, boolean isUnoptimized,
@@ -5887,7 +5858,7 @@
public void noteBluetoothScanStoppedFromSourceLocked(WorkSource ws, boolean isUnoptimized) {
noteBluetoothScanStoppedFromSourceLocked(ws, isUnoptimized,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteBluetoothScanStoppedFromSourceLocked(WorkSource ws, boolean isUnoptimized,
@@ -5908,7 +5879,7 @@
}
public void noteResetBluetoothScanLocked() {
- noteResetBluetoothScanLocked(mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteResetBluetoothScanLocked(mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteResetBluetoothScanLocked(long elapsedRealtimeMs, long uptimeMs) {
@@ -5928,7 +5899,7 @@
public void noteBluetoothScanResultsFromSourceLocked(WorkSource ws, int numNewResults) {
noteBluetoothScanResultsFromSourceLocked(ws, numNewResults,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteBluetoothScanResultsFromSourceLocked(WorkSource ws, int numNewResults,
@@ -5961,7 +5932,7 @@
public void noteWifiRadioPowerState(int powerState, long timestampNs, int uid) {
noteWifiRadioPowerState(powerState, timestampNs, uid,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiRadioPowerState(int powerState, long timestampNs, int uid,
@@ -5988,7 +5959,7 @@
}
public void noteWifiRunningLocked(WorkSource ws) {
- noteWifiRunningLocked(ws, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteWifiRunningLocked(ws, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiRunningLocked(WorkSource ws, long elapsedRealtimeMs, long uptimeMs) {
@@ -6023,7 +5994,7 @@
public void noteWifiRunningChangedLocked(WorkSource oldWs, WorkSource newWs) {
noteWifiRunningChangedLocked(oldWs, newWs,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiRunningChangedLocked(WorkSource oldWs, WorkSource newWs,
@@ -6066,7 +6037,7 @@
}
public void noteWifiStoppedLocked(WorkSource ws) {
- noteWifiStoppedLocked(ws, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteWifiStoppedLocked(ws, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiStoppedLocked(WorkSource ws, long elapsedRealtimeMs, long uptimeMs) {
@@ -6100,7 +6071,7 @@
}
public void noteWifiStateLocked(int wifiState, String accessPoint) {
- noteWifiStateLocked(wifiState, accessPoint, mClocks.elapsedRealtime());
+ noteWifiStateLocked(wifiState, accessPoint, mClock.elapsedRealtime());
}
public void noteWifiStateLocked(int wifiState, String accessPoint, long elapsedRealtimeMs) {
@@ -6117,7 +6088,7 @@
public void noteWifiSupplicantStateChangedLocked(int supplState, boolean failedAuth) {
noteWifiSupplicantStateChangedLocked(supplState, failedAuth,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiSupplicantStateChangedLocked(int supplState, boolean failedAuth,
@@ -6150,7 +6121,7 @@
}
public void noteWifiRssiChangedLocked(int newRssi) {
- noteWifiRssiChangedLocked(newRssi, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteWifiRssiChangedLocked(newRssi, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiRssiChangedLocked(int newRssi, long elapsedRealtimeMs, long uptimeMs) {
@@ -6182,7 +6153,7 @@
@UnsupportedAppUsage
public void noteFullWifiLockAcquiredLocked(int uid) {
- noteFullWifiLockAcquiredLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteFullWifiLockAcquiredLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteFullWifiLockAcquiredLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -6199,7 +6170,7 @@
@UnsupportedAppUsage
public void noteFullWifiLockReleasedLocked(int uid) {
- noteFullWifiLockReleasedLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteFullWifiLockReleasedLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteFullWifiLockReleasedLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -6217,7 +6188,7 @@
int mWifiScanNesting = 0;
public void noteWifiScanStartedLocked(int uid) {
- noteWifiScanStartedLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteWifiScanStartedLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiScanStartedLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -6233,7 +6204,7 @@
}
public void noteWifiScanStoppedLocked(int uid) {
- noteWifiScanStoppedLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteWifiScanStoppedLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiScanStoppedLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -6250,7 +6221,7 @@
public void noteWifiBatchedScanStartedLocked(int uid, int csph) {
noteWifiBatchedScanStartedLocked(uid, csph,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiBatchedScanStartedLocked(int uid, int csph,
@@ -6261,7 +6232,7 @@
}
public void noteWifiBatchedScanStoppedLocked(int uid) {
- noteWifiBatchedScanStoppedLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteWifiBatchedScanStoppedLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiBatchedScanStoppedLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -6274,7 +6245,7 @@
@UnsupportedAppUsage
public void noteWifiMulticastEnabledLocked(int uid) {
- noteWifiMulticastEnabledLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteWifiMulticastEnabledLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiMulticastEnabledLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -6298,7 +6269,7 @@
@UnsupportedAppUsage
public void noteWifiMulticastDisabledLocked(int uid) {
- noteWifiMulticastDisabledLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteWifiMulticastDisabledLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiMulticastDisabledLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -6322,7 +6293,7 @@
public void noteFullWifiLockAcquiredFromSourceLocked(WorkSource ws) {
noteFullWifiLockAcquiredFromSourceLocked(ws,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteFullWifiLockAcquiredFromSourceLocked(WorkSource ws,
@@ -6345,7 +6316,7 @@
public void noteFullWifiLockReleasedFromSourceLocked(WorkSource ws) {
noteFullWifiLockReleasedFromSourceLocked(ws,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteFullWifiLockReleasedFromSourceLocked(WorkSource ws,
@@ -6367,7 +6338,7 @@
}
public void noteWifiScanStartedFromSourceLocked(WorkSource ws) {
- noteWifiScanStartedFromSourceLocked(ws, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteWifiScanStartedFromSourceLocked(ws, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiScanStartedFromSourceLocked(WorkSource ws,
@@ -6389,7 +6360,7 @@
}
public void noteWifiScanStoppedFromSourceLocked(WorkSource ws) {
- noteWifiScanStoppedFromSourceLocked(ws, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ noteWifiScanStoppedFromSourceLocked(ws, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiScanStoppedFromSourceLocked(WorkSource ws,
@@ -6412,7 +6383,7 @@
public void noteWifiBatchedScanStartedFromSourceLocked(WorkSource ws, int csph) {
noteWifiBatchedScanStartedFromSourceLocked(ws, csph,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiBatchedScanStartedFromSourceLocked(WorkSource ws, int csph,
@@ -6433,7 +6404,7 @@
public void noteWifiBatchedScanStoppedFromSourceLocked(WorkSource ws) {
noteWifiBatchedScanStoppedFromSourceLocked(ws,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteWifiBatchedScanStoppedFromSourceLocked(WorkSource ws,
long elapsedRealtimeMs, long uptimeMs) {
@@ -6509,7 +6480,7 @@
public void noteBinderCallStats(int workSourceUid, long incrementalCallCount,
Collection<BinderCallsStats.CallStat> callStats) {
noteBinderCallStats(workSourceUid, incrementalCallCount, callStats,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public void noteBinderCallStats(int workSourceUid, long incrementalCallCount,
@@ -7011,16 +6982,16 @@
}
@Override public long getStartClockTime() {
- final long currentTimeMs = mClocks.currentTimeMillis();
+ final long currentTimeMs = mClock.currentTimeMillis();
if ((currentTimeMs > MILLISECONDS_IN_YEAR
&& mStartClockTimeMs < (currentTimeMs - MILLISECONDS_IN_YEAR))
|| (mStartClockTimeMs > currentTimeMs)) {
// If the start clock time has changed by more than a year, then presumably
// the previous time was completely bogus. So we are going to figure out a
// new time based on how much time has elapsed since we started counting.
- recordCurrentTimeChangeLocked(currentTimeMs, mClocks.elapsedRealtime(),
- mClocks.uptimeMillis());
- return currentTimeMs - (mClocks.elapsedRealtime() - (mRealtimeStartUs / 1000));
+ recordCurrentTimeChangeLocked(currentTimeMs, mClock.elapsedRealtime(),
+ mClock.uptimeMillis());
+ return currentTimeMs - (mClock.elapsedRealtime() - (mRealtimeStartUs / 1000));
}
return mStartClockTimeMs;
}
@@ -7383,7 +7354,7 @@
private double mProportionalSystemServiceUsage;
public Uid(BatteryStatsImpl bsi, int uid) {
- this(bsi, uid, bsi.mClocks.elapsedRealtime(), bsi.mClocks.uptimeMillis());
+ this(bsi, uid, bsi.mClock.elapsedRealtime(), bsi.mClock.uptimeMillis());
}
public Uid(BatteryStatsImpl bsi, int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -7409,25 +7380,25 @@
};
mSyncStats = mBsi.new OverflowArrayMap<DualTimer>(uid) {
@Override public DualTimer instantiateObject() {
- return new DualTimer(mBsi.mClocks, Uid.this, SYNC, null,
+ return new DualTimer(mBsi.mClock, Uid.this, SYNC, null,
mBsi.mOnBatteryTimeBase, mOnBatteryBackgroundTimeBase);
}
};
mJobStats = mBsi.new OverflowArrayMap<DualTimer>(uid) {
@Override public DualTimer instantiateObject() {
- return new DualTimer(mBsi.mClocks, Uid.this, JOB, null,
+ return new DualTimer(mBsi.mClock, Uid.this, JOB, null,
mBsi.mOnBatteryTimeBase, mOnBatteryBackgroundTimeBase);
}
};
- mWifiRunningTimer = new StopwatchTimer(mBsi.mClocks, this, WIFI_RUNNING,
+ mWifiRunningTimer = new StopwatchTimer(mBsi.mClock, this, WIFI_RUNNING,
mBsi.mWifiRunningTimers, mBsi.mOnBatteryTimeBase);
- mFullWifiLockTimer = new StopwatchTimer(mBsi.mClocks, this, FULL_WIFI_LOCK,
+ mFullWifiLockTimer = new StopwatchTimer(mBsi.mClock, this, FULL_WIFI_LOCK,
mBsi.mFullWifiLockTimers, mBsi.mOnBatteryTimeBase);
- mWifiScanTimer = new DualTimer(mBsi.mClocks, this, WIFI_SCAN,
+ mWifiScanTimer = new DualTimer(mBsi.mClock, this, WIFI_SCAN,
mBsi.mWifiScanTimers, mBsi.mOnBatteryTimeBase, mOnBatteryBackgroundTimeBase);
mWifiBatchedScanTimer = new StopwatchTimer[NUM_WIFI_BATCHED_SCAN_BINS];
- mWifiMulticastTimer = new StopwatchTimer(mBsi.mClocks, this, WIFI_MULTICAST_ENABLED,
+ mWifiMulticastTimer = new StopwatchTimer(mBsi.mClock, this, WIFI_MULTICAST_ENABLED,
mBsi.mWifiMulticastTimers, mBsi.mOnBatteryTimeBase);
mProcessStateTimer = new StopwatchTimer[NUM_PROCESS_STATE];
mJobsDeferredEventCount = new Counter(mBsi.mOnBatteryTimeBase);
@@ -7625,7 +7596,7 @@
if (!mWifiRunning) {
mWifiRunning = true;
if (mWifiRunningTimer == null) {
- mWifiRunningTimer = new StopwatchTimer(mBsi.mClocks, Uid.this, WIFI_RUNNING,
+ mWifiRunningTimer = new StopwatchTimer(mBsi.mClock, Uid.this, WIFI_RUNNING,
mBsi.mWifiRunningTimers, mBsi.mOnBatteryTimeBase);
}
mWifiRunningTimer.startRunningLocked(elapsedRealtimeMs);
@@ -7645,7 +7616,7 @@
if (!mFullWifiLockOut) {
mFullWifiLockOut = true;
if (mFullWifiLockTimer == null) {
- mFullWifiLockTimer = new StopwatchTimer(mBsi.mClocks, Uid.this, FULL_WIFI_LOCK,
+ mFullWifiLockTimer = new StopwatchTimer(mBsi.mClock, Uid.this, FULL_WIFI_LOCK,
mBsi.mFullWifiLockTimers, mBsi.mOnBatteryTimeBase);
}
mFullWifiLockTimer.startRunningLocked(elapsedRealtimeMs);
@@ -7665,7 +7636,7 @@
if (!mWifiScanStarted) {
mWifiScanStarted = true;
if (mWifiScanTimer == null) {
- mWifiScanTimer = new DualTimer(mBsi.mClocks, Uid.this, WIFI_SCAN,
+ mWifiScanTimer = new DualTimer(mBsi.mClock, Uid.this, WIFI_SCAN,
mBsi.mWifiScanTimers, mBsi.mOnBatteryTimeBase,
mOnBatteryBackgroundTimeBase);
}
@@ -7715,7 +7686,7 @@
public void noteWifiMulticastEnabledLocked(long elapsedRealtimeMs) {
if (mWifiMulticastWakelockCount == 0) {
if (mWifiMulticastTimer == null) {
- mWifiMulticastTimer = new StopwatchTimer(mBsi.mClocks, Uid.this,
+ mWifiMulticastTimer = new StopwatchTimer(mBsi.mClock, Uid.this,
WIFI_MULTICAST_ENABLED, mBsi.mWifiMulticastTimers, mBsi.mOnBatteryTimeBase);
}
mWifiMulticastTimer.startRunningLocked(elapsedRealtimeMs);
@@ -7904,7 +7875,7 @@
public StopwatchTimer createAudioTurnedOnTimerLocked() {
if (mAudioTurnedOnTimer == null) {
- mAudioTurnedOnTimer = new StopwatchTimer(mBsi.mClocks, Uid.this, AUDIO_TURNED_ON,
+ mAudioTurnedOnTimer = new StopwatchTimer(mBsi.mClock, Uid.this, AUDIO_TURNED_ON,
mBsi.mAudioTurnedOnTimers, mBsi.mOnBatteryTimeBase);
}
return mAudioTurnedOnTimer;
@@ -7928,7 +7899,7 @@
public StopwatchTimer createVideoTurnedOnTimerLocked() {
if (mVideoTurnedOnTimer == null) {
- mVideoTurnedOnTimer = new StopwatchTimer(mBsi.mClocks, Uid.this, VIDEO_TURNED_ON,
+ mVideoTurnedOnTimer = new StopwatchTimer(mBsi.mClock, Uid.this, VIDEO_TURNED_ON,
mBsi.mVideoTurnedOnTimers, mBsi.mOnBatteryTimeBase);
}
return mVideoTurnedOnTimer;
@@ -7952,7 +7923,7 @@
public StopwatchTimer createFlashlightTurnedOnTimerLocked() {
if (mFlashlightTurnedOnTimer == null) {
- mFlashlightTurnedOnTimer = new StopwatchTimer(mBsi.mClocks, Uid.this,
+ mFlashlightTurnedOnTimer = new StopwatchTimer(mBsi.mClock, Uid.this,
FLASHLIGHT_TURNED_ON, mBsi.mFlashlightTurnedOnTimers, mBsi.mOnBatteryTimeBase);
}
return mFlashlightTurnedOnTimer;
@@ -7976,7 +7947,7 @@
public StopwatchTimer createCameraTurnedOnTimerLocked() {
if (mCameraTurnedOnTimer == null) {
- mCameraTurnedOnTimer = new StopwatchTimer(mBsi.mClocks, Uid.this, CAMERA_TURNED_ON,
+ mCameraTurnedOnTimer = new StopwatchTimer(mBsi.mClock, Uid.this, CAMERA_TURNED_ON,
mBsi.mCameraTurnedOnTimers, mBsi.mOnBatteryTimeBase);
}
return mCameraTurnedOnTimer;
@@ -8000,7 +7971,7 @@
public StopwatchTimer createForegroundActivityTimerLocked() {
if (mForegroundActivityTimer == null) {
- mForegroundActivityTimer = new StopwatchTimer(mBsi.mClocks, Uid.this,
+ mForegroundActivityTimer = new StopwatchTimer(mBsi.mClock, Uid.this,
FOREGROUND_ACTIVITY, null, mBsi.mOnBatteryTimeBase);
}
return mForegroundActivityTimer;
@@ -8008,7 +7979,7 @@
public StopwatchTimer createForegroundServiceTimerLocked() {
if (mForegroundServiceTimer == null) {
- mForegroundServiceTimer = new StopwatchTimer(mBsi.mClocks, Uid.this,
+ mForegroundServiceTimer = new StopwatchTimer(mBsi.mClock, Uid.this,
FOREGROUND_SERVICE, null, mBsi.mOnBatteryTimeBase);
}
return mForegroundServiceTimer;
@@ -8016,7 +7987,7 @@
public DualTimer createAggregatedPartialWakelockTimerLocked() {
if (mAggregatedPartialWakelockTimer == null) {
- mAggregatedPartialWakelockTimer = new DualTimer(mBsi.mClocks, this,
+ mAggregatedPartialWakelockTimer = new DualTimer(mBsi.mClock, this,
AGGREGATED_WAKE_TYPE_PARTIAL, null,
mBsi.mOnBatteryScreenOffTimeBase, mOnBatteryScreenOffBackgroundTimeBase);
}
@@ -8025,7 +7996,7 @@
public DualTimer createBluetoothScanTimerLocked() {
if (mBluetoothScanTimer == null) {
- mBluetoothScanTimer = new DualTimer(mBsi.mClocks, Uid.this, BLUETOOTH_SCAN_ON,
+ mBluetoothScanTimer = new DualTimer(mBsi.mClock, Uid.this, BLUETOOTH_SCAN_ON,
mBsi.mBluetoothScanOnTimers, mBsi.mOnBatteryTimeBase,
mOnBatteryBackgroundTimeBase);
}
@@ -8034,7 +8005,7 @@
public DualTimer createBluetoothUnoptimizedScanTimerLocked() {
if (mBluetoothUnoptimizedScanTimer == null) {
- mBluetoothUnoptimizedScanTimer = new DualTimer(mBsi.mClocks, Uid.this,
+ mBluetoothUnoptimizedScanTimer = new DualTimer(mBsi.mClock, Uid.this,
BLUETOOTH_UNOPTIMIZED_SCAN_ON, null,
mBsi.mOnBatteryTimeBase, mOnBatteryBackgroundTimeBase);
}
@@ -8112,7 +8083,7 @@
public BatchTimer createVibratorOnTimerLocked() {
if (mVibratorOnTimer == null) {
- mVibratorOnTimer = new BatchTimer(mBsi.mClocks, Uid.this, VIBRATOR_ON,
+ mVibratorOnTimer = new BatchTimer(mBsi.mClock, Uid.this, VIBRATOR_ON,
mBsi.mOnBatteryTimeBase);
}
return mVibratorOnTimer;
@@ -8298,10 +8269,10 @@
detachIfNotNull(mProcessStateTimer[i]);
if (in == null) {
- mProcessStateTimer[i] = new StopwatchTimer(mBsi.mClocks, this, PROCESS_STATE, null,
+ mProcessStateTimer[i] = new StopwatchTimer(mBsi.mClock, this, PROCESS_STATE, null,
mBsi.mOnBatteryTimeBase);
} else {
- mProcessStateTimer[i] = new StopwatchTimer(mBsi.mClocks, this, PROCESS_STATE, null,
+ mProcessStateTimer[i] = new StopwatchTimer(mBsi.mClock, this, PROCESS_STATE, null,
mBsi.mOnBatteryTimeBase, in);
}
}
@@ -8362,10 +8333,10 @@
}
detachIfNotNull(mWifiBatchedScanTimer[i]);
if (in == null) {
- mWifiBatchedScanTimer[i] = new StopwatchTimer(mBsi.mClocks, this, WIFI_BATCHED_SCAN,
+ mWifiBatchedScanTimer[i] = new StopwatchTimer(mBsi.mClock, this, WIFI_BATCHED_SCAN,
collected, mBsi.mOnBatteryTimeBase);
} else {
- mWifiBatchedScanTimer[i] = new StopwatchTimer(mBsi.mClocks, this, WIFI_BATCHED_SCAN,
+ mWifiBatchedScanTimer[i] = new StopwatchTimer(mBsi.mClock, this, WIFI_BATCHED_SCAN,
collected, mBsi.mOnBatteryTimeBase, in);
}
}
@@ -9159,7 +9130,7 @@
for (int j = 0; j < numSyncs; j++) {
String syncName = in.readString();
if (in.readInt() != 0) {
- mSyncStats.add(syncName, new DualTimer(mBsi.mClocks, Uid.this, SYNC, null,
+ mSyncStats.add(syncName, new DualTimer(mBsi.mClock, Uid.this, SYNC, null,
mBsi.mOnBatteryTimeBase, mOnBatteryBackgroundTimeBase, in));
}
}
@@ -9169,7 +9140,7 @@
for (int j = 0; j < numJobs; j++) {
String jobName = in.readString();
if (in.readInt() != 0) {
- mJobStats.add(jobName, new DualTimer(mBsi.mClocks, Uid.this, JOB, null,
+ mJobStats.add(jobName, new DualTimer(mBsi.mClock, Uid.this, JOB, null,
mBsi.mOnBatteryTimeBase, mOnBatteryBackgroundTimeBase, in));
}
}
@@ -9214,21 +9185,21 @@
mWifiRunning = false;
if (in.readInt() != 0) {
- mWifiRunningTimer = new StopwatchTimer(mBsi.mClocks, Uid.this, WIFI_RUNNING,
+ mWifiRunningTimer = new StopwatchTimer(mBsi.mClock, Uid.this, WIFI_RUNNING,
mBsi.mWifiRunningTimers, mBsi.mOnBatteryTimeBase, in);
} else {
mWifiRunningTimer = null;
}
mFullWifiLockOut = false;
if (in.readInt() != 0) {
- mFullWifiLockTimer = new StopwatchTimer(mBsi.mClocks, Uid.this, FULL_WIFI_LOCK,
+ mFullWifiLockTimer = new StopwatchTimer(mBsi.mClock, Uid.this, FULL_WIFI_LOCK,
mBsi.mFullWifiLockTimers, mBsi.mOnBatteryTimeBase, in);
} else {
mFullWifiLockTimer = null;
}
mWifiScanStarted = false;
if (in.readInt() != 0) {
- mWifiScanTimer = new DualTimer(mBsi.mClocks, Uid.this, WIFI_SCAN,
+ mWifiScanTimer = new DualTimer(mBsi.mClock, Uid.this, WIFI_SCAN,
mBsi.mWifiScanTimers, mBsi.mOnBatteryTimeBase, mOnBatteryBackgroundTimeBase,
in);
} else {
@@ -9244,49 +9215,50 @@
}
mWifiMulticastWakelockCount = 0;
if (in.readInt() != 0) {
- mWifiMulticastTimer = new StopwatchTimer(mBsi.mClocks, Uid.this, WIFI_MULTICAST_ENABLED,
+ mWifiMulticastTimer = new StopwatchTimer(mBsi.mClock, Uid.this,
+ WIFI_MULTICAST_ENABLED,
mBsi.mWifiMulticastTimers, mBsi.mOnBatteryTimeBase, in);
} else {
mWifiMulticastTimer = null;
}
if (in.readInt() != 0) {
- mAudioTurnedOnTimer = new StopwatchTimer(mBsi.mClocks, Uid.this, AUDIO_TURNED_ON,
+ mAudioTurnedOnTimer = new StopwatchTimer(mBsi.mClock, Uid.this, AUDIO_TURNED_ON,
mBsi.mAudioTurnedOnTimers, mBsi.mOnBatteryTimeBase, in);
} else {
mAudioTurnedOnTimer = null;
}
if (in.readInt() != 0) {
- mVideoTurnedOnTimer = new StopwatchTimer(mBsi.mClocks, Uid.this, VIDEO_TURNED_ON,
+ mVideoTurnedOnTimer = new StopwatchTimer(mBsi.mClock, Uid.this, VIDEO_TURNED_ON,
mBsi.mVideoTurnedOnTimers, mBsi.mOnBatteryTimeBase, in);
} else {
mVideoTurnedOnTimer = null;
}
if (in.readInt() != 0) {
- mFlashlightTurnedOnTimer = new StopwatchTimer(mBsi.mClocks, Uid.this,
+ mFlashlightTurnedOnTimer = new StopwatchTimer(mBsi.mClock, Uid.this,
FLASHLIGHT_TURNED_ON, mBsi.mFlashlightTurnedOnTimers, mBsi.mOnBatteryTimeBase, in);
} else {
mFlashlightTurnedOnTimer = null;
}
if (in.readInt() != 0) {
- mCameraTurnedOnTimer = new StopwatchTimer(mBsi.mClocks, Uid.this, CAMERA_TURNED_ON,
+ mCameraTurnedOnTimer = new StopwatchTimer(mBsi.mClock, Uid.this, CAMERA_TURNED_ON,
mBsi.mCameraTurnedOnTimers, mBsi.mOnBatteryTimeBase, in);
} else {
mCameraTurnedOnTimer = null;
}
if (in.readInt() != 0) {
- mForegroundActivityTimer = new StopwatchTimer(mBsi.mClocks, Uid.this,
+ mForegroundActivityTimer = new StopwatchTimer(mBsi.mClock, Uid.this,
FOREGROUND_ACTIVITY, null, mBsi.mOnBatteryTimeBase, in);
} else {
mForegroundActivityTimer = null;
}
if (in.readInt() != 0) {
- mForegroundServiceTimer = new StopwatchTimer(mBsi.mClocks, Uid.this,
+ mForegroundServiceTimer = new StopwatchTimer(mBsi.mClock, Uid.this,
FOREGROUND_SERVICE, null, mBsi.mOnBatteryTimeBase, in);
} else {
mForegroundServiceTimer = null;
}
if (in.readInt() != 0) {
- mAggregatedPartialWakelockTimer = new DualTimer(mBsi.mClocks, this,
+ mAggregatedPartialWakelockTimer = new DualTimer(mBsi.mClock, this,
AGGREGATED_WAKE_TYPE_PARTIAL, null,
mBsi.mOnBatteryScreenOffTimeBase, mOnBatteryScreenOffBackgroundTimeBase,
in);
@@ -9294,14 +9266,14 @@
mAggregatedPartialWakelockTimer = null;
}
if (in.readInt() != 0) {
- mBluetoothScanTimer = new DualTimer(mBsi.mClocks, Uid.this, BLUETOOTH_SCAN_ON,
+ mBluetoothScanTimer = new DualTimer(mBsi.mClock, Uid.this, BLUETOOTH_SCAN_ON,
mBsi.mBluetoothScanOnTimers, mBsi.mOnBatteryTimeBase,
mOnBatteryBackgroundTimeBase, in);
} else {
mBluetoothScanTimer = null;
}
if (in.readInt() != 0) {
- mBluetoothUnoptimizedScanTimer = new DualTimer(mBsi.mClocks, Uid.this,
+ mBluetoothUnoptimizedScanTimer = new DualTimer(mBsi.mClock, Uid.this,
BLUETOOTH_UNOPTIMIZED_SCAN_ON, null,
mBsi.mOnBatteryTimeBase, mOnBatteryBackgroundTimeBase, in);
} else {
@@ -9326,7 +9298,7 @@
}
}
if (in.readInt() != 0) {
- mVibratorOnTimer = new BatchTimer(mBsi.mClocks, Uid.this, VIBRATOR_ON,
+ mVibratorOnTimer = new BatchTimer(mBsi.mClock, Uid.this, VIBRATOR_ON,
mBsi.mOnBatteryTimeBase, in);
} else {
mVibratorOnTimer = null;
@@ -9536,7 +9508,7 @@
return null;
}
- return new StopwatchTimer(mBsi.mClocks, mUid, type, pool, timeBase, in);
+ return new StopwatchTimer(mBsi.mClock, mUid, type, pool, timeBase, in);
}
/**
@@ -9552,7 +9524,7 @@
return null;
}
- return new DualTimer(mBsi.mClocks, mUid, type, pool, timeBase, bgTimeBase, in);
+ return new DualTimer(mBsi.mClock, mUid, type, pool, timeBase, bgTimeBase, in);
}
boolean reset(long elapsedRealtimeUs) {
@@ -9649,7 +9621,7 @@
pool = new ArrayList<StopwatchTimer>();
mBsi.mSensorTimers.put(mHandle, pool);
}
- return new DualTimer(mBsi.mClocks, mUid, 0, pool, timeBase, bgTimeBase, in);
+ return new DualTimer(mBsi.mClock, mUid, 0, pool, timeBase, bgTimeBase, in);
}
boolean reset(long elapsedRealtimeUs) {
@@ -10151,7 +10123,7 @@
@UnsupportedAppUsage
public void startLaunchedLocked() {
- startLaunchedLocked(mBsi.mClocks.uptimeMillis());
+ startLaunchedLocked(mBsi.mClock.uptimeMillis());
}
public void startLaunchedLocked(long uptimeMs) {
@@ -10164,7 +10136,7 @@
@UnsupportedAppUsage
public void stopLaunchedLocked() {
- stopLaunchedLocked(mBsi.mClocks.uptimeMillis());
+ stopLaunchedLocked(mBsi.mClock.uptimeMillis());
}
public void stopLaunchedLocked(long uptimeMs) {
@@ -10182,7 +10154,7 @@
@UnsupportedAppUsage
public void startRunningLocked() {
- startRunningLocked(mBsi.mClocks.uptimeMillis());
+ startRunningLocked(mBsi.mClock.uptimeMillis());
}
public void startRunningLocked(long uptimeMs) {
@@ -10195,7 +10167,7 @@
@UnsupportedAppUsage
public void stopRunningLocked() {
- stopRunningLocked(mBsi.mClocks.uptimeMillis());
+ stopRunningLocked(mBsi.mClock.uptimeMillis());
}
public void stopRunningLocked(long uptimeMs) {
@@ -10254,7 +10226,7 @@
@GuardedBy("mBsi")
public void updateUidProcessStateLocked(int procState) {
updateUidProcessStateLocked(procState,
- mBsi.mClocks.elapsedRealtime(), mBsi.mClocks.uptimeMillis());
+ mBsi.mClock.elapsedRealtime(), mBsi.mClock.uptimeMillis());
}
public void updateUidProcessStateLocked(int procState,
@@ -10419,7 +10391,7 @@
timers = new ArrayList<StopwatchTimer>();
mBsi.mSensorTimers.put(sensor, timers);
}
- t = new DualTimer(mBsi.mClocks, this, BatteryStats.SENSOR, timers,
+ t = new DualTimer(mBsi.mClock, this, BatteryStats.SENSOR, timers,
mBsi.mOnBatteryTimeBase, mOnBatteryBackgroundTimeBase);
se.mTimer = t;
return t;
@@ -10470,7 +10442,7 @@
case WAKE_TYPE_PARTIAL: {
DualTimer t = wl.mTimerPartial;
if (t == null) {
- t = new DualTimer(mBsi.mClocks, this, WAKE_TYPE_PARTIAL,
+ t = new DualTimer(mBsi.mClock, this, WAKE_TYPE_PARTIAL,
mBsi.mPartialTimers, mBsi.mOnBatteryScreenOffTimeBase,
mOnBatteryScreenOffBackgroundTimeBase);
wl.mTimerPartial = t;
@@ -10480,7 +10452,7 @@
case WAKE_TYPE_FULL: {
StopwatchTimer t = wl.mTimerFull;
if (t == null) {
- t = new StopwatchTimer(mBsi.mClocks, this, WAKE_TYPE_FULL,
+ t = new StopwatchTimer(mBsi.mClock, this, WAKE_TYPE_FULL,
mBsi.mFullTimers, mBsi.mOnBatteryTimeBase);
wl.mTimerFull = t;
}
@@ -10489,7 +10461,7 @@
case WAKE_TYPE_WINDOW: {
StopwatchTimer t = wl.mTimerWindow;
if (t == null) {
- t = new StopwatchTimer(mBsi.mClocks, this, WAKE_TYPE_WINDOW,
+ t = new StopwatchTimer(mBsi.mClock, this, WAKE_TYPE_WINDOW,
mBsi.mWindowTimers, mBsi.mOnBatteryTimeBase);
wl.mTimerWindow = t;
}
@@ -10498,7 +10470,7 @@
case WAKE_TYPE_DRAW: {
StopwatchTimer t = wl.mTimerDraw;
if (t == null) {
- t = new StopwatchTimer(mBsi.mClocks, this, WAKE_TYPE_DRAW,
+ t = new StopwatchTimer(mBsi.mClock, this, WAKE_TYPE_DRAW,
mBsi.mDrawTimers, mBsi.mOnBatteryTimeBase);
wl.mTimerDraw = t;
}
@@ -10586,13 +10558,13 @@
public BatteryStatsImpl(File systemDir, Handler handler, PlatformIdleStateCallback cb,
MeasuredEnergyRetriever energyStatsCb, UserInfoProvider userInfoProvider) {
- this(new SystemClocks(), systemDir, handler, cb, energyStatsCb, userInfoProvider);
+ this(Clock.SYSTEM_CLOCK, systemDir, handler, cb, energyStatsCb, userInfoProvider);
}
- private BatteryStatsImpl(Clocks clocks, File systemDir, Handler handler,
+ private BatteryStatsImpl(Clock clock, File systemDir, Handler handler,
PlatformIdleStateCallback cb, MeasuredEnergyRetriever energyStatsCb,
UserInfoProvider userInfoProvider) {
- init(clocks);
+ init(clock);
if (systemDir == null) {
mStatsFile = null;
@@ -10608,8 +10580,8 @@
mStartCount++;
initTimersAndCounters();
mOnBattery = mOnBatteryInternal = false;
- long uptimeUs = mClocks.uptimeMillis() * 1000;
- long realtimeUs = mClocks.elapsedRealtime() * 1000;
+ long uptimeUs = mClock.uptimeMillis() * 1000;
+ long realtimeUs = mClock.elapsedRealtime() * 1000;
initTimes(uptimeUs, realtimeUs);
mStartPlatformVersion = mEndPlatformVersion = Build.ID;
initDischarge(realtimeUs);
@@ -10626,29 +10598,29 @@
@VisibleForTesting
protected void initTimersAndCounters() {
- mScreenOnTimer = new StopwatchTimer(mClocks, null, -1, null, mOnBatteryTimeBase);
- mScreenDozeTimer = new StopwatchTimer(mClocks, null, -1, null, mOnBatteryTimeBase);
+ mScreenOnTimer = new StopwatchTimer(mClock, null, -1, null, mOnBatteryTimeBase);
+ mScreenDozeTimer = new StopwatchTimer(mClock, null, -1, null, mOnBatteryTimeBase);
for (int i=0; i<NUM_SCREEN_BRIGHTNESS_BINS; i++) {
- mScreenBrightnessTimer[i] = new StopwatchTimer(mClocks, null, -100-i, null,
+ mScreenBrightnessTimer[i] = new StopwatchTimer(mClock, null, -100 - i, null,
mOnBatteryTimeBase);
}
- mInteractiveTimer = new StopwatchTimer(mClocks, null, -10, null, mOnBatteryTimeBase);
- mPowerSaveModeEnabledTimer = new StopwatchTimer(mClocks, null, -2, null,
+ mInteractiveTimer = new StopwatchTimer(mClock, null, -10, null, mOnBatteryTimeBase);
+ mPowerSaveModeEnabledTimer = new StopwatchTimer(mClock, null, -2, null,
mOnBatteryTimeBase);
- mDeviceIdleModeLightTimer = new StopwatchTimer(mClocks, null, -11, null,
+ mDeviceIdleModeLightTimer = new StopwatchTimer(mClock, null, -11, null,
mOnBatteryTimeBase);
- mDeviceIdleModeFullTimer = new StopwatchTimer(mClocks, null, -14, null, mOnBatteryTimeBase);
- mDeviceLightIdlingTimer = new StopwatchTimer(mClocks, null, -15, null, mOnBatteryTimeBase);
- mDeviceIdlingTimer = new StopwatchTimer(mClocks, null, -12, null, mOnBatteryTimeBase);
- mPhoneOnTimer = new StopwatchTimer(mClocks, null, -3, null, mOnBatteryTimeBase);
+ mDeviceIdleModeFullTimer = new StopwatchTimer(mClock, null, -14, null, mOnBatteryTimeBase);
+ mDeviceLightIdlingTimer = new StopwatchTimer(mClock, null, -15, null, mOnBatteryTimeBase);
+ mDeviceIdlingTimer = new StopwatchTimer(mClock, null, -12, null, mOnBatteryTimeBase);
+ mPhoneOnTimer = new StopwatchTimer(mClock, null, -3, null, mOnBatteryTimeBase);
for (int i = 0; i < CellSignalStrength.getNumSignalStrengthLevels(); i++) {
- mPhoneSignalStrengthsTimer[i] = new StopwatchTimer(mClocks, null, -200-i, null,
+ mPhoneSignalStrengthsTimer[i] = new StopwatchTimer(mClock, null, -200 - i, null,
mOnBatteryTimeBase);
}
- mPhoneSignalScanningTimer = new StopwatchTimer(mClocks, null, -200+1, null,
+ mPhoneSignalScanningTimer = new StopwatchTimer(mClock, null, -200 + 1, null,
mOnBatteryTimeBase);
for (int i=0; i<NUM_DATA_CONNECTION_TYPES; i++) {
- mPhoneDataConnectionsTimer[i] = new StopwatchTimer(mClocks, null, -300-i, null,
+ mPhoneDataConnectionsTimer[i] = new StopwatchTimer(mClock, null, -300 - i, null,
mOnBatteryTimeBase);
}
for (int i = 0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
@@ -10660,38 +10632,38 @@
NUM_BT_TX_LEVELS);
mModemActivity = new ControllerActivityCounterImpl(mOnBatteryTimeBase,
ModemActivityInfo.getNumTxPowerLevels());
- mMobileRadioActiveTimer = new StopwatchTimer(mClocks, null, -400, null, mOnBatteryTimeBase);
- mMobileRadioActivePerAppTimer = new StopwatchTimer(mClocks, null, -401, null,
+ mMobileRadioActiveTimer = new StopwatchTimer(mClock, null, -400, null, mOnBatteryTimeBase);
+ mMobileRadioActivePerAppTimer = new StopwatchTimer(mClock, null, -401, null,
mOnBatteryTimeBase);
mMobileRadioActiveAdjustedTime = new LongSamplingCounter(mOnBatteryTimeBase);
mMobileRadioActiveUnknownTime = new LongSamplingCounter(mOnBatteryTimeBase);
mMobileRadioActiveUnknownCount = new LongSamplingCounter(mOnBatteryTimeBase);
- mWifiMulticastWakelockTimer = new StopwatchTimer(mClocks, null,
+ mWifiMulticastWakelockTimer = new StopwatchTimer(mClock, null,
WIFI_AGGREGATE_MULTICAST_ENABLED, null, mOnBatteryTimeBase);
- mWifiOnTimer = new StopwatchTimer(mClocks, null, -4, null, mOnBatteryTimeBase);
- mGlobalWifiRunningTimer = new StopwatchTimer(mClocks, null, -5, null, mOnBatteryTimeBase);
+ mWifiOnTimer = new StopwatchTimer(mClock, null, -4, null, mOnBatteryTimeBase);
+ mGlobalWifiRunningTimer = new StopwatchTimer(mClock, null, -5, null, mOnBatteryTimeBase);
for (int i=0; i<NUM_WIFI_STATES; i++) {
- mWifiStateTimer[i] = new StopwatchTimer(mClocks, null, -600-i, null,
+ mWifiStateTimer[i] = new StopwatchTimer(mClock, null, -600 - i, null,
mOnBatteryTimeBase);
}
for (int i=0; i<NUM_WIFI_SUPPL_STATES; i++) {
- mWifiSupplStateTimer[i] = new StopwatchTimer(mClocks, null, -700-i, null,
+ mWifiSupplStateTimer[i] = new StopwatchTimer(mClock, null, -700 - i, null,
mOnBatteryTimeBase);
}
for (int i=0; i<NUM_WIFI_SIGNAL_STRENGTH_BINS; i++) {
- mWifiSignalStrengthsTimer[i] = new StopwatchTimer(mClocks, null, -800-i, null,
+ mWifiSignalStrengthsTimer[i] = new StopwatchTimer(mClock, null, -800 - i, null,
mOnBatteryTimeBase);
}
- mWifiActiveTimer = new StopwatchTimer(mClocks, null, -900, null, mOnBatteryTimeBase);
+ mWifiActiveTimer = new StopwatchTimer(mClock, null, -900, null, mOnBatteryTimeBase);
for (int i=0; i< mGpsSignalQualityTimer.length; i++) {
- mGpsSignalQualityTimer[i] = new StopwatchTimer(mClocks, null, -1000-i, null,
- mOnBatteryTimeBase);
+ mGpsSignalQualityTimer[i] = new StopwatchTimer(mClock, null, -1000 - i, null,
+ mOnBatteryTimeBase);
}
- mAudioOnTimer = new StopwatchTimer(mClocks, null, -7, null, mOnBatteryTimeBase);
- mVideoOnTimer = new StopwatchTimer(mClocks, null, -8, null, mOnBatteryTimeBase);
- mFlashlightOnTimer = new StopwatchTimer(mClocks, null, -9, null, mOnBatteryTimeBase);
- mCameraOnTimer = new StopwatchTimer(mClocks, null, -13, null, mOnBatteryTimeBase);
- mBluetoothScanTimer = new StopwatchTimer(mClocks, null, -14, null, mOnBatteryTimeBase);
+ mAudioOnTimer = new StopwatchTimer(mClock, null, -7, null, mOnBatteryTimeBase);
+ mVideoOnTimer = new StopwatchTimer(mClock, null, -8, null, mOnBatteryTimeBase);
+ mFlashlightOnTimer = new StopwatchTimer(mClock, null, -9, null, mOnBatteryTimeBase);
+ mCameraOnTimer = new StopwatchTimer(mClock, null, -13, null, mOnBatteryTimeBase);
+ mBluetoothScanTimer = new StopwatchTimer(mClock, null, -14, null, mOnBatteryTimeBase);
mDischargeScreenOffCounter = new LongSamplingCounter(mOnBatteryScreenOffTimeBase);
mDischargeScreenDozeCounter = new LongSamplingCounter(mOnBatteryTimeBase);
mDischargeLightDozeCounter = new LongSamplingCounter(mOnBatteryTimeBase);
@@ -10706,11 +10678,11 @@
@UnsupportedAppUsage
public BatteryStatsImpl(Parcel p) {
- this(new SystemClocks(), p);
+ this(Clock.SYSTEM_CLOCK, p);
}
- public BatteryStatsImpl(Clocks clocks, Parcel p) {
- init(clocks);
+ public BatteryStatsImpl(Clock clock, Parcel p) {
+ init(clock);
mStatsFile = null;
mCheckinFile = null;
mDailyFile = null;
@@ -10778,7 +10750,7 @@
public void updateDailyDeadlineLocked() {
// Get the current time.
- long currentTimeMs = mDailyStartTimeMs = mClocks.currentTimeMillis();
+ long currentTimeMs = mDailyStartTimeMs = mClock.currentTimeMillis();
Calendar calDeadline = Calendar.getInstance();
calDeadline.setTimeInMillis(currentTimeMs);
@@ -10806,7 +10778,7 @@
public void recordDailyStatsLocked() {
DailyItem item = new DailyItem();
item.mStartTime = mDailyStartTimeMs;
- item.mEndTime = mClocks.currentTimeMillis();
+ item.mEndTime = mClock.currentTimeMillis();
boolean hasData = false;
if (mDailyDischargeStepTracker.mNumStepDurations > 0) {
hasData = true;
@@ -11171,7 +11143,7 @@
}
void initTimes(long uptimeUs, long realtimeUs) {
- mStartClockTimeMs = mClocks.currentTimeMillis();
+ mStartClockTimeMs = mClock.currentTimeMillis();
mOnBatteryTimeBase.init(uptimeUs, realtimeUs);
mOnBatteryScreenOffTimeBase.init(uptimeUs, realtimeUs);
mRealtimeUs = 0;
@@ -11203,9 +11175,9 @@
}
public void resetAllStatsCmdLocked() {
- final long mSecUptime = mClocks.uptimeMillis();
+ final long mSecUptime = mClock.uptimeMillis();
long uptimeUs = mSecUptime * 1000;
- long mSecRealtime = mClocks.elapsedRealtime();
+ long mSecRealtime = mClock.elapsedRealtime();
long realtimeUs = mSecRealtime * 1000;
resetAllStatsLocked(mSecUptime, mSecRealtime, RESET_REASON_ADB_COMMAND);
mDischargeStartLevel = mHistoryCur.batteryLevel;
@@ -12739,7 +12711,7 @@
* Read and distribute kernel wake lock use across apps.
*/
public void updateKernelWakelocksLocked() {
- updateKernelWakelocksLocked(mClocks.elapsedRealtime() * 1000);
+ updateKernelWakelocksLocked(mClock.elapsedRealtime() * 1000);
}
/**
@@ -12760,7 +12732,7 @@
SamplingTimer kwlt = mKernelWakelockStats.get(name);
if (kwlt == null) {
- kwlt = new SamplingTimer(mClocks, mOnBatteryScreenOffTimeBase);
+ kwlt = new SamplingTimer(mClock, mOnBatteryScreenOffTimeBase);
mKernelWakelockStats.put(name, kwlt);
}
@@ -12802,7 +12774,7 @@
* Reads the newest memory stats from the kernel.
*/
public void updateKernelMemoryBandwidthLocked() {
- updateKernelMemoryBandwidthLocked(mClocks.elapsedRealtime() * 1000);
+ updateKernelMemoryBandwidthLocked(mClock.elapsedRealtime() * 1000);
}
public void updateKernelMemoryBandwidthLocked(long elapsedRealtimeUs) {
@@ -12815,7 +12787,7 @@
if ((index = mKernelMemoryStats.indexOfKey(bandwidthEntries.keyAt(i))) >= 0) {
timer = mKernelMemoryStats.valueAt(index);
} else {
- timer = new SamplingTimer(mClocks, mOnBatteryTimeBase);
+ timer = new SamplingTimer(mClock, mOnBatteryTimeBase);
mKernelMemoryStats.put(bandwidthEntries.keyAt(i), timer);
}
timer.update(bandwidthEntries.valueAt(i), 1, elapsedRealtimeUs);
@@ -13113,8 +13085,8 @@
// So, we distribute total time spent by an uid to different cpu freqs based on the
// amount of time cpu was running at that freq.
final int updatedUidsCount = updatedUids.size();
- final long elapsedRealtimeMs = mClocks.elapsedRealtime();
- final long uptimeMs = mClocks.uptimeMillis();
+ final long elapsedRealtimeMs = mClock.elapsedRealtime();
+ final long uptimeMs = mClock.uptimeMillis();
for (int i = 0; i < updatedUidsCount; ++i) {
final Uid u = getUidStatsLocked(updatedUids.keyAt(i), elapsedRealtimeMs, uptimeMs);
final long appCpuTimeUs = updatedUids.valueAt(i);
@@ -13166,8 +13138,8 @@
@Nullable SparseLongArray updatedUids, boolean onBattery) {
mTempTotalCpuUserTimeUs = mTempTotalCpuSystemTimeUs = 0;
final int numWakelocks = partialTimers == null ? 0 : partialTimers.size();
- final long startTimeMs = mClocks.uptimeMillis();
- final long elapsedRealtimeMs = mClocks.elapsedRealtime();
+ final long startTimeMs = mClock.uptimeMillis();
+ final long elapsedRealtimeMs = mClock.elapsedRealtime();
mCpuUidUserSysTimeReader.readDelta(false, (uid, timesUs) -> {
long userTimeUs = timesUs[0], systemTimeUs = timesUs[1];
@@ -13222,7 +13194,7 @@
}
});
- final long elapsedTimeMs = mClocks.uptimeMillis() - startTimeMs;
+ final long elapsedTimeMs = mClock.uptimeMillis() - startTimeMs;
if (DEBUG_ENERGY_CPU || elapsedTimeMs >= 100) {
Slog.d(TAG, "Reading cpu stats took " + elapsedTimeMs + "ms");
}
@@ -13283,8 +13255,8 @@
final int numWakelocks = partialTimers == null ? 0 : partialTimers.size();
final int numClusters = mPowerProfile.getNumCpuClusters();
mWakeLockAllocationsUs = null;
- final long startTimeMs = mClocks.uptimeMillis();
- final long elapsedRealtimeMs = mClocks.elapsedRealtime();
+ final long startTimeMs = mClock.uptimeMillis();
+ final long elapsedRealtimeMs = mClock.elapsedRealtime();
// If power is being accumulated for attribution, data needs to be read immediately.
final boolean forceRead = powerAccumulator != null;
mCpuUidFreqTimeReader.readDelta(forceRead, (uid, cpuFreqTimeMs) -> {
@@ -13359,7 +13331,7 @@
}
});
- final long elapsedTimeMs = mClocks.uptimeMillis() - startTimeMs;
+ final long elapsedTimeMs = mClock.uptimeMillis() - startTimeMs;
if (DEBUG_ENERGY_CPU || elapsedTimeMs >= 100) {
Slog.d(TAG, "Reading cpu freq times took " + elapsedTimeMs + "ms");
}
@@ -13407,8 +13379,8 @@
*/
@VisibleForTesting
public void readKernelUidCpuActiveTimesLocked(boolean onBattery) {
- final long startTimeMs = mClocks.uptimeMillis();
- final long elapsedRealtimeMs = mClocks.elapsedRealtime();
+ final long startTimeMs = mClock.uptimeMillis();
+ final long elapsedRealtimeMs = mClock.elapsedRealtime();
mCpuUidActiveTimeReader.readDelta(false, (uid, cpuActiveTimesMs) -> {
uid = mapUid(uid);
if (Process.isIsolated(uid)) {
@@ -13423,7 +13395,7 @@
u.mCpuActiveTimeMs.addCountLocked(cpuActiveTimesMs, onBattery);
});
- final long elapsedTimeMs = mClocks.uptimeMillis() - startTimeMs;
+ final long elapsedTimeMs = mClock.uptimeMillis() - startTimeMs;
if (DEBUG_ENERGY_CPU || elapsedTimeMs >= 100) {
Slog.d(TAG, "Reading cpu active times took " + elapsedTimeMs + "ms");
}
@@ -13440,8 +13412,8 @@
@VisibleForTesting
public void readKernelUidCpuClusterTimesLocked(boolean onBattery,
@Nullable CpuDeltaPowerAccumulator powerAccumulator) {
- final long startTimeMs = mClocks.uptimeMillis();
- final long elapsedRealtimeMs = mClocks.elapsedRealtime();
+ final long startTimeMs = mClock.uptimeMillis();
+ final long elapsedRealtimeMs = mClock.elapsedRealtime();
// If power is being accumulated for attribution, data needs to be read immediately.
final boolean forceRead = powerAccumulator != null;
mCpuUidClusterTimeReader.readDelta(forceRead, (uid, cpuClusterTimesMs) -> {
@@ -13462,7 +13434,7 @@
}
});
- final long elapsedTimeMs = mClocks.uptimeMillis() - startTimeMs;
+ final long elapsedTimeMs = mClock.uptimeMillis() - startTimeMs;
if (DEBUG_ENERGY_CPU || elapsedTimeMs >= 100) {
Slog.d(TAG, "Reading cpu cluster times took " + elapsedTimeMs + "ms");
}
@@ -13641,7 +13613,7 @@
private void startRecordingHistory(final long elapsedRealtimeMs, final long uptimeMs,
boolean reset) {
mRecordingHistory = true;
- mHistoryCur.currentTime = mClocks.currentTimeMillis();
+ mHistoryCur.currentTime = mClock.currentTimeMillis();
addHistoryBufferLocked(elapsedRealtimeMs,
reset ? HistoryItem.CMD_RESET : HistoryItem.CMD_CURRENT_TIME,
mHistoryCur);
@@ -13683,7 +13655,7 @@
final int chargeFullUah, final long chargeTimeToFullSeconds) {
setBatteryStateLocked(status, health, plugType, level, temp, voltageMv, chargeUah,
chargeFullUah, chargeTimeToFullSeconds,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis(), mClocks.currentTimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis(), mClock.currentTimeMillis());
}
public void setBatteryStateLocked(final int status, final int health, final int plugType,
@@ -13920,12 +13892,12 @@
public long getAwakeTimeBattery() {
// This previously evaluated to mOnBatteryTimeBase.getUptime(getBatteryUptimeLocked());
// for over a decade, but surely that was a mistake.
- return getBatteryUptimeLocked(mClocks.uptimeMillis());
+ return getBatteryUptimeLocked(mClock.uptimeMillis());
}
@UnsupportedAppUsage
public long getAwakeTimePlugged() {
- return (mClocks.uptimeMillis() * 1000) - getAwakeTimeBattery();
+ return (mClock.uptimeMillis() * 1000) - getAwakeTimeBattery();
}
@Override
@@ -14175,7 +14147,7 @@
* @return battery uptime in microseconds
*/
protected long getBatteryUptimeLocked() {
- return getBatteryUptimeLocked(mClocks.uptimeMillis());
+ return getBatteryUptimeLocked(mClock.uptimeMillis());
}
/**
@@ -14348,7 +14320,7 @@
*/
@UnsupportedAppUsage
public Uid getUidStatsLocked(int uid) {
- return getUidStatsLocked(uid, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ return getUidStatsLocked(uid, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public Uid getUidStatsLocked(int uid, long elapsedRealtimeMs, long uptimeMs) {
@@ -14410,7 +14382,7 @@
*/
@UnsupportedAppUsage
public void removeUidStatsLocked(int uid) {
- removeUidStatsLocked(uid, mClocks.elapsedRealtime());
+ removeUidStatsLocked(uid, mClock.elapsedRealtime());
}
/**
@@ -14464,7 +14436,7 @@
*/
@UnsupportedAppUsage
public Uid.Proc getProcessStatsLocked(int uid, String name) {
- return getProcessStatsLocked(uid, name, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ return getProcessStatsLocked(uid, name, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
/**
@@ -14483,7 +14455,7 @@
*/
@UnsupportedAppUsage
public Uid.Pkg getPackageStatsLocked(int uid, String pkg) {
- return getPackageStatsLocked(uid, pkg, mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ return getPackageStatsLocked(uid, pkg, mClock.elapsedRealtime(), mClock.uptimeMillis());
}
/**
@@ -14503,7 +14475,7 @@
@UnsupportedAppUsage
public Uid.Pkg.Serv getServiceStatsLocked(int uid, String pkg, String name) {
return getServiceStatsLocked(uid, pkg, name,
- mClocks.elapsedRealtime(), mClocks.uptimeMillis());
+ mClock.elapsedRealtime(), mClock.uptimeMillis());
}
public Uid.Pkg.Serv getServiceStatsLocked(int uid, String pkg, String name,
@@ -14514,7 +14486,7 @@
}
public void shutdownLocked() {
- recordShutdownLocked(mClocks.currentTimeMillis(), mClocks.elapsedRealtime());
+ recordShutdownLocked(mClock.currentTimeMillis(), mClock.elapsedRealtime());
writeSyncLocked();
mShuttingDown = true;
}
@@ -14736,7 +14708,7 @@
mNumSingleUidCpuTimeReads = 0;
mNumBatchedSingleUidCpuTimeReads = 0;
- mCpuTimeReadsTrackingStartTimeMs = mClocks.uptimeMillis();
+ mCpuTimeReadsTrackingStartTimeMs = mClock.uptimeMillis();
}
}
@@ -14745,7 +14717,7 @@
if (oldDelayMillis != newDelayMillis) {
mNumSingleUidCpuTimeReads = 0;
mNumBatchedSingleUidCpuTimeReads = 0;
- mCpuTimeReadsTrackingStartTimeMs = mClocks.uptimeMillis();
+ mCpuTimeReadsTrackingStartTimeMs = mClock.uptimeMillis();
}
}
@@ -14925,7 +14897,7 @@
Slog.d(TAG, "writeSummaryToParcel duration ms:"
+ (SystemClock.uptimeMillis() - start) + " bytes:" + p.dataSize());
}
- mLastWriteTimeMs = mClocks.elapsedRealtime();
+ mLastWriteTimeMs = mClock.elapsedRealtime();
writeParcelToFileLocked(p, mStatsFile, sync);
}
@@ -15059,13 +15031,13 @@
if (mHistoryBuffer.dataPosition() > 0
|| mBatteryStatsHistory.getFilesNumbers().size() > 1) {
mRecordingHistory = true;
- final long elapsedRealtimeMs = mClocks.elapsedRealtime();
- final long uptimeMs = mClocks.uptimeMillis();
+ final long elapsedRealtimeMs = mClock.elapsedRealtime();
+ final long uptimeMs = mClock.uptimeMillis();
addHistoryBufferLocked(elapsedRealtimeMs, HistoryItem.CMD_START, mHistoryCur);
startRecordingHistory(elapsedRealtimeMs, uptimeMs, false);
}
- recordDailyStatsIfNeededLocked(false, mClocks.currentTimeMillis());
+ recordDailyStatsIfNeededLocked(false, mClock.currentTimeMillis());
}
public int describeContents() {
@@ -15117,7 +15089,7 @@
// We are just arbitrarily going to insert 1 minute from the sample of
// the last run until samples in this run.
if (mHistoryBaseTimeMs > 0) {
- long oldnow = mClocks.elapsedRealtime();
+ long oldnow = mClock.elapsedRealtime();
mHistoryBaseTimeMs = mHistoryBaseTimeMs - oldnow + 1;
if (DEBUG_HISTORY) {
StringBuilder sb = new StringBuilder(128);
@@ -15368,8 +15340,8 @@
if (NU > 10000) {
throw new ParcelFormatException("File corrupt: too many uids " + NU);
}
- final long elapsedRealtimeMs = mClocks.elapsedRealtime();
- final long uptimeMs = mClocks.uptimeMillis();
+ final long elapsedRealtimeMs = mClock.elapsedRealtime();
+ final long uptimeMs = mClock.uptimeMillis();
for (int iu = 0; iu < NU; iu++) {
int uid = in.readInt();
Uid u = new Uid(this, uid, elapsedRealtimeMs, uptimeMs);
@@ -15677,8 +15649,8 @@
// if we had originally pulled a time before the RTC was set.
getStartClockTime();
- final long NOW_SYS = mClocks.uptimeMillis() * 1000;
- final long NOWREAL_SYS = mClocks.elapsedRealtime() * 1000;
+ final long nowUptime = mClock.uptimeMillis() * 1000;
+ final long nowRealtime = mClock.elapsedRealtime() * 1000;
out.writeInt(VERSION);
@@ -15697,13 +15669,13 @@
}
out.writeInt(mStartCount);
- out.writeLong(computeUptime(NOW_SYS, STATS_SINCE_CHARGED));
- out.writeLong(computeRealtime(NOWREAL_SYS, STATS_SINCE_CHARGED));
+ out.writeLong(computeUptime(nowUptime, STATS_SINCE_CHARGED));
+ out.writeLong(computeRealtime(nowRealtime, STATS_SINCE_CHARGED));
out.writeLong(mStartClockTimeMs);
out.writeString(mStartPlatformVersion);
out.writeString(mEndPlatformVersion);
- mOnBatteryTimeBase.writeSummaryToParcel(out, NOW_SYS, NOWREAL_SYS);
- mOnBatteryScreenOffTimeBase.writeSummaryToParcel(out, NOW_SYS, NOWREAL_SYS);
+ mOnBatteryTimeBase.writeSummaryToParcel(out, nowUptime, nowRealtime);
+ mOnBatteryScreenOffTimeBase.writeSummaryToParcel(out, nowUptime, nowRealtime);
out.writeInt(mDischargeUnplugLevel);
out.writeInt(mDischargePlugLevel);
out.writeInt(mDischargeCurrentLevel);
@@ -15745,52 +15717,52 @@
MeasuredEnergyStats.writeSummaryToParcel(mGlobalMeasuredEnergyStats, out, false, false);
- mScreenOnTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
- mScreenDozeTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ mScreenOnTimer.writeSummaryFromParcelLocked(out, nowRealtime);
+ mScreenDozeTimer.writeSummaryFromParcelLocked(out, nowRealtime);
for (int i=0; i<NUM_SCREEN_BRIGHTNESS_BINS; i++) {
- mScreenBrightnessTimer[i].writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ mScreenBrightnessTimer[i].writeSummaryFromParcelLocked(out, nowRealtime);
}
- mInteractiveTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
- mPowerSaveModeEnabledTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ mInteractiveTimer.writeSummaryFromParcelLocked(out, nowRealtime);
+ mPowerSaveModeEnabledTimer.writeSummaryFromParcelLocked(out, nowRealtime);
out.writeLong(mLongestLightIdleTimeMs);
out.writeLong(mLongestFullIdleTimeMs);
- mDeviceIdleModeLightTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
- mDeviceIdleModeFullTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
- mDeviceLightIdlingTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
- mDeviceIdlingTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
- mPhoneOnTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ mDeviceIdleModeLightTimer.writeSummaryFromParcelLocked(out, nowRealtime);
+ mDeviceIdleModeFullTimer.writeSummaryFromParcelLocked(out, nowRealtime);
+ mDeviceLightIdlingTimer.writeSummaryFromParcelLocked(out, nowRealtime);
+ mDeviceIdlingTimer.writeSummaryFromParcelLocked(out, nowRealtime);
+ mPhoneOnTimer.writeSummaryFromParcelLocked(out, nowRealtime);
for (int i = 0; i < CellSignalStrength.getNumSignalStrengthLevels(); i++) {
- mPhoneSignalStrengthsTimer[i].writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ mPhoneSignalStrengthsTimer[i].writeSummaryFromParcelLocked(out, nowRealtime);
}
- mPhoneSignalScanningTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ mPhoneSignalScanningTimer.writeSummaryFromParcelLocked(out, nowRealtime);
for (int i=0; i<NUM_DATA_CONNECTION_TYPES; i++) {
- mPhoneDataConnectionsTimer[i].writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ mPhoneDataConnectionsTimer[i].writeSummaryFromParcelLocked(out, nowRealtime);
}
for (int i = 0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
mNetworkByteActivityCounters[i].writeSummaryFromParcelLocked(out);
mNetworkPacketActivityCounters[i].writeSummaryFromParcelLocked(out);
}
- mMobileRadioActiveTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
- mMobileRadioActivePerAppTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ mMobileRadioActiveTimer.writeSummaryFromParcelLocked(out, nowRealtime);
+ mMobileRadioActivePerAppTimer.writeSummaryFromParcelLocked(out, nowRealtime);
mMobileRadioActiveAdjustedTime.writeSummaryFromParcelLocked(out);
mMobileRadioActiveUnknownTime.writeSummaryFromParcelLocked(out);
mMobileRadioActiveUnknownCount.writeSummaryFromParcelLocked(out);
- mWifiMulticastWakelockTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
- mWifiOnTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
- mGlobalWifiRunningTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ mWifiMulticastWakelockTimer.writeSummaryFromParcelLocked(out, nowRealtime);
+ mWifiOnTimer.writeSummaryFromParcelLocked(out, nowRealtime);
+ mGlobalWifiRunningTimer.writeSummaryFromParcelLocked(out, nowRealtime);
for (int i=0; i<NUM_WIFI_STATES; i++) {
- mWifiStateTimer[i].writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ mWifiStateTimer[i].writeSummaryFromParcelLocked(out, nowRealtime);
}
for (int i=0; i<NUM_WIFI_SUPPL_STATES; i++) {
- mWifiSupplStateTimer[i].writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ mWifiSupplStateTimer[i].writeSummaryFromParcelLocked(out, nowRealtime);
}
for (int i=0; i<NUM_WIFI_SIGNAL_STRENGTH_BINS; i++) {
- mWifiSignalStrengthsTimer[i].writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ mWifiSignalStrengthsTimer[i].writeSummaryFromParcelLocked(out, nowRealtime);
}
- mWifiActiveTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ mWifiActiveTimer.writeSummaryFromParcelLocked(out, nowRealtime);
mWifiActivity.writeSummaryToParcel(out);
for (int i=0; i< mGpsSignalQualityTimer.length; i++) {
- mGpsSignalQualityTimer[i].writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ mGpsSignalQualityTimer[i].writeSummaryFromParcelLocked(out, nowRealtime);
}
mBluetoothActivity.writeSummaryToParcel(out);
mModemActivity.writeSummaryToParcel(out);
@@ -15799,9 +15771,9 @@
out.writeInt(mHasModemReporting ? 1 : 0);
out.writeInt(mNumConnectivityChange);
- mFlashlightOnTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
- mCameraOnTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
- mBluetoothScanTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ mFlashlightOnTimer.writeSummaryFromParcelLocked(out, nowRealtime);
+ mCameraOnTimer.writeSummaryFromParcelLocked(out, nowRealtime);
+ mBluetoothScanTimer.writeSummaryFromParcelLocked(out, nowRealtime);
out.writeInt(mRpmStats.size());
for (Map.Entry<String, SamplingTimer> ent : mRpmStats.entrySet()) {
@@ -15809,7 +15781,7 @@
if (rpmt != null) {
out.writeInt(1);
out.writeString(ent.getKey());
- rpmt.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ rpmt.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
@@ -15820,7 +15792,7 @@
if (rpmt != null) {
out.writeInt(1);
out.writeString(ent.getKey());
- rpmt.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ rpmt.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
@@ -15832,7 +15804,7 @@
if (kwlt != null) {
out.writeInt(1);
out.writeString(ent.getKey());
- kwlt.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ kwlt.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
@@ -15844,7 +15816,7 @@
if (timer != null) {
out.writeInt(1);
out.writeString(ent.getKey());
- timer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ timer.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
@@ -15856,7 +15828,7 @@
if (kmt != null) {
out.writeInt(1);
out.writeLong(mKernelMemoryStats.keyAt(i));
- kmt.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ kmt.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
@@ -15868,92 +15840,93 @@
out.writeInt(mUidStats.keyAt(iu));
Uid u = mUidStats.valueAt(iu);
- u.mOnBatteryBackgroundTimeBase.writeSummaryToParcel(out, NOW_SYS, NOWREAL_SYS);
- u.mOnBatteryScreenOffBackgroundTimeBase.writeSummaryToParcel(out, NOW_SYS, NOWREAL_SYS);
+ u.mOnBatteryBackgroundTimeBase.writeSummaryToParcel(out, nowUptime, nowRealtime);
+ u.mOnBatteryScreenOffBackgroundTimeBase.writeSummaryToParcel(out, nowUptime,
+ nowRealtime);
if (u.mWifiRunningTimer != null) {
out.writeInt(1);
- u.mWifiRunningTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ u.mWifiRunningTimer.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
if (u.mFullWifiLockTimer != null) {
out.writeInt(1);
- u.mFullWifiLockTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ u.mFullWifiLockTimer.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
if (u.mWifiScanTimer != null) {
out.writeInt(1);
- u.mWifiScanTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ u.mWifiScanTimer.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
for (int i = 0; i < Uid.NUM_WIFI_BATCHED_SCAN_BINS; i++) {
if (u.mWifiBatchedScanTimer[i] != null) {
out.writeInt(1);
- u.mWifiBatchedScanTimer[i].writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ u.mWifiBatchedScanTimer[i].writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
}
if (u.mWifiMulticastTimer != null) {
out.writeInt(1);
- u.mWifiMulticastTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ u.mWifiMulticastTimer.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
if (u.mAudioTurnedOnTimer != null) {
out.writeInt(1);
- u.mAudioTurnedOnTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ u.mAudioTurnedOnTimer.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
if (u.mVideoTurnedOnTimer != null) {
out.writeInt(1);
- u.mVideoTurnedOnTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ u.mVideoTurnedOnTimer.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
if (u.mFlashlightTurnedOnTimer != null) {
out.writeInt(1);
- u.mFlashlightTurnedOnTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ u.mFlashlightTurnedOnTimer.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
if (u.mCameraTurnedOnTimer != null) {
out.writeInt(1);
- u.mCameraTurnedOnTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ u.mCameraTurnedOnTimer.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
if (u.mForegroundActivityTimer != null) {
out.writeInt(1);
- u.mForegroundActivityTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ u.mForegroundActivityTimer.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
if (u.mForegroundServiceTimer != null) {
out.writeInt(1);
- u.mForegroundServiceTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ u.mForegroundServiceTimer.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
if (u.mAggregatedPartialWakelockTimer != null) {
out.writeInt(1);
- u.mAggregatedPartialWakelockTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ u.mAggregatedPartialWakelockTimer.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
if (u.mBluetoothScanTimer != null) {
out.writeInt(1);
- u.mBluetoothScanTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ u.mBluetoothScanTimer.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
if (u.mBluetoothUnoptimizedScanTimer != null) {
out.writeInt(1);
- u.mBluetoothUnoptimizedScanTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ u.mBluetoothUnoptimizedScanTimer.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
@@ -15972,14 +15945,14 @@
for (int i = 0; i < Uid.NUM_PROCESS_STATE; i++) {
if (u.mProcessStateTimer[i] != null) {
out.writeInt(1);
- u.mProcessStateTimer[i].writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ u.mProcessStateTimer[i].writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
}
if (u.mVibratorOnTimer != null) {
out.writeInt(1);
- u.mVibratorOnTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ u.mVibratorOnTimer.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
@@ -16078,25 +16051,25 @@
Uid.Wakelock wl = wakeStats.valueAt(iw);
if (wl.mTimerFull != null) {
out.writeInt(1);
- wl.mTimerFull.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ wl.mTimerFull.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
if (wl.mTimerPartial != null) {
out.writeInt(1);
- wl.mTimerPartial.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ wl.mTimerPartial.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
if (wl.mTimerWindow != null) {
out.writeInt(1);
- wl.mTimerWindow.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ wl.mTimerWindow.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
if (wl.mTimerDraw != null) {
out.writeInt(1);
- wl.mTimerDraw.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ wl.mTimerDraw.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
@@ -16107,7 +16080,7 @@
out.writeInt(NS);
for (int is=0; is<NS; is++) {
out.writeString(syncStats.keyAt(is));
- syncStats.valueAt(is).writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ syncStats.valueAt(is).writeSummaryFromParcelLocked(out, nowRealtime);
}
final ArrayMap<String, DualTimer> jobStats = u.mJobStats.getMap();
@@ -16115,7 +16088,7 @@
out.writeInt(NJ);
for (int ij=0; ij<NJ; ij++) {
out.writeString(jobStats.keyAt(ij));
- jobStats.valueAt(ij).writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ jobStats.valueAt(ij).writeSummaryFromParcelLocked(out, nowRealtime);
}
u.writeJobCompletionsToParcelLocked(out);
@@ -16139,7 +16112,7 @@
Uid.Sensor se = u.mSensorStats.valueAt(ise);
if (se.mTimer != null) {
out.writeInt(1);
- se.mTimer.writeSummaryFromParcelLocked(out, NOWREAL_SYS);
+ se.mTimer.writeSummaryFromParcelLocked(out, nowRealtime);
} else {
out.writeInt(0);
}
@@ -16178,7 +16151,7 @@
out.writeString(ps.mServiceStats.keyAt(is));
BatteryStatsImpl.Uid.Pkg.Serv ss = ps.mServiceStats.valueAt(is);
long time = ss.getStartTimeToNowLocked(
- mOnBatteryTimeBase.getUptime(NOW_SYS) / 1000);
+ mOnBatteryTimeBase.getUptime(nowUptime) / 1000);
out.writeLong(time);
out.writeInt(ss.mStarts);
out.writeInt(ss.mLaunches);
@@ -16221,35 +16194,35 @@
mOnBatteryScreenOffTimeBase.readFromParcel(in);
mScreenState = Display.STATE_UNKNOWN;
- mScreenOnTimer = new StopwatchTimer(mClocks, null, -1, null, mOnBatteryTimeBase, in);
- mScreenDozeTimer = new StopwatchTimer(mClocks, null, -1, null, mOnBatteryTimeBase, in);
+ mScreenOnTimer = new StopwatchTimer(mClock, null, -1, null, mOnBatteryTimeBase, in);
+ mScreenDozeTimer = new StopwatchTimer(mClock, null, -1, null, mOnBatteryTimeBase, in);
for (int i=0; i<NUM_SCREEN_BRIGHTNESS_BINS; i++) {
- mScreenBrightnessTimer[i] = new StopwatchTimer(mClocks, null, -100-i, null,
+ mScreenBrightnessTimer[i] = new StopwatchTimer(mClock, null, -100 - i, null,
mOnBatteryTimeBase, in);
}
mInteractive = false;
- mInteractiveTimer = new StopwatchTimer(mClocks, null, -10, null, mOnBatteryTimeBase, in);
+ mInteractiveTimer = new StopwatchTimer(mClock, null, -10, null, mOnBatteryTimeBase, in);
mPhoneOn = false;
- mPowerSaveModeEnabledTimer = new StopwatchTimer(mClocks, null, -2, null,
+ mPowerSaveModeEnabledTimer = new StopwatchTimer(mClock, null, -2, null,
mOnBatteryTimeBase, in);
mLongestLightIdleTimeMs = in.readLong();
mLongestFullIdleTimeMs = in.readLong();
- mDeviceIdleModeLightTimer = new StopwatchTimer(mClocks, null, -14, null,
+ mDeviceIdleModeLightTimer = new StopwatchTimer(mClock, null, -14, null,
mOnBatteryTimeBase, in);
- mDeviceIdleModeFullTimer = new StopwatchTimer(mClocks, null, -11, null,
+ mDeviceIdleModeFullTimer = new StopwatchTimer(mClock, null, -11, null,
mOnBatteryTimeBase, in);
- mDeviceLightIdlingTimer = new StopwatchTimer(mClocks, null, -15, null,
+ mDeviceLightIdlingTimer = new StopwatchTimer(mClock, null, -15, null,
mOnBatteryTimeBase, in);
- mDeviceIdlingTimer = new StopwatchTimer(mClocks, null, -12, null, mOnBatteryTimeBase, in);
- mPhoneOnTimer = new StopwatchTimer(mClocks, null, -3, null, mOnBatteryTimeBase, in);
+ mDeviceIdlingTimer = new StopwatchTimer(mClock, null, -12, null, mOnBatteryTimeBase, in);
+ mPhoneOnTimer = new StopwatchTimer(mClock, null, -3, null, mOnBatteryTimeBase, in);
for (int i = 0; i < CellSignalStrength.getNumSignalStrengthLevels(); i++) {
- mPhoneSignalStrengthsTimer[i] = new StopwatchTimer(mClocks, null, -200-i,
+ mPhoneSignalStrengthsTimer[i] = new StopwatchTimer(mClock, null, -200 - i,
null, mOnBatteryTimeBase, in);
}
- mPhoneSignalScanningTimer = new StopwatchTimer(mClocks, null, -200+1, null,
+ mPhoneSignalScanningTimer = new StopwatchTimer(mClock, null, -200 + 1, null,
mOnBatteryTimeBase, in);
for (int i=0; i<NUM_DATA_CONNECTION_TYPES; i++) {
- mPhoneDataConnectionsTimer[i] = new StopwatchTimer(mClocks, null, -300-i,
+ mPhoneDataConnectionsTimer[i] = new StopwatchTimer(mClock, null, -300 - i,
null, mOnBatteryTimeBase, in);
}
for (int i = 0; i < NUM_NETWORK_ACTIVITY_TYPES; i++) {
@@ -16257,39 +16230,39 @@
mNetworkPacketActivityCounters[i] = new LongSamplingCounter(mOnBatteryTimeBase, in);
}
mMobileRadioPowerState = DataConnectionRealTimeInfo.DC_POWER_STATE_LOW;
- mMobileRadioActiveTimer = new StopwatchTimer(mClocks, null, -400, null,
+ mMobileRadioActiveTimer = new StopwatchTimer(mClock, null, -400, null,
mOnBatteryTimeBase, in);
- mMobileRadioActivePerAppTimer = new StopwatchTimer(mClocks, null, -401, null,
+ mMobileRadioActivePerAppTimer = new StopwatchTimer(mClock, null, -401, null,
mOnBatteryTimeBase, in);
mMobileRadioActiveAdjustedTime = new LongSamplingCounter(mOnBatteryTimeBase, in);
mMobileRadioActiveUnknownTime = new LongSamplingCounter(mOnBatteryTimeBase, in);
mMobileRadioActiveUnknownCount = new LongSamplingCounter(mOnBatteryTimeBase, in);
- mWifiMulticastWakelockTimer = new StopwatchTimer(mClocks, null, -4, null,
+ mWifiMulticastWakelockTimer = new StopwatchTimer(mClock, null, -4, null,
mOnBatteryTimeBase, in);
mWifiRadioPowerState = DataConnectionRealTimeInfo.DC_POWER_STATE_LOW;
mWifiOn = false;
- mWifiOnTimer = new StopwatchTimer(mClocks, null, -4, null, mOnBatteryTimeBase, in);
+ mWifiOnTimer = new StopwatchTimer(mClock, null, -4, null, mOnBatteryTimeBase, in);
mGlobalWifiRunning = false;
- mGlobalWifiRunningTimer = new StopwatchTimer(mClocks, null, -5, null,
+ mGlobalWifiRunningTimer = new StopwatchTimer(mClock, null, -5, null,
mOnBatteryTimeBase, in);
for (int i=0; i<NUM_WIFI_STATES; i++) {
- mWifiStateTimer[i] = new StopwatchTimer(mClocks, null, -600-i,
+ mWifiStateTimer[i] = new StopwatchTimer(mClock, null, -600 - i,
null, mOnBatteryTimeBase, in);
}
for (int i=0; i<NUM_WIFI_SUPPL_STATES; i++) {
- mWifiSupplStateTimer[i] = new StopwatchTimer(mClocks, null, -700-i,
+ mWifiSupplStateTimer[i] = new StopwatchTimer(mClock, null, -700 - i,
null, mOnBatteryTimeBase, in);
}
for (int i=0; i<NUM_WIFI_SIGNAL_STRENGTH_BINS; i++) {
- mWifiSignalStrengthsTimer[i] = new StopwatchTimer(mClocks, null, -800-i,
+ mWifiSignalStrengthsTimer[i] = new StopwatchTimer(mClock, null, -800 - i,
null, mOnBatteryTimeBase, in);
}
- mWifiActiveTimer = new StopwatchTimer(mClocks, null, -900, null,
+ mWifiActiveTimer = new StopwatchTimer(mClock, null, -900, null,
mOnBatteryTimeBase, in);
mWifiActivity = new ControllerActivityCounterImpl(mOnBatteryTimeBase,
NUM_WIFI_TX_LEVELS, in);
for (int i=0; i<mGpsSignalQualityTimer.length; i++) {
- mGpsSignalQualityTimer[i] = new StopwatchTimer(mClocks, null, -1000-i,
+ mGpsSignalQualityTimer[i] = new StopwatchTimer(mClock, null, -1000 - i,
null, mOnBatteryTimeBase, in);
}
mBluetoothActivity = new ControllerActivityCounterImpl(mOnBatteryTimeBase,
@@ -16303,15 +16276,15 @@
mNumConnectivityChange = in.readInt();
mAudioOnNesting = 0;
// TODO: It's likely a mistake that mAudioOnTimer/mVideoOnTimer don't write/read to parcel!
- mAudioOnTimer = new StopwatchTimer(mClocks, null, -7, null, mOnBatteryTimeBase);
+ mAudioOnTimer = new StopwatchTimer(mClock, null, -7, null, mOnBatteryTimeBase);
mVideoOnNesting = 0;
- mVideoOnTimer = new StopwatchTimer(mClocks, null, -8, null, mOnBatteryTimeBase);
+ mVideoOnTimer = new StopwatchTimer(mClock, null, -8, null, mOnBatteryTimeBase);
mFlashlightOnNesting = 0;
- mFlashlightOnTimer = new StopwatchTimer(mClocks, null, -9, null, mOnBatteryTimeBase, in);
+ mFlashlightOnTimer = new StopwatchTimer(mClock, null, -9, null, mOnBatteryTimeBase, in);
mCameraOnNesting = 0;
- mCameraOnTimer = new StopwatchTimer(mClocks, null, -13, null, mOnBatteryTimeBase, in);
+ mCameraOnTimer = new StopwatchTimer(mClock, null, -13, null, mOnBatteryTimeBase, in);
mBluetoothScanNesting = 0;
- mBluetoothScanTimer = new StopwatchTimer(mClocks, null, -14, null, mOnBatteryTimeBase, in);
+ mBluetoothScanTimer = new StopwatchTimer(mClock, null, -14, null, mOnBatteryTimeBase, in);
mDischargeUnplugLevel = in.readInt();
mDischargePlugLevel = in.readInt();
mDischargeCurrentLevel = in.readInt();
@@ -16343,7 +16316,7 @@
for (int irpm = 0; irpm < NRPMS; irpm++) {
if (in.readInt() != 0) {
String rpmName = in.readString();
- SamplingTimer rpmt = new SamplingTimer(mClocks, mOnBatteryTimeBase, in);
+ SamplingTimer rpmt = new SamplingTimer(mClock, mOnBatteryTimeBase, in);
mRpmStats.put(rpmName, rpmt);
}
}
@@ -16352,7 +16325,7 @@
for (int irpm = 0; irpm < NSORPMS; irpm++) {
if (in.readInt() != 0) {
String rpmName = in.readString();
- SamplingTimer rpmt = new SamplingTimer(mClocks, mOnBatteryScreenOffTimeBase, in);
+ SamplingTimer rpmt = new SamplingTimer(mClock, mOnBatteryScreenOffTimeBase, in);
mScreenOffRpmStats.put(rpmName, rpmt);
}
}
@@ -16362,7 +16335,7 @@
for (int ikw = 0; ikw < NKW; ikw++) {
if (in.readInt() != 0) {
String wakelockName = in.readString();
- SamplingTimer kwlt = new SamplingTimer(mClocks, mOnBatteryScreenOffTimeBase, in);
+ SamplingTimer kwlt = new SamplingTimer(mClock, mOnBatteryScreenOffTimeBase, in);
mKernelWakelockStats.put(wakelockName, kwlt);
}
}
@@ -16372,7 +16345,7 @@
for (int iwr = 0; iwr < NWR; iwr++) {
if (in.readInt() != 0) {
String reasonName = in.readString();
- SamplingTimer timer = new SamplingTimer(mClocks, mOnBatteryTimeBase, in);
+ SamplingTimer timer = new SamplingTimer(mClock, mOnBatteryTimeBase, in);
mWakeupReasonStats.put(reasonName, timer);
}
}
@@ -16382,7 +16355,7 @@
for (int imt = 0; imt < nmt; imt++) {
if (in.readInt() != 0) {
Long bucket = in.readLong();
- SamplingTimer kmt = new SamplingTimer(mClocks, mOnBatteryTimeBase, in);
+ SamplingTimer kmt = new SamplingTimer(mClock, mOnBatteryTimeBase, in);
mKernelMemoryStats.put(bucket, kmt);
}
}
@@ -16402,8 +16375,8 @@
int numUids = in.readInt();
mUidStats.clear();
- final long elapsedRealtimeMs = mClocks.elapsedRealtime();
- final long uptimeMs = mClocks.uptimeMillis();
+ final long elapsedRealtimeMs = mClock.elapsedRealtime();
+ final long uptimeMs = mClock.uptimeMillis();
for (int i = 0; i < numUids; i++) {
int uid = in.readInt();
Uid u = new Uid(this, uid, elapsedRealtimeMs, uptimeMs);
@@ -16433,8 +16406,8 @@
// if we had originally pulled a time before the RTC was set.
getStartClockTime();
- final long uSecUptime = mClocks.uptimeMillis() * 1000;
- final long uSecRealtime = mClocks.elapsedRealtime() * 1000;
+ final long uSecUptime = mClock.uptimeMillis() * 1000;
+ final long uSecRealtime = mClock.elapsedRealtime() * 1000;
final long batteryRealtime = mOnBatteryTimeBase.getRealtime(uSecRealtime);
final long batteryScreenOffRealtime = mOnBatteryScreenOffTimeBase.getRealtime(uSecRealtime);
@@ -16790,7 +16763,7 @@
pw.print("Batched cpu time reads: ");
pw.println(mNumBatchedSingleUidCpuTimeReads);
pw.print("Batching Duration (min): ");
- pw.println((mClocks.uptimeMillis() - mCpuTimeReadsTrackingStartTimeMs) / (60 * 1000));
+ pw.println((mClock.uptimeMillis() - mCpuTimeReadsTrackingStartTimeMs) / (60 * 1000));
pw.print("All UID cpu time reads since the later of device start or stats reset: ");
pw.println(mNumAllUidCpuTimeReads);
pw.print("UIDs removed since the later of device start or stats reset: ");
diff --git a/core/java/com/android/internal/os/BatteryUsageStatsProvider.java b/core/java/com/android/internal/os/BatteryUsageStatsProvider.java
index 0038579..c0a22e0 100644
--- a/core/java/com/android/internal/os/BatteryUsageStatsProvider.java
+++ b/core/java/com/android/internal/os/BatteryUsageStatsProvider.java
@@ -256,7 +256,7 @@
private long elapsedRealtime() {
if (mStats instanceof BatteryStatsImpl) {
- return ((BatteryStatsImpl) mStats).mClocks.elapsedRealtime();
+ return ((BatteryStatsImpl) mStats).mClock.elapsedRealtime();
} else {
return SystemClock.elapsedRealtime();
}
@@ -264,7 +264,7 @@
private long uptimeMillis() {
if (mStats instanceof BatteryStatsImpl) {
- return ((BatteryStatsImpl) mStats).mClocks.uptimeMillis();
+ return ((BatteryStatsImpl) mStats).mClock.uptimeMillis();
} else {
return SystemClock.uptimeMillis();
}
@@ -272,7 +272,7 @@
private long currentTimeMillis() {
if (mStats instanceof BatteryStatsImpl) {
- return ((BatteryStatsImpl) mStats).mClocks.currentTimeMillis();
+ return ((BatteryStatsImpl) mStats).mClock.currentTimeMillis();
} else {
return System.currentTimeMillis();
}
diff --git a/core/java/com/android/internal/os/BinderCallsStats.java b/core/java/com/android/internal/os/BinderCallsStats.java
index 6ce7cea..be91aac 100644
--- a/core/java/com/android/internal/os/BinderCallsStats.java
+++ b/core/java/com/android/internal/os/BinderCallsStats.java
@@ -220,8 +220,9 @@
public CallSession callStarted(Binder binder, int code, int workSourceUid) {
noteNativeThreadId();
+ boolean collectCpu = canCollect();
// We always want to collect data for latency if it's enabled, regardless of device state.
- if (!mCollectLatencyData && !canCollect()) {
+ if (!mCollectLatencyData && !collectCpu) {
return null;
}
@@ -233,7 +234,7 @@
s.timeStarted = -1;
s.recordedCall = shouldRecordDetailedData();
- if (mRecordingAllTransactionsForUid || s.recordedCall) {
+ if (collectCpu && (mRecordingAllTransactionsForUid || s.recordedCall)) {
s.cpuTimeStarted = getThreadTimeMicro();
s.timeStarted = getElapsedRealtimeMicro();
} else if (mCollectLatencyData) {
diff --git a/core/java/com/android/internal/os/Clock.java b/core/java/com/android/internal/os/Clock.java
new file mode 100644
index 0000000..45007c4
--- /dev/null
+++ b/core/java/com/android/internal/os/Clock.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.internal.os;
+
+import android.os.SystemClock;
+
+/**
+ * A wrapper for SystemClock, intended for mocking in unit tests.
+ */
+public abstract class Clock {
+ /** Elapsed Realtime, see SystemClock.elapsedRealtime() */
+ public long elapsedRealtime() {
+ throw new UnsupportedOperationException();
+ }
+
+ /** Uptime, see SystemClock.uptimeMillis() */
+ public long uptimeMillis() {
+ throw new UnsupportedOperationException();
+ }
+
+ /** Wall-clock time as per System.currentTimeMillis() */
+ public long currentTimeMillis() {
+ throw new UnsupportedOperationException();
+ }
+
+ public static final Clock SYSTEM_CLOCK = new Clock() {
+
+ @Override
+ public long elapsedRealtime() {
+ return SystemClock.elapsedRealtime();
+ }
+
+ @Override
+ public long uptimeMillis() {
+ return SystemClock.uptimeMillis();
+ }
+
+ @Override
+ public long currentTimeMillis() {
+ return System.currentTimeMillis();
+ }
+ };
+}
diff --git a/core/java/com/android/internal/os/KernelCpuProcStringReader.java b/core/java/com/android/internal/os/KernelCpuProcStringReader.java
index b3aec0c..b04fd47 100644
--- a/core/java/com/android/internal/os/KernelCpuProcStringReader.java
+++ b/core/java/com/android/internal/os/KernelCpuProcStringReader.java
@@ -17,7 +17,6 @@
package com.android.internal.os;
import android.os.StrictMode;
-import android.os.SystemClock;
import android.util.Slog;
import java.io.BufferedReader;
@@ -89,6 +88,7 @@
private int mErrors = 0;
private final Path mFile;
+ private final Clock mClock;
private char[] mBuf;
private int mSize;
private long mLastReadTime = 0;
@@ -97,7 +97,12 @@
private final ReentrantReadWriteLock.WriteLock mWriteLock = mLock.writeLock();
public KernelCpuProcStringReader(String file) {
+ this(file, Clock.SYSTEM_CLOCK);
+ }
+
+ public KernelCpuProcStringReader(String file, Clock clock) {
mFile = Paths.get(file);
+ mClock = clock;
}
/**
@@ -168,7 +173,7 @@
}
}
mSize = total;
- mLastReadTime = SystemClock.elapsedRealtime();
+ mLastReadTime = mClock.elapsedRealtime();
// ReentrantReadWriteLock allows lock downgrading.
mReadLock.lock();
return new ProcFileIterator(total);
@@ -186,7 +191,7 @@
}
private boolean dataValid() {
- return mSize > 0 && (SystemClock.elapsedRealtime() - mLastReadTime < FRESHNESS);
+ return mSize > 0 && (mClock.elapsedRealtime() - mLastReadTime < FRESHNESS);
}
/**
diff --git a/core/java/com/android/internal/os/KernelCpuUidTimeReader.java b/core/java/com/android/internal/os/KernelCpuUidTimeReader.java
index 50df166..faeb8fc 100644
--- a/core/java/com/android/internal/os/KernelCpuUidTimeReader.java
+++ b/core/java/com/android/internal/os/KernelCpuUidTimeReader.java
@@ -21,7 +21,6 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.StrictMode;
-import android.os.SystemClock;
import android.util.IntArray;
import android.util.Slog;
import android.util.SparseArray;
@@ -60,6 +59,7 @@
final boolean mThrottle;
protected boolean mBpfTimesAvailable;
final KernelCpuUidBpfMapReader mBpfReader;
+ private final Clock mClock;
private long mMinTimeBetweenRead = DEFAULT_MIN_TIME_BETWEEN_READ;
private long mLastReadTimeMs = 0;
@@ -76,15 +76,17 @@
void onUidCpuTime(int uid, T time);
}
- KernelCpuUidTimeReader(KernelCpuProcStringReader reader, @Nullable KernelCpuUidBpfMapReader bpfReader, boolean throttle) {
+ KernelCpuUidTimeReader(KernelCpuProcStringReader reader,
+ @Nullable KernelCpuUidBpfMapReader bpfReader, boolean throttle, Clock clock) {
mReader = reader;
mThrottle = throttle;
mBpfReader = bpfReader;
+ mClock = clock;
mBpfTimesAvailable = (mBpfReader != null);
}
- KernelCpuUidTimeReader(KernelCpuProcStringReader reader, boolean throttle) {
- this(reader, null, throttle);
+ KernelCpuUidTimeReader(KernelCpuProcStringReader reader, boolean throttle, Clock clock) {
+ this(reader, null, throttle, clock);
}
/**
@@ -104,17 +106,17 @@
*/
public void readDelta(boolean force, @Nullable Callback<T> cb) {
if (!mThrottle) {
- readDeltaImpl(cb);
+ readDeltaImpl(cb, force);
return;
}
- final long currTimeMs = SystemClock.elapsedRealtime();
+ final long currTimeMs = mClock.elapsedRealtime();
if (!force && currTimeMs < mLastReadTimeMs + mMinTimeBetweenRead) {
if (DEBUG) {
Slog.d(mTag, "Throttle readDelta");
}
return;
}
- readDeltaImpl(cb);
+ readDeltaImpl(cb, force);
mLastReadTimeMs = currTimeMs;
}
@@ -128,7 +130,7 @@
readAbsoluteImpl(cb);
return;
}
- final long currTimeMs = SystemClock.elapsedRealtime();
+ final long currTimeMs = mClock.elapsedRealtime();
if (currTimeMs < mLastReadTimeMs + mMinTimeBetweenRead) {
if (DEBUG) {
Slog.d(mTag, "Throttle readAbsolute");
@@ -139,7 +141,7 @@
mLastReadTimeMs = currTimeMs;
}
- abstract void readDeltaImpl(@Nullable Callback<T> cb);
+ abstract void readDeltaImpl(@Nullable Callback<T> cb, boolean forceRead);
abstract void readAbsoluteImpl(Callback<T> callback);
@@ -216,17 +218,22 @@
private final long[] mUsrSysTime = new long[2];
public KernelCpuUidUserSysTimeReader(boolean throttle) {
- super(KernelCpuProcStringReader.getUserSysTimeReaderInstance(), throttle);
+ this(throttle, Clock.SYSTEM_CLOCK);
+ }
+
+ public KernelCpuUidUserSysTimeReader(boolean throttle, Clock clock) {
+ super(KernelCpuProcStringReader.getUserSysTimeReaderInstance(), throttle, clock);
}
@VisibleForTesting
- public KernelCpuUidUserSysTimeReader(KernelCpuProcStringReader reader, boolean throttle) {
- super(reader, throttle);
+ public KernelCpuUidUserSysTimeReader(KernelCpuProcStringReader reader, boolean throttle,
+ Clock clock) {
+ super(reader, throttle, clock);
}
@Override
- void readDeltaImpl(@Nullable Callback<long[]> cb) {
- try (ProcFileIterator iter = mReader.open(!mThrottle)) {
+ void readDeltaImpl(@Nullable Callback<long[]> cb, boolean forceRead) {
+ try (ProcFileIterator iter = mReader.open(!mThrottle || forceRead)) {
if (iter == null) {
return;
}
@@ -348,14 +355,23 @@
private boolean mAllUidTimesAvailable = true;
public KernelCpuUidFreqTimeReader(boolean throttle) {
+ this(throttle, Clock.SYSTEM_CLOCK);
+ }
+
+ public KernelCpuUidFreqTimeReader(boolean throttle, Clock clock) {
this(UID_TIMES_PROC_FILE, KernelCpuProcStringReader.getFreqTimeReaderInstance(),
- KernelCpuUidBpfMapReader.getFreqTimeReaderInstance(), throttle);
+ KernelCpuUidBpfMapReader.getFreqTimeReaderInstance(), throttle, clock);
}
@VisibleForTesting
public KernelCpuUidFreqTimeReader(String procFile, KernelCpuProcStringReader reader,
KernelCpuUidBpfMapReader bpfReader, boolean throttle) {
- super(reader, bpfReader, throttle);
+ this(procFile, reader, bpfReader, throttle, Clock.SYSTEM_CLOCK);
+ }
+
+ private KernelCpuUidFreqTimeReader(String procFile, KernelCpuProcStringReader reader,
+ KernelCpuUidBpfMapReader bpfReader, boolean throttle, Clock clock) {
+ super(reader, bpfReader, throttle, clock);
mProcFilePath = Paths.get(procFile);
}
@@ -496,7 +512,7 @@
}
@Override
- void readDeltaImpl(@Nullable Callback<long[]> cb) {
+ void readDeltaImpl(@Nullable Callback<long[]> cb, boolean forceRead) {
if (mBpfTimesAvailable) {
try (BpfMapIterator iter = mBpfReader.open(!mThrottle)) {
if (checkPrecondition(iter)) {
@@ -628,13 +644,18 @@
private long[] mBuffer;
public KernelCpuUidActiveTimeReader(boolean throttle) {
+ this(throttle, Clock.SYSTEM_CLOCK);
+ }
+
+ public KernelCpuUidActiveTimeReader(boolean throttle, Clock clock) {
super(KernelCpuProcStringReader.getActiveTimeReaderInstance(),
- KernelCpuUidBpfMapReader.getActiveTimeReaderInstance(), throttle);
+ KernelCpuUidBpfMapReader.getActiveTimeReaderInstance(), throttle, clock);
}
@VisibleForTesting
- public KernelCpuUidActiveTimeReader(KernelCpuProcStringReader reader, KernelCpuUidBpfMapReader bpfReader, boolean throttle) {
- super(reader, bpfReader, throttle);
+ public KernelCpuUidActiveTimeReader(KernelCpuProcStringReader reader,
+ KernelCpuUidBpfMapReader bpfReader, boolean throttle) {
+ super(reader, bpfReader, throttle, Clock.SYSTEM_CLOCK);
}
private void processUidDelta(@Nullable Callback<Long> cb) {
@@ -655,7 +676,7 @@
}
@Override
- void readDeltaImpl(@Nullable Callback<Long> cb) {
+ void readDeltaImpl(@Nullable Callback<Long> cb, boolean forceRead) {
if (mBpfTimesAvailable) {
try (BpfMapIterator iter = mBpfReader.open(!mThrottle)) {
if (checkPrecondition(iter)) {
@@ -800,14 +821,18 @@
private long[] mDeltaTime;
public KernelCpuUidClusterTimeReader(boolean throttle) {
+ this(throttle, Clock.SYSTEM_CLOCK);
+ }
+
+ public KernelCpuUidClusterTimeReader(boolean throttle, Clock clock) {
super(KernelCpuProcStringReader.getClusterTimeReaderInstance(),
- KernelCpuUidBpfMapReader.getClusterTimeReaderInstance(), throttle);
+ KernelCpuUidBpfMapReader.getClusterTimeReaderInstance(), throttle, clock);
}
@VisibleForTesting
public KernelCpuUidClusterTimeReader(KernelCpuProcStringReader reader,
- KernelCpuUidBpfMapReader bpfReader, boolean throttle) {
- super(reader, bpfReader, throttle);
+ KernelCpuUidBpfMapReader bpfReader, boolean throttle) {
+ super(reader, bpfReader, throttle, Clock.SYSTEM_CLOCK);
}
void processUidDelta(@Nullable Callback<long[]> cb) {
@@ -838,7 +863,7 @@
}
@Override
- void readDeltaImpl(@Nullable Callback<long[]> cb) {
+ void readDeltaImpl(@Nullable Callback<long[]> cb, boolean forceRead) {
if (mBpfTimesAvailable) {
try (BpfMapIterator iter = mBpfReader.open(!mThrottle)) {
if (checkPrecondition(iter)) {
diff --git a/core/java/com/android/internal/view/IInputConnectionWrapper.java b/core/java/com/android/internal/view/IInputConnectionWrapper.java
index 4607129..fdbbf97 100644
--- a/core/java/com/android/internal/view/IInputConnectionWrapper.java
+++ b/core/java/com/android/internal/view/IInputConnectionWrapper.java
@@ -16,13 +16,14 @@
package com.android.internal.view;
+import android.annotation.AnyThread;
+import android.annotation.BinderThread;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
-import android.os.RemoteException;
import android.os.Trace;
import android.util.Log;
import android.util.proto.ProtoOutputStream;
@@ -41,14 +42,12 @@
import android.view.inputmethod.SurroundingText;
import com.android.internal.annotations.GuardedBy;
-import com.android.internal.inputmethod.IBooleanResultCallback;
-import com.android.internal.inputmethod.ICharSequenceResultCallback;
-import com.android.internal.inputmethod.IExtractedTextResultCallback;
-import com.android.internal.inputmethod.IIntResultCallback;
-import com.android.internal.inputmethod.ISurroundingTextResultCallback;
+import com.android.internal.inputmethod.CallbackUtils;
import com.android.internal.inputmethod.ImeTracing;
+import com.android.internal.inputmethod.InputConnectionCommand;
+import com.android.internal.inputmethod.InputConnectionCommandType;
import com.android.internal.inputmethod.InputConnectionProtoDumper;
-import com.android.internal.os.SomeArgs;
+import com.android.internal.inputmethod.InputMethodDebug;
import java.lang.ref.WeakReference;
@@ -56,34 +55,8 @@
private static final String TAG = "IInputConnectionWrapper";
private static final boolean DEBUG = false;
- private static final int DO_GET_TEXT_AFTER_CURSOR = 10;
- private static final int DO_GET_TEXT_BEFORE_CURSOR = 20;
- private static final int DO_GET_SELECTED_TEXT = 25;
- private static final int DO_GET_CURSOR_CAPS_MODE = 30;
- private static final int DO_GET_EXTRACTED_TEXT = 40;
- private static final int DO_COMMIT_TEXT = 50;
- private static final int DO_COMMIT_COMPLETION = 55;
- private static final int DO_COMMIT_CORRECTION = 56;
- private static final int DO_SET_SELECTION = 57;
- private static final int DO_PERFORM_EDITOR_ACTION = 58;
- private static final int DO_PERFORM_CONTEXT_MENU_ACTION = 59;
- private static final int DO_SET_COMPOSING_TEXT = 60;
- private static final int DO_SET_COMPOSING_REGION = 63;
- private static final int DO_FINISH_COMPOSING_TEXT = 65;
- private static final int DO_SEND_KEY_EVENT = 70;
- private static final int DO_DELETE_SURROUNDING_TEXT = 80;
- private static final int DO_DELETE_SURROUNDING_TEXT_IN_CODE_POINTS = 81;
- private static final int DO_BEGIN_BATCH_EDIT = 90;
- private static final int DO_END_BATCH_EDIT = 95;
- private static final int DO_PERFORM_SPELL_CHECK = 110;
- private static final int DO_PERFORM_PRIVATE_COMMAND = 120;
- private static final int DO_CLEAR_META_KEY_STATES = 130;
- private static final int DO_REQUEST_CURSOR_UPDATES = 140;
- private static final int DO_CLOSE_CONNECTION = 150;
- private static final int DO_COMMIT_CONTENT = 160;
- private static final int DO_GET_SURROUNDING_TEXT = 41;
- private static final int DO_SET_IME_CONSUMES_INPUT = 170;
-
+ private static final int DO_EDIT = 10;
+ private static final int DO_CLOSE_CONNECTION = 20;
@GuardedBy("mLock")
@Nullable
@@ -147,7 +120,7 @@
// reportFinish() will take effect.
return;
}
- closeConnection();
+ dispatchMessage(mH.obtainMessage(DO_CLOSE_CONNECTION));
// Notify the app that the InputConnection was closed.
final View servedView = mServedView.get();
@@ -192,146 +165,33 @@
}
}
- public void getTextAfterCursor(int length, int flags, ICharSequenceResultCallback callback) {
- dispatchMessage(mH.obtainMessage(DO_GET_TEXT_AFTER_CURSOR, length, flags, callback));
- }
-
- public void getTextBeforeCursor(int length, int flags, ICharSequenceResultCallback callback) {
- dispatchMessage(mH.obtainMessage(DO_GET_TEXT_BEFORE_CURSOR, length, flags, callback));
- }
-
- public void getSelectedText(int flags, ICharSequenceResultCallback callback) {
- dispatchMessage(mH.obtainMessage(DO_GET_SELECTED_TEXT, flags, 0 /* unused */, callback));
+ @BinderThread
+ @Override
+ public void doEdit(@Nullable InputConnectionCommand command) {
+ if (command == null) {
+ // As long as everything is working as expected, we should never see any null object
+ // here. If we are seeing null object, it means that either the sender or
+ // InputConnectionCommand.CREATOR#createFromParcel() returned null for whatever
+ // unexpected reasons. Note that InputConnectionCommand.CREATOR#createFromParcel() does
+ // some data verifications. Hence failing to pass the verification is one of the
+ // reasons to see null here.
+ Log.w(TAG, "Ignoring invalid InputConnectionCommand.");
+ return;
+ }
+ if (DEBUG) {
+ Log.d(TAG, "incoming: " + InputMethodDebug.dumpInputConnectionCommand(command));
+ }
+ dispatchMessage(mH.obtainMessage(DO_EDIT, command));
}
/**
- * Dispatches the request for retrieving surrounding text.
- *
- * <p>See {@link InputConnection#getSurroundingText(int, int, int)}.
+ * Exposed for {@link InputMethodManager} to trigger
+ * {@link InputConnection#finishComposingText()}.
*/
- public void getSurroundingText(int beforeLength, int afterLength, int flags,
- ISurroundingTextResultCallback callback) {
- final SomeArgs args = SomeArgs.obtain();
- args.arg1 = beforeLength;
- args.arg2 = afterLength;
- args.arg3 = flags;
- args.arg4 = callback;
- dispatchMessage(mH.obtainMessage(DO_GET_SURROUNDING_TEXT, flags, 0 /* unused */, args));
- }
-
- public void getCursorCapsMode(int reqModes, IIntResultCallback callback) {
- dispatchMessage(
- mH.obtainMessage(DO_GET_CURSOR_CAPS_MODE, reqModes, 0 /* unused */, callback));
- }
-
- public void getExtractedText(ExtractedTextRequest request, int flags,
- IExtractedTextResultCallback callback) {
- final SomeArgs args = SomeArgs.obtain();
- args.arg1 = request;
- args.arg2 = callback;
- dispatchMessage(mH.obtainMessage(DO_GET_EXTRACTED_TEXT, flags, 0 /* unused */, args));
- }
-
- public void commitText(CharSequence text, int newCursorPosition) {
- dispatchMessage(obtainMessageIO(DO_COMMIT_TEXT, newCursorPosition, text));
- }
-
- public void commitCompletion(CompletionInfo text) {
- dispatchMessage(obtainMessageO(DO_COMMIT_COMPLETION, text));
- }
-
- public void commitCorrection(CorrectionInfo info) {
- dispatchMessage(obtainMessageO(DO_COMMIT_CORRECTION, info));
- }
-
- public void setSelection(int start, int end) {
- dispatchMessage(obtainMessageII(DO_SET_SELECTION, start, end));
- }
-
- public void performEditorAction(int id) {
- dispatchMessage(obtainMessageII(DO_PERFORM_EDITOR_ACTION, id, 0));
- }
-
- public void performContextMenuAction(int id) {
- dispatchMessage(obtainMessageII(DO_PERFORM_CONTEXT_MENU_ACTION, id, 0));
- }
-
- public void setComposingRegion(int start, int end) {
- dispatchMessage(obtainMessageII(DO_SET_COMPOSING_REGION, start, end));
- }
-
- public void setComposingText(CharSequence text, int newCursorPosition) {
- dispatchMessage(obtainMessageIO(DO_SET_COMPOSING_TEXT, newCursorPosition, text));
- }
-
+ @AnyThread
public void finishComposingText() {
- dispatchMessage(obtainMessage(DO_FINISH_COMPOSING_TEXT));
- }
-
- public void sendKeyEvent(KeyEvent event) {
- dispatchMessage(obtainMessageO(DO_SEND_KEY_EVENT, event));
- }
-
- public void clearMetaKeyStates(int states) {
- dispatchMessage(obtainMessageII(DO_CLEAR_META_KEY_STATES, states, 0));
- }
-
- public void deleteSurroundingText(int beforeLength, int afterLength) {
- dispatchMessage(obtainMessageII(DO_DELETE_SURROUNDING_TEXT,
- beforeLength, afterLength));
- }
-
- public void deleteSurroundingTextInCodePoints(int beforeLength, int afterLength) {
- dispatchMessage(obtainMessageII(DO_DELETE_SURROUNDING_TEXT_IN_CODE_POINTS,
- beforeLength, afterLength));
- }
-
- public void beginBatchEdit() {
- dispatchMessage(obtainMessage(DO_BEGIN_BATCH_EDIT));
- }
-
- public void endBatchEdit() {
- dispatchMessage(obtainMessage(DO_END_BATCH_EDIT));
- }
-
- /**
- * Dispatches the request for performing spell check.
- *
- * @see InputConnection#performSpellCheck()
- */
- public void performSpellCheck() {
- dispatchMessage(obtainMessage(DO_PERFORM_SPELL_CHECK));
- }
-
- public void performPrivateCommand(String action, Bundle data) {
- dispatchMessage(obtainMessageOO(DO_PERFORM_PRIVATE_COMMAND, action, data));
- }
-
- public void requestCursorUpdates(int cursorUpdateMode, IBooleanResultCallback callback) {
- dispatchMessage(mH.obtainMessage(DO_REQUEST_CURSOR_UPDATES, cursorUpdateMode,
- 0 /* unused */, callback));
- }
-
- public void closeConnection() {
- dispatchMessage(obtainMessage(DO_CLOSE_CONNECTION));
- }
-
- public void commitContent(InputContentInfo inputContentInfo, int flags, Bundle opts,
- IBooleanResultCallback callback) {
- final SomeArgs args = SomeArgs.obtain();
- args.arg1 = inputContentInfo;
- args.arg2 = opts;
- args.arg3 = callback;
- dispatchMessage(mH.obtainMessage(DO_COMMIT_CONTENT, flags, 0 /* unused */, args));
- }
-
- /**
- * Dispatches the request for setting ime consumes input.
- *
- * <p>See {@link InputConnection#setImeConsumesInput(boolean)}.
- */
- public void setImeConsumesInput(boolean imeConsumesInput) {
- dispatchMessage(obtainMessageB(DO_SET_IME_CONSUMES_INPUT, imeConsumesInput));
+ dispatchMessage(mH.obtainMessage(DO_EDIT, InputConnectionCommand.create(
+ InputConnectionCommandType.FINISH_COMPOSING_TEXT)));
}
void dispatchMessage(Message msg) {
@@ -347,108 +207,131 @@
mH.sendMessage(msg);
}
- void executeMessage(Message msg) {
- byte[] icProto;
+ private void executeMessage(Message msg) {
switch (msg.what) {
- case DO_GET_TEXT_AFTER_CURSOR: {
+ case DO_EDIT:
+ doEditMain((InputConnectionCommand) msg.obj);
+ break;
+ case DO_CLOSE_CONNECTION:
+ // Note that we do not need to worry about race condition here, because 1) mFinished
+ // is updated only inside this block, and 2) the code here is running on a Handler
+ // hence we assume multiple DO_CLOSE_CONNECTION messages will not be handled at the
+ // same time.
+ if (isFinished()) {
+ return;
+ }
+ Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#closeConnection");
+ try {
+ InputConnection ic = getInputConnection();
+ // Note we do NOT check isActive() here, because this is safe
+ // for an IME to call at any time, and we need to allow it
+ // through to clean up our state after the IME has switched to
+ // another client.
+ if (ic == null) {
+ return;
+ }
+ @MissingMethodFlags final int missingMethods =
+ InputConnectionInspector.getMissingMethodFlags(ic);
+ if ((missingMethods & MissingMethodFlags.CLOSE_CONNECTION) == 0) {
+ ic.closeConnection();
+ }
+ } finally {
+ synchronized (mLock) {
+ mInputConnection = null;
+ mFinished = true;
+ }
+ Trace.traceEnd(Trace.TRACE_TAG_INPUT);
+ }
+ break;
+ }
+ }
+
+ private void doEditMain(@NonNull InputConnectionCommand command) {
+ if (DEBUG) {
+ Log.d(TAG, "handling: " + InputMethodDebug.dumpInputConnectionCommand(command));
+ }
+ byte[] icProto;
+ switch (command.mCommandType) {
+ case InputConnectionCommandType.GET_TEXT_AFTER_CURSOR: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#getTextAfterCursor");
try {
- final ICharSequenceResultCallback callback =
- (ICharSequenceResultCallback) msg.obj;
+ final int n = command.mIntArg0;
+ final int flags = command.mFlags;
final InputConnection ic = getInputConnection();
final CharSequence result;
if (ic == null || !isActive()) {
Log.w(TAG, "getTextAfterCursor on inactive InputConnection");
result = null;
} else {
- result = ic.getTextAfterCursor(msg.arg1, msg.arg2);
+ result = ic.getTextAfterCursor(n, flags);
}
if (ImeTracing.getInstance().isEnabled()) {
- icProto = InputConnectionProtoDumper.buildGetTextAfterCursorProto(msg.arg1,
- msg.arg2, result);
+ icProto = InputConnectionProtoDumper.buildGetTextAfterCursorProto(n, flags,
+ result);
ImeTracing.getInstance().triggerClientDump(
TAG + "#getTextAfterCursor", mParentInputMethodManager, icProto);
}
- try {
- callback.onResult(result);
- } catch (RemoteException e) {
- Log.w(TAG, "Failed to return the result to getTextAfterCursor()."
- + " result=" + result, e);
- }
+ CallbackUtils.onResult(command, result, TAG);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
- case DO_GET_TEXT_BEFORE_CURSOR: {
+ case InputConnectionCommandType.GET_TEXT_BEFORE_CURSOR: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#getTextBeforeCursor");
try {
- final ICharSequenceResultCallback callback =
- (ICharSequenceResultCallback) msg.obj;
+ final int n = command.mIntArg0;
+ final int flags = command.mFlags;
final InputConnection ic = getInputConnection();
final CharSequence result;
if (ic == null || !isActive()) {
Log.w(TAG, "getTextBeforeCursor on inactive InputConnection");
result = null;
} else {
- result = ic.getTextBeforeCursor(msg.arg1, msg.arg2);
+ result = ic.getTextBeforeCursor(n, flags);
}
if (ImeTracing.getInstance().isEnabled()) {
- icProto = InputConnectionProtoDumper.buildGetTextBeforeCursorProto(msg.arg1,
- msg.arg2, result);
+ icProto = InputConnectionProtoDumper.buildGetTextBeforeCursorProto(n, flags,
+ result);
ImeTracing.getInstance().triggerClientDump(
TAG + "#getTextBeforeCursor", mParentInputMethodManager, icProto);
}
- try {
- callback.onResult(result);
- } catch (RemoteException e) {
- Log.w(TAG, "Failed to return the result to getTextBeforeCursor()."
- + " result=" + result, e);
- }
+ CallbackUtils.onResult(command, result, TAG);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
- case DO_GET_SELECTED_TEXT: {
+ case InputConnectionCommandType.GET_SELECTED_TEXT: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#getSelectedText");
try {
- final ICharSequenceResultCallback callback =
- (ICharSequenceResultCallback) msg.obj;
+ final int flags = command.mFlags;
final InputConnection ic = getInputConnection();
final CharSequence result;
if (ic == null || !isActive()) {
Log.w(TAG, "getSelectedText on inactive InputConnection");
result = null;
} else {
- result = ic.getSelectedText(msg.arg1);
+ result = ic.getSelectedText(flags);
}
if (ImeTracing.getInstance().isEnabled()) {
- icProto = InputConnectionProtoDumper.buildGetSelectedTextProto(msg.arg1,
+ icProto = InputConnectionProtoDumper.buildGetSelectedTextProto(flags,
result);
ImeTracing.getInstance().triggerClientDump(
TAG + "#getSelectedText", mParentInputMethodManager, icProto);
}
- try {
- callback.onResult(result);
- } catch (RemoteException e) {
- Log.w(TAG, "Failed to return the result to getSelectedText()."
- + " result=" + result, e);
- }
+ CallbackUtils.onResult(command, result, TAG);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
- case DO_GET_SURROUNDING_TEXT: {
- final SomeArgs args = (SomeArgs) msg.obj;
+ case InputConnectionCommandType.GET_SURROUNDING_TEXT: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#getSurroundingText");
try {
- int beforeLength = (int) args.arg1;
- int afterLength = (int) args.arg2;
- int flags = (int) args.arg3;
- final ISurroundingTextResultCallback callback =
- (ISurroundingTextResultCallback) args.arg4;
+ final int beforeLength = command.mIntArg0;
+ final int afterLength = command.mIntArg1;
+ final int flags = command.mFlags;
final InputConnection ic = getInputConnection();
final SurroundingText result;
if (ic == null || !isActive()) {
@@ -463,193 +346,186 @@
ImeTracing.getInstance().triggerClientDump(
TAG + "#getSurroundingText", mParentInputMethodManager, icProto);
}
- try {
- callback.onResult(result);
- } catch (RemoteException e) {
- Log.w(TAG, "Failed to return the result to getSurroundingText()."
- + " result=" + result, e);
- }
+ CallbackUtils.onResult(command, result, TAG);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
- args.recycle();
}
return;
}
- case DO_GET_CURSOR_CAPS_MODE: {
+ case InputConnectionCommandType.GET_CURSOR_CAPS_MODE: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#getCursorCapsMode");
try {
- final IIntResultCallback callback = (IIntResultCallback) msg.obj;
+ final int reqModes = command.mIntArg0;
final InputConnection ic = getInputConnection();
final int result;
if (ic == null || !isActive()) {
Log.w(TAG, "getCursorCapsMode on inactive InputConnection");
result = 0;
} else {
- result = ic.getCursorCapsMode(msg.arg1);
+ result = ic.getCursorCapsMode(reqModes);
}
if (ImeTracing.getInstance().isEnabled()) {
- icProto = InputConnectionProtoDumper.buildGetCursorCapsModeProto(msg.arg1,
+ icProto = InputConnectionProtoDumper.buildGetCursorCapsModeProto(reqModes,
result);
ImeTracing.getInstance().triggerClientDump(
TAG + "#getCursorCapsMode", mParentInputMethodManager, icProto);
}
- try {
- callback.onResult(result);
- } catch (RemoteException e) {
- Log.w(TAG, "Failed to return the result to getCursorCapsMode()."
- + " result=" + result, e);
- }
+ CallbackUtils.onResult(command, result, TAG);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
- case DO_GET_EXTRACTED_TEXT: {
- final SomeArgs args = (SomeArgs) msg.obj;
+ case InputConnectionCommandType.GET_EXTRACTED_TEXT: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#getExtractedText");
try {
- final ExtractedTextRequest request = (ExtractedTextRequest) args.arg1;
- final IExtractedTextResultCallback callback =
- (IExtractedTextResultCallback) args.arg2;
+ final ExtractedTextRequest request = (ExtractedTextRequest) command.mParcelable;
+ final int flags = command.mFlags;
final InputConnection ic = getInputConnection();
final ExtractedText result;
if (ic == null || !isActive()) {
Log.w(TAG, "getExtractedText on inactive InputConnection");
result = null;
} else {
- result = ic.getExtractedText(request, msg.arg1);
+ result = ic.getExtractedText(request, flags);
}
if (ImeTracing.getInstance().isEnabled()) {
icProto = InputConnectionProtoDumper.buildGetExtractedTextProto(request,
- msg.arg1, result);
+ flags, result);
ImeTracing.getInstance().triggerClientDump(
TAG + "#getExtractedText", mParentInputMethodManager, icProto);
}
- try {
- callback.onResult(result);
- } catch (RemoteException e) {
- Log.w(TAG, "Failed to return the result to getExtractedText()."
- + " result=" + result, e);
- }
+ CallbackUtils.onResult(command, result, TAG);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
- args.recycle();
}
return;
}
- case DO_COMMIT_TEXT: {
+ case InputConnectionCommandType.COMMIT_TEXT: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#commitText");
try {
+ final CharSequence text = command.mCharSequence;
+ final int newCursorPosition = command.mIntArg0;
InputConnection ic = getInputConnection();
if (ic == null || !isActive()) {
Log.w(TAG, "commitText on inactive InputConnection");
return;
}
- ic.commitText((CharSequence) msg.obj, msg.arg1);
+ ic.commitText(text, newCursorPosition);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
- case DO_SET_SELECTION: {
+ case InputConnectionCommandType.SET_SELECTION: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#setSelection");
try {
+ final int start = command.mIntArg0;
+ final int end = command.mIntArg1;
InputConnection ic = getInputConnection();
if (ic == null || !isActive()) {
Log.w(TAG, "setSelection on inactive InputConnection");
return;
}
- ic.setSelection(msg.arg1, msg.arg2);
+ ic.setSelection(start, end);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
- case DO_PERFORM_EDITOR_ACTION: {
+ case InputConnectionCommandType.PERFORM_EDITOR_ACTION: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#performEditorAction");
try {
+ final int editorAction = command.mIntArg0;
InputConnection ic = getInputConnection();
if (ic == null || !isActive()) {
Log.w(TAG, "performEditorAction on inactive InputConnection");
return;
}
- ic.performEditorAction(msg.arg1);
+ ic.performEditorAction(editorAction);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
- case DO_PERFORM_CONTEXT_MENU_ACTION: {
+ case InputConnectionCommandType.PERFORM_CONTEXT_MENU_ACTION: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#performContextMenuAction");
try {
+ final int id = command.mIntArg0;
InputConnection ic = getInputConnection();
if (ic == null || !isActive()) {
Log.w(TAG, "performContextMenuAction on inactive InputConnection");
return;
}
- ic.performContextMenuAction(msg.arg1);
+ ic.performContextMenuAction(id);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
- case DO_COMMIT_COMPLETION: {
+ case InputConnectionCommandType.COMMIT_COMPLETION: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#commitCompletion");
try {
+ final CompletionInfo text = (CompletionInfo) command.mParcelable;
InputConnection ic = getInputConnection();
if (ic == null || !isActive()) {
Log.w(TAG, "commitCompletion on inactive InputConnection");
return;
}
- ic.commitCompletion((CompletionInfo) msg.obj);
+ ic.commitCompletion(text);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
- case DO_COMMIT_CORRECTION: {
+ case InputConnectionCommandType.COMMIT_CORRECTION: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#commitCorrection");
try {
+ final CorrectionInfo correctionInfo = (CorrectionInfo) command.mParcelable;
InputConnection ic = getInputConnection();
if (ic == null || !isActive()) {
Log.w(TAG, "commitCorrection on inactive InputConnection");
return;
}
- ic.commitCorrection((CorrectionInfo) msg.obj);
+ ic.commitCorrection(correctionInfo);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
- case DO_SET_COMPOSING_TEXT: {
+ case InputConnectionCommandType.SET_COMPOSING_TEXT: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#setComposingText");
try {
+ final CharSequence text = command.mCharSequence;
+ final int newCursorPosition = command.mIntArg0;
InputConnection ic = getInputConnection();
if (ic == null || !isActive()) {
Log.w(TAG, "setComposingText on inactive InputConnection");
return;
}
- ic.setComposingText((CharSequence) msg.obj, msg.arg1);
+ ic.setComposingText(text, newCursorPosition);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
- case DO_SET_COMPOSING_REGION: {
+ case InputConnectionCommandType.SET_COMPOSING_REGION: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#setComposingRegion");
try {
+ final int start = command.mIntArg0;
+ final int end = command.mIntArg1;
InputConnection ic = getInputConnection();
if (ic == null || !isActive()) {
Log.w(TAG, "setComposingRegion on inactive InputConnection");
return;
}
- ic.setComposingRegion(msg.arg1, msg.arg2);
+ ic.setComposingRegion(start, end);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
- case DO_FINISH_COMPOSING_TEXT: {
+ case InputConnectionCommandType.FINISH_COMPOSING_TEXT: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#finishComposingText");
try {
if (isFinished()) {
@@ -675,64 +551,70 @@
}
return;
}
- case DO_SEND_KEY_EVENT: {
+ case InputConnectionCommandType.SEND_KEY_EVENT: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#sendKeyEvent");
try {
+ final KeyEvent event = (KeyEvent) command.mParcelable;
InputConnection ic = getInputConnection();
if (ic == null || !isActive()) {
Log.w(TAG, "sendKeyEvent on inactive InputConnection");
return;
}
- ic.sendKeyEvent((KeyEvent) msg.obj);
+ ic.sendKeyEvent(event);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
- case DO_CLEAR_META_KEY_STATES: {
+ case InputConnectionCommandType.CLEAR_META_KEY_STATES: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#clearMetaKeyStates");
try {
+ final int states = command.mIntArg0;
InputConnection ic = getInputConnection();
if (ic == null || !isActive()) {
Log.w(TAG, "clearMetaKeyStates on inactive InputConnection");
return;
}
- ic.clearMetaKeyStates(msg.arg1);
+ ic.clearMetaKeyStates(states);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
- case DO_DELETE_SURROUNDING_TEXT: {
+ case InputConnectionCommandType.DELETE_SURROUNDING_TEXT: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#deleteSurroundingText");
try {
+ final int beforeLength = command.mIntArg0;
+ final int afterLength = command.mIntArg1;
InputConnection ic = getInputConnection();
if (ic == null || !isActive()) {
Log.w(TAG, "deleteSurroundingText on inactive InputConnection");
return;
}
- ic.deleteSurroundingText(msg.arg1, msg.arg2);
+ ic.deleteSurroundingText(beforeLength, afterLength);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
- case DO_DELETE_SURROUNDING_TEXT_IN_CODE_POINTS: {
+ case InputConnectionCommandType.DELETE_SURROUNDING_TEXT_IN_CODE_POINTS: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT,
"InputConnection#deleteSurroundingTextInCodePoints");
try {
+ final int beforeLength = command.mIntArg0;
+ final int afterLength = command.mIntArg1;
InputConnection ic = getInputConnection();
if (ic == null || !isActive()) {
Log.w(TAG, "deleteSurroundingTextInCodePoints on inactive InputConnection");
return;
}
- ic.deleteSurroundingTextInCodePoints(msg.arg1, msg.arg2);
+ ic.deleteSurroundingTextInCodePoints(beforeLength, afterLength);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
- case DO_BEGIN_BATCH_EDIT: {
+ case InputConnectionCommandType.BEGIN_BATCH_EDIT: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#beginBatchEdit");
try {
InputConnection ic = getInputConnection();
@@ -746,7 +628,7 @@
}
return;
}
- case DO_END_BATCH_EDIT: {
+ case InputConnectionCommandType.END_BATCH_EDIT: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#endBatchEdit");
try {
InputConnection ic = getInputConnection();
@@ -760,7 +642,7 @@
}
return;
}
- case DO_PERFORM_SPELL_CHECK: {
+ case InputConnectionCommandType.PERFORM_SPELL_CHECK: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#performSpellCheck");
try {
InputConnection ic = getInputConnection();
@@ -774,12 +656,11 @@
}
return;
}
- case DO_PERFORM_PRIVATE_COMMAND: {
- final SomeArgs args = (SomeArgs) msg.obj;
+ case InputConnectionCommandType.PERFORM_PRIVATE_COMMAND: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#performPrivateCommand");
try {
- final String action = (String) args.arg1;
- final Bundle data = (Bundle) args.arg2;
+ final String action = command.mString;
+ final Bundle data = command.mBundle;
InputConnection ic = getInputConnection();
if (ic == null || !isActive()) {
Log.w(TAG, "performPrivateCommand on inactive InputConnection");
@@ -788,142 +669,71 @@
ic.performPrivateCommand(action, data);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
- args.recycle();
}
return;
}
- case DO_REQUEST_CURSOR_UPDATES: {
+ case InputConnectionCommandType.REQUEST_CURSOR_UPDATES: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#requestCursorUpdates");
try {
- final IBooleanResultCallback callback = (IBooleanResultCallback) msg.obj;
+ final int cursorUpdateMode = command.mIntArg0;
final InputConnection ic = getInputConnection();
final boolean result;
if (ic == null || !isActive()) {
Log.w(TAG, "requestCursorAnchorInfo on inactive InputConnection");
result = false;
} else {
- result = ic.requestCursorUpdates(msg.arg1);
+ result = ic.requestCursorUpdates(cursorUpdateMode);
}
- try {
- callback.onResult(result);
- } catch (RemoteException e) {
- Log.w(TAG, "Failed to return the result to requestCursorUpdates()."
- + " result=" + result, e);
- }
+ CallbackUtils.onResult(command, result, TAG);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
- case DO_CLOSE_CONNECTION: {
- // Note that we do not need to worry about race condition here, because 1) mFinished
- // is updated only inside this block, and 2) the code here is running on a Handler
- // hence we assume multiple DO_CLOSE_CONNECTION messages will not be handled at the
- // same time.
- if (isFinished()) {
- return;
- }
- Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#closeConnection");
- try {
- InputConnection ic = getInputConnection();
- // Note we do NOT check isActive() here, because this is safe
- // for an IME to call at any time, and we need to allow it
- // through to clean up our state after the IME has switched to
- // another client.
- if (ic == null) {
- return;
- }
- @MissingMethodFlags
- final int missingMethods = InputConnectionInspector.getMissingMethodFlags(ic);
- if ((missingMethods & MissingMethodFlags.CLOSE_CONNECTION) == 0) {
- ic.closeConnection();
- }
- } finally {
- synchronized (mLock) {
- mInputConnection = null;
- mFinished = true;
- }
- Trace.traceEnd(Trace.TRACE_TAG_INPUT);
- }
- return;
- }
- case DO_COMMIT_CONTENT: {
- final int flags = msg.arg1;
- SomeArgs args = (SomeArgs) msg.obj;
+ case InputConnectionCommandType.COMMIT_CONTENT: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT, "InputConnection#commitContent");
try {
- final IBooleanResultCallback callback = (IBooleanResultCallback) args.arg3;
+ final InputContentInfo inputContentInfo =
+ (InputContentInfo) command.mParcelable;
+ final int flags = command.mFlags;
+ final Bundle opts = command.mBundle;
final InputConnection ic = getInputConnection();
final boolean result;
if (ic == null || !isActive()) {
Log.w(TAG, "commitContent on inactive InputConnection");
result = false;
} else {
- final InputContentInfo inputContentInfo = (InputContentInfo) args.arg1;
if (inputContentInfo == null || !inputContentInfo.validate()) {
Log.w(TAG, "commitContent with invalid inputContentInfo="
+ inputContentInfo);
result = false;
} else {
- result = ic.commitContent(inputContentInfo, flags, (Bundle) args.arg2);
+ result = ic.commitContent(inputContentInfo, flags, opts);
}
}
- try {
- callback.onResult(result);
- } catch (RemoteException e) {
- Log.w(TAG, "Failed to return the result to commitContent()."
- + " result=" + result, e);
- }
+ CallbackUtils.onResult(command, result, TAG);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
- args.recycle();
}
return;
}
- case DO_SET_IME_CONSUMES_INPUT: {
+ case InputConnectionCommandType.SET_IME_CONSUMES_INPUT: {
Trace.traceBegin(Trace.TRACE_TAG_INPUT,
"InputConnection#setImeConsumesInput");
try {
+ final boolean imeConsumesInput = (command.mIntArg0 != 0);
InputConnection ic = getInputConnection();
if (ic == null || !isActive()) {
Log.w(TAG,
"setImeConsumesInput on inactive InputConnection");
return;
}
- ic.setImeConsumesInput(msg.arg1 == 1);
+ ic.setImeConsumesInput(imeConsumesInput);
} finally {
Trace.traceEnd(Trace.TRACE_TAG_INPUT);
}
return;
}
}
- Log.w(TAG, "Unhandled message code: " + msg.what);
- }
-
- Message obtainMessage(int what) {
- return mH.obtainMessage(what);
- }
-
- Message obtainMessageII(int what, int arg1, int arg2) {
- return mH.obtainMessage(what, arg1, arg2);
- }
-
- Message obtainMessageO(int what, Object arg1) {
- return mH.obtainMessage(what, 0, 0, arg1);
- }
-
- Message obtainMessageIO(int what, int arg1, Object arg2) {
- return mH.obtainMessage(what, arg1, 0, arg2);
- }
-
- Message obtainMessageOO(int what, Object arg1, Object arg2) {
- final SomeArgs args = SomeArgs.obtain();
- args.arg1 = arg1;
- args.arg2 = arg2;
- return mH.obtainMessage(what, 0, 0, args);
- }
-
- Message obtainMessageB(int what, boolean arg1) {
- return mH.obtainMessage(what, arg1 ? 1 : 0, 0);
}
}
diff --git a/core/java/com/android/internal/view/IInputContext.aidl b/core/java/com/android/internal/view/IInputContext.aidl
index dd42c40e..095c0b4 100644
--- a/core/java/com/android/internal/view/IInputContext.aidl
+++ b/core/java/com/android/internal/view/IInputContext.aidl
@@ -16,76 +16,13 @@
package com.android.internal.view;
-import android.os.Bundle;
-import android.view.KeyEvent;
-import android.view.inputmethod.CompletionInfo;
-import android.view.inputmethod.CorrectionInfo;
-import android.view.inputmethod.ExtractedTextRequest;
-import android.view.inputmethod.InputContentInfo;
-
-import com.android.internal.inputmethod.IBooleanResultCallback;
-import com.android.internal.inputmethod.ICharSequenceResultCallback;
-import com.android.internal.inputmethod.IExtractedTextResultCallback;
-import com.android.internal.inputmethod.IIntResultCallback;
-import com.android.internal.inputmethod.ISurroundingTextResultCallback;
+import com.android.internal.inputmethod.InputConnectionCommand;
/**
* Interface from an input method to the application, allowing it to perform
* edits on the current input field and other interactions with the application.
* {@hide}
*/
- oneway interface IInputContext {
- void getTextBeforeCursor(int length, int flags, ICharSequenceResultCallback callback);
-
- void getTextAfterCursor(int length, int flags, ICharSequenceResultCallback callback);
-
- void getCursorCapsMode(int reqModes, IIntResultCallback callback);
-
- void getExtractedText(in ExtractedTextRequest request, int flags,
- IExtractedTextResultCallback callback);
-
- void deleteSurroundingText(int beforeLength, int afterLength);
- void deleteSurroundingTextInCodePoints(int beforeLength, int afterLength);
-
- void setComposingText(CharSequence text, int newCursorPosition);
-
- void finishComposingText();
-
- void commitText(CharSequence text, int newCursorPosition);
-
- void commitCompletion(in CompletionInfo completion);
-
- void commitCorrection(in CorrectionInfo correction);
-
- void setSelection(int start, int end);
-
- void performEditorAction(int actionCode);
-
- void performContextMenuAction(int id);
-
- void beginBatchEdit();
-
- void endBatchEdit();
-
- void sendKeyEvent(in KeyEvent event);
-
- void clearMetaKeyStates(int states);
-
- void performSpellCheck();
-
- void performPrivateCommand(String action, in Bundle data);
-
- void setComposingRegion(int start, int end);
-
- void getSelectedText(int flags, ICharSequenceResultCallback callback);
-
- void requestCursorUpdates(int cursorUpdateMode, IBooleanResultCallback callback);
-
- void commitContent(in InputContentInfo inputContentInfo, int flags, in Bundle opts,
- IBooleanResultCallback callback);
-
- void getSurroundingText(int beforeLength, int afterLength, int flags,
- ISurroundingTextResultCallback callback);
-
- void setImeConsumesInput(boolean imeConsumesInput);
+oneway interface IInputContext {
+ void doEdit(in InputConnectionCommand command);
}
diff --git a/core/java/com/android/server/SystemConfig.java b/core/java/com/android/server/SystemConfig.java
index a8dcbaf..6cbace4 100644
--- a/core/java/com/android/server/SystemConfig.java
+++ b/core/java/com/android/server/SystemConfig.java
@@ -241,7 +241,11 @@
private final ArraySet<String> mRollbackWhitelistedPackages = new ArraySet<>();
private final ArraySet<String> mWhitelistedStagedInstallers = new ArraySet<>();
- private final ArraySet<String> mAllowedVendorApexes = new ArraySet<>();
+ // A map from package name of vendor APEXes that can be updated to an installer package name
+ // allowed to install updates for it.
+ private final ArrayMap<String, String> mAllowedVendorApexes = new ArrayMap<>();
+
+ private String mModulesInstallerPackageName;
/**
* Map of system pre-defined, uniquely named actors; keys are namespace,
@@ -412,10 +416,14 @@
return mWhitelistedStagedInstallers;
}
- public Set<String> getAllowedVendorApexes() {
+ public Map<String, String> getAllowedVendorApexes() {
return mAllowedVendorApexes;
}
+ public String getModulesInstallerPackageName() {
+ return mModulesInstallerPackageName;
+ }
+
public ArraySet<String> getAppDataIsolationWhitelistedApps() {
return mAppDataIsolationWhitelistedApps;
}
@@ -1210,12 +1218,21 @@
case "whitelisted-staged-installer": {
if (allowAppConfigs) {
String pkgname = parser.getAttributeValue(null, "package");
+ boolean isModulesInstaller = XmlUtils.readBooleanAttribute(
+ parser, "isModulesInstaller", false);
if (pkgname == null) {
Slog.w(TAG, "<" + name + "> without package in " + permFile
+ " at " + parser.getPositionDescription());
} else {
mWhitelistedStagedInstallers.add(pkgname);
}
+ if (isModulesInstaller) {
+ if (mModulesInstallerPackageName != null) {
+ throw new IllegalStateException(
+ "Multiple modules installers");
+ }
+ mModulesInstallerPackageName = pkgname;
+ }
} else {
logNotAllowedInPartition(name, permFile, parser);
}
@@ -1224,11 +1241,18 @@
case "allowed-vendor-apex": {
if (allowVendorApex) {
String pkgName = parser.getAttributeValue(null, "package");
+ String installerPkgName = parser.getAttributeValue(
+ null, "installerPackage");
if (pkgName == null) {
Slog.w(TAG, "<" + name + "> without package in " + permFile
+ " at " + parser.getPositionDescription());
- } else {
- mAllowedVendorApexes.add(pkgName);
+ }
+ if (installerPkgName == null) {
+ Slog.w(TAG, "<" + name + "> without installerPackage in " + permFile
+ + " at " + parser.getPositionDescription());
+ }
+ if (pkgName != null && installerPkgName != null) {
+ mAllowedVendorApexes.put(pkgName, installerPkgName);
}
} else {
logNotAllowedInPartition(name, permFile, parser);
diff --git a/core/jni/Android.bp b/core/jni/Android.bp
index e274595..ce6101f 100644
--- a/core/jni/Android.bp
+++ b/core/jni/Android.bp
@@ -146,6 +146,7 @@
"android_os_MemoryFile.cpp",
"android_os_MessageQueue.cpp",
"android_os_Parcel.cpp",
+ "android_os_PerformanceHintManager.cpp",
"android_os_SELinux.cpp",
"android_os_ServiceManager.cpp",
"android_os_SharedMemory.cpp",
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 09d7ef0..97cac29 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -144,6 +144,7 @@
extern int register_android_os_ServiceManager(JNIEnv *env);
extern int register_android_os_MessageQueue(JNIEnv* env);
extern int register_android_os_Parcel(JNIEnv* env);
+extern int register_android_os_PerformanceHintManager(JNIEnv* env);
extern int register_android_os_SELinux(JNIEnv* env);
extern int register_android_os_VintfObject(JNIEnv *env);
extern int register_android_os_VintfRuntimeInfo(JNIEnv *env);
@@ -1523,6 +1524,7 @@
REG_JNI(register_android_os_SystemProperties),
REG_JNI(register_android_os_Binder),
REG_JNI(register_android_os_Parcel),
+ REG_JNI(register_android_os_PerformanceHintManager),
REG_JNI(register_android_os_HidlMemory),
REG_JNI(register_android_os_HidlSupport),
REG_JNI(register_android_os_HwBinder),
diff --git a/core/jni/android_os_PerformanceHintManager.cpp b/core/jni/android_os_PerformanceHintManager.cpp
new file mode 100644
index 0000000..d05a24f
--- /dev/null
+++ b/core/jni/android_os_PerformanceHintManager.cpp
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "PerfHint-jni"
+
+#include "jni.h"
+
+#include <dlfcn.h>
+#include <nativehelper/JNIHelp.h>
+#include <nativehelper/ScopedPrimitiveArray.h>
+#include <utils/Log.h>
+#include <vector>
+
+#include "core_jni_helpers.h"
+
+namespace android {
+
+namespace {
+
+struct APerformanceHintManager;
+struct APerformanceHintSession;
+
+typedef APerformanceHintManager* (*APH_getManager)();
+typedef APerformanceHintSession* (*APH_createSession)(APerformanceHintManager*, const int32_t*,
+ size_t, int64_t);
+typedef int64_t (*APH_getPreferredUpdateRateNanos)(APerformanceHintManager* manager);
+typedef void (*APH_updateTargetWorkDuration)(APerformanceHintSession*, int64_t);
+typedef void (*APH_reportActualWorkDuration)(APerformanceHintSession*, int64_t);
+typedef void (*APH_closeSession)(APerformanceHintSession* session);
+
+bool gAPerformanceHintBindingInitialized = false;
+APH_getManager gAPH_getManagerFn = nullptr;
+APH_createSession gAPH_createSessionFn = nullptr;
+APH_getPreferredUpdateRateNanos gAPH_getPreferredUpdateRateNanosFn = nullptr;
+APH_updateTargetWorkDuration gAPH_updateTargetWorkDurationFn = nullptr;
+APH_reportActualWorkDuration gAPH_reportActualWorkDurationFn = nullptr;
+APH_closeSession gAPH_closeSessionFn = nullptr;
+
+void ensureAPerformanceHintBindingInitialized() {
+ if (gAPerformanceHintBindingInitialized) return;
+
+ void* handle_ = dlopen("libandroid.so", RTLD_NOW | RTLD_NODELETE);
+ LOG_ALWAYS_FATAL_IF(handle_ == nullptr, "Failed to dlopen libandroid.so!");
+
+ gAPH_getManagerFn = (APH_getManager)dlsym(handle_, "APerformanceHint_getManager");
+ LOG_ALWAYS_FATAL_IF(gAPH_getManagerFn == nullptr,
+ "Failed to find required symbol APerformanceHint_getManager!");
+
+ gAPH_createSessionFn = (APH_createSession)dlsym(handle_, "APerformanceHint_createSession");
+ LOG_ALWAYS_FATAL_IF(gAPH_createSessionFn == nullptr,
+ "Failed to find required symbol APerformanceHint_createSession!");
+
+ gAPH_getPreferredUpdateRateNanosFn =
+ (APH_getPreferredUpdateRateNanos)dlsym(handle_,
+ "APerformanceHint_getPreferredUpdateRateNanos");
+ LOG_ALWAYS_FATAL_IF(gAPH_getPreferredUpdateRateNanosFn == nullptr,
+ "Failed to find required symbol "
+ "APerformanceHint_getPreferredUpdateRateNanos!");
+
+ gAPH_updateTargetWorkDurationFn =
+ (APH_updateTargetWorkDuration)dlsym(handle_,
+ "APerformanceHint_updateTargetWorkDuration");
+ LOG_ALWAYS_FATAL_IF(gAPH_updateTargetWorkDurationFn == nullptr,
+ "Failed to find required symbol "
+ "APerformanceHint_updateTargetWorkDuration!");
+
+ gAPH_reportActualWorkDurationFn =
+ (APH_reportActualWorkDuration)dlsym(handle_,
+ "APerformanceHint_reportActualWorkDuration");
+ LOG_ALWAYS_FATAL_IF(gAPH_reportActualWorkDurationFn == nullptr,
+ "Failed to find required symbol "
+ "APerformanceHint_reportActualWorkDuration!");
+
+ gAPH_closeSessionFn = (APH_closeSession)dlsym(handle_, "APerformanceHint_closeSession");
+ LOG_ALWAYS_FATAL_IF(gAPH_closeSessionFn == nullptr,
+ "Failed to find required symbol APerformanceHint_closeSession!");
+
+ gAPerformanceHintBindingInitialized = true;
+}
+
+} // namespace
+
+static jlong nativeAcquireManager(JNIEnv* env, jclass clazz) {
+ ensureAPerformanceHintBindingInitialized();
+ return reinterpret_cast<jlong>(gAPH_getManagerFn());
+}
+
+static jlong nativeGetPreferredUpdateRateNanos(JNIEnv* env, jclass clazz, jlong nativeManagerPtr) {
+ ensureAPerformanceHintBindingInitialized();
+ return gAPH_getPreferredUpdateRateNanosFn(
+ reinterpret_cast<APerformanceHintManager*>(nativeManagerPtr));
+}
+
+static jlong nativeCreateSession(JNIEnv* env, jclass clazz, jlong nativeManagerPtr, jintArray tids,
+ jlong initialTargetWorkDurationNanos) {
+ ensureAPerformanceHintBindingInitialized();
+ if (tids == nullptr) return 0;
+ std::vector<int32_t> tidsVector;
+ ScopedIntArrayRO tidsArray(env, tids);
+ for (size_t i = 0; i < tidsArray.size(); ++i) {
+ tidsVector.push_back(static_cast<int32_t>(tidsArray[i]));
+ }
+ return reinterpret_cast<jlong>(
+ gAPH_createSessionFn(reinterpret_cast<APerformanceHintManager*>(nativeManagerPtr),
+ tidsVector.data(), tidsVector.size(),
+ initialTargetWorkDurationNanos));
+}
+
+static void nativeUpdateTargetWorkDuration(JNIEnv* env, jclass clazz, jlong nativeSessionPtr,
+ jlong targetDurationNanos) {
+ ensureAPerformanceHintBindingInitialized();
+ gAPH_updateTargetWorkDurationFn(reinterpret_cast<APerformanceHintSession*>(nativeSessionPtr),
+ targetDurationNanos);
+}
+
+static void nativeReportActualWorkDuration(JNIEnv* env, jclass clazz, jlong nativeSessionPtr,
+ jlong actualDurationNanos) {
+ ensureAPerformanceHintBindingInitialized();
+ gAPH_reportActualWorkDurationFn(reinterpret_cast<APerformanceHintSession*>(nativeSessionPtr),
+ actualDurationNanos);
+}
+
+static void nativeCloseSession(JNIEnv* env, jclass clazz, jlong nativeSessionPtr) {
+ ensureAPerformanceHintBindingInitialized();
+ gAPH_closeSessionFn(reinterpret_cast<APerformanceHintSession*>(nativeSessionPtr));
+}
+
+static const JNINativeMethod gPerformanceHintMethods[] = {
+ {"nativeAcquireManager", "()J", (void*)nativeAcquireManager},
+ {"nativeGetPreferredUpdateRateNanos", "(J)J", (void*)nativeGetPreferredUpdateRateNanos},
+ {"nativeCreateSession", "(J[IJ)J", (void*)nativeCreateSession},
+ {"nativeUpdateTargetWorkDuration", "(JJ)V", (void*)nativeUpdateTargetWorkDuration},
+ {"nativeReportActualWorkDuration", "(JJ)V", (void*)nativeReportActualWorkDuration},
+ {"nativeCloseSession", "(J)V", (void*)nativeCloseSession},
+};
+
+int register_android_os_PerformanceHintManager(JNIEnv* env) {
+ return RegisterMethodsOrDie(env, "android/os/PerformanceHintManager", gPerformanceHintMethods,
+ NELEM(gPerformanceHintMethods));
+}
+
+} // namespace android
diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp
index 1955ec5..f63c0e5 100644
--- a/core/jni/android_view_SurfaceControl.cpp
+++ b/core/jni/android_view_SurfaceControl.cpp
@@ -825,6 +825,14 @@
transaction->setShadowRadius(ctrl, shadowRadius);
}
+static void nativeSetTrustedOverlay(JNIEnv* env, jclass clazz, jlong transactionObj,
+ jlong nativeObject, jboolean isTrustedOverlay) {
+ auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);
+
+ SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl *>(nativeObject);
+ transaction->setTrustedOverlay(ctrl, isTrustedOverlay);
+}
+
static void nativeSetFrameRate(JNIEnv* env, jclass clazz, jlong transactionObj, jlong nativeObject,
jfloat frameRate, jint compatibility, jint changeFrameRateStrategy) {
auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj);
@@ -2000,6 +2008,8 @@
(void*)nativeSetTransformHint },
{"nativeGetTransformHint", "(J)I",
(void*)nativeGetTransformHint },
+ {"nativeSetTrustedOverlay", "(JJZ)V",
+ (void*)nativeSetTrustedOverlay },
// clang-format on
};
diff --git a/core/res/res/drawable/chooser_row_layer_list.xml b/core/res/res/drawable/chooser_row_layer_list.xml
index 0800815..f5ba1e9 100644
--- a/core/res/res/drawable/chooser_row_layer_list.xml
+++ b/core/res/res/drawable/chooser_row_layer_list.xml
@@ -17,9 +17,11 @@
*/
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:bottom="-5dp" android:left="-5dp" android:right="-5dp">
+ <item>
<shape android:shape="rectangle">
- <stroke android:width="1dp" android:color="@color/chooser_row_divider"/>
+ <solid android:color="?android:attr/colorAccentSecondary"/>
+ <size android:width="128dp" android:height="2dp"/>
+ <corners android:radius="2dp" />
</shape>
</item>
</layer-list>
diff --git a/core/res/res/layout-car/car_alert_dialog.xml b/core/res/res/layout-car/car_alert_dialog.xml
index 569e594..2e7b62c 100644
--- a/core/res/res/layout-car/car_alert_dialog.xml
+++ b/core/res/res/layout-car/car_alert_dialog.xml
@@ -54,7 +54,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/text_view_start_margin"
android:layout_marginEnd="@dimen/text_view_end_margin"
- style="@style/CarBody2"/>
+ style="@style/CarBody4"/>
<!-- we don't need this spacer, but the id needs to be here for compatibility -->
<Space
diff --git a/core/res/res/layout-car/car_alert_dialog_button_bar.xml b/core/res/res/layout-car/car_alert_dialog_button_bar.xml
index 277b0dc..4f815b8 100644
--- a/core/res/res/layout-car/car_alert_dialog_button_bar.xml
+++ b/core/res/res/layout-car/car_alert_dialog_button_bar.xml
@@ -36,6 +36,9 @@
<Button
android:id="@+id/button3"
style="@style/CarAction1"
+ android:minWidth="@dimen/car_touch_target_size"
+ android:paddingStart="@dimen/car_padding_2"
+ android:paddingEnd="@dimen/car_padding_2"
android:background="@drawable/car_dialog_button_background"
android:layout_marginRight="@dimen/button_end_margin"
android:layout_width="wrap_content"
@@ -44,6 +47,9 @@
<Button
android:id="@+id/button2"
style="@style/CarAction1"
+ android:minWidth="@dimen/car_touch_target_size"
+ android:paddingStart="@dimen/car_padding_2"
+ android:paddingEnd="@dimen/car_padding_2"
android:background="@drawable/car_dialog_button_background"
android:layout_marginRight="@dimen/button_end_margin"
android:layout_width="wrap_content"
@@ -52,6 +58,9 @@
<Button
android:id="@+id/button1"
style="@style/CarAction1"
+ android:minWidth="@dimen/car_touch_target_size"
+ android:paddingStart="@dimen/car_padding_2"
+ android:paddingEnd="@dimen/car_padding_2"
android:background="@drawable/car_dialog_button_background"
android:layout_width="wrap_content"
android:layout_height="@dimen/button_layout_height" />
diff --git a/core/res/res/layout/chooser_az_label_row.xml b/core/res/res/layout/chooser_az_label_row.xml
index 1b733fc..baf07ce 100644
--- a/core/res/res/layout/chooser_az_label_row.xml
+++ b/core/res/res/layout/chooser_az_label_row.xml
@@ -15,17 +15,12 @@
~ limitations under the License
-->
-<!-- Separator applied as background -->
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
- android:text="@string/chooser_all_apps_button_label"
+<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:contentDescription="@string/chooser_all_apps_button_label"
- android:background="@drawable/chooser_row_layer_list"
- android:textAppearance="?attr/textAppearanceSmall"
- android:textColor="?attr/textColorSecondary"
- android:textSize="14sp"
- android:singleLine="true"
+ android:src="@drawable/chooser_row_layer_list"
android:paddingTop="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:scaleType="center"
android:gravity="center"/>
diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml
index 1fd1f18..a4726cf 100644
--- a/core/res/res/values-be/strings.xml
+++ b/core/res/res/values-be/strings.xml
@@ -1249,9 +1249,9 @@
<string name="whichImageCaptureApplication" msgid="2737413019463215284">"Зрабіць здымак з дапамогай"</string>
<string name="whichImageCaptureApplicationNamed" msgid="8820702441847612202">"Зрабіць здымак з дапамогай %1$s"</string>
<string name="whichImageCaptureApplicationLabel" msgid="6505433734824988277">"Зрабіць здымак"</string>
- <string name="alwaysUse" msgid="3153558199076112903">"Выкарыстоўваць па змаўчанні для гэтага дзеяння."</string>
+ <string name="alwaysUse" msgid="3153558199076112903">"Выкарыстоўваць стандартна для гэтага дзеяння."</string>
<string name="use_a_different_app" msgid="4987790276170972776">"Выкарыстоўваць іншую праграму"</string>
- <string name="clearDefaultHintMsg" msgid="1325866337702524936">"Ачысціць па змаўчанні ў раздзеле \"Налады сістэмы > Прыкладанні > Спампаваныя\"."</string>
+ <string name="clearDefaultHintMsg" msgid="1325866337702524936">"Ачысціць стандартныя налады ў раздзеле \"Налады сістэмы > Праграмы > Спампаваныя\"."</string>
<string name="chooseActivity" msgid="8563390197659779956">"Выберыце дзеянне"</string>
<string name="chooseUsbActivity" msgid="2096269989990986612">"Выберыце прыкладанне для USB-прылады"</string>
<string name="noApplications" msgid="1186909265235544019">"Няма прыкладанняў, якія могуць выконваць гэты працэс."</string>
diff --git a/core/res/res/values-en-rAU/strings.xml b/core/res/res/values-en-rAU/strings.xml
index bb26e6c..13725de 100644
--- a/core/res/res/values-en-rAU/strings.xml
+++ b/core/res/res/values-en-rAU/strings.xml
@@ -700,8 +700,8 @@
<string name="permdesc_bindConditionProviderService" msgid="6106018791256120258">"Allows the holder to bind to the top-level interface of a condition provider service. Should never be needed for normal apps."</string>
<string name="permlab_bindDreamService" msgid="4776175992848982706">"bind to a dream service"</string>
<string name="permdesc_bindDreamService" msgid="9129615743300572973">"Allows the holder to bind to the top-level interface of a dream service. Should never be needed for normal apps."</string>
- <string name="permlab_invokeCarrierSetup" msgid="5098810760209818140">"invoke the carrier-provided configuration app"</string>
- <string name="permdesc_invokeCarrierSetup" msgid="4790845896063237887">"Allows the holder to invoke the carrier-provided configuration app. Should never be needed for normal apps."</string>
+ <string name="permlab_invokeCarrierSetup" msgid="5098810760209818140">"invoke the operator-provided configuration app"</string>
+ <string name="permdesc_invokeCarrierSetup" msgid="4790845896063237887">"Allows the holder to invoke the operator-provided configuration app. Should never be needed for normal apps."</string>
<string name="permlab_accessNetworkConditions" msgid="1270732533356286514">"listen for observations on network conditions"</string>
<string name="permdesc_accessNetworkConditions" msgid="2959269186741956109">"Allows an application to listen for observations on network conditions. Should never be needed for normal apps."</string>
<string name="permlab_setInputCalibration" msgid="932069700285223434">"change input device calibration"</string>
@@ -712,8 +712,8 @@
<string name="permdesc_handoverStatus" msgid="3842269451732571070">"Allows this application to receive information about current Android Beam transfers"</string>
<string name="permlab_removeDrmCertificates" msgid="710576248717404416">"remove DRM certificates"</string>
<string name="permdesc_removeDrmCertificates" msgid="4068445390318355716">"Allows an application to remove DRM certficates. Should never be needed for normal apps."</string>
- <string name="permlab_bindCarrierMessagingService" msgid="3363450860593096967">"bind to a carrier messaging service"</string>
- <string name="permdesc_bindCarrierMessagingService" msgid="6316457028173478345">"Allows the holder to bind to the top-level interface of a carrier messaging service. Should never be needed for normal apps."</string>
+ <string name="permlab_bindCarrierMessagingService" msgid="3363450860593096967">"bind to an operator messaging service"</string>
+ <string name="permdesc_bindCarrierMessagingService" msgid="6316457028173478345">"Allows the holder to bind to the top-level interface of an operator messaging service. Should never be needed for normal apps."</string>
<string name="permlab_bindCarrierServices" msgid="2395596978626237474">"bind to operator services"</string>
<string name="permdesc_bindCarrierServices" msgid="9185614481967262900">"Allows the holder to bind to operator services. Should never be needed for normal apps."</string>
<string name="permlab_access_notification_policy" msgid="5524112842876975537">"access Do Not Disturb"</string>
@@ -1656,7 +1656,7 @@
<string name="kg_sim_pin_instructions" msgid="6479401489471690359">"Enter SIM PIN"</string>
<string name="kg_pin_instructions" msgid="7355933174673539021">"Enter PIN"</string>
<string name="kg_password_instructions" msgid="7179782578809398050">"Enter Password"</string>
- <string name="kg_puk_enter_puk_hint" msgid="6696187482616360994">"SIM is now disabled. Enter PUK code to continue. Contact carrier for details."</string>
+ <string name="kg_puk_enter_puk_hint" msgid="6696187482616360994">"SIM is now disabled. Enter PUK code to continue. Contact operator for details."</string>
<string name="kg_puk_enter_pin_hint" msgid="8190982314659429770">"Enter desired PIN code"</string>
<string name="kg_enter_confirm_pin_hint" msgid="6372557107414074580">"Confirm desired PIN code"</string>
<string name="kg_sim_unlock_progress_dialog_message" msgid="8871937892678885545">"Unlocking SIM card…"</string>
diff --git a/core/res/res/values-en-rCA/strings.xml b/core/res/res/values-en-rCA/strings.xml
index 9dd378c..9205763 100644
--- a/core/res/res/values-en-rCA/strings.xml
+++ b/core/res/res/values-en-rCA/strings.xml
@@ -700,8 +700,8 @@
<string name="permdesc_bindConditionProviderService" msgid="6106018791256120258">"Allows the holder to bind to the top-level interface of a condition provider service. Should never be needed for normal apps."</string>
<string name="permlab_bindDreamService" msgid="4776175992848982706">"bind to a dream service"</string>
<string name="permdesc_bindDreamService" msgid="9129615743300572973">"Allows the holder to bind to the top-level interface of a dream service. Should never be needed for normal apps."</string>
- <string name="permlab_invokeCarrierSetup" msgid="5098810760209818140">"invoke the carrier-provided configuration app"</string>
- <string name="permdesc_invokeCarrierSetup" msgid="4790845896063237887">"Allows the holder to invoke the carrier-provided configuration app. Should never be needed for normal apps."</string>
+ <string name="permlab_invokeCarrierSetup" msgid="5098810760209818140">"invoke the operator-provided configuration app"</string>
+ <string name="permdesc_invokeCarrierSetup" msgid="4790845896063237887">"Allows the holder to invoke the operator-provided configuration app. Should never be needed for normal apps."</string>
<string name="permlab_accessNetworkConditions" msgid="1270732533356286514">"listen for observations on network conditions"</string>
<string name="permdesc_accessNetworkConditions" msgid="2959269186741956109">"Allows an application to listen for observations on network conditions. Should never be needed for normal apps."</string>
<string name="permlab_setInputCalibration" msgid="932069700285223434">"change input device calibration"</string>
@@ -712,8 +712,8 @@
<string name="permdesc_handoverStatus" msgid="3842269451732571070">"Allows this application to receive information about current Android Beam transfers"</string>
<string name="permlab_removeDrmCertificates" msgid="710576248717404416">"remove DRM certificates"</string>
<string name="permdesc_removeDrmCertificates" msgid="4068445390318355716">"Allows an application to remove DRM certficates. Should never be needed for normal apps."</string>
- <string name="permlab_bindCarrierMessagingService" msgid="3363450860593096967">"bind to a carrier messaging service"</string>
- <string name="permdesc_bindCarrierMessagingService" msgid="6316457028173478345">"Allows the holder to bind to the top-level interface of a carrier messaging service. Should never be needed for normal apps."</string>
+ <string name="permlab_bindCarrierMessagingService" msgid="3363450860593096967">"bind to an operator messaging service"</string>
+ <string name="permdesc_bindCarrierMessagingService" msgid="6316457028173478345">"Allows the holder to bind to the top-level interface of an operator messaging service. Should never be needed for normal apps."</string>
<string name="permlab_bindCarrierServices" msgid="2395596978626237474">"bind to operator services"</string>
<string name="permdesc_bindCarrierServices" msgid="9185614481967262900">"Allows the holder to bind to operator services. Should never be needed for normal apps."</string>
<string name="permlab_access_notification_policy" msgid="5524112842876975537">"access Do Not Disturb"</string>
@@ -1656,7 +1656,7 @@
<string name="kg_sim_pin_instructions" msgid="6479401489471690359">"Enter SIM PIN"</string>
<string name="kg_pin_instructions" msgid="7355933174673539021">"Enter PIN"</string>
<string name="kg_password_instructions" msgid="7179782578809398050">"Enter Password"</string>
- <string name="kg_puk_enter_puk_hint" msgid="6696187482616360994">"SIM is now disabled. Enter PUK code to continue. Contact carrier for details."</string>
+ <string name="kg_puk_enter_puk_hint" msgid="6696187482616360994">"SIM is now disabled. Enter PUK code to continue. Contact operator for details."</string>
<string name="kg_puk_enter_pin_hint" msgid="8190982314659429770">"Enter desired PIN code"</string>
<string name="kg_enter_confirm_pin_hint" msgid="6372557107414074580">"Confirm desired PIN code"</string>
<string name="kg_sim_unlock_progress_dialog_message" msgid="8871937892678885545">"Unlocking SIM card…"</string>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index 81f49ce..45709f0 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -700,8 +700,8 @@
<string name="permdesc_bindConditionProviderService" msgid="6106018791256120258">"Allows the holder to bind to the top-level interface of a condition provider service. Should never be needed for normal apps."</string>
<string name="permlab_bindDreamService" msgid="4776175992848982706">"bind to a dream service"</string>
<string name="permdesc_bindDreamService" msgid="9129615743300572973">"Allows the holder to bind to the top-level interface of a dream service. Should never be needed for normal apps."</string>
- <string name="permlab_invokeCarrierSetup" msgid="5098810760209818140">"invoke the carrier-provided configuration app"</string>
- <string name="permdesc_invokeCarrierSetup" msgid="4790845896063237887">"Allows the holder to invoke the carrier-provided configuration app. Should never be needed for normal apps."</string>
+ <string name="permlab_invokeCarrierSetup" msgid="5098810760209818140">"invoke the operator-provided configuration app"</string>
+ <string name="permdesc_invokeCarrierSetup" msgid="4790845896063237887">"Allows the holder to invoke the operator-provided configuration app. Should never be needed for normal apps."</string>
<string name="permlab_accessNetworkConditions" msgid="1270732533356286514">"listen for observations on network conditions"</string>
<string name="permdesc_accessNetworkConditions" msgid="2959269186741956109">"Allows an application to listen for observations on network conditions. Should never be needed for normal apps."</string>
<string name="permlab_setInputCalibration" msgid="932069700285223434">"change input device calibration"</string>
@@ -712,8 +712,8 @@
<string name="permdesc_handoverStatus" msgid="3842269451732571070">"Allows this application to receive information about current Android Beam transfers"</string>
<string name="permlab_removeDrmCertificates" msgid="710576248717404416">"remove DRM certificates"</string>
<string name="permdesc_removeDrmCertificates" msgid="4068445390318355716">"Allows an application to remove DRM certficates. Should never be needed for normal apps."</string>
- <string name="permlab_bindCarrierMessagingService" msgid="3363450860593096967">"bind to a carrier messaging service"</string>
- <string name="permdesc_bindCarrierMessagingService" msgid="6316457028173478345">"Allows the holder to bind to the top-level interface of a carrier messaging service. Should never be needed for normal apps."</string>
+ <string name="permlab_bindCarrierMessagingService" msgid="3363450860593096967">"bind to an operator messaging service"</string>
+ <string name="permdesc_bindCarrierMessagingService" msgid="6316457028173478345">"Allows the holder to bind to the top-level interface of an operator messaging service. Should never be needed for normal apps."</string>
<string name="permlab_bindCarrierServices" msgid="2395596978626237474">"bind to operator services"</string>
<string name="permdesc_bindCarrierServices" msgid="9185614481967262900">"Allows the holder to bind to operator services. Should never be needed for normal apps."</string>
<string name="permlab_access_notification_policy" msgid="5524112842876975537">"access Do Not Disturb"</string>
@@ -1656,7 +1656,7 @@
<string name="kg_sim_pin_instructions" msgid="6479401489471690359">"Enter SIM PIN"</string>
<string name="kg_pin_instructions" msgid="7355933174673539021">"Enter PIN"</string>
<string name="kg_password_instructions" msgid="7179782578809398050">"Enter Password"</string>
- <string name="kg_puk_enter_puk_hint" msgid="6696187482616360994">"SIM is now disabled. Enter PUK code to continue. Contact carrier for details."</string>
+ <string name="kg_puk_enter_puk_hint" msgid="6696187482616360994">"SIM is now disabled. Enter PUK code to continue. Contact operator for details."</string>
<string name="kg_puk_enter_pin_hint" msgid="8190982314659429770">"Enter desired PIN code"</string>
<string name="kg_enter_confirm_pin_hint" msgid="6372557107414074580">"Confirm desired PIN code"</string>
<string name="kg_sim_unlock_progress_dialog_message" msgid="8871937892678885545">"Unlocking SIM card…"</string>
diff --git a/core/res/res/values-en-rIN/strings.xml b/core/res/res/values-en-rIN/strings.xml
index ddbcfb8..8749d05 100644
--- a/core/res/res/values-en-rIN/strings.xml
+++ b/core/res/res/values-en-rIN/strings.xml
@@ -700,8 +700,8 @@
<string name="permdesc_bindConditionProviderService" msgid="6106018791256120258">"Allows the holder to bind to the top-level interface of a condition provider service. Should never be needed for normal apps."</string>
<string name="permlab_bindDreamService" msgid="4776175992848982706">"bind to a dream service"</string>
<string name="permdesc_bindDreamService" msgid="9129615743300572973">"Allows the holder to bind to the top-level interface of a dream service. Should never be needed for normal apps."</string>
- <string name="permlab_invokeCarrierSetup" msgid="5098810760209818140">"invoke the carrier-provided configuration app"</string>
- <string name="permdesc_invokeCarrierSetup" msgid="4790845896063237887">"Allows the holder to invoke the carrier-provided configuration app. Should never be needed for normal apps."</string>
+ <string name="permlab_invokeCarrierSetup" msgid="5098810760209818140">"invoke the operator-provided configuration app"</string>
+ <string name="permdesc_invokeCarrierSetup" msgid="4790845896063237887">"Allows the holder to invoke the operator-provided configuration app. Should never be needed for normal apps."</string>
<string name="permlab_accessNetworkConditions" msgid="1270732533356286514">"listen for observations on network conditions"</string>
<string name="permdesc_accessNetworkConditions" msgid="2959269186741956109">"Allows an application to listen for observations on network conditions. Should never be needed for normal apps."</string>
<string name="permlab_setInputCalibration" msgid="932069700285223434">"change input device calibration"</string>
@@ -712,8 +712,8 @@
<string name="permdesc_handoverStatus" msgid="3842269451732571070">"Allows this application to receive information about current Android Beam transfers"</string>
<string name="permlab_removeDrmCertificates" msgid="710576248717404416">"remove DRM certificates"</string>
<string name="permdesc_removeDrmCertificates" msgid="4068445390318355716">"Allows an application to remove DRM certficates. Should never be needed for normal apps."</string>
- <string name="permlab_bindCarrierMessagingService" msgid="3363450860593096967">"bind to a carrier messaging service"</string>
- <string name="permdesc_bindCarrierMessagingService" msgid="6316457028173478345">"Allows the holder to bind to the top-level interface of a carrier messaging service. Should never be needed for normal apps."</string>
+ <string name="permlab_bindCarrierMessagingService" msgid="3363450860593096967">"bind to an operator messaging service"</string>
+ <string name="permdesc_bindCarrierMessagingService" msgid="6316457028173478345">"Allows the holder to bind to the top-level interface of an operator messaging service. Should never be needed for normal apps."</string>
<string name="permlab_bindCarrierServices" msgid="2395596978626237474">"bind to operator services"</string>
<string name="permdesc_bindCarrierServices" msgid="9185614481967262900">"Allows the holder to bind to operator services. Should never be needed for normal apps."</string>
<string name="permlab_access_notification_policy" msgid="5524112842876975537">"access Do Not Disturb"</string>
@@ -1656,7 +1656,7 @@
<string name="kg_sim_pin_instructions" msgid="6479401489471690359">"Enter SIM PIN"</string>
<string name="kg_pin_instructions" msgid="7355933174673539021">"Enter PIN"</string>
<string name="kg_password_instructions" msgid="7179782578809398050">"Enter Password"</string>
- <string name="kg_puk_enter_puk_hint" msgid="6696187482616360994">"SIM is now disabled. Enter PUK code to continue. Contact carrier for details."</string>
+ <string name="kg_puk_enter_puk_hint" msgid="6696187482616360994">"SIM is now disabled. Enter PUK code to continue. Contact operator for details."</string>
<string name="kg_puk_enter_pin_hint" msgid="8190982314659429770">"Enter desired PIN code"</string>
<string name="kg_enter_confirm_pin_hint" msgid="6372557107414074580">"Confirm desired PIN code"</string>
<string name="kg_sim_unlock_progress_dialog_message" msgid="8871937892678885545">"Unlocking SIM card…"</string>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index 3ce014c..e0deab1 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -244,7 +244,7 @@
<string name="global_actions" product="default" msgid="6410072189971495460">"Opciones del teléfono"</string>
<string name="global_action_lock" msgid="6949357274257655383">"Bloqueo de pantalla"</string>
<string name="global_action_power_off" msgid="4404936470711393203">"Apagar"</string>
- <string name="global_action_power_options" msgid="1185286119330160073">"Encender o apagar"</string>
+ <string name="global_action_power_options" msgid="1185286119330160073">"Apagar o reiniciar"</string>
<string name="global_action_restart" msgid="4678451019561687074">"Reiniciar"</string>
<string name="global_action_emergency" msgid="1387617624177105088">"Emergencia"</string>
<string name="global_action_bug_report" msgid="5127867163044170003">"Informe de errores"</string>
diff --git a/core/res/res/values-gu/strings.xml b/core/res/res/values-gu/strings.xml
index 3290919..710e943 100644
--- a/core/res/res/values-gu/strings.xml
+++ b/core/res/res/values-gu/strings.xml
@@ -34,7 +34,7 @@
<string name="defaultMsisdnAlphaTag" msgid="2285034592902077488">"MSISDN1"</string>
<string name="mmiError" msgid="2862759606579822246">"કનેક્શન સમસ્યા અથવા અમાન્ય MMI કોડ."</string>
<string name="mmiFdnError" msgid="3975490266767565852">"ઑપરેશન ફક્ત સ્થિર ડાયલિંગ નંબર્સ પર પ્રતિબંધિત છે."</string>
- <string name="mmiErrorWhileRoaming" msgid="1204173664713870114">"તમે રોમિંગમાં હોવ તે વખતે તમારા ફોન પરથી કૉલ ફોરવર્ડિગ સેટિંગ્સ બદલી શકતાં નથી."</string>
+ <string name="mmiErrorWhileRoaming" msgid="1204173664713870114">"તમે રોમિંગમાં હો તે વખતે તમારા ફોન પરથી કૉલ ફૉરવર્ડિગ સેટિંગ બદલી શકતાં નથી."</string>
<string name="serviceEnabled" msgid="7549025003394765639">"સેવા સક્ષમ હતી."</string>
<string name="serviceEnabledFor" msgid="1463104778656711613">"સેવા આ માટે સક્ષમ હતી:"</string>
<string name="serviceDisabled" msgid="641878791205871379">"સેવા અક્ષમ કરવામાં આવી છે."</string>
@@ -124,7 +124,7 @@
<string name="roamingTextSearching" msgid="5323235489657753486">"સેવા શોધી રહ્યું છે"</string>
<string name="wfcRegErrorTitle" msgid="3193072971584858020">"વાઇ-ફાઇ કૉલિંગ સેટ કરી શકાયું નથી"</string>
<string-array name="wfcOperatorErrorAlertMessages">
- <item msgid="468830943567116703">"વાઇ-ફાઇ પરથી કૉલ કરવા અને સંદેશા મોકલવા માટે પહેલાં તમારા કૅરિઅરને આ સેવા સેટ કરવા માટે કહો. પછી સેટિંગ્સમાંથી વાઇ-ફાઇ કૉલિંગ ફરીથી ચાલુ કરો. (ભૂલ કોડ: <xliff:g id="CODE">%1$s</xliff:g>)"</item>
+ <item msgid="468830943567116703">"વાઇ-ફાઇ પરથી કૉલ કરવા અને સંદેશા મોકલવા માટે પહેલાં તમારા કૅરિઅરને આ સેવા સેટ કરવા માટે કહો. પછી સેટિંગમાંથી વાઇ-ફાઇ કૉલિંગ ફરીથી ચાલુ કરો. (ભૂલ કોડ: <xliff:g id="CODE">%1$s</xliff:g>)"</item>
</string-array>
<string-array name="wfcOperatorErrorNotificationMessages">
<item msgid="4795145070505729156">"તમારા કૅરિઅરમાં વાઇ-ફાઇ કૉલિંગ રજિસ્ટર કરવામાં સમસ્યા આવી: <xliff:g id="CODE">%1$s</xliff:g>"</item>
@@ -401,7 +401,7 @@
<string name="permlab_getPackageSize" msgid="375391550792886641">"ઍપ્લિકેશન સંગ્રહ સ્થાન માપો"</string>
<string name="permdesc_getPackageSize" msgid="742743530909966782">"એપ્લિકેશનને તેનો કોડ, ડેટા અને કેશ કદ પુનઃપ્રાપ્ત કરવાની મંજૂરી આપે છે."</string>
<string name="permlab_writeSettings" msgid="8057285063719277394">"સિસ્ટમ સેટિંગમાં ફેરફાર કરો"</string>
- <string name="permdesc_writeSettings" msgid="8293047411196067188">"એપ્લિકેશનને તમારા સિસ્ટમના સેટિંગ્સ ડેટાને સંશોધિત કરવાની મંજૂરી આપે છે. દુર્ભાવનાપૂર્ણ ઍપ્લિકેશનો તમારા સિસ્ટમની ગોઠવણીને દૂષિત કરી શકે છે."</string>
+ <string name="permdesc_writeSettings" msgid="8293047411196067188">"ઍપને તમારા સિસ્ટમના સેટિંગ ડેટાને સંશોધિત કરવાની મંજૂરી આપે છે. દુર્ભાવનાપૂર્ણ ઍપ તમારા સિસ્ટમની ગોઠવણીને દૂષિત કરી શકે છે."</string>
<string name="permlab_receiveBootCompleted" msgid="6643339400247325379">"સ્ટાર્ટઅપ પર શરૂ કરો"</string>
<string name="permdesc_receiveBootCompleted" product="tablet" msgid="5565659082718177484">"એપ્લિકેશનને સિસ્ટમ બૂટ થવાનું સમાપ્ત કરી લે કે તરત જ પોતાની જાતે પ્રારંભ થવાની મંજૂરી આપે છે. આનાથી ટેબ્લેટને પ્રારંભ થવામાં વધુ લાંબો સમય લાગી શકે છે અને એપ્લિકેશનને હંમેશા ચાલુ રહીને ટેબ્લેટને એકંદર ધીમું કરવાની મંજૂરી આપી શકે છે."</string>
<string name="permdesc_receiveBootCompleted" product="tv" msgid="4900842256047614307">"ઍપને સિસ્ટમ બૂટ થવાનું સમાપ્ત કરી લે કે તરત જ પોતાની જાતે પ્રારંભ થવાની મંજૂરી આપે છે. આનાથી તમારા Android TV ડિવાઇસને શરૂ થવામાં વધુ સમય લાગી શકે છે અને ઍપને હંમેશાં ચાલુ રહીને ડિવાઇસને એકંદર ધીમું કરવાની મંજૂરી આપે છે."</string>
@@ -442,8 +442,8 @@
<string name="permdesc_accessCoarseLocation" msgid="778521847873199160">"ઍપ ઉપયોગમાં હોય તે વખતે સ્થાન સેવાઓમાંથી આ ઍપ તમારું અંદાજિત સ્થાન મેળવી શકે છે. ઍપ સ્થાન મેળવી શકે તે માટે તમારા ડિવાઇસમાં સ્થાન સેવાઓ ચાલુ કરેલી હોવી જરૂરી છે."</string>
<string name="permlab_accessBackgroundLocation" msgid="1721164702777366138">"બૅકગ્રાઉન્ડમાં સ્થાન ઍક્સેસ કરો"</string>
<string name="permdesc_accessBackgroundLocation" msgid="8264885066095638105">"આ ઍપ કોઈપણ સમયે સ્થાનને ઍક્સેસ કરી શકે છે, પછી ભલેને આ ઍપ ઉપયોગમાં ન હોય."</string>
- <string name="permlab_modifyAudioSettings" msgid="6129039778010031815">"તમારી ઑડિઓ સેટિંગ્સ બદલો"</string>
- <string name="permdesc_modifyAudioSettings" msgid="8687227609663124921">"એપ્લિકેશનને વૈશ્વિક ઑડિઓ સેટિંગ્સને સંશોધિત કરવાની મંજૂરી આપે છે, જેમ કે વૉલ્યૂમ અને આઉટપુટ માટે કયા સ્પીકરનો ઉપયોગ કરવો."</string>
+ <string name="permlab_modifyAudioSettings" msgid="6129039778010031815">"તમારા ઑડિયો સેટિંગ બદલો"</string>
+ <string name="permdesc_modifyAudioSettings" msgid="8687227609663124921">"ઍપને વૈશ્વિક ઑડિયો સેટિંગમાં ફેરફાર કરવાની મંજૂરી આપે છે, જેમ કે વૉલ્યૂમ અને આઉટપુટ માટે કયા સ્પીકરનો ઉપયોગ કરવો."</string>
<string name="permlab_recordAudio" msgid="1208457423054219147">"ઑડિઓ રેકોર્ડ કરવાની"</string>
<string name="permdesc_recordAudio" msgid="5857246765327514062">"આ ઍપ ઉપયોગમાં હોય ત્યારે તે માઇક્રોફોનનો ઉપયોગ કરીને ઑડિયો રેકોર્ડ કરી શકે છે."</string>
<string name="permlab_recordBackgroundAudio" msgid="5891032812308878254">"બૅકગ્રાઉન્ડમાં ઑડિયો રેકોર્ડ કરો"</string>
@@ -519,7 +519,7 @@
<string name="permdesc_changeWifiMulticastState" product="tablet" msgid="191079868596433554">"એપ્લિકેશનને ફક્ત તમારા ટેબ્લેટ પર નહીં, પણ મલ્ટિકાસ્ટ સરનામાંનો ઉપયોગ કરીને વાઇ-ફાઇ નેટવર્ક પરના તમામ ઉપકરણોને મોકલાયેલ પૅકેટ્સ પ્રાપ્ત કરવાની મંજૂરી આપે છે. તે બિન-મલ્ટિકાસ્ટ મોડ કરતાં વધુ પાવર વાપરે છે."</string>
<string name="permdesc_changeWifiMulticastState" product="tv" msgid="1336952358450652595">"ઍપને ફક્ત તમારા Android TV ડિવાઇસ પર નહીં, પણ મલ્ટિકાસ્ટ ઍડ્રેસનો ઉપયોગ કરીને વાઇ-ફાઇ નેટવર્ક પરના તમામ ડિવાઇસને મોકલાયેલા પૅકેટ પ્રાપ્ત કરવાની મંજૂરી આપે છે. તે બિન-મલ્ટિકાસ્ટ મોડ કરતાં વધુ પાવર વાપરે છે."</string>
<string name="permdesc_changeWifiMulticastState" product="default" msgid="8296627590220222740">"એપ્લિકેશનને ફક્ત તમારા ફોન પર નહીં, પણ મલ્ટિકાસ્ટ સરનામાંનો ઉપયોગ કરીને વાઇ-ફાઇ નેટવર્ક પર તમામ ઉપકરણોને મોકલાયેલ પૅકેટ્સ પ્રાપ્ત કરવાની મંજૂરી આપે છે. તે બિન-મલ્ટિકાસ્ટ મોડ કરતાં વધુ પાવર વાપરે છે."</string>
- <string name="permlab_bluetoothAdmin" msgid="6490373569441946064">"બ્લૂટૂથ સેટિંગ્સ ઍક્સેસ કરો"</string>
+ <string name="permlab_bluetoothAdmin" msgid="6490373569441946064">"બ્લૂટૂથ સેટિંગ ઍક્સેસ કરો"</string>
<string name="permdesc_bluetoothAdmin" product="tablet" msgid="5370837055438574863">"એપ્લિકેશનને સ્થાનિક બ્લૂટૂથ ટેબ્લેટ ગોઠવવાની અને રિમોટ ઉપકરણો શોધવા અને તેમની સાથે જોડી કરવાની મંજૂરી આપે છે."</string>
<string name="permdesc_bluetoothAdmin" product="tv" msgid="1623992984547014588">"ઍપને તમારા Android TV ડિવાઇસ પર બ્લૂટૂથને ગોઠવવાની અને રિમોટ ડિવાઇસ શોધવા અને તેમની સાથે જોડાણ કરવાની મંજૂરી આપે છે."</string>
<string name="permdesc_bluetoothAdmin" product="default" msgid="7381341743021234863">"એપ્લિકેશનને સ્થાનિક બ્લૂટૂથ ફોન ગોઠવવાની અને રિમોટ ઉપકરણો શોધવા અને તેમની સાથે જોડી કરવાની મંજૂરી આપે છે."</string>
@@ -662,10 +662,10 @@
<string-array name="face_error_vendor">
</string-array>
<string name="face_icon_content_description" msgid="465030547475916280">"ચહેરા આઇકન"</string>
- <string name="permlab_readSyncSettings" msgid="6250532864893156277">"સમન્વયન સેટિંગ્સ વાંચો"</string>
- <string name="permdesc_readSyncSettings" msgid="1325658466358779298">"ઍપ્લિકેશનને એકાઉન્ટ માટે સમન્વયન સેટિંગ્સને વાંચવાની મંજૂરી આપે છે. ઉદાહરણ તરીકે, આ એકાઉન્ટ સાથે લોકો ઍપ્લિકેશન સમન્વયિત થઈ છે કે કેમ તે નિર્ધારિત કરી શકે છે."</string>
+ <string name="permlab_readSyncSettings" msgid="6250532864893156277">"સિંક સેટિંગ વાંચો"</string>
+ <string name="permdesc_readSyncSettings" msgid="1325658466358779298">"ઍપને એકાઉન્ટ માટે સિંક સેટિંગને વાંચવાની મંજૂરી આપે છે. ઉદાહરણ તરીકે, આ એકાઉન્ટ સાથે લોકો ઍપ સિંક થઈ છે કે કેમ તે નિર્ધારિત કરી શકે છે."</string>
<string name="permlab_writeSyncSettings" msgid="6583154300780427399">"સમન્વયન ચાલુ અને બંધ ટોગલ કરો"</string>
- <string name="permdesc_writeSyncSettings" msgid="6029151549667182687">"એપ્લિકેશનને એકાઉન્ટ માટે સમન્વયન સેટિંગ્સ સંશોધિત કરવાની મંજૂરી આપે છે. ઉદાહરણ તરીકે, આનો ઉપયોગ એકાઉન્ટ સાથે લોકો એપ્લિકેશનના સમન્વયનને સક્ષમ કરવા માટે થઈ શકે છે."</string>
+ <string name="permdesc_writeSyncSettings" msgid="6029151549667182687">"ઍપને એકાઉન્ટ માટે સિંક સેટિંગમાં ફેરફાર કરવાની મંજૂરી આપે છે. ઉદાહરણ તરીકે, આનો ઉપયોગ એકાઉન્ટ સાથે લોકો ઍપના સિંકને ચાલુ કરવા માટે થઈ શકે છે."</string>
<string name="permlab_readSyncStats" msgid="3747407238320105332">"સમન્વયન આંકડા વાંચો"</string>
<string name="permdesc_readSyncStats" msgid="3867809926567379434">"એપ્લિકેશનને સમન્વયન ઇવેન્ટ્સનો ઇતિહાસ અને કેટલો ડેટા સમન્વયિત થયો છે તે સહિત કોઈ એકાઉન્ટ માટેનાં સમન્વયન આંકડા વાંચવાની મંજૂરી આપે છે."</string>
<string name="permlab_sdcardRead" msgid="5791467020950064920">"તમારા શેર કરેલા સ્ટોરેજના કન્ટેન્ટને વાંચો"</string>
@@ -1211,7 +1211,7 @@
<string name="whichImageCaptureApplicationLabel" msgid="6505433734824988277">"છબી કૅપ્ચર કરો"</string>
<string name="alwaysUse" msgid="3153558199076112903">"આ ક્રિયા માટે ડિફોલ્ટ તરીકે ઉપયોગમાં લો."</string>
<string name="use_a_different_app" msgid="4987790276170972776">"અલગ એપ્લિકેશનનો ઉપયોગ કરો"</string>
- <string name="clearDefaultHintMsg" msgid="1325866337702524936">"સિસ્ટમ સેટિંગ્સ > ઍપ્લિકેશનો > ડાઉનલોડ કરેલમાં ડિફોલ્ટ સાફ કરો."</string>
+ <string name="clearDefaultHintMsg" msgid="1325866337702524936">"સિસ્ટમ સેટિંગ > ઍપ > ડાઉનલોડ કરેલામાં ડિફૉલ્ટ સાફ કરો."</string>
<string name="chooseActivity" msgid="8563390197659779956">"એક ક્રિયા પસંદ કરો"</string>
<string name="chooseUsbActivity" msgid="2096269989990986612">"USB ઉપકરણ માટે ઍપ્લિકેશન પસંદ કરો"</string>
<string name="noApplications" msgid="1186909265235544019">"કોઈ ઍપ્લિકેશન આ ક્રિયા કરી શકતી નથી."</string>
@@ -1239,8 +1239,8 @@
<string name="launch_warning_original" msgid="3332206576800169626">"<xliff:g id="APP_NAME">%1$s</xliff:g> મૂળરૂપે લોંચ થઈ હતી."</string>
<string name="screen_compat_mode_scale" msgid="8627359598437527726">"સ્કેલ"</string>
<string name="screen_compat_mode_show" msgid="5080361367584709857">"હંમેશા બતાવો"</string>
- <string name="screen_compat_mode_hint" msgid="4032272159093750908">"આને સિસ્ટમ સેટિંગ્સ > ઍપ્લિકેશનો > ડાઉનલોડ કરેલમાં ફરીથી સક્ષમ કરો."</string>
- <string name="unsupported_display_size_message" msgid="7265211375269394699">"<xliff:g id="APP_NAME">%1$s</xliff:g> વર્તમાન પ્રદર્શન કદની સેટિંગનું સમર્થન કરતું નથી અને અનપેક્ષિત રીતે વર્તી શકે છે."</string>
+ <string name="screen_compat_mode_hint" msgid="4032272159093750908">"આને સિસ્ટમ સેટિંગ > ઍપ > ડાઉનલોડ કરેલામાં ફરીથી ચાલુ કરો."</string>
+ <string name="unsupported_display_size_message" msgid="7265211375269394699">"<xliff:g id="APP_NAME">%1$s</xliff:g> વર્તમાન ડિસ્પ્લે કદની સેટિંગને સપોર્ટ કરતું નથી અને અનપેક્ષિત રીતે વર્તી શકે છે."</string>
<string name="unsupported_display_size_show" msgid="980129850974919375">"હંમેશાં બતાવો"</string>
<string name="unsupported_compile_sdk_message" msgid="7326293500707890537">"<xliff:g id="APP_NAME">%1$s</xliff:g>ને Android OSના અસંગત વર્ઝન માટે બનાવવામાં આવ્યું હતું અને તે અનપેક્ષિત રીતે કાર્ય કરી શકે છે. ઍપનું અપડેટ કરેલ વર્ઝન ઉપલબ્ધ હોઈ શકે છે."</string>
<string name="unsupported_compile_sdk_show" msgid="1601210057960312248">"હંમેશાં બતાવો"</string>
@@ -1336,7 +1336,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">"સિમ કાર્ડ કાઢી નાખ્યો"</string>
@@ -1503,7 +1503,7 @@
<string name="vpn_lockdown_connected" msgid="2853127976590658469">"હંમેશા-ચાલુ VPN કનેક્ટ થયું"</string>
<string name="vpn_lockdown_disconnected" msgid="5573611651300764955">"હંમેશાં-ચાલુ VPN થી ડિસ્કનેક્ટ થયું"</string>
<string name="vpn_lockdown_error" msgid="4453048646854247947">"હંમેશાં-ચાલુ VPN સાથે કનેક્ટ કરી શકાયું નથી"</string>
- <string name="vpn_lockdown_config" msgid="8331697329868252169">"નેટવર્ક અથવા VPN સેટિંગ્સ બદલો"</string>
+ <string name="vpn_lockdown_config" msgid="8331697329868252169">"નેટવર્ક અથવા VPN સેટિંગ બદલો"</string>
<string name="upload_file" msgid="8651942222301634271">"ફાઇલ પસંદ કરો"</string>
<string name="no_file_chosen" msgid="4146295695162318057">"કોઈ ફાઇલ પસંદ કરેલી નથી"</string>
<string name="reset" msgid="3865826612628171429">"ફરીથી સેટ કરો"</string>
@@ -1617,7 +1617,7 @@
<string name="SetupCallDefault" msgid="5581740063237175247">"કૉલ સ્વીકારીએ?"</string>
<string name="activity_resolver_use_always" msgid="5575222334666843269">"હંમેશાં"</string>
<string name="activity_resolver_use_once" msgid="948462794469672658">"ફક્ત એક વાર"</string>
- <string name="activity_resolver_work_profiles_support" msgid="4071345609235361269">"%1$s કાર્ય પ્રોફાઇલનું સમર્થન કરતું નથી"</string>
+ <string name="activity_resolver_work_profiles_support" msgid="4071345609235361269">"%1$s ઑફિસની પ્રોફાઇલને સપોર્ટ કરતું નથી"</string>
<string name="default_audio_route_name" product="tablet" msgid="367936735632195517">"ટેબ્લેટ"</string>
<string name="default_audio_route_name" product="tv" msgid="4908971385068087367">"TV"</string>
<string name="default_audio_route_name" product="default" msgid="9213546147739983977">"ફોન"</string>
@@ -2068,7 +2068,7 @@
<string name="popup_window_default_title" msgid="6907717596694826919">"પૉપઅપ વિંડો"</string>
<string name="slice_more_content" msgid="3377367737876888459">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
<string name="shortcut_restored_on_lower_version" msgid="9206301954024286063">"આ ઍપનું વર્ઝન ડાઉનગ્રેડ કરવામાં આવ્યું છે અથવા આ શૉર્ટકટ સાથે સુસંગત નથી"</string>
- <string name="shortcut_restore_not_supported" msgid="4763198938588468400">"શૉર્ટકટ ફરી મેળવી શકાયો નથી કારણ કે ઍપ બૅકઅપ અને ફરી મેળવવાનું સમર્થન કરતી નથી"</string>
+ <string name="shortcut_restore_not_supported" msgid="4763198938588468400">"શૉર્ટકટ ફરી મેળવી શકાયો નથી કારણ કે ઍપ બૅકઅપ અને ફરી મેળવવાને સપોર્ટ કરતી નથી"</string>
<string name="shortcut_restore_signature_mismatch" msgid="579345304221605479">"શૉર્ટકટ ફરી મેળવી શકાયો નથી કારણ કે ઍપમાં છે તે સહી મેળ ખાતી નથી"</string>
<string name="shortcut_restore_unknown_issue" msgid="2478146134395982154">"શૉર્ટકટ પાછો મેળવી શકાયો નથી"</string>
<string name="shortcut_disabled_reason_unknown" msgid="753074793553599166">"શૉર્ટકટને બંધ કરવામાં આવ્યો છે"</string>
diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml
index b66d5f6..414d0bd 100644
--- a/core/res/res/values-sl/strings.xml
+++ b/core/res/res/values-sl/strings.xml
@@ -434,7 +434,7 @@
<string name="permdesc_bodySensors" product="default" msgid="2365357960407973997">"Aplikaciji omogoča dostop do podatkov tipal, ki nadzirajo vaše fizično stanje, med drugim vaš srčni utrip."</string>
<string name="permlab_readCalendar" msgid="6408654259475396200">"Branje dogodkov v koledarjih in podrobnosti koledarjev"</string>
<string name="permdesc_readCalendar" product="tablet" msgid="515452384059803326">"Ta aplikacija lahko prebere vse dogodke v koledarju, ki so shranjeni v tabličnem računalniku, ter shrani podatke koledarja ali jih deli z drugimi."</string>
- <string name="permdesc_readCalendar" product="tv" msgid="5811726712981647628">"Ta aplikacija lahko prebere vse dogodke v koledarju, ki so shranjeni v napravi Android TV, ter shrani podatke koledarja ali jih da v skupno rabo z drugimi."</string>
+ <string name="permdesc_readCalendar" product="tv" msgid="5811726712981647628">"Ta aplikacija lahko prebere vse dogodke v koledarju, ki so shranjeni v napravi Android TV, ter shrani podatke koledarja ali jih deli z drugimi."</string>
<string name="permdesc_readCalendar" product="default" msgid="9118823807655829957">"Ta aplikacija lahko prebere vse dogodke v koledarju, ki so shranjeni v telefonu, ter shrani podatke koledarja ali jih deli z drugimi."</string>
<string name="permlab_writeCalendar" msgid="6422137308329578076">"dodajanje ali spreminjanje dogodkov v koledarju in pošiljanje e-pošte gostom brez vedenja lastnikov"</string>
<string name="permdesc_writeCalendar" product="tablet" msgid="8722230940717092850">"Ta aplikacija lahko dodaja, odstranjuje in spreminja dogodke v koledarju, ki so shranjeni v tabličnem računalniku. Ta aplikacija lahko pošilja sporočila, ki bodo morda videti, kot da prihajajo od lastnikov koledarjev, ali spreminja dogodke brez vednosti lastnikov."</string>
@@ -932,7 +932,7 @@
<string name="lockscreen_forgot_pattern_button_text" msgid="8362442730606839031">"Ali ste pozabili vzorec?"</string>
<string name="lockscreen_glogin_forgot_pattern" msgid="9218940117797602518">"Odklepanje računa"</string>
<string name="lockscreen_glogin_too_many_attempts" msgid="3775904917743034195">"Preveč poskusov vzorca"</string>
- <string name="lockscreen_glogin_instructions" msgid="4695162942525531700">"Če želite odkleniti telefon, se prijavite z Google Računom."</string>
+ <string name="lockscreen_glogin_instructions" msgid="4695162942525531700">"Če želite odkleniti telefon, se prijavite z računom Google."</string>
<string name="lockscreen_glogin_username_hint" msgid="6916101478673157045">"Uporabniško ime (e-pošta)"</string>
<string name="lockscreen_glogin_password_hint" msgid="3031027901286812848">"Geslo"</string>
<string name="lockscreen_glogin_submit_button" msgid="3590556636347843733">"Prijava"</string>
@@ -1238,8 +1238,8 @@
<string name="whichEditApplicationNamed" msgid="8096494987978521514">"Urejanje z aplikacijo %1$s"</string>
<string name="whichEditApplicationLabel" msgid="1463288652070140285">"Urejanje"</string>
<string name="whichSendApplication" msgid="4143847974460792029">"Deljenje z drugimi"</string>
- <string name="whichSendApplicationNamed" msgid="4470386782693183461">"Skupna raba z aplikacijo %1$s"</string>
- <string name="whichSendApplicationLabel" msgid="7467813004769188515">"Skupna raba"</string>
+ <string name="whichSendApplicationNamed" msgid="4470386782693183461">"Deljenje z aplikacijo %1$s"</string>
+ <string name="whichSendApplicationLabel" msgid="7467813004769188515">"Deljenje"</string>
<string name="whichSendToApplication" msgid="77101541959464018">"Pošiljanje z aplikacijo"</string>
<string name="whichSendToApplicationNamed" msgid="3385686512014670003">"Pošiljanje z aplikacijo %1$s"</string>
<string name="whichSendToApplicationLabel" msgid="3543240188816513303">"Pošiljanje"</string>
@@ -1401,14 +1401,14 @@
<string name="perm_costs_money" msgid="749054595022779685">"to je lahko plačljivo"</string>
<string name="dlg_ok" msgid="5103447663504839312">"V redu"</string>
<string name="usb_charging_notification_title" msgid="1674124518282666955">"Polnjenje naprave prek USB-ja"</string>
- <string name="usb_supplying_notification_title" msgid="5378546632408101811">"Polnjenje akumulatorja v povezani napravi prek USB-ja"</string>
+ <string name="usb_supplying_notification_title" msgid="5378546632408101811">"Polnjenje baterije v povezani napravi prek USB-ja"</string>
<string name="usb_mtp_notification_title" msgid="1065989144124499810">"Vklopljen je prenos datotek prek USB-ja"</string>
<string name="usb_ptp_notification_title" msgid="5043437571863443281">"Vklopljen je način PTP prek USB-ja"</string>
<string name="usb_tether_notification_title" msgid="8828527870612663771">"Vklopljen je internet prek USB-ja"</string>
<string name="usb_midi_notification_title" msgid="7404506788950595557">"Vklopljen je način MIDI prek USB-ja"</string>
<string name="usb_accessory_notification_title" msgid="1385394660861956980">"Dodatek USB je priključen"</string>
<string name="usb_notification_message" msgid="4715163067192110676">"Dotaknite se za več možnosti."</string>
- <string name="usb_power_notification_message" msgid="7284765627437897702">"Polnjenje akumulatorja v povezani napravi. Dotaknite se za več možnosti."</string>
+ <string name="usb_power_notification_message" msgid="7284765627437897702">"Polnjenje baterije v povezani napravi. Dotaknite se za več možnosti."</string>
<string name="usb_unsupported_audio_accessory_title" msgid="2335775548086533065">"Zaznana je analogna dodatna zvočna oprema"</string>
<string name="usb_unsupported_audio_accessory_message" msgid="1300168007129796621">"Priključena naprava ni združljiva s tem telefonom. Dotaknite se za več informacij."</string>
<string name="adb_active_notification_title" msgid="408390247354560331">"Iskanje napak prek USB-ja je povezano"</string>
@@ -1428,8 +1428,8 @@
<string name="taking_remote_bugreport_notification_title" msgid="1582531382166919850">"Zajemanje poročila o napakah …"</string>
<string name="share_remote_bugreport_notification_title" msgid="6708897723753334999">"Želite poslati poročilo o napakah?"</string>
<string name="sharing_remote_bugreport_notification_title" msgid="3077385149217638550">"Pošiljanje poročila o napakah …"</string>
- <string name="share_remote_bugreport_notification_message_finished" msgid="7325635795739260135">"Skrbnik je zahteval poročilo o napakah za pomoč pri odpravljanju napak v tej napravi. Aplikacije in podatki bodo morda dani v skupno rabo."</string>
- <string name="share_remote_bugreport_action" msgid="7630880678785123682">"SKUPNA RABA"</string>
+ <string name="share_remote_bugreport_notification_message_finished" msgid="7325635795739260135">"Skrbnik je zahteval poročilo o napakah za pomoč pri odpravljanju napak v tej napravi. Aplikacije in podatki bodo morda deljeni."</string>
+ <string name="share_remote_bugreport_action" msgid="7630880678785123682">"DELJENJE"</string>
<string name="decline_remote_bugreport_action" msgid="4040894777519784346">"NE SPREJMEM"</string>
<string name="select_input_method" msgid="3971267998568587025">"Izberite način vnosa"</string>
<string name="show_ime" msgid="6406112007347443383">"Ohrani na zaslonu, dokler je aktivna fizična tipkovnica"</string>
@@ -1617,7 +1617,7 @@
<string name="action_menu_overflow_description" msgid="4579536843510088170">"Več možnosti"</string>
<string name="action_bar_home_description_format" msgid="5087107531331621803">"%1$s, %2$s"</string>
<string name="action_bar_home_subtitle_description_format" msgid="4346835454749569826">"%1$s, %2$s, %3$s"</string>
- <string name="storage_internal" msgid="8490227947584914460">"Notranja shramba v skupni rabi"</string>
+ <string name="storage_internal" msgid="8490227947584914460">"Notranja deljena shramba"</string>
<string name="storage_sd_card" msgid="3404740277075331881">"Kartica SD"</string>
<string name="storage_sd_card_label" msgid="7526153141147470509">"Kartica SD <xliff:g id="MANUFACTURER">%s</xliff:g>"</string>
<string name="storage_usb_drive" msgid="448030813201444573">"Pogon USB"</string>
@@ -1710,7 +1710,7 @@
<string name="kg_invalid_puk" msgid="4809502818518963344">"Vnovič vnesite pravilno kodo PUK. Večkratni poskusi bodo trajno onemogočili kartico SIM."</string>
<string name="kg_invalid_confirm_pin_hint" product="default" msgid="4705368340409816254">"Kodi PIN se ne ujemata"</string>
<string name="kg_login_too_many_attempts" msgid="699292728290654121">"Preveč poskusov vzorca"</string>
- <string name="kg_login_instructions" msgid="3619844310339066827">"Če želite odkleniti napravo, se prijavite z Google Računom."</string>
+ <string name="kg_login_instructions" msgid="3619844310339066827">"Če želite odkleniti napravo, se prijavite z računom Google."</string>
<string name="kg_login_username_hint" msgid="1765453775467133251">"Uporabniško ime (e-pošta)"</string>
<string name="kg_login_password_hint" msgid="3330530727273164402">"Geslo"</string>
<string name="kg_login_submit_button" msgid="893611277617096870">"Prijava"</string>
diff --git a/core/res/res/values-sq/strings.xml b/core/res/res/values-sq/strings.xml
index bf04c0e..16edb81 100644
--- a/core/res/res/values-sq/strings.xml
+++ b/core/res/res/values-sq/strings.xml
@@ -1198,7 +1198,7 @@
<string name="whichEditApplicationNamed" msgid="8096494987978521514">"Redakto me %1$s"</string>
<string name="whichEditApplicationLabel" msgid="1463288652070140285">"Redakto"</string>
<string name="whichSendApplication" msgid="4143847974460792029">"Ndaj"</string>
- <string name="whichSendApplicationNamed" msgid="4470386782693183461">"Shpërnda publikisht me %1$s"</string>
+ <string name="whichSendApplicationNamed" msgid="4470386782693183461">"Shpërndaj me %1$s"</string>
<string name="whichSendApplicationLabel" msgid="7467813004769188515">"Ndaj"</string>
<string name="whichSendToApplication" msgid="77101541959464018">"Dërgo me"</string>
<string name="whichSendToApplicationNamed" msgid="3385686512014670003">"Dërgo me %1$s"</string>
@@ -1566,8 +1566,8 @@
<string name="keyboardview_keycode_enter" msgid="168054869339091055">"Enter"</string>
<string name="activitychooserview_choose_application" msgid="3500574466367891463">"Zgjidh një aplikacion"</string>
<string name="activitychooserview_choose_application_error" msgid="6937782107559241734">"Nuk mundi ta hapte <xliff:g id="APPLICATION_NAME">%s</xliff:g>"</string>
- <string name="shareactionprovider_share_with" msgid="2753089758467748982">"Shpërnda publikisht me"</string>
- <string name="shareactionprovider_share_with_application" msgid="4902832247173666973">"Shpërnda me <xliff:g id="APPLICATION_NAME">%s</xliff:g>"</string>
+ <string name="shareactionprovider_share_with" msgid="2753089758467748982">"Shpërndaj me"</string>
+ <string name="shareactionprovider_share_with_application" msgid="4902832247173666973">"Shpërndaj me <xliff:g id="APPLICATION_NAME">%s</xliff:g>"</string>
<string name="content_description_sliding_handle" msgid="982510275422590757">"Dorezë me rrëshqitje. Preke dhe mbaje të shtypur."</string>
<string name="description_target_unlock_tablet" msgid="7431571180065859551">"Rrëshqit për të shkyçur."</string>
<string name="action_bar_home_description" msgid="1501655419158631974">"Orientohu për në shtëpi"</string>
@@ -1611,7 +1611,7 @@
<string name="sha1_fingerprint" msgid="2339915142825390774">"Gjurma e gishtit SHA-1:"</string>
<string name="activity_chooser_view_see_all" msgid="3917045206812726099">"Shikoji të gjitha"</string>
<string name="activity_chooser_view_dialog_title_default" msgid="8880731437191978314">"Zgjidh aktivitetin"</string>
- <string name="share_action_provider_share_with" msgid="1904096863622941880">"Shpërnda publikisht me"</string>
+ <string name="share_action_provider_share_with" msgid="1904096863622941880">"Shpërndaj me"</string>
<string name="sending" msgid="206925243621664438">"Po dërgon…"</string>
<string name="launchBrowserDefault" msgid="6328349989932924119">"Të hapet shfletuesi?"</string>
<string name="SetupCallDefault" msgid="5581740063237175247">"Dëshiron ta pranosh telefonatën?"</string>
diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml
index 1b54981..e494ef0 100644
--- a/core/res/res/values-sv/strings.xml
+++ b/core/res/res/values-sv/strings.xml
@@ -572,7 +572,7 @@
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Autentiseringen avbröts"</string>
<string name="biometric_not_recognized" msgid="5106687642694635888">"Identifierades inte"</string>
<string name="biometric_error_canceled" msgid="8266582404844179778">"Autentiseringen avbröts"</string>
- <string name="biometric_error_device_not_secured" msgid="3129845065043995924">"Pinkod, grafiskt lösenord eller lösenord har inte angetts"</string>
+ <string name="biometric_error_device_not_secured" msgid="3129845065043995924">"Pinkod, mönster eller lösenord har inte angetts"</string>
<string name="biometric_error_generic" msgid="6784371929985434439">"Ett fel uppstod vid autentiseringen"</string>
<string name="screen_lock_app_setting_name" msgid="6054944352976789228">"Använd skärmlåset"</string>
<string name="screen_lock_dialog_default_subtitle" msgid="120359538048533695">"Fortsätt med hjälp av ditt skärmlås"</string>
@@ -881,7 +881,7 @@
<string name="lockscreen_screen_locked" msgid="7364905540516041817">"Skärmen har låsts."</string>
<string name="lockscreen_instructions_when_pattern_enabled" msgid="7982445492532123308">"Tryck på Menu för att låsa upp eller ringa nödsamtal."</string>
<string name="lockscreen_instructions_when_pattern_disabled" msgid="7434061749374801753">"Tryck på Menu för att låsa upp."</string>
- <string name="lockscreen_pattern_instructions" msgid="3169991838169244941">"Rita grafiskt lösenord för att låsa upp"</string>
+ <string name="lockscreen_pattern_instructions" msgid="3169991838169244941">"Rita mönster för att låsa upp"</string>
<string name="lockscreen_emergency_call" msgid="7549683825868928636">"Nödsamtal"</string>
<string name="lockscreen_return_to_call" msgid="3156883574692006382">"Tillbaka till samtal"</string>
<string name="lockscreen_pattern_correct" msgid="8050630103651508582">"Korrekt!"</string>
@@ -925,7 +925,7 @@
<string name="lockscreen_too_many_failed_attempts_countdown" msgid="6807200118164539589">"Försök igen om <xliff:g id="NUMBER">%d</xliff:g> sekunder."</string>
<string name="lockscreen_forgot_pattern_button_text" msgid="8362442730606839031">"Glömt ditt grafiska lösenord?"</string>
<string name="lockscreen_glogin_forgot_pattern" msgid="9218940117797602518">"Lås upp konto"</string>
- <string name="lockscreen_glogin_too_many_attempts" msgid="3775904917743034195">"För många försök med grafiskt lösenord"</string>
+ <string name="lockscreen_glogin_too_many_attempts" msgid="3775904917743034195">"För många försök med mönster"</string>
<string name="lockscreen_glogin_instructions" msgid="4695162942525531700">"Logga in med ditt Google-konto om du vill låsa upp."</string>
<string name="lockscreen_glogin_username_hint" msgid="6916101478673157045">"Användarnamn (e-post)"</string>
<string name="lockscreen_glogin_password_hint" msgid="3031027901286812848">"Lösenord"</string>
@@ -936,12 +936,12 @@
<string name="lockscreen_unlock_label" msgid="4648257878373307582">"Lås upp"</string>
<string name="lockscreen_sound_on_label" msgid="1660281470535492430">"Ljud på"</string>
<string name="lockscreen_sound_off_label" msgid="2331496559245450053">"Ljud av"</string>
- <string name="lockscreen_access_pattern_start" msgid="3778502525702613399">"Skriver grafiskt lösenord"</string>
- <string name="lockscreen_access_pattern_cleared" msgid="7493849102641167049">"Grafiskt lösenord har tagits bort"</string>
+ <string name="lockscreen_access_pattern_start" msgid="3778502525702613399">"Ritar mönster"</string>
+ <string name="lockscreen_access_pattern_cleared" msgid="7493849102641167049">"Mönster har tagits bort"</string>
<string name="lockscreen_access_pattern_cell_added" msgid="6746676335293144163">"En cell har lagts till"</string>
<string name="lockscreen_access_pattern_cell_added_verbose" msgid="2931364927622563465">"Cell <xliff:g id="CELL_INDEX">%1$s</xliff:g> har lagts till"</string>
- <string name="lockscreen_access_pattern_detected" msgid="3931150554035194012">"Grafiskt lösenord har slutförts"</string>
- <string name="lockscreen_access_pattern_area" msgid="1288780416685002841">"Fält för grafiskt lösenord."</string>
+ <string name="lockscreen_access_pattern_detected" msgid="3931150554035194012">"Mönster har slutförts"</string>
+ <string name="lockscreen_access_pattern_area" msgid="1288780416685002841">"Fält för mönster."</string>
<string name="keyguard_accessibility_widget_changed" msgid="7298011259508200234">"%1$s. Widget %2$d av %3$d."</string>
<string name="keyguard_accessibility_add_widget" msgid="8245795023551343672">"Lägg till en widget."</string>
<string name="keyguard_accessibility_widget_empty_slot" msgid="544239307077644480">"Tom"</string>
@@ -957,13 +957,13 @@
<string name="keyguard_accessibility_widget_deleted" msgid="1509738950119878705">"Widgeten <xliff:g id="WIDGET_INDEX">%1$s</xliff:g> har tagits bort."</string>
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"Expandera upplåsningsytan."</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"Lås upp genom att dra."</string>
- <string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"Lås upp med grafiskt lösenord."</string>
+ <string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"Lås upp med mönster."</string>
<string name="keyguard_accessibility_face_unlock" msgid="4533832120787386728">"Ansiktslås."</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"Lås upp med PIN-kod."</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"Lås upp med SIM-kortets pinkod."</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"Lås upp med SIM-kortets PUK-kod."</string>
<string name="keyguard_accessibility_password_unlock" msgid="6130186108581153265">"Lås upp med lösenord."</string>
- <string name="keyguard_accessibility_pattern_area" msgid="1419570880512350689">"Fält för grafiskt lösenord."</string>
+ <string name="keyguard_accessibility_pattern_area" msgid="1419570880512350689">"Fält för mönster."</string>
<string name="keyguard_accessibility_slide_area" msgid="4331399051142520176">"Fält med dragreglage."</string>
<string name="password_keyboard_label_symbol_key" msgid="2716255580853511949">"?123"</string>
<string name="password_keyboard_label_alpha_key" msgid="5294837425652726684">"ABC"</string>
@@ -1645,7 +1645,7 @@
<string name="display_manager_overlay_display_title" msgid="1480158037150469170">"<xliff:g id="NAME">%1$s</xliff:g>: <xliff:g id="WIDTH">%2$d</xliff:g> x <xliff:g id="HEIGHT">%3$d</xliff:g>, <xliff:g id="DPI">%4$d</xliff:g> dpi"</string>
<string name="display_manager_overlay_display_secure_suffix" msgid="2810034719482834679">", säker"</string>
<string name="kg_forgot_pattern_button_text" msgid="406145459223122537">"Har du glömt ditt grafiska lösenord?"</string>
- <string name="kg_wrong_pattern" msgid="1342812634464179931">"Fel grafiskt lösenord"</string>
+ <string name="kg_wrong_pattern" msgid="1342812634464179931">"Fel mönster"</string>
<string name="kg_wrong_password" msgid="2384677900494439426">"Fel lösenord"</string>
<string name="kg_wrong_pin" msgid="3680925703673166482">"Fel PIN-kod"</string>
<plurals name="kg_too_many_failed_attempts_countdown" formatted="false" msgid="236717428673283568">
@@ -1665,7 +1665,7 @@
<string name="kg_invalid_sim_puk_hint" msgid="2539364558870734339">"PUK-koden ska vara åtta siffror."</string>
<string name="kg_invalid_puk" msgid="4809502818518963344">"Ange rätt PUK-kod igen. Om försöken upprepas inaktiveras SIM-kortet permanent."</string>
<string name="kg_invalid_confirm_pin_hint" product="default" msgid="4705368340409816254">"PIN-koderna stämmer inte överens"</string>
- <string name="kg_login_too_many_attempts" msgid="699292728290654121">"För många försök med grafiskt lösenord"</string>
+ <string name="kg_login_too_many_attempts" msgid="699292728290654121">"För många försök med mönster"</string>
<string name="kg_login_instructions" msgid="3619844310339066827">"Logga in med ditt Google-konto om du vill låsa upp."</string>
<string name="kg_login_username_hint" msgid="1765453775467133251">"Användarnamn (e-post)"</string>
<string name="kg_login_password_hint" msgid="3330530727273164402">"Lösenord"</string>
diff --git a/core/res/res/values-te/strings.xml b/core/res/res/values-te/strings.xml
index 01d0226..9a4d41b 100644
--- a/core/res/res/values-te/strings.xml
+++ b/core/res/res/values-te/strings.xml
@@ -815,7 +815,7 @@
<string name="phoneTypeTtyTdd" msgid="532038552105328779">"TTY TDD"</string>
<string name="phoneTypeWorkMobile" msgid="7522314392003565121">"కార్యాలయ మొబైల్"</string>
<string name="phoneTypeWorkPager" msgid="3748332310638505234">"కార్యాలయ పేజర్"</string>
- <string name="phoneTypeAssistant" msgid="757550783842231039">"Assistant"</string>
+ <string name="phoneTypeAssistant" msgid="757550783842231039">"అసిస్టెంట్"</string>
<string name="phoneTypeMms" msgid="1799747455131365989">"MMS"</string>
<string name="eventTypeCustom" msgid="3257367158986466481">"అనుకూలం"</string>
<string name="eventTypeBirthday" msgid="7770026752793912283">"పుట్టినరోజు"</string>
diff --git a/core/res/res/values/dimens_car.xml b/core/res/res/values/dimens_car.xml
index 0ef60c4..36f1edb 100644
--- a/core/res/res/values/dimens_car.xml
+++ b/core/res/res/values/dimens_car.xml
@@ -110,10 +110,10 @@
<dimen name="car_textview_fading_edge_length">40dp</dimen>
<!-- Dialog start padding for button bar layout -->
- <dimen name="button_bar_layout_start_padding">@*android:dimen/car_keyline_1</dimen>
+ <dimen name="button_bar_layout_start_padding">@dimen/car_padding_2</dimen>
<!-- Dialog end padding for button bar layout -->
- <dimen name="button_bar_layout_end_padding">@*android:dimen/car_keyline_1</dimen>
+ <dimen name="button_bar_layout_end_padding">@dimen/car_padding_2</dimen>
<!-- Dialog top padding for button bar layout -->
<dimen name="button_bar_layout_top_padding">@*android:dimen/car_padding_2</dimen>
@@ -122,7 +122,7 @@
<dimen name="button_layout_height">@*android:dimen/car_card_action_bar_height</dimen>
<!-- Dialog button end margin -->
- <dimen name="button_end_margin">@*android:dimen/car_padding_4</dimen>
+ <dimen name="button_end_margin">@*android:dimen/car_padding_2</dimen>
<!-- Dialog top padding when there is no title -->
<dimen name="dialog_no_title_padding_top">@*android:dimen/car_padding_4</dimen>
diff --git a/core/res/res/xml/config_user_types.xml b/core/res/res/xml/config_user_types.xml
index 71dfc55..7663150 100644
--- a/core/res/res/xml/config_user_types.xml
+++ b/core/res/res/xml/config_user_types.xml
@@ -62,6 +62,10 @@
<default-restrictions no_sms="true" no_outgoing_calls="true" />
</profile-type>
+ <full-type
+ name="android.os.usertype.full.RESTRICTED"
+ enabled='0' />
+
<profile-type
name="com.example.profilename"
max-allowed-per-parent="2" />
@@ -78,6 +82,7 @@
Supported optional properties (to be used as shown in the example above) are as follows.
For profile and full users:
default-restrictions (with values defined in UserRestrictionUtils.USER_RESTRICTIONS)
+ enabled
For profile users only:
max-allowed-per-parent
icon-badge
@@ -98,6 +103,9 @@
Note, however, that default-restrictions refers to the restrictions applied at the time of user
creation; therefore, the active restrictions of any pre-existing users will not be updated.
+If a user type is disabled, by setting enabled='0', then no further users of that type may be
+created; however, any pre-existing users of that type will remain.
+
The 'change-user-type' tag should be used in conjunction with the 'version' property of
'user-types'. It defines a type change for all pre-existing users of 'from' type to the new 'to'
type, if the former 'user-type's version of device is less than or equal to 'whenVersionLeq'.
diff --git a/core/tests/coretests/src/android/app/appsearch/AppSearchSessionUnitTest.java b/core/tests/coretests/src/android/app/appsearch/AppSearchSessionUnitTest.java
index d51004c..07e4333 100644
--- a/core/tests/coretests/src/android/app/appsearch/AppSearchSessionUnitTest.java
+++ b/core/tests/coretests/src/android/app/appsearch/AppSearchSessionUnitTest.java
@@ -16,6 +16,8 @@
package android.app.appsearch;
+import static android.app.appsearch.SearchSpec.TERM_MATCH_PREFIX;
+
import static com.google.common.truth.Truth.assertThat;
import static org.testng.Assert.expectThrows;
@@ -30,6 +32,8 @@
import org.junit.Before;
import org.junit.Test;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
@@ -100,4 +104,127 @@
.isEqualTo(AppSearchResult.RESULT_INTERNAL_ERROR);
assertThat(appSearchException.getMessage()).startsWith("NullPointerException");
}
+
+ @Test
+ public void testGetEmptyNextPage() throws Exception {
+ // Set the schema.
+ CompletableFuture<AppSearchResult<SetSchemaResponse>> schemaFuture =
+ new CompletableFuture<>();
+ mSearchSession.setSchema(
+ new SetSchemaRequest.Builder()
+ .addSchemas(new AppSearchSchema.Builder("schema1").build())
+ .setForceOverride(true).build(),
+ mExecutor, mExecutor, schemaFuture::complete);
+ schemaFuture.get().getResultValue();
+
+ // Create a document and index it.
+ GenericDocument document1 = new GenericDocument.Builder<>("namespace", "id1",
+ "schema1").build();
+ CompletableFuture<AppSearchBatchResult<String, Void>> putDocumentsFuture =
+ new CompletableFuture<>();
+ mSearchSession.put(
+ new PutDocumentsRequest.Builder().addGenericDocuments(document1).build(),
+ mExecutor, new BatchResultCallback<String, Void>() {
+ @Override
+ public void onResult(AppSearchBatchResult<String, Void> result) {
+ putDocumentsFuture.complete(result);
+ }
+
+ @Override
+ public void onSystemError(Throwable throwable) {
+ putDocumentsFuture.completeExceptionally(throwable);
+ }
+ });
+ putDocumentsFuture.get();
+
+ // Search and get the first page.
+ SearchSpec searchSpec = new SearchSpec.Builder()
+ .setTermMatch(TERM_MATCH_PREFIX)
+ .setResultCountPerPage(1)
+ .build();
+ SearchResults searchResults = mSearchSession.search("", searchSpec);
+
+ CompletableFuture<AppSearchResult<List<SearchResult>>> getNextPageFuture =
+ new CompletableFuture<>();
+ searchResults.getNextPage(mExecutor, getNextPageFuture::complete);
+ List<SearchResult> results = getNextPageFuture.get().getResultValue();
+ assertThat(results).hasSize(1);
+ assertThat(results.get(0).getGenericDocument()).isEqualTo(document1);
+
+ // We get all documents, and it shouldn't fail if we keep calling getNextPage().
+ getNextPageFuture = new CompletableFuture<>();
+ searchResults.getNextPage(mExecutor, getNextPageFuture::complete);
+ results = getNextPageFuture.get().getResultValue();
+ assertThat(results).isEmpty();
+ }
+
+ @Test
+ public void testGetEmptyNextPage_multiPages() throws Exception {
+ // Set the schema.
+ CompletableFuture<AppSearchResult<SetSchemaResponse>> schemaFuture =
+ new CompletableFuture<>();
+ mSearchSession.setSchema(
+ new SetSchemaRequest.Builder()
+ .addSchemas(new AppSearchSchema.Builder("schema1").build())
+ .setForceOverride(true).build(),
+ mExecutor, mExecutor, schemaFuture::complete);
+ schemaFuture.get().getResultValue();
+
+ // Create a document and insert 3 package1 documents
+ GenericDocument document1 = new GenericDocument.Builder<>("namespace", "id1",
+ "schema1").build();
+ GenericDocument document2 = new GenericDocument.Builder<>("namespace", "id2",
+ "schema1").build();
+ GenericDocument document3 = new GenericDocument.Builder<>("namespace", "id3",
+ "schema1").build();
+ CompletableFuture<AppSearchBatchResult<String, Void>> putDocumentsFuture =
+ new CompletableFuture<>();
+ mSearchSession.put(
+ new PutDocumentsRequest.Builder()
+ .addGenericDocuments(document1, document2, document3).build(),
+ mExecutor, new BatchResultCallback<String, Void>() {
+ @Override
+ public void onResult(AppSearchBatchResult<String, Void> result) {
+ putDocumentsFuture.complete(result);
+ }
+
+ @Override
+ public void onSystemError(Throwable throwable) {
+ putDocumentsFuture.completeExceptionally(throwable);
+ }
+ });
+ putDocumentsFuture.get();
+
+ // Search for only 2 result per page
+ SearchSpec searchSpec = new SearchSpec.Builder()
+ .setTermMatch(TERM_MATCH_PREFIX)
+ .setResultCountPerPage(2)
+ .build();
+ SearchResults searchResults = mSearchSession.search("", searchSpec);
+
+ // Get the first page, it contains 2 results.
+ List<GenericDocument> outDocs = new ArrayList<>();
+ CompletableFuture<AppSearchResult<List<SearchResult>>> getNextPageFuture =
+ new CompletableFuture<>();
+ searchResults.getNextPage(mExecutor, getNextPageFuture::complete);
+ List<SearchResult> results = getNextPageFuture.get().getResultValue();
+ assertThat(results).hasSize(2);
+ outDocs.add(results.get(0).getGenericDocument());
+ outDocs.add(results.get(1).getGenericDocument());
+
+ // Get the second page, it contains only 1 result.
+ getNextPageFuture = new CompletableFuture<>();
+ searchResults.getNextPage(mExecutor, getNextPageFuture::complete);
+ results = getNextPageFuture.get().getResultValue();
+ assertThat(results).hasSize(1);
+ outDocs.add(results.get(0).getGenericDocument());
+
+ assertThat(outDocs).containsExactly(document1, document2, document3);
+
+ // We get all documents, and it shouldn't fail if we keep calling getNextPage().
+ getNextPageFuture = new CompletableFuture<>();
+ searchResults.getNextPage(mExecutor, getNextPageFuture::complete);
+ results = getNextPageFuture.get().getResultValue();
+ assertThat(results).isEmpty();
+ }
}
diff --git a/core/tests/coretests/src/android/os/PerformanceHintManagerTest.java b/core/tests/coretests/src/android/os/PerformanceHintManagerTest.java
index 7dea82d..69eb13f 100644
--- a/core/tests/coretests/src/android/os/PerformanceHintManagerTest.java
+++ b/core/tests/coretests/src/android/os/PerformanceHintManagerTest.java
@@ -22,12 +22,6 @@
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeNotNull;
-import static org.mockito.Mockito.any;
-import static org.mockito.Mockito.eq;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
import android.os.PerformanceHintManager.Session;
@@ -120,92 +114,9 @@
}
@Test
- public void testRateLimitWithDurationFastEnough() throws Exception {
- FakeClock fakeClock = new FakeClock();
- Session s = new Session(mIHintSessionMock, fakeClock, RATE_1000, TARGET_166);
-
- reset(mIHintSessionMock);
- fakeClock.setNow(0);
- s.updateTargetWorkDuration(TARGET_166);
-
- s.reportActualWorkDuration(TARGET_166 - 1);
- s.reportActualWorkDuration(TARGET_166);
- // we should not see update as the rate should be 10X for over-perform case.
- verify(mIHintSessionMock, never()).reportActualWorkDuration(any(), any());
- fakeClock.incrementClock(10 * RATE_1000);
- s.reportActualWorkDuration(TARGET_166);
- verify(mIHintSessionMock, never()).reportActualWorkDuration(any(), any());
- fakeClock.incrementClock(1);
- s.reportActualWorkDuration(TARGET_166);
- // we should see update after rate limit
- verify(mIHintSessionMock, times(1)).reportActualWorkDuration(
- eq(new long[] {TARGET_166 - 1, TARGET_166, TARGET_166, TARGET_166}),
- eq(new long[] {0, 0, 10 * RATE_1000, 10 * RATE_1000 + 1}));
-
- reset(mIHintSessionMock);
- s.reportActualWorkDuration(TARGET_166);
- s.reportActualWorkDuration(TARGET_166 - 1);
- s.reportActualWorkDuration(TARGET_166 - 2);
- // we should not see update as the rate should be 10X for over-perform case.
- verify(mIHintSessionMock, never()).reportActualWorkDuration(any(), any());
- fakeClock.incrementClock(10 * RATE_1000 + 1);
- s.reportActualWorkDuration(TARGET_166);
- s.reportActualWorkDuration(TARGET_166 - 1);
- // we should see update now
- verify(mIHintSessionMock, times(1)).reportActualWorkDuration(
- eq(new long[] {TARGET_166, TARGET_166 - 1, TARGET_166 - 2, TARGET_166}),
- eq(new long[] {10 * RATE_1000 + 1, 10 * RATE_1000 + 1, 10 * RATE_1000 + 1,
- (10 * RATE_1000 + 1) * 2}));
- }
-
- @Test
- public void testRateLimitWithDurationTooSlow() throws Exception {
- FakeClock fakeClock = new FakeClock();
- Session s = new Session(mIHintSessionMock, fakeClock, RATE_1000, TARGET_166);
-
- reset(mIHintSessionMock);
- fakeClock.setNow(0);
- s.updateTargetWorkDuration(TARGET_166);
-
- verify(mIHintSessionMock, times(1)).updateTargetWorkDuration(eq(TARGET_166));
- // shouldn't update before rate limit
- s.reportActualWorkDuration(TARGET_166 + 1);
- verify(mIHintSessionMock, never()).reportActualWorkDuration(any(), any());
-
- // shouldn't update when the time is exactly at rate limit
- fakeClock.incrementClock(RATE_1000);
- s.reportActualWorkDuration(TARGET_166 + 1);
- verify(mIHintSessionMock, never()).reportActualWorkDuration(any(), any());
-
- // should be ready for sending hint
- fakeClock.incrementClock(1);
- s.reportActualWorkDuration(TARGET_166 + 1);
- verify(mIHintSessionMock, times(1)).reportActualWorkDuration(
- eq(new long[] {TARGET_166 + 1, TARGET_166 + 1, TARGET_166 + 1}),
- eq(new long[] {0 , RATE_1000, RATE_1000 + 1}));
- }
-
- @Test
public void testCloseHintSession() {
Session s = createSession();
assumeNotNull(s);
s.close();
}
-
- private static class FakeClock implements PerformanceHintManager.NanoClock {
- private long mCurrentTime = 0L;
-
- @Override
- public long nanos() {
- return mCurrentTime;
- }
-
- public void setNow(long nanos) {
- mCurrentTime = nanos;
- }
-
- public void incrementClock(long nanos) {
- mCurrentTime += nanos;
- }
- }
}
diff --git a/core/tests/coretests/src/com/android/internal/inputmethod/InputMethodDebugTest.java b/core/tests/coretests/src/com/android/internal/inputmethod/InputMethodDebugTest.java
index 32bfdcb..9de09d6 100644
--- a/core/tests/coretests/src/com/android/internal/inputmethod/InputMethodDebugTest.java
+++ b/core/tests/coretests/src/com/android/internal/inputmethod/InputMethodDebugTest.java
@@ -73,4 +73,13 @@
InputMethodDebug.softInputDisplayReasonToString(
SoftInputShowHideReason.HIDE_REMOVE_CLIENT));
}
+
+ @Test
+ public void testDumpInputConnectionCommand() {
+ // TODO: add more tests
+ assertEquals("null", InputMethodDebug.dumpInputConnectionCommand(null));
+ assertEquals("endBatchEdit()",
+ InputMethodDebug.dumpInputConnectionCommand(
+ InputConnectionCommand.create(InputConnectionCommandType.END_BATCH_EDIT)));
+ }
}
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsBackgroundStatsTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsBackgroundStatsTest.java
index b687801..25bc1ee 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsBackgroundStatsTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsBackgroundStatsTest.java
@@ -38,7 +38,7 @@
/** Test that BatteryStatsImpl.Uid.mOnBatteryBackgroundTimeBase works correctly. */
@SmallTest
public void testBgTimeBase() throws Exception {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
long cur = 0; // realtime in us
@@ -106,7 +106,7 @@
/** Test that BatteryStatsImpl.Uid.mOnBatteryScreenOffBackgroundTimeBase works correctly. */
@SmallTest
public void testScreenOffBgTimeBase() throws Exception {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
long cur = 0; // realtime in us
@@ -154,7 +154,7 @@
@SmallTest
public void testWifiScan() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
long curr = 0; // realtime in us
@@ -207,7 +207,7 @@
}
private void doTestAppBluetoothScanInternal(WorkSource ws) throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
long curr = 0; // realtime in us
@@ -276,7 +276,7 @@
@SmallTest
public void testJob() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
final String jobName = "job_name";
long curr = 0; // realtime in us
@@ -337,7 +337,7 @@
@SmallTest
public void testSyncs() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
final String syncName = "sync_name";
long curr = 0; // realtime in us
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsBinderCallStatsTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsBinderCallStatsTest.java
index 85f9c97..8ca0da0 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsBinderCallStatsTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsBinderCallStatsTest.java
@@ -46,7 +46,7 @@
*/
@Test
public void testNoteBinderCallStats() throws Exception {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
int callingUid = Process.FIRST_APPLICATION_UID + 1;
@@ -89,7 +89,7 @@
@Test
public void testProportionalSystemServiceUsage_noStatsForSomeMethods() throws Exception {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
int callingUid = Process.FIRST_APPLICATION_UID + 1;
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsCounterTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsCounterTest.java
index ade3a99..6ff2b64 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsCounterTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsCounterTest.java
@@ -30,7 +30,7 @@
@SmallTest
public void testCounter() throws Exception {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
final BatteryStatsImpl.TimeBase timeBase = new BatteryStatsImpl.TimeBase();
timeBase.init(clocks.uptimeMillis(), clocks.elapsedRealtime());
@@ -70,7 +70,7 @@
@SmallTest
public void testParceling() throws Exception {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
final BatteryStatsImpl.TimeBase timeBase = new BatteryStatsImpl.TimeBase();
timeBase.init(clocks.uptimeMillis(), clocks.elapsedRealtime());
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsCpuTimesTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsCpuTimesTest.java
index 65df390..1ac89ea 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsCpuTimesTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsCpuTimesTest.java
@@ -96,7 +96,7 @@
@Mock
PowerProfile mPowerProfile;
- private MockClocks mClocks;
+ private MockClock mClocks;
private MockBatteryStatsImpl mBatteryStatsImpl;
private KernelCpuSpeedReader[] mKernelCpuSpeedReaders;
@@ -104,7 +104,7 @@
public void setUp() {
MockitoAnnotations.initMocks(this);
- mClocks = new MockClocks();
+ mClocks = new MockClock();
mBatteryStatsImpl = new MockBatteryStatsImpl(mClocks)
.setKernelCpuUidUserSysTimeReader(mCpuUidUserSysTimeReader)
.setKernelCpuUidFreqTimeReader(mCpuUidFreqTimeReader)
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsDualTimerTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsDualTimerTest.java
index efb8710..678d3ee 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsDualTimerTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsDualTimerTest.java
@@ -29,7 +29,7 @@
@SmallTest
public void testResetDetach() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
clocks.realtime = clocks.uptime = 100;
final BatteryStatsImpl.TimeBase timeBase = new BatteryStatsImpl.TimeBase();
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsDurationTimerTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsDurationTimerTest.java
index 78fa3fb..b7edb17 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsDurationTimerTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsDurationTimerTest.java
@@ -33,7 +33,7 @@
@SmallTest
public void testStartStop() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
final BatteryStatsImpl.TimeBase timeBase = new BatteryStatsImpl.TimeBase();
timeBase.init(clocks.uptimeMillis(), clocks.elapsedRealtime());
@@ -105,7 +105,7 @@
*/
@SmallTest
public void testReset() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
final BatteryStatsImpl.TimeBase timeBase = new BatteryStatsImpl.TimeBase();
timeBase.init(clocks.uptimeMillis(), clocks.elapsedRealtime());
@@ -141,7 +141,7 @@
*/
@SmallTest
public void testResetAndDetach() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
final BatteryStatsImpl.TimeBase timeBase = new BatteryStatsImpl.TimeBase();
timeBase.init(clocks.uptimeMillis(), clocks.elapsedRealtime());
@@ -168,7 +168,7 @@
@SmallTest
public void testParceling() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
final BatteryStatsImpl.TimeBase timeBase = new BatteryStatsImpl.TimeBase();
timeBase.init(clocks.uptimeMillis(), clocks.elapsedRealtime());
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsNoteTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsNoteTest.java
index 464412f..7a84201 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsNoteTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsNoteTest.java
@@ -60,7 +60,7 @@
*/
@SmallTest
public void testNoteBluetoothScanResultLocked() throws Exception {
- MockBatteryStatsImpl bi = new MockBatteryStatsImpl(new MockClocks());
+ MockBatteryStatsImpl bi = new MockBatteryStatsImpl(new MockClock());
bi.updateTimeBasesLocked(true, Display.STATE_OFF, 0, 0);
bi.noteUidProcessStateLocked(UID, ActivityManager.PROCESS_STATE_TOP);
@@ -89,7 +89,7 @@
*/
@SmallTest
public void testNoteStartWakeLocked() throws Exception {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
int pid = 10;
@@ -120,7 +120,7 @@
*/
@SmallTest
public void testNoteUidProcessStateLocked() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
// map of ActivityManager process states and how long to simulate run time in each state
@@ -205,7 +205,7 @@
*/
@SmallTest
public void testUpdateTimeBasesLocked() throws Exception {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
bi.updateTimeBasesLocked(false, Display.STATE_OFF, 0, 0);
@@ -229,7 +229,7 @@
*/
@SmallTest
public void testNoteScreenStateLocked() throws Exception {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
bi.updateTimeBasesLocked(true, Display.STATE_ON, 0, 0);
@@ -258,7 +258,7 @@
*/
@SmallTest
public void testNoteScreenStateTimersLocked() throws Exception {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
clocks.realtime = clocks.uptime = 100;
@@ -297,7 +297,7 @@
@SmallTest
@SkipPresubmit("b/180015146")
public void testAlarmStartAndFinishLocked() throws Exception {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
bi.setRecordAllHistoryLocked(true);
bi.forceRecordAllHistory();
@@ -335,7 +335,7 @@
@SmallTest
@SkipPresubmit("b/180015146")
public void testAlarmStartAndFinishLocked_workSource() throws Exception {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
bi.setRecordAllHistoryLocked(true);
bi.forceRecordAllHistory();
@@ -379,7 +379,7 @@
@SmallTest
public void testNoteWakupAlarmLocked() {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
bi.setRecordAllHistoryLocked(true);
bi.forceRecordAllHistory();
@@ -397,7 +397,7 @@
@SmallTest
public void testNoteWakupAlarmLocked_workSource_uid() {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
bi.setRecordAllHistoryLocked(true);
bi.forceRecordAllHistory();
@@ -430,7 +430,7 @@
@SmallTest
public void testNoteWakupAlarmLocked_workSource_workChain() {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
bi.setRecordAllHistoryLocked(true);
bi.forceRecordAllHistory();
@@ -456,7 +456,7 @@
@SmallTest
public void testNoteGpsChanged() {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
bi.setRecordAllHistoryLocked(true);
bi.forceRecordAllHistory();
@@ -480,7 +480,7 @@
@SmallTest
public void testNoteGpsChanged_workSource() {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
bi.setRecordAllHistoryLocked(true);
bi.forceRecordAllHistory();
@@ -504,7 +504,7 @@
@SmallTest
public void testUpdateDisplayMeasuredEnergyStatsLocked() {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
final MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
bi.initMeasuredEnergyStats();
@@ -589,7 +589,7 @@
@SmallTest
public void testUpdateCustomMeasuredEnergyStatsLocked_neverCalled() {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
final MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
bi.initMeasuredEnergyStats();
bi.setOnBatteryInternal(true);
@@ -603,7 +603,7 @@
@SmallTest
public void testUpdateCustomMeasuredEnergyStatsLocked() {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
final MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
bi.initMeasuredEnergyStats();
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsSamplingTimerTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsSamplingTimerTest.java
index 53845a7..0d2249f 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsSamplingTimerTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsSamplingTimerTest.java
@@ -30,7 +30,7 @@
@SmallTest
public void testSettingStalePreservesData() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
final BatteryStatsImpl.SamplingTimer timer = new BatteryStatsImpl.SamplingTimer(clocks,
Mockito.mock(BatteryStatsImpl.TimeBase.class));
@@ -57,7 +57,7 @@
@SmallTest
public void testEndSampleAndContinueWhenTimeOrCountDecreases() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
final BatteryStatsImpl.TimeBase timeBase = Mockito.mock(BatteryStatsImpl.TimeBase.class);
final BatteryStatsImpl.SamplingTimer timer = new BatteryStatsImpl.SamplingTimer(clocks,
timeBase);
@@ -107,7 +107,7 @@
@SmallTest
public void testFirstUpdateIsAbsorbed() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
final BatteryStatsImpl.TimeBase timeBase = Mockito.mock(BatteryStatsImpl.TimeBase.class);
BatteryStatsImpl.SamplingTimer timer = new BatteryStatsImpl.SamplingTimer(clocks, timeBase);
@@ -146,7 +146,7 @@
@SmallTest
public void testSampleTimerSummaryParceling() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
clocks.realtime = 0;
clocks.uptime = 0;
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsSensorTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsSensorTest.java
index b851f0a..f833981 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsSensorTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsSensorTest.java
@@ -34,7 +34,7 @@
@SmallTest
public void testSensorStartStop() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
bi.mForceOnBattery = true;
clocks.realtime = 100;
@@ -71,7 +71,7 @@
@SmallTest
public void testCountingWhileOffBattery() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
long curr = 0; // realtime in us
@@ -107,7 +107,7 @@
@SmallTest
public void testCountingWhileOnBattery() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
long curr = 0; // realtime in us
@@ -142,7 +142,7 @@
@SmallTest
public void testBatteryStatusOnToOff() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
long curr = 0; // realtime in us
@@ -188,7 +188,7 @@
@SmallTest
public void testBatteryStatusOffToOn() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
long curr = 0; // realtime in us
@@ -240,7 +240,7 @@
@SmallTest
public void testPooledBackgroundUsage() throws Exception {
final int UID_2 = 20000; // second uid for testing pool usage
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
bi.mForceOnBattery = true;
long curr = 0; // realtime in us
@@ -377,7 +377,7 @@
@SmallTest
public void testSensorReset() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
bi.mForceOnBattery = true;
clocks.realtime = 100;
@@ -421,7 +421,7 @@
@SmallTest
public void testSensorResetTimes() throws Exception {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
MockBatteryStatsImpl bi = new MockBatteryStatsImpl(clocks);
final int which = BatteryStats.STATS_SINCE_CHARGED;
bi.mForceOnBattery = true;
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsStopwatchTimerTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsStopwatchTimerTest.java
index f76f316..94092f1 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsStopwatchTimerTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsStopwatchTimerTest.java
@@ -31,7 +31,7 @@
// negative values of count.
@SmallTest
public void testCount() throws Exception {
- final MockClocks clocks = new MockClocks(); // holds realtime and uptime in ms
+ final MockClock clocks = new MockClock(); // holds realtime and uptime in ms
final BatteryStatsImpl.TimeBase timeBase = new BatteryStatsImpl.TimeBase();
timeBase.init(clocks.uptimeMillis(), clocks.elapsedRealtime());
final BatteryStatsImpl.StopwatchTimer timer = new BatteryStatsImpl.StopwatchTimer(clocks,
@@ -142,7 +142,7 @@
assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED));
}
- private static long updateTime(MockClocks clocks, long time) {
+ private static long updateTime(MockClock clocks, long time) {
return clocks.realtime = clocks.uptime = time;
}
}
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsTimerTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsTimerTest.java
index 11a01b3..be3fc8a 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsTimerTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsTimerTest.java
@@ -22,7 +22,6 @@
import androidx.test.filters.SmallTest;
-import com.android.internal.os.BatteryStatsImpl.Clocks;
import com.android.internal.os.BatteryStatsImpl.TimeBase;
import com.android.internal.os.BatteryStatsImpl.Timer;
@@ -41,12 +40,12 @@
int nextComputeCurrentCount;
- TestTimer(Clocks clocks, int type, TimeBase timeBase, Parcel in) {
- super(clocks, type, timeBase, in);
+ TestTimer(Clock clock, int type, TimeBase timeBase, Parcel in) {
+ super(clock, type, timeBase, in);
}
- TestTimer(Clocks clocks, int type, TimeBase timeBase) {
- super(clocks, type, timeBase);
+ TestTimer(Clock clock, int type, TimeBase timeBase) {
+ super(clock, type, timeBase);
}
@Override
@@ -91,7 +90,7 @@
@SmallTest
public void testRunning() throws Exception {
TimeBase timeBase = new TimeBase();
- MockClocks clocks = new MockClocks();
+ MockClock clocks = new MockClock();
TestTimer timer = new TestTimer(clocks, 0, timeBase);
timer.nextComputeCurrentCount = 3000;
@@ -112,7 +111,7 @@
@SmallTest
public void testParceling() throws Exception {
TimeBase timeBase = new TimeBase();
- MockClocks clocks = new MockClocks();
+ MockClock clocks = new MockClock();
// Test write then read
TestTimer timer1 = new TestTimer(clocks, 0, timeBase);
@@ -157,7 +156,7 @@
@SmallTest
public void testResetNoDetach() throws Exception {
TimeBase timeBase = new TimeBase();
- MockClocks clocks = new MockClocks();
+ MockClock clocks = new MockClock();
TestTimer timer = new TestTimer(clocks, 0, timeBase);
timer.setCount(1);
@@ -180,7 +179,7 @@
@SmallTest
public void testResetDetach() throws Exception {
TimeBase timeBase = new TimeBase();
- MockClocks clocks = new MockClocks();
+ MockClock clocks = new MockClock();
TestTimer timer = new TestTimer(clocks, 0, timeBase);
timer.setCount(1);
@@ -208,7 +207,7 @@
Assert.assertEquals(40, timeBase.getRealtime(200));
// the past uptime is 35 and the past runtime is 40
- MockClocks clocks = new MockClocks();
+ MockClock clocks = new MockClock();
TestTimer timer1 = new TestTimer(clocks, 0, timeBase);
timer1.setCount(1);
@@ -250,7 +249,7 @@
timeBase.setRunning(false, 45, 60);
Assert.assertEquals(40, timeBase.getRealtime(200));
- MockClocks clocks = new MockClocks();
+ MockClock clocks = new MockClock();
TestTimer timer = new TestTimer(clocks, 0, timeBase);
timer.setCount(1);
@@ -275,7 +274,7 @@
timeBase.setRunning(false, 45, 60);
Assert.assertEquals(40, timeBase.getRealtime(200));
- MockClocks clocks = new MockClocks();
+ MockClock clocks = new MockClock();
TestTimer timer = new TestTimer(clocks, 0, timeBase);
timer.setCount(1);
@@ -296,7 +295,7 @@
timeBase.setRunning(false, 45, 60);
Assert.assertEquals(40, timeBase.getRealtime(200));
- MockClocks clocks = new MockClocks();
+ MockClock clocks = new MockClock();
TestTimer timer = new TestTimer(clocks, 0, timeBase);
timer.setCount(1);
@@ -313,7 +312,7 @@
@SmallTest
public void testLogState() throws Exception {
TimeBase timeBase = new TimeBase();
- MockClocks clocks = new MockClocks();
+ MockClock clocks = new MockClock();
TestTimer timer = new TestTimer(clocks, 0, timeBase);
timer.setTotalTime(100);
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsUidTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsUidTest.java
index 4df3190..9270346 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsUidTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsUidTest.java
@@ -27,7 +27,7 @@
private static final String TAG = "BatteryStatsTimeBaseTest";
static class TestBsi extends BatteryStatsImpl {
- TestBsi(MockClocks clocks) {
+ TestBsi(MockClock clocks) {
super(clocks);
}
}
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsRule.java b/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsRule.java
index 083090c..e7fa656 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsRule.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsRule.java
@@ -50,7 +50,7 @@
.build();
private final PowerProfile mPowerProfile;
- private final MockClocks mMockClocks = new MockClocks();
+ private final MockClock mMockClock = new MockClock();
private final MockBatteryStatsImpl mBatteryStats;
private BatteryUsageStats mBatteryUsageStats;
@@ -63,8 +63,8 @@
public BatteryUsageStatsRule(long currentTime) {
Context context = InstrumentationRegistry.getContext();
mPowerProfile = spy(new PowerProfile(context, true /* forTest */));
- mMockClocks.currentTime = currentTime;
- mBatteryStats = new MockBatteryStatsImpl(mMockClocks);
+ mMockClock.currentTime = currentTime;
+ mBatteryStats = new MockBatteryStatsImpl(mMockClock);
mBatteryStats.setPowerProfile(mPowerProfile);
mBatteryStats.onSystemReady();
}
@@ -166,12 +166,12 @@
}
public void setTime(long realtimeMs, long uptimeMs) {
- mMockClocks.realtime = realtimeMs;
- mMockClocks.uptime = uptimeMs;
+ mMockClock.realtime = realtimeMs;
+ mMockClock.uptime = uptimeMs;
}
public void setCurrentTime(long currentTimeMs) {
- mMockClocks.currentTime = currentTimeMs;
+ mMockClock.currentTime = currentTimeMs;
}
BatteryUsageStats apply(PowerCalculator... calculators) {
@@ -191,7 +191,7 @@
}
for (PowerCalculator calculator : calculators) {
- calculator.calculate(builder, mBatteryStats, mMockClocks.realtime, mMockClocks.uptime,
+ calculator.calculate(builder, mBatteryStats, mMockClock.realtime, mMockClock.uptime,
query);
}
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsStoreTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsStoreTest.java
index e478cd7..51f20f3 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsStoreTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsStoreTest.java
@@ -47,7 +47,7 @@
public class BatteryUsageStatsStoreTest {
private static final long MAX_BATTERY_STATS_SNAPSHOT_STORAGE_BYTES = 2 * 1024;
- private final MockClocks mMockClocks = new MockClocks();
+ private final MockClock mMockClock = new MockClock();
private MockBatteryStatsImpl mBatteryStats;
private BatteryUsageStatsStore mBatteryUsageStatsStore;
private BatteryUsageStatsProvider mBatteryUsageStatsProvider;
@@ -55,8 +55,8 @@
@Before
public void setup() {
- mMockClocks.currentTime = 123;
- mBatteryStats = new MockBatteryStatsImpl(mMockClocks);
+ mMockClock.currentTime = 123;
+ mBatteryStats = new MockBatteryStatsImpl(mMockClock);
mBatteryStats.setNoAutoReset(true);
mBatteryStats.setPowerProfile(mock(PowerProfile.class));
mBatteryStats.onSystemReady();
@@ -75,7 +75,7 @@
@Test
public void testStoreSnapshot() {
- mMockClocks.currentTime = 1_600_000;
+ mMockClock.currentTime = 1_600_000;
prepareBatteryStats();
mBatteryStats.resetAllStatsCmdLocked();
@@ -99,9 +99,9 @@
public void testGarbageCollectOldSnapshots() throws Exception {
prepareBatteryStats();
- mMockClocks.realtime = 10_000_000;
- mMockClocks.uptime = 10_000_000;
- mMockClocks.currentTime = 10_000_000;
+ mMockClock.realtime = 10_000_000;
+ mMockClock.uptime = 10_000_000;
+ mMockClock.currentTime = 10_000_000;
final int snapshotFileSize = getSnapshotFileSize();
final int numberOfSnapshots =
@@ -109,9 +109,9 @@
for (int i = 0; i < numberOfSnapshots + 2; i++) {
mBatteryStats.resetAllStatsCmdLocked();
- mMockClocks.realtime += 10_000_000;
- mMockClocks.uptime += 10_000_000;
- mMockClocks.currentTime += 10_000_000;
+ mMockClock.realtime += 10_000_000;
+ mMockClock.uptime += 10_000_000;
+ mMockClock.currentTime += 10_000_000;
prepareBatteryStats();
}
@@ -137,11 +137,11 @@
private void prepareBatteryStats() {
mBatteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100,
/* plugType */ 0, 90, 72, 3700, 3_600_000, 4_000_000, 0,
- mMockClocks.realtime, mMockClocks.uptime, mMockClocks.currentTime);
+ mMockClock.realtime, mMockClock.uptime, mMockClock.currentTime);
mBatteryStats.setBatteryStateLocked(BatteryManager.BATTERY_STATUS_DISCHARGING, 100,
/* plugType */ 0, 85, 72, 3700, 3_000_000, 4_000_000, 0,
- mMockClocks.realtime + 500_000, mMockClocks.uptime + 500_000,
- mMockClocks.currentTime + 500_000);
+ mMockClock.realtime + 500_000, mMockClock.uptime + 500_000,
+ mMockClock.currentTime + 500_000);
}
private void clearDirectory(File dir) {
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsTest.java
index fedbf7a..c58df4e 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryUsageStatsTest.java
@@ -228,7 +228,7 @@
}
private BatteryUsageStats.Builder buildBatteryUsageStats1(boolean includeUserBatteryConsumer) {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
final MockBatteryStatsImpl batteryStats = new MockBatteryStatsImpl(clocks);
final BatteryUsageStats.Builder builder =
@@ -267,7 +267,7 @@
}
private BatteryUsageStats.Builder buildBatteryUsageStats2(String[] customPowerComponentNames) {
- final MockClocks clocks = new MockClocks();
+ final MockClock clocks = new MockClock();
final MockBatteryStatsImpl batteryStats = new MockBatteryStatsImpl(clocks);
final BatteryUsageStats.Builder builder =
diff --git a/core/tests/coretests/src/com/android/internal/os/KernelCpuUidUserSysTimeReaderTest.java b/core/tests/coretests/src/com/android/internal/os/KernelCpuUidUserSysTimeReaderTest.java
index 177f348..1da1a90 100644
--- a/core/tests/coretests/src/com/android/internal/os/KernelCpuUidUserSysTimeReaderTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/KernelCpuUidUserSysTimeReaderTest.java
@@ -23,7 +23,6 @@
import android.content.Context;
import android.os.FileUtils;
-import android.os.SystemClock;
import android.util.SparseArray;
import androidx.test.InstrumentationRegistry;
@@ -56,7 +55,7 @@
private KernelCpuUidTimeReader.KernelCpuUidUserSysTimeReader mReader;
private VerifiableCallback mCallback;
- private Random mRand = new Random(12345);
+ private final Random mRand = new Random(12345);
private final int[] mUids = {0, 1, 22, 333, 4444, 55555};
private final long[][] mInitialTimes = new long[][]{
{15334000, 310964000},
@@ -67,6 +66,8 @@
{47000, 17000}
};
+ private final MockClock mMockClock = new MockClock();
+
private Context getContext() {
return InstrumentationRegistry.getContext();
}
@@ -76,7 +77,8 @@
mTestDir = getContext().getDir("test", Context.MODE_PRIVATE);
mTestFile = new File(mTestDir, "test.file");
mReader = new KernelCpuUidUserSysTimeReader(
- new KernelCpuProcStringReader(mTestFile.getAbsolutePath()), false);
+ new KernelCpuProcStringReader(mTestFile.getAbsolutePath(), mMockClock),
+ false, mMockClock);
mCallback = new VerifiableCallback();
}
@@ -87,10 +89,13 @@
}
@Test
- @SkipPresubmit("b/180015146")
public void testThrottler() throws Exception {
+ mMockClock.realtime = 1000;
+
mReader = new KernelCpuUidUserSysTimeReader(
- new KernelCpuProcStringReader(mTestFile.getAbsolutePath()), true);
+ new KernelCpuProcStringReader(mTestFile.getAbsolutePath(), mMockClock),
+ true, mMockClock);
+
mReader.setThrottle(500);
writeToFile(uidLines(mUids, mInitialTimes));
@@ -103,8 +108,7 @@
mReader.readDelta(false, mCallback);
assertEquals(0, mCallback.mData.size());
- // TODO(b/180473895): Replace sleeps with injected simulated time.
- SystemClock.sleep(600);
+ mMockClock.realtime += 600;
long[][] times2 = increaseTime(times1);
writeToFile(uidLines(mUids, times2));
@@ -123,7 +127,7 @@
mReader.readDelta(true, mCallback);
assertEquals(6, mCallback.mData.size());
- SystemClock.sleep(600);
+ mMockClock.realtime += 600;
long[][] times4 = increaseTime(times3);
writeToFile(uidLines(mUids, times4));
@@ -138,7 +142,7 @@
mReader.readDelta(false, mCallback);
assertEquals(0, mCallback.mData.size());
- SystemClock.sleep(600);
+ mMockClock.realtime += 600;
mCallback.clear();
mReader.readDelta(false, mCallback);
diff --git a/core/tests/coretests/src/com/android/internal/os/MockBatteryStatsImpl.java b/core/tests/coretests/src/com/android/internal/os/MockBatteryStatsImpl.java
index d9b69b1..c8387cb 100644
--- a/core/tests/coretests/src/com/android/internal/os/MockBatteryStatsImpl.java
+++ b/core/tests/coretests/src/com/android/internal/os/MockBatteryStatsImpl.java
@@ -36,13 +36,13 @@
* Mocks a BatteryStatsImpl object.
*/
public class MockBatteryStatsImpl extends BatteryStatsImpl {
- public BatteryStatsImpl.Clocks clocks;
+ public Clock mClock;
public boolean mForceOnBattery;
private NetworkStats mNetworkStats;
- MockBatteryStatsImpl(Clocks clocks) {
- super(clocks);
- this.clocks = mClocks;
+ MockBatteryStatsImpl(Clock clock) {
+ super(clock);
+ this.mClock = mClock;
initTimersAndCounters();
setExternalStatsSyncLocked(new DummyExternalStatsSync());
@@ -54,7 +54,7 @@
}
MockBatteryStatsImpl() {
- this(new MockClocks());
+ this(new MockClock());
}
public void initMeasuredEnergyStats() {
diff --git a/core/tests/coretests/src/com/android/internal/os/MockClocks.java b/core/tests/coretests/src/com/android/internal/os/MockClock.java
similarity index 94%
rename from core/tests/coretests/src/com/android/internal/os/MockClocks.java
rename to core/tests/coretests/src/com/android/internal/os/MockClock.java
index c26505e..ac69c33 100644
--- a/core/tests/coretests/src/com/android/internal/os/MockClocks.java
+++ b/core/tests/coretests/src/com/android/internal/os/MockClock.java
@@ -16,7 +16,7 @@
package com.android.internal.os;
-public class MockClocks implements BatteryStatsImpl.Clocks {
+public class MockClock extends Clock {
/** ElapsedRealtime in ms */
public long realtime;
/** Uptime in ms */
diff --git a/graphics/java/android/graphics/HardwareRenderer.java b/graphics/java/android/graphics/HardwareRenderer.java
index 8bc3cae..ac2d0c4 100644
--- a/graphics/java/android/graphics/HardwareRenderer.java
+++ b/graphics/java/android/graphics/HardwareRenderer.java
@@ -28,7 +28,6 @@
import android.hardware.display.DisplayManager;
import android.os.IBinder;
import android.os.ParcelFileDescriptor;
-import android.os.PerformanceHintManager;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.util.Log;
@@ -856,36 +855,6 @@
callback.onPictureCaptured(picture);
}
- /** called by native */
- static PerformanceHintManager.Session createHintSession(int[] tids) {
- PerformanceHintManager performanceHintManager =
- ProcessInitializer.sInstance.getHintManager();
- if (performanceHintManager == null) {
- return null;
- }
- // Native code will always set a target duration before reporting actual durations.
- // So this is just a placeholder value that's never used.
- long targetDurationNanos = 16666667;
- return performanceHintManager.createHintSession(tids, targetDurationNanos);
- }
-
- /** called by native */
- static void updateTargetWorkDuration(PerformanceHintManager.Session session,
- long targetDurationNanos) {
- session.updateTargetWorkDuration(targetDurationNanos);
- }
-
- /** called by native */
- static void reportActualWorkDuration(PerformanceHintManager.Session session,
- long actualDurationNanos) {
- session.reportActualWorkDuration(actualDurationNanos);
- }
-
- /** called by native */
- static void closeHintSession(PerformanceHintManager.Session session) {
- session.close();
- }
-
/**
* Interface used to receive callbacks when Webview requests a surface control.
*
@@ -1189,7 +1158,6 @@
private boolean mIsolated = false;
private Context mContext;
private String mPackageName;
- private PerformanceHintManager mPerformanceHintManager;
private IGraphicsStats mGraphicsStatsService;
private IGraphicsStatsCallback mGraphicsStatsCallback = new IGraphicsStatsCallback.Stub() {
@Override
@@ -1201,10 +1169,6 @@
private ProcessInitializer() {
}
- synchronized PerformanceHintManager getHintManager() {
- return mPerformanceHintManager;
- }
-
synchronized void setPackageName(String name) {
if (mInitialized) return;
mPackageName = name;
@@ -1255,10 +1219,6 @@
initDisplayInfo();
- // HintManager and HintSession are designed to be accessible from isoalted processes
- // so not checking for isolated process here.
- initHintSession();
-
nSetIsHighEndGfx(ActivityManager.isHighEndGfx());
// Defensively clear out the context in case we were passed a context that can leak
// if we live longer than it, e.g. an activity context.
@@ -1302,11 +1262,6 @@
mDisplayInitialized = true;
}
- private void initHintSession() {
- if (mContext == null) return;
- mPerformanceHintManager = mContext.getSystemService(PerformanceHintManager.class);
- }
-
private void rotateBuffer() {
nRotateProcessStatsBuffer();
requestBuffer();
diff --git a/graphics/java/android/graphics/text/TextRunShaper.java b/graphics/java/android/graphics/text/TextRunShaper.java
index 8459e7b..19ea04a 100644
--- a/graphics/java/android/graphics/text/TextRunShaper.java
+++ b/graphics/java/android/graphics/text/TextRunShaper.java
@@ -24,8 +24,6 @@
import com.android.internal.util.Preconditions;
-import dalvik.annotation.optimization.FastNative;
-
/**
* Provides conversion from a text into glyph array.
*
@@ -116,12 +114,10 @@
}
}
- @FastNative
private static native long nativeShapeTextRun(
char[] text, int start, int count, int contextStart, int contextCount,
boolean isRtl, long nativePaint);
- @FastNative
private static native long nativeShapeTextRun(
String text, int start, int count, int contextStart, int contextCount,
boolean isRtl, long nativePaint);
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/organizer/JetpackTaskFragmentOrganizer.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/organizer/JetpackTaskFragmentOrganizer.java
index 48d78cf..d84554b 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/organizer/JetpackTaskFragmentOrganizer.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/organizer/JetpackTaskFragmentOrganizer.java
@@ -175,7 +175,8 @@
final TaskFragmentCreationParams fragmentOptions =
createFragmentOptions(fragmentToken, ownerToken, bounds, windowingMode);
wct.createTaskFragment(fragmentOptions)
- .startActivityInTaskFragment(fragmentToken, activityIntent, activityOptions);
+ .startActivityInTaskFragment(fragmentToken, ownerToken, activityIntent,
+ activityOptions);
}
TaskFragmentCreationParams createFragmentOptions(IBinder fragmentToken, IBinder ownerToken,
diff --git a/libs/WindowManager/Shell/res/color/one_handed_tutorial_background_color.xml b/libs/WindowManager/Shell/res/color/one_handed_tutorial_background_color.xml
new file mode 100644
index 0000000..4f56e0f
--- /dev/null
+++ b/libs/WindowManager/Shell/res/color/one_handed_tutorial_background_color.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2021 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
+ <item android:color="?androidprv:attr/colorSurfaceVariant"/>
+</selector>
diff --git a/libs/WindowManager/Shell/res/drawable-hdpi/one_handed_tutorial.png b/libs/WindowManager/Shell/res/drawable-hdpi/one_handed_tutorial.png
deleted file mode 100644
index 6c1f1cf..0000000
--- a/libs/WindowManager/Shell/res/drawable-hdpi/one_handed_tutorial.png
+++ /dev/null
Binary files differ
diff --git a/libs/WindowManager/Shell/res/drawable/one_handed_tutorial_icon.xml b/libs/WindowManager/Shell/res/drawable/one_handed_tutorial_icon.xml
new file mode 100644
index 0000000..b32f34e
--- /dev/null
+++ b/libs/WindowManager/Shell/res/drawable/one_handed_tutorial_icon.xml
@@ -0,0 +1,14 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="32dp"
+ android:height="60dp"
+ android:viewportWidth="32"
+ android:viewportHeight="60">
+ <path
+ android:pathData="M1.9703,30.5041C1.9703,28.295 3.7612,26.5042 5.9703,26.5042H25.5551C27.7642,26.5042 29.5551,28.295 29.5551,30.5042V54.0296C29.5551,56.2387 27.7642,58.0296 25.5551,58.0296H5.9703C3.7612,58.0296 1.9703,56.2387 1.9703,54.0296V30.5041Z"
+ android:fillColor="#000000"
+ android:fillAlpha="0.16"/>
+ <path
+ android:pathData="M25.5254,2H6C3.7909,2 2,3.7909 2,6V54C2,56.2091 3.7909,58 6,58H25.5254C27.7346,58 29.5254,56.2091 29.5254,54V6C29.5254,3.7909 27.7346,2 25.5254,2ZM6,0C2.6863,0 0,2.6863 0,6V54C0,57.3137 2.6863,60 6,60H25.5254C28.8391,60 31.5254,57.3137 31.5254,54V6C31.5254,2.6863 28.8391,0 25.5254,0H6ZM12.2034,47.2336L12.8307,47.861L15.3178,45.3783V52.1277H16.2076V45.3783L18.6903,47.8654L19.322,47.2336L15.7627,43.6743L12.2034,47.2336ZM19.7034,55.0742H11.822V56.552H19.7034V55.0742Z"
+ android:fillColor="#000000"
+ android:fillType="evenOdd"/>
+</vector>
diff --git a/libs/WindowManager/Shell/res/layout/one_handed_tutorial.xml b/libs/WindowManager/Shell/res/layout/one_handed_tutorial.xml
index 0190aad..d29ed8b 100644
--- a/libs/WindowManager/Shell/res/layout/one_handed_tutorial.xml
+++ b/libs/WindowManager/Shell/res/layout/one_handed_tutorial.xml
@@ -31,7 +31,7 @@
android:layout_marginTop="6dp"
android:layout_marginBottom="0dp"
android:gravity="center_horizontal"
- android:src="@drawable/one_handed_tutorial"
+ android:src="@drawable/one_handed_tutorial_icon"
android:scaleType="centerInside" />
<TextView
@@ -45,7 +45,6 @@
android:fontFamily="google-sans-medium"
android:text="@string/one_handed_tutorial_title"
android:textSize="16sp"
- android:textStyle="bold"
android:textColor="@android:color/white"/>
<TextView
@@ -54,8 +53,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginBottom="0dp"
- android:layout_marginStart="46dp"
- android:layout_marginEnd="46dp"
+ android:layout_marginStart="60dp"
+ android:layout_marginEnd="60dp"
android:gravity="center_horizontal"
android:fontFamily="roboto-regular"
android:text="@string/one_handed_tutorial_description"
diff --git a/libs/WindowManager/Shell/res/values-ky/strings.xml b/libs/WindowManager/Shell/res/values-ky/strings.xml
index c16041d..8056d15 100644
--- a/libs/WindowManager/Shell/res/values-ky/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ky/strings.xml
@@ -46,7 +46,7 @@
<string name="accessibility_action_divider_top_30" msgid="3572788224908570257">"Үстүнкү экранды 30%"</string>
<string name="accessibility_action_divider_bottom_full" msgid="2831868345092314060">"Ылдыйкы экранды толук экран режимине өткөрүү"</string>
<string name="one_handed_tutorial_title" msgid="4583241688067426350">"Бир кол режимин колдонуу"</string>
- <string name="one_handed_tutorial_description" msgid="3486582858591353067">"Чыгуу үчүн экранды ылдый жагынан өйдө көздөй сүрүңүз же колдонмонун өйдө жагын басыңыз"</string>
+ <string name="one_handed_tutorial_description" msgid="3486582858591353067">"Чыгуу үчүн экранды ылдый жагынан өйдө сүрүңүз же колдонмонун өйдө жагын басыңыз"</string>
<string name="accessibility_action_start_one_handed" msgid="5070337354072861426">"Бир кол режимин баштоо"</string>
<string name="accessibility_action_stop_one_handed" msgid="1369940261782179442">"Бир кол режиминен чыгуу"</string>
<string name="bubbles_settings_button_description" msgid="1301286017420516912">"<xliff:g id="APP_NAME">%1$s</xliff:g> калкып чыкма билдирмелер жөндөөлөрү"</string>
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java
index d460195..36b8923 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java
@@ -45,6 +45,7 @@
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.SurfaceControl;
+import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.ViewGroup;
@@ -205,6 +206,7 @@
* between bubble activities without needing both to be alive at the same time.
*/
private SurfaceView mAnimatingOutSurfaceView;
+ private boolean mAnimatingOutSurfaceReady;
/** Container for the animating-out SurfaceView. */
private FrameLayout mAnimatingOutSurfaceContainer;
@@ -808,6 +810,20 @@
mAnimatingOutSurfaceView.setZOrderOnTop(true);
mAnimatingOutSurfaceView.setCornerRadius(mCornerRadius);
mAnimatingOutSurfaceView.setLayoutParams(new ViewGroup.LayoutParams(0, 0));
+ mAnimatingOutSurfaceView.getHolder().addCallback(new SurfaceHolder.Callback() {
+ @Override
+ public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i1, int i2) {}
+
+ @Override
+ public void surfaceCreated(SurfaceHolder surfaceHolder) {
+ mAnimatingOutSurfaceReady = true;
+ }
+
+ @Override
+ public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
+ mAnimatingOutSurfaceReady = false;
+ }
+ });
mAnimatingOutSurfaceContainer.addView(mAnimatingOutSurfaceView);
mAnimatingOutSurfaceContainer.setPadding(
@@ -2652,7 +2668,7 @@
return;
}
- if (!mIsExpanded) {
+ if (!mIsExpanded || !mAnimatingOutSurfaceReady) {
onComplete.accept(false);
return;
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedBackgroundPanelOrganizer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedBackgroundPanelOrganizer.java
index 481b948..3ccb9e7 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedBackgroundPanelOrganizer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedBackgroundPanelOrganizer.java
@@ -20,7 +20,6 @@
import android.graphics.Color;
import android.graphics.PixelFormat;
import android.graphics.Rect;
-import android.util.Log;
import android.view.SurfaceControl;
import android.view.SurfaceSession;
import android.window.DisplayAreaAppearedInfo;
@@ -30,7 +29,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
-import androidx.core.content.ContextCompat;
import com.android.internal.annotations.GuardedBy;
import com.android.wm.shell.R;
@@ -48,14 +46,17 @@
public class OneHandedBackgroundPanelOrganizer extends DisplayAreaOrganizer
implements OneHandedTransitionCallback {
private static final String TAG = "OneHandedBackgroundPanelOrganizer";
+ private static final int THEME_COLOR_OFFSET = 10;
+ private final Context mContext;
private final Object mLock = new Object();
private final SurfaceSession mSurfaceSession = new SurfaceSession();
- private final float[] mDefaultColor;
private final Executor mMainExecutor;
private final OneHandedSurfaceTransactionHelper.SurfaceControlTransactionFactory
mSurfaceControlTransactionFactory;
+ private float[] mDefaultColor;
+
/**
* The background to distinguish the boundary of translated windows and empty region when
* one handed mode triggered.
@@ -88,15 +89,14 @@
public OneHandedBackgroundPanelOrganizer(Context context, DisplayLayout displayLayout,
Executor executor) {
super(executor);
+ mContext = context;
// Ensure the mBkgBounds is portrait, due to OHM only support on portrait
if (displayLayout.height() > displayLayout.width()) {
mBkgBounds = new Rect(0, 0, displayLayout.width(), displayLayout.height());
} else {
mBkgBounds = new Rect(0, 0, displayLayout.height(), displayLayout.width());
}
- final int defaultColor = ContextCompat.getColor(context, R.color.GM2_grey_800);
- mDefaultColor = new float[]{Color.red(defaultColor) / 255.0f,
- Color.green(defaultColor) / 255.0f, Color.blue(defaultColor) / 255.0f};
+ updateThemeColors();
mMainExecutor = executor;
mSurfaceControlTransactionFactory = SurfaceControl.Transaction::new;
}
@@ -170,7 +170,6 @@
}
if (getBackgroundSurface() == null) {
- Log.w(TAG, "mBackgroundSurface is null !");
return;
}
@@ -201,6 +200,30 @@
}
}
+ /**
+ * onConfigurationChanged events for updating tutorial text.
+ */
+ public void onConfigurationChanged() {
+ synchronized (mLock) {
+ if (mBackgroundSurface == null) {
+ getBackgroundSurface();
+ } else {
+ removeBackgroundPanelLayer();
+ }
+ updateThemeColors();
+ showBackgroundPanelLayer();
+ }
+ }
+
+ private void updateThemeColors() {
+ synchronized (mLock) {
+ final int themeColor = mContext.getColor(R.color.one_handed_tutorial_background_color);
+ mDefaultColor = new float[]{(Color.red(themeColor) - THEME_COLOR_OFFSET) / 255.0f,
+ (Color.green(themeColor) - THEME_COLOR_OFFSET) / 255.0f,
+ (Color.blue(themeColor) - THEME_COLOR_OFFSET) / 255.0f};
+ }
+ }
+
void dump(@NonNull PrintWriter pw) {
final String innerPrefix = " ";
pw.println(TAG);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedController.java
index 2038cff..09cde38 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedController.java
@@ -658,12 +658,13 @@
}
private void onConfigChanged(Configuration newConfig) {
- if (mTutorialHandler == null) {
+ if (mTutorialHandler == null || mBackgroundPanelOrganizer == null) {
return;
}
if (!mIsOneHandedEnabled || newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
return;
}
+ mBackgroundPanelOrganizer.onConfigurationChanged();
mTutorialHandler.onConfigurationChanged();
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedTutorialHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedTutorialHandler.java
index d0206a4..97e04b5 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedTutorialHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedTutorialHandler.java
@@ -25,8 +25,11 @@
import static com.android.wm.shell.onehanded.OneHandedState.STATE_EXITING;
import static com.android.wm.shell.onehanded.OneHandedState.STATE_NONE;
+import android.animation.ValueAnimator;
import android.annotation.Nullable;
import android.content.Context;
+import android.content.res.ColorStateList;
+import android.content.res.TypedArray;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.os.SystemProperties;
@@ -35,9 +38,13 @@
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
+import android.view.animation.LinearInterpolator;
import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.TextView;
import androidx.annotation.NonNull;
+import androidx.appcompat.view.ContextThemeWrapper;
import com.android.internal.annotations.VisibleForTesting;
import com.android.wm.shell.R;
@@ -53,11 +60,14 @@
public class OneHandedTutorialHandler implements OneHandedTransitionCallback,
OneHandedState.OnStateChangedListener {
private static final String TAG = "OneHandedTutorialHandler";
- private static final String ONE_HANDED_MODE_OFFSET_PERCENTAGE =
- "persist.debug.one_handed_offset_percentage";
+ private static final String OFFSET_PERCENTAGE = "persist.debug.one_handed_offset_percentage";
+ private static final String TRANSLATE_ANIMATION_DURATION =
+ "persist.debug.one_handed_translate_animation_duration";
+ private static final float START_TRANSITION_FRACTION = 0.7f;
private final float mTutorialHeightRatio;
private final WindowManager mWindowManager;
+ private final OneHandedAnimationCallback mAnimationCallback;
private @OneHandedState.State int mCurrentState;
private int mTutorialAreaHeight;
@@ -67,7 +77,9 @@
private @Nullable View mTutorialView;
private @Nullable ViewGroup mTargetViewContainer;
- private final OneHandedAnimationCallback mAnimationCallback;
+ private float mAlphaTransitionStart;
+ private ValueAnimator mAlphaAnimator;
+ private int mAlphaAnimationDurationMs;
public OneHandedTutorialHandler(Context context, WindowManager windowManager) {
mContext = context;
@@ -75,15 +87,35 @@
final float offsetPercentageConfig = context.getResources().getFraction(
R.fraction.config_one_handed_offset, 1, 1);
final int sysPropPercentageConfig = SystemProperties.getInt(
- ONE_HANDED_MODE_OFFSET_PERCENTAGE, Math.round(offsetPercentageConfig * 100.0f));
+ OFFSET_PERCENTAGE, Math.round(offsetPercentageConfig * 100.0f));
mTutorialHeightRatio = sysPropPercentageConfig / 100.0f;
+ final int animationDuration = context.getResources().getInteger(
+ R.integer.config_one_handed_translate_animation_duration);
+ mAlphaAnimationDurationMs = SystemProperties.getInt(TRANSLATE_ANIMATION_DURATION,
+ animationDuration);
mAnimationCallback = new OneHandedAnimationCallback() {
@Override
+ public void onOneHandedAnimationCancel(
+ OneHandedAnimationController.OneHandedTransitionAnimator animator) {
+ if (mAlphaAnimator != null) {
+ mAlphaAnimator.cancel();
+ }
+ }
+
+ @Override
public void onAnimationUpdate(float xPos, float yPos) {
if (!isAttached()) {
return;
}
- mTargetViewContainer.setTranslationY(yPos - mTutorialAreaHeight);
+ if (yPos < mAlphaTransitionStart) {
+ checkTransitionEnd();
+ return;
+ }
+ if (mAlphaAnimator == null || mAlphaAnimator.isStarted()
+ || mAlphaAnimator.isRunning()) {
+ return;
+ }
+ mAlphaAnimator.start();
}
};
}
@@ -94,12 +126,16 @@
switch (newState) {
case STATE_ENTERING:
createViewAndAttachToWindow(mContext);
+ updateThemeColor();
+ setupAlphaTransition(true /* isEntering */);
break;
case STATE_ACTIVE:
- case STATE_EXITING:
- // no - op
+ checkTransitionEnd();
+ setupAlphaTransition(false /* isEntering */);
break;
+ case STATE_EXITING:
case STATE_NONE:
+ checkTransitionEnd();
removeTutorialFromWindowManager();
break;
default:
@@ -119,6 +155,7 @@
mDisplayBounds = new Rect(0, 0, displayLayout.height(), displayLayout.width());
}
mTutorialAreaHeight = Math.round(mDisplayBounds.height() * mTutorialHeightRatio);
+ mAlphaTransitionStart = mTutorialAreaHeight * START_TRANSITION_FRACTION;
}
@VisibleForTesting
@@ -129,6 +166,7 @@
mTutorialView = LayoutInflater.from(context).inflate(R.layout.one_handed_tutorial, null);
mTargetViewContainer = new FrameLayout(context);
mTargetViewContainer.setClipChildren(false);
+ mTargetViewContainer.setAlpha(mCurrentState == STATE_ACTIVE ? 1.0f : 0.0f);
mTargetViewContainer.addView(mTutorialView);
mTargetViewContainer.setLayerType(LAYER_TYPE_HARDWARE, null);
@@ -192,6 +230,52 @@
removeTutorialFromWindowManager();
if (mCurrentState == STATE_ENTERING || mCurrentState == STATE_ACTIVE) {
createViewAndAttachToWindow(mContext);
+ updateThemeColor();
+ checkTransitionEnd();
+ }
+ }
+
+ private void updateThemeColor() {
+ if (mTutorialView == null) {
+ return;
+ }
+
+ final Context themedContext = new ContextThemeWrapper(mTutorialView.getContext(),
+ com.android.internal.R.style.Theme_DeviceDefault_DayNight);
+ final int textColorPrimary;
+ final int themedTextColorSecondary;
+ TypedArray ta = themedContext.obtainStyledAttributes(new int[]{
+ com.android.internal.R.attr.textColorPrimary,
+ com.android.internal.R.attr.textColorSecondary});
+ textColorPrimary = ta.getColor(0, 0);
+ themedTextColorSecondary = ta.getColor(1, 0);
+ ta.recycle();
+
+ final ImageView iconView = mTutorialView.findViewById(R.id.one_handed_tutorial_image);
+ iconView.setImageTintList(ColorStateList.valueOf(textColorPrimary));
+
+ final TextView tutorialTitle = mTutorialView.findViewById(R.id.one_handed_tutorial_title);
+ final TextView tutorialDesc = mTutorialView.findViewById(
+ R.id.one_handed_tutorial_description);
+ tutorialTitle.setTextColor(textColorPrimary);
+ tutorialDesc.setTextColor(themedTextColorSecondary);
+ }
+
+ private void setupAlphaTransition(boolean isEntering) {
+ final float start = isEntering ? 0.0f : 1.0f;
+ final float end = isEntering ? 1.0f : 0.0f;
+ mAlphaAnimator = ValueAnimator.ofFloat(start, end);
+ mAlphaAnimator.setInterpolator(new LinearInterpolator());
+ mAlphaAnimator.setDuration(mAlphaAnimationDurationMs);
+ mAlphaAnimator.addUpdateListener(
+ animator -> mTargetViewContainer.setAlpha((float) animator.getAnimatedValue()));
+ }
+
+ private void checkTransitionEnd() {
+ if (mAlphaAnimator != null && mAlphaAnimator.isRunning()) {
+ mAlphaAnimator.end();
+ mAlphaAnimator.removeAllUpdateListeners();
+ mAlphaAnimator = null;
}
}
@@ -206,5 +290,9 @@
pw.println(mDisplayBounds);
pw.print(innerPrefix + "mTutorialAreaHeight=");
pw.println(mTutorialAreaHeight);
+ pw.print(innerPrefix + "mAlphaTransitionStart=");
+ pw.println(mAlphaTransitionStart);
+ pw.print(innerPrefix + "mAlphaAnimationDurationMs=");
+ pw.println(mAlphaAnimationDurationMs);
}
}
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 200af74..05111a3 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
@@ -38,6 +38,7 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.graphics.SfVsyncFrameCallbackProvider;
import com.android.wm.shell.animation.Interpolators;
+import com.android.wm.shell.transition.Transitions;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -617,14 +618,28 @@
setCurrentValue(bounds);
final Rect insets = computeInsets(fraction);
final float degree, x, y;
- if (rotationDelta == ROTATION_90) {
- degree = 90 * fraction;
- x = fraction * (end.right - start.left) + start.left;
- y = fraction * (end.top - start.top) + start.top;
+ if (Transitions.ENABLE_SHELL_TRANSITIONS) {
+ if (rotationDelta == ROTATION_90) {
+ degree = 90 * (1 - fraction);
+ x = fraction * (end.left - start.left)
+ + start.left + start.right * (1 - fraction);
+ y = fraction * (end.top - start.top) + start.top;
+ } else {
+ degree = -90 * (1 - fraction);
+ x = fraction * (end.left - start.left) + start.left;
+ y = fraction * (end.top - start.top)
+ + start.top + start.bottom * (1 - fraction);
+ }
} else {
- degree = -90 * fraction;
- x = fraction * (end.left - start.left) + start.left;
- y = fraction * (end.bottom - start.top) + start.top;
+ if (rotationDelta == ROTATION_90) {
+ degree = 90 * fraction;
+ x = fraction * (end.right - start.left) + start.left;
+ y = fraction * (end.top - start.top) + start.top;
+ } else {
+ degree = -90 * fraction;
+ x = fraction * (end.left - start.left) + start.left;
+ y = fraction * (end.bottom - start.top) + start.top;
+ }
}
getSurfaceTransactionHelper()
.rotateAndScaleWithCrop(tx, leash, initialContainerRect, bounds,
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 728794d..180e3fb 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
@@ -23,6 +23,7 @@
import android.view.SurfaceControl;
import com.android.wm.shell.R;
+import com.android.wm.shell.transition.Transitions;
/**
* Abstracts the common operations on {@link SurfaceControl.Transaction} for PiP transition.
@@ -137,7 +138,8 @@
// destination are different.
final float scale = srcW <= srcH ? (float) destW / srcW : (float) destH / srcH;
final Rect crop = mTmpDestinationRect;
- crop.set(0, 0, destW, destH);
+ crop.set(0, 0, Transitions.ENABLE_SHELL_TRANSITIONS ? destH
+ : destW, Transitions.ENABLE_SHELL_TRANSITIONS ? destW : destH);
// Inverse scale for crop to fit in screen coordinates.
crop.scale(1 / scale);
crop.offset(insets.left, insets.top);
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 a0d83c0..d77619a 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
@@ -243,16 +243,8 @@
private @Surface.Rotation int mCurrentRotation;
/**
- * If set to {@code true}, no entering PiP transition would be kicked off and most likely
- * it's due to the fact that Launcher is handling the transition directly when swiping
- * auto PiP-able Activity to home.
- * See also {@link #startSwipePipToHome(ComponentName, ActivityInfo, PictureInPictureParams)}.
- */
- private boolean mInSwipePipToHomeTransition;
-
- /**
* An optional overlay used to mask content changing between an app in/out of PiP, only set if
- * {@link #mInSwipePipToHomeTransition} is true.
+ * {@link PipTransitionState#getInSwipePipToHomeTransition()} is true.
*/
private SurfaceControl mSwipePipToHomeOverlay;
@@ -343,7 +335,7 @@
*/
public Rect startSwipePipToHome(ComponentName componentName, ActivityInfo activityInfo,
PictureInPictureParams pictureInPictureParams) {
- mInSwipePipToHomeTransition = true;
+ mPipTransitionState.setInSwipePipToHomeTransition(true);
sendOnPipTransitionStarted(TRANSITION_DIRECTION_TO_PIP);
setBoundsStateForEntry(componentName, pictureInPictureParams, activityInfo);
return mPipBoundsAlgorithm.getEntryDestinationBounds();
@@ -356,7 +348,7 @@
public void stopSwipePipToHome(ComponentName componentName, Rect destinationBounds,
SurfaceControl overlay) {
// do nothing if there is no startSwipePipToHome being called before
- if (mInSwipePipToHomeTransition) {
+ if (mPipTransitionState.getInSwipePipToHomeTransition()) {
mPipBoundsState.setBounds(destinationBounds);
mSwipePipToHomeOverlay = overlay;
}
@@ -517,7 +509,7 @@
mOnDisplayIdChangeCallback.accept(info.displayId);
}
- if (mInSwipePipToHomeTransition) {
+ if (mPipTransitionState.getInSwipePipToHomeTransition()) {
if (!mWaitForFixedRotation) {
onEndOfSwipePipToHomeTransition();
} else {
@@ -626,7 +618,7 @@
private void onEndOfSwipePipToHomeTransition() {
if (Transitions.ENABLE_SHELL_TRANSITIONS) {
- mInSwipePipToHomeTransition = false;
+ mPipTransitionState.setInSwipePipToHomeTransition(false);
mSwipePipToHomeOverlay = null;
return;
}
@@ -650,7 +642,7 @@
null /* callback */, false /* withStartDelay */);
}
}, tx);
- mInSwipePipToHomeTransition = false;
+ mPipTransitionState.setInSwipePipToHomeTransition(false);
mSwipePipToHomeOverlay = null;
}
@@ -718,7 +710,7 @@
return;
}
clearWaitForFixedRotation();
- mInSwipePipToHomeTransition = false;
+ mPipTransitionState.setInSwipePipToHomeTransition(false);
mPictureInPictureParams = null;
mPipTransitionState.setTransitionState(PipTransitionState.UNDEFINED);
// Re-set the PIP bounds to none.
@@ -793,7 +785,7 @@
return;
}
if (mPipTransitionState.getTransitionState() == PipTransitionState.TASK_APPEARED) {
- if (mInSwipePipToHomeTransition) {
+ if (mPipTransitionState.getInSwipePipToHomeTransition()) {
onEndOfSwipePipToHomeTransition();
} else {
// Schedule a regular animation to ensure all the callbacks are still being sent.
@@ -859,10 +851,12 @@
// Skip this entirely if that's the case.
final boolean waitForFixedRotationOnEnteringPip = mWaitForFixedRotation
&& (mPipTransitionState.getTransitionState() != PipTransitionState.ENTERED_PIP);
- if ((mInSwipePipToHomeTransition || waitForFixedRotationOnEnteringPip) && fromRotation) {
+ if ((mPipTransitionState.getInSwipePipToHomeTransition()
+ || waitForFixedRotationOnEnteringPip) && fromRotation) {
if (DEBUG) {
Log.d(TAG, "Skip onMovementBoundsChanged on rotation change"
- + " mInSwipePipToHomeTransition=" + mInSwipePipToHomeTransition
+ + " InSwipePipToHomeTransition="
+ + mPipTransitionState.getInSwipePipToHomeTransition()
+ " mWaitForFixedRotation=" + mWaitForFixedRotation
+ " getTransitionState=" + mPipTransitionState.getTransitionState());
}
@@ -1383,11 +1377,20 @@
final ValueAnimator animator = ValueAnimator.ofFloat(1.0f, 0.0f);
animator.setDuration(mCrossFadeAnimationDuration);
animator.addUpdateListener(animation -> {
- final float alpha = (float) animation.getAnimatedValue();
- final SurfaceControl.Transaction transaction =
- mSurfaceControlTransactionFactory.getTransaction();
- transaction.setAlpha(surface, alpha);
- transaction.apply();
+ if (mPipTransitionState.getTransitionState() == PipTransitionState.UNDEFINED) {
+ // Could happen if onTaskVanished happens during the animation since we may have
+ // set a start delay on this animation.
+ Log.d(TAG, "Task vanished, skip fadeOutAndRemoveOverlay");
+ animation.removeAllListeners();
+ animation.removeAllUpdateListeners();
+ animation.cancel();
+ } else {
+ final float alpha = (float) animation.getAnimatedValue();
+ final SurfaceControl.Transaction transaction =
+ mSurfaceControlTransactionFactory.getTransaction();
+ transaction.setAlpha(surface, alpha);
+ transaction.apply();
+ }
});
animator.addListener(new AnimatorListenerAdapter() {
@Override
@@ -1400,6 +1403,10 @@
}
private void removeContentOverlay(SurfaceControl surface, Runnable callback) {
+ if (mPipTransitionState.getTransitionState() == PipTransitionState.UNDEFINED) {
+ // Avoid double removal, which is fatal.
+ return;
+ }
final SurfaceControl.Transaction tx =
mSurfaceControlTransactionFactory.getTransaction();
tx.remove(surface);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
index 18153e3..ae17a93 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
@@ -18,6 +18,7 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
+import static android.util.RotationUtils.deltaRotation;
import static android.view.WindowManager.TRANSIT_PIP;
import static android.window.TransitionInfo.FLAG_IS_WALLPAPER;
@@ -151,7 +152,8 @@
mPipTransitionState.setTransitionState(PipTransitionState.ENTERING_PIP);
mFinishCallback = finishCallback;
return startEnterAnimation(enterPip.getTaskInfo(), enterPip.getLeash(),
- startTransaction, finishTransaction);
+ startTransaction, finishTransaction, enterPip.getStartRotation(),
+ enterPip.getEndRotation());
}
@Nullable
@@ -208,7 +210,8 @@
private boolean startEnterAnimation(final TaskInfo taskInfo, final SurfaceControl leash,
final SurfaceControl.Transaction startTransaction,
- final SurfaceControl.Transaction finishTransaction) {
+ final SurfaceControl.Transaction finishTransaction,
+ final int startRotation, final int endRotation) {
setBoundsStateForEntry(taskInfo.topActivity, taskInfo.pictureInPictureParams,
taskInfo.topActivityInfo);
final Rect destinationBounds = mPipBoundsAlgorithm.getEntryDestinationBounds();
@@ -216,7 +219,8 @@
PipAnimationController.PipTransitionAnimator animator;
finishTransaction.setPosition(leash, destinationBounds.left, destinationBounds.top);
if (taskInfo.pictureInPictureParams != null
- && taskInfo.pictureInPictureParams.isAutoEnterEnabled()) {
+ && taskInfo.pictureInPictureParams.isAutoEnterEnabled()
+ && mPipTransitionState.getInSwipePipToHomeTransition()) {
mOneShotAnimationType = ANIM_TYPE_BOUNDS;
// PiP menu is attached late in the process here to avoid any artifacts on the leash
@@ -234,13 +238,21 @@
mFinishCallback = null;
return true;
}
+
+ int rotationDelta = deltaRotation(endRotation, startRotation);
+ if (rotationDelta != Surface.ROTATION_0) {
+ Matrix tmpTransform = new Matrix();
+ tmpTransform.postRotate(rotationDelta == Surface.ROTATION_90
+ ? Surface.ROTATION_270 : Surface.ROTATION_90);
+ startTransaction.setMatrix(leash, tmpTransform, new float[9]);
+ }
if (mOneShotAnimationType == ANIM_TYPE_BOUNDS) {
final Rect sourceHintRect =
PipBoundsAlgorithm.getValidSourceHintRect(
taskInfo.pictureInPictureParams, currentBounds);
animator = mPipAnimationController.getAnimator(taskInfo, leash, currentBounds,
currentBounds, destinationBounds, sourceHintRect, TRANSITION_DIRECTION_TO_PIP,
- 0 /* startingAngle */, Surface.ROTATION_0);
+ 0 /* startingAngle */, rotationDelta);
} else if (mOneShotAnimationType == ANIM_TYPE_ALPHA) {
startTransaction.setAlpha(leash, 0f);
// PiP menu is attached late in the process here to avoid any artifacts on the leash
@@ -258,6 +270,7 @@
.setPipAnimationCallback(mPipAnimationCallback)
.setDuration(mEnterExitAnimationDuration)
.start();
+
return true;
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransitionState.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransitionState.java
index d23aada..85e56b7 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransitionState.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransitionState.java
@@ -17,6 +17,9 @@
package com.android.wm.shell.pip;
import android.annotation.IntDef;
+import android.app.PictureInPictureParams;
+import android.content.ComponentName;
+import android.content.pm.ActivityInfo;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -34,6 +37,15 @@
public static final int ENTERED_PIP = 4;
public static final int EXITING_PIP = 5;
+ /**
+ * If set to {@code true}, no entering PiP transition would be kicked off and most likely
+ * it's due to the fact that Launcher is handling the transition directly when swiping
+ * auto PiP-able Activity to home.
+ * See also {@link PipTaskOrganizer#startSwipePipToHome(ComponentName, ActivityInfo,
+ * PictureInPictureParams)}.
+ */
+ private boolean mInSwipePipToHomeTransition;
+
// Not a complete set of states but serves what we want right now.
@IntDef(prefix = { "TRANSITION_STATE_" }, value = {
UNDEFINED,
@@ -65,6 +77,13 @@
&& mState != EXITING_PIP;
}
+ public void setInSwipePipToHomeTransition(boolean inSwipePipToHomeTransition) {
+ mInSwipePipToHomeTransition = inSwipePipToHomeTransition;
+ }
+
+ public boolean getInSwipePipToHomeTransition() {
+ return mInSwipePipToHomeTransition;
+ }
/**
* Resize request can be initiated in other component, ignore if we are no longer in PIP,
* still waiting for animation or we're exiting from it.
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 1da9577..82092ac 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
@@ -158,14 +158,16 @@
@Override
public void onReleasedInTarget(@NonNull MagnetizedObject.MagneticTarget target) {
- mMainExecutor.executeDelayed(() -> {
- mMotionHelper.notifyDismissalPending();
- mMotionHelper.animateDismiss();
- hideDismissTargetMaybe();
+ if (mEnableDismissDragToEdge) {
+ mMainExecutor.executeDelayed(() -> {
+ mMotionHelper.notifyDismissalPending();
+ mMotionHelper.animateDismiss();
+ hideDismissTargetMaybe();
- mPipUiEventLogger.log(
- PipUiEventLogger.PipUiEventEnum.PICTURE_IN_PICTURE_DRAG_TO_REMOVE);
- }, 0);
+ mPipUiEventLogger.log(
+ PipUiEventLogger.PipUiEventEnum.PICTURE_IN_PICTURE_DRAG_TO_REMOVE);
+ }, 0);
+ }
}
});
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreen.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreen.java
index d6afeba..0e76da7 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreen.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreen.java
@@ -17,10 +17,13 @@
package com.android.wm.shell.splitscreen;
import android.annotation.IntDef;
+import android.annotation.NonNull;
import com.android.wm.shell.common.annotations.ExternalThread;
import com.android.wm.shell.common.split.SplitLayout.SplitPosition;
+import java.util.concurrent.Executor;
+
/**
* Interface to engage split-screen feature.
* TODO: Figure out which of these are actually needed outside of the Shell
@@ -53,10 +56,18 @@
/** Callback interface for listening to changes in a split-screen stage. */
interface SplitScreenListener {
- void onStagePositionChanged(@StageType int stage, @SplitPosition int position);
- void onTaskStageChanged(int taskId, @StageType int stage, boolean visible);
+ default void onStagePositionChanged(@StageType int stage, @SplitPosition int position) {}
+ default void onTaskStageChanged(int taskId, @StageType int stage, boolean visible) {}
+ default void onSplitVisibilityChanged(boolean visible) {}
}
+ /** Registers listener that gets split screen callback. */
+ void registerSplitScreenListener(@NonNull SplitScreenListener listener,
+ @NonNull Executor executor);
+
+ /** Unregisters listener that gets split screen callback. */
+ void unregisterSplitScreenListener(@NonNull SplitScreenListener listener);
+
/**
* Returns a binder that can be passed to an external process to manipulate SplitScreen.
*/
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java
index aca545b4..988efb6 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenController.java
@@ -36,6 +36,7 @@
import android.os.IBinder;
import android.os.RemoteException;
import android.os.UserHandle;
+import android.util.ArrayMap;
import android.util.Slog;
import android.view.IRemoteAnimationFinishedCallback;
import android.view.RemoteAnimationAdapter;
@@ -64,6 +65,7 @@
import com.android.wm.shell.transition.Transitions;
import java.io.PrintWriter;
+import java.util.concurrent.Executor;
/**
* Class manages split-screen multitasking mode and implements the main interface
@@ -249,14 +251,17 @@
});
return;
}
- }
- for (int i = 0; i < apps.length; ++i) {
- if (apps[i].mode == MODE_OPENING) {
- t.show(apps[i].leash);
+ } else {
+ for (int i = 0; i < apps.length; ++i) {
+ if (apps[i].mode == MODE_OPENING) {
+ t.show(apps[i].leash);
+ }
}
}
RemoteAnimationTarget divider = mStageCoordinator.getDividerBarLegacyTarget();
- t.show(divider.leash);
+ if (divider.leash != null) {
+ t.show(divider.leash);
+ }
t.apply();
if (cancelled) return;
try {
@@ -290,6 +295,38 @@
@ExternalThread
private class SplitScreenImpl implements SplitScreen {
private ISplitScreenImpl mISplitScreen;
+ private final ArrayMap<SplitScreenListener, Executor> mExecutors = new ArrayMap<>();
+ private final SplitScreen.SplitScreenListener mListener = new SplitScreenListener() {
+ @Override
+ public void onStagePositionChanged(int stage, int position) {
+ for (int i = 0; i < mExecutors.size(); i++) {
+ final int index = i;
+ mExecutors.valueAt(index).execute(() -> {
+ mExecutors.keyAt(index).onStagePositionChanged(stage, position);
+ });
+ }
+ }
+
+ @Override
+ public void onTaskStageChanged(int taskId, int stage, boolean visible) {
+ for (int i = 0; i < mExecutors.size(); i++) {
+ final int index = i;
+ mExecutors.valueAt(index).execute(() -> {
+ mExecutors.keyAt(index).onTaskStageChanged(taskId, stage, visible);
+ });
+ }
+ }
+
+ @Override
+ public void onSplitVisibilityChanged(boolean visible) {
+ for (int i = 0; i < mExecutors.size(); i++) {
+ final int index = i;
+ mExecutors.valueAt(index).execute(() -> {
+ mExecutors.keyAt(index).onSplitVisibilityChanged(visible);
+ });
+ }
+ }
+ };
@Override
public ISplitScreen createExternalInterface() {
@@ -306,6 +343,34 @@
SplitScreenController.this.onKeyguardOccludedChanged(occluded);
});
}
+
+ @Override
+ public void registerSplitScreenListener(SplitScreenListener listener, Executor executor) {
+ if (mExecutors.containsKey(listener)) return;
+
+ mMainExecutor.execute(() -> {
+ if (mExecutors.size() == 0) {
+ SplitScreenController.this.registerSplitScreenListener(mListener);
+ }
+
+ mExecutors.put(listener, executor);
+ });
+
+ executor.execute(() -> {
+ mStageCoordinator.sendStatusToListener(listener);
+ });
+ }
+
+ @Override
+ public void unregisterSplitScreenListener(SplitScreenListener listener) {
+ mMainExecutor.execute(() -> {
+ mExecutors.remove(listener);
+
+ if (mExecutors.size() == 0) {
+ SplitScreenController.this.unregisterSplitScreenListener(mListener);
+ }
+ });
+ }
}
/**
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
index 81ce2b7..d1aa2d7 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
@@ -501,16 +501,21 @@
void registerSplitScreenListener(SplitScreen.SplitScreenListener listener) {
if (mListeners.contains(listener)) return;
mListeners.add(listener);
- listener.onStagePositionChanged(STAGE_TYPE_MAIN, getMainStagePosition());
- listener.onStagePositionChanged(STAGE_TYPE_SIDE, getSideStagePosition());
- mSideStage.onSplitScreenListenerRegistered(listener, STAGE_TYPE_SIDE);
- mMainStage.onSplitScreenListenerRegistered(listener, STAGE_TYPE_MAIN);
+ sendStatusToListener(listener);
}
void unregisterSplitScreenListener(SplitScreen.SplitScreenListener listener) {
mListeners.remove(listener);
}
+ void sendStatusToListener(SplitScreen.SplitScreenListener listener) {
+ listener.onStagePositionChanged(STAGE_TYPE_MAIN, getMainStagePosition());
+ listener.onStagePositionChanged(STAGE_TYPE_SIDE, getSideStagePosition());
+ listener.onSplitVisibilityChanged(isSplitScreenVisible());
+ mSideStage.onSplitScreenListenerRegistered(listener, STAGE_TYPE_SIDE);
+ mMainStage.onSplitScreenListenerRegistered(listener, STAGE_TYPE_MAIN);
+ }
+
private void sendOnStagePositionChanged() {
for (int i = mListeners.size() - 1; i >= 0; --i) {
final SplitScreen.SplitScreenListener l = mListeners.get(i);
@@ -535,6 +540,13 @@
}
}
+ private void sendSplitVisibilityChanged() {
+ for (int i = mListeners.size() - 1; i >= 0; --i) {
+ final SplitScreen.SplitScreenListener l = mListeners.get(i);
+ l.onSplitVisibilityChanged(mDividerVisible);
+ }
+ }
+
private void onStageRootTaskAppeared(StageListenerImpl stageListener) {
if (mMainStageListener.mHasRootTask && mSideStageListener.mHasRootTask) {
mUseLegacySplit = mContext.getResources().getBoolean(R.bool.config_useLegacySplit);
@@ -574,6 +586,7 @@
} else {
mSplitLayout.release();
}
+ sendSplitVisibilityChanged();
}
private void onStageVisibilityChanged(StageListenerImpl stageListener) {
@@ -620,22 +633,9 @@
}
mSyncQueue.runInSync(t -> {
- final SurfaceControl dividerLeash = mSplitLayout.getDividerLeash();
final SurfaceControl sideStageLeash = mSideStage.mRootLeash;
final SurfaceControl mainStageLeash = mMainStage.mRootLeash;
- if (dividerLeash != null) {
- if (mDividerVisible) {
- t.show(dividerLeash)
- .setLayer(dividerLeash, Integer.MAX_VALUE)
- .setPosition(dividerLeash,
- mSplitLayout.getDividerBounds().left,
- mSplitLayout.getDividerBounds().top);
- } else {
- t.hide(dividerLeash);
- }
- }
-
if (sideStageVisible) {
final Rect sideStageBounds = getSideStageBounds();
t.show(sideStageLeash)
@@ -662,9 +662,30 @@
} else {
t.hide(mainStageLeash);
}
+
+ applyDividerVisibility(t);
});
}
+ private void applyDividerVisibility(SurfaceControl.Transaction t) {
+ final SurfaceControl dividerLeash = mSplitLayout.getDividerLeash();
+ if (dividerLeash == null) {
+ return;
+ }
+
+ if (mDividerVisible) {
+ t.show(dividerLeash)
+ .setLayer(dividerLeash, Integer.MAX_VALUE)
+ .setPosition(dividerLeash,
+ mSplitLayout.getDividerBounds().left,
+ mSplitLayout.getDividerBounds().top);
+ } else {
+ t.hide(dividerLeash);
+ }
+
+ }
+
+
private void onStageHasChildrenChanged(StageListenerImpl stageListener) {
final boolean hasChildren = stageListener.mHasChildren;
final boolean isSideStage = stageListener == mSideStageListener;
@@ -782,6 +803,7 @@
&& mSplitLayout.updateConfiguration(mDisplayAreaInfo.configuration)
&& mMainStage.isActive()) {
onBoundsChanged(mSplitLayout);
+ mSyncQueue.runInSync(t -> applyDividerVisibility(t));
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java
index 56ad2be..dff5577 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/SplashscreenContentDrawer.java
@@ -23,6 +23,7 @@
import static android.window.StartingWindowInfo.STARTING_WINDOW_TYPE_SPLASH_SCREEN;
import android.annotation.ColorInt;
+import android.annotation.IntDef;
import android.annotation.NonNull;
import android.app.ActivityThread;
import android.content.BroadcastReceiver;
@@ -64,6 +65,7 @@
import java.util.List;
import java.util.function.Consumer;
+import java.util.function.IntPredicate;
import java.util.function.IntSupplier;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;
@@ -132,7 +134,6 @@
* @param splashScreenViewConsumer Receiving the SplashScreenView object, which will also be
* executed on splash screen thread. Note that the view can be
* null if failed.
- * @param bgColorConsumer Receiving the background color once it's estimated complete.
*/
void createContentView(Context context, @StartingWindowType int suggestType, ActivityInfo info,
int taskId, Consumer<SplashScreenView> splashScreenViewConsumer) {
@@ -209,9 +210,9 @@
}
private static int estimateWindowBGColor(Drawable themeBGDrawable) {
- final DrawableColorTester themeBGTester =
- new DrawableColorTester(themeBGDrawable, true /* filterTransparent */);
- if (themeBGTester.nonTransparentRatio() == 0) {
+ final DrawableColorTester themeBGTester = new DrawableColorTester(
+ themeBGDrawable, DrawableColorTester.TRANSPARENT_FILTER /* filterType */);
+ if (themeBGTester.passFilterRatio() == 0) {
// the window background is transparent, unable to draw
Slog.w(TAG, "Window background is transparent, fill background with black color");
return getSystemBGColor();
@@ -414,7 +415,8 @@
final ColorCache.IconColor iconColor = mColorCache.getIconColor(
mActivityInfo.packageName, mActivityInfo.getIconResource(),
mLastPackageContextConfigHash,
- () -> new DrawableColorTester(iconForeground, true /* filterTransparent */),
+ () -> new DrawableColorTester(iconForeground,
+ DrawableColorTester.TRANSLUCENT_FILTER /* filterType */),
() -> new DrawableColorTester(adaptiveIconDrawable.getBackground()));
if (DEBUG) {
@@ -443,7 +445,7 @@
// Reference AdaptiveIcon description, outer is 108 and inner is 72, so we
// scale by 192/160 if we only draw adaptiveIcon's foreground.
final float noBgScale =
- iconColor.mFgNonTransparentRatio < ENLARGE_FOREGROUND_ICON_THRESHOLD
+ iconColor.mFgNonTranslucentRatio < ENLARGE_FOREGROUND_ICON_THRESHOLD
? NO_BACKGROUND_SCALE : 1f;
// Using AdaptiveIconDrawable here can help keep the shape consistent with the
// current settings.
@@ -545,13 +547,26 @@
}
private static class DrawableColorTester {
+ private static final int NO_ALPHA_FILTER = 0;
+ // filter out completely invisible pixels
+ private static final int TRANSPARENT_FILTER = 1;
+ // filter out translucent and invisible pixels
+ private static final int TRANSLUCENT_FILTER = 2;
+
+ @IntDef(flag = true, value = {
+ NO_ALPHA_FILTER,
+ TRANSPARENT_FILTER,
+ TRANSLUCENT_FILTER
+ })
+ private @interface QuantizerFilterType {}
+
private final ColorTester mColorChecker;
DrawableColorTester(Drawable drawable) {
- this(drawable, false /* filterTransparent */);
+ this(drawable, NO_ALPHA_FILTER /* filterType */);
}
- DrawableColorTester(Drawable drawable, boolean filterTransparent) {
+ DrawableColorTester(Drawable drawable, @QuantizerFilterType int filterType) {
// Some applications use LayerDrawable for their windowBackground. To ensure that we
// only get the real background, so that the color is not affected by the alpha of the
// upper layer, try to get the lower layer here. This can also speed up the calculation.
@@ -570,12 +585,12 @@
} else {
mColorChecker = drawable instanceof ColorDrawable
? new SingleColorTester((ColorDrawable) drawable)
- : new ComplexDrawableTester(drawable, filterTransparent);
+ : new ComplexDrawableTester(drawable, filterType);
}
}
- public float nonTransparentRatio() {
- return mColorChecker.nonTransparentRatio();
+ public float passFilterRatio() {
+ return mColorChecker.passFilterRatio();
}
public boolean isComplexColor() {
@@ -594,7 +609,7 @@
* A help class to check the color information from a Drawable.
*/
private interface ColorTester {
- float nonTransparentRatio();
+ float passFilterRatio();
boolean isComplexColor();
@@ -622,7 +637,7 @@
}
@Override
- public float nonTransparentRatio() {
+ public float passFilterRatio() {
final int alpha = mColorDrawable.getAlpha();
return (float) (alpha / 255);
}
@@ -651,15 +666,21 @@
private static final int MAX_BITMAP_SIZE = 40;
private final Palette mPalette;
private final boolean mFilterTransparent;
- private static final TransparentFilterQuantizer TRANSPARENT_FILTER_QUANTIZER =
- new TransparentFilterQuantizer();
+ private static final AlphaFilterQuantizer ALPHA_FILTER_QUANTIZER =
+ new AlphaFilterQuantizer();
- ComplexDrawableTester(Drawable drawable, boolean filterTransparent) {
+ /**
+ * @param drawable The test target.
+ * @param filterType Targeting to filter out transparent or translucent pixels,
+ * this would be needed if want to check
+ * {@link #passFilterRatio()}, also affecting the estimated result
+ * of the dominant color.
+ */
+ ComplexDrawableTester(Drawable drawable, @QuantizerFilterType int filterType) {
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "ComplexDrawableTester");
final Rect initialBounds = drawable.copyBounds();
int width = drawable.getIntrinsicWidth();
int height = drawable.getIntrinsicHeight();
-
// Some drawables do not have intrinsic dimensions
if (width <= 0 || height <= 0) {
width = MAX_BITMAP_SIZE;
@@ -680,9 +701,10 @@
// The Palette API will ignore Alpha, so it cannot handle transparent pixels, but
// sometimes we will need this information to know if this Drawable object is
// transparent.
- mFilterTransparent = filterTransparent;
+ mFilterTransparent = filterType != NO_ALPHA_FILTER;
if (mFilterTransparent) {
- builder = new Palette.Builder(bitmap, TRANSPARENT_FILTER_QUANTIZER)
+ ALPHA_FILTER_QUANTIZER.setFilter(filterType);
+ builder = new Palette.Builder(bitmap, ALPHA_FILTER_QUANTIZER)
.maximumColorCount(5);
} else {
builder = new Palette.Builder(bitmap, null)
@@ -694,8 +716,8 @@
}
@Override
- public float nonTransparentRatio() {
- return mFilterTransparent ? TRANSPARENT_FILTER_QUANTIZER.mNonTransparentRatio : 1;
+ public float passFilterRatio() {
+ return mFilterTransparent ? ALPHA_FILTER_QUANTIZER.mPassFilterRatio : 1;
}
@Override
@@ -726,17 +748,34 @@
return true;
}
- private static class TransparentFilterQuantizer implements Quantizer {
+ private static class AlphaFilterQuantizer implements Quantizer {
private static final int NON_TRANSPARENT = 0xFF000000;
private final Quantizer mInnerQuantizer = new VariationalKMeansQuantizer();
- private float mNonTransparentRatio;
+ private final IntPredicate mTransparentFilter = i -> (i & NON_TRANSPARENT) != 0;
+ private final IntPredicate mTranslucentFilter = i ->
+ (i & NON_TRANSPARENT) == NON_TRANSPARENT;
+
+ private IntPredicate mFilter = mTransparentFilter;
+ private float mPassFilterRatio;
+
+ void setFilter(@QuantizerFilterType int filterType) {
+ switch (filterType) {
+ case TRANSLUCENT_FILTER:
+ mFilter = mTranslucentFilter;
+ break;
+ case TRANSPARENT_FILTER:
+ default:
+ mFilter = mTransparentFilter;
+ break;
+ }
+ }
@Override
public void quantize(final int[] pixels, final int maxColors) {
- mNonTransparentRatio = 0;
+ mPassFilterRatio = 0;
int realSize = 0;
for (int i = pixels.length - 1; i > 0; i--) {
- if ((pixels[i] & NON_TRANSPARENT) != 0) {
+ if (mFilter.test(pixels[i])) {
realSize++;
}
}
@@ -747,11 +786,11 @@
mInnerQuantizer.quantize(pixels, maxColors);
return;
}
- mNonTransparentRatio = (float) realSize / pixels.length;
+ mPassFilterRatio = (float) realSize / pixels.length;
final int[] samplePixels = new int[realSize];
int rowIndex = 0;
for (int i = pixels.length - 1; i > 0; i--) {
- if ((pixels[i] & NON_TRANSPARENT) == NON_TRANSPARENT) {
+ if (mFilter.test(pixels[i])) {
samplePixels[rowIndex] = pixels[i];
rowIndex++;
}
@@ -810,16 +849,16 @@
final int mBgColor;
final boolean mIsBgComplex;
final boolean mIsBgGrayscale;
- final float mFgNonTransparentRatio;
+ final float mFgNonTranslucentRatio;
IconColor(int hash, int fgColor, int bgColor, boolean isBgComplex,
- boolean isBgGrayscale, float fgNonTransparentRatio) {
+ boolean isBgGrayscale, float fgNonTranslucnetRatio) {
super(hash);
mFgColor = fgColor;
mBgColor = bgColor;
mIsBgComplex = isBgComplex;
mIsBgGrayscale = isBgGrayscale;
- mFgNonTransparentRatio = fgNonTransparentRatio;
+ mFgNonTranslucentRatio = fgNonTranslucnetRatio;
}
}
@@ -905,7 +944,7 @@
final DrawableColorTester bgTester = bgColorTesterSupplier.get();
final IconColor iconColor = new IconColor(hash, fgTester.getDominateColor(),
bgTester.getDominateColor(), bgTester.isComplexColor(), bgTester.isGrayscale(),
- fgTester.nonTransparentRatio());
+ fgTester.passFilterRatio());
colors.mIconColors[leastUsedIndex[0]] = iconColor;
return iconColor;
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java
index 243751fe..fc7c86d 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawer.java
@@ -168,16 +168,14 @@
void addSplashScreenStartingWindow(StartingWindowInfo windowInfo, IBinder appToken,
@StartingWindowType int suggestType) {
final RunningTaskInfo taskInfo = windowInfo.taskInfo;
- final ActivityInfo activityInfo = taskInfo.topActivityInfo;
- if (activityInfo == null) {
+ final ActivityInfo activityInfo = windowInfo.targetActivityInfo != null
+ ? windowInfo.targetActivityInfo
+ : taskInfo.topActivityInfo;
+ if (activityInfo == null || activityInfo.packageName == null) {
return;
}
final int displayId = taskInfo.displayId;
- if (activityInfo.packageName == null) {
- return;
- }
-
final int taskId = taskInfo.taskId;
Context context = mContext;
// replace with the default theme if the application didn't set
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawerTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawerTests.java
index 284f384..d536adb 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawerTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawerTests.java
@@ -214,6 +214,7 @@
final ActivityManager.RunningTaskInfo taskInfo = new ActivityManager.RunningTaskInfo();
taskInfo.topActivityInfo = info;
taskInfo.taskId = taskId;
+ windowInfo.targetActivityInfo = info;
windowInfo.taskInfo = taskInfo;
return windowInfo;
}
diff --git a/libs/hwui/WebViewFunctorManager.cpp b/libs/hwui/WebViewFunctorManager.cpp
index df41011..5aad821 100644
--- a/libs/hwui/WebViewFunctorManager.cpp
+++ b/libs/hwui/WebViewFunctorManager.cpp
@@ -100,6 +100,9 @@
destroyContext();
ATRACE_NAME("WebViewFunctor::onDestroy");
+ if (mSurfaceControl) {
+ removeOverlays();
+ }
mCallbacks.onDestroyed(mFunctor, mData);
}
diff --git a/libs/hwui/jni/android_graphics_HardwareRenderer.cpp b/libs/hwui/jni/android_graphics_HardwareRenderer.cpp
index afe86cc..db59154 100644
--- a/libs/hwui/jni/android_graphics_HardwareRenderer.cpp
+++ b/libs/hwui/jni/android_graphics_HardwareRenderer.cpp
@@ -44,8 +44,6 @@
#include <utils/StrongPointer.h>
#include <utils/Timers.h>
-#include <pthread.h>
-
#include <algorithm>
#include <atomic>
#include <vector>
@@ -60,10 +58,6 @@
struct {
jclass clazz;
jmethodID invokePictureCapturedCallback;
- jmethodID createHintSession;
- jmethodID updateTargetWorkDuration;
- jmethodID reportActualWorkDuration;
- jmethodID closeHintSession;
} gHardwareRenderer;
struct {
@@ -90,14 +84,6 @@
return env;
}
-static bool hasExceptionAndClear(JNIEnv* env) {
- if (GraphicsJNI::hasException(env)) {
- env->ExceptionClear();
- return true;
- }
- return false;
-}
-
typedef ANativeWindow* (*ANW_fromSurface)(JNIEnv* env, jobject surface);
ANW_fromSurface fromSurface;
@@ -147,67 +133,6 @@
}
};
-class HintSessionWrapper : public LightRefBase<HintSessionWrapper> {
-public:
- static sp<HintSessionWrapper> create(JNIEnv* env, RenderProxy* proxy) {
- if (!Properties::useHintManager) return nullptr;
-
- // Include UI thread (self), render thread, and thread pool.
- std::vector<int> tids = CommonPool::getThreadIds();
- tids.push_back(proxy->getRenderThreadTid());
- tids.push_back(pthread_gettid_np(pthread_self()));
-
- jintArray tidsArray = env->NewIntArray(tids.size());
- if (hasExceptionAndClear(env)) return nullptr;
- env->SetIntArrayRegion(tidsArray, 0, tids.size(), reinterpret_cast<jint*>(tids.data()));
- if (hasExceptionAndClear(env)) return nullptr;
- jobject session = env->CallStaticObjectMethod(
- gHardwareRenderer.clazz, gHardwareRenderer.createHintSession, tidsArray);
- if (hasExceptionAndClear(env) || !session) return nullptr;
- return new HintSessionWrapper(env, session);
- }
-
- ~HintSessionWrapper() {
- if (!mSession) return;
- JNIEnv* env = getenv(mVm);
- env->CallStaticVoidMethod(gHardwareRenderer.clazz, gHardwareRenderer.closeHintSession,
- mSession);
- hasExceptionAndClear(env);
- env->DeleteGlobalRef(mSession);
- mSession = nullptr;
- }
-
- void updateTargetWorkDuration(long targetDurationNanos) {
- if (!mSession) return;
- JNIEnv* env = getenv(mVm);
- env->CallStaticVoidMethod(gHardwareRenderer.clazz,
- gHardwareRenderer.updateTargetWorkDuration, mSession,
- static_cast<jlong>(targetDurationNanos));
- hasExceptionAndClear(env);
- }
-
- void reportActualWorkDuration(long actualDurationNanos) {
- if (!mSession) return;
- JNIEnv* env = getenv(mVm);
- env->CallStaticVoidMethod(gHardwareRenderer.clazz,
- gHardwareRenderer.reportActualWorkDuration, mSession,
- static_cast<jlong>(actualDurationNanos));
- hasExceptionAndClear(env);
- }
-
-private:
- HintSessionWrapper(JNIEnv* env, jobject jobject) {
- env->GetJavaVM(&mVm);
- if (jobject) {
- mSession = env->NewGlobalRef(jobject);
- LOG_ALWAYS_FATAL_IF(!mSession, "Failed to make global ref");
- }
- }
-
- JavaVM* mVm = nullptr;
- jobject mSession = nullptr;
-};
-
static void android_view_ThreadedRenderer_rotateProcessStatsBuffer(JNIEnv* env, jobject clazz) {
RenderProxy::rotateProcessStatsBuffer();
}
@@ -235,12 +160,6 @@
RootRenderNode* rootRenderNode = reinterpret_cast<RootRenderNode*>(rootRenderNodePtr);
ContextFactoryImpl factory(rootRenderNode);
RenderProxy* proxy = new RenderProxy(translucent, rootRenderNode, &factory);
- sp<HintSessionWrapper> wrapper = HintSessionWrapper::create(env, proxy);
- if (wrapper) {
- proxy->setHintSessionCallbacks(
- [wrapper](int64_t nanos) { wrapper->updateTargetWorkDuration(nanos); },
- [wrapper](int64_t nanos) { wrapper->reportActualWorkDuration(nanos); });
- }
return (jlong) proxy;
}
@@ -1069,18 +988,6 @@
gHardwareRenderer.invokePictureCapturedCallback = GetStaticMethodIDOrDie(env, hardwareRenderer,
"invokePictureCapturedCallback",
"(JLandroid/graphics/HardwareRenderer$PictureCapturedCallback;)V");
- gHardwareRenderer.createHintSession =
- GetStaticMethodIDOrDie(env, hardwareRenderer, "createHintSession",
- "([I)Landroid/os/PerformanceHintManager$Session;");
- gHardwareRenderer.updateTargetWorkDuration =
- GetStaticMethodIDOrDie(env, hardwareRenderer, "updateTargetWorkDuration",
- "(Landroid/os/PerformanceHintManager$Session;J)V");
- gHardwareRenderer.reportActualWorkDuration =
- GetStaticMethodIDOrDie(env, hardwareRenderer, "reportActualWorkDuration",
- "(Landroid/os/PerformanceHintManager$Session;J)V");
- gHardwareRenderer.closeHintSession =
- GetStaticMethodIDOrDie(env, hardwareRenderer, "closeHintSession",
- "(Landroid/os/PerformanceHintManager$Session;)V");
jclass aSurfaceTransactionCallbackClass =
FindClassOrDie(env, "android/graphics/HardwareRenderer$ASurfaceTransactionCallback");
diff --git a/libs/hwui/jni/text/TextShaper.cpp b/libs/hwui/jni/text/TextShaper.cpp
index a6fb958..8e4dd53 100644
--- a/libs/hwui/jni/text/TextShaper.cpp
+++ b/libs/hwui/jni/text/TextShaper.cpp
@@ -160,7 +160,6 @@
}
static const JNINativeMethod gMethods[] = {
- // Fast Natives
{"nativeShapeTextRun", "("
"[C" // text
"I" // start
diff --git a/libs/hwui/renderthread/DrawFrameTask.cpp b/libs/hwui/renderthread/DrawFrameTask.cpp
index db29e34..e7081df 100644
--- a/libs/hwui/renderthread/DrawFrameTask.cpp
+++ b/libs/hwui/renderthread/DrawFrameTask.cpp
@@ -16,6 +16,7 @@
#include "DrawFrameTask.h"
+#include <dlfcn.h>
#include <gui/TraceUtils.h>
#include <utils/Log.h>
#include <algorithm>
@@ -26,11 +27,63 @@
#include "../RenderNode.h"
#include "CanvasContext.h"
#include "RenderThread.h"
+#include "thread/CommonPool.h"
namespace android {
namespace uirenderer {
namespace renderthread {
+namespace {
+
+typedef APerformanceHintManager* (*APH_getManager)();
+typedef APerformanceHintSession* (*APH_createSession)(APerformanceHintManager*, const int32_t*,
+ size_t, int64_t);
+typedef void (*APH_updateTargetWorkDuration)(APerformanceHintSession*, int64_t);
+typedef void (*APH_reportActualWorkDuration)(APerformanceHintSession*, int64_t);
+typedef void (*APH_closeSession)(APerformanceHintSession* session);
+
+bool gAPerformanceHintBindingInitialized = false;
+APH_getManager gAPH_getManagerFn = nullptr;
+APH_createSession gAPH_createSessionFn = nullptr;
+APH_updateTargetWorkDuration gAPH_updateTargetWorkDurationFn = nullptr;
+APH_reportActualWorkDuration gAPH_reportActualWorkDurationFn = nullptr;
+APH_closeSession gAPH_closeSessionFn = nullptr;
+
+void ensureAPerformanceHintBindingInitialized() {
+ if (gAPerformanceHintBindingInitialized) return;
+
+ void* handle_ = dlopen("libandroid.so", RTLD_NOW | RTLD_NODELETE);
+ LOG_ALWAYS_FATAL_IF(handle_ == nullptr, "Failed to dlopen libandroid.so!");
+
+ gAPH_getManagerFn = (APH_getManager)dlsym(handle_, "APerformanceHint_getManager");
+ LOG_ALWAYS_FATAL_IF(gAPH_getManagerFn == nullptr,
+ "Failed to find required symbol APerformanceHint_getManager!");
+
+ gAPH_createSessionFn = (APH_createSession)dlsym(handle_, "APerformanceHint_createSession");
+ LOG_ALWAYS_FATAL_IF(gAPH_createSessionFn == nullptr,
+ "Failed to find required symbol APerformanceHint_createSession!");
+
+ gAPH_updateTargetWorkDurationFn = (APH_updateTargetWorkDuration)dlsym(
+ handle_, "APerformanceHint_updateTargetWorkDuration");
+ LOG_ALWAYS_FATAL_IF(
+ gAPH_updateTargetWorkDurationFn == nullptr,
+ "Failed to find required symbol APerformanceHint_updateTargetWorkDuration!");
+
+ gAPH_reportActualWorkDurationFn = (APH_reportActualWorkDuration)dlsym(
+ handle_, "APerformanceHint_reportActualWorkDuration");
+ LOG_ALWAYS_FATAL_IF(
+ gAPH_reportActualWorkDurationFn == nullptr,
+ "Failed to find required symbol APerformanceHint_reportActualWorkDuration!");
+
+ gAPH_closeSessionFn = (APH_closeSession)dlsym(handle_, "APerformanceHint_closeSession");
+ LOG_ALWAYS_FATAL_IF(gAPH_closeSessionFn == nullptr,
+ "Failed to find required symbol APerformanceHint_closeSession!");
+
+ gAPerformanceHintBindingInitialized = true;
+}
+
+} // namespace
+
DrawFrameTask::DrawFrameTask()
: mRenderThread(nullptr)
, mContext(nullptr)
@@ -39,17 +92,13 @@
DrawFrameTask::~DrawFrameTask() {}
-void DrawFrameTask::setContext(RenderThread* thread, CanvasContext* context,
- RenderNode* targetNode) {
+void DrawFrameTask::setContext(RenderThread* thread, CanvasContext* context, RenderNode* targetNode,
+ int32_t uiThreadId, int32_t renderThreadId) {
mRenderThread = thread;
mContext = context;
mTargetNode = targetNode;
-}
-
-void DrawFrameTask::setHintSessionCallbacks(std::function<void(int64_t)> updateTargetWorkDuration,
- std::function<void(int64_t)> reportActualWorkDuration) {
- mUpdateTargetWorkDuration = std::move(updateTargetWorkDuration);
- mReportActualWorkDuration = std::move(reportActualWorkDuration);
+ mUiThreadId = uiThreadId;
+ mRenderThreadId = renderThreadId;
}
void DrawFrameTask::pushLayerUpdate(DeferredLayerUpdater* layer) {
@@ -144,27 +193,25 @@
unblockUiThread();
}
- // These member callbacks are effectively const as they are set once during init, so it's safe
- // to use these directly instead of making local copies.
- if (mUpdateTargetWorkDuration && mReportActualWorkDuration) {
- constexpr int64_t kSanityCheckLowerBound = 100000; // 0.1ms
- constexpr int64_t kSanityCheckUpperBound = 10000000000; // 10s
- int64_t targetWorkDuration = frameDeadline - intendedVsync;
- targetWorkDuration = targetWorkDuration * Properties::targetCpuTimePercentage / 100;
- if (targetWorkDuration > kSanityCheckLowerBound &&
- targetWorkDuration < kSanityCheckUpperBound &&
- targetWorkDuration != mLastTargetWorkDuration) {
- mLastTargetWorkDuration = targetWorkDuration;
- mUpdateTargetWorkDuration(targetWorkDuration);
- }
- int64_t frameDuration = systemTime(SYSTEM_TIME_MONOTONIC) - frameStartTime;
- int64_t actualDuration = frameDuration -
- (std::min(syncDelayDuration, mLastDequeueBufferDuration)) -
- dequeueBufferDuration;
- if (actualDuration > kSanityCheckLowerBound && actualDuration < kSanityCheckUpperBound) {
- mReportActualWorkDuration(actualDuration);
- }
+ if (!mHintSessionWrapper) mHintSessionWrapper.emplace(mUiThreadId, mRenderThreadId);
+ constexpr int64_t kSanityCheckLowerBound = 100000; // 0.1ms
+ constexpr int64_t kSanityCheckUpperBound = 10000000000; // 10s
+ int64_t targetWorkDuration = frameDeadline - intendedVsync;
+ targetWorkDuration = targetWorkDuration * Properties::targetCpuTimePercentage / 100;
+ if (targetWorkDuration > kSanityCheckLowerBound &&
+ targetWorkDuration < kSanityCheckUpperBound &&
+ targetWorkDuration != mLastTargetWorkDuration) {
+ mLastTargetWorkDuration = targetWorkDuration;
+ mHintSessionWrapper->updateTargetWorkDuration(targetWorkDuration);
}
+ int64_t frameDuration = systemTime(SYSTEM_TIME_MONOTONIC) - frameStartTime;
+ int64_t actualDuration = frameDuration -
+ (std::min(syncDelayDuration, mLastDequeueBufferDuration)) -
+ dequeueBufferDuration;
+ if (actualDuration > kSanityCheckLowerBound && actualDuration < kSanityCheckUpperBound) {
+ mHintSessionWrapper->reportActualWorkDuration(actualDuration);
+ }
+
mLastDequeueBufferDuration = dequeueBufferDuration;
}
@@ -216,6 +263,44 @@
mSignal.signal();
}
+DrawFrameTask::HintSessionWrapper::HintSessionWrapper(int32_t uiThreadId, int32_t renderThreadId) {
+ if (!Properties::useHintManager) return;
+ if (uiThreadId < 0 || renderThreadId < 0) return;
+
+ ensureAPerformanceHintBindingInitialized();
+
+ APerformanceHintManager* manager = gAPH_getManagerFn();
+ if (!manager) return;
+
+ std::vector<int32_t> tids = CommonPool::getThreadIds();
+ tids.push_back(uiThreadId);
+ tids.push_back(renderThreadId);
+
+ // DrawFrameTask code will always set a target duration before reporting actual durations.
+ // So this is just a placeholder value that's never used.
+ int64_t dummyTargetDurationNanos = 16666667;
+ mHintSession =
+ gAPH_createSessionFn(manager, tids.data(), tids.size(), dummyTargetDurationNanos);
+}
+
+DrawFrameTask::HintSessionWrapper::~HintSessionWrapper() {
+ if (mHintSession) {
+ gAPH_closeSessionFn(mHintSession);
+ }
+}
+
+void DrawFrameTask::HintSessionWrapper::updateTargetWorkDuration(long targetDurationNanos) {
+ if (mHintSession) {
+ gAPH_updateTargetWorkDurationFn(mHintSession, targetDurationNanos);
+ }
+}
+
+void DrawFrameTask::HintSessionWrapper::reportActualWorkDuration(long actualDurationNanos) {
+ if (mHintSession) {
+ gAPH_reportActualWorkDurationFn(mHintSession, actualDurationNanos);
+ }
+}
+
} /* namespace renderthread */
} /* namespace uirenderer */
} /* namespace android */
diff --git a/libs/hwui/renderthread/DrawFrameTask.h b/libs/hwui/renderthread/DrawFrameTask.h
index 2455ea8..6a61a2b 100644
--- a/libs/hwui/renderthread/DrawFrameTask.h
+++ b/libs/hwui/renderthread/DrawFrameTask.h
@@ -16,8 +16,10 @@
#ifndef DRAWFRAMETASK_H
#define DRAWFRAMETASK_H
+#include <optional>
#include <vector>
+#include <performance_hint_private.h>
#include <utils/Condition.h>
#include <utils/Mutex.h>
#include <utils/StrongPointer.h>
@@ -60,9 +62,8 @@
DrawFrameTask();
virtual ~DrawFrameTask();
- void setContext(RenderThread* thread, CanvasContext* context, RenderNode* targetNode);
- void setHintSessionCallbacks(std::function<void(int64_t)> updateTargetWorkDuration,
- std::function<void(int64_t)> reportActualWorkDuration);
+ void setContext(RenderThread* thread, CanvasContext* context, RenderNode* targetNode,
+ int32_t uiThreadId, int32_t renderThreadId);
void setContentDrawBounds(int left, int top, int right, int bottom) {
mContentDrawBounds.set(left, top, right, bottom);
}
@@ -85,6 +86,18 @@
}
private:
+ class HintSessionWrapper {
+ public:
+ HintSessionWrapper(int32_t uiThreadId, int32_t renderThreadId);
+ ~HintSessionWrapper();
+
+ void updateTargetWorkDuration(long targetDurationNanos);
+ void reportActualWorkDuration(long actualDurationNanos);
+
+ private:
+ APerformanceHintSession* mHintSession = nullptr;
+ };
+
void postAndWait();
bool syncFrameState(TreeInfo& info);
void unblockUiThread();
@@ -95,6 +108,8 @@
RenderThread* mRenderThread;
CanvasContext* mContext;
RenderNode* mTargetNode = nullptr;
+ int32_t mUiThreadId = -1;
+ int32_t mRenderThreadId = -1;
Rect mContentDrawBounds;
/*********************************************
@@ -112,8 +127,7 @@
nsecs_t mLastDequeueBufferDuration = 0;
nsecs_t mLastTargetWorkDuration = 0;
- std::function<void(int64_t)> mUpdateTargetWorkDuration;
- std::function<void(int64_t)> mReportActualWorkDuration;
+ std::optional<HintSessionWrapper> mHintSessionWrapper;
};
} /* namespace renderthread */
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index a77b5b5..c485ce2 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -29,6 +29,8 @@
#include "utils/Macros.h"
#include "utils/TimeUtils.h"
+#include <pthread.h>
+
namespace android {
namespace uirenderer {
namespace renderthread {
@@ -39,7 +41,8 @@
mContext = mRenderThread.queue().runSync([&]() -> CanvasContext* {
return CanvasContext::create(mRenderThread, translucent, rootRenderNode, contextFactory);
});
- mDrawFrameTask.setContext(&mRenderThread, mContext, rootRenderNode);
+ mDrawFrameTask.setContext(&mRenderThread, mContext, rootRenderNode,
+ pthread_gettid_np(pthread_self()), getRenderThreadTid());
}
RenderProxy::~RenderProxy() {
@@ -48,7 +51,7 @@
void RenderProxy::destroyContext() {
if (mContext) {
- mDrawFrameTask.setContext(nullptr, nullptr, nullptr);
+ mDrawFrameTask.setContext(nullptr, nullptr, nullptr, -1, -1);
// This is also a fence as we need to be certain that there are no
// outstanding mDrawFrame tasks posted before it is destroyed
mRenderThread.queue().runSync([this]() { delete mContext; });
@@ -76,12 +79,6 @@
mRenderThread.queue().runSync([this, name]() { mContext->setName(std::string(name)); });
}
-void RenderProxy::setHintSessionCallbacks(std::function<void(int64_t)> updateTargetWorkDuration,
- std::function<void(int64_t)> reportActualWorkDuration) {
- mDrawFrameTask.setHintSessionCallbacks(std::move(updateTargetWorkDuration),
- std::move(reportActualWorkDuration));
-}
-
void RenderProxy::setSurface(ANativeWindow* window, bool enableTimeout) {
if (window) { ANativeWindow_acquire(window); }
mRenderThread.queue().post([this, win = window, enableTimeout]() mutable {
diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h
index 1b0f22e..2b5405c 100644
--- a/libs/hwui/renderthread/RenderProxy.h
+++ b/libs/hwui/renderthread/RenderProxy.h
@@ -71,8 +71,6 @@
void setSwapBehavior(SwapBehavior swapBehavior);
bool loadSystemProperties();
void setName(const char* name);
- void setHintSessionCallbacks(std::function<void(int64_t)> updateTargetWorkDuration,
- std::function<void(int64_t)> reportActualWorkDuration);
void setSurface(ANativeWindow* window, bool enableTimeout = true);
void setSurfaceControl(ASurfaceControl* surfaceControl);
diff --git a/media/java/android/media/metrics/PlaybackErrorEvent.java b/media/java/android/media/metrics/PlaybackErrorEvent.java
index 184b359..4e3b426 100644
--- a/media/java/android/media/metrics/PlaybackErrorEvent.java
+++ b/media/java/android/media/metrics/PlaybackErrorEvent.java
@@ -317,7 +317,7 @@
*/
public static final class Builder {
private @Nullable Exception mException;
- private int mErrorCode;
+ private int mErrorCode = ERROR_UNKNOWN;
private int mSubErrorCode;
private long mTimeSinceCreatedMillis = -1;
private Bundle mMetricsBundle = new Bundle();
diff --git a/media/java/android/media/metrics/PlaybackMetrics.java b/media/java/android/media/metrics/PlaybackMetrics.java
index bbcc484..e71ee20 100644
--- a/media/java/android/media/metrics/PlaybackMetrics.java
+++ b/media/java/android/media/metrics/PlaybackMetrics.java
@@ -502,9 +502,9 @@
private long mMediaDurationMillis = -1;
private int mStreamSource = STREAM_SOURCE_UNKNOWN;
private int mStreamType = STREAM_TYPE_UNKNOWN;
- private int mPlaybackType = PLAYBACK_TYPE_OTHER;
+ private int mPlaybackType = PLAYBACK_TYPE_UNKNOWN;
private int mDrmType = DRM_TYPE_NONE;
- private int mContentType = CONTENT_TYPE_OTHER;
+ private int mContentType = CONTENT_TYPE_UNKNOWN;
private @Nullable String mPlayerName;
private @Nullable String mPlayerVersion;
private @NonNull List<Long> mExperimentIds = new ArrayList<>();
diff --git a/media/jni/android_mtp_MtpDevice.cpp b/media/jni/android_mtp_MtpDevice.cpp
index ac89fecd..8436ba4 100644
--- a/media/jni/android_mtp_MtpDevice.cpp
+++ b/media/jni/android_mtp_MtpDevice.cpp
@@ -416,20 +416,14 @@
return -1;
}
- MtpProperty* property = new MtpProperty(MTP_DEVICE_PROPERTY_SESSION_INITIATOR_VERSION_INFO,
- MTP_TYPE_STR, true);
- if (!property) {
- env->ThrowNew(clazz_io_exception, "Failed to obtain property.");
- return -1;
- }
-
- if (property->getDataType() != MTP_TYPE_STR) {
+ MtpProperty property(MTP_DEVICE_PROPERTY_SESSION_INITIATOR_VERSION_INFO, MTP_TYPE_STR, true);
+ if (property.getDataType() != MTP_TYPE_STR) {
env->ThrowNew(clazz_io_exception, "Unexpected property data type.");
return -1;
}
- property->setCurrentValue(propertyStr);
- if (!device->setDevicePropValueStr(property)) {
+ property.setCurrentValue(propertyStr);
+ if (!device->setDevicePropValueStr(&property)) {
env->ThrowNew(clazz_io_exception, "Failed to obtain property value.");
return -1;
}
diff --git a/native/android/Android.bp b/native/android/Android.bp
index 3ee2c18..32b7a07 100644
--- a/native/android/Android.bp
+++ b/native/android/Android.bp
@@ -57,6 +57,7 @@
"net.c",
"obb.cpp",
"permission_manager.cpp",
+ "performance_hint.cpp",
"sensor.cpp",
"sharedmem.cpp",
"storage_manager.cpp",
diff --git a/native/android/libandroid.map.txt b/native/android/libandroid.map.txt
index de6db1a..f33e118 100644
--- a/native/android/libandroid.map.txt
+++ b/native/android/libandroid.map.txt
@@ -312,6 +312,13 @@
LIBANDROID_PLATFORM {
global:
+ APerformanceHint_getManager;
+ APerformanceHint_createSession;
+ APerformanceHint_getPreferredUpdateRateNanos;
+ APerformanceHint_updateTargetWorkDuration;
+ APerformanceHint_reportActualWorkDuration;
+ APerformanceHint_closeSession;
+ APerformanceHint_setIHintManagerForTesting;
extern "C++" {
ASurfaceControl_registerSurfaceStatsListener*;
ASurfaceControl_unregisterSurfaceStatsListener*;
diff --git a/native/android/performance_hint.cpp b/native/android/performance_hint.cpp
new file mode 100644
index 0000000..95a2da9
--- /dev/null
+++ b/native/android/performance_hint.cpp
@@ -0,0 +1,241 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "perf_hint"
+
+#include <utility>
+#include <vector>
+
+#include <android/os/IHintManager.h>
+#include <android/os/IHintSession.h>
+#include <binder/Binder.h>
+#include <binder/IBinder.h>
+#include <binder/IServiceManager.h>
+#include <performance_hint_private.h>
+#include <utils/SystemClock.h>
+
+using namespace android;
+using namespace android::os;
+
+struct APerformanceHintSession;
+
+struct APerformanceHintManager {
+public:
+ static APerformanceHintManager* getInstance();
+ APerformanceHintManager(sp<IHintManager> service, int64_t preferredRateNanos);
+ APerformanceHintManager() = delete;
+ ~APerformanceHintManager() = default;
+
+ APerformanceHintSession* createSession(const int32_t* threadIds, size_t size,
+ int64_t initialTargetWorkDurationNanos);
+ int64_t getPreferredRateNanos() const;
+
+private:
+ static APerformanceHintManager* create(sp<IHintManager> iHintManager);
+
+ sp<IHintManager> mHintManager;
+ const int64_t mPreferredRateNanos;
+};
+
+struct APerformanceHintSession {
+public:
+ APerformanceHintSession(sp<IHintSession> session, int64_t preferredRateNanos,
+ int64_t targetDurationNanos);
+ APerformanceHintSession() = delete;
+ ~APerformanceHintSession();
+
+ int updateTargetWorkDuration(int64_t targetDurationNanos);
+ int reportActualWorkDuration(int64_t actualDurationNanos);
+
+private:
+ friend struct APerformanceHintManager;
+
+ sp<IHintSession> mHintSession;
+ // HAL preferred update rate
+ const int64_t mPreferredRateNanos;
+ // Target duration for choosing update rate
+ int64_t mTargetDurationNanos;
+ // Last update timestamp
+ int64_t mLastUpdateTimestamp;
+ // Cached samples
+ std::vector<int64_t> mActualDurationsNanos;
+ std::vector<int64_t> mTimestampsNanos;
+};
+
+static IHintManager* gIHintManagerForTesting = nullptr;
+static APerformanceHintManager* gHintManagerForTesting = nullptr;
+
+// ===================================== APerformanceHintManager implementation
+APerformanceHintManager::APerformanceHintManager(sp<IHintManager> manager,
+ int64_t preferredRateNanos)
+ : mHintManager(std::move(manager)), mPreferredRateNanos(preferredRateNanos) {}
+
+APerformanceHintManager* APerformanceHintManager::getInstance() {
+ if (gHintManagerForTesting) return gHintManagerForTesting;
+ if (gIHintManagerForTesting) {
+ APerformanceHintManager* manager = create(gIHintManagerForTesting);
+ gIHintManagerForTesting = nullptr;
+ return manager;
+ }
+ static APerformanceHintManager* instance = create(nullptr);
+ return instance;
+}
+
+APerformanceHintManager* APerformanceHintManager::create(sp<IHintManager> manager) {
+ if (!manager) {
+ manager = interface_cast<IHintManager>(
+ defaultServiceManager()->checkService(String16("performance_hint")));
+ }
+ if (manager == nullptr) {
+ ALOGE("%s: PerformanceHint service is not ready ", __FUNCTION__);
+ return nullptr;
+ }
+ int64_t preferredRateNanos = -1L;
+ binder::Status ret = manager->getHintSessionPreferredRate(&preferredRateNanos);
+ if (!ret.isOk()) {
+ ALOGE("%s: PerformanceHint cannot get preferred rate. %s", __FUNCTION__,
+ ret.exceptionMessage().c_str());
+ return nullptr;
+ }
+ if (preferredRateNanos <= 0) {
+ ALOGE("%s: PerformanceHint invalid preferred rate.", __FUNCTION__);
+ return nullptr;
+ }
+ return new APerformanceHintManager(std::move(manager), preferredRateNanos);
+}
+
+APerformanceHintSession* APerformanceHintManager::createSession(
+ const int32_t* threadIds, size_t size, int64_t initialTargetWorkDurationNanos) {
+ sp<IBinder> token = sp<BBinder>::make();
+ std::vector<int32_t> tids(threadIds, threadIds + size);
+ sp<IHintSession> session;
+ binder::Status ret =
+ mHintManager->createHintSession(token, tids, initialTargetWorkDurationNanos, &session);
+ if (!ret.isOk() || !session) {
+ return nullptr;
+ }
+ return new APerformanceHintSession(std::move(session), mPreferredRateNanos,
+ initialTargetWorkDurationNanos);
+}
+
+int64_t APerformanceHintManager::getPreferredRateNanos() const {
+ return mPreferredRateNanos;
+}
+
+// ===================================== APerformanceHintSession implementation
+
+APerformanceHintSession::APerformanceHintSession(sp<IHintSession> session,
+ int64_t preferredRateNanos,
+ int64_t targetDurationNanos)
+ : mHintSession(std::move(session)),
+ mPreferredRateNanos(preferredRateNanos),
+ mTargetDurationNanos(targetDurationNanos),
+ mLastUpdateTimestamp(elapsedRealtimeNano()) {}
+
+APerformanceHintSession::~APerformanceHintSession() {
+ binder::Status ret = mHintSession->close();
+ if (!ret.isOk()) {
+ ALOGE("%s: HintSession close failed: %s", __FUNCTION__, ret.exceptionMessage().c_str());
+ }
+}
+
+int APerformanceHintSession::updateTargetWorkDuration(int64_t targetDurationNanos) {
+ if (targetDurationNanos <= 0) {
+ ALOGE("%s: targetDurationNanos must be positive", __FUNCTION__);
+ return EINVAL;
+ }
+ binder::Status ret = mHintSession->updateTargetWorkDuration(targetDurationNanos);
+ if (!ret.isOk()) {
+ ALOGE("%s: HintSessionn updateTargetWorkDuration failed: %s", __FUNCTION__,
+ ret.exceptionMessage().c_str());
+ return EPIPE;
+ }
+ mTargetDurationNanos = targetDurationNanos;
+ /**
+ * Most of the workload is target_duration dependent, so now clear the cached samples
+ * as they are most likely obsolete.
+ */
+ mActualDurationsNanos.clear();
+ mTimestampsNanos.clear();
+ mLastUpdateTimestamp = elapsedRealtimeNano();
+ return 0;
+}
+
+int APerformanceHintSession::reportActualWorkDuration(int64_t actualDurationNanos) {
+ if (actualDurationNanos <= 0) {
+ ALOGE("%s: actualDurationNanos must be positive", __FUNCTION__);
+ return EINVAL;
+ }
+ int64_t now = elapsedRealtimeNano();
+ mActualDurationsNanos.push_back(actualDurationNanos);
+ 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.
+ */
+ int64_t rateLimit = actualDurationNanos > mTargetDurationNanos ? mPreferredRateNanos
+ : 10 * mPreferredRateNanos;
+ if (now - mLastUpdateTimestamp <= rateLimit) return 0;
+
+ binder::Status ret =
+ mHintSession->reportActualWorkDuration(mActualDurationsNanos, mTimestampsNanos);
+ mActualDurationsNanos.clear();
+ mTimestampsNanos.clear();
+ if (!ret.isOk()) {
+ ALOGE("%s: HintSession reportActualWorkDuration failed: %s", __FUNCTION__,
+ ret.exceptionMessage().c_str());
+ return EPIPE;
+ }
+ mLastUpdateTimestamp = now;
+ return 0;
+}
+
+// ===================================== C API
+APerformanceHintManager* APerformanceHint_getManager() {
+ return APerformanceHintManager::getInstance();
+}
+
+APerformanceHintSession* APerformanceHint_createSession(APerformanceHintManager* manager,
+ const int32_t* threadIds, size_t size,
+ int64_t initialTargetWorkDurationNanos) {
+ return manager->createSession(threadIds, size, initialTargetWorkDurationNanos);
+}
+
+int64_t APerformanceHint_getPreferredUpdateRateNanos(APerformanceHintManager* manager) {
+ return manager->getPreferredRateNanos();
+}
+
+int APerformanceHint_updateTargetWorkDuration(APerformanceHintSession* session,
+ int64_t targetDurationNanos) {
+ return session->updateTargetWorkDuration(targetDurationNanos);
+}
+
+int APerformanceHint_reportActualWorkDuration(APerformanceHintSession* session,
+ int64_t actualDurationNanos) {
+ return session->reportActualWorkDuration(actualDurationNanos);
+}
+
+void APerformanceHint_closeSession(APerformanceHintSession* session) {
+ delete session;
+}
+
+void APerformanceHint_setIHintManagerForTesting(void* iManager) {
+ delete gHintManagerForTesting;
+ gHintManagerForTesting = nullptr;
+ gIHintManagerForTesting = static_cast<IHintManager*>(iManager);
+}
diff --git a/native/android/tests/performance_hint/Android.bp b/native/android/tests/performance_hint/Android.bp
new file mode 100644
index 0000000..fdc1bc6
--- /dev/null
+++ b/native/android/tests/performance_hint/Android.bp
@@ -0,0 +1,65 @@
+// Copyright (C) 2021 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "frameworks_base_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["frameworks_base_license"],
+}
+
+cc_test {
+ name: "PerformanceHintNativeTestCases",
+
+ multilib: {
+ lib32: {
+ suffix: "32",
+ },
+ lib64: {
+ suffix: "64",
+ },
+ },
+
+ srcs: ["PerformanceHintNativeTest.cpp"],
+
+ shared_libs: [
+ "libandroid",
+ "liblog",
+ "libbinder",
+ "libpowermanager",
+ "libutils",
+ ],
+
+ static_libs: [
+ "libbase",
+ "libgmock",
+ "libgtest",
+ ],
+ stl: "c++_shared",
+
+ test_suites: [
+ "device-tests",
+ ],
+
+ cflags: [
+ "-Werror",
+ "-Wall",
+ ],
+
+ header_libs: [
+ "libandroid_headers_private",
+ ],
+}
diff --git a/native/android/tests/performance_hint/PerformanceHintNativeTest.cpp b/native/android/tests/performance_hint/PerformanceHintNativeTest.cpp
new file mode 100644
index 0000000..284e9ee
--- /dev/null
+++ b/native/android/tests/performance_hint/PerformanceHintNativeTest.cpp
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "PerformanceHintNativeTest"
+
+#include <android/os/IHintManager.h>
+#include <android/os/IHintSession.h>
+#include <binder/IBinder.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <performance_hint_private.h>
+#include <memory>
+#include <vector>
+
+using android::binder::Status;
+using android::os::IHintManager;
+using android::os::IHintSession;
+
+using namespace android;
+using namespace testing;
+
+class MockIHintManager : public IHintManager {
+public:
+ MOCK_METHOD(Status, createHintSession,
+ (const ::android::sp<::android::IBinder>& token, const ::std::vector<int32_t>& tids,
+ int64_t durationNanos, ::android::sp<::android::os::IHintSession>* _aidl_return),
+ (override));
+ MOCK_METHOD(Status, getHintSessionPreferredRate, (int64_t * _aidl_return), (override));
+ MOCK_METHOD(IBinder*, onAsBinder, (), (override));
+};
+
+class MockIHintSession : public IHintSession {
+public:
+ MOCK_METHOD(Status, updateTargetWorkDuration, (int64_t targetDurationNanos), (override));
+ MOCK_METHOD(Status, reportActualWorkDuration,
+ (const ::std::vector<int64_t>& actualDurationNanos,
+ const ::std::vector<int64_t>& timeStampNanos),
+ (override));
+ MOCK_METHOD(Status, close, (), (override));
+ MOCK_METHOD(IBinder*, onAsBinder, (), (override));
+};
+
+class PerformanceHintTest : public Test {
+public:
+ void SetUp() override {
+ mMockIHintManager = new StrictMock<MockIHintManager>();
+ APerformanceHint_setIHintManagerForTesting(mMockIHintManager);
+ }
+
+ void TearDown() override {
+ mMockIHintManager = nullptr;
+ // Destroys MockIHintManager.
+ APerformanceHint_setIHintManagerForTesting(nullptr);
+ }
+
+ APerformanceHintManager* createManager() {
+ EXPECT_CALL(*mMockIHintManager, getHintSessionPreferredRate(_))
+ .Times(Exactly(1))
+ .WillRepeatedly(DoAll(SetArgPointee<0>(123L), Return(Status())));
+ return APerformanceHint_getManager();
+ }
+
+ StrictMock<MockIHintManager>* mMockIHintManager = nullptr;
+};
+
+TEST_F(PerformanceHintTest, TestGetPreferredUpdateRateNanos) {
+ APerformanceHintManager* manager = createManager();
+ int64_t preferredUpdateRateNanos = APerformanceHint_getPreferredUpdateRateNanos(manager);
+ EXPECT_EQ(123L, preferredUpdateRateNanos);
+}
+
+TEST_F(PerformanceHintTest, TestSession) {
+ APerformanceHintManager* manager = createManager();
+
+ std::vector<int32_t> tids;
+ tids.push_back(1);
+ tids.push_back(2);
+ int64_t targetDuration = 56789L;
+
+ StrictMock<MockIHintSession>* iSession = new StrictMock<MockIHintSession>();
+ sp<IHintSession> session_sp(iSession);
+
+ EXPECT_CALL(*mMockIHintManager, createHintSession(_, Eq(tids), Eq(targetDuration), _))
+ .Times(Exactly(1))
+ .WillRepeatedly(DoAll(SetArgPointee<3>(std::move(session_sp)), Return(Status())));
+
+ APerformanceHintSession* session =
+ APerformanceHint_createSession(manager, tids.data(), tids.size(), targetDuration);
+ ASSERT_TRUE(session);
+
+ int64_t targetDurationNanos = 10;
+ EXPECT_CALL(*iSession, updateTargetWorkDuration(Eq(targetDurationNanos))).Times(Exactly(1));
+ int result = APerformanceHint_updateTargetWorkDuration(session, targetDurationNanos);
+ EXPECT_EQ(0, result);
+
+ usleep(2); // Sleep for longer than preferredUpdateRateNanos.
+ int64_t actualDurationNanos = 20;
+ std::vector<int64_t> actualDurations;
+ actualDurations.push_back(20);
+ EXPECT_CALL(*iSession, reportActualWorkDuration(Eq(actualDurations), _)).Times(Exactly(1));
+ result = APerformanceHint_reportActualWorkDuration(session, actualDurationNanos);
+ EXPECT_EQ(0, result);
+
+ result = APerformanceHint_updateTargetWorkDuration(session, -1L);
+ EXPECT_EQ(EINVAL, result);
+ result = APerformanceHint_reportActualWorkDuration(session, -1L);
+ EXPECT_EQ(EINVAL, result);
+
+ EXPECT_CALL(*iSession, close()).Times(Exactly(1));
+ APerformanceHint_closeSession(session);
+}
diff --git a/packages/SettingsLib/IllustrationPreference/src/com/android/settingslib/widget/IllustrationPreference.java b/packages/SettingsLib/IllustrationPreference/src/com/android/settingslib/widget/IllustrationPreference.java
index f04b0e3..266fc78 100644
--- a/packages/SettingsLib/IllustrationPreference/src/com/android/settingslib/widget/IllustrationPreference.java
+++ b/packages/SettingsLib/IllustrationPreference/src/com/android/settingslib/widget/IllustrationPreference.java
@@ -267,26 +267,22 @@
private static void startLottieAnimationWith(LottieAnimationView illustrationView,
Uri imageUri) {
- try {
- final InputStream inputStream =
- getInputStreamFromUri(illustrationView.getContext(), imageUri);
- illustrationView.setAnimation(inputStream, /* cacheKey= */ null);
- illustrationView.setRepeatCount(LottieDrawable.INFINITE);
- illustrationView.playAnimation();
- } catch (IllegalStateException e) {
- Log.w(TAG, "Invalid illustration image uri: " + imageUri, e);
- }
+ final InputStream inputStream =
+ getInputStreamFromUri(illustrationView.getContext(), imageUri);
+ illustrationView.setFailureListener(
+ result -> Log.w(TAG, "Invalid illustration image uri: " + imageUri, result));
+ illustrationView.setAnimation(inputStream, /* cacheKey= */ null);
+ illustrationView.setRepeatCount(LottieDrawable.INFINITE);
+ illustrationView.playAnimation();
}
private static void startLottieAnimationWith(LottieAnimationView illustrationView,
@RawRes int rawRes) {
- try {
- illustrationView.setAnimation(rawRes);
- illustrationView.setRepeatCount(LottieDrawable.INFINITE);
- illustrationView.playAnimation();
- } catch (IllegalStateException e) {
- Log.w(TAG, "Invalid illustration resource id: " + rawRes, e);
- }
+ illustrationView.setFailureListener(
+ result -> Log.w(TAG, "Invalid illustration resource id: " + rawRes, result));
+ illustrationView.setAnimation(rawRes);
+ illustrationView.setRepeatCount(LottieDrawable.INFINITE);
+ illustrationView.playAnimation();
}
private static void resetAnimations(LottieAnimationView illustrationView) {
diff --git a/packages/SettingsLib/res/values-be/strings.xml b/packages/SettingsLib/res/values-be/strings.xml
index 710ca32..08ca17f 100644
--- a/packages/SettingsLib/res/values-be/strings.xml
+++ b/packages/SettingsLib/res/values-be/strings.xml
@@ -172,7 +172,7 @@
<string name="tts_engine_security_warning" msgid="3372432853837988146">"Гэты модуль сінтэзу гаворкі можа збіраць увесь тэкст, які будзе прамоўлены, у тым ліку асабістыя дадзеныя, напрыклад паролі і нумары крэдытных карт. Ён адносіцца да модуля <xliff:g id="TTS_PLUGIN_ENGINE_NAME">%s</xliff:g>. Уключыць гэты модуль сінтэзу гаворкі?"</string>
<string name="tts_engine_network_required" msgid="8722087649733906851">"Гэта мова патрабуе актыўнага падключэння да сеткі, каб выконваць функцыю прамаўлення тэксту."</string>
<string name="tts_default_sample_string" msgid="6388016028292967973">"Гэта прыклад сінтэзу гаворкі"</string>
- <string name="tts_status_title" msgid="8190784181389278640">"Статус мовы па змаўчанні"</string>
+ <string name="tts_status_title" msgid="8190784181389278640">"Статус стандартнай мовы"</string>
<string name="tts_status_ok" msgid="8583076006537547379">"<xliff:g id="LOCALE">%1$s</xliff:g> цалкам падтрымліваецца"</string>
<string name="tts_status_requires_network" msgid="8327617638884678896">"Для <xliff:g id="LOCALE">%1$s</xliff:g> патрабуецца падлучэнне да сеткі"</string>
<string name="tts_status_not_supported" msgid="2702997696245523743">"<xliff:g id="LOCALE">%1$s</xliff:g> не падтрымліваецца"</string>
@@ -388,7 +388,7 @@
<string name="local_backup_password_toast_validation_failure" msgid="714669442363647122">"Збой пры ўсталёўцы паролю для рэзервовага капіявання"</string>
<string name="loading_injected_setting_summary" msgid="8394446285689070348">"Ідзе загрузка…"</string>
<string-array name="color_mode_names">
- <item msgid="3836559907767149216">"Сочны (па змаўчанні)"</item>
+ <item msgid="3836559907767149216">"Насычаны (стандартна)"</item>
<item msgid="9112200311983078311">"Натуральныя"</item>
<item msgid="6564241960833766170">"Стандартны"</item>
</string-array>
diff --git a/packages/SettingsLib/res/values-gu/strings.xml b/packages/SettingsLib/res/values-gu/strings.xml
index 8052e2a..ac078fd 100644
--- a/packages/SettingsLib/res/values-gu/strings.xml
+++ b/packages/SettingsLib/res/values-gu/strings.xml
@@ -85,7 +85,7 @@
<string name="bluetooth_profile_a2dp" msgid="4632426382762851724">"મીડિયા ઑડિયો"</string>
<string name="bluetooth_profile_headset" msgid="5395952236133499331">"ફોન કૉલ"</string>
<string name="bluetooth_profile_opp" msgid="6692618568149493430">"ફાઇલ સ્થાનાંતરણ"</string>
- <string name="bluetooth_profile_hid" msgid="2969922922664315866">"ઇનપુટ ઉપકરણ"</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_summary" msgid="2955819694801952056">"સંપર્ક શેરિંગ માટે ઉપયોગ કરો"</string>
@@ -102,7 +102,7 @@
<string name="bluetooth_map_profile_summary_connected" msgid="4141725591784669181">"નકશા સાથે કનેક્ટ થયું"</string>
<string name="bluetooth_sap_profile_summary_connected" msgid="1280297388033001037">"SAP થી કનેક્ટ કરેલ"</string>
<string name="bluetooth_opp_profile_summary_not_connected" msgid="3959741824627764954">"ફાઇલ સ્થાનાંતરણ સેવાથી કનેક્ટ થયેલ નથી"</string>
- <string name="bluetooth_hid_profile_summary_connected" msgid="3923653977051684833">"ઇનપુટ ઉપકરણ સાથે કનેક્ટ થયાં"</string>
+ <string name="bluetooth_hid_profile_summary_connected" msgid="3923653977051684833">"ઇનપુટ ડિવાઇસ સાથે કનેક્ટ થયાં"</string>
<string name="bluetooth_pan_user_profile_summary_connected" msgid="380469653827505727">"ઇન્ટરનેટ ઍક્સેસ માટે ઉપકરણથી કનેક્ટેડ છીએ"</string>
<string name="bluetooth_pan_nap_profile_summary_connected" msgid="3744773111299503493">"ઉપકરણ સાથે સ્થાનિક ઇન્ટરનેટ કનેક્શન શેર કરી રહ્યાં છીએ"</string>
<string name="bluetooth_pan_profile_summary_use_for" msgid="7422039765025340313">"ઇન્ટરનેટ ઍક્સેસ માટે ઉપયોગ કરો"</string>
@@ -155,7 +155,7 @@
<string name="running_process_item_user_label" msgid="3988506293099805796">"વપરાશકર્તા: <xliff:g id="USER_NAME">%1$s</xliff:g>"</string>
<string name="launch_defaults_some" msgid="3631650616557252926">"કેટલાંક ડિફોલ્ટ્સ સેટ કરેલ છે"</string>
<string name="launch_defaults_none" msgid="8049374306261262709">"કોઈ ડિફૉલ્ટ સેટ કરેલા નથી"</string>
- <string name="tts_settings" msgid="8130616705989351312">"ટેક્સ્ટ-ટુ-સ્પીચ સેટિંગ્સ"</string>
+ <string name="tts_settings" msgid="8130616705989351312">"ટેક્સ્ટ ટૂ સ્પીચ સેટિંગ"</string>
<string name="tts_settings_title" msgid="7602210956640483039">"ટેક્સ્ટ ટુ સ્પીચ આઉટપુટ"</string>
<string name="tts_default_rate_title" msgid="3964187817364304022">"વાણી દર"</string>
<string name="tts_default_rate_summary" msgid="3781937042151716987">"ટેક્સ્ટ બોલાયેલ છે તે ઝડપ"</string>
@@ -177,8 +177,8 @@
<string name="tts_status_requires_network" msgid="8327617638884678896">"<xliff:g id="LOCALE">%1$s</xliff:g> નેટવર્ક કનેક્શનની આવશ્યકતા છે"</string>
<string name="tts_status_not_supported" msgid="2702997696245523743">"<xliff:g id="LOCALE">%1$s</xliff:g> સમર્થિત નથી"</string>
<string name="tts_status_checking" msgid="8026559918948285013">"તપાસી રહ્યું છે..."</string>
- <string name="tts_engine_settings_title" msgid="7849477533103566291">"<xliff:g id="TTS_ENGINE_NAME">%s</xliff:g> માટેની સેટિંગ્સ"</string>
- <string name="tts_engine_settings_button" msgid="477155276199968948">"એન્જિન સેટિંગ્સ લોંચ કરો"</string>
+ <string name="tts_engine_settings_title" msgid="7849477533103566291">"<xliff:g id="TTS_ENGINE_NAME">%s</xliff:g> માટેના સેટિંગ"</string>
+ <string name="tts_engine_settings_button" msgid="477155276199968948">"એન્જિન સેટિંગ લૉન્ચ કરો"</string>
<string name="tts_engine_preference_section_title" msgid="3861562305498624904">"મનપસંદ એન્જિન"</string>
<string name="tts_general_section_title" msgid="8919671529502364567">"સામાન્ય"</string>
<string name="tts_reset_speech_pitch_title" msgid="7149398585468413246">"સ્પીચની પિચ ફરીથી સેટ કરો"</string>
@@ -201,9 +201,9 @@
<string name="development_settings_enable" msgid="4285094651288242183">"વિકાસકર્તાનાં વિકલ્પો સક્ષમ કરો"</string>
<string name="development_settings_summary" msgid="8718917813868735095">"ઍપ્લિકેશન વિકાસ માટે વિકલ્પો સેટ કરો"</string>
<string name="development_settings_not_available" msgid="355070198089140951">"આ વપરાશકર્તા માટે વિકાસકર્તા વિકલ્પો ઉપલબ્ધ નથી"</string>
- <string name="vpn_settings_not_available" msgid="2894137119965668920">"આ વપરાશકર્તા માટે VPN સેટિંગ્સ ઉપલબ્ધ નથી"</string>
- <string name="tethering_settings_not_available" msgid="266821736434699780">"આ વપરાશકર્તા માટે ટિથરિંગ સેટિંગ્સ ઉપલબ્ધ નથી"</string>
- <string name="apn_settings_not_available" msgid="1147111671403342300">"અૅક્સેસ પોઇન્ટનું નામ સેટિંગ્સ આ વપરાશકર્તા માટે ઉપલબ્ધ નથી"</string>
+ <string name="vpn_settings_not_available" msgid="2894137119965668920">"આ વપરાશકર્તા માટે VPN સેટિંગ ઉપલબ્ધ નથી"</string>
+ <string name="tethering_settings_not_available" msgid="266821736434699780">"આ વપરાશકર્તા માટે ટિથરિંગ સેટિંગ ઉપલબ્ધ નથી"</string>
+ <string name="apn_settings_not_available" msgid="1147111671403342300">"અૅક્સેસ પૉઇન્ટનું નામ સેટિંગ આ વપરાશકર્તા માટે ઉપલબ્ધ નથી"</string>
<string name="enable_adb" msgid="8072776357237289039">"USB ડિબગીંગ"</string>
<string name="enable_adb_summary" msgid="3711526030096574316">"જ્યારે USB કનેક્ટ કરેલું હોય ત્યારે ડિબગ મોડ"</string>
<string name="clear_adb_keys" msgid="3010148733140369917">"USB ડીબગિંગ પ્રમાણીકરણોને રદબાતલ કરો"</string>
@@ -259,7 +259,7 @@
<string name="bluetooth_disable_absolute_volume" msgid="1452342324349203434">"ચોક્કસ વૉલ્યૂમને બંધ કરો"</string>
<string name="bluetooth_enable_gabeldorsche" msgid="9131730396242883416">"Gabeldorsche ચાલુ કરો"</string>
<string name="bluetooth_select_avrcp_version_string" msgid="1710571610177659127">"બ્લૂટૂથ AVRCP વર્ઝન"</string>
- <string name="bluetooth_select_avrcp_version_dialog_title" msgid="7846922290083709633">"બ્લૂટૂથ AVRCP સંસ્કરણ પસંદ કરો"</string>
+ <string name="bluetooth_select_avrcp_version_dialog_title" msgid="7846922290083709633">"બ્લૂટૂથ AVRCP વર્ઝન પસંદ કરો"</string>
<string name="bluetooth_select_map_version_string" msgid="526308145174175327">"બ્લૂટૂથ MAP વર્ઝન"</string>
<string name="bluetooth_select_map_version_dialog_title" msgid="7085934373987428460">"બ્લૂટૂથ MAP વર્ઝન પસંદ કરો"</string>
<string name="bluetooth_select_a2dp_codec_type" msgid="952001408455456494">"બ્લૂટૂથ ઑડિયો કોડેક"</string>
@@ -301,12 +301,12 @@
<string name="mobile_data_always_on_summary" msgid="1112156365594371019">"વાઇ-ફાઇ સક્રિય હોય ત્યારે પણ, હંમેશા મોબાઇલ ડેટાને સક્રિય રાખો (ઝડપી નેટવર્ક સ્વિચિંગ માટે)."</string>
<string name="tethering_hardware_offload_summary" msgid="7801345335142803029">"જો ટિથરિંગ માટે હાર્ડવેર ગતિવૃદ્ધિ ઉપલબ્ધ હોય તો તેનો ઉપયોગ કરો"</string>
<string name="adb_warning_title" msgid="7708653449506485728">"USB ડિબગિંગને મંજૂરી આપીએ?"</string>
- <string name="adb_warning_message" msgid="8145270656419669221">"USB ડિબગીંગ ફક્ત વિકાસ હેતુઓ માટે જ બનાવાયેલ છે. તેનો ઉપયોગ તમારા કમ્પ્યુટર અને તમારા ઉપકરણ વચ્ચે ડેટાને કૉપિ કરવા, નોટિફિકેશન વગર તમારા ઉપકરણ પર ઍપ્લિકેશનો ઇન્સ્ટોલ કરવા અને લૉગ ડેટા વાંચવા માટે કરો."</string>
+ <string name="adb_warning_message" msgid="8145270656419669221">"USB ડિબગીંગ ફક્ત વિકાસ હેતુઓ માટે જ બનાવાયેલ છે. તેનો ઉપયોગ તમારા કમ્પ્યુટર અને તમારા ડિવાઇસ વચ્ચે ડેટાને કૉપિ કરવા, નોટિફિકેશન વગર તમારા ડિવાઇસ પર ઍપ ઇન્સ્ટોલ કરવા અને લૉગ ડેટા વાંચવા માટે કરો."</string>
<string name="adbwifi_warning_title" msgid="727104571653031865">"વાયરલેસ ડિબગીંગને મંજૂરી આપીએ?"</string>
<string name="adbwifi_warning_message" msgid="8005936574322702388">"વાયરલેસ ડિબગીંગ ફક્ત ડેવલપમેન્ટના હેતુઓ માટે જ બનાવાયું છે. તેનો ઉપયોગ તમારા કમ્પ્યુટર અને તમારા ડિવાઇસ વચ્ચે ડેટાને કૉપિ કરવા, નોટિફિકેશન વગર તમારા ડિવાઇસ પર ઍપને ઇન્સ્ટૉલ કરવા અને લૉગ ડેટા વાંચવા માટે કરો."</string>
<string name="adb_keys_warning_message" msgid="2968555274488101220">"તમે અગાઉ અધિકૃત કરેલા તમામ કમ્પ્યુટર્સમાંથી USB ડિબગિંગ પરની અૅક્સેસ રદબાતલ કરીએ?"</string>
- <string name="dev_settings_warning_title" msgid="8251234890169074553">"વિકાસ સેટિંગ્સને મંજૂરી આપીએ?"</string>
- <string name="dev_settings_warning_message" msgid="37741686486073668">"આ સેટિંગ્સ ફક્ત વિકાસનાં ઉપયોગ માટે જ હેતુબદ્ધ છે. તે તમારા ઉપકરણ અને તેના પરની એપ્લિકેશન્સનાં ભંગ થવા અથવા ખરાબ વર્તનનું કારણ બની શકે છે."</string>
+ <string name="dev_settings_warning_title" msgid="8251234890169074553">"ડેવલપમેન્ટ સેટિંગને મંજૂરી આપીએ?"</string>
+ <string name="dev_settings_warning_message" msgid="37741686486073668">"આ સેટિંગ ફક્ત વિકાસનાં ઉપયોગ માટે જ હેતુબદ્ધ છે. તે તમારા ડિવાઇસ અને તેના પરની ઍપના ભંગ થવા અથવા ખરાબ વર્તનનું કારણ બની શકે છે."</string>
<string name="verify_apps_over_usb_title" msgid="6031809675604442636">"USB પર ઍપ ચકાસો"</string>
<string name="verify_apps_over_usb_summary" msgid="1317933737581167839">"હાનિકારક વર્તણૂંક માટે ADB/ADT મારફતે ઇન્સ્ટોલ કરવામાં આવેલી ઍપ તપાસો."</string>
<string name="bluetooth_show_devices_without_names_summary" msgid="780964354377854507">"નામ વગરના (ફક્ત MAC ઍડ્રેસવાળા) બ્લૂટૂથ ડિવાઇસ બતાવવામાં આવશે"</string>
@@ -468,7 +468,7 @@
<string name="external_source_trusted" msgid="1146522036773132905">"મંજૂરી છે"</string>
<string name="external_source_untrusted" msgid="5037891688911672227">"મંજૂરી નથી"</string>
<string name="install_other_apps" msgid="3232595082023199454">"અજાણી ઍપ ઇન્સ્ટૉલ કરો"</string>
- <string name="home" msgid="973834627243661438">"સેટિંગ્સ હોમ"</string>
+ <string name="home" msgid="973834627243661438">"સેટિંગ હોમ"</string>
<string-array name="battery_labels">
<item msgid="7878690469765357158">"0%"</item>
<item msgid="8894873528875953317">"50%"</item>
@@ -488,7 +488,7 @@
<string name="retail_demo_reset_title" msgid="1866911701095959800">"પાસવર્ડ આવશ્યક છે"</string>
<string name="active_input_method_subtypes" msgid="4232680535471633046">"ઇનપુટ પદ્ધતિઓ સક્રિય કરો"</string>
<string name="use_system_language_to_select_input_method_subtypes" msgid="4865195835541387040">"સિસ્ટમ ભાષાઓનો ઉપયોગ કરો"</string>
- <string name="failed_to_open_app_settings_toast" msgid="764897252657692092">"<xliff:g id="SPELL_APPLICATION_NAME">%1$s</xliff:g> માટેની સેટિંગ્સ ખોલવામાં નિષ્ફળ"</string>
+ <string name="failed_to_open_app_settings_toast" msgid="764897252657692092">"<xliff:g id="SPELL_APPLICATION_NAME">%1$s</xliff:g> માટેના સેટિંગ ખોલવામાં નિષ્ફળ"</string>
<string name="ime_security_warning" msgid="6547562217880551450">"આ ઇનપુટ પદ્ધતિ પાસવર્ડ્સ અને ક્રેડિટ કાર્ડ નંબર જેવી વ્યક્તિગત માહિતી સહિત તમે લખો છો તે તમામ ટેક્સ્ટ એકત્રિત કરવા માટે સક્ષમ હોઈ શકે છે. તે ઍપ્લિકેશન <xliff:g id="IME_APPLICATION_NAME">%1$s</xliff:g> માંથી આવે છે. આ ઇનપુટ પદ્ધતિ વાપરીએ?"</string>
<string name="direct_boot_unaware_dialog_message" msgid="7845398276735021548">"નોંધ: રીબૂટ કર્યાં પછી, જ્યાં સુધી તમે તમારો ફોન અનલૉક કરશો નહીં ત્યાં સુધી આ ઍપ્લિકેશન શરૂ થઈ શકશે નહીં"</string>
<string name="ims_reg_title" msgid="8197592958123671062">"IMS રજિસ્ટ્રેશનની સ્થિતિ"</string>
diff --git a/packages/SettingsLib/res/values-mn/strings.xml b/packages/SettingsLib/res/values-mn/strings.xml
index 5ac22ff..2576993 100644
--- a/packages/SettingsLib/res/values-mn/strings.xml
+++ b/packages/SettingsLib/res/values-mn/strings.xml
@@ -155,8 +155,8 @@
<string name="running_process_item_user_label" msgid="3988506293099805796">"Хэрэглэгч: <xliff:g id="USER_NAME">%1$s</xliff:g>"</string>
<string name="launch_defaults_some" msgid="3631650616557252926">"Зарим үндсэн тохиргоонуудыг суулгасан"</string>
<string name="launch_defaults_none" msgid="8049374306261262709">"Ямар ч үндсэн тохиргоог суулгаагүй байна"</string>
- <string name="tts_settings" msgid="8130616705989351312">"Текст-ярианы тохиргоо"</string>
- <string name="tts_settings_title" msgid="7602210956640483039">"Текстийг яриа болгон гаргах"</string>
+ <string name="tts_settings" msgid="8130616705989351312">"Бичвэрийг ярианд хувиргах тохиргоо"</string>
+ <string name="tts_settings_title" msgid="7602210956640483039">"Бичвэрийг ярианд хувиргах"</string>
<string name="tts_default_rate_title" msgid="3964187817364304022">"Ярианы түвшин"</string>
<string name="tts_default_rate_summary" msgid="3781937042151716987">"Текстийг унших хурд"</string>
<string name="tts_default_pitch_title" msgid="6988592215554485479">"Авиа тон"</string>
@@ -170,7 +170,7 @@
<string name="tts_install_data_title" msgid="1829942496472751703">"Хоолойн өгөгдлийг суулгах"</string>
<string name="tts_install_data_summary" msgid="3608874324992243851">"Яриа үүсгэхэд шаардлагатай дууны өгөгдлийг суулгах"</string>
<string name="tts_engine_security_warning" msgid="3372432853837988146">"Энэ яриа үүсгүүр нь нууц үг, зээлийн картын дугаар гэх мэт таны хувийн мэдээллийг оруулан унших бүх текстийг цуглуулах боломжтой. Үүнийг <xliff:g id="TTS_PLUGIN_ENGINE_NAME">%s</xliff:g> үүсгүүрээс нийлүүлдэг. Энэ яриа үүсгүүрийн ашиглалтыг идэвхжүүлэх үү?"</string>
- <string name="tts_engine_network_required" msgid="8722087649733906851">"Энэ хэл нь текстээс дуунд хөрвүүлэхэд ажлын сүлжээний холболтыг шаарддаг."</string>
+ <string name="tts_engine_network_required" msgid="8722087649733906851">"Энэ хэл нь бичвэрийг ярианд хувиргахад ажлын сүлжээний холболт шаардана."</string>
<string name="tts_default_sample_string" msgid="6388016028292967973">"Энэ бол яриа үүсгэх жишээ юм."</string>
<string name="tts_status_title" msgid="8190784181389278640">"Үндсэн хэлний статус"</string>
<string name="tts_status_ok" msgid="8583076006537547379">"<xliff:g id="LOCALE">%1$s</xliff:g> бүрэн дэмжигдсэн"</string>
diff --git a/packages/SettingsLib/res/values-pl/arrays.xml b/packages/SettingsLib/res/values-pl/arrays.xml
index db621be..22b0539 100644
--- a/packages/SettingsLib/res/values-pl/arrays.xml
+++ b/packages/SettingsLib/res/values-pl/arrays.xml
@@ -247,7 +247,7 @@
<item msgid="5023908510820531131">"W: <xliff:g id="AS_TYPED_COMMAND">adb shell dumpsys gfxinfo</xliff:g>"</item>
</string-array>
<string-array name="debug_hw_overdraw_entries">
- <item msgid="1968128556747588800">"Wył."</item>
+ <item msgid="1968128556747588800">"Wyłączone"</item>
<item msgid="3033215374382962216">"Pokaż przerysowywane obszary"</item>
<item msgid="3474333938380896988">"Pokaż obszary dostosowane do deuteranomalii"</item>
</string-array>
diff --git a/packages/SettingsLib/res/values-sl/strings.xml b/packages/SettingsLib/res/values-sl/strings.xml
index 490d3aa..055760d 100644
--- a/packages/SettingsLib/res/values-sl/strings.xml
+++ b/packages/SettingsLib/res/values-sl/strings.xml
@@ -88,8 +88,8 @@
<string name="bluetooth_profile_hid" msgid="2969922922664315866">"Vnosna naprava"</string>
<string name="bluetooth_profile_pan" msgid="1006235139308318188">"Internetni dostop"</string>
<string name="bluetooth_profile_pbap" msgid="7064307749579335765">"Deljenje stikov"</string>
- <string name="bluetooth_profile_pbap_summary" msgid="2955819694801952056">"Uporabi za dajanje stikov v skupno rabo"</string>
- <string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Skupna raba internetne povezave"</string>
+ <string name="bluetooth_profile_pbap_summary" msgid="2955819694801952056">"Uporabi za deljenje stikov"</string>
+ <string name="bluetooth_profile_pan_nap" msgid="7871974753822470050">"Deljenje internetne povezave"</string>
<string name="bluetooth_profile_map" msgid="8907204701162107271">"Sporočila SMS"</string>
<string name="bluetooth_profile_sap" msgid="8304170950447934386">"Dostop do kartice SIM"</string>
<string name="bluetooth_profile_a2dp_high_quality" msgid="4739440941324792775">"Zvok visoke kakovosti: <xliff:g id="CODEC_NAME">%1$s</xliff:g>"</string>
@@ -104,7 +104,7 @@
<string name="bluetooth_opp_profile_summary_not_connected" msgid="3959741824627764954">"Povezava s strežnikom za prenos datotek ni vzpostavljena"</string>
<string name="bluetooth_hid_profile_summary_connected" msgid="3923653977051684833">"Povezava z vnosno napravo je vzpostavljena"</string>
<string name="bluetooth_pan_user_profile_summary_connected" msgid="380469653827505727">"Povezava z napravo za internetni dostop"</string>
- <string name="bluetooth_pan_nap_profile_summary_connected" msgid="3744773111299503493">"Skupna raba lok. internetne povezave z napravo"</string>
+ <string name="bluetooth_pan_nap_profile_summary_connected" msgid="3744773111299503493">"Deljenje lok. internetne povezave z napravo"</string>
<string name="bluetooth_pan_profile_summary_use_for" msgid="7422039765025340313">"Uporabi za dostop do interneta"</string>
<string name="bluetooth_map_profile_summary_use_for" msgid="4453622103977592583">"Uporabi za zemljevid"</string>
<string name="bluetooth_sap_profile_summary_use_for" msgid="6204902866176714046">"Uporablja se za dostop do kartice SIM"</string>
diff --git a/packages/SettingsLib/tests/robotests/OWNERS b/packages/SettingsLib/tests/robotests/OWNERS
new file mode 100644
index 0000000..8a7a27e
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/OWNERS
@@ -0,0 +1,2 @@
+# We do not guard tests - everyone is welcomed to contribute to tests.
+per-file *.java=*
\ No newline at end of file
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/IllustrationPreferenceTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/IllustrationPreferenceTest.java
index ea9be04..9e3312a 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/IllustrationPreferenceTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/IllustrationPreferenceTest.java
@@ -18,6 +18,8 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
@@ -130,4 +132,27 @@
verify(drawable).start();
}
+
+ @Test
+ public void playLottieAnimationWithUri_verifyFailureListener() {
+ doReturn(null).when(mAnimationView).getDrawable();
+
+ mPreference.setImageUri(mImageUri);
+ mPreference.onBindViewHolder(mViewHolder);
+
+ verify(mAnimationView).setFailureListener(any());
+ }
+
+ @Test
+ public void playLottieAnimationWithResource_verifyFailureListener() {
+ // fake the valid lottie image
+ final int fakeValidResId = 111;
+ doNothing().when(mAnimationView).setImageResource(fakeValidResId);
+ doReturn(null).when(mAnimationView).getDrawable();
+
+ mPreference.setLottieAnimationResId(fakeValidResId);
+ mPreference.onBindViewHolder(mViewHolder);
+
+ verify(mAnimationView).setFailureListener(any());
+ }
}
diff --git a/packages/SettingsProvider/res/values-gu/strings.xml b/packages/SettingsProvider/res/values-gu/strings.xml
index 1f91f71..dded10e 100644
--- a/packages/SettingsProvider/res/values-gu/strings.xml
+++ b/packages/SettingsProvider/res/values-gu/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="4567566098528588863">"સેટિંગ્સ સંગ્રહ"</string>
+ <string name="app_label" msgid="4567566098528588863">"સેટિંગ સ્ટોરેજ"</string>
<string name="wifi_softap_config_change" msgid="5688373762357941645">"હૉટસ્પૉટ સેટિંગ બદલાઈ ગઈ છે"</string>
<string name="wifi_softap_config_change_summary" msgid="8946397286141531087">"વિગતો જોવા માટે ટૅપ કરો"</string>
</resources>
diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
index 6d7fb02..7a9f81e0 100644
--- a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
+++ b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
@@ -276,7 +276,7 @@
VALIDATORS.put(Secure.ACCESSIBILITY_BUTTON_MODE,
new InclusiveIntegerRangeValidator(
Secure.ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR,
- Secure.ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU));
+ Secure.ACCESSIBILITY_BUTTON_MODE_GESTURE));
VALIDATORS.put(Secure.ACCESSIBILITY_FLOATING_MENU_SIZE,
new DiscreteValueValidator(new String[] {"0", "1"}));
VALIDATORS.put(Secure.ACCESSIBILITY_FLOATING_MENU_ICON_TYPE,
diff --git a/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java b/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
index f66d014..6a4b5e9 100644
--- a/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
+++ b/packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java
@@ -102,7 +102,8 @@
Settings.System.PEAK_REFRESH_RATE, // depends on hardware capabilities
Settings.System.SCREEN_BRIGHTNESS_FLOAT,
Settings.System.SCREEN_BRIGHTNESS_FOR_VR_FLOAT,
- Settings.System.MULTI_AUDIO_FOCUS_ENABLED // form-factor/OEM specific
+ Settings.System.MULTI_AUDIO_FOCUS_ENABLED, // form-factor/OEM specific
+ Settings.System.WEAR_ACCESSIBILITY_GESTURE_ENABLED
);
private static final Set<String> BACKUP_DENY_LIST_GLOBAL_SETTINGS =
diff --git a/packages/Shell/res/values-sl/strings.xml b/packages/Shell/res/values-sl/strings.xml
index 1fc27ca..76702d6 100644
--- a/packages/Shell/res/values-sl/strings.xml
+++ b/packages/Shell/res/values-sl/strings.xml
@@ -24,7 +24,7 @@
<string name="bugreport_updating_wait" msgid="3322151947853929470">"Počakajte ..."</string>
<string name="bugreport_finished_text" product="watch" msgid="1223616207145252689">"Poročilo o napakah bo kmalu prikazano v telefonu"</string>
<string name="bugreport_finished_text" product="tv" msgid="5758325479058638893">"Izberite za pošiljanje poročila o napakah"</string>
- <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Dotaknite se, če želite poročilo o napaki dati v skupno rabo"</string>
+ <string name="bugreport_finished_text" product="default" msgid="8353769438382138847">"Dotaknite se, če želite deliti poročilo o napaki"</string>
<string name="bugreport_finished_pending_screenshot_text" product="tv" msgid="2343263822812016950">"Izberite za pošiljanje poročila o napakah brez posnetka zaslona ali počakajte, da se ta dokonča"</string>
<string name="bugreport_finished_pending_screenshot_text" product="watch" msgid="1474435374470177193">"Dotaknite se za pošiljanje poročila o napakah brez posnetka zaslona ali počakajte, da se ta dokonča"</string>
<string name="bugreport_finished_pending_screenshot_text" product="default" msgid="1474435374470177193">"Dotaknite se za pošiljanje poročila o napakah brez posnetka zaslona ali počakajte, da se ta dokonča"</string>
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 9de1c5e..adf441b 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -656,6 +656,10 @@
</service>
<service
+ android:name=".communal.service.CommunalService"
+ android:exported="@bool/config_communalServiceEnabled"/>
+
+ <service
android:name=".keyguard.KeyguardService"
android:exported="true" />
diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QS.java b/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QS.java
index bd2209b..0424382 100644
--- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QS.java
+++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QS.java
@@ -52,13 +52,6 @@
void setListening(boolean listening);
boolean isShowingDetail();
void closeDetail();
-
- /**
- * Set that we're currently pulse expanding
- *
- * @param pulseExpanding if we're currently expanding during pulsing
- */
- default void setPulseExpanding(boolean pulseExpanding) {}
void animateHeaderSlidingOut();
void setQsExpansion(float qsExpansionFraction, float headerTranslation);
void setHeaderListening(boolean listening);
diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml b/packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml
index 02cb2bc..a22a56f 100644
--- a/packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml
+++ b/packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml
@@ -20,171 +20,166 @@
<com.android.keyguard.KeyguardPINView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/res-auto"
- android:id="@+id/keyguard_pin_view"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/keyguard_pin_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
androidprv:layout_maxWidth="@dimen/keyguard_security_width"
android:orientation="vertical"
>
- <LinearLayout
- android:id="@+id/pin_container"
+
+ <androidx.constraintlayout.widget.ConstraintLayout
+ android:id="@+id/pin_container"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_marginBottom="8dp"
+ android:layout_weight="1"
+ android:layoutDirection="ltr"
+ android:orientation="vertical">
+
+ <!-- Set this to be just above key1. It would be better to introduce a barrier above
+ key1/key2/key3, then place this View above that. Sadly, that doesn't work (the Barrier
+ drops to the bottom of the page, and key1/2/3 all shoot up to the top-left). In any
+ case, the Flow should ensure that key1/2/3 all have the same top, so this should be
+ fine. -->
+ <com.android.keyguard.AlphaOptimizedRelativeLayout
+ android:id="@+id/row0"
android:layout_width="match_parent"
- android:layout_height="0dp"
- android:orientation="vertical"
- android:layout_weight="1"
- android:layoutDirection="ltr"
- android:layout_marginBottom="8dp"
- >
- <Space
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- />
- <com.android.keyguard.AlphaOptimizedRelativeLayout
- android:id="@+id/row0"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingBottom="@dimen/num_pad_entry_row_margin_bottom"
- >
+ android:layout_height="wrap_content"
+ android:paddingBottom="@dimen/num_pad_entry_row_margin_bottom"
+ androidprv:layout_constraintBottom_toTopOf="@id/key1"
+ androidprv:layout_constraintEnd_toEndOf="parent"
+ androidprv:layout_constraintStart_toStartOf="parent"
+
+ androidprv:layout_constraintTop_toTopOf="parent"
+ androidprv:layout_constraintVertical_bias="1.0">
+
<com.android.keyguard.PasswordTextView
- android:id="@+id/pinEntry"
- android:layout_width="@dimen/keyguard_security_width"
- android:layout_height="@dimen/keyguard_password_height"
- style="@style/Widget.TextView.Password"
- android:layout_centerHorizontal="true"
- android:layout_marginRight="72dp"
- androidprv:scaledTextSize="@integer/scaled_password_text_size"
- android:contentDescription="@string/keyguard_accessibility_pin_area"
- />
+ android:id="@+id/pinEntry"
+ style="@style/Widget.TextView.Password"
+ android:layout_width="@dimen/keyguard_security_width"
+ android:layout_height="@dimen/keyguard_password_height"
+ android:layout_centerHorizontal="true"
+ android:layout_marginRight="72dp"
+ android:contentDescription="@string/keyguard_accessibility_pin_area"
+ androidprv:scaledTextSize="@integer/scaled_password_text_size" />
</com.android.keyguard.AlphaOptimizedRelativeLayout>
- <LinearLayout
- android:id="@+id/row1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:layout_gravity="center_horizontal"
- android:layout_marginBottom="@dimen/num_pad_row_margin_bottom"
- >
- <com.android.keyguard.NumPadKey
- android:id="@+id/key1"
- android:layout_width="@dimen/num_pad_key_width"
- android:layout_height="match_parent"
- android:layout_marginEnd="@dimen/num_pad_key_margin_end"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="1"
- />
- <com.android.keyguard.NumPadKey
- android:id="@+id/key2"
- android:layout_width="@dimen/num_pad_key_width"
- android:layout_height="match_parent"
- android:layout_marginEnd="@dimen/num_pad_key_margin_end"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="2"
- />
- <com.android.keyguard.NumPadKey
- android:id="@+id/key3"
- android:layout_width="@dimen/num_pad_key_width"
- android:layout_height="match_parent"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="3"
- />
- </LinearLayout>
- <LinearLayout
- android:id="@+id/row2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:layout_gravity="center_horizontal"
- android:layout_marginBottom="@dimen/num_pad_row_margin_bottom"
- >
- <com.android.keyguard.NumPadKey
- android:id="@+id/key4"
- android:layout_width="@dimen/num_pad_key_width"
- android:layout_height="match_parent"
- android:layout_marginEnd="@dimen/num_pad_key_margin_end"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="4"
- />
- <com.android.keyguard.NumPadKey
- android:id="@+id/key5"
- android:layout_width="@dimen/num_pad_key_width"
- android:layout_height="match_parent"
- android:layout_marginEnd="@dimen/num_pad_key_margin_end"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="5"
- />
- <com.android.keyguard.NumPadKey
- android:id="@+id/key6"
- android:layout_width="@dimen/num_pad_key_width"
- android:layout_height="match_parent"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="6"
- />
- </LinearLayout>
- <LinearLayout
- android:id="@+id/row3"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:layout_gravity="center_horizontal"
- android:layout_marginBottom="@dimen/num_pad_row_margin_bottom"
- >
- <com.android.keyguard.NumPadKey
- android:id="@+id/key7"
- android:layout_width="@dimen/num_pad_key_width"
- android:layout_height="match_parent"
- android:layout_marginEnd="@dimen/num_pad_key_margin_end"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="7"
- />
- <com.android.keyguard.NumPadKey
- android:id="@+id/key8"
- android:layout_width="@dimen/num_pad_key_width"
- android:layout_height="match_parent"
- android:layout_marginEnd="@dimen/num_pad_key_margin_end"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="8"
- />
- <com.android.keyguard.NumPadKey
- android:id="@+id/key9"
- android:layout_width="@dimen/num_pad_key_width"
- android:layout_height="match_parent"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="9"
- />
- </LinearLayout>
- <LinearLayout
- android:id="@+id/row4"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:layout_gravity="center_horizontal"
- >
- <com.android.keyguard.NumPadButton
- android:id="@+id/delete_button"
- android:layout_width="@dimen/num_pad_key_width"
- android:layout_height="match_parent"
- android:layout_marginEnd="@dimen/num_pad_key_margin_end"
- android:contentDescription="@string/keyboardview_keycode_delete"
- style="@style/NumPadKey.Delete"
- />
- <com.android.keyguard.NumPadKey
- android:id="@+id/key0"
- android:layout_width="@dimen/num_pad_key_width"
- android:layout_height="match_parent"
- android:layout_marginEnd="@dimen/num_pad_key_margin_end"
- androidprv:textView="@+id/pinEntry"
- androidprv:digit="0"
- />
- <com.android.keyguard.NumPadButton
- android:id="@+id/key_enter"
- android:layout_width="@dimen/num_pad_key_width"
- android:layout_height="match_parent"
- style="@style/NumPadKey.Enter"
- android:contentDescription="@string/keyboardview_keycode_enter"
- />
- </LinearLayout>
- </LinearLayout>
+
+ <androidx.constraintlayout.helper.widget.Flow
+ android:id="@+id/flow1"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:orientation="horizontal"
+
+ androidprv:constraint_referenced_ids="key1,key2,key3,key4,key5,key6,key7,key8,key9,delete_button,key0,key_enter"
+
+ androidprv:flow_horizontalGap="@dimen/num_pad_key_margin_end"
+
+ androidprv:flow_horizontalStyle="packed"
+ androidprv:flow_maxElementsWrap="3"
+
+ androidprv:flow_verticalGap="@dimen/num_pad_entry_row_margin_bottom"
+ androidprv:flow_verticalStyle="packed"
+ androidprv:flow_verticalBias="1.0"
+
+ androidprv:flow_wrapMode="aligned"
+
+ androidprv:layout_constraintTop_toTopOf="parent"
+ androidprv:layout_constraintBottom_toBottomOf="parent"
+ androidprv:layout_constraintEnd_toEndOf="parent"
+ androidprv:layout_constraintStart_toStartOf="parent" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key1"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ androidprv:digit="1"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key2"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ androidprv:digit="2"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key3"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ androidprv:digit="3"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key4"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ androidprv:digit="4"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key5"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ androidprv:digit="5"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key6"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ androidprv:digit="6"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key7"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ androidprv:digit="7"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key8"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ androidprv:digit="8"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key9"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ androidprv:digit="9"
+ androidprv:textView="@+id/pinEntry" />
+
+
+ <com.android.keyguard.NumPadButton
+ android:id="@+id/delete_button"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ style="@style/NumPadKey.Delete"
+ android:contentDescription="@string/keyboardview_keycode_delete"
+ />
+
+ <com.android.keyguard.NumPadKey
+ android:id="@+id/key0"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ androidprv:digit="0"
+ androidprv:textView="@+id/pinEntry" />
+
+ <com.android.keyguard.NumPadButton
+ android:id="@+id/key_enter"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ style="@style/NumPadKey.Enter"
+ android:contentDescription="@string/keyboardview_keycode_enter"
+ />
+
+ </androidx.constraintlayout.widget.ConstraintLayout>
+
+
+
<include layout="@layout/keyguard_eca"
android:id="@+id/keyguard_selector_fade_container"
android:layout_width="match_parent"
diff --git a/packages/SystemUI/res-keyguard/values-en-rAU/strings.xml b/packages/SystemUI/res-keyguard/values-en-rAU/strings.xml
index 1abd393..009b7cb 100644
--- a/packages/SystemUI/res-keyguard/values-en-rAU/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-en-rAU/strings.xml
@@ -74,7 +74,7 @@
<string name="kg_sim_lock_esim_instructions" msgid="5577169988158738030">"<xliff:g id="PREVIOUS_MSG">%1$s</xliff:g> Disable eSIM to use device without mobile service."</string>
<string name="kg_pin_instructions" msgid="822353548385014361">"Enter PIN"</string>
<string name="kg_password_instructions" msgid="324455062831719903">"Enter Password"</string>
- <string name="kg_puk_enter_puk_hint" msgid="3005288372875367017">"SIM is now disabled. Enter PUK code to continue. Contact carrier for details."</string>
+ <string name="kg_puk_enter_puk_hint" msgid="3005288372875367017">"SIM is now disabled. Enter PUK code to continue. Contact operator for details."</string>
<string name="kg_puk_enter_puk_hint_multi" msgid="4876780689904862943">"SIM \"<xliff:g id="CARRIER">%1$s</xliff:g>\" is now disabled. Enter PUK code to continue. Contact operator for details."</string>
<string name="kg_puk_enter_pin_hint" msgid="6028432138916150399">"Enter desired PIN code"</string>
<string name="kg_enter_confirm_pin_hint" msgid="4261064020391799132">"Confirm desired PIN code"</string>
diff --git a/packages/SystemUI/res-keyguard/values-en-rCA/strings.xml b/packages/SystemUI/res-keyguard/values-en-rCA/strings.xml
index c3e8e61..21f32cf 100644
--- a/packages/SystemUI/res-keyguard/values-en-rCA/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-en-rCA/strings.xml
@@ -74,7 +74,7 @@
<string name="kg_sim_lock_esim_instructions" msgid="5577169988158738030">"<xliff:g id="PREVIOUS_MSG">%1$s</xliff:g> Disable eSIM to use device without mobile service."</string>
<string name="kg_pin_instructions" msgid="822353548385014361">"Enter PIN"</string>
<string name="kg_password_instructions" msgid="324455062831719903">"Enter Password"</string>
- <string name="kg_puk_enter_puk_hint" msgid="3005288372875367017">"SIM is now disabled. Enter PUK code to continue. Contact carrier for details."</string>
+ <string name="kg_puk_enter_puk_hint" msgid="3005288372875367017">"SIM is now disabled. Enter PUK code to continue. Contact operator for details."</string>
<string name="kg_puk_enter_puk_hint_multi" msgid="4876780689904862943">"SIM \"<xliff:g id="CARRIER">%1$s</xliff:g>\" is now disabled. Enter PUK code to continue. Contact operator for details."</string>
<string name="kg_puk_enter_pin_hint" msgid="6028432138916150399">"Enter desired PIN code"</string>
<string name="kg_enter_confirm_pin_hint" msgid="4261064020391799132">"Confirm desired PIN code"</string>
diff --git a/packages/SystemUI/res-keyguard/values-en-rGB/strings.xml b/packages/SystemUI/res-keyguard/values-en-rGB/strings.xml
index 1abd393..009b7cb 100644
--- a/packages/SystemUI/res-keyguard/values-en-rGB/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-en-rGB/strings.xml
@@ -74,7 +74,7 @@
<string name="kg_sim_lock_esim_instructions" msgid="5577169988158738030">"<xliff:g id="PREVIOUS_MSG">%1$s</xliff:g> Disable eSIM to use device without mobile service."</string>
<string name="kg_pin_instructions" msgid="822353548385014361">"Enter PIN"</string>
<string name="kg_password_instructions" msgid="324455062831719903">"Enter Password"</string>
- <string name="kg_puk_enter_puk_hint" msgid="3005288372875367017">"SIM is now disabled. Enter PUK code to continue. Contact carrier for details."</string>
+ <string name="kg_puk_enter_puk_hint" msgid="3005288372875367017">"SIM is now disabled. Enter PUK code to continue. Contact operator for details."</string>
<string name="kg_puk_enter_puk_hint_multi" msgid="4876780689904862943">"SIM \"<xliff:g id="CARRIER">%1$s</xliff:g>\" is now disabled. Enter PUK code to continue. Contact operator for details."</string>
<string name="kg_puk_enter_pin_hint" msgid="6028432138916150399">"Enter desired PIN code"</string>
<string name="kg_enter_confirm_pin_hint" msgid="4261064020391799132">"Confirm desired PIN code"</string>
diff --git a/packages/SystemUI/res-keyguard/values-en-rIN/strings.xml b/packages/SystemUI/res-keyguard/values-en-rIN/strings.xml
index 1abd393..009b7cb 100644
--- a/packages/SystemUI/res-keyguard/values-en-rIN/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-en-rIN/strings.xml
@@ -74,7 +74,7 @@
<string name="kg_sim_lock_esim_instructions" msgid="5577169988158738030">"<xliff:g id="PREVIOUS_MSG">%1$s</xliff:g> Disable eSIM to use device without mobile service."</string>
<string name="kg_pin_instructions" msgid="822353548385014361">"Enter PIN"</string>
<string name="kg_password_instructions" msgid="324455062831719903">"Enter Password"</string>
- <string name="kg_puk_enter_puk_hint" msgid="3005288372875367017">"SIM is now disabled. Enter PUK code to continue. Contact carrier for details."</string>
+ <string name="kg_puk_enter_puk_hint" msgid="3005288372875367017">"SIM is now disabled. Enter PUK code to continue. Contact operator for details."</string>
<string name="kg_puk_enter_puk_hint_multi" msgid="4876780689904862943">"SIM \"<xliff:g id="CARRIER">%1$s</xliff:g>\" is now disabled. Enter PUK code to continue. Contact operator for details."</string>
<string name="kg_puk_enter_pin_hint" msgid="6028432138916150399">"Enter desired PIN code"</string>
<string name="kg_enter_confirm_pin_hint" msgid="4261064020391799132">"Confirm desired PIN code"</string>
diff --git a/packages/SystemUI/res-keyguard/values-land/donottranslate.xml b/packages/SystemUI/res-keyguard/values-land/donottranslate.xml
new file mode 100644
index 0000000..9912b69
--- /dev/null
+++ b/packages/SystemUI/res-keyguard/values-land/donottranslate.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2021 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="num_pad_key_ratio">1.51</string>
+</resources>
diff --git a/packages/SystemUI/res-keyguard/values-sv/strings.xml b/packages/SystemUI/res-keyguard/values-sv/strings.xml
index 0b1efa8..fb2571e 100644
--- a/packages/SystemUI/res-keyguard/values-sv/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-sv/strings.xml
@@ -61,7 +61,7 @@
<string name="error_disable_esim_msg" msgid="2441188596467999327">"Det gick inte att inaktivera eSIM-kortet på grund av ett fel."</string>
<string name="keyboardview_keycode_enter" msgid="6727192265631761174">"Retur"</string>
<string name="kg_forgot_pattern_button_text" msgid="3304688032024541260">"Har du glömt ditt grafiska lösenord?"</string>
- <string name="kg_wrong_pattern" msgid="5907301342430102842">"Fel grafiskt lösenord"</string>
+ <string name="kg_wrong_pattern" msgid="5907301342430102842">"Fel mönster"</string>
<string name="kg_wrong_password" msgid="4143127991071670512">"Fel lösenord"</string>
<string name="kg_wrong_pin" msgid="4160978845968732624">"Fel pinkod"</string>
<plurals name="kg_too_many_failed_attempts_countdown" formatted="false" msgid="991400408675793914">
@@ -82,7 +82,7 @@
<string name="kg_invalid_sim_pin_hint" msgid="2762202646949552978">"Ange en pinkod med fyra till åtta siffror."</string>
<string name="kg_invalid_sim_puk_hint" msgid="5319756880543857694">"PUK-koden ska vara minst åtta siffror."</string>
<string name="kg_invalid_puk" msgid="1774337070084931186">"Ange rätt PUK-kod. Om försöken upprepas inaktiveras SIM-kortet permanent."</string>
- <string name="kg_login_too_many_attempts" msgid="4519957179182578690">"För många försök med grafiskt lösenord"</string>
+ <string name="kg_login_too_many_attempts" msgid="4519957179182578690">"För många försök med mönster"</string>
<string name="kg_too_many_failed_pin_attempts_dialog_message" msgid="544687656831558971">"Du har angett fel pinkod <xliff:g id="NUMBER_0">%1$d</xliff:g> gånger. \n\nFörsök igen om <xliff:g id="NUMBER_1">%2$d</xliff:g> sekunder."</string>
<string name="kg_too_many_failed_password_attempts_dialog_message" msgid="190984061975729494">"Du har angett fel lösenord <xliff:g id="NUMBER_0">%1$d</xliff:g> gånger. \n\nFörsök igen om <xliff:g id="NUMBER_1">%2$d</xliff:g> sekunder."</string>
<string name="kg_too_many_failed_pattern_attempts_dialog_message" msgid="4252405904570284368">"Du har ritat ditt grafiska lösenord fel <xliff:g id="NUMBER_0">%1$d</xliff:g> gånger. \n\nFörsök igen om <xliff:g id="NUMBER_1">%2$d</xliff:g> sekunder."</string>
@@ -102,13 +102,13 @@
<string name="keyguard_carrier_default" msgid="6359808469637388586">"Ingen tjänst."</string>
<string name="accessibility_ime_switch_button" msgid="9082358310194861329">"Byt inmatningsmetod"</string>
<string name="airplane_mode" msgid="2528005343938497866">"Flygplansläge"</string>
- <string name="kg_prompt_reason_restart_pattern" msgid="4720554342633852066">"Du måste ange grafiskt lösenord när du har startat om enheten"</string>
+ <string name="kg_prompt_reason_restart_pattern" msgid="4720554342633852066">"Du måste rita mönster när du har startat om enheten"</string>
<string name="kg_prompt_reason_restart_pin" msgid="1587671566498057656">"Du måste ange pinkod när du har startat om enheten"</string>
<string name="kg_prompt_reason_restart_password" msgid="8061279087240952002">"Du måste ange lösenord när du har startat om enheten"</string>
- <string name="kg_prompt_reason_timeout_pattern" msgid="9170360502528959889">"Du måste ange grafiskt lösenord för ytterligare säkerhet"</string>
+ <string name="kg_prompt_reason_timeout_pattern" msgid="9170360502528959889">"Du måste rita mönster för ytterligare säkerhet"</string>
<string name="kg_prompt_reason_timeout_pin" msgid="5945186097160029201">"Du måste ange pinkod för ytterligare säkerhet"</string>
<string name="kg_prompt_reason_timeout_password" msgid="2258263949430384278">"Du måste ange lösenord för ytterligare säkerhet"</string>
- <string name="kg_prompt_reason_switch_profiles_pattern" msgid="1922016914701991230">"Du måste ange grafiskt lösenord när du byter profil"</string>
+ <string name="kg_prompt_reason_switch_profiles_pattern" msgid="1922016914701991230">"Du måste rita mönster när du byter profil"</string>
<string name="kg_prompt_reason_switch_profiles_pin" msgid="6490434826361055400">"Du måste ange pinkod när du byter profil"</string>
<string name="kg_prompt_reason_switch_profiles_password" msgid="1680374696393804441">"Du måste ange lösenord när du byter profil"</string>
<string name="kg_prompt_reason_device_admin" msgid="6961159596224055685">"Administratören har låst enheten"</string>
diff --git a/packages/SystemUI/res-keyguard/values/donottranslate.xml b/packages/SystemUI/res-keyguard/values/donottranslate.xml
index 1934457..052d329 100644
--- a/packages/SystemUI/res-keyguard/values/donottranslate.xml
+++ b/packages/SystemUI/res-keyguard/values/donottranslate.xml
@@ -29,4 +29,6 @@
<!-- Skeleton string format for displaying the time in 24-hour format. -->
<string name="clock_24hr_format">Hm</string>
+
+ <string name="num_pad_key_ratio">1</string>
</resources>
diff --git a/packages/SystemUI/res-keyguard/values/styles.xml b/packages/SystemUI/res-keyguard/values/styles.xml
index 72b027a..ea769c6 100644
--- a/packages/SystemUI/res-keyguard/values/styles.xml
+++ b/packages/SystemUI/res-keyguard/values/styles.xml
@@ -37,6 +37,10 @@
<item name="android:colorControlNormal">@null</item>
<item name="android:colorControlHighlight">?android:attr/colorAccent</item>
<item name="android:background">@drawable/num_pad_key_background</item>
+
+ <!-- Default values for NumPadKey used in a ConstraintLayout. -->
+ <item name="layout_constraintDimensionRatio">@string/num_pad_key_ratio</item>
+ <item name="layout_constraintWidth_max">@dimen/num_pad_key_width</item>
</style>
<style name="Widget.TextView.NumPadKey.Digit"
parent="@android:style/Widget.DeviceDefault.TextView">
diff --git a/packages/SystemUI/res/layout/communal_host_view.xml b/packages/SystemUI/res/layout/communal_host_view.xml
new file mode 100644
index 0000000..d3698be
--- /dev/null
+++ b/packages/SystemUI/res/layout/communal_host_view.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2021 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<!-- This is a view that shows general status information in Keyguard. -->
+<com.android.systemui.communal.CommunalHostView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:systemui="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/communal_host"
+ android:orientation="vertical"
+ systemui:layout_constraintEnd_toEndOf="parent"
+ android:layout_width="0dp"
+ android:layout_height="0dp"/>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml
index cf91a2b..da0010e 100644
--- a/packages/SystemUI/res/layout/status_bar_expanded.xml
+++ b/packages/SystemUI/res/layout/status_bar_expanded.xml
@@ -106,6 +106,9 @@
systemui:layout_constraintEnd_toEndOf="parent"
/>
+ <include layout="@layout/communal_host_view"
+ android:visibility="gone"/>
+
<include layout="@layout/ambient_indication"
android:id="@+id/ambient_indication_container" />
diff --git a/packages/SystemUI/res/values-af/strings.xml b/packages/SystemUI/res/values-af/strings.xml
index c5578f2..b2274a6 100644
--- a/packages/SystemUI/res/values-af/strings.xml
+++ b/packages/SystemUI/res/values-af/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Dit deblokkeer toegang vir alle programme en dienste wat toegelaat word om jou kamera te gebruik."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Dit deblokkeer toegang vir alle programme en dienste wat toegelaat word om jou kamera of mikrofoon te gebruik."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Toestel"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Swiep op om programme te wissel"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Sleep regs om programme vinnig te wissel"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Wissel oorsig"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Gelaai"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Laai tans"</string>
diff --git a/packages/SystemUI/res/values-af/strings_tv.xml b/packages/SystemUI/res/values-af/strings_tv.xml
index 5420779..c20d01e 100644
--- a/packages/SystemUI/res/values-af/strings_tv.xml
+++ b/packages/SystemUI/res/values-af/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Kennisgewings"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Geen kennisgewings nie"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofoon neem tans op"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kamera neem tans op"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kamera en mikrofoon neem tans op"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Mikrofoon het opname gestop"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Kamera het opname gestop"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Kamera en mikrofoon het opname gestop"</string>
</resources>
diff --git a/packages/SystemUI/res/values-am/strings.xml b/packages/SystemUI/res/values-am/strings.xml
index 4be2cee..abb4ef9 100644
--- a/packages/SystemUI/res/values-am/strings.xml
+++ b/packages/SystemUI/res/values-am/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"ይህ ካሜራዎን እንዲጠቀሙ ለተፈቀደላቸው ሁሉም መተግበሪያዎች እና አገልግሎቶች መዳረሻን እገዳ ያነሳል።"</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"ይህ የእርስዎን ካሜራ ወይም ማይክሮፎን እንዲጠቀሙ የተፈቀደላቸው የሁሉም መተግበሪያዎች እና አገልግሎቶች መዳረሻ እገዳን ያነሳል።"</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"መሣሪያ"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"መተግበሪያዎችን ለመቀየር ወደ ላይ ያንሸራትቱ"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"መተግበሪያዎችን በፍጥነት ለመቀየር ወደ ቀኝ ይጎትቱ"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"አጠቃላይ እይታን ቀያይር"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"ባትሪ ሞልቷል"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"ኃይል በመሙላት ላይ"</string>
diff --git a/packages/SystemUI/res/values-am/strings_tv.xml b/packages/SystemUI/res/values-am/strings_tv.xml
index ede0b78..39429e4 100644
--- a/packages/SystemUI/res/values-am/strings_tv.xml
+++ b/packages/SystemUI/res/values-am/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"በ<xliff:g id="VPN_APP">%1$s</xliff:g> በኩል"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"ማሳወቂያዎች"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"ምንም ማሳወቂያዎች የሉም"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"ማይክሮፎን እየቀዳ ነው"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"ካሜራ እየቀረጸ ነው"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"ካሜራ እየቀረጸ እና ማይክሮፎን እየቀዳ ነው"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"ማይክሮፎን መቅዳት አቁሟል"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"ካሜራ መቅረጽ አቁሟል"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"ካሜራ መቅረጽ እና ማይክሮፎን መቅዳት አቁመዋል"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ar/strings.xml b/packages/SystemUI/res/values-ar/strings.xml
index 300f3c6..ad4402b 100644
--- a/packages/SystemUI/res/values-ar/strings.xml
+++ b/packages/SystemUI/res/values-ar/strings.xml
@@ -441,8 +441,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"يؤدي هذا الخيار إلى إزالة حظر الوصول بالنسبة إلى كل التطبيقات والخدمات المسموح لها باستخدام الكاميرا."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"يؤدي هذا الخيار إلى إزالة حظر الوصول بالنسبة إلى كل التطبيقات والخدمات المسموح لها باستخدام الكاميرا أو الميكروفون."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"الجهاز"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"مرّر سريعًا لأعلى لتبديل التطبيقات"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"اسحب لليسار للتبديل السريع بين التطبيقات"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"تبديل \"النظرة العامة\""</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"تم الشحن"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"جارٍ الشحن"</string>
diff --git a/packages/SystemUI/res/values-as/strings.xml b/packages/SystemUI/res/values-as/strings.xml
index b06e010..17149a1 100644
--- a/packages/SystemUI/res/values-as/strings.xml
+++ b/packages/SystemUI/res/values-as/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"এইটোৱে আপোনাৰ কেমেৰা ব্যৱহাৰ কৰিবলৈ অনুমতি দিয়া আটাইবোৰ এপ্ আৰু সেৱাৰ বাবে এক্সেছ অৱৰোধৰ পৰা আঁতৰায়।"</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"এইটোৱে আপোনাৰ কেমেৰা অথবা মাইক্ৰ\'ফ\'ন ব্যৱহাৰ কৰিবলৈ অনুমতি দিয়া আটাইবোৰ এপ্ আৰু সেৱাৰ বাবে এক্সেছ অৱৰোধৰ পৰা আঁতৰায়।"</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"ডিভাইচ"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"আনটো এপ্ ব্য়ৱহাৰ কৰিবলৈ ওপৰলৈ ছোৱাইপ কৰক"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"খৰতকীয়াকৈ আনটো এপ্ ব্য়ৱহাৰ কৰিবলৈ সোঁফালে টানক"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"অৱলোকন ট’গল কৰক"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"চ্চার্জ হ’ল"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"চ্চার্জ হৈ আছে"</string>
diff --git a/packages/SystemUI/res/values-az/strings.xml b/packages/SystemUI/res/values-az/strings.xml
index 4b9dfa5..c1d520c 100644
--- a/packages/SystemUI/res/values-az/strings.xml
+++ b/packages/SystemUI/res/values-az/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Kamera və mikrofon istifadə edən bütün tətbiq və xidmətlərə giriş verir."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Kamera və mikrofon istifadə edən bütün tətbiq və xidmətlərə giriş verir."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Cihaz"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Tətbiqi dəyişmək üçün yuxarı sürüşdürün"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Tətbiqləri cəld dəyişmək üçün sağa çəkin"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"İcmala Keçin"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Enerji yığılıb"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Enerji doldurulur"</string>
diff --git a/packages/SystemUI/res/values-az/strings_tv.xml b/packages/SystemUI/res/values-az/strings_tv.xml
index d141ad6..cd8b46c 100644
--- a/packages/SystemUI/res/values-az/strings_tv.xml
+++ b/packages/SystemUI/res/values-az/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> vasitəsilə"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Bildirişlər"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Bildiriş yoxdur"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofon yazır"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kamera yazır"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kamera və mikrofon yazır"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Mikrofon yazmağı dayandırıb"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Kamera yazmağı dayandırıb"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Kamera və mikrofon yazmağı dayandırıb"</string>
</resources>
diff --git a/packages/SystemUI/res/values-b+sr+Latn/strings.xml b/packages/SystemUI/res/values-b+sr+Latn/strings.xml
index 3c29f85..0d6a635 100644
--- a/packages/SystemUI/res/values-b+sr+Latn/strings.xml
+++ b/packages/SystemUI/res/values-b+sr+Latn/strings.xml
@@ -435,8 +435,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Ovim će se odblokirati pristup za sve aplikacije i usluge koje imaju dozvolu za korišćenje kamere."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Ovim će se odblokirati pristup za sve aplikacije i usluge koje imaju dozvolu za korišćenje kamere ili mikrofona."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Uređaj"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Prevucite nagore da biste menjali aplikacije"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Prevucite udesno da biste brzo promenili aplikacije"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Uključi/isključi pregled"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Napunjena je"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Puni se"</string>
diff --git a/packages/SystemUI/res/values-b+sr+Latn/strings_tv.xml b/packages/SystemUI/res/values-b+sr+Latn/strings_tv.xml
index 04a7e81..31a37db 100644
--- a/packages/SystemUI/res/values-b+sr+Latn/strings_tv.xml
+++ b/packages/SystemUI/res/values-b+sr+Latn/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Preko: <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Obaveštenja"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nema obaveštenja"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofon snima"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kamera snima"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kamera i mikrofon snimaju"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Snimanje mikrofonom je zaustavljeno"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Snimanje kamerom je zaustavljeno"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Snimanje kamerom i mikrofonom je zaustavljeno"</string>
</resources>
diff --git a/packages/SystemUI/res/values-be/strings.xml b/packages/SystemUI/res/values-be/strings.xml
index aefeb47..f810bbf 100644
--- a/packages/SystemUI/res/values-be/strings.xml
+++ b/packages/SystemUI/res/values-be/strings.xml
@@ -437,8 +437,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Доступ адкрыецца для ўсіх праграм і сэрвісаў, якім дазволена выкарыстоўваць камеру."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Доступ адкрыецца для ўсіх праграм і сэрвісаў, якім дазволена выкарыстоўваць камеру ці мікрафон."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Прылада"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Правядзіце ўверх, каб пераключыць праграмы"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Каб хутка пераключыцца паміж праграмамі, перацягніце ўправа"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Уключыць/выключыць агляд"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Зараджаны"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Зарадка"</string>
diff --git a/packages/SystemUI/res/values-be/strings_tv.xml b/packages/SystemUI/res/values-be/strings_tv.xml
index 5aa771f..410c120 100644
--- a/packages/SystemUI/res/values-be/strings_tv.xml
+++ b/packages/SystemUI/res/values-be/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Праз <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Апавяшчэнні"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Апавяшчэнняў няма"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Ідзе запіс з выкарыстаннем мікрафона"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Ідзе запіс з выкарыстаннем камеры"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Ідзе запіс з выкарыстаннем камеры і мікрафона"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Запіс з выкарыстаннем мікрафона спынены"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Запіс з выкарыстаннем камеры спынены"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Запіс з выкарыстаннем камеры і мікрафона спынены"</string>
</resources>
diff --git a/packages/SystemUI/res/values-bg/strings.xml b/packages/SystemUI/res/values-bg/strings.xml
index 015504d..8ac8dad 100644
--- a/packages/SystemUI/res/values-bg/strings.xml
+++ b/packages/SystemUI/res/values-bg/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Това действие отблокира достъпа за всички приложения и услуги, които имат разрешение да използват камерата ви."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Това действие отблокира достъпа за всички приложения и услуги, които имат разрешение да използват камерата или микрофона ви."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Устройство"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Прекарайте пръст нагоре, за да превключите между приложенията"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Плъзнете надясно за бързо превключване между приложенията"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Превключване на общия преглед"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Заредена"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Зарежда се"</string>
diff --git a/packages/SystemUI/res/values-bg/strings_tv.xml b/packages/SystemUI/res/values-bg/strings_tv.xml
index 49bf014..981ab95 100644
--- a/packages/SystemUI/res/values-bg/strings_tv.xml
+++ b/packages/SystemUI/res/values-bg/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Чрез <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Известия"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Няма известия"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Микрофонът записва"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Камерата записва"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Камерата и микрофонът записват"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Микрофонът спря да записва"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Камерата спря да записва"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Камерата и микрофонът спряха да записват"</string>
</resources>
diff --git a/packages/SystemUI/res/values-bn/strings.xml b/packages/SystemUI/res/values-bn/strings.xml
index c8a4366..eca5467 100644
--- a/packages/SystemUI/res/values-bn/strings.xml
+++ b/packages/SystemUI/res/values-bn/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"এটার জন্য ক্যামেরার অ্যাক্সেস সেই সব অ্যাপ এবং পরিষেবার জন্য আনব্লক হয়ে যাবে, যাতে আপনার ক্যামেরা ব্যবহারের অনুমতি দেওয়া হয়েছে।"</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"এটার জন্য ক্যামেরা অথবা মাইক্রোফোনের অ্যাক্সেস সেই সব অ্যাপ এবং পরিষেবার জন্য আনব্লক হয়ে যাবে, যাতে আপনার ক্যামেরা অথবা মাইক্রোফোন ব্যবহারের অনুমতি দেওয়া হয়েছে।"</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"ডিভাইস"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"অন্য অ্যাপে যেতে উপরের দিকে সোয়াইপ করুন"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"একটি অ্যাপ ছেড়ে দ্রুত অন্য অ্যাপে যেতে ডান দিকে টেনে আনুন"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"\'এক নজরে\' বৈশিষ্ট্যটি চালু বা বন্ধ করুন"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"চার্জ হয়েছে"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"চার্জ হচ্ছে"</string>
diff --git a/packages/SystemUI/res/values-bn/strings_tv.xml b/packages/SystemUI/res/values-bn/strings_tv.xml
index 5a9b456..5d252b1 100644
--- a/packages/SystemUI/res/values-bn/strings_tv.xml
+++ b/packages/SystemUI/res/values-bn/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g>-এর মাধ্যমে"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"বিজ্ঞপ্তি"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"কোনও বিজ্ঞপ্তি নেই"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"মাইক্রোফোনে রেকর্ড করা হচ্ছে"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"ক্যামেরায় রেকর্ড করা হচ্ছে"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"ক্যামেরা ও মাইক্রোফোনে রেকর্ড করা হচ্ছে"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"মাইক্রোফোনে রেকর্ড করা বন্ধ হয়ে গেছে"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"ক্যামেরায় রেকর্ড করা বন্ধ হয়ে গেছে"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"ক্যামেরা ও মাইক্রোফোনে রেকর্ড করা বন্ধ হয়ে গেছে"</string>
</resources>
diff --git a/packages/SystemUI/res/values-bs/strings.xml b/packages/SystemUI/res/values-bs/strings.xml
index 20fc2c6..3ed40e7 100644
--- a/packages/SystemUI/res/values-bs/strings.xml
+++ b/packages/SystemUI/res/values-bs/strings.xml
@@ -435,8 +435,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Ovim se deblokira pristup za sve aplikacije i usluge kojima je dozvoljeno da koriste vašu kameru."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Ovim se deblokira pristup za sve aplikacije i usluge kojima je dozvoljeno da koriste vašu kameru ili mikrofon."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Uređaj"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Prevucite prema gore za promjenu aplikacije"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Prevucite udesno za brzu promjenu aplikacija"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Pregled uključivanja/isključivanja"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Napunjeno"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Punjenje"</string>
diff --git a/packages/SystemUI/res/values-bs/strings_tv.xml b/packages/SystemUI/res/values-bs/strings_tv.xml
index 92c5e2a..341c125 100644
--- a/packages/SystemUI/res/values-bs/strings_tv.xml
+++ b/packages/SystemUI/res/values-bs/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Putem: <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Obavještenja"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nema obavještenja"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofon snima"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kamera snima"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kamera i mikrofon snimaju"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Mikrofon je prestao snimati"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Kamera je prestala snimati"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Kamera i mikrofon su prestali snimati"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ca/strings.xml b/packages/SystemUI/res/values-ca/strings.xml
index ae12615..cceb9a8 100644
--- a/packages/SystemUI/res/values-ca/strings.xml
+++ b/packages/SystemUI/res/values-ca/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Aquesta opció desbloqueja l\'accés de tots els serveis i aplicacions que tenen permís per utilitzar la càmera."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Aquesta opció desbloqueja l\'accés de tots els serveis i aplicacions que tenen permís per utilitzar la càmera o el micròfon."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Dispositiu"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Llisca cap amunt per canviar d\'aplicació"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Arrossega el dit cap a la dreta per canviar ràpidament d\'aplicació"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Activa o desactiva Aplicacions recents"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Carregada"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"S\'està carregant"</string>
diff --git a/packages/SystemUI/res/values-ca/strings_tv.xml b/packages/SystemUI/res/values-ca/strings_tv.xml
index dac4a1a..6a28c83 100644
--- a/packages/SystemUI/res/values-ca/strings_tv.xml
+++ b/packages/SystemUI/res/values-ca/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Mitjançant <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Notificacions"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Cap notificació"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"El micròfon està gravant"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"La càmera està gravant"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"La càmera i el micròfon estan gravant"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"El micròfon ha deixat de gravar"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"La càmera ha deixat de gravar"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"La càmera i el micròfon han deixat de gravar"</string>
</resources>
diff --git a/packages/SystemUI/res/values-cs/strings.xml b/packages/SystemUI/res/values-cs/strings.xml
index b4937c6..adf156d 100644
--- a/packages/SystemUI/res/values-cs/strings.xml
+++ b/packages/SystemUI/res/values-cs/strings.xml
@@ -437,8 +437,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Tímto odblokujete přístup všem aplikacím a službám, které mají povoleno používat váš fotoaparát."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Tímto odblokujete přístup všem aplikacím a službám, které mají povoleno používat váš fotoaparát či mikrofon."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Zařízení"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Přejetím nahoru přepnete aplikace"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Přetažením doprava rychle přepnete aplikace"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Přepnout přehled"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Nabito"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Nabíjení"</string>
diff --git a/packages/SystemUI/res/values-cs/strings_tv.xml b/packages/SystemUI/res/values-cs/strings_tv.xml
index e9f4a10..115c875 100644
--- a/packages/SystemUI/res/values-cs/strings_tv.xml
+++ b/packages/SystemUI/res/values-cs/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Přes <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Oznámení"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Žádná oznámení"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofon nahrává"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kamera nahrává"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kamera a mikrofon nahrávají"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Mikrofon přestal nahrávat"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Kamera přestala nahrávat"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Kamera a mikrofon přestaly nahrávat"</string>
</resources>
diff --git a/packages/SystemUI/res/values-da/strings.xml b/packages/SystemUI/res/values-da/strings.xml
index 9ee6edc..2753f65 100644
--- a/packages/SystemUI/res/values-da/strings.xml
+++ b/packages/SystemUI/res/values-da/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Dette fjerner adgangsblokeringen for alle apps og tjenester, der har tilladelse til at bruge dit kamera."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Dette fjerner adgangsblokeringen for alle apps og tjenester, der har tilladelse til at bruge dit kamera eller din mikrofon."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Enhed"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Stryg opad for at skifte apps"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Træk til højre for hurtigt at skifte app"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Slå Oversigt til/fra"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Opladet"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Oplader"</string>
diff --git a/packages/SystemUI/res/values-da/strings_tv.xml b/packages/SystemUI/res/values-da/strings_tv.xml
index 9534776..af48946 100644
--- a/packages/SystemUI/res/values-da/strings_tv.xml
+++ b/packages/SystemUI/res/values-da/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Notifikationer"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Ingen notifikationer"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofonen optager"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kameraet optager"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kameraet og mikrofonen optager"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Mikrofonen er stoppet med at optage"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Kameraet er stoppet med at optage"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Kameraet og mikrofonen er stoppet med at optage"</string>
</resources>
diff --git a/packages/SystemUI/res/values-de/strings.xml b/packages/SystemUI/res/values-de/strings.xml
index 5b31275..c4fa1d7 100644
--- a/packages/SystemUI/res/values-de/strings.xml
+++ b/packages/SystemUI/res/values-de/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Dadurch wird die Blockierung des Zugriffs für alle Apps und Dienste aufgehoben, die deine Kamera verwenden dürfen."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Dadurch wird die Blockierung des Zugriffs für alle Apps und Dienste aufgehoben, die deine Kamera oder dein Mikrofon verwenden dürfen."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Gerät"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Nach oben wischen, um Apps zu wechseln"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Zum schnellen Wechseln der Apps nach rechts ziehen"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Übersicht ein-/ausblenden"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Aufgeladen"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Wird aufgeladen"</string>
diff --git a/packages/SystemUI/res/values-de/strings_tv.xml b/packages/SystemUI/res/values-de/strings_tv.xml
index ec162ef..e8e8dcd 100644
--- a/packages/SystemUI/res/values-de/strings_tv.xml
+++ b/packages/SystemUI/res/values-de/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Über <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Benachrichtigungen"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Keine Benachrichtigungen"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofon nimmt auf"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kamera nimmt auf"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kamera und Mikrofon nehmen auf"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Aufnahme des Mikrofons gestoppt"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Aufnahme der Kamera gestoppt"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Aufnahme von Kamera und Mikrofon gestoppt"</string>
</resources>
diff --git a/packages/SystemUI/res/values-el/strings.xml b/packages/SystemUI/res/values-el/strings.xml
index 1c1e806..8cf0629 100644
--- a/packages/SystemUI/res/values-el/strings.xml
+++ b/packages/SystemUI/res/values-el/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Με αυτόν τον τρόπο καταργείται ο αποκλεισμός της πρόσβασης για όλες τις εφαρμογές και υπηρεσίες που επιτρέπεται να χρησιμοποιούν την κάμερά σας."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Με αυτόν τον τρόπο καταργείται ο αποκλεισμός της πρόσβασης για όλες τις εφαρμογές και υπηρεσίες που επιτρέπεται να χρησιμοποιούν την κάμερα ή το μικρόφωνό σας."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Συσκευή"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Σύρετε προς τα επάνω για εναλλαγή των εφαρμογών"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Σύρετε προς τα δεξιά για γρήγορη εναλλαγή εφαρμογών"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Εναλλαγή επισκόπησης"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Φορτίστηκε"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Φόρτιση"</string>
diff --git a/packages/SystemUI/res/values-el/strings_tv.xml b/packages/SystemUI/res/values-el/strings_tv.xml
index 175c402..01def2b 100644
--- a/packages/SystemUI/res/values-el/strings_tv.xml
+++ b/packages/SystemUI/res/values-el/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Μέσω <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Ειδοποιήσεις"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Δεν υπάρχουν ειδοποιήσεις."</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Πραγματοποιείται εγγραφή από το μικρόφωνο"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Πραγματοποιείται εγγραφή από την κάμερα"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Πραγματοποιείται εγγραφή από την κάμερα και το μικρόφωνο"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Η εγγραφή από το μικρόφωνο διακόπηκε"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Η εγγραφή από την κάμερα διακόπηκε"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Η εγγραφή από την κάμερα και το μικρόφωνο διακόπηκε"</string>
</resources>
diff --git a/packages/SystemUI/res/values-en-rAU/strings.xml b/packages/SystemUI/res/values-en-rAU/strings.xml
index 38630e1..9dd95c7 100644
--- a/packages/SystemUI/res/values-en-rAU/strings.xml
+++ b/packages/SystemUI/res/values-en-rAU/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"This unblocks access for all apps and services allowed to use your camera."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"This unblocks access for all apps and services allowed to use your camera or microphone."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Device"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Swipe up to switch apps"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Drag right to quickly switch apps"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Toggle Overview"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Charged"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Charging"</string>
diff --git a/packages/SystemUI/res/values-en-rCA/strings.xml b/packages/SystemUI/res/values-en-rCA/strings.xml
index 0669461..03e596d 100644
--- a/packages/SystemUI/res/values-en-rCA/strings.xml
+++ b/packages/SystemUI/res/values-en-rCA/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"This unblocks access for all apps and services allowed to use your camera."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"This unblocks access for all apps and services allowed to use your camera or microphone."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Device"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Swipe up to switch apps"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Drag right to quickly switch apps"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Toggle Overview"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Charged"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Charging"</string>
diff --git a/packages/SystemUI/res/values-en-rGB/strings.xml b/packages/SystemUI/res/values-en-rGB/strings.xml
index 38630e1..9dd95c7 100644
--- a/packages/SystemUI/res/values-en-rGB/strings.xml
+++ b/packages/SystemUI/res/values-en-rGB/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"This unblocks access for all apps and services allowed to use your camera."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"This unblocks access for all apps and services allowed to use your camera or microphone."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Device"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Swipe up to switch apps"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Drag right to quickly switch apps"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Toggle Overview"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Charged"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Charging"</string>
diff --git a/packages/SystemUI/res/values-en-rIN/strings.xml b/packages/SystemUI/res/values-en-rIN/strings.xml
index 38630e1..9dd95c7 100644
--- a/packages/SystemUI/res/values-en-rIN/strings.xml
+++ b/packages/SystemUI/res/values-en-rIN/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"This unblocks access for all apps and services allowed to use your camera."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"This unblocks access for all apps and services allowed to use your camera or microphone."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Device"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Swipe up to switch apps"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Drag right to quickly switch apps"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Toggle Overview"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Charged"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Charging"</string>
diff --git a/packages/SystemUI/res/values-en-rXC/strings.xml b/packages/SystemUI/res/values-en-rXC/strings.xml
index 5668317..1b9a302 100644
--- a/packages/SystemUI/res/values-en-rXC/strings.xml
+++ b/packages/SystemUI/res/values-en-rXC/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"This unblocks access for all apps and services allowed to use your camera."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"This unblocks access for all apps and services allowed to use your camera or microphone."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Device"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Swipe up to switch apps"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Drag right to quickly switch apps"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Toggle Overview"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Charged"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Charging"</string>
diff --git a/packages/SystemUI/res/values-es-rUS/strings.xml b/packages/SystemUI/res/values-es-rUS/strings.xml
index c04d600..f8eca13 100644
--- a/packages/SystemUI/res/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Esta acción desbloquea el acceso para todos los servicios y las apps que tengan permitido usar la cámara."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Esta acción permite que todas las aplicaciones y servicios que tengan permiso puedan usar la cámara o el micrófono."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Dispositivo"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Desliza el dedo hacia arriba para cambiar de app"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Arrastra a la derecha para cambiar aplicaciones rápidamente"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Ocultar o mostrar Recientes"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Cargada"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Cargando"</string>
@@ -536,7 +534,7 @@
<string name="quick_settings_disclosure_named_management_vpns" msgid="4046375645500668555">"Este dispositivo pertenece a <xliff:g id="ORGANIZATION_NAME">%1$s</xliff:g> y está conectado a VPN"</string>
<string name="quick_settings_disclosure_managed_profile_monitoring" msgid="1423899084754272514">"Tu organización puede controlar el tráfico de red en tu perfil de trabajo"</string>
<string name="quick_settings_disclosure_named_managed_profile_monitoring" msgid="8321469176706219860">"Es posible que <xliff:g id="ORGANIZATION_NAME">%1$s</xliff:g> controle el tráfico de red en tu perfil de trabajo"</string>
- <string name="quick_settings_disclosure_managed_profile_network_activity" msgid="2636594621387832827">"El administrador de IT puede ver la actividad de red de tu perfil de trabajo"</string>
+ <string name="quick_settings_disclosure_managed_profile_network_activity" msgid="2636594621387832827">"El administrador de TI puede ver la actividad de red de tu perfil de trabajo"</string>
<string name="quick_settings_disclosure_monitoring" msgid="8548019955631378680">"Es posible que la red esté supervisada"</string>
<string name="quick_settings_disclosure_vpns" msgid="7213546797022280246">"Este dispositivo está conectado a VPN"</string>
<string name="quick_settings_disclosure_managed_profile_named_vpn" msgid="8117568745060010789">"Tu perfil de trabajo está conectado a <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
diff --git a/packages/SystemUI/res/values-es-rUS/strings_tv.xml b/packages/SystemUI/res/values-es-rUS/strings_tv.xml
index 680e7cc..f2f0601 100644
--- a/packages/SystemUI/res/values-es-rUS/strings_tv.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"A través de <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Notificaciones"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"No hay notificaciones"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"El micrófono está grabando"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"La cámara está grabando"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"La cámara y el micrófono están grabando"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"El micrófono dejó de grabar"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"La cámara dejó de grabar"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"La cámara y el micrófono dejaron de grabar"</string>
</resources>
diff --git a/packages/SystemUI/res/values-es/strings.xml b/packages/SystemUI/res/values-es/strings.xml
index bbaf208..f2943ae 100644
--- a/packages/SystemUI/res/values-es/strings.xml
+++ b/packages/SystemUI/res/values-es/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Si lo haces, todas las aplicaciones y servicios que tengan permiso podrán usar tu cámara."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Si lo haces, todas las aplicaciones y servicios que tengan permiso podrán usar tu cámara o tu micrófono."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Dispositivo"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Desliza el dedo hacia arriba para cambiar de aplicación"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Arrastra hacia la derecha para cambiar rápidamente de aplicación"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Mostrar u ocultar aplicaciones recientes"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Cargada"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Cargando"</string>
diff --git a/packages/SystemUI/res/values-es/strings_tv.xml b/packages/SystemUI/res/values-es/strings_tv.xml
index 16154a4..cc78cf2 100644
--- a/packages/SystemUI/res/values-es/strings_tv.xml
+++ b/packages/SystemUI/res/values-es/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"A través de <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Notificaciones"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Sin notificaciones"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"El micrófono está grabando"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"La cámara está grabando"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"La cámara y el micrófono están grabando"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"El micrófono ha dejado de grabar"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"La cámara ha dejado de grabar"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"La cámara y el micrófono han dejado de grabar"</string>
</resources>
diff --git a/packages/SystemUI/res/values-et/strings.xml b/packages/SystemUI/res/values-et/strings.xml
index b23b283..a1ab2c4 100644
--- a/packages/SystemUI/res/values-et/strings.xml
+++ b/packages/SystemUI/res/values-et/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Sellega tühistatakse juurdepääsu blokeerimine kõikide rakenduste ja teenuste puhul, millel on lubatud kaamerat kasutada."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Sellega tühistatakse juurdepääsu blokeerimine kõikide rakenduste ja teenuste puhul, millel on lubatud kaamerat või mikrofoni kasutada."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Seade"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Rakenduste vahetamiseks pühkige üles"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Lohistage paremale, et rakendusi kiiresti vahetada"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Lehe Ülevaade sisse- ja väljalülitamine"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Laetud"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Laadimine"</string>
diff --git a/packages/SystemUI/res/values-et/strings_tv.xml b/packages/SystemUI/res/values-et/strings_tv.xml
index 3732020..6f020c6 100644
--- a/packages/SystemUI/res/values-et/strings_tv.xml
+++ b/packages/SystemUI/res/values-et/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Teenuse <xliff:g id="VPN_APP">%1$s</xliff:g> kaudu"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Märguanded"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Märguandeid pole"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofon salvestab"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kaamera salvestab"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kaamera ja mikrofon salvestavad"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Mikrofon peatas salvestamise"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Kaamera peatas salvestamise"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Kaamera ja mikrofon peatasid salvestamise"</string>
</resources>
diff --git a/packages/SystemUI/res/values-eu/strings.xml b/packages/SystemUI/res/values-eu/strings.xml
index 6344f62..177270a 100644
--- a/packages/SystemUI/res/values-eu/strings.xml
+++ b/packages/SystemUI/res/values-eu/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Kamera atzitzeko baimena duten aplikazio eta zerbitzu guztiek erabili ahalko dute."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Kamera edo mikrofonoa atzitzeko baimena duten aplikazio eta zerbitzu guztiek erabili ahalko dituzte."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Gailua"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Egin gora aplikazioa aldatzeko"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Arrastatu eskuinera aplikazioa azkar aldatzeko"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Aldatu ikuspegi orokorra"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Kargatuta"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Kargatzen"</string>
diff --git a/packages/SystemUI/res/values-eu/strings_tv.xml b/packages/SystemUI/res/values-eu/strings_tv.xml
index 524165e..c9c30c7 100644
--- a/packages/SystemUI/res/values-eu/strings_tv.xml
+++ b/packages/SystemUI/res/values-eu/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> bidez"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Jakinarazpenak"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Ez dago jakinarazpenik"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofonoa grabatzen ari da"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kamera grabatzen ari da"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kamera eta mikrofonoa grabatzen ari dira"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Mikrofonoak grabatzeari utzi dio"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Kamerak grabatzeari utzi dio"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Kamerak eta mikrofonoak grabatzeari utzi diote"</string>
</resources>
diff --git a/packages/SystemUI/res/values-fa/strings.xml b/packages/SystemUI/res/values-fa/strings.xml
index 6988df2..e06764d 100644
--- a/packages/SystemUI/res/values-fa/strings.xml
+++ b/packages/SystemUI/res/values-fa/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"با این کار دسترسی برای همه برنامهها و سرویسهایی که مجاز هستند از دوربینتان استفاده کنند لغو انسداد میشود."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"با این کار دسترسی برای همه برنامهها و دستگاههایی که مجاز هستند از دوربین یا میکروفونتان استفاده کنند لغو انسداد میشود."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"دستگاه"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"برای تغییر برنامهها، تند بهبالا بکشید"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"برای جابهجایی سریع میان برنامهها، به چپ بکشید"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"تغییر وضعیت نمای کلی"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"شارژ کامل شد"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"در حال شارژ شدن"</string>
diff --git a/packages/SystemUI/res/values-fa/strings_tv.xml b/packages/SystemUI/res/values-fa/strings_tv.xml
index 8038755..3ba9b4e 100644
--- a/packages/SystemUI/res/values-fa/strings_tv.xml
+++ b/packages/SystemUI/res/values-fa/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"ازطریق <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"اعلانها"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"اعلانی ندارید"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"میکروفون درحال ضبط کردن است"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"دوربین درحال ضبط کردن است"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"دوربین و میکروفون درحال ضبط کردن هستند"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"ضبط میکروفون متوقف شد"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"ضبط دوربین متوقف شد"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"ضبط دوربین و میکروفون متوقف شد"</string>
</resources>
diff --git a/packages/SystemUI/res/values-fi/strings.xml b/packages/SystemUI/res/values-fi/strings.xml
index 29304c89..548d34c 100644
--- a/packages/SystemUI/res/values-fi/strings.xml
+++ b/packages/SystemUI/res/values-fi/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Tämä kumoaa kaikkien sellaisten sovellusten ja palveluiden eston, joilla on lupa käyttää kameraasi."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Tämä kumoaa eston kaikkien sellaisten sovellusten ja palveluiden osalta, joilla on lupa käyttää kameraasi tai mikrofoniasi."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Laite"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Vaihda sovellusta pyyhkäisemällä ylös"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Vaihda sovellusta nopeasti vetämällä oikealle"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Näytä/piilota viimeisimmät"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Ladattu"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Ladataan"</string>
diff --git a/packages/SystemUI/res/values-fi/strings_tv.xml b/packages/SystemUI/res/values-fi/strings_tv.xml
index 17797d7..6312837 100644
--- a/packages/SystemUI/res/values-fi/strings_tv.xml
+++ b/packages/SystemUI/res/values-fi/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Palvelun <xliff:g id="VPN_APP">%1$s</xliff:g> kautta"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Ilmoitukset"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Ei ilmoituksia"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofoni tallentaa"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kamera kuvaa"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kamera ja mikrofoni tallentavat"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Mikrofoni lopetti tallentamisen"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Kamera lopetti kuvaamisen"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Kamera ja mikrofoni lopettivat tallentamisen"</string>
</resources>
diff --git a/packages/SystemUI/res/values-fr-rCA/strings.xml b/packages/SystemUI/res/values-fr-rCA/strings.xml
index a479e83..7f942cc 100644
--- a/packages/SystemUI/res/values-fr-rCA/strings.xml
+++ b/packages/SystemUI/res/values-fr-rCA/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Cette action débloque l\'accès pour toutes les applications et pour tous les services autorisés à utiliser l\'appareil photo."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Cette action débloque l\'accès pour toutes les applications et tous les services autorisés à utiliser l\'appareil photo ou le microphone."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Appareil"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Balayez vers le haut pour changer d\'application"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Balayez l\'écran vers la droite pour changer rapidement d\'application"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Basculer l\'aperçu"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Chargée"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Charge en cours..."</string>
diff --git a/packages/SystemUI/res/values-fr-rCA/strings_tv.xml b/packages/SystemUI/res/values-fr-rCA/strings_tv.xml
index 7f45411..0925abe 100644
--- a/packages/SystemUI/res/values-fr-rCA/strings_tv.xml
+++ b/packages/SystemUI/res/values-fr-rCA/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Par <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Notifications"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Aucune notification"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Le microphone enregistre"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"L\'appareil photo enregistre"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"L\'appareil photo et le microphone enregistrent"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Le microphone a arrêté l\'enregistrement"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"L\'appareil photo a arrêté l\'enregistrement"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"L\'appareil photo et le microphone ont arrêté l\'enregistrement"</string>
</resources>
diff --git a/packages/SystemUI/res/values-fr/strings.xml b/packages/SystemUI/res/values-fr/strings.xml
index fef652b..f540cfe 100644
--- a/packages/SystemUI/res/values-fr/strings.xml
+++ b/packages/SystemUI/res/values-fr/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Cette action débloque l\'accès à tous les services et applis autorisés à utiliser votre appareil photo."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Cette action débloque l\'accès pour tous les services et applis autorisés à utiliser votre appareil photo ou votre micro."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Appareil"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Balayer l\'écran vers le haut pour changer d\'application"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Déplacer vers la droite pour changer rapidement d\'application"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Activer/Désactiver l\'aperçu"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Chargé"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"En charge"</string>
diff --git a/packages/SystemUI/res/values-fr/strings_tv.xml b/packages/SystemUI/res/values-fr/strings_tv.xml
index 99bab80..3a33aad 100644
--- a/packages/SystemUI/res/values-fr/strings_tv.xml
+++ b/packages/SystemUI/res/values-fr/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Notifications"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Aucune notification"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Le micro enregistre…"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"La caméra enregistre…"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"La caméra et le micro enregistrent…"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Le micro a arrêté l\'enregistrement"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"La caméra a arrêté l\'enregistrement"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"La caméra et le micro ont arrêté l\'enregistrement"</string>
</resources>
diff --git a/packages/SystemUI/res/values-gl/strings.xml b/packages/SystemUI/res/values-gl/strings.xml
index 9e91ae5..9b9c4f1 100644
--- a/packages/SystemUI/res/values-gl/strings.xml
+++ b/packages/SystemUI/res/values-gl/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Con esta acción desbloquearase o acceso á cámara para todas as aplicacións e servizos que teñan permiso para utilizala."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Con esta acción desbloquearase o acceso á cámara ou ao micrófono para todas as aplicacións e servizos que teñan permiso para utilizalos."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Dispositivo"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Pasar o dedo cara arriba para cambiar de aplicación"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Arrastra cara á dereita para cambiar de aplicacións rapidamente"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Activar/desactivar Visión xeral"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Cargado"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Cargando"</string>
diff --git a/packages/SystemUI/res/values-gl/strings_tv.xml b/packages/SystemUI/res/values-gl/strings_tv.xml
index 0d35c4d..679c21d 100644
--- a/packages/SystemUI/res/values-gl/strings_tv.xml
+++ b/packages/SystemUI/res/values-gl/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"A través de <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Notificacións"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Non hai notificacións"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"O micrófono está gravando"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"A cámara está gravando"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"A cámara e o micrófono están gravando"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"O micrófono deixou de gravar"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"A cámara deixou de gravar"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"A cámara e o micrófono deixaron de gravar"</string>
</resources>
diff --git a/packages/SystemUI/res/values-gu/strings.xml b/packages/SystemUI/res/values-gu/strings.xml
index e099447..eaaf776 100644
--- a/packages/SystemUI/res/values-gu/strings.xml
+++ b/packages/SystemUI/res/values-gu/strings.xml
@@ -230,7 +230,7 @@
<string name="accessibility_battery_level" msgid="5143715405241138822">"બૅટરી <xliff:g id="NUMBER">%d</xliff:g> ટકા."</string>
<string name="accessibility_battery_level_with_estimate" msgid="4843119982547599452">"તમારા વપરાશના આધારે બૅટરી <xliff:g id="PERCENTAGE">%1$s</xliff:g> ટકા, જે લગભગ <xliff:g id="TIME">%2$s</xliff:g> સુધી ચાલે તેટલી બચી છે"</string>
<string name="accessibility_battery_level_charging" msgid="8892191177774027364">"બૅટરી ચાર્જ થઈ રહી છે, <xliff:g id="BATTERY_PERCENTAGE">%d</xliff:g>%%."</string>
- <string name="accessibility_settings_button" msgid="2197034218538913880">"સિસ્ટમ સેટિંગ્સ."</string>
+ <string name="accessibility_settings_button" msgid="2197034218538913880">"સિસ્ટમ સેટિંગ."</string>
<string name="accessibility_notifications_button" msgid="3960913924189228831">"નોટિફિકેશન."</string>
<string name="accessibility_overflow_action" msgid="8555835828182509104">"બધી સૂચના જુઓ"</string>
<string name="accessibility_remove_notification" msgid="1641455251495815527">"સૂચના સાફ કરો."</string>
@@ -245,7 +245,7 @@
<skip />
<string name="accessibility_notification_dismissed" msgid="4411652015138892952">"સૂચના કાઢી નાખી."</string>
<string name="accessibility_desc_notification_shade" msgid="5355229129428759989">"નોટિફિકેશન શેડ."</string>
- <string name="accessibility_desc_quick_settings" msgid="4374766941484719179">"ઝડપી સેટિંગ્સ."</string>
+ <string name="accessibility_desc_quick_settings" msgid="4374766941484719179">"ઝડપી સેટિંગ."</string>
<string name="accessibility_desc_lock_screen" msgid="5983125095181194887">"લૉક સ્ક્રીન."</string>
<string name="accessibility_desc_settings" msgid="6728577365389151969">"સેટિંગ"</string>
<string name="accessibility_desc_recent_apps" msgid="1748675199348914194">"ઝલક."</string>
@@ -315,7 +315,7 @@
<item quantity="other"><xliff:g id="NUMBER_1">%s</xliff:g> વધુ સૂચના અંદર છે.</item>
</plurals>
<string name="notification_summary_message_format" msgid="5158219088501909966">"<xliff:g id="CONTACT_NAME">%1$s</xliff:g>: <xliff:g id="MESSAGE_CONTENT">%2$s</xliff:g>"</string>
- <string name="status_bar_notification_inspect_item_title" msgid="6818779631806163080">"સૂચનાઓની સેટિંગ્સ"</string>
+ <string name="status_bar_notification_inspect_item_title" msgid="6818779631806163080">"નોટિફિકેશન સેટિંગ"</string>
<string name="status_bar_notification_app_settings_title" msgid="5050006438806013903">"<xliff:g id="APP_NAME">%s</xliff:g> સેટિંગ"</string>
<string name="accessibility_rotation_lock_off" msgid="3880436123632448930">"સ્ક્રીન ઑટોમૅટિક રીતે ફરશે."</string>
<string name="accessibility_rotation_lock_on_landscape" msgid="936972553861524360">"સ્ક્રીન લેન્ડસ્કેપ ઓરિએન્ટેશનમાં લૉક કરેલ છે."</string>
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"આ તમારા કૅમેરાનો ઉપયોગ કરવાની મંજૂરી ધરાવતી તમામ ઍપ અને સેવાઓ માટે ઍક્સેસને અનબ્લૉક કરે છે."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"આ તમારા કૅમેરા અથવા માઇક્રોફોનનો ઉપયોગ કરવાની મંજૂરી ધરાવતી તમામ ઍપ અને સેવાઓ માટે ઍક્સેસને અનબ્લૉક કરે છે."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"ડિવાઇસ"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"ઍપ સ્વિચ કરવા માટે ઉપરની તરફ સ્વાઇપ કરો"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"ઍપને ઝડપથી સ્વિચ કરવા માટે જમણે ખેંચો"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"ઝલકને ટૉગલ કરો"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"ચાર્જ થઈ ગયું"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"ચાર્જ થઈ રહ્યું છે"</string>
@@ -567,12 +565,12 @@
<string name="monitoring_description_personal_profile_named_vpn" msgid="8179722332380953673">"તમારી વ્યક્તિગત પ્રોફાઇલ <xliff:g id="VPN_APP">%1$s</xliff:g> સાથે કનેક્ટ કરેલ છે, જે ઇમેઇલ, ઍપ્લિકેશનો અને વેબસાઇટો સહિતની તમારી નેટવર્ક પ્રવૃત્તિનું નિયમન કરી શકે છે."</string>
<string name="monitoring_description_do_header_generic" msgid="6130190408164834986">"તમારું ડિવાઇસ <xliff:g id="DEVICE_OWNER_APP">%1$s</xliff:g> દ્વારા મેનેજ થાય છે."</string>
<string name="monitoring_description_do_header_with_name" msgid="2696255132542779511">"<xliff:g id="ORGANIZATION_NAME">%1$s</xliff:g>, તમારા ઉપકરણનું સંચાલન કરવા માટે <xliff:g id="DEVICE_OWNER_APP">%2$s</xliff:g> નો ઉપયોગ કરે છે."</string>
- <string name="monitoring_description_do_body" msgid="7700878065625769970">"વ્યવસ્થાપક સેટિંગ્સ, કૉર્પોરેટ ઍક્સેસ, ઍપ્સ, તમારા ઉપકરણ સંબંદ્ધ ડેટા અને ઉપકરણની સ્થાન માહિતીનું નિરીક્ષણ અને સંચાલન કરી શકે છે."</string>
+ <string name="monitoring_description_do_body" msgid="7700878065625769970">"વ્યવસ્થાપક સેટિંગ, કૉર્પોરેટ ઍક્સેસ, ઍપ, તમારા ડિવાઇસ સંબંધિત ડેટા અને ડિવાઇસની સ્થાન માહિતીને મૉનિટર અને મેનેજ કરી શકે છે."</string>
<string name="monitoring_description_do_learn_more_separator" msgid="1467280496376492558">" "</string>
<string name="monitoring_description_do_learn_more" msgid="645149183455573790">"વધુ જાણો"</string>
<string name="monitoring_description_do_body_vpn" msgid="7699280130070502303">"તમે <xliff:g id="VPN_APP">%1$s</xliff:g> સાથે કનેક્ટ થયાં છો, જે ઇમેઇલ્સ, ઍપ્લિકેશનો અને વેબસાઇટ્સ સહિત તમારી નેટવર્ક પ્રવૃત્તિને મૉનિટર કરી શકે છે."</string>
<string name="monitoring_description_vpn_settings_separator" msgid="8292589617720435430">" "</string>
- <string name="monitoring_description_vpn_settings" msgid="5264167033247632071">"VPNની સેટિંગ્સ ખોલો"</string>
+ <string name="monitoring_description_vpn_settings" msgid="5264167033247632071">"VPN સેટિંગ ખોલો"</string>
<string name="monitoring_description_ca_cert_settings_separator" msgid="7107390013344435439">" "</string>
<string name="monitoring_description_ca_cert_settings" msgid="8329781950135541003">"વિશ્વસનીય ઓળખપત્ર ખોલો"</string>
<string name="monitoring_description_network_logging" msgid="577305979174002252">"તમારા વ્યવસ્થાપકે નેટવર્ક લૉગિંગ ચાલુ કર્યુ છે, જે તમારા ઉપકરણ પર ટ્રાફિકનું નિરીક્ષણ કરે છે.\n\nવધુ માહિતી માટે, તમારા વ્યવસ્થાપકનો સંપર્ક કરો."</string>
@@ -619,7 +617,7 @@
<string name="screen_pinning_start" msgid="7483998671383371313">"ઍપ પિન કરી"</string>
<string name="screen_pinning_exit" msgid="4553787518387346893">"ઍપ અનપિન કરી"</string>
<string name="quick_settings_reset_confirmation_title" msgid="463533331480997595">"<xliff:g id="TILE_LABEL">%1$s</xliff:g> ને છુપાવીએ?"</string>
- <string name="quick_settings_reset_confirmation_message" msgid="2320586180785674186">"તે સેટિંગ્સમાં તમે તેને ચાલુ કરશો ત્યારે આગલી વખતે ફરીથી દેખાશે."</string>
+ <string name="quick_settings_reset_confirmation_message" msgid="2320586180785674186">"તે સેટિંગમાં તમે તેને ચાલુ કરશો ત્યારે આગલી વખતે ફરીથી દેખાશે."</string>
<string name="quick_settings_reset_confirmation_button" msgid="3341477479055016776">"છુપાવો"</string>
<string name="stream_voice_call" msgid="7468348170702375660">"કૉલ કરો"</string>
<string name="stream_system" msgid="7663148785370565134">"સિસ્ટમ"</string>
@@ -657,7 +655,7 @@
<string name="system_ui_tuner" msgid="1471348823289954729">"સિસ્ટમ UI ટ્યૂનર"</string>
<string name="show_battery_percentage" msgid="6235377891802910455">"એમ્બેડ કરેલ બૅટરી ટકા બતાવો"</string>
<string name="show_battery_percentage_summary" msgid="9053024758304102915">"જ્યારે ચાર્જ ન થઈ રહ્યું હોય ત્યારે સ્ટેટસ બાર આયકનની અંદર બૅટરી સ્તર ટકા બતાવો"</string>
- <string name="quick_settings" msgid="6211774484997470203">"ઝડપી સેટિંગ્સ"</string>
+ <string name="quick_settings" msgid="6211774484997470203">"ઝડપી સેટિંગ"</string>
<string name="status_bar" msgid="4357390266055077437">"સ્ટેટસ બાર"</string>
<string name="overview" msgid="3522318590458536816">"ઝલક"</string>
<string name="demo_mode" msgid="263484519766901593">"સિસ્ટમ UI ડેમો મોડ"</string>
@@ -682,21 +680,21 @@
<string name="zen_alarm_warning" msgid="7844303238486849503">"તમે <xliff:g id="WHEN">%1$s</xliff:g> એ તમારો આગલો એલાર્મ સાંભળશો નહીં"</string>
<string name="alarm_template" msgid="2234991538018805736">"<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>
- <string name="accessibility_quick_settings_detail" msgid="544463655956179791">"ઝડપી સેટિંગ્સ, <xliff:g id="TITLE">%s</xliff:g>."</string>
+ <string name="accessibility_quick_settings_detail" msgid="544463655956179791">"ઝડપી સેટિંગ, <xliff:g id="TITLE">%s</xliff:g>."</string>
<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">"સિસ્ટમ UI ટ્યૂનર તમને Android વપરાશકર્તા ઇન્ટરફેસને ટ્વીક અને કસ્ટમાઇઝ કરવાની વધારાની રીતો આપે છે. ભાવિ રીલિઝેસમાં આ પ્રાયોગિક સુવિધાઓ બદલાઈ, ભંગ અથવા અદૃશ્ય થઈ શકે છે. સાવધાની સાથે આગળ વધો."</string>
<string name="tuner_persistent_warning" msgid="230466285569307806">"ભાવિ રીલિઝેસમાં આ પ્રાયોગિક સુવિધાઓ બદલાઈ, ભંગ અથવા અદૃશ્ય થઈ શકે છે. સાવધાની સાથે આગળ વધો."</string>
<string name="got_it" msgid="477119182261892069">"સમજાઈ ગયું"</string>
- <string name="tuner_toast" msgid="3812684836514766951">"અભિનંદન! સિસ્ટમ UI ટ્યૂનરને સેટિંગ્સમાં ઉમેરવામાં આવ્યું છે"</string>
- <string name="remove_from_settings" msgid="633775561782209994">"સેટિંગ્સમાંથી દૂર કરો"</string>
- <string name="remove_from_settings_prompt" msgid="551565437265615426">"સેટિંગ્સમાંથી સિસ્ટમ UI ટ્યૂનર દૂર કરી અને તેની તમામ સુવિધાઓનો ઉપયોગ કરવાનું બંધ કરીએ?"</string>
+ <string name="tuner_toast" msgid="3812684836514766951">"અભિનંદન! સિસ્ટમ UI ટ્યૂનરને સેટિંગમાં ઉમેરવામાં આવ્યું છે"</string>
+ <string name="remove_from_settings" msgid="633775561782209994">"સેટિંગમાંથી કાઢી નાખો"</string>
+ <string name="remove_from_settings_prompt" msgid="551565437265615426">"સેટિંગમાંથી સિસ્ટમ UI ટ્યૂનર કાઢી નાખી અને તેની તમામ સુવિધાઓનો ઉપયોગ કરવાનું બંધ કરીએ?"</string>
<string name="activity_not_found" msgid="8711661533828200293">"તમારા ઉપકરણ પર ઍપ્લિકેશન ઇન્સ્ટોલ થયેલ નથી"</string>
<string name="clock_seconds" msgid="8709189470828542071">"ઘડિયાળ સેકન્ડ બતાવો"</string>
<string name="clock_seconds_desc" msgid="2415312788902144817">"ઘડિયાળ સેકન્ડ સ્થિતિ બારમાં બતાવો. બૅટરીની આવરદા પર અસર કરી શકે છે."</string>
- <string name="qs_rearrange" msgid="484816665478662911">"ઝડપી સેટિંગ્સને ફરીથી ગોઠવો"</string>
- <string name="show_brightness" msgid="6700267491672470007">"ઝડપી સેટિંગ્સમાં તેજ બતાવો"</string>
+ <string name="qs_rearrange" msgid="484816665478662911">"ઝડપી સેટિંગને ફરીથી ગોઠવો"</string>
+ <string name="show_brightness" msgid="6700267491672470007">"ઝડપી સેટિંગમાં બ્રાઇટનેસ બતાવો"</string>
<string name="experimental" msgid="3549865454812314826">"પ્રાયોગિક"</string>
<string name="enable_bluetooth_title" msgid="866883307336662596">"બ્લૂટૂથ ચાલુ કરવુ છે?"</string>
<string name="enable_bluetooth_message" msgid="6740938333772779717">"તમારા ટેબ્લેટ સાથે કીબોર્ડ કનેક્ટ કરવા માટે, તમારે પહેલાં બ્લૂટૂથ ચાલુ કરવાની જરૂર પડશે."</string>
@@ -918,19 +916,19 @@
<string name="accessibility_qs_edit_position" msgid="4509277359815711830">"જગ્યા <xliff:g id="POSITION">%1$d</xliff:g>"</string>
<string name="accessibility_qs_edit_tile_added" msgid="9067146040380836334">"ટાઇલ ઉમેરી"</string>
<string name="accessibility_qs_edit_tile_removed" msgid="1175925632436612036">"ટાઇલ કાઢી નાખી"</string>
- <string name="accessibility_desc_quick_settings_edit" msgid="741658939453595297">"ઝડપી સેટિંગ્સ સંપાદક."</string>
+ <string name="accessibility_desc_quick_settings_edit" msgid="741658939453595297">"ઝડપી સેટિંગ એડિટર."</string>
<string name="accessibility_desc_notification_icon" msgid="7331265967584178674">"<xliff:g id="ID_1">%1$s</xliff:g> નોટિફિકેશન: <xliff:g id="ID_2">%2$s</xliff:g>"</string>
- <string name="accessibility_quick_settings_settings" msgid="7098489591715844713">"સેટિંગ્સ ખોલો."</string>
- <string name="accessibility_quick_settings_expand" msgid="2609275052412521467">"ઝડપી સેટિંગ્સ ખોલો."</string>
- <string name="accessibility_quick_settings_collapse" msgid="4674876336725041982">"ઝડપી સેટિંગ્સ બંધ કરો."</string>
+ <string name="accessibility_quick_settings_settings" msgid="7098489591715844713">"સેટિંગ ખોલો."</string>
+ <string name="accessibility_quick_settings_expand" msgid="2609275052412521467">"ઝડપી સેટિંગ ખોલો."</string>
+ <string name="accessibility_quick_settings_collapse" msgid="4674876336725041982">"ઝડપી સેટિંગ બંધ કરો."</string>
<string name="accessibility_quick_settings_alarm_set" msgid="7237918261045099853">"એલાર્મ સેટ કર્યો."</string>
<string name="accessibility_quick_settings_user" msgid="505821942882668619">"<xliff:g id="ID_1">%s</xliff:g> તરીકે સાઇન ઇન કર્યું"</string>
<string name="accessibility_quick_settings_choose_user_action" msgid="4554388498186576087">"વપરાશકર્તા પસંદ કરો"</string>
<string name="data_connection_no_internet" msgid="691058178914184544">"કોઈ ઇન્ટરનેટ નથી"</string>
<string name="accessibility_quick_settings_open_details" msgid="4879279912389052142">"વિગતો ખોલો."</string>
<string name="accessibility_quick_settings_not_available" msgid="6860875849497473854">"<xliff:g id="REASON">%s</xliff:g>ને કારણે અનુપલબ્ધ છે"</string>
- <string name="accessibility_quick_settings_open_settings" msgid="536838345505030893">"<xliff:g id="ID_1">%s</xliff:g> સેટિંગ્સ ખોલો."</string>
- <string name="accessibility_quick_settings_edit" msgid="1523745183383815910">"સેટિંગ્સનો ક્રમ સંપાદિત કરો."</string>
+ <string name="accessibility_quick_settings_open_settings" msgid="536838345505030893">"<xliff:g id="ID_1">%s</xliff:g> સેટિંગ ખોલો."</string>
+ <string name="accessibility_quick_settings_edit" msgid="1523745183383815910">"સેટિંગના ક્રમમાં ફેરફાર કરો."</string>
<string name="accessibility_quick_settings_power_menu" msgid="6820426108301758412">"પાવર મેનૂ"</string>
<string name="accessibility_quick_settings_page" msgid="7506322631645550961">"<xliff:g id="ID_2">%2$d</xliff:g> માંથી <xliff:g id="ID_1">%1$d</xliff:g> પૃષ્ઠ"</string>
<string name="tuner_lock_screen" msgid="2267383813241144544">"લૉક સ્ક્રીન"</string>
@@ -988,7 +986,7 @@
<string name="mobile_data_disable_title" msgid="5366476131671617790">"મોબાઇલ ડેટા બંધ કરીએ?"</string>
<string name="mobile_data_disable_message" msgid="8604966027899770415">"તમને <xliff:g id="CARRIER">%s</xliff:g> મારફતે ડેટા અથવા ઇન્ટરનેટનો ઍક્સેસ મળશે નહીં. ઇન્ટરનેટ માત્ર વાઇ-ફાઇ દ્વારા ઉપલબ્ધ થશે."</string>
<string name="mobile_data_disable_message_default_carrier" msgid="6496033312431658238">"તમારા કૅરિઅર"</string>
- <string name="touch_filtered_warning" msgid="8119511393338714836">"એક ઍપ પરવાનગી વિનંતીને અસ્પષ્ટ કરતી હોવાને કારણે, સેટિંગ્સ તમારા પ્રતિસાદને ચકાસી શકતી નથી."</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_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>
diff --git a/packages/SystemUI/res/values-hi/strings.xml b/packages/SystemUI/res/values-hi/strings.xml
index fde2a39..c9636c2 100644
--- a/packages/SystemUI/res/values-hi/strings.xml
+++ b/packages/SystemUI/res/values-hi/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"ऐसा करने से, कैमरे का ऐक्सेस उन सभी ऐप्लिकेशन और सेवाओं के लिए अनब्लॉक हो जाएगा जिन्हें कैमरे का इस्तेमाल करने की अनुमति दी गई है."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"ऐसा करने से, कैमरा या माइक्रोफ़ोन का ऐक्सेस उन सभी ऐप्लिकेशन और सेवाओं के लिए अनब्लॉक हो जाएगा जिन्हें ये इस्तेमाल करने की अनुमति है."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"डिवाइस"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"ऐप्लिकेशन बदलने के लिए ऊपर स्वाइप करें"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"ऐप्लिकेशन को झटपट स्विच करने के लिए उसे दाईं ओर खींचें और छोड़ें"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"खास जानकारी टॉगल करें"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"चार्ज हो गई है"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"चार्ज हो रही है"</string>
diff --git a/packages/SystemUI/res/values-hi/strings_tv.xml b/packages/SystemUI/res/values-hi/strings_tv.xml
index eb8f150..1135ecb 100644
--- a/packages/SystemUI/res/values-hi/strings_tv.xml
+++ b/packages/SystemUI/res/values-hi/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> के ज़रिए"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"सूचनाएं"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"कोई सूचना नहीं है"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"माइक्रोफ़ोन आवाज़ रिकॉर्ड कर रहा है"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"कैमरा वीडियो रिकॉर्ड कर रहा है"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"कैमरा और माइक्रोफ़ोन वीडियो रिकॉर्ड कर रहे हैं"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"माइक्रोफ़ोन ने आवाज़ रिकॉर्ड करना बंद कर दिया है"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"कैमरे ने वीडियो रिकॉर्ड करना बंद कर दिया है"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"कैमरे और माइक्रोफ़ोन ने वीडियो रिकॉर्ड करना बंद कर दिया है"</string>
</resources>
diff --git a/packages/SystemUI/res/values-hr/strings.xml b/packages/SystemUI/res/values-hr/strings.xml
index bbba1a8..e341049 100644
--- a/packages/SystemUI/res/values-hr/strings.xml
+++ b/packages/SystemUI/res/values-hr/strings.xml
@@ -435,8 +435,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Time se deblokira pristup za sve aplikacije i usluge kojima je dopuštena upotreba vašeg fotoaparata."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Time se deblokira pristup za sve aplikacije i usluge kojima je dopuštena upotreba vašeg fotoaparata ili mikrofona."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Uređaj"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Prijeđite prstom prema gore da biste promijenili aplikaciju"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Povucite udesno da biste brzo promijenili aplikaciju"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Uključivanje/isključivanje pregleda"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Napunjeno"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Punjenje"</string>
diff --git a/packages/SystemUI/res/values-hr/strings_tv.xml b/packages/SystemUI/res/values-hr/strings_tv.xml
index 241195b..633847c 100644
--- a/packages/SystemUI/res/values-hr/strings_tv.xml
+++ b/packages/SystemUI/res/values-hr/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Putem mreže <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Obavijesti"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nema obavijesti"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofon snima"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kamera snima"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kamera i mikrofon snimaju"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Mikrofon je prestao snimati"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Kamera je prestala snimati"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Kamera i mikrofon prestali su snimati"</string>
</resources>
diff --git a/packages/SystemUI/res/values-hu/strings.xml b/packages/SystemUI/res/values-hu/strings.xml
index 7eb5ec1..02eb298 100644
--- a/packages/SystemUI/res/values-hu/strings.xml
+++ b/packages/SystemUI/res/values-hu/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Ezzel feloldja a hozzáférés letiltását az összes olyan alkalmazás és szolgáltatás esetében, amelyek számára engedélyezte a kamera használatát."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Ezzel feloldja a hozzáférés letiltását az összes olyan alkalmazás és szolgáltatás esetében, amelyek számára engedélyezte a kamera vagy a mikrofon használatát."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Eszköz"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Váltás az alkalmazások között felfelé csúsztatással"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Húzza jobbra az ujját az alkalmazások közötti gyors váltáshoz"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Áttekintés be- és kikapcsolása"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Feltöltve"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Töltés"</string>
diff --git a/packages/SystemUI/res/values-hu/strings_tv.xml b/packages/SystemUI/res/values-hu/strings_tv.xml
index e825584..97c375a 100644
--- a/packages/SystemUI/res/values-hu/strings_tv.xml
+++ b/packages/SystemUI/res/values-hu/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Ezzel: <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Értesítések"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nincs értesítés"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"A mikrofon felvételt készít…"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"A kamera felvételt készít…"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"A kamera és a mikrofon felvételt készít…"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"A mikrofon befejezte a felvételkészítést"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"A kamera befejezte a felvételkészítést"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"A kamera és a mikrofon befejezte a felvételkészítést"</string>
</resources>
diff --git a/packages/SystemUI/res/values-hy/strings.xml b/packages/SystemUI/res/values-hy/strings.xml
index 95b2d6a..c3a3bb8 100644
--- a/packages/SystemUI/res/values-hy/strings.xml
+++ b/packages/SystemUI/res/values-hy/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Սա բացում է մուտքը բոլոր հավելվածների և ծառայությունների համար, որոնք ունեն ձեր տեսախցիկն օգտագործելու թույլտվություն։"</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Սա բացում է մուտքը բոլոր հավելվածների և ծառայությունների համար, որոնք ունեն ձեր տեսախցիկը կամ խոսափողն օգտագործելու թույլտվություն։"</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Սարք"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Սահեցրեք վերև՝ մյուս հավելվածին անցնելու համար"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Քաշեք աջ՝ հավելվածների միջև անցնելու համար"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Միացնել/անջատել համատեսքը"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Լիցքավորված է"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Լիցքավորվում է"</string>
diff --git a/packages/SystemUI/res/values-hy/strings_tv.xml b/packages/SystemUI/res/values-hy/strings_tv.xml
index 0fab090..3f46b90 100644
--- a/packages/SystemUI/res/values-hy/strings_tv.xml
+++ b/packages/SystemUI/res/values-hy/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g>-ի միջոցով"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Ծանուցումներ"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Ծանուցումներ չկան"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Խոսափողը ձայնագրում է"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Տեսախցիկը տեսագրում է"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Տեսախցիկն ու խոսափողը տեսաձայնագրում են"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Խոսափողն այլևս չի ձայնագրում"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Տեսախցիկն այլևս չի տեսագրում"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Տեսախցիկն ու խոսափողը այլևս չեն տեսաձայնագրում"</string>
</resources>
diff --git a/packages/SystemUI/res/values-in/strings.xml b/packages/SystemUI/res/values-in/strings.xml
index 193628a..0444ee4 100644
--- a/packages/SystemUI/res/values-in/strings.xml
+++ b/packages/SystemUI/res/values-in/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Ini akan berhenti memblokir akses untuk semua aplikasi dan layanan yang diizinkan menggunakan kamera."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Langkah ini akan berhenti memblokir akses untuk semua aplikasi dan layanan yang diizinkan menggunakan kamera atau mikrofon."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Perangkat"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Geser ke atas untuk beralih aplikasi"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Tarik ke kanan untuk beralih aplikasi dengan cepat"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Aktifkan Ringkasan"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Terisi penuh"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Mengisi daya"</string>
diff --git a/packages/SystemUI/res/values-in/strings_tv.xml b/packages/SystemUI/res/values-in/strings_tv.xml
index c787ca2..d58cdc8 100644
--- a/packages/SystemUI/res/values-in/strings_tv.xml
+++ b/packages/SystemUI/res/values-in/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Melalui <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Notifikasi"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Tidak Ada Notifikasi"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofon sedang merekam"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kamera sedang merekam"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kamera dan Mikrofon sedang merekam"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Mikrofon berhenti merekam"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Kamera berhenti merekam"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Kamera dan Mikrofon berhenti merekam"</string>
</resources>
diff --git a/packages/SystemUI/res/values-is/strings.xml b/packages/SystemUI/res/values-is/strings.xml
index dbc7c05..b57b93a 100644
--- a/packages/SystemUI/res/values-is/strings.xml
+++ b/packages/SystemUI/res/values-is/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Þetta veitir öllum forritum og þjónustum aðgang að myndavélinni þinni."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Þetta veitir öllum forritum og þjónustum aðgang að myndavélinni og hljóðnemanum þínum."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Tæki"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Strjúktu upp til að skipta á milli forrita"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Dragðu til hægri til að skipta hratt á milli forrita"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Kveikja/slökkva á yfirliti"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Fullhlaðin"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Í hleðslu"</string>
diff --git a/packages/SystemUI/res/values-is/strings_tv.xml b/packages/SystemUI/res/values-is/strings_tv.xml
index 6d7c91c..eb0f450 100644
--- a/packages/SystemUI/res/values-is/strings_tv.xml
+++ b/packages/SystemUI/res/values-is/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Í gegnum <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Tilkynningar"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Engar tilkynningar"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Hljóðnemi er að taka upp"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Myndavél er að taka upp"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Myndavél og hljóðnemi eru að taka upp"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Hljóðnemi er hættur að taka upp"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Myndavél er hætt að taka upp"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Myndavél og hljóðnemi eru hætt að taka upp"</string>
</resources>
diff --git a/packages/SystemUI/res/values-it/strings.xml b/packages/SystemUI/res/values-it/strings.xml
index 6f160b9..270c214 100644
--- a/packages/SystemUI/res/values-it/strings.xml
+++ b/packages/SystemUI/res/values-it/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Viene sbloccato l\'accesso per tutti i servizi e le app autorizzati a usare la fotocamera."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Viene sbloccato l\'accesso per tutti i servizi e le app autorizzati a usare la fotocamera o il microfono."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Dispositivo"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Scorri verso l\'alto per passare ad altre app"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Trascina verso destra per cambiare velocemente app"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Attiva/disattiva la panoramica"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Carica"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"In carica"</string>
diff --git a/packages/SystemUI/res/values-it/strings_tv.xml b/packages/SystemUI/res/values-it/strings_tv.xml
index c676029..45d3369 100644
--- a/packages/SystemUI/res/values-it/strings_tv.xml
+++ b/packages/SystemUI/res/values-it/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Tramite <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Notifiche"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nessuna notifica"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Registrazione in corso con il microfono"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Registrazione in corso con la fotocamera"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Registrazione in corso con fotocamera e microfono"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Registrazione con il microfono interrotta"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Registrazione con la fotocamera interrotta"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Registrazione con fotocamera e microfono interrotta"</string>
</resources>
diff --git a/packages/SystemUI/res/values-iw/strings.xml b/packages/SystemUI/res/values-iw/strings.xml
index 9dccc98..899aca2 100644
--- a/packages/SystemUI/res/values-iw/strings.xml
+++ b/packages/SystemUI/res/values-iw/strings.xml
@@ -437,8 +437,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"הפעולה הזו מבטלת את חסימת הגישה של כל האפליקציות והשירותים שמורשים להשתמש במצלמה."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"הפעולה הזו מבטלת את חסימת הגישה של כל האפליקציות והשירותים שמורשים להשתמש במצלמה או במיקרופון."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"מכשיר"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"יש להחליק מעלה כדי להחליף אפליקציות"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"יש לגרור ימינה כדי לעבור במהירות בין אפליקציות"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"החלפת מצב של מסכים אחרונים"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"הסוללה טעונה"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"בטעינה"</string>
diff --git a/packages/SystemUI/res/values-iw/strings_tv.xml b/packages/SystemUI/res/values-iw/strings_tv.xml
index 46e61d0..5c091d3 100644
--- a/packages/SystemUI/res/values-iw/strings_tv.xml
+++ b/packages/SystemUI/res/values-iw/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"דרך <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"התראות"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"אין התראות"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"המיקרופון מקליט"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"המצלמה מקליטה"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"המצלמה והמיקרופון מקליטים"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"המיקרופון הפסיק להקליט"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"המצלמה הפסיקה להקליט"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"המצלמה והמיקרופון הפסיקו להקליט"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ja/strings.xml b/packages/SystemUI/res/values-ja/strings.xml
index 1e8020f..e67841d 100644
--- a/packages/SystemUI/res/values-ja/strings.xml
+++ b/packages/SystemUI/res/values-ja/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"カメラの使用が許可されているすべてのアプリとサービスでアクセスのブロックが解除されます。"</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"カメラやマイクの使用が許可されているすべてのアプリとサービスでアクセスのブロックが解除されます。"</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"デバイス"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"アプリを切り替えるには上にスワイプ"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"右にドラッグするとアプリを素早く切り替えることができます"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"概要を切り替え"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"充電が完了しました"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"充電しています"</string>
diff --git a/packages/SystemUI/res/values-ja/strings_tv.xml b/packages/SystemUI/res/values-ja/strings_tv.xml
index 798caec..c37958f 100644
--- a/packages/SystemUI/res/values-ja/strings_tv.xml
+++ b/packages/SystemUI/res/values-ja/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> 経由"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"通知"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"通知はありません"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"マイクで録音しています"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"カメラで録画しています"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"カメラとマイクで録画、録音しています"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"マイクが録音を停止しました"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"カメラが録画を停止しました"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"カメラとマイクが録画、録音を停止しました"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ka/strings.xml b/packages/SystemUI/res/values-ka/strings.xml
index 8177464..65813c6 100644
--- a/packages/SystemUI/res/values-ka/strings.xml
+++ b/packages/SystemUI/res/values-ka/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"ამ მოქმედების მეშვეობით განიბლოკება ყველა აპსა და მომსახურებაზე წვდომა, რომელთაც აქვთ თქვენი კამერის გამოყენების უფლება."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"ამ მოქმედების მეშვეობით განიბლოკება ყველა აპსა და მომსახურებაზე წვდომა, რომელთაც აქვთ თქვენი კამერის ან მიკროფონის გამოყენების უფლება."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"მოწყობილობა"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"გადაფურცლეთ ზემოთ აპების გადასართავად"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"აპების სწრაფად გადასართავად ჩავლებით გადაიტანეთ მარჯვნივ"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"მიმოხილვის გადართვა"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"დატენილია"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"მიმდინარეობს დატენვა"</string>
diff --git a/packages/SystemUI/res/values-ka/strings_tv.xml b/packages/SystemUI/res/values-ka/strings_tv.xml
index b158e5c..8db4b1b 100644
--- a/packages/SystemUI/res/values-ka/strings_tv.xml
+++ b/packages/SystemUI/res/values-ka/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g>-ის მიერ"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"შეტყობინებები"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"შეტყობინებები არ არის"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"მიკროფონი იწერს"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"კამერა იწერს"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"კამერა და მიკროფონი იწერს"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"მიკროფონმა ჩაწერა შეწყვიტა"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"კამერამ ჩაწერა შეწყვიტა"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"კამერამ და მიკროფონმა ჩაწერა შეწყვიტა"</string>
</resources>
diff --git a/packages/SystemUI/res/values-kk/strings.xml b/packages/SystemUI/res/values-kk/strings.xml
index 983e4b8..c902051 100644
--- a/packages/SystemUI/res/values-kk/strings.xml
+++ b/packages/SystemUI/res/values-kk/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Камераңызды пайдалануға рұқсат берілген барлық қолданба мен қызметтің бөгеуі алынады."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Камераңызды немесе микрофоныңызды пайдалануға рұқсат берілген барлық қолданба мен қызметтің бөгеуі алынады."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Құрылғы"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Қолданбалар арасында ауысу үшін жоғары сырғытыңыз"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Қолданбаларды жылдам ауыстырып қосу үшін оңға қарай сүйреңіз"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Шолуды қосу/өшіру"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Зарядталды"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Зарядталуда"</string>
diff --git a/packages/SystemUI/res/values-kk/strings_tv.xml b/packages/SystemUI/res/values-kk/strings_tv.xml
index 36440c9..a56b4aa 100644
--- a/packages/SystemUI/res/values-kk/strings_tv.xml
+++ b/packages/SystemUI/res/values-kk/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> арқылы жалғанған"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Хабарландырулар"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Хабарландырулар жоқ"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Микрофон жазып жатыр."</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Камера жазып жатыр."</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Камера мен микрофон жазып жатыр."</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Микрофон жазуды тоқтатты."</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Камера жазуды тоқтатты."</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Камера мен микрофон жазуды тоқтатты."</string>
</resources>
diff --git a/packages/SystemUI/res/values-km/strings.xml b/packages/SystemUI/res/values-km/strings.xml
index 183712b..299187d 100644
--- a/packages/SystemUI/res/values-km/strings.xml
+++ b/packages/SystemUI/res/values-km/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"ការធ្វើបែបនេះនឹងឈប់ទប់ស្កាត់ការចូលប្រើសម្រាប់កម្មវិធី និងសេវាកម្មទាំងអស់ ដែលត្រូវបានអនុញ្ញាតឱ្យប្រើកាមេរ៉ារបស់អ្នក។"</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"ការធ្វើបែបនេះនឹងឈប់ទប់ស្កាត់ការចូលប្រើសម្រាប់កម្មវិធី និងសេវាកម្មទាំងអស់ ដែលត្រូវបានអនុញ្ញាតឱ្យប្រើកាមេរ៉ា ឬមីក្រូហ្វូនរបស់អ្នក។"</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"ឧបករណ៍"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"អូសឡើងលើដើម្បីប្តូរកម្មវិធី"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"អូសទៅស្ដាំដើម្បីប្ដូរកម្មវិធីបានរហ័ស"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"បិទ/បើកទិដ្ឋភាពរួម"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"បានសាកថ្មពេញ"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"កំពុងសាកថ្ម"</string>
diff --git a/packages/SystemUI/res/values-km/strings_tv.xml b/packages/SystemUI/res/values-km/strings_tv.xml
index b04cc2b..c654e6d 100644
--- a/packages/SystemUI/res/values-km/strings_tv.xml
+++ b/packages/SystemUI/res/values-km/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"តាមរយៈ <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"ការជូនដំណឹង"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"គ្មានការជូនដំណឹងទេ"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"មីក្រូហ្វូនកំពុងថត"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"កាមេរ៉ាកំពុងថត"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"កាមេរ៉ា និងមីក្រូហ្វូនកំពុងថត"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"មីក្រូហ្វូនបានឈប់ថត"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"កាមេរ៉ាបានឈប់ថត"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"កាមេរ៉ា និងមីក្រូហ្វូនបានឈប់ថត"</string>
</resources>
diff --git a/packages/SystemUI/res/values-kn/strings.xml b/packages/SystemUI/res/values-kn/strings.xml
index e48c842..aadf662 100644
--- a/packages/SystemUI/res/values-kn/strings.xml
+++ b/packages/SystemUI/res/values-kn/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"ಇದು ಎಲ್ಲಾ ಆ್ಯಪ್ಗಳಿಗೆ ಹಾಗೂ ಸೇವೆಗಳಿಗೆ ನಿಮ್ಮ ಕ್ಯಾಮರಾವನ್ನು ಬಳಸುವುದಕ್ಕಾಗಿ ಇರುವ ಪ್ರವೇಶದ ನಿರ್ಬಂಧವನ್ನು ತೆಗೆದುಹಾಕುತ್ತದೆ."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"ಇದು ಎಲ್ಲಾ ಆ್ಯಪ್ಗಳಿಗೆ ಹಾಗೂ ಸೇವೆಗಳಿಗೆ ನಿಮ್ಮ ಕ್ಯಾಮರಾ ಅಥವಾ ಮೈಕ್ರೋಫೋನ್ ಬಳಸುವುದಕ್ಕಾಗಿ ಇರುವ ಪ್ರವೇಶದ ನಿರ್ಬಂಧವನ್ನು ತೆಗೆದುಹಾಕುತ್ತದೆ."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"ಸಾಧನ"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"ಅಪ್ಲಿಕೇಶನ್ಗಳನ್ನು ಬದಲಾಯಿಸಲು ಸ್ವೈಪ್ ಮಾಡಿ"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"ಅಪ್ಲಿಕೇಶನ್ಗಳನ್ನು ಬದಲಿಸಲು ತ್ವರಿತವಾಗಿ ಬಲಕ್ಕೆ ಡ್ರ್ಯಾಗ್ ಮಾಡಿ"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"ಟಾಗಲ್ ನ ಅವಲೋಕನ"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"ಚಾರ್ಜ್ ಆಗಿದೆ"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"ಚಾರ್ಜ್ ಆಗುತ್ತಿದೆ"</string>
diff --git a/packages/SystemUI/res/values-kn/strings_tv.xml b/packages/SystemUI/res/values-kn/strings_tv.xml
index e4b3314..3955a09 100644
--- a/packages/SystemUI/res/values-kn/strings_tv.xml
+++ b/packages/SystemUI/res/values-kn/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> ಮೂಲಕ"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"ಅಧಿಸೂಚನೆಗಳು"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"ಯಾವುದೇ ಅಧಿಸೂಚನೆಗಳಿಲ್ಲ"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"ಮೈಕ್ರೊಫೋನ್ ರೆಕಾರ್ಡಿಂಗ್ ಆಗುತ್ತಿದೆ"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"ಕ್ಯಾಮರಾ ರೆಕಾರ್ಡಿಂಗ್ ಆಗುತ್ತಿದೆ"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"ಕ್ಯಾಮರಾ ಮತ್ತು ಮೈಕ್ರೊಫೋನ್ ರೆಕಾರ್ಡಿಂಗ್ ಆಗುತ್ತಿವೆ"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"ಮೈಕ್ರೊಫೋನ್ ರೆಕಾರ್ಡಿಂಗ್ ನಿಲ್ಲಿಸಿದೆ"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"ಕ್ಯಾಮರಾ ರೆಕಾರ್ಡಿಂಗ್ ನಿಲ್ಲಿಸಲಾಗಿದೆ"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"ಕ್ಯಾಮರಾ ಮತ್ತು ಮೈಕ್ರೊಫೋನ್ ರೆಕಾರ್ಡಿಂಗ್ ನಿಲ್ಲಿಸಿವೆ"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ko/strings.xml b/packages/SystemUI/res/values-ko/strings.xml
index 6f896c7..e592f5a 100644
--- a/packages/SystemUI/res/values-ko/strings.xml
+++ b/packages/SystemUI/res/values-ko/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"카메라를 사용할 수 있는 모든 앱 및 서비스에 대해 액세스가 차단 해제됩니다."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"카메라 또는 마이크를 사용할 수 있는 모든 앱 및 서비스에 대해 액세스가 차단 해제됩니다."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"기기"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"위로 스와이프하여 앱 전환"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"앱을 빠르게 전환하려면 오른쪽으로 드래그"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"최근 사용 버튼 전환"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"충전됨"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"충전 중"</string>
diff --git a/packages/SystemUI/res/values-ko/strings_tv.xml b/packages/SystemUI/res/values-ko/strings_tv.xml
index 8849265..b9fb537 100644
--- a/packages/SystemUI/res/values-ko/strings_tv.xml
+++ b/packages/SystemUI/res/values-ko/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g>에 연결됨"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"알림"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"알림 없음"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"마이크 녹음 중"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"카메라 녹화 중"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"카메라 녹화 및 마이크 녹음 중"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"마이크 녹음 중단됨"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"카메라 녹화 중단됨"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"카메라 녹화 및 마이크 녹음 중단됨"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ky/strings.xml b/packages/SystemUI/res/values-ky/strings.xml
index 20ec715..af1a0c0 100644
--- a/packages/SystemUI/res/values-ky/strings.xml
+++ b/packages/SystemUI/res/values-ky/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Камераны колдонууга уруксат алган бардык колдонмолор менен кызматтар бөгөттөн чыгат."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Камераңызды же микрофонуңузду колдонууга уруксат алган бардык колдонмолор менен кызматтар бөгөттөн чыгат."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Түзмөк"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Башка колдонмого которулуу үчүн өйдө сүрүңүз"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Колдонмолорду тез которуштуруу үчүн, оңго сүйрөңүз"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Назар режимин өчүрүү/күйгүзүү"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Кубатталды"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Кубатталууда"</string>
@@ -1019,8 +1017,8 @@
<string name="device_services" msgid="1549944177856658705">"Түзмөк кызматтары"</string>
<string name="music_controls_no_title" msgid="4166497066552290938">"Аталышы жок"</string>
<string name="bubble_accessibility_action_move" msgid="3185080443743819178">"Жылдыруу"</string>
- <string name="notification_content_system_nav_changed" msgid="5077913144844684544">"Тутум чабыттоосу жаңырды. Өзгөртүү үчүн, Жөндөөлөргө өтүңүз."</string>
- <string name="notification_content_gesture_nav_available" msgid="4431460803004659888">"Тутум чабыттоосун жаңыртуу үчүн Жөндөөлөргө өтүңүз"</string>
+ <string name="notification_content_system_nav_changed" msgid="5077913144844684544">"Тутум чабыттоосу жаңырды. Өзгөртүү үчүн, жөндөөлөргө өтүңүз."</string>
+ <string name="notification_content_gesture_nav_available" msgid="4431460803004659888">"Тутум чабыттоосун жаңыртуу үчүн жөндөөлөргө өтүңүз"</string>
<string name="inattentive_sleep_warning_title" msgid="3891371591713990373">"Көшүү режими"</string>
<string name="magnification_window_title" msgid="4863914360847258333">"Чоңойтуу терезеси"</string>
<string name="magnification_controls_title" msgid="8421106606708891519">"Чоңойтуу терезесин башкаруу каражаттары"</string>
diff --git a/packages/SystemUI/res/values-ky/strings_tv.xml b/packages/SystemUI/res/values-ky/strings_tv.xml
index 128c7e0..52b2375 100644
--- a/packages/SystemUI/res/values-ky/strings_tv.xml
+++ b/packages/SystemUI/res/values-ky/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> аркылуу"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Билдирмелер"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Билдирме жок"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Микрофон жаздырууда"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Камера жаздырууда"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Камера менен микрофон жаздырууда"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Микрофон жаздырууну токтотту"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Камера жаздырууну токтотту"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Камера менен микрофон жаздырууну токтотту"</string>
</resources>
diff --git a/packages/SystemUI/res/values-lo/strings.xml b/packages/SystemUI/res/values-lo/strings.xml
index de3afd3..6e0a9b3 100644
--- a/packages/SystemUI/res/values-lo/strings.xml
+++ b/packages/SystemUI/res/values-lo/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"ນີ້ຈະຍົກເລີກການບລັອກການເຂົ້າເຖິງແອັບ ແລະ ບໍລິການທັງໝົດທີ່ອະນຸຍາດໃຫ້ໃຊ້ກ້ອງຖ່າຍຮູບຂອງທ່ານ."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"ນີ້ຈະປົດບລັອກການເຂົ້າເຖິງແອັບ ແລະ ບໍລິການທັງໝົດທີ່ອະນຸຍາດໃຫ້ໃຊ້ກ້ອງຖ່າຍຮູບ ຫຼື ໄມໂຄຣໂຟນຂອງທ່ານ."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"ອຸປະກອນ"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"ປັດຂື້ນເພື່ອສະຫຼັບແອັບ"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"ລາກໄປຂວາເພື່ອສະຫຼັບແອັບດ່ວນ"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"ສະຫຼັບພາບຮວມ"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"ສາກເຕັມແລ້ວ."</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"ກຳລັງສາກໄຟ"</string>
diff --git a/packages/SystemUI/res/values-lo/strings_tv.xml b/packages/SystemUI/res/values-lo/strings_tv.xml
index b852456..d2de125 100644
--- a/packages/SystemUI/res/values-lo/strings_tv.xml
+++ b/packages/SystemUI/res/values-lo/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"ຜ່ານ <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"ການແຈ້ງເຕືອນ"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"ບໍ່ມີການແຈ້ງເຕືອນ"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"ໄມໂຄຣໂຟນກຳລັງບັນທຶກ"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"ກ້ອງຖ່າຍຮູບກຳລັງບັນທຶກ"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"ກ້ອງຖ່າຍຮູບ ແລະ ໄມໂຄຣໂຟນກຳລັງບັນທຶກ"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"ໄມໂຄຣໂຟນຢຸດການບັນທຶກແລ້ວ"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"ກ້ອງຖ່າຍຮູບຢຸດການບັນທຶກແລ້ວ"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"ກ້ອງຖ່າຍຮູບ ແລະ ໄມໂຄຣໂຟນຢຸດການບັນທຶກແລ້ວ"</string>
</resources>
diff --git a/packages/SystemUI/res/values-lt/strings.xml b/packages/SystemUI/res/values-lt/strings.xml
index 230ee19..01498b9 100644
--- a/packages/SystemUI/res/values-lt/strings.xml
+++ b/packages/SystemUI/res/values-lt/strings.xml
@@ -437,8 +437,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Tai atlikus visų programų ir paslaugų prieigos blokavimas panaikinamas ir joms leidžiama naudoti fotoaparatą."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Tai atlikus visų programų ir paslaugų prieigos blokavimas panaikinamas ir joms leidžiama naudoti fotoaparatą ar mikrofoną."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Įrenginys"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Perbraukite aukštyn, kad perjungtumėte programas"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Vilkite į dešinę, kad greitai perjungtumėte programas"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Perjungti apžvalgą"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Įkrautas"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Kraunamas"</string>
diff --git a/packages/SystemUI/res/values-lt/strings_tv.xml b/packages/SystemUI/res/values-lt/strings_tv.xml
index 7cd7507..df23a61 100644
--- a/packages/SystemUI/res/values-lt/strings_tv.xml
+++ b/packages/SystemUI/res/values-lt/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Per „<xliff:g id="VPN_APP">%1$s</xliff:g>“"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Pranešimai"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nėra jokių pranešimų"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofonas įrašo"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kamera įrašo"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kamera ir mikrofonas įrašo"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Mikrofonas nebeįrašo"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Kamera nebeįrašo"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Kamera ir mikrofonas nebeįrašo"</string>
</resources>
diff --git a/packages/SystemUI/res/values-lv/strings.xml b/packages/SystemUI/res/values-lv/strings.xml
index c454f2a..c320321 100644
--- a/packages/SystemUI/res/values-lv/strings.xml
+++ b/packages/SystemUI/res/values-lv/strings.xml
@@ -435,8 +435,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Visas lietotnes un pakalpojumi, kuriem ir atļauts izmantot kameru, varēs tai piekļūt."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Visas lietotnes un pakalpojumi, kuriem ir atļauts izmantot kameru vai mikrofonu, varēs tiem piekļūt."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Ierīce"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Velciet augšup, lai pārslēgtu lietotnes"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Lai ātri pārslēgtu lietotnes, velciet pa labi"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Pārskata pārslēgšana"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Akumulators uzlādēts"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Notiek uzlāde"</string>
diff --git a/packages/SystemUI/res/values-lv/strings_tv.xml b/packages/SystemUI/res/values-lv/strings_tv.xml
index 4c64843..e343a77 100644
--- a/packages/SystemUI/res/values-lv/strings_tv.xml
+++ b/packages/SystemUI/res/values-lv/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Izmantojot: <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Paziņojumi"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nav paziņojumu"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Notiek ierakstīšana ar mikrofonu"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Notiek ierakstīšana ar kameru"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Notiek ierakstīšana ar kameru un mikrofonu"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Ierakstīšana ar mikrofonu apturēta"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Ierakstīšana ar kameru apturēta"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Ierakstīšana ar kameru un mikrofonu apturēta"</string>
</resources>
diff --git a/packages/SystemUI/res/values-mk/strings.xml b/packages/SystemUI/res/values-mk/strings.xml
index fc1a69a..f2d40fe 100644
--- a/packages/SystemUI/res/values-mk/strings.xml
+++ b/packages/SystemUI/res/values-mk/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Ова ќе го одблокира пристапот за сите апликации и услуги на кои им е дозволено користење на камерата."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Ова ќе го одблокира пристапот за сите апликации и услуги на кои им е дозволено користење на камерата или микрофонот."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Уред"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Повлечете нагоре за да се префрлите од една на друга апликација"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Повлечете надесно за брзо префрлање меѓу апликациите"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Вклучи/исклучи преглед"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Наполнета"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Се полни"</string>
diff --git a/packages/SystemUI/res/values-mk/strings_tv.xml b/packages/SystemUI/res/values-mk/strings_tv.xml
index 55d9df7..f39f1fa 100644
--- a/packages/SystemUI/res/values-mk/strings_tv.xml
+++ b/packages/SystemUI/res/values-mk/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Преку <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Известувања"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Нема известувања"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Микрофонот снима"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Камерата снима"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Камерата и микрофонот снимаат"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Микрофонот прекина со снимање"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Камерата прекина со снимање"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Камерата и микрофонот прекинаа со снимање"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ml/strings.xml b/packages/SystemUI/res/values-ml/strings.xml
index 1c3837f..340dae0 100644
--- a/packages/SystemUI/res/values-ml/strings.xml
+++ b/packages/SystemUI/res/values-ml/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"നിങ്ങളുടെ ക്യാമറ ഉപയോഗിക്കാൻ അനുവദിച്ചിരിക്കുന്ന എല്ലാ ആപ്പുകൾക്കും സേവനങ്ങൾക്കുമുള്ള ആക്സസ് ഇത് അൺബ്ലോക്ക് ചെയ്യുന്നു."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"നിങ്ങളുടെ ക്യാമറയോ മൈക്രോഫോണോ ഉപയോഗിക്കാൻ അനുവദിച്ചിരിക്കുന്ന എല്ലാ ആപ്പുകൾക്കും സേവനങ്ങൾക്കുമുള്ള ആക്സസ് ഇത് അൺബ്ലോക്ക് ചെയ്യുന്നു."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"ഉപകരണം"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"ആപ്പുകൾ മാറാൻ മുകളിലേക്ക് സ്വൈപ്പ് ചെയ്യുക"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"ആപ്പുകൾ പെട്ടെന്ന് മാറാൻ വലത്തോട്ട് വലിച്ചിടുക"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"അവലോകനം മാറ്റുക"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"ചാർജായി"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"ചാർജ് ചെയ്യുന്നു"</string>
diff --git a/packages/SystemUI/res/values-ml/strings_tv.xml b/packages/SystemUI/res/values-ml/strings_tv.xml
index 6ae342cf..50d0280 100644
--- a/packages/SystemUI/res/values-ml/strings_tv.xml
+++ b/packages/SystemUI/res/values-ml/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> വഴി"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"അറിയിപ്പുകൾ"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"അറിയിപ്പുകൾ ഒന്നുമില്ല"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"മൈക്രോഫോൺ റെക്കോർഡ് ചെയ്യുകയാണ്"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"ക്യാമറ റെക്കോർഡ് ചെയ്യുകയാണ്"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"ക്യാമറയും മൈക്രോഫോണും റെക്കോർഡ് ചെയ്യുകയാണ്"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"മൈക്രോഫോൺ റെക്കോർഡ് ചെയ്യുന്നത് നിർത്തി"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"ക്യാമറ റെക്കോർഡ് ചെയ്യുന്നത് നിർത്തി"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"ക്യാമറയും മൈക്രോഫോണും റെക്കോർഡ് ചെയ്യുന്നത് നിർത്തി"</string>
</resources>
diff --git a/packages/SystemUI/res/values-mn/strings.xml b/packages/SystemUI/res/values-mn/strings.xml
index 4e04c61..155f1a3 100644
--- a/packages/SystemUI/res/values-mn/strings.xml
+++ b/packages/SystemUI/res/values-mn/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Энэ нь таны камерыг ашиглах зөвшөөрөлтэй бүх апп болон үйлчилгээний хандалтыг блокоос гаргана."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Энэ нь таны камер эсвэл микрофоныг ашиглах зөвшөөрөлтэй бүх апп болон үйлчилгээний хандалтыг блокоос гаргана."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Төхөөрөмж"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Апп сэлгэхийн тулд дээш шударна уу"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Аппуудыг хурдан сэлгэхийн тулд баруун тийш чирнэ үү"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Тоймыг асаах/унтраах"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Цэнэглэгдсэн"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Цэнэглэж байна"</string>
diff --git a/packages/SystemUI/res/values-mn/strings_tv.xml b/packages/SystemUI/res/values-mn/strings_tv.xml
index bbb302f..1b20d84 100644
--- a/packages/SystemUI/res/values-mn/strings_tv.xml
+++ b/packages/SystemUI/res/values-mn/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g>-р"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Мэдэгдэл"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Мэдэгдэл байхгүй байна"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Микрофон бичиж байна"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Камер бичиж байна"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Камер болон микрофон бичиж байна"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Микрофон бичихээ зогсоосон"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Камер бичихээ зогсоосон"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Камер болон микрофон бичихээ зогсоосон"</string>
</resources>
diff --git a/packages/SystemUI/res/values-mr/strings.xml b/packages/SystemUI/res/values-mr/strings.xml
index 5785b41..721b28f3 100644
--- a/packages/SystemUI/res/values-mr/strings.xml
+++ b/packages/SystemUI/res/values-mr/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"हे तुमचा कॅमेरा वापरण्याची परवानगी असलेल्या सर्व ॲप्स आणि सेवांसाठी अॅक्सेस अनब्लॉक करते."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"हे तुमचा कॅमेरा आणि मायक्रोफोन वापरण्याची परवानगी असलेल्या सर्व ॲप्स व सेवांसाठी अॅक्सेस अनब्लॉक करते."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"डिव्हाइस"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"अॅप्स स्विच करण्यासाठी वर स्वाइप करा"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"अॅप्स वर झटपट स्विच करण्यासाठी उजवीकडे ड्रॅग करा"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"अवलोकन टॉगल करा."</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"चार्ज झाली"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"चार्ज होत आहे"</string>
diff --git a/packages/SystemUI/res/values-mr/strings_tv.xml b/packages/SystemUI/res/values-mr/strings_tv.xml
index d596d95..2d79d4a 100644
--- a/packages/SystemUI/res/values-mr/strings_tv.xml
+++ b/packages/SystemUI/res/values-mr/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> द्वारे"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"सूचना"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"सूचना नाहीत"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"मायक्रोफोन रेकॉर्ड करत आहे"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"कॅमेरा रेकॉर्ड करत आहे"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"कॅमेरा आणि मायक्रोफोन रेकॉर्ड करत आहेत"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"मायक्रोफोनने रेकॉर्ड करणे थांबवले"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"कॅमेराने रेकॉर्ड करणे थांबवले"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"कॅमेरा आणि मायक्रोफोनने रेकॉर्ड करणे थांबवले"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ms/strings.xml b/packages/SystemUI/res/values-ms/strings.xml
index 6b6a6b7..10d8b1e 100644
--- a/packages/SystemUI/res/values-ms/strings.xml
+++ b/packages/SystemUI/res/values-ms/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Tindakan ini menyahsekat akses bagi semua apl dan perkhidmatan yang dibenarkan untuk menggunakan kamera anda."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Tindakan ini menyahsekat akses bagi semua apl dan perkhidmatan yang dibenarkan untuk menggunakan kamera atau mikrofon anda."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Peranti"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Leret ke atas untuk menukar apl"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Seret ke kanan untuk beralih apl dengan pantas"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Togol Ikhtisar"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Sudah dicas"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Mengecas"</string>
diff --git a/packages/SystemUI/res/values-ms/strings_tv.xml b/packages/SystemUI/res/values-ms/strings_tv.xml
index e28d032..9064ec4 100644
--- a/packages/SystemUI/res/values-ms/strings_tv.xml
+++ b/packages/SystemUI/res/values-ms/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Melalui <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Pemberitahuan"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Tiada Pemberitahuan"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofon sedang merakam"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kamera sedang merakam"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kamera dan Mikrofon sedang merakam"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Mikrofon berhenti merakam"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Kamera berhenti merakam"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Kamera dan Mikrofon berhenti merakam"</string>
</resources>
diff --git a/packages/SystemUI/res/values-my/strings.xml b/packages/SystemUI/res/values-my/strings.xml
index ba643f0..9cc4ee2 100644
--- a/packages/SystemUI/res/values-my/strings.xml
+++ b/packages/SystemUI/res/values-my/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"၎င်းက သင့်ကင်မရာသုံးရန် ခွင့်ပြုထားသော အက်ပ်နှင့် ဝန်ဆောင်မှုအားလုံးအတွက် သုံးခွင့်ကို ပြန်ဖွင့်ပေးသည်။"</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"၎င်းက သင့်ကင်မရာ (သို့) မိုက်ခရိုဖုန်းသုံးရန် ခွင့်ပြုထားသော အက်ပ်နှင့် ဝန်ဆောင်မှုအားလုံးအတွက် သုံးခွင့်ကို ပြန်ဖွင့်ပေးသည်။"</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"စက်"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"အက်ပ်များကို ဖွင့်ရန် အပေါ်သို့ ပွတ်ဆွဲပါ"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"အက်ပ်များကို ပြောင်းရန် ညာဘက်သို့ ဖိဆွဲပါ"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"ဖွင့်၊ ပိတ် အနှစ်ချုပ်"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"အားသွင်းပြီး"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"အားသွင်းနေ"</string>
diff --git a/packages/SystemUI/res/values-my/strings_tv.xml b/packages/SystemUI/res/values-my/strings_tv.xml
index 848c403..1aca9eb 100644
--- a/packages/SystemUI/res/values-my/strings_tv.xml
+++ b/packages/SystemUI/res/values-my/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> မှတစ်ဆင့်"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"အကြောင်းကြားချက်များ"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"အကြောင်းကြားချက်များ မရှိပါ"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"မိုက်ခရိုဖုန်း မှတ်တမ်းတင်နေသည်"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"ကင်မရာ မှတ်တမ်းတင်နေသည်"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"ကင်မရာနှင့် မိုက်ခရိုဖုန်းက မှတ်တမ်းတင်နေသည်"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"မိုက်ခရိုဖုန်း မှတ်တမ်းတင်ခြင်းကို ရပ်ထားသည်"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"ကင်မရာ မှတ်တမ်းတင်ခြင်းကို ရပ်ထားသည်"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"ကင်မရာနှင့် မိုက်ခရိုဖုန်းက မှတ်တမ်းတင်ခြင်းကို ရပ်ထားသည်"</string>
</resources>
diff --git a/packages/SystemUI/res/values-nb/strings.xml b/packages/SystemUI/res/values-nb/strings.xml
index 7a42d3e..e091c34 100644
--- a/packages/SystemUI/res/values-nb/strings.xml
+++ b/packages/SystemUI/res/values-nb/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Dette opphever blokkeringen av tilgang for alle apper og tjenester som har tillatelse til å bruke kameraet."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Dette opphever blokkeringen av tilgang for alle apper og tjenester som har tillatelse til å bruke kameraet eller mikrofonen."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Enhet"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Sveip opp for å bytte apper"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Dra til høyre for å bytte apper raskt"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Slå oversikten av eller på"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Oppladet"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Lader"</string>
diff --git a/packages/SystemUI/res/values-nb/strings_tv.xml b/packages/SystemUI/res/values-nb/strings_tv.xml
index 11de50a..7eb6a29 100644
--- a/packages/SystemUI/res/values-nb/strings_tv.xml
+++ b/packages/SystemUI/res/values-nb/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Varsler"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Ingen varsler"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofonen tar opp"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kameraet tar opp"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kameraet og mikrofonen tar opp"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Mikrofonen stoppet opptaket"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Kameraet stoppet opptaket"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Kameraet og mikrofonen stoppet opptaket"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ne/strings.xml b/packages/SystemUI/res/values-ne/strings.xml
index c46d705..b271ba6 100644
--- a/packages/SystemUI/res/values-ne/strings.xml
+++ b/packages/SystemUI/res/values-ne/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"यसो गर्नुभयो भने क्यामेरा प्रयोग गर्ने अनुमति दिइएका सबै एप तथा सेवाहरूका लागि सो अनुमति अनब्लक गरिन्छ।"</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"यसो गर्नुभयो भने क्यामेरा वा माइक्रोफोन प्रयोग गर्ने अनुमति दिइएका सबै एप तथा सेवाहरूका लागि सो अनुमति अनब्लक गरिन्छ।"</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"यन्त्र"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"एपहरू बदल्न माथितिर स्वाइप गर्नुहोस्"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"एपहरू बदल्न द्रुत गतिमा दायाँतिर ड्र्याग गर्नुहोस्"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"परिदृश्य टगल गर्नुहोस्"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"चार्ज भयो"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"चार्ज हुँदै छ"</string>
diff --git a/packages/SystemUI/res/values-ne/strings_tv.xml b/packages/SystemUI/res/values-ne/strings_tv.xml
index 0bcc1cc..410f26f 100644
--- a/packages/SystemUI/res/values-ne/strings_tv.xml
+++ b/packages/SystemUI/res/values-ne/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> मार्फत"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"सूचनाहरू"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"कुनै पनि सूचना छैन"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"माइक्रोफोनले रेकर्ड गर्दै छ"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"क्यामेराले रेकर्ड गर्दै छ"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"क्यामेरा र माइक्रोफोनले रेकर्ड गर्दै छन्"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"माइक्रोफोनले रेकर्ड गर्न छाड्यो"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"क्यामेराले रेकर्ड गर्न छाड्यो"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"क्यामेरा र माइक्रोफोनले रेकर्ड गर्न छाडे"</string>
</resources>
diff --git a/packages/SystemUI/res/values-nl/strings.xml b/packages/SystemUI/res/values-nl/strings.xml
index f0cc269..7331087 100644
--- a/packages/SystemUI/res/values-nl/strings.xml
+++ b/packages/SystemUI/res/values-nl/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Hiermee hef je de toegangsblokkering op voor alle apps en services die rechten hebben om je camera te gebruiken."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Hiermee hef je de toegangsblokkering op voor alle apps en services die rechten hebben om je camera of microfoon te gebruiken."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Apparaat"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Swipe omhoog om te schakelen tussen apps"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Sleep naar rechts om snel tussen apps te schakelen"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Overzicht aan- of uitzetten"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Opgeladen"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Opladen"</string>
diff --git a/packages/SystemUI/res/values-nl/strings_tv.xml b/packages/SystemUI/res/values-nl/strings_tv.xml
index 02c00ec..7aeeabf 100644
--- a/packages/SystemUI/res/values-nl/strings_tv.xml
+++ b/packages/SystemUI/res/values-nl/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Meldingen"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Geen meldingen"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Microfoon neemt op"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Camera neemt op"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Camera en microfoon nemen op"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Microfoon neemt niet meer op"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Camera neemt niet meer op"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Camera en microfoon nemen niet meer op"</string>
</resources>
diff --git a/packages/SystemUI/res/values-or/strings.xml b/packages/SystemUI/res/values-or/strings.xml
index 2fcc505..6ff3814 100644
--- a/packages/SystemUI/res/values-or/strings.xml
+++ b/packages/SystemUI/res/values-or/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"ଆପଣଙ୍କ କ୍ୟାମେରାକୁ ବ୍ୟବହାର କରିବା ପାଇଁ ଅନୁମତି ଦିଆଯାଇଥିବା ସମସ୍ତ ଆପ୍ ଓ ସେବା ପାଇଁ ଏହା ଆକ୍ସେସକୁ ଅନବ୍ଲକ୍ କରେ।"</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"ଆପଣଙ୍କ କ୍ୟାମେରା କିମ୍ବା ମାଇକ୍ରୋଫୋନକୁ ବ୍ୟବହାର କରିବା ପାଇଁ ଅନୁମତି ଦିଆଯାଇଥିବା ସମସ୍ତ ଆପ୍ ଓ ସେବା ପାଇଁ ଏହା ଆକ୍ସେସକୁ ଅନବ୍ଲକ୍ କରେ।"</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"ଡିଭାଇସ୍"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"ଆପ୍କୁ ବଦଳ କରିବା ପାଇଁ ସ୍ଵାଇପ୍ କରନ୍ତୁ"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"ଆପ୍ଗୁଡ଼ିକ ମଧ୍ୟରେ ଶୀଘ୍ର ବଦଳ କରିବା ପାଇଁ ଡାହାଣକୁ ଡ୍ରାଗ୍ କରନ୍ତୁ"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"ସଂକ୍ଷିପ୍ତ ବିବରଣୀକୁ ଟୋଗଲ୍ କରନ୍ତୁ"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"ଚାର୍ଜ ହୋଇଗଲା"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"ଚାର୍ଜ କରାଯାଉଛି"</string>
diff --git a/packages/SystemUI/res/values-or/strings_tv.xml b/packages/SystemUI/res/values-or/strings_tv.xml
index 8289068..2669a5a 100644
--- a/packages/SystemUI/res/values-or/strings_tv.xml
+++ b/packages/SystemUI/res/values-or/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> ମାଧ୍ୟମରେ"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"ବିଜ୍ଞପ୍ତିଗୁଡ଼ିକ"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"କୌଣସି ବିଜ୍ଞପ୍ତି ନାହିଁ"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"ମାଇକ୍ରୋଫୋନ୍ ରେକର୍ଡିଂ କରୁଛି"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"କ୍ୟାମେରା ରେକର୍ଡିଂ କରୁଛି"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"କ୍ୟାମେରା ଏବଂ ମାଇକ୍ରୋଫୋନ୍ ରେକର୍ଡିଂ କରୁଛି"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"ମାଇକ୍ରୋଫୋନ୍ ରେକର୍ଡିଂ ବନ୍ଦ କରିଛି"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"କ୍ୟାମେରା ରେକର୍ଡିଂ ବନ୍ଦ କରିଛି"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"କ୍ୟାମେରା ଏବଂ ମାଇକ୍ରୋଫୋନ୍ ରେକର୍ଡିଂ ବନ୍ଦ କରିଛି"</string>
</resources>
diff --git a/packages/SystemUI/res/values-pa/strings.xml b/packages/SystemUI/res/values-pa/strings.xml
index 3dad773..542f341 100644
--- a/packages/SystemUI/res/values-pa/strings.xml
+++ b/packages/SystemUI/res/values-pa/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"ਇਹ ਉਹਨਾਂ ਐਪਾਂ ਅਤੇ ਸੇਵਾਵਾਂ ਲਈ ਪਹੁੰਚ ਨੂੰ ਅਣਬਲਾਕ ਕਰਦਾ ਹੈ ਜਿਨ੍ਹਾਂ ਨੂੰ ਤੁਹਾਡਾ ਕੈਮਰਾ ਵਰਤਣ ਦੀ ਆਗਿਆ ਦਿੱਤੀ ਗਈ ਹੈ।"</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"ਇਹ ਉਹਨਾਂ ਐਪਾਂ ਅਤੇ ਸੇਵਾਵਾਂ ਲਈ ਪਹੁੰਚ ਨੂੰ ਅਣਬਲਾਕ ਕਰਦਾ ਹੈ ਜਿਨ੍ਹਾਂ ਨੂੰ ਤੁਹਾਡਾ ਕੈਮਰਾ ਜਾਂ ਮਾਈਕ੍ਰੋਫ਼ੋਨ ਵਰਤਣ ਦੀ ਆਗਿਆ ਦਿੱਤੀ ਗਈ ਹੈ।"</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"ਡੀਵਾਈਸ"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"ਐਪਾਂ ਵਿਚਾਲੇ ਅਦਲਾ-ਬਦਲੀ ਕਰਨ ਲਈ ਉੱਪਰ ਵੱਲ ਸਵਾਈਪ ਕਰੋ"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"ਐਪਾਂ ਵਿਚਾਲੇ ਤੇਜ਼ੀ ਨਾਲ ਅਦਲਾ-ਬਦਲੀ ਕਰਨ ਲਈ ਸੱਜੇ ਪਾਸੇ ਵੱਲ ਘਸੀਟੋ"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"ਰੂਪ-ਰੇਖਾ ਨੂੰ ਟੌਗਲ ਕਰੋ"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"ਚਾਰਜ ਹੋਇਆ"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"ਚਾਰਜ ਕਰ ਰਿਹਾ ਹੈ"</string>
diff --git a/packages/SystemUI/res/values-pa/strings_tv.xml b/packages/SystemUI/res/values-pa/strings_tv.xml
index 22fcce8..3443cfa 100644
--- a/packages/SystemUI/res/values-pa/strings_tv.xml
+++ b/packages/SystemUI/res/values-pa/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> ਰਾਹੀਂ"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"ਸੂਚਨਾਵਾਂ"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"ਕੋਈ ਸੂਚਨਾ ਨਹੀਂ"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"ਮਾਈਕ੍ਰੋਫ਼ੋਨ ਰਿਕਾਰਡ ਕਰ ਰਿਹਾ ਹੈ"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"ਕੈਮਰਾ ਰਿਕਾਰਡ ਕਰ ਰਿਹਾ ਹੈ"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"ਕੈਮਰਾ ਅਤੇ ਮਾਈਕ੍ਰੋਫ਼ੋਨ ਰਿਕਾਰਡ ਕਰ ਰਹੇ ਹਨ"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"ਮਾਈਕ੍ਰੋਫ਼ੋਨ ਨੇ ਰਿਕਾਰਡ ਕਰਨਾ ਬੰਦ ਕਰ ਦਿੱਤਾ ਹੈ"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"ਕੈਮਰੇ ਨੇ ਰਿਕਾਰਡ ਕਰਨਾ ਬੰਦ ਕਰ ਦਿੱਤਾ ਹੈ"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"ਕੈਮਰੇ ਅਤੇ ਮਾਈਕ੍ਰੋਫ਼ੋਨ ਨੇ ਰਿਕਾਰਡ ਕਰਨਾ ਬੰਦ ਕਰ ਦਿੱਤਾ ਹੈ"</string>
</resources>
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index 30d6f05..2d13f98 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -437,8 +437,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Spowoduje to odblokowanie dostępu dla wszystkich aplikacji i usług, które mają uprawnienia do korzystania z aparatu."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Spowoduje to odblokowanie dostępu dla wszystkich aplikacji i usług, które mają uprawnienia do korzystania z aparatu lub mikrofonu."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Urządzenie"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Przesuń w górę, by przełączyć aplikacje"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Szybko przeciągnij w prawo, by przełączyć aplikacje"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Przełącz Przegląd"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Naładowana"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Ładowanie"</string>
diff --git a/packages/SystemUI/res/values-pl/strings_tv.xml b/packages/SystemUI/res/values-pl/strings_tv.xml
index 2371b5e..12b3777 100644
--- a/packages/SystemUI/res/values-pl/strings_tv.xml
+++ b/packages/SystemUI/res/values-pl/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Przez: <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Powiadomienia"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Brak powiadomień"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofon rejestruje"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Aparat rejestruje"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Aparat i mikrofon rejestrują"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Mikrofon przestał rejestrować"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Aparat przestał rejestrować"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Aparat i mikrofon przestały rejestrować"</string>
</resources>
diff --git a/packages/SystemUI/res/values-pt-rBR/strings.xml b/packages/SystemUI/res/values-pt-rBR/strings.xml
index 24015d8..cea977f 100644
--- a/packages/SystemUI/res/values-pt-rBR/strings.xml
+++ b/packages/SystemUI/res/values-pt-rBR/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Essa ação desbloqueia o acesso para todos os apps e serviços com autorização para usar sua câmera."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Essa ação desbloqueia o acesso para todos os apps e serviços com autorização para usar sua câmera ou seu microfone."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Dispositivo"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Deslize para cima para mudar de app"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Arraste para a direita para mudar rapidamente de app"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Alternar Visão geral"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Carregado"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Carregando"</string>
diff --git a/packages/SystemUI/res/values-pt-rPT/strings.xml b/packages/SystemUI/res/values-pt-rPT/strings.xml
index 362d656..72bc64b 100644
--- a/packages/SystemUI/res/values-pt-rPT/strings.xml
+++ b/packages/SystemUI/res/values-pt-rPT/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Isto desbloqueia o acesso a todas as apps e serviços com autorização para utilizar a sua câmara."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Isto desbloqueia o acesso a todas as apps e serviços com autorização para utilizar a sua câmara ou microfone."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Dispositivo"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Deslizar rapidamente para cima para mudar de app"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Arraste para a direita para mudar rapidamente de app."</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Ativar/desativar Vista geral"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Carregada"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"A carregar"</string>
diff --git a/packages/SystemUI/res/values-pt-rPT/strings_tv.xml b/packages/SystemUI/res/values-pt-rPT/strings_tv.xml
index 883fa3a..3ae7daf 100644
--- a/packages/SystemUI/res/values-pt-rPT/strings_tv.xml
+++ b/packages/SystemUI/res/values-pt-rPT/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Através de <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Notificações"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Sem notificações"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"O microfone está a gravar"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"A câmara está a gravar"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"A câmara e o microfone estão a gravar"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"O microfone parou a gravação"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"A câmara parou a gravação"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"A câmara e o microfone pararam a gravação"</string>
</resources>
diff --git a/packages/SystemUI/res/values-pt/strings.xml b/packages/SystemUI/res/values-pt/strings.xml
index 24015d8..cea977f 100644
--- a/packages/SystemUI/res/values-pt/strings.xml
+++ b/packages/SystemUI/res/values-pt/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Essa ação desbloqueia o acesso para todos os apps e serviços com autorização para usar sua câmera."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Essa ação desbloqueia o acesso para todos os apps e serviços com autorização para usar sua câmera ou seu microfone."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Dispositivo"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Deslize para cima para mudar de app"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Arraste para a direita para mudar rapidamente de app"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Alternar Visão geral"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Carregado"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Carregando"</string>
diff --git a/packages/SystemUI/res/values-ro/strings.xml b/packages/SystemUI/res/values-ro/strings.xml
index 452664f..8a0edce 100644
--- a/packages/SystemUI/res/values-ro/strings.xml
+++ b/packages/SystemUI/res/values-ro/strings.xml
@@ -435,8 +435,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Astfel, deblocați accesul pentru toate aplicațiile și serviciile care au permisiunea de a folosi camera."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Astfel, deblocați accesul pentru toate aplicațiile și serviciile care au permisiunea de a folosi camera sau microfonul."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Dispozitiv"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Glisați în sus pentru a comuta între aplicații"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Glisați la dreapta pentru a comuta rapid între aplicații"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Comutați secțiunea Recente"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Încărcată"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Se încarcă"</string>
diff --git a/packages/SystemUI/res/values-ro/strings_tv.xml b/packages/SystemUI/res/values-ro/strings_tv.xml
index 9f28693..54dd985 100644
--- a/packages/SystemUI/res/values-ro/strings_tv.xml
+++ b/packages/SystemUI/res/values-ro/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Prin <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Notificări"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Nicio notificare"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Microfonul înregistrează"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Camera foto înregistrează"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Camera foto și microfonul înregistrează"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Microfonul nu mai înregistrează"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Camera foto a oprit înregistrarea"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Camera foto și microfonul nu mai înregistrează"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml
index 7ebbb43..cb852f6a 100644
--- a/packages/SystemUI/res/values-ru/strings.xml
+++ b/packages/SystemUI/res/values-ru/strings.xml
@@ -437,8 +437,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Будет снята блокировка доступа для всех приложений и сервисов с разрешением на использование камеры."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Будет снята блокировка доступа для всех приложений и сервисов с разрешением на использование камеры или микрофона."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Устройство"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Чтобы переключиться между приложениями, проведите по экрану вверх."</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Перетащите вправо, чтобы быстро переключиться между приложениями"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Переключить режим обзора"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Батарея заряжена"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Зарядка батареи"</string>
diff --git a/packages/SystemUI/res/values-ru/strings_tv.xml b/packages/SystemUI/res/values-ru/strings_tv.xml
index e2162ea..befb5d2 100644
--- a/packages/SystemUI/res/values-ru/strings_tv.xml
+++ b/packages/SystemUI/res/values-ru/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Через приложение <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Уведомления"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Уведомлений нет."</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Выполняется запись с микрофона"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Выполняется запись с камеры"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Выполняется запись с камеры и микрофона"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Запись с микрофона остановлена"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Запись с камеры остановлена"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Запись с камеры и микрофона остановлена"</string>
</resources>
diff --git a/packages/SystemUI/res/values-si/strings.xml b/packages/SystemUI/res/values-si/strings.xml
index 6cf9f9b..e8bc947 100644
--- a/packages/SystemUI/res/values-si/strings.xml
+++ b/packages/SystemUI/res/values-si/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"මෙය ඔබගේ කැමරාව භාවිතා කිරීමට ඉඩ දී ඇති සියලු යෙදුම් සහ සේවා සඳහා ප්රවේශය අවහිර කිරීම ඉවත් කරයි."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"මෙය ඔබගේ කැමරාව හෝ මයික්රෆෝනය භාවිත කිරීමට ඉඩ දී ඇති සියලු යෙදුම් සහ සේවා සඳහා ප්රවේශය අවහිර කිරීම ඉවත් කරයි."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"උපාංගය"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"යෙදුම් මාරු කිරීමට ස්වයිප් කරන්න"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"ඉක්මනින් යෙදුම් මාරු කිරීමට දකුණට අදින්න"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"දළ විශ්ලේෂණය ටොගල කරන්න"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"අරෝපිතයි"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"ආරෝපණය වෙමින්"</string>
diff --git a/packages/SystemUI/res/values-si/strings_tv.xml b/packages/SystemUI/res/values-si/strings_tv.xml
index b750988..92257c7 100644
--- a/packages/SystemUI/res/values-si/strings_tv.xml
+++ b/packages/SystemUI/res/values-si/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> හරහා"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"දැනුම්දීම්"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"දැනුම්දීම් නැත"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"මයික්රෆෝනය පටිගත කරයි"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"කැමරාව පටිගත කරයි"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"කැමරාව සහ මයික්රෆෝනය පටිගත කරයි"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"මයික්රෆෝනය පටිගත කිරීම නැවැත්වීය"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"කැමරාව පටිගත කිරීම නැවැත්වීය"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"කැමරාව සහ මයික්රෆෝනය පටිගත කිරීම නැවැත්වීය"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sk/strings.xml b/packages/SystemUI/res/values-sk/strings.xml
index 5893223..4a646b3 100644
--- a/packages/SystemUI/res/values-sk/strings.xml
+++ b/packages/SystemUI/res/values-sk/strings.xml
@@ -437,8 +437,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Táto akcia odblokuje prístup všetkým aplikáciám a službám, ktoré majú povolené používať fotoaparát."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Táto akcia odblokuje prístup všetkým aplikáciám a službám, ktoré majú povolené používať fotoaparát alebo mikrofón."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Zariadenie"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Potiahnutím nahor prepnete aplikácie"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Presunutím doprava rýchlo prepnete aplikácie"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Prepnúť prehľad"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Nabitá"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Nabíja sa"</string>
diff --git a/packages/SystemUI/res/values-sk/strings_tv.xml b/packages/SystemUI/res/values-sk/strings_tv.xml
index 2b74267..6910079 100644
--- a/packages/SystemUI/res/values-sk/strings_tv.xml
+++ b/packages/SystemUI/res/values-sk/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Cez: <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Upozornenia"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Žiadne upozornenia"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofón nahráva"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kamera nahráva"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kamera a mikrofón nahrávajú"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Mikrofón prestal nahrávať"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Kamera prestala nahrávať"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Kamera a mikrofón prestali nahrávať"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sl/strings.xml b/packages/SystemUI/res/values-sl/strings.xml
index 6bc27d0..627359a 100644
--- a/packages/SystemUI/res/values-sl/strings.xml
+++ b/packages/SystemUI/res/values-sl/strings.xml
@@ -437,8 +437,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"S tem boste odblokirali dostop za vse aplikacije in storitve, ki imajo dovoljenje za uporabo fotoaparata."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"S tem boste odblokirali dostop za vse aplikacije in storitve, ki imajo dovoljenje za uporabo fotoaparata ali mikrofona."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Naprava"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Za preklop aplikacij povlecite navzgor"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Povlecite v desno za hiter preklop med aplikacijami"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Vklop/izklop pregleda"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Baterija napolnjena"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Polnjenje"</string>
diff --git a/packages/SystemUI/res/values-sl/strings_tv.xml b/packages/SystemUI/res/values-sl/strings_tv.xml
index 2ef9705..1005079 100644
--- a/packages/SystemUI/res/values-sl/strings_tv.xml
+++ b/packages/SystemUI/res/values-sl/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Prek storitve <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Obvestila"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Ni obvestil"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Snemanje z mikrofonom"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Snemanje s fotoaparatom"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Snemanje s fotoaparatom in mikrofonom"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Ustavljeno snemanje z mikrofonom"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Ustavljeno snemanje s fotoaparatom"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Ustavljeno snemanje s fotoaparatom in mikrofonom"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sq/strings.xml b/packages/SystemUI/res/values-sq/strings.xml
index 1600d03..eb49af0 100644
--- a/packages/SystemUI/res/values-sq/strings.xml
+++ b/packages/SystemUI/res/values-sq/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Kjo zhbllokon qasjen për të gjitha aplikacionet dhe shërbimet që lejohen të përdorin kamerën tënde."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Kjo zhbllokon qasjen për të gjitha aplikacionet dhe shërbimet që lejohen të përdorin kamerën ose mikrofonin tënd."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Pajisja"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Rrëshqit shpejt lart për të ndërruar aplikacionet"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Zvarrit djathtas për të ndërruar aplikacionet me shpejtësi"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Kalo te përmbledhja"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"I karikuar"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Po karikohet"</string>
diff --git a/packages/SystemUI/res/values-sq/strings_tv.xml b/packages/SystemUI/res/values-sq/strings_tv.xml
index ece5982..c5ce631 100644
--- a/packages/SystemUI/res/values-sq/strings_tv.xml
+++ b/packages/SystemUI/res/values-sq/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Nëpërmjet <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Njoftimet"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Asnjë njoftim"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"\"Mikrofoni\" po regjistron"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"\"Kamera\" po regjistron"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"\"Kamera\" dhe \"Mikrofoni\" po regjistrojnë"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"\"Mikrofoni\" ndaloi së regjistruari"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"\"Kamera\" ndaloi së regjistruari"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"\"Kamera\" dhe \"Mikrofoni\" ndaluan së regjistruari"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sr/strings.xml b/packages/SystemUI/res/values-sr/strings.xml
index 0670a9c..91ccdc2 100644
--- a/packages/SystemUI/res/values-sr/strings.xml
+++ b/packages/SystemUI/res/values-sr/strings.xml
@@ -435,8 +435,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Овим ће се одблокирати приступ за све апликације и услуге које имају дозволу за коришћење камере."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Овим ће се одблокирати приступ за све апликације и услуге које имају дозволу за коришћење камере или микрофона."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Уређај"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Превуците нагоре да бисте мењали апликације"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Превуците удесно да бисте брзо променили апликације"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Укључи/искључи преглед"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Напуњена је"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Пуни се"</string>
diff --git a/packages/SystemUI/res/values-sr/strings_tv.xml b/packages/SystemUI/res/values-sr/strings_tv.xml
index 38b106b..d35ff3c 100644
--- a/packages/SystemUI/res/values-sr/strings_tv.xml
+++ b/packages/SystemUI/res/values-sr/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Преко: <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Обавештења"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Нема обавештења"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Микрофон снима"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Камера снима"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Камера и микрофон снимају"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Снимање микрофоном је заустављено"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Снимање камером је заустављено"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Снимање камером и микрофоном је заустављено"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sv/strings.xml b/packages/SystemUI/res/values-sv/strings.xml
index 4ba8999..2ebdce2 100644
--- a/packages/SystemUI/res/values-sv/strings.xml
+++ b/packages/SystemUI/res/values-sv/strings.xml
@@ -158,21 +158,21 @@
<string name="biometric_dialog_tap_confirm" msgid="9166350738859143358">"Slutför genom att trycka på Bekräfta"</string>
<string name="biometric_dialog_authenticated" msgid="7337147327545272484">"Autentiserad"</string>
<string name="biometric_dialog_use_pin" msgid="8385294115283000709">"Använd pinkod"</string>
- <string name="biometric_dialog_use_pattern" msgid="2315593393167211194">"Använd grafiskt lösenord"</string>
+ <string name="biometric_dialog_use_pattern" msgid="2315593393167211194">"Använd mönster"</string>
<string name="biometric_dialog_use_password" msgid="3445033859393474779">"Använd lösenord"</string>
<string name="biometric_dialog_wrong_pin" msgid="1878539073972762803">"Fel pinkod"</string>
- <string name="biometric_dialog_wrong_pattern" msgid="8954812279840889029">"Fel grafiskt lösenord"</string>
+ <string name="biometric_dialog_wrong_pattern" msgid="8954812279840889029">"Fel mönster"</string>
<string name="biometric_dialog_wrong_password" msgid="69477929306843790">"Fel lösenord"</string>
<string name="biometric_dialog_credential_too_many_attempts" msgid="3083141271737748716">"För många felaktiga försök.\nFörsök igen om <xliff:g id="NUMBER">%d</xliff:g> sekunder."</string>
<string name="biometric_dialog_credential_attempts_before_wipe" msgid="6751859711975516999">"Försök igen. Försök <xliff:g id="ATTEMPTS_0">%1$d</xliff:g> av <xliff:g id="MAX_ATTEMPTS">%2$d</xliff:g>."</string>
<string name="biometric_dialog_last_attempt_before_wipe_dialog_title" msgid="2874250099278693477">"Din data raderas."</string>
- <string name="biometric_dialog_last_pattern_attempt_before_wipe_device" msgid="6562299244825817598">"Enhetens data raderas om du anger fel grafiskt lösenord vid nästa försök."</string>
+ <string name="biometric_dialog_last_pattern_attempt_before_wipe_device" msgid="6562299244825817598">"Enhetens data raderas om du ritar fel mönster vid nästa försök."</string>
<string name="biometric_dialog_last_pin_attempt_before_wipe_device" msgid="9151756675698215723">"Enhetens data raderas om du anger fel pinkod vid nästa försök."</string>
<string name="biometric_dialog_last_password_attempt_before_wipe_device" msgid="2363778585575998317">"Enhetens data raderas om du anger fel lösenord vid nästa försök."</string>
- <string name="biometric_dialog_last_pattern_attempt_before_wipe_user" msgid="8400180746043407270">"Användaren raderas om du anger fel grafiskt lösenord vid nästa försök."</string>
+ <string name="biometric_dialog_last_pattern_attempt_before_wipe_user" msgid="8400180746043407270">"Användaren raderas om du ritar fel mönster vid nästa försök."</string>
<string name="biometric_dialog_last_pin_attempt_before_wipe_user" msgid="4159878829962411168">"Användaren raderas om du anger fel pinkod vid nästa försök."</string>
<string name="biometric_dialog_last_password_attempt_before_wipe_user" msgid="4695682515465063885">"Den här användaren raderas om du anger fel lösenord vid nästa försök."</string>
- <string name="biometric_dialog_last_pattern_attempt_before_wipe_profile" msgid="6045224069529284686">"Jobbprofilen och dess data raderas om du anger fel grafiskt lösenord vid nästa försök."</string>
+ <string name="biometric_dialog_last_pattern_attempt_before_wipe_profile" msgid="6045224069529284686">"Jobbprofilen och dess data raderas om du ritar fel mönster vid nästa försök."</string>
<string name="biometric_dialog_last_pin_attempt_before_wipe_profile" msgid="545567685899091757">"Jobbprofilen och dess data raderas om du anger fel pinkod vid nästa försök."</string>
<string name="biometric_dialog_last_password_attempt_before_wipe_profile" msgid="8538032972389729253">"Din jobbprofil och dess data raderas om du anger fel lösenord vid nästa försök."</string>
<string name="biometric_dialog_failed_attempts_now_wiping_device" msgid="6585503524026243042">"För många felaktiga försök. Enhetens data raderas."</string>
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Detta återaktiverar åtkomsten för alla appar och tjänster som tillåts att använda kameran."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Detta återaktiverar åtkomsten för alla appar och tjänster som tillåts att använda kameran eller mikrofonen."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Enhet"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Byt appar genom att svepa uppåt"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Tryck och dra åt höger för att snabbt byta mellan appar"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Aktivera och inaktivera översikten"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Laddat"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Laddar"</string>
diff --git a/packages/SystemUI/res/values-sv/strings_tv.xml b/packages/SystemUI/res/values-sv/strings_tv.xml
index 22f6baa..346d5d2 100644
--- a/packages/SystemUI/res/values-sv/strings_tv.xml
+++ b/packages/SystemUI/res/values-sv/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"via <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Aviseringar"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Inga aviseringar"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofonen spelar in"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kameran spelar in"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kameran och mikrofonen spelar in"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Mikrofonen slutade spela in"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Kameran slutade spela in"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Kameran och mikrofonen slutade spelade in"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sw/strings.xml b/packages/SystemUI/res/values-sw/strings.xml
index 0ba5d05..3eb941d 100644
--- a/packages/SystemUI/res/values-sw/strings.xml
+++ b/packages/SystemUI/res/values-sw/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Hatua hii huruhusu programu na huduma zote zenye idhini zitumie kamera yako."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Hatua hii huruhusu programu na huduma zote zenye idhini zitumie kamera au maikrofoni yako."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Kifaa"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Telezesha kidole juu ili ubadilishe programu"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Buruta kulia ili ubadilishe programu haraka"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Washa Muhtasari"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Betri imejaa"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Inachaji"</string>
diff --git a/packages/SystemUI/res/values-sw/strings_tv.xml b/packages/SystemUI/res/values-sw/strings_tv.xml
index 086a098..a585e69 100644
--- a/packages/SystemUI/res/values-sw/strings_tv.xml
+++ b/packages/SystemUI/res/values-sw/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Kupitia <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Arifa"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Hakuna Arifa"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Maikrofoni inarekodi"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kamera inarekodi"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kamera na Maikrofoni zinarekodi"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Maikrofoni imeacha kurekodi"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Kamera imeacha kurekodi"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Kamera na Maikrofoni zimeacha kurekodi"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ta/strings.xml b/packages/SystemUI/res/values-ta/strings.xml
index 4de2ab5..6a3cf34 100644
--- a/packages/SystemUI/res/values-ta/strings.xml
+++ b/packages/SystemUI/res/values-ta/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"உங்கள் கேமராவைப் பயன்படுத்த அனுமதிக்கப்பட்டுள்ள அனைத்து ஆப்ஸ் மற்றும் சேவைகளை அணுகுவதற்கான தடுப்பை இது நீக்கும்."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"உங்கள் கேமராவையோ மைக்ரோஃபோனையோ பயன்படுத்த அனுமதிக்கப்பட்டுள்ள அனைத்து ஆப்ஸ் மற்றும் சேவைகளை அணுகுவதற்கான தடுப்பை இது நீக்கும்."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"சாதனம்"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"ஆப்ஸிற்கு இடையே மாற்றுவதற்கு, மேல்நோக்கி ஸ்வைப் செய்க"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"ஆப்ஸை வேகமாக மாற்ற, வலப்புறம் இழுக்கவும்"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"மேலோட்டப் பார்வையை நிலைமாற்று"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"சார்ஜ் செய்யப்பட்டது"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"சார்ஜ் ஆகிறது"</string>
diff --git a/packages/SystemUI/res/values-ta/strings_tv.xml b/packages/SystemUI/res/values-ta/strings_tv.xml
index 398ffe9..1dc581d 100644
--- a/packages/SystemUI/res/values-ta/strings_tv.xml
+++ b/packages/SystemUI/res/values-ta/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> வழியாக"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"அறிவிப்புகள்"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"அறிவிப்புகள் எதுவுமில்லை"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"மைக்ரோஃபோன் ரெக்கார்டு செய்கிறது"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"கேமரா ரெக்கார்டு செய்கிறது"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"கேமராவும் மைக்ரோஃபோனும் ரெக்கார்டு செய்கின்றன"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"மைக்ரோஃபோன் ரெக்கார்டு செய்வதை நிறுத்திவிட்டது"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"கேமரா ரெக்கார்டு செய்வதை நிறுத்திவிட்டது"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"கேமராவும் மைக்ரோஃபோனும் ரெக்கார்டு செய்வதை நிறுத்திவிட்டன"</string>
</resources>
diff --git a/packages/SystemUI/res/values-te/strings.xml b/packages/SystemUI/res/values-te/strings.xml
index 6cdaa22..7828d4f 100644
--- a/packages/SystemUI/res/values-te/strings.xml
+++ b/packages/SystemUI/res/values-te/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"మీ కెమెరాను ఉపయోగించడానికి అనుమతి పొందిన అన్ని యాప్లు, సర్వీస్లకు యాక్సెస్ను ఇది అన్బ్లాక్ చేస్తుంది."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"మీ కెమెరాను లేదా మైక్రోఫోన్ను ఉపయోగించడానికి అనుమతి పొందిన అన్ని యాప్లు, సర్వీస్లకు యాక్సెస్ను ఇది అన్బ్లాక్ చేస్తుంది."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"పరికరం"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"యాప్లను మార్చడం కోసం ఎగువకు స్వైప్ చేయండి"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"యాప్లను శీఘ్రంగా స్విచ్ చేయడానికి కుడి వైపుకు లాగండి"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"స్థూలదృష్టిని టోగుల్ చేయి"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"ఛార్జ్ చేయబడింది"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"ఛార్జ్ అవుతోంది"</string>
diff --git a/packages/SystemUI/res/values-te/strings_tv.xml b/packages/SystemUI/res/values-te/strings_tv.xml
index 33c9ec9..7eded1e 100644
--- a/packages/SystemUI/res/values-te/strings_tv.xml
+++ b/packages/SystemUI/res/values-te/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> ద్వారా"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"నోటిఫికేషన్లు"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"నోటిఫికేషన్లు లేవు"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"మైక్రోఫోన్ రికార్డింగ్ చేస్తోంది"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"కెమెరా రికార్డింగ్ చేస్తోంది"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"కెమెరా, మైక్రోఫోన్ రికార్డింగ్ చేస్తున్నాయి"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"మైక్రోఫోన్ రికార్డింగ్ చేయడం ఆపివేసింది"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"కెమెరా రికార్డింగ్ చేయడం ఆపివేసింది"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"కెమెరా, మైక్రోఫోన్ రికార్డింగ్ చేయడం ఆపివేశాయి"</string>
</resources>
diff --git a/packages/SystemUI/res/values-th/strings.xml b/packages/SystemUI/res/values-th/strings.xml
index f2fce1e..a530ef4 100644
--- a/packages/SystemUI/res/values-th/strings.xml
+++ b/packages/SystemUI/res/values-th/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"การดำเนินการนี้จะเลิกบล็อกสิทธิ์เข้าถึงของแอปและบริการทั้งหมดที่ได้รับอนุญาตให้ใช้กล้องของคุณ"</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"การดำเนินการนี้จะเลิกบล็อกสิทธิ์เข้าถึงของแอปและบริการทั้งหมดที่ได้รับอนุญาตให้ใช้กล้องหรือไมโครโฟนของคุณ"</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"อุปกรณ์"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"เลื่อนขึ้นเพื่อสลับแอป"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"ลากไปทางขวาเพื่อสลับแอปอย่างรวดเร็ว"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"สลับภาพรวม"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"ชาร์จแล้ว"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"กำลังชาร์จ"</string>
diff --git a/packages/SystemUI/res/values-th/strings_tv.xml b/packages/SystemUI/res/values-th/strings_tv.xml
index 57cff1f..458dc7e 100644
--- a/packages/SystemUI/res/values-th/strings_tv.xml
+++ b/packages/SystemUI/res/values-th/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"ผ่าน <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"การแจ้งเตือน"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"ไม่มีการแจ้งเตือน"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"ไมโครโฟนกำลังบันทึก"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"กล้องกำลังบันทึก"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"กล้องและไมโครโฟนกำลังบันทึก"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"ไมโครโฟนหยุดบันทึกแล้ว"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"กล้องหยุดบันทึกแล้ว"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"กล้องและไมโครโฟนหยุดบันทึกแล้ว"</string>
</resources>
diff --git a/packages/SystemUI/res/values-tl/strings.xml b/packages/SystemUI/res/values-tl/strings.xml
index 3ef994e..7bf902f 100644
--- a/packages/SystemUI/res/values-tl/strings.xml
+++ b/packages/SystemUI/res/values-tl/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Ina-unblock nito ang access para sa lahat ng app at serbisyong pinapayagang gumamit ng iyong camera."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Ina-unblock nito ang access para sa lahat ng app at serbisyong pinapayagang gumamit ng iyong camera o mikropono."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Device"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Mag-swipe pataas upang lumipat ng app"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"I-drag pakanan para mabilisang magpalipat-lipat ng app"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"I-toggle ang Overview"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Tapos nang mag-charge"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Nagcha-charge"</string>
diff --git a/packages/SystemUI/res/values-tl/strings_tv.xml b/packages/SystemUI/res/values-tl/strings_tv.xml
index 8be6a86..b45d62b 100644
--- a/packages/SystemUI/res/values-tl/strings_tv.xml
+++ b/packages/SystemUI/res/values-tl/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Sa pamamagitan ng <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Mga Notification"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Walang Notification"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Nagre-record ang Mikropono"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Nagre-record ang Camera"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Nagre-record ang Camera at Mikropono"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Huminto sa pag-record ang Mikropono"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Huminto sa pag-record ang Camera"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Huminto sa pag-record ang Camera at Mikropono"</string>
</resources>
diff --git a/packages/SystemUI/res/values-tr/strings.xml b/packages/SystemUI/res/values-tr/strings.xml
index d9afda18..2c51cc4 100644
--- a/packages/SystemUI/res/values-tr/strings.xml
+++ b/packages/SystemUI/res/values-tr/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Bu işlem, kameranızı kullanmasına izin verilen tüm uygulama ve hizmetlere erişimin engellemesini kaldırır."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Bu işlem, kamera veya mikrofonunuzu kullanmasına izin verilen tüm uygulama ve hizmetlere erişimin engellemesini kaldırır."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Cihaz"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Uygulamalar arasında geçiş yapmak için yukarı kaydırın"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Uygulamaları hızlıca değiştirmek için sağa kaydırın"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Genel bakışı aç/kapat"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Şarj oldu"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Şarj oluyor"</string>
diff --git a/packages/SystemUI/res/values-tr/strings_tv.xml b/packages/SystemUI/res/values-tr/strings_tv.xml
index 28b2d77..54f24c3 100644
--- a/packages/SystemUI/res/values-tr/strings_tv.xml
+++ b/packages/SystemUI/res/values-tr/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"<xliff:g id="VPN_APP">%1$s</xliff:g> üzerinden"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Bildirimler"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Bildirim Yok"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Mikrofon kaydediyor"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Kamera kaydediyor"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Kamera ve Mikrofon kaydediyor"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Mikrofon kaydı durdu"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Kamera kaydı durdu"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Kamera ve Mikrofon kaydı durdu"</string>
</resources>
diff --git a/packages/SystemUI/res/values-uk/strings.xml b/packages/SystemUI/res/values-uk/strings.xml
index 50a0f52..ae4772b 100644
--- a/packages/SystemUI/res/values-uk/strings.xml
+++ b/packages/SystemUI/res/values-uk/strings.xml
@@ -437,8 +437,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Усі додатки та сервіси, яким дозволено користуватися вашою камерою, отримають доступ."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Усі додатки та сервіси, яким дозволено користуватися вашою камерою чи мікрофоном, отримають доступ."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Пристрій"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Проводьте пальцем угору, щоб переходити між додатками"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Перетягуйте праворуч, щоб швидко переходити між додатками"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Увімкнути або вимкнути огляд"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Заряджено"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Заряджається"</string>
diff --git a/packages/SystemUI/res/values-uk/strings_tv.xml b/packages/SystemUI/res/values-uk/strings_tv.xml
index c86cf31..2ec6d9a 100644
--- a/packages/SystemUI/res/values-uk/strings_tv.xml
+++ b/packages/SystemUI/res/values-uk/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Через <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Сповіщення"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Немає сповіщень"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Мікрофон записує"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Камера записує"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Камера й мікрофон записують"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Мікрофон припинив запис"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Камера припинила запис"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Камера й мікрофон припинили запис"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ur/strings.xml b/packages/SystemUI/res/values-ur/strings.xml
index 62b09f2..9cad711 100644
--- a/packages/SystemUI/res/values-ur/strings.xml
+++ b/packages/SystemUI/res/values-ur/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"اس سے آپ کا کیمرا استعمال کرنے کے لیے اجازت یافتہ سبھی ایپس اور سروسز کے لیے رسائی غیر مسدود ہو جاتی ہے۔"</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"اس سے آپ کا کیمرا یا مائیکروفون استعمال کرنے کے لیے اجازت یافتہ سبھی ایپس اور سروسز کے لیے رسائی غیر مسدود ہو جاتی ہے۔"</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"آلہ"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"ایپس سوئچ کرنے کیلئے اوپر سوائپ کریں"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"تیزی سے ایپس کو سوئچ کرنے کے لیے دائیں طرف گھسیٹیں"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"مجموعی جائزہ ٹوگل کریں"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"چارج ہوگئی"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"چارج ہو رہی ہے"</string>
diff --git a/packages/SystemUI/res/values-ur/strings_tv.xml b/packages/SystemUI/res/values-ur/strings_tv.xml
index 5810482..566b33f 100644
--- a/packages/SystemUI/res/values-ur/strings_tv.xml
+++ b/packages/SystemUI/res/values-ur/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"بذریعہ <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"اطلاعات"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"کوئی اطلاع نہیں ہے"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"مائیکروفون ریکارڈ کر رہا ہے"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"کیمرا ریکارڈ کر رہا ہے"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"کیمرا اور مائیکروفون ریکارڈ کر رہا ہے"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"مائیکروفون نے ریکارڈ کرنا بند کر دیا"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"کیمرے نے ریکارڈ کرنا بند کر دیا"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"کیمرے اور مائیکروفون نے ریکارڈ کرنا بند کر دیا"</string>
</resources>
diff --git a/packages/SystemUI/res/values-uz/strings.xml b/packages/SystemUI/res/values-uz/strings.xml
index fae90c8..874af0f 100644
--- a/packages/SystemUI/res/values-uz/strings.xml
+++ b/packages/SystemUI/res/values-uz/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Kamerangizdan foydalanishga ruxsat berilgan barcha ilovalar va xizmatlar uchun ruxsatni blokdan chiqaradi."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Kamera va mikrofoningizdan foydalanishga ruxsat berilgan barcha ilovalar va xizmatlar uchun ruxsatni blokdan chiqaradi."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Qurilma"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Ilovalarni almashtirish uchun ekranni tepaga suring"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Ilovalarni tezkor almashtirish uchun o‘ngga torting"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Umumiy nazar rejimini almashtirish"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Quvvat oldi"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Quvvat olmoqda"</string>
diff --git a/packages/SystemUI/res/values-vi/strings.xml b/packages/SystemUI/res/values-vi/strings.xml
index 1ef805f..3506385f 100644
--- a/packages/SystemUI/res/values-vi/strings.xml
+++ b/packages/SystemUI/res/values-vi/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Thao tác này sẽ bỏ chặn quyền truy cập cho mọi ứng dụng và dịch vụ được phép sử dụng máy ảnh của bạn."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Thao tác này sẽ bỏ chặn quyền truy cập cho mọi ứng dụng và dịch vụ được phép sử dụng máy ảnh hoặc micrô của bạn."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Thiết bị"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Vuốt lên để chuyển đổi ứng dụng"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Kéo sang phải để chuyển đổi nhanh giữa các ứng dụng"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Bật/tắt chế độ xem Tổng quan"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Đã sạc đầy"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Đang sạc"</string>
diff --git a/packages/SystemUI/res/values-vi/strings_tv.xml b/packages/SystemUI/res/values-vi/strings_tv.xml
index 21f5471..0144884 100644
--- a/packages/SystemUI/res/values-vi/strings_tv.xml
+++ b/packages/SystemUI/res/values-vi/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Thông qua <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Thông báo"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Không có thông báo"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Micrô đang ghi"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Máy ảnh đang ghi"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Máy ảnh và micrô đang ghi"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Micrô đã dừng ghi"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Máy ảnh đã dừng ghi"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Máy ảnh và micrô đã dừng ghi"</string>
</resources>
diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml
index a8b8285..62a4133 100644
--- a/packages/SystemUI/res/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"这将会为所有获准使用您摄像头的应用和服务启用这项权限。"</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"这将会为所有获准使用您的摄像头或麦克风的应用和服务启用这项权限。"</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"设备"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"向上滑动可切换应用"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"向右拖动可快速切换应用"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"切换概览"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"已充满"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"正在充电"</string>
diff --git a/packages/SystemUI/res/values-zh-rCN/strings_tv.xml b/packages/SystemUI/res/values-zh-rCN/strings_tv.xml
index ca814a3..ed914c9 100644
--- a/packages/SystemUI/res/values-zh-rCN/strings_tv.xml
+++ b/packages/SystemUI/res/values-zh-rCN/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"通过“<xliff:g id="VPN_APP">%1$s</xliff:g>”"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"通知"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"没有通知"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"麦克风正在录制"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"相机正在录制"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"相机和麦克风正在录制"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"麦克风已停止录制"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"相机已停止录制"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"相机和麦克风已停止录制"</string>
</resources>
diff --git a/packages/SystemUI/res/values-zh-rHK/strings.xml b/packages/SystemUI/res/values-zh-rHK/strings.xml
index 9e498f6..42badd4 100644
--- a/packages/SystemUI/res/values-zh-rHK/strings.xml
+++ b/packages/SystemUI/res/values-zh-rHK/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"解除封鎖後,凡有存取權的應用程式和服務都可使用您的相機。"</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"解除封鎖後,凡有存取權的應用程式和服務都可使用您的相機或麥克風。"</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"裝置"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"向上滑動即可切換應用程式"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"向右拖曳即可快速切換應用程式"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"切換概覽"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"已完成充電"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"充電中"</string>
diff --git a/packages/SystemUI/res/values-zh-rHK/strings_tv.xml b/packages/SystemUI/res/values-zh-rHK/strings_tv.xml
index f992b62..dfc34e5 100644
--- a/packages/SystemUI/res/values-zh-rHK/strings_tv.xml
+++ b/packages/SystemUI/res/values-zh-rHK/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"透過 <xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"通知"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"沒有通知"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"麥克風正在錄音"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"相機正在錄影"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"相機和麥克風正在錄影及錄音"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"麥克風已停止錄音"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"相機已停止錄影"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"相機和麥克風已停止錄影及錄音"</string>
</resources>
diff --git a/packages/SystemUI/res/values-zh-rTW/strings.xml b/packages/SystemUI/res/values-zh-rTW/strings.xml
index 1b0fa10..ea5aac6 100644
--- a/packages/SystemUI/res/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res/values-zh-rTW/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"這麼做可允許所有應用程式和服務使用相機。"</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"這麼做可允許所有應用程式和服務使用相機或麥克風。"</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"裝置"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"向上滑動即可切換應用程式"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"向右拖曳即可快速切換應用程式"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"切換總覽"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"已充飽"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"充電中"</string>
diff --git a/packages/SystemUI/res/values-zh-rTW/strings_tv.xml b/packages/SystemUI/res/values-zh-rTW/strings_tv.xml
index 94135d2..869ac48 100644
--- a/packages/SystemUI/res/values-zh-rTW/strings_tv.xml
+++ b/packages/SystemUI/res/values-zh-rTW/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"透過「<xliff:g id="VPN_APP">%1$s</xliff:g>」"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"通知"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"沒有通知"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"麥克風正在錄音"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"相機正在錄影"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"相機和麥克風正在錄影及錄音"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"麥克風已停止錄音"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"相機已停止錄影"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"相機和麥克風已停止錄影及錄音"</string>
</resources>
diff --git a/packages/SystemUI/res/values-zu/strings.xml b/packages/SystemUI/res/values-zu/strings.xml
index a14229a..de986d2 100644
--- a/packages/SystemUI/res/values-zu/strings.xml
+++ b/packages/SystemUI/res/values-zu/strings.xml
@@ -433,8 +433,6 @@
<string name="sensor_privacy_start_use_camera_dialog_content" msgid="4704948062372435963">"Lokhu kuvulela ukufinyelela kwawo wonke ama-app namasevisi avunyelwe ukusebenzisa ikhamera yakho."</string>
<string name="sensor_privacy_start_use_mic_camera_dialog_content" msgid="3577642558418404919">"Lokhu kuvulela ukufinyelela kwawo wonke ama-app namasevisi avunyelwe ukusebenzisa ikhamera yakho noma imakrofoni."</string>
<string name="media_seamless_remote_device" msgid="177033467332920464">"Idivayisi"</string>
- <string name="recents_swipe_up_onboarding" msgid="2820265886420993995">"Swayiphela phezulu ukuze ushintshe izinhlelo zokusebenza"</string>
- <string name="recents_quick_scrub_onboarding" msgid="765934300283514912">"Hudula ngqo ukuze ushintshe ngokushesha izinhlelo zokusebenza"</string>
<string name="quick_step_accessibility_toggle_overview" msgid="7908949976727578403">"Guqula ukubuka konke"</string>
<string name="expanded_header_battery_charged" msgid="5307907517976548448">"Kushajiwe"</string>
<string name="expanded_header_battery_charging" msgid="1717522253171025549">"Iyashaja"</string>
diff --git a/packages/SystemUI/res/values-zu/strings_tv.xml b/packages/SystemUI/res/values-zu/strings_tv.xml
index 79a6575..a3e5255 100644
--- a/packages/SystemUI/res/values-zu/strings_tv.xml
+++ b/packages/SystemUI/res/values-zu/strings_tv.xml
@@ -26,16 +26,10 @@
<string name="notification_disclosure_vpn_text" msgid="3873532735584866236">"Nge-<xliff:g id="VPN_APP">%1$s</xliff:g>"</string>
<string name="tv_notification_panel_title" msgid="5311050946506276154">"Izaziso"</string>
<string name="tv_notification_panel_no_notifications" msgid="9115191912267270678">"Azikho Izaziso"</string>
- <!-- no translation found for mic_recording_announcement (7587123608060316575) -->
- <skip />
- <!-- no translation found for camera_recording_announcement (7240177719403759112) -->
- <skip />
- <!-- no translation found for mic_and_camera_recording_announcement (8599231390508812667) -->
- <skip />
- <!-- no translation found for mic_stopped_recording_announcement (7301537004900721242) -->
- <skip />
- <!-- no translation found for camera_stopped_recording_announcement (8540496432367032801) -->
- <skip />
- <!-- no translation found for mic_camera_stopped_recording_announcement (8708524579599977412) -->
- <skip />
+ <string name="mic_recording_announcement" msgid="7587123608060316575">"Imakrofoni iyarekhoda"</string>
+ <string name="camera_recording_announcement" msgid="7240177719403759112">"Ikhamera iyarekhoda"</string>
+ <string name="mic_and_camera_recording_announcement" msgid="8599231390508812667">"Ikhamera nemakrofoni kuyarekhoda"</string>
+ <string name="mic_stopped_recording_announcement" msgid="7301537004900721242">"Imakrofoni iyekile ukurekhoda"</string>
+ <string name="camera_stopped_recording_announcement" msgid="8540496432367032801">"Ikhamera iyeke ukurekhoda"</string>
+ <string name="mic_camera_stopped_recording_announcement" msgid="8708524579599977412">"Ikhemera nemakrofoni kuyekile ukurekhoda"</string>
</resources>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index bf29cf4..6dc7bc6 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -313,7 +313,8 @@
<!-- SystemUIFactory component -->
<string name="config_systemUIFactoryComponent" translatable="false">com.android.systemui.SystemUIFactory</string>
- <!-- SystemUI Services: The classes of the stuff to start. -->
+ <!-- SystemUI Services: The classes of base stuff to start by default for all
+ configurations. -->
<string-array name="config_systemUIServiceComponents" translatable="false">
<item>com.android.systemui.util.NotificationChannels</item>
<item>com.android.systemui.keyguard.KeyguardViewMediator</item>
@@ -340,6 +341,12 @@
<item>com.android.systemui.wmshell.WMShell</item>
</string-array>
+ <!-- SystemUI Services: The classes of the additional stuff to start. Services here are
+ specified as an overlay to provide configuration-specific services that
+ supplement those listed in config_systemUIServiceComponents. -->
+ <string-array name="config_additionalSystemUIServiceComponents" translatable="false">
+ </string-array>
+
<!-- QS tile shape store width. negative implies fill configuration instead of stroke-->
<dimen name="config_qsTileStrokeWidthActive">-1dp</dimen>
<dimen name="config_qsTileStrokeWidthInactive">-1dp</dimen>
@@ -666,4 +673,10 @@
1 - Override the setting to always bypass keyguard
2 - Override the setting to never bypass keyguard -->
<integer name="config_face_unlock_bypass_override">0</integer>
+
+ <!-- Whether the communal service should be enabled -->
+ <bool name="config_communalServiceEnabled">false</bool>
+
+ <!-- Component name of communal source service -->
+ <string name="config_communalSourceComponent" translatable="false">@null</string>
</resources>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 22035f4..2a9c54dd 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -931,6 +931,7 @@
<dimen name="keyguard_lock_padding">20dp</dimen>
<dimen name="keyguard_indication_margin_bottom">32dp</dimen>
+ <dimen name="lock_icon_margin_bottom">98dp</dimen>
<!-- The text size for battery level -->
<dimen name="battery_level_text_size">12sp</dimen>
@@ -1275,6 +1276,8 @@
<!-- Three privacy items. This value must not be exceeded -->
<dimen name="ongoing_appops_chip_max_width">76dp</dimen>
<dimen name="ongoing_appops_dot_diameter">6dp</dimen>
+ <!-- Total minimum padding to enforce to ensure that the dot can always show -->
+ <dimen name="ongoing_appops_dot_min_padding">20dp</dimen>
<dimen name="ongoing_appops_dialog_side_margins">@dimen/notification_shade_content_margin_horizontal</dimen>
@@ -1462,7 +1465,7 @@
<dimen name="lockscreen_shade_notification_movement">24dp</dimen>
<!-- Maximum overshoot for the pulse expansion -->
- <dimen name="pulse_expansion_max_top_overshoot">16dp</dimen>
+ <dimen name="pulse_expansion_max_top_overshoot">32dp</dimen>
<dimen name="people_space_widget_radius">28dp</dimen>
<dimen name="people_space_image_radius">20dp</dimen>
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index ec951ff..a8812bf 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -1064,6 +1064,9 @@
<!-- Message shown when lock screen is tapped or face authentication fails. [CHAR LIMIT=60] -->
<string name="keyguard_unlock">Swipe up to open</string>
+ <!-- Message shown when lock screen is tapped or face authentication fails. Provides extra instructions for how the user can enter their device (unlock or proceed to home) [CHAR LIMIT=60] -->
+ <string name="keyguard_unlock_press">Press to open</string>
+
<!-- Message shown when face authentication fails and the pin pad is visible. [CHAR LIMIT=60] -->
<string name="keyguard_retry">Swipe up to try again</string>
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/communal/ICommunalHost.aidl b/packages/SystemUI/shared/src/com/android/systemui/shared/communal/ICommunalHost.aidl
new file mode 100644
index 0000000..b76be4f
--- /dev/null
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/communal/ICommunalHost.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.shared.communal;
+
+import com.android.systemui.shared.communal.ICommunalSource;
+
+/**
+* An interface, implemented by SystemUI, for hosting a shared, communal surface on the lock
+* screen. Clients declare themselves sources (as defined by ICommunalSource). ICommunalHost is
+* meant only for the input of said sources. The lifetime scope and interactions that follow after
+* are bound to source.
+*/
+oneway interface ICommunalHost {
+ /**
+ * Invoked to specify the CommunalSource that should be consulted for communal surfaces to be
+ * displayed.
+ */
+ void setSource(in ICommunalSource source) = 1;
+}
\ No newline at end of file
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/communal/ICommunalSource.aidl b/packages/SystemUI/shared/src/com/android/systemui/shared/communal/ICommunalSource.aidl
new file mode 100644
index 0000000..7ef403b
--- /dev/null
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/communal/ICommunalSource.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.shared.communal;
+
+import com.android.systemui.shared.communal.ICommunalSurfaceCallback;
+
+/**
+ * An interface, implemented by clients of CommunalHost, to provide communal surfaces for SystemUI.
+ * The associated binder proxy will be retained by SystemUI and called on-demand when a communal
+ * surface is needed (either new instantiation or update).
+ */
+oneway interface ICommunalSource {
+ /**
+ * Called by the CommunalHost when a new communal surface is needed. The provided arguments
+ * match the arguments necessary to construct a SurfaceControlViewHost for producing a
+ * SurfacePackage to return.
+ */
+ void getCommunalSurface(in IBinder hostToken, in int width, in int height, in int displayId,
+ in ICommunalSurfaceCallback callback) = 1;
+}
\ No newline at end of file
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/communal/ICommunalSurfaceCallback.aidl b/packages/SystemUI/shared/src/com/android/systemui/shared/communal/ICommunalSurfaceCallback.aidl
new file mode 100644
index 0000000..58acce0
--- /dev/null
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/communal/ICommunalSurfaceCallback.aidl
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.shared.communal;
+
+import android.view.SurfaceControlViewHost;
+
+/**
+* An interface for receiving the result of a surface request. ICommunalSurfaceCallback is
+* implemented by the CommunalHost (SystemUI) to process the results of a new communal surface.
+*/
+interface ICommunalSurfaceCallback {
+ /**
+ * Invoked when the CommunalSurface has generated the SurfacePackage to be displayed.
+ */
+ void onSurface(in SurfaceControlViewHost.SurfacePackage surfacePackage) = 1;
+}
\ No newline at end of file
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteTransitionCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteTransitionCompat.java
index 7f2d252..2519284 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteTransitionCompat.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteTransitionCompat.java
@@ -131,12 +131,13 @@
t.setLayer(leashMap.get(change.getLeash()),
info.getChanges().size() * 3 - i);
final ActivityManager.RunningTaskInfo taskInfo = change.getTaskInfo();
- if (taskInfo != null) {
- pausingTask = change.getTaskInfo().token;
+ if (taskInfo == null) {
+ continue;
}
+ pausingTask = taskInfo.token;
if (taskInfo.pictureInPictureParams != null
&& taskInfo.pictureInPictureParams.isAutoEnterEnabled()) {
- pipTask = change.getTaskInfo().token;
+ pipTask = taskInfo.token;
}
}
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java
index 8fc4240..82ade7a 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java
@@ -22,15 +22,14 @@
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
-import android.widget.LinearLayout;
+
+import androidx.constraintlayout.widget.ConstraintLayout;
import com.android.internal.jank.InteractionJankMonitor;
import com.android.settingslib.animation.AppearAnimationUtils;
import com.android.settingslib.animation.DisappearAnimationUtils;
import com.android.systemui.R;
-import java.util.List;
-
/**
* Displays a PIN pad for unlocking.
*/
@@ -40,10 +39,6 @@
private final DisappearAnimationUtils mDisappearAnimationUtils;
private final DisappearAnimationUtils mDisappearAnimationUtilsLocked;
private ViewGroup mContainer;
- private ViewGroup mRow0;
- private ViewGroup mRow1;
- private ViewGroup mRow2;
- private ViewGroup mRow3;
private int mDisappearYTranslation;
private View[][] mViews;
@@ -82,30 +77,38 @@
}
private void updateMargins() {
+ // Re-apply everything to the keys...
int bottomMargin = mContext.getResources().getDimensionPixelSize(
- R.dimen.num_pad_row_margin_bottom);
-
- for (ViewGroup vg : List.of(mRow1, mRow2, mRow3)) {
- ((LinearLayout.LayoutParams) vg.getLayoutParams()).setMargins(0, 0, 0, bottomMargin);
- }
-
- bottomMargin = mContext.getResources().getDimensionPixelSize(
R.dimen.num_pad_entry_row_margin_bottom);
- ((LinearLayout.LayoutParams) mRow0.getLayoutParams()).setMargins(0, 0, 0, bottomMargin);
+ int rightMargin = mContext.getResources().getDimensionPixelSize(
+ R.dimen.num_pad_key_margin_end);
+ String ratio = mContext.getResources().getString(R.string.num_pad_key_ratio);
- if (mEcaView != null) {
- int ecaTopMargin = mContext.getResources().getDimensionPixelSize(
- R.dimen.keyguard_eca_top_margin);
- int ecaBottomMargin = mContext.getResources().getDimensionPixelSize(
- R.dimen.keyguard_eca_bottom_margin);
- ((LinearLayout.LayoutParams) mEcaView.getLayoutParams()).setMargins(0, ecaTopMargin,
- 0, ecaBottomMargin);
+ // mView contains all Views that make up the PIN pad; row0 = the entry test field, then
+ // rows 1-4 contain the buttons. Iterate over all views that make up the buttons in the pad,
+ // and re-set all the margins.
+ for (int row = 1; row < 5; row++) {
+ for (int column = 0; column < 3; column++) {
+ View key = mViews[row][column];
+
+ ConstraintLayout.LayoutParams lp =
+ (ConstraintLayout.LayoutParams) key.getLayoutParams();
+
+ lp.dimensionRatio = ratio;
+
+ // Don't set any margins on the last row of buttons.
+ if (row != 4) {
+ lp.bottomMargin = bottomMargin;
+ }
+
+ // Don't set margins on the rightmost buttons.
+ if (column != 2) {
+ lp.rightMargin = rightMargin;
+ }
+
+ key.setLayoutParams(lp);
+ }
}
-
- View entryView = findViewById(R.id.pinEntry);
- ViewGroup.LayoutParams lp = entryView.getLayoutParams();
- lp.height = mContext.getResources().getDimensionPixelSize(R.dimen.keyguard_password_height);
- entryView.setLayoutParams(lp);
}
@Override
@@ -113,13 +116,9 @@
super.onFinishInflate();
mContainer = findViewById(R.id.pin_container);
- mRow0 = findViewById(R.id.row0);
- mRow1 = findViewById(R.id.row1);
- mRow2 = findViewById(R.id.row2);
- mRow3 = findViewById(R.id.row3);
mViews = new View[][]{
new View[]{
- mRow0, null, null
+ findViewById(R.id.row0), null, null
},
new View[]{
findViewById(R.id.key1), findViewById(R.id.key2),
@@ -188,9 +187,6 @@
private void enableClipping(boolean enable) {
mContainer.setClipToPadding(enable);
mContainer.setClipChildren(enable);
- mRow1.setClipToPadding(enable);
- mRow2.setClipToPadding(enable);
- mRow3.setClipToPadding(enable);
setClipChildren(enable);
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 0e25fac..20b3eb1 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -2068,6 +2068,15 @@
}
/**
+ * @return if udfps is available on this device. will return true even if the user hasn't
+ * enrolled udfps.
+ */
+ public boolean isUdfpsAvailable() {
+ return mAuthController.getUdfpsProps() != null
+ && !mAuthController.getUdfpsProps().isEmpty();
+ }
+
+ /**
* @return true if there's at least one face enrolled
*/
public boolean isFaceEnrolled() {
diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
index 8b974b4..9c8582fa 100644
--- a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
@@ -72,7 +72,10 @@
*/
@StatusBarComponent.StatusBarScope
public class LockIconViewController extends ViewController<LockIconView> implements Dumpable {
-
+ private static final float sDefaultDensity =
+ (float) DisplayMetrics.DENSITY_DEVICE_STABLE / (float) DisplayMetrics.DENSITY_DEFAULT;
+ private static final int sLockIconRadiusPx = (int) (sDefaultDensity * 36);
+ private static final float sDistAboveKgBottomAreaPx = sDefaultDensity * 12;
private static final AudioAttributes VIBRATION_SONIFICATION_ATTRIBUTES =
new AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
@@ -111,9 +114,7 @@
private boolean mHasUdfps;
private float mHeightPixels;
private float mWidthPixels;
- private float mDensity;
- private int mAmbientIndicationHeight; // in pixels
- private int mKgIndicationHeight; // in pixels
+ private int mBottomPadding; // in pixels
private boolean mShowUnlockIcon;
private boolean mShowLockIcon;
@@ -318,11 +319,8 @@
final DisplayMetrics metrics = mView.getContext().getResources().getDisplayMetrics();
mWidthPixels = metrics.widthPixels;
mHeightPixels = metrics.heightPixels;
- mDensity = metrics.density;
- mKgIndicationHeight = mView.getContext().getResources().getDimensionPixelSize(
- R.dimen.keyguard_indication_margin_bottom)
- + mView.getContext().getResources().getDimensionPixelSize(
- R.dimen.keyguard_indication_bottom_padding);
+ mBottomPadding = mView.getContext().getResources().getDimensionPixelSize(
+ R.dimen.lock_icon_margin_bottom);
updateLockIconLocation();
}
@@ -332,26 +330,15 @@
mView.setCenterLocation(new PointF(props.sensorLocationX, props.sensorLocationY),
props.sensorRadius);
} else {
- final float distAboveKgBottomArea = 12 * mDensity;
- final float radius = 36 * mDensity;
- final int kgBottomAreaHeight = Math.max(mKgIndicationHeight, mAmbientIndicationHeight);
mView.setCenterLocation(
new PointF(mWidthPixels / 2,
- mHeightPixels - kgBottomAreaHeight - distAboveKgBottomArea
- - radius / 2), (int) radius);
+ mHeightPixels - mBottomPadding - sDistAboveKgBottomAreaPx
+ - sLockIconRadiusPx), sLockIconRadiusPx);
}
mView.getHitRect(mSensorTouchLocation);
}
- /**
- * Set the location of ambient indication if showing (ie: now playing)
- */
- public void setAmbientIndicationBottomPadding(int ambientIndicationBottomPadding) {
- mAmbientIndicationHeight = ambientIndicationBottomPadding;
- updateLockIconLocation();
- }
-
@Override
public void dump(@NonNull FileDescriptor fd, @NonNull PrintWriter pw, @NonNull String[] args) {
pw.println("mUdfpsEnrolled: " + mUdfpsEnrolled);
diff --git a/packages/SystemUI/src/com/android/keyguard/NumPadButton.java b/packages/SystemUI/src/com/android/keyguard/NumPadButton.java
index 57407f1..99f9558 100644
--- a/packages/SystemUI/src/com/android/keyguard/NumPadButton.java
+++ b/packages/SystemUI/src/com/android/keyguard/NumPadButton.java
@@ -59,7 +59,9 @@
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
// Set width/height to the same value to ensure a smooth circle for the bg, but shrink
- // the height to match the old pin bouncer
+ // the height to match the old pin bouncer.
+ // This is only used for PIN/PUK; the main PIN pad now uses ConstraintLayout, which will
+ // force our width/height to conform to the ratio in the layout.
int width = getMeasuredWidth();
boolean shortenHeight = mAnimator == null
diff --git a/packages/SystemUI/src/com/android/keyguard/NumPadKey.java b/packages/SystemUI/src/com/android/keyguard/NumPadKey.java
index 232c6fc..e79ea9a 100644
--- a/packages/SystemUI/src/com/android/keyguard/NumPadKey.java
+++ b/packages/SystemUI/src/com/android/keyguard/NumPadKey.java
@@ -175,7 +175,9 @@
measureChildren(widthMeasureSpec, heightMeasureSpec);
// Set width/height to the same value to ensure a smooth circle for the bg, but shrink
- // the height to match the old pin bouncer
+ // the height to match the old pin bouncer.
+ // This is only used for PIN/PUK; the main PIN pad now uses ConstraintLayout, which will
+ // force our width/height to conform to the ratio in the layout.
int width = getMeasuredWidth();
boolean shortenHeight = mAnimator == null
diff --git a/packages/SystemUI/src/com/android/systemui/GuestResumeSessionReceiver.java b/packages/SystemUI/src/com/android/systemui/GuestResumeSessionReceiver.java
index 1d355f2..b5b6b13 100644
--- a/packages/SystemUI/src/com/android/systemui/GuestResumeSessionReceiver.java
+++ b/packages/SystemUI/src/com/android/systemui/GuestResumeSessionReceiver.java
@@ -93,7 +93,7 @@
SETTING_GUEST_HAS_LOGGED_IN, 0, userId);
if (notFirstLogin != 0) {
mNewSessionDialog = new ResetSessionDialog(context, mUserSwitcherController,
- mUserTracker, mUiEventLogger, userId);
+ mUiEventLogger, userId);
mNewSessionDialog.show();
} else {
mSecureSettings.putIntForUser(SETTING_GUEST_HAS_LOGGED_IN, 1, userId);
@@ -126,7 +126,6 @@
ResetSessionDialog(Context context,
UserSwitcherController userSwitcherController,
- UserTracker userTracker,
UiEventLogger uiEventLogger,
int userId) {
super(context);
diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java
index 865ca40..4fd2701 100644
--- a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java
+++ b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java
@@ -42,6 +42,8 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Collections;
/**
* Application class for SystemUI.
@@ -159,8 +161,17 @@
*/
public void startServicesIfNeeded() {
- String[] names = SystemUIFactory.getInstance().getSystemUIServiceComponents(getResources());
- startServicesIfNeeded(/* metricsPrefix= */ "StartServices", names);
+ final String[] names = SystemUIFactory.getInstance()
+ .getSystemUIServiceComponents(getResources());
+ final String[] additionalNames = SystemUIFactory.getInstance()
+ .getAdditionalSystemUIServiceComponents(getResources());
+
+ final ArrayList<String> serviceComponents = new ArrayList<>();
+ Collections.addAll(serviceComponents, names);
+ Collections.addAll(serviceComponents, additionalNames);
+
+ startServicesIfNeeded(/* metricsPrefix= */ "StartServices",
+ serviceComponents.toArray(new String[serviceComponents.size()]));
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java b/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java
index a28223d..d31301a 100644
--- a/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java
+++ b/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java
@@ -187,6 +187,13 @@
}
/**
+ * Returns the list of additional system UI components that should be started.
+ */
+ public String[] getAdditionalSystemUIServiceComponents(Resources resources) {
+ return resources.getStringArray(R.array.config_additionalSystemUIServiceComponents);
+ }
+
+ /**
* Returns the list of system UI components that should be started per user.
*/
public String[] getSystemUIServiceComponentsPerUser(Resources resources) {
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/AccessibilityButtonModeObserver.java b/packages/SystemUI/src/com/android/systemui/accessibility/AccessibilityButtonModeObserver.java
index 9bedb1e..fbb909f 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/AccessibilityButtonModeObserver.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/AccessibilityButtonModeObserver.java
@@ -17,6 +17,7 @@
package com.android.systemui.accessibility;
import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU;
+import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_GESTURE;
import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR;
import android.annotation.IntDef;
@@ -49,7 +50,8 @@
@Retention(RetentionPolicy.SOURCE)
@IntDef({
ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR,
- ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU
+ ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU,
+ ACCESSIBILITY_BUTTON_MODE_GESTURE
})
public @interface AccessibilityButtonMode {}
diff --git a/packages/SystemUI/src/com/android/systemui/communal/CommunalHostView.java b/packages/SystemUI/src/com/android/systemui/communal/CommunalHostView.java
new file mode 100644
index 0000000..6e2fcd1
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/communal/CommunalHostView.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.communal;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.FrameLayout;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+/**
+ * Container for communal presentation. Containing communal-related view to this parent view allows
+ * for aggregate measurement/layout adjustments and capturing said values before the communal views
+ * might be available.
+ */
+public class CommunalHostView extends FrameLayout {
+ public CommunalHostView(@NonNull Context context) {
+ this(context, null, 0);
+ }
+
+ public CommunalHostView(@NonNull Context context,
+ @Nullable AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public CommunalHostView(@NonNull Context context, @Nullable AttributeSet attrs,
+ int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/communal/CommunalHostViewController.java b/packages/SystemUI/src/com/android/systemui/communal/CommunalHostViewController.java
new file mode 100644
index 0000000..268ba64
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/communal/CommunalHostViewController.java
@@ -0,0 +1,205 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.communal;
+
+import android.content.Context;
+import android.util.Log;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.android.systemui.dagger.qualifiers.Main;
+import com.android.systemui.plugins.statusbar.StatusBarStateController;
+import com.android.systemui.statusbar.notification.AnimatableProperty;
+import com.android.systemui.statusbar.notification.PropertyAnimator;
+import com.android.systemui.statusbar.notification.stack.AnimationProperties;
+import com.android.systemui.statusbar.notification.stack.StackStateAnimator;
+import com.android.systemui.statusbar.policy.KeyguardStateController;
+import com.android.systemui.util.ViewController;
+
+import com.google.common.util.concurrent.ListenableFuture;
+
+import java.lang.ref.WeakReference;
+import java.util.concurrent.Executor;
+
+import javax.inject.Inject;
+
+/**
+ * Injectable controller for {@link CommunalHostView}.
+ */
+public class CommunalHostViewController extends ViewController<CommunalHostView> {
+ private static final String TAG = "CommunalController";
+ private static final boolean DEBUG = false;
+ private static final AnimationProperties ANIMATION_PROPERTIES =
+ new AnimationProperties().setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD);
+
+ private final Executor mMainExecutor;
+ private final KeyguardStateController mKeyguardStateController;
+ private final StatusBarStateController mStatusBarStateController;
+ private WeakReference<CommunalSource> mLastSource;
+ private int mState;
+
+ private static final int STATE_KEYGUARD_SHOWING = 1 << 0;
+ private static final int STATE_DOZING = 1 << 1;
+
+ // Only show communal view when keyguard is showing and not dozing.
+ private static final int SHOW_COMMUNAL_VIEW_REQUIRED_STATES = STATE_KEYGUARD_SHOWING;
+ private static final int SHOW_COMMUNAL_VIEW_INVALID_STATES = STATE_DOZING;
+
+ private KeyguardStateController.Callback mKeyguardCallback =
+ new KeyguardStateController.Callback() {
+ @Override
+ public void onKeyguardShowingChanged() {
+ final boolean isShowing = mKeyguardStateController.isShowing();
+ if (DEBUG) {
+ Log.d(TAG, "setKeyguardShowing:" + isShowing);
+ }
+
+ setState(STATE_KEYGUARD_SHOWING, isShowing);
+ }
+ };
+
+ private StatusBarStateController.StateListener mDozeCallback =
+ new StatusBarStateController.StateListener() {
+ @Override
+ public void onDozingChanged(boolean isDozing) {
+ if (DEBUG) {
+ Log.d(TAG, "setDozing:" + isDozing);
+ }
+
+ setState(STATE_DOZING, isDozing);
+ }
+ };
+
+ @Inject
+ protected CommunalHostViewController(@Main Executor mainExecutor,
+ KeyguardStateController keyguardStateController,
+ StatusBarStateController statusBarStateController, CommunalHostView view) {
+ super(view);
+ mMainExecutor = mainExecutor;
+ mKeyguardStateController = keyguardStateController;
+ mStatusBarStateController = statusBarStateController;
+ mState = 0;
+
+ if (mKeyguardStateController.isShowing()) {
+ mState |= STATE_KEYGUARD_SHOWING;
+ }
+
+ if (mStatusBarStateController.isDozing()) {
+ mState |= STATE_DOZING;
+ }
+
+ mKeyguardStateController.addCallback(mKeyguardCallback);
+ mStatusBarStateController.addCallback(mDozeCallback);
+ }
+
+ @Override
+ protected void onViewAttached() {
+ mKeyguardStateController.removeCallback(mKeyguardCallback);
+ mKeyguardStateController.addCallback(mKeyguardCallback);
+ mStatusBarStateController.removeCallback(mDozeCallback);
+ mStatusBarStateController.addCallback(mDozeCallback);
+ }
+
+ @Override
+ protected void onViewDetached() {
+ mKeyguardStateController.removeCallback(mKeyguardCallback);
+ mStatusBarStateController.removeCallback(mDozeCallback);
+ }
+
+ private void setState(int stateFlag, boolean enabled) {
+ final int existingState = mState;
+ if (DEBUG) {
+ Log.d(TAG, "setState flag:" + stateFlag + " enabled:" + enabled);
+ }
+
+ if (enabled) {
+ mState |= stateFlag;
+ } else {
+ mState &= ~stateFlag;
+ }
+
+ if (DEBUG) {
+ Log.d(TAG, "updated state:" + mState);
+ }
+
+ if (existingState != mState) {
+ showSource();
+ }
+ }
+
+ private void showSource() {
+ // Make sure all necessary states are present for showing communal and all invalid states
+ // are absent
+ mMainExecutor.execute(() -> {
+ final CommunalSource currentSource = mLastSource != null ? mLastSource.get() : null;
+
+ if ((mState & SHOW_COMMUNAL_VIEW_REQUIRED_STATES) == SHOW_COMMUNAL_VIEW_REQUIRED_STATES
+ && (mState & SHOW_COMMUNAL_VIEW_INVALID_STATES) == 0
+ && currentSource != null) {
+ mView.removeAllViews();
+
+ // Make view visible.
+ mView.setVisibility(View.VISIBLE);
+
+ final Context context = mView.getContext();
+
+ final ListenableFuture<View> listenableFuture =
+ currentSource.requestCommunalView(context);
+
+ if (listenableFuture == null) {
+ Log.e(TAG, "could not request communal view");
+ return;
+ }
+
+ listenableFuture.addListener(() -> {
+ try {
+ final View view = listenableFuture.get();
+ view.setLayoutParams(new ViewGroup.LayoutParams(
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT));
+ mView.addView(view);
+ } catch (Exception e) {
+ Log.e(TAG, "could not obtain communal view through callback:" + e);
+ }
+ }, mMainExecutor);
+ } else {
+ mView.removeAllViews();
+ mView.setVisibility(View.INVISIBLE);
+ }
+ });
+ }
+
+ /**
+ * Instructs {@link CommunalHostViewController} to display provided source.
+ *
+ * @param source The new {@link CommunalSource}, {@code null} if not set.
+ */
+ public void show(WeakReference<CommunalSource> source) {
+ mLastSource = source;
+ showSource();
+ }
+
+ /**
+ * Sets the Y position of the {@link CommunalHostView}
+ *
+ * @param y Offset from parent top.
+ * @param animate Whether the change should be animated.
+ */
+ public void updatePositionY(int y, boolean animate) {
+ PropertyAnimator.setProperty(mView, AnimatableProperty.Y, y, ANIMATION_PROPERTIES, animate);
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/communal/CommunalSource.java b/packages/SystemUI/src/com/android/systemui/communal/CommunalSource.java
new file mode 100644
index 0000000..742e4b1
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/communal/CommunalSource.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.communal;
+
+import android.content.Context;
+import android.view.View;
+
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * {@link CommunalSource} defines an interface for working with a source for communal data. Clients
+ * may request a communal surface that can be shown within a {@link android.view.SurfaceView}.
+ * Callbacks may also be registered to listen to state changes.
+ */
+public interface CommunalSource {
+ /**
+ * Requests a communal surface that can be displayed inside {@link CommunalHostView}.
+ *
+ * @param context The {@link View} {@link Context} to build the resulting view from
+ * @return A future that can be listened upon for the resulting {@link View}. The value will be
+ * {@code null} in case of a failure.
+ */
+ ListenableFuture<View> requestCommunalView(Context context);
+
+ /**
+ * Adds a {@link Callback} to receive future status updates regarding this
+ * {@link CommunalSource}.
+ *
+ * @param callback The {@link Callback} to be added.
+ */
+ void addCallback(Callback callback);
+
+ /**
+ * Removes a {@link Callback} from receiving future updates.
+ *
+ * @param callback The {@link Callback} to be removed.
+ */
+ void removeCallback(Callback callback);
+
+ /**
+ * An interface for receiving updates on the state of the {@link CommunalSource}.
+ */
+ interface Callback {
+ /**
+ * Invoked when the {@link CommunalSource} is no longer available for use.
+ */
+ void onDisconnected();
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/communal/CommunalSourceMonitor.java b/packages/SystemUI/src/com/android/systemui/communal/CommunalSourceMonitor.java
new file mode 100644
index 0000000..36fc5fa
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/communal/CommunalSourceMonitor.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.communal;
+
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.systemui.dagger.SysUISingleton;
+
+import com.google.android.collect.Lists;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+
+import javax.inject.Inject;
+
+/**
+ * A Monitor for reporting a {@link CommunalSource} presence.
+ */
+@SysUISingleton
+public class CommunalSourceMonitor {
+ // A list of {@link Callback} that have registered to receive updates.
+ private final ArrayList<WeakReference<Callback>> mCallbacks = Lists.newArrayList();
+
+ private CommunalSource mCurrentSource;
+
+ private CommunalSource.Callback mSourceCallback = new CommunalSource.Callback() {
+ @Override
+ public void onDisconnected() {
+ // Clear source reference.
+ setSource(null /* source */);
+ }
+ };
+
+ @VisibleForTesting
+ @Inject
+ public CommunalSourceMonitor() {
+ }
+
+ /**
+ * Sets the current {@link CommunalSource}, informing any callbacks. Any existing
+ * {@link CommunalSource} will be disconnected.
+ *
+ * @param source The new {@link CommunalSource}.
+ */
+ public void setSource(CommunalSource source) {
+ if (mCurrentSource != null) {
+ mCurrentSource.removeCallback(mSourceCallback);
+ }
+
+ mCurrentSource = source;
+
+ // If the new source is valid, inform registered Callbacks of its presence.
+ for (int i = 0; i < mCallbacks.size(); i++) {
+ Callback cb = mCallbacks.get(i).get();
+ if (cb != null) {
+ cb.onSourceAvailable(
+ mCurrentSource != null ? new WeakReference<>(mCurrentSource) : null);
+ }
+ }
+
+ // Add callback to be informed when the source disconnects.
+ if (mCurrentSource != null) {
+ mCurrentSource.addCallback(mSourceCallback);
+ }
+ }
+
+ /**
+ * Adds a {@link Callback} to receive {@link CommunalSource} updates.
+ *
+ * @param callback The {@link Callback} to add.
+ */
+ public void addCallback(Callback callback) {
+ mCallbacks.add(new WeakReference<>(callback));
+
+ // Inform the callback of any already present CommunalSource.
+ if (mCurrentSource != null) {
+ callback.onSourceAvailable(new WeakReference<>(mCurrentSource));
+ }
+ }
+
+ /**
+ * Removes the specified {@link Callback} from receive future updates if present.
+ *
+ * @param callback The {@link Callback} to add.
+ */
+ public void removeCallback(Callback callback) {
+ mCallbacks.removeIf(el -> el.get() == callback);
+ }
+
+ /**
+ * Interface implemented to be notified when new {@link CommunalSource} become available.
+ */
+ public interface Callback {
+ /**
+ * Called when a new {@link CommunalSource} has been registered. This will also be invoked
+ * when a {@link Callback} is first registered and a {@link CommunalSource} is already
+ * registered.
+ *
+ * @param source The new {@link CommunalSource}.
+ */
+ void onSourceAvailable(WeakReference<CommunalSource> source);
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/communal/dagger/CommunalModule.java b/packages/SystemUI/src/com/android/systemui/communal/dagger/CommunalModule.java
index cb4eddd..bcc3684 100644
--- a/packages/SystemUI/src/com/android/systemui/communal/dagger/CommunalModule.java
+++ b/packages/SystemUI/src/com/android/systemui/communal/dagger/CommunalModule.java
@@ -21,6 +21,8 @@
/**
* Dagger Module providing Communal-related functionality.
*/
-@Module
+@Module(subcomponents = {
+ CommunalViewComponent.class,
+})
public class CommunalModule {
}
diff --git a/packages/SystemUI/src/com/android/systemui/communal/dagger/CommunalViewComponent.java b/packages/SystemUI/src/com/android/systemui/communal/dagger/CommunalViewComponent.java
new file mode 100644
index 0000000..3a80a03
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/communal/dagger/CommunalViewComponent.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.communal.dagger;
+
+import com.android.systemui.communal.CommunalHostView;
+import com.android.systemui.communal.CommunalHostViewController;
+
+import dagger.BindsInstance;
+import dagger.Subcomponent;
+
+/**
+ * Subcomponent for working with {@link CommunalHostView}.
+ */
+@Subcomponent
+public interface CommunalViewComponent {
+ /** Simple factory for {@link CommunalViewComponent}. */
+ @Subcomponent.Factory
+ interface Factory {
+ CommunalViewComponent build(@BindsInstance CommunalHostView view);
+ }
+
+ /** Builds a {@link CommunalHostViewController}. */
+ CommunalHostViewController getCommunalHostViewController();
+}
diff --git a/packages/SystemUI/src/com/android/systemui/communal/service/CommunalService.java b/packages/SystemUI/src/com/android/systemui/communal/service/CommunalService.java
new file mode 100644
index 0000000..7c010a9
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/communal/service/CommunalService.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.communal.service;
+
+import android.app.Service;
+import android.content.Intent;
+import android.os.IBinder;
+
+import androidx.annotation.Nullable;
+
+import com.android.systemui.communal.CommunalSourceMonitor;
+import com.android.systemui.dagger.qualifiers.Main;
+import com.android.systemui.shared.communal.ICommunalHost;
+import com.android.systemui.shared.communal.ICommunalSource;
+
+import java.util.concurrent.Executor;
+
+import javax.inject.Inject;
+
+/**
+ * CommunalService services requests to {@link ICommunalHost}, allowing clients to declare
+ * themselves as the source of communal surfaces.
+ */
+public class CommunalService extends Service {
+ final Executor mMainExecutor;
+ final CommunalSourceMonitor mMonitor;
+
+ private ICommunalHost.Stub mBinder = new ICommunalHost.Stub() {
+ @Override
+ public void setSource(ICommunalSource source) {
+ mMonitor.setSource(
+ source != null ? new CommunalSourceImpl(mMainExecutor, source) : null);
+ }
+ };
+
+ @Inject
+ CommunalService(@Main Executor mainExecutor, CommunalSourceMonitor monitor) {
+ mMainExecutor = mainExecutor;
+ mMonitor = monitor;
+ }
+
+ @Nullable
+ @Override
+ public IBinder onBind(Intent intent) {
+ // The service does not expect requests outside ICommunalHost.
+ return mBinder;
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/communal/service/CommunalSourceImpl.java b/packages/SystemUI/src/com/android/systemui/communal/service/CommunalSourceImpl.java
new file mode 100644
index 0000000..7d2006a
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/communal/service/CommunalSourceImpl.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.communal.service;
+
+import android.content.Context;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.util.Log;
+import android.view.SurfaceControlViewHost;
+import android.view.View;
+
+import androidx.concurrent.futures.CallbackToFutureAdapter;
+
+import com.android.systemui.communal.CommunalSource;
+import com.android.systemui.shared.communal.ICommunalSource;
+import com.android.systemui.shared.communal.ICommunalSurfaceCallback;
+
+import com.google.android.collect.Lists;
+import com.google.common.util.concurrent.ListenableFuture;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.concurrent.Executor;
+
+/**
+ * {@link CommunalSourceImpl} provides a wrapper around {@link ICommunalSource} proxies as an
+ * implementation of {@link CommunalSource}. Requests and responses for communal surfaces are
+ * translated into the proper binder calls.
+ */
+public class CommunalSourceImpl implements CommunalSource {
+ private static final String TAG = "CommunalSourceImpl";
+ private static final boolean DEBUG = false;
+ private final ICommunalSource mSourceProxy;
+ private final Executor mMainExecutor;
+
+ // mConnected is initialized to true as it is presumed instances are constructed with valid
+ // proxies. The source can never be reconnected once the proxy has died. Once this value
+ // becomes false, the source will always report disconnected to registering callbacks.
+ private boolean mConnected = true;
+
+ // A list of {@link Callback} that have registered to receive updates.
+ private final ArrayList<WeakReference<Callback>> mCallbacks = Lists.newArrayList();
+
+ public CommunalSourceImpl(Executor mainExecutor, ICommunalSource sourceProxy) {
+ mMainExecutor = mainExecutor;
+ mSourceProxy = sourceProxy;
+
+ try {
+ // Track connection status based on proxy lifetime.
+ mSourceProxy.asBinder().linkToDeath(new IBinder.DeathRecipient() {
+ @Override
+ public void binderDied() {
+ if (DEBUG) {
+ Log.d(TAG, "Source lost. Clearing reporting disconnect.");
+ }
+
+ // Set connection state and inform callbacks.
+ onDisconnected();
+ }
+ }, 0);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Could not link to the source proxy death:" + e);
+ }
+ }
+
+ private void onDisconnected() {
+ mConnected = false;
+ for (WeakReference<Callback> cbRef : mCallbacks) {
+ final Callback cb = cbRef.get();
+ if (cb != null) {
+ cb.onDisconnected();
+ }
+ }
+
+ mCallbacks.clear();
+ }
+
+ @Override
+ public ListenableFuture<View> requestCommunalView(Context context) {
+ if (DEBUG) {
+ Log.d(TAG, "Received request for communal view");
+ }
+ ListenableFuture<View> packageFuture =
+ CallbackToFutureAdapter.getFuture(completer -> {
+ completer.set(new CommunalSurfaceView(context, mMainExecutor, this));
+ return "CommunalSourceImpl::requestCommunalSurface::getCommunalSurface";
+ });
+
+ return packageFuture;
+ }
+
+ /**
+ * Called internally to request a new {@link android.view.SurfaceControlViewHost.SurfacePackage}
+ * for showing communal content.
+ *
+ * @param hostToken The HostToken necessary to generate a {@link SurfaceControlViewHost}.
+ * @param displayId The id of the display the surface will be shown on.
+ * @param width The width of the surface.
+ * @param height The height of the surface.
+ * @return A future that returns the resulting
+ * {@link android.view.SurfaceControlViewHost.SurfacePackage}.
+ */
+ protected ListenableFuture<SurfaceControlViewHost.SurfacePackage> requestCommunalSurface(
+ IBinder hostToken, int displayId, int width, int height) {
+ return CallbackToFutureAdapter.getFuture(completer -> {
+ mSourceProxy.getCommunalSurface(hostToken, width, height, displayId,
+ new ICommunalSurfaceCallback.Stub() {
+ @Override
+ public void onSurface(
+ SurfaceControlViewHost.SurfacePackage surfacePackage) {
+ completer.set(surfacePackage);
+ }
+ });
+ return "CommunalSourceImpl::requestCommunalSurface::getCommunalSurface";
+ });
+
+ }
+
+ @Override
+ public void addCallback(Callback callback) {
+ mCallbacks.add(new WeakReference<>(callback));
+
+ // If not connected anymore, immediately inform new callback of disconnection and remove.
+ if (!mConnected) {
+ onDisconnected();
+ }
+ }
+
+ @Override
+ public void removeCallback(Callback callback) {
+ mCallbacks.removeIf(el -> el.get() == callback);
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/communal/service/CommunalSourcePrimer.java b/packages/SystemUI/src/com/android/systemui/communal/service/CommunalSourcePrimer.java
new file mode 100644
index 0000000..bb3fef3
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/communal/service/CommunalSourcePrimer.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.communal.service;
+
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.os.IBinder;
+import android.util.Log;
+
+import com.android.systemui.R;
+import com.android.systemui.SystemUI;
+import com.android.systemui.communal.CommunalSourceMonitor;
+import com.android.systemui.dagger.SysUISingleton;
+import com.android.systemui.dagger.qualifiers.Main;
+import com.android.systemui.shared.communal.ICommunalSource;
+
+import java.util.concurrent.Executor;
+
+import javax.inject.Inject;
+
+/**
+ * The {@link CommunalSourcePrimer} is responsible for priming SystemUI with a pre-configured
+ * Communal source. The SystemUI service binds to the component to retrieve the
+ * {@link com.android.systemui.communal.CommunalSource}. {@link CommunalSourcePrimer} has no effect
+ * if there is no pre-defined value.
+ */
+@SysUISingleton
+public class CommunalSourcePrimer extends SystemUI {
+ private static final String TAG = "CommunalSourcePrimer";
+ private static final boolean DEBUG = false;
+ private final Context mContext;
+ private final Executor mMainExecutor;
+ private final CommunalSourceMonitor mMonitor;
+ private static final String ACTION_COMMUNAL_SOURCE = "android.intent.action.COMMUNAL_SOURCE";
+
+ private final ServiceConnection mConnection = new ServiceConnection() {
+ @Override
+ public void onServiceConnected(ComponentName className, IBinder service) {
+ final ICommunalSource source = ICommunalSource.Stub.asInterface(service);
+ if (DEBUG) {
+ Log.d(TAG, "onServiceConnected. source;" + source);
+ }
+
+ mMonitor.setSource(
+ source != null ? new CommunalSourceImpl(mMainExecutor, source) : null);
+
+ }
+
+ @Override
+ public void onServiceDisconnected(ComponentName className) {
+ }
+ };
+
+ @Inject
+ public CommunalSourcePrimer(Context context, @Main Executor mainExecutor,
+ CommunalSourceMonitor monitor) {
+ super(context);
+ mContext = context;
+ mMainExecutor = mainExecutor;
+ mMonitor = monitor;
+ }
+
+ @Override
+ public void start() {
+ if (DEBUG) {
+ Log.d(TAG, "start");
+ }
+ }
+
+ @Override
+ protected void onBootCompleted() {
+ super.onBootCompleted();
+ final String serviceComponent = mContext.getString(R.string.config_communalSourceComponent);
+
+ if (DEBUG) {
+ Log.d(TAG, "onBootCompleted. communal source component:" + serviceComponent);
+ }
+
+ if (serviceComponent == null || serviceComponent.isEmpty()) {
+ return;
+ }
+
+ final Intent intent = new Intent();
+ intent.setAction(ACTION_COMMUNAL_SOURCE);
+ intent.setComponent(ComponentName.unflattenFromString(serviceComponent));
+
+ mContext.bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/communal/service/CommunalSurfaceView.java b/packages/SystemUI/src/com/android/systemui/communal/service/CommunalSurfaceView.java
new file mode 100644
index 0000000..67458a8
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/communal/service/CommunalSurfaceView.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.communal.service;
+
+import android.content.Context;
+import android.util.Log;
+import android.view.SurfaceControlViewHost;
+import android.view.SurfaceHolder;
+import android.view.SurfaceView;
+
+import androidx.annotation.NonNull;
+
+import com.google.common.util.concurrent.ListenableFuture;
+
+import java.util.concurrent.Executor;
+
+/**
+ * {@link CommunalSurfaceView} can be used to display remote surfaces returned by the
+ * {@link CommunalService}. The necessary information for the request are derived from the view's
+ * events from being attached to the parent container.
+ */
+public class CommunalSurfaceView extends SurfaceView {
+ private static final String TAG = "CommunalSurfaceView";
+ private static final boolean DEBUG = false;
+ private final Executor mMainExecutor;
+ private final CommunalSourceImpl mSource;
+
+ public CommunalSurfaceView(Context context, Executor executor, CommunalSourceImpl source) {
+ super(context);
+ mSource = source;
+ mMainExecutor = executor;
+
+ getHolder().addCallback(new SurfaceHolder.Callback() {
+ @Override
+ public void surfaceCreated(@NonNull SurfaceHolder holder) {
+ onSurfaceCreated();
+ }
+
+ @Override
+ public void surfaceChanged(@NonNull SurfaceHolder holder, int format, int width,
+ int height) {
+
+ }
+
+ @Override
+ public void surfaceDestroyed(@NonNull SurfaceHolder holder) {
+
+ }
+ });
+ }
+
+ private void onSurfaceCreated() {
+ setWillNotDraw(false);
+
+ final ListenableFuture<SurfaceControlViewHost.SurfacePackage> surfaceFuture =
+ mSource.requestCommunalSurface(this.getHostToken(),
+ getDisplay().getDisplayId(), getMeasuredWidth(), getMeasuredHeight());
+
+ surfaceFuture.addListener(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ SurfaceControlViewHost.SurfacePackage surfacePackage = surfaceFuture.get();
+
+ if (DEBUG) {
+ Log.d(TAG, "Received surface package:" + surfacePackage);
+ }
+
+ if (surfacePackage != null) {
+ setChildSurfacePackage(surfacePackage);
+ setZOrderOnTop(true);
+ postInvalidate();
+ } else {
+ Log.e(TAG, "couldn't get the surface package");
+ }
+ } catch (Exception e) {
+ Log.e(TAG, "An error occurred retrieving the future result:" + e);
+ }
+ }
+ }, mMainExecutor);
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt
index c241c08..4104e31 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt
@@ -64,16 +64,12 @@
}
}
- override fun onStart() {
- super.onStart()
+ override fun onResume() {
+ super.onResume()
parent = requireViewById<ViewGroup>(R.id.global_actions_controls)
parent.alpha = 0f
uiController.show(parent, { finish() }, this)
- }
-
- override fun onResume() {
- super.onResume()
ControlsAnimations.enterAnimation(parent).start()
}
@@ -82,8 +78,8 @@
finish()
}
- override fun onStop() {
- super.onStop()
+ override fun onPause() {
+ super.onPause()
uiController.hide()
}
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/DefaultServiceBinder.java b/packages/SystemUI/src/com/android/systemui/dagger/DefaultServiceBinder.java
index 596e440..17bd14c3 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/DefaultServiceBinder.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/DefaultServiceBinder.java
@@ -20,11 +20,11 @@
import com.android.systemui.ImageWallpaper;
import com.android.systemui.SystemUIService;
+import com.android.systemui.communal.service.CommunalService;
import com.android.systemui.doze.DozeService;
import com.android.systemui.dump.SystemUIAuxiliaryDumpService;
import com.android.systemui.keyguard.KeyguardService;
import com.android.systemui.screenrecord.RecordingService;
-import com.android.systemui.screenshot.TakeScreenshotService;
import dagger.Binds;
import dagger.Module;
@@ -39,6 +39,12 @@
/** */
@Binds
@IntoMap
+ @ClassKey(CommunalService.class)
+ public abstract Service bindCommunalService(CommunalService service);
+
+ /** */
+ @Binds
+ @IntoMap
@ClassKey(DozeService.class)
public abstract Service bindDozeService(DozeService service);
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java
index 40768ec..30844cc 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIBinder.java
@@ -23,7 +23,6 @@
import com.android.systemui.accessibility.SystemActions;
import com.android.systemui.accessibility.WindowMagnification;
import com.android.systemui.biometrics.AuthController;
-import com.android.systemui.communal.dagger.CommunalModule;
import com.android.systemui.globalactions.GlobalActionsComponent;
import com.android.systemui.keyguard.KeyguardViewMediator;
import com.android.systemui.keyguard.dagger.KeyguardModule;
@@ -56,7 +55,6 @@
RecentsModule.class,
StatusBarModule.class,
KeyguardModule.class,
- CommunalModule.class,
})
public abstract class SystemUIBinder {
/** Inject into AuthController. */
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
index 556f956..b42d65a 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
@@ -31,6 +31,7 @@
import com.android.systemui.assist.AssistModule;
import com.android.systemui.biometrics.UdfpsHbmProvider;
import com.android.systemui.classifier.FalsingModule;
+import com.android.systemui.communal.dagger.CommunalModule;
import com.android.systemui.controls.dagger.ControlsModule;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.demomode.dagger.DemoModeModule;
@@ -97,6 +98,7 @@
AppOpsModule.class,
AssistModule.class,
ClockModule.class,
+ CommunalModule.class,
ControlsModule.class,
DemoModeModule.class,
FalsingModule.class,
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt
index 941f2c6..a5fe9015 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt
@@ -222,6 +222,11 @@
keyguardViewController.hide(startTime, 350)
surfaceBehindEntryAnimator.start()
}
+
+ // Finish the keyguard remote animation if the dismiss amount has crossed the threshold.
+ // Check it here in case there is no more change to the dismiss amount after the last change
+ // that starts the keyguard animation. @see #updateKeyguardViewMediatorIfThresholdsReached()
+ finishKeyguardExitRemoteAnimationIfReachThreshold()
}
fun notifyCancelKeyguardExitAnimation() {
@@ -353,16 +358,6 @@
}
val dismissAmount = keyguardStateController.dismissAmount
-
- // Hide the keyguard if we're fully dismissed, or if we're swiping to dismiss and have
- // crossed the threshold to finish the dismissal.
- val reachedHideKeyguardThreshold = (dismissAmount >= 1f ||
- (keyguardStateController.isDismissingFromSwipe &&
- // Don't hide if we're flinging during a swipe, since we need to finish
- // animating it out. This will be called again after the fling ends.
- !keyguardStateController.isFlingingToDismissKeyguardDuringSwipeGesture &&
- dismissAmount >= DISMISS_AMOUNT_EXIT_KEYGUARD_THRESHOLD))
-
if (dismissAmount >= DISMISS_AMOUNT_SHOW_SURFACE_THRESHOLD &&
!keyguardViewMediator.get().requestedShowSurfaceBehindKeyguard()) {
// We passed the threshold, and we're not yet showing the surface behind the
@@ -375,9 +370,35 @@
// out.
keyguardViewMediator.get().hideSurfaceBehindKeyguard()
fadeOutSurfaceBehind()
- } else if (keyguardViewMediator.get()
- .isAnimatingBetweenKeyguardAndSurfaceBehindOrWillBe &&
- reachedHideKeyguardThreshold) {
+ } else {
+ finishKeyguardExitRemoteAnimationIfReachThreshold()
+ }
+ }
+
+ /**
+ * Hides the keyguard if we're fully dismissed, or if we're swiping to dismiss and have crossed
+ * the threshold to finish the dismissal.
+ */
+ private fun finishKeyguardExitRemoteAnimationIfReachThreshold() {
+ // no-op if keyguard is not showing or animation is not enabled.
+ if (!KeyguardService.sEnableRemoteKeyguardGoingAwayAnimation ||
+ !keyguardViewController.isShowing) {
+ return
+ }
+
+ // no-op if animation is not requested yet.
+ if (!keyguardViewMediator.get().requestedShowSurfaceBehindKeyguard() ||
+ !keyguardViewMediator.get().isAnimatingBetweenKeyguardAndSurfaceBehindOrWillBe) {
+ return
+ }
+
+ val dismissAmount = keyguardStateController.dismissAmount
+ if (dismissAmount >= 1f ||
+ (keyguardStateController.isDismissingFromSwipe &&
+ // Don't hide if we're flinging during a swipe, since we need to finish
+ // animating it out. This will be called again after the fling ends.
+ !keyguardStateController.isFlingingToDismissKeyguardDuringSwipeGesture &&
+ dismissAmount >= DISMISS_AMOUNT_EXIT_KEYGUARD_THRESHOLD)) {
keyguardViewMediator.get().onKeyguardExitRemoteAnimationFinished(false /* cancelled */)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java
index 683b5c3..fe2ac31 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java
@@ -25,6 +25,8 @@
import static android.app.StatusBarManager.windowStateToString;
import static android.app.WindowConfiguration.ROTATION_UNDEFINED;
import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU;
+import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_GESTURE;
+import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.InsetsState.ITYPE_NAVIGATION_BAR;
import static android.view.InsetsState.containsType;
@@ -290,7 +292,7 @@
@Override
public boolean shouldHideOnTouch() {
- return !mNotificationRemoteInputManager.getController().isRemoteInputActive();
+ return !mNotificationRemoteInputManager.isRemoteInputActive();
}
@Override
@@ -589,7 +591,7 @@
mDeviceProvisionedController.addCallback(mUserSetupListener);
mNotificationShadeDepthController.addListener(mDepthListener);
- setAccessibilityFloatingMenuModeIfNeeded();
+ updateAccessibilityButtonModeIfNeeded();
return barView;
}
@@ -1379,11 +1381,31 @@
updateSystemUiStateFlags(a11yFlags);
}
- private void setAccessibilityFloatingMenuModeIfNeeded() {
- if (QuickStepContract.isGesturalMode(mNavBarMode)) {
+ private void updateAccessibilityButtonModeIfNeeded() {
+ final int mode = Settings.Secure.getIntForUser(mContentResolver,
+ Settings.Secure.ACCESSIBILITY_BUTTON_MODE,
+ ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR, UserHandle.USER_CURRENT);
+
+ // ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU is compatible under gestural or non-gestural
+ // mode, so we don't need to update it.
+ if (mode == ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU) {
+ return;
+ }
+
+ // ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR is incompatible under gestural mode. Need to
+ // force update to ACCESSIBILITY_BUTTON_MODE_GESTURE.
+ if (QuickStepContract.isGesturalMode(mNavBarMode)
+ && mode == ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR) {
+ Settings.Secure.putIntForUser(mContentResolver,
+ Settings.Secure.ACCESSIBILITY_BUTTON_MODE, ACCESSIBILITY_BUTTON_MODE_GESTURE,
+ UserHandle.USER_CURRENT);
+ // ACCESSIBILITY_BUTTON_MODE_GESTURE is incompatible under non gestural mode. Need to
+ // force update to ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR.
+ } else if (!QuickStepContract.isGesturalMode(mNavBarMode)
+ && mode == ACCESSIBILITY_BUTTON_MODE_GESTURE) {
Settings.Secure.putIntForUser(mContentResolver,
Settings.Secure.ACCESSIBILITY_BUTTON_MODE,
- ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU, UserHandle.USER_CURRENT);
+ ACCESSIBILITY_BUTTON_MODE_NAVIGATION_BAR, UserHandle.USER_CURRENT);
}
}
@@ -1511,7 +1533,7 @@
}
}
updateScreenPinningGestures();
- setAccessibilityFloatingMenuModeIfNeeded();
+ updateAccessibilityButtonModeIfNeeded();
if (!canShowSecondaryHandle()) {
resetSecondaryHandle();
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java b/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java
index a318073..4fcd46c 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSAnimator.java
@@ -423,6 +423,9 @@
if (mQsPanelController.shouldUseHorizontalLayout()
&& mQsPanelController.mMediaHost.hostView != null) {
builder.addFloat(mQsPanelController.mMediaHost.hostView, "alpha", 0, 1);
+ } else {
+ // In portrait, media view should always be visible
+ mQsPanelController.mMediaHost.hostView.setAlpha(1.0f);
}
mAllPagesDelayedAnimator = builder.build();
mAllViews.add(mSecurityFooter.getView());
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java b/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java
index d56fe48..dd81b65 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java
@@ -48,6 +48,7 @@
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.notification.stack.StackStateAnimator;
+import com.android.systemui.statusbar.phone.KeyguardBypassController;
import com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer;
import com.android.systemui.statusbar.policy.RemoteInputQuickSettingsDisabler;
import com.android.systemui.util.InjectionInflationController;
@@ -69,6 +70,7 @@
private final Rect mQsBounds = new Rect();
private final StatusBarStateController mStatusBarStateController;
private final FalsingManager mFalsingManager;
+ private final KeyguardBypassController mBypassController;
private boolean mQsExpanded;
private boolean mHeaderAnimating;
private boolean mStackScrollerOverscrolling;
@@ -135,6 +137,7 @@
StatusBarStateController statusBarStateController, CommandQueue commandQueue,
QSDetailDisplayer qsDetailDisplayer, @Named(QS_PANEL) MediaHost qsMediaHost,
@Named(QUICK_QS_PANEL) MediaHost qqsMediaHost,
+ KeyguardBypassController keyguardBypassController,
QSFragmentComponent.Factory qsComponentFactory,
FalsingManager falsingManager) {
mRemoteInputQuickSettingsDisabler = remoteInputQsDisabler;
@@ -147,6 +150,7 @@
commandQueue.observe(getLifecycle(), this);
mHost = qsTileHost;
mFalsingManager = falsingManager;
+ mBypassController = keyguardBypassController;
mStatusBarStateController = statusBarStateController;
}
@@ -385,16 +389,8 @@
return mStatusBarStateController.getState() == StatusBarState.KEYGUARD;
}
- @Override
- public void setPulseExpanding(boolean pulseExpanding) {
- if (pulseExpanding != mPulseExpanding) {
- mPulseExpanding = pulseExpanding;
- updateShowCollapsedOnKeyguard();
- }
- }
-
private void updateShowCollapsedOnKeyguard() {
- boolean showCollapsed = mPulseExpanding || mTransitioningToFullShade;
+ boolean showCollapsed = mBypassController.getBypassEnabled() || mTransitioningToFullShade;
if (showCollapsed != mShowCollapsedOnKeyguard) {
mShowCollapsedOnKeyguard = showCollapsed;
updateQsState();
@@ -724,5 +720,6 @@
public void onStateChanged(int newState) {
mState = newState;
setKeyguardShowing(newState == StatusBarState.KEYGUARD);
+ updateShowCollapsedOnKeyguard();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java
index a9ebcad..9e4a355 100644
--- a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java
+++ b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java
@@ -354,9 +354,10 @@
convertGammaToLinearFloat(value, minBacklight, maxBacklight),
maxBacklight);
if (stopTracking) {
- // TODO(brightnessfloat): change to use float value instead.
+ // Log brightness as a value between 0-1000 directly correlated to brightnesses 0-1.0
MetricsLogger.action(mContext, metric,
- BrightnessSynchronizer.brightnessFloatToInt(valFloat));
+ Math.round(MathUtils.constrainedMap(0, 1000, PowerManager.BRIGHTNESS_MIN,
+ PowerManager.BRIGHTNESS_MAX, valFloat)));
}
setBrightness(valFloat);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
index 4d15a0a..92922b6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
@@ -77,6 +77,7 @@
import com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController;
import com.android.systemui.plugins.FalsingManager;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
+import com.android.systemui.statusbar.phone.KeyguardBypassController;
import com.android.systemui.statusbar.phone.KeyguardIndicationTextView;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
import com.android.systemui.statusbar.policy.KeyguardStateController;
@@ -100,7 +101,7 @@
private static final boolean DEBUG_CHARGING_SPEED = false;
private static final int MSG_HIDE_TRANSIENT = 1;
- private static final int MSG_SWIPE_UP_TO_UNLOCK = 2;
+ private static final int MSG_SHOW_ACTION_TO_UNLOCK = 2;
private static final long TRANSIENT_BIOMETRIC_ERROR_TIMEOUT = 1300;
private static final float BOUNCE_ANIMATION_FINAL_Y = 0f;
@@ -121,6 +122,7 @@
private final LockPatternUtils mLockPatternUtils;
private final IActivityManager mIActivityManager;
private final FalsingManager mFalsingManager;
+ private final KeyguardBypassController mKeyguardBypassController;
protected KeyguardIndicationRotateTextViewController mRotateTextViewController;
private BroadcastReceiver mBroadcastReceiver;
@@ -175,7 +177,8 @@
@Main DelayableExecutor executor,
FalsingManager falsingManager,
LockPatternUtils lockPatternUtils,
- IActivityManager iActivityManager) {
+ IActivityManager iActivityManager,
+ KeyguardBypassController keyguardBypassController) {
mContext = context;
mBroadcastDispatcher = broadcastDispatcher;
mDevicePolicyManager = devicePolicyManager;
@@ -191,6 +194,7 @@
mLockPatternUtils = lockPatternUtils;
mIActivityManager = iActivityManager;
mFalsingManager = falsingManager;
+ mKeyguardBypassController = keyguardBypassController;
}
@@ -593,7 +597,7 @@
mTransientIndication = transientIndication;
mHideTransientMessageOnScreenOff = hideOnScreenOff && transientIndication != null;
mHandler.removeMessages(MSG_HIDE_TRANSIENT);
- mHandler.removeMessages(MSG_SWIPE_UP_TO_UNLOCK);
+ mHandler.removeMessages(MSG_SHOW_ACTION_TO_UNLOCK);
if (mDozing && !TextUtils.isEmpty(mTransientIndication)) {
// Make sure this doesn't get stuck and burns in. Acquire wakelock until its cleared.
mWakeLock.setAcquired(true);
@@ -785,27 +789,35 @@
public void handleMessage(Message msg) {
if (msg.what == MSG_HIDE_TRANSIENT) {
hideTransientIndication();
- } else if (msg.what == MSG_SWIPE_UP_TO_UNLOCK) {
- showSwipeUpToUnlock();
+ } else if (msg.what == MSG_SHOW_ACTION_TO_UNLOCK) {
+ showActionToUnlock();
}
}
};
- private void showSwipeUpToUnlock() {
+ /**
+ * Show message on the keyguard for how the user can unlock/enter their device.
+ */
+ public void showActionToUnlock() {
if (mDozing) {
return;
}
if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
if (mStatusBarKeyguardViewManager.isShowingAlternateAuth()) {
- return; // udfps affordance is highlighted, no need to surface face auth error
- } else {
+ return; // udfps affordance is highlighted, no need to show action to unlock
+ } else if (mKeyguardUpdateMonitor.isFaceEnrolled()) {
String message = mContext.getString(R.string.keyguard_retry);
mStatusBarKeyguardViewManager.showBouncerMessage(message, mInitialTextColorState);
}
} else if (mKeyguardUpdateMonitor.isScreenOn()) {
- showTransientIndication(mContext.getString(R.string.keyguard_unlock),
- false /* isError */, true /* hideOnScreenOff */);
+ if (mKeyguardUpdateMonitor.isUdfpsAvailable()) {
+ showTransientIndication(mContext.getString(R.string.keyguard_unlock_press),
+ false /* isError */, true /* hideOnScreenOff */);
+ } else {
+ showTransientIndication(mContext.getString(R.string.keyguard_unlock),
+ false /* isError */, true /* hideOnScreenOff */);
+ }
}
}
@@ -885,13 +897,16 @@
mStatusBarKeyguardViewManager.showBouncerMessage(helpString,
mInitialTextColorState);
} else if (mKeyguardUpdateMonitor.isScreenOn()) {
- if (biometricSourceType == BiometricSourceType.FACE && shouldSuppressFaceMsg()) {
+ if (biometricSourceType == BiometricSourceType.FACE
+ && shouldSuppressFaceMsgAndShowTryFingerprintMsg()) {
+ // suggest trying fingerprint
+ showTransientIndication(R.string.keyguard_try_fingerprint);
return;
}
showTransientIndication(helpString, false /* isError */, showSwipeToUnlock);
}
if (showSwipeToUnlock) {
- mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_SWIPE_UP_TO_UNLOCK),
+ mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_SHOW_ACTION_TO_UNLOCK),
TRANSIENT_BIOMETRIC_ERROR_TIMEOUT);
}
}
@@ -903,9 +918,11 @@
return;
}
if (biometricSourceType == BiometricSourceType.FACE
- && shouldSuppressFaceMsg()
+ && shouldSuppressFaceMsgAndShowTryFingerprintMsg()
&& !mStatusBarKeyguardViewManager.isBouncerShowing()
&& mKeyguardUpdateMonitor.isScreenOn()) {
+ // suggest trying fingerprint
+ showTransientIndication(R.string.keyguard_try_fingerprint);
return;
}
if (msgId == FaceManager.FACE_ERROR_TIMEOUT) {
@@ -923,7 +940,7 @@
);
} else {
// suggest swiping up to unlock (try face auth again or swipe up to bouncer)
- showSwipeUpToUnlock();
+ showActionToUnlock();
}
} else if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
mStatusBarKeyguardViewManager.showBouncerMessage(errString, mInitialTextColorState);
@@ -956,7 +973,7 @@
|| msgId == FingerprintManager.FINGERPRINT_ERROR_USER_CANCELED);
}
- private boolean shouldSuppressFaceMsg() {
+ private boolean shouldSuppressFaceMsgAndShowTryFingerprintMsg() {
// For dual biometric, don't show face auth messages
return mKeyguardUpdateMonitor.isFingerprintDetectionRunning()
&& mKeyguardUpdateMonitor.isUnlockingWithBiometricAllowed(
@@ -1005,6 +1022,11 @@
boolean isStrongBiometric) {
super.onBiometricAuthenticated(userId, biometricSourceType, isStrongBiometric);
mHandler.sendEmptyMessage(MSG_HIDE_TRANSIENT);
+
+ if (biometricSourceType == BiometricSourceType.FACE
+ && !mKeyguardBypassController.canBypass()) {
+ mHandler.sendEmptyMessage(MSG_SHOW_ACTION_TO_UNLOCK);
+ }
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt
index f0da702..ca18b07 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/LockscreenShadeTransitionController.kt
@@ -64,6 +64,7 @@
configurationController: ConfigurationController,
falsingManager: FalsingManager
) {
+ private var pulseHeight: Float = 0f
private var useSplitShade: Boolean = false
private lateinit var nsslController: NotificationStackScrollLayoutController
lateinit var notificationPanelController: NotificationPanelViewController
@@ -87,6 +88,12 @@
internal var dragDownAnimator: ValueAnimator? = null
/**
+ * The current pulse height animator if any
+ */
+ @VisibleForTesting
+ internal var pulseHeightAnimator: ValueAnimator? = null
+
+ /**
* Distance that the full shade transition takes in order for scrim to fully transition to
* the shade (in alpha)
*/
@@ -109,6 +116,12 @@
private var nextHideKeyguardNeedsNoAnimation = false
/**
+ * The distance until we're showing the notifications when pulsing
+ */
+ val distanceUntilShowingPulsingNotifications
+ get() = scrimTransitionDistance
+
+ /**
* The udfpsKeyguardViewController if it exists.
*/
var udfpsKeyguardViewController: UdfpsKeyguardViewController? = null
@@ -285,22 +298,26 @@
nsslController.setTransitionToFullShadeAmount(field)
notificationPanelController.setTransitionToFullShadeAmount(field,
false /* animate */, 0 /* delay */)
- val scrimProgress = MathUtils.saturate(field / scrimTransitionDistance)
- scrimController.setTransitionToFullShadeProgress(scrimProgress)
// TODO: appear qs also in split shade
val qsAmount = if (useSplitShade) 0f else field
qS.setTransitionToFullShadeAmount(qsAmount, false /* animate */)
// TODO: appear media also in split shade
val mediaAmount = if (useSplitShade) 0f else field
mediaHierarchyManager.setTransitionToFullShadeAmount(mediaAmount)
- // Fade out all content only visible on the lockscreen
- notificationPanelController.setKeyguardOnlyContentAlpha(1.0f - scrimProgress)
- depthController.transitionToFullShadeProgress = scrimProgress
- udfpsKeyguardViewController?.setTransitionToFullShadeProgress(scrimProgress)
+ transitionToShadeAmountCommon(field)
}
}
}
+ private fun transitionToShadeAmountCommon(dragDownAmount: Float) {
+ val scrimProgress = MathUtils.saturate(dragDownAmount / scrimTransitionDistance)
+ scrimController.setTransitionToFullShadeProgress(scrimProgress)
+ // Fade out all content only visible on the lockscreen
+ notificationPanelController.setKeyguardOnlyContentAlpha(1.0f - scrimProgress)
+ depthController.transitionToFullShadeProgress = scrimProgress
+ udfpsKeyguardViewController?.setTransitionToFullShadeProgress(scrimProgress)
+ }
+
private fun setDragDownAmountAnimated(
target: Float,
delay: Long = 0,
@@ -452,15 +469,19 @@
/**
* Notify this handler that the keyguard was just dismissed and that a animation to
* the full shade should happen.
+ *
+ * @param delay the delay to do the animation with
+ * @param previousState which state were we in when we hid the keyguard?
*/
- fun onHideKeyguard(delay: Long) {
+ fun onHideKeyguard(delay: Long, previousState: Int) {
if (animationHandlerOnKeyguardDismiss != null) {
animationHandlerOnKeyguardDismiss!!.invoke(delay)
animationHandlerOnKeyguardDismiss = null
} else {
if (nextHideKeyguardNeedsNoAnimation) {
nextHideKeyguardNeedsNoAnimation = false
- } else {
+ } else if (previousState != StatusBarState.SHADE_LOCKED) {
+ // No animation necessary if we already were in the shade locked!
performDefaultGoToFullShadeAnimation(delay)
}
}
@@ -478,6 +499,53 @@
notificationPanelController.animateToFullShade(delay)
animateAppear(delay)
}
+
+ //
+ // PULSE EXPANSION
+ //
+
+ /**
+ * Set the height how tall notifications are pulsing. This is only set whenever we are expanding
+ * from a pulse and determines how much the notifications are expanded.
+ */
+ fun setPulseHeight(height: Float, animate: Boolean = false) {
+ if (animate) {
+ val pulseHeightAnimator = ValueAnimator.ofFloat(pulseHeight, height)
+ pulseHeightAnimator.interpolator = Interpolators.FAST_OUT_SLOW_IN
+ pulseHeightAnimator.duration = SPRING_BACK_ANIMATION_LENGTH_MS
+ pulseHeightAnimator.addUpdateListener { animation: ValueAnimator ->
+ setPulseHeight(animation.animatedValue as Float)
+ }
+ pulseHeightAnimator.start()
+ this.pulseHeightAnimator = pulseHeightAnimator
+ } else {
+ pulseHeight = height
+ val overflow = nsslController.setPulseHeight(height)
+ notificationPanelController.setOverStrechAmount(overflow)
+ val transitionHeight = if (keyguardBypassController.bypassEnabled) height else 0.0f
+ transitionToShadeAmountCommon(transitionHeight)
+ }
+ }
+
+ /**
+ * Finish the pulse animation when the touch interaction finishes
+ * @param cancelled was the interaction cancelled and this is a reset?
+ */
+ fun finishPulseAnimation(cancelled: Boolean) {
+ if (cancelled) {
+ setPulseHeight(0f, animate = true)
+ } else {
+ notificationPanelController.onPulseExpansionFinished()
+ setPulseHeight(0f, animate = false)
+ }
+ }
+
+ /**
+ * Notify this class that a pulse expansion is starting
+ */
+ fun onPulseExpansionStarted() {
+ pulseHeightAnimator?.cancel()
+ }
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
index bc3883c..625d9cd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
@@ -70,6 +70,7 @@
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
@@ -136,6 +137,8 @@
protected Callback mCallback;
protected final ArrayList<NotificationLifetimeExtender> mLifetimeExtenders = new ArrayList<>();
+ private final List<RemoteInputController.Callback> mControllerCallbacks = new ArrayList<>();
+
private final InteractionHandler mInteractionHandler = new InteractionHandler() {
@Override
@@ -332,6 +335,11 @@
public void setUpWithCallback(Callback callback, RemoteInputController.Delegate delegate) {
mCallback = callback;
mRemoteInputController = new RemoteInputController(delegate, mRemoteInputUriController);
+ // Register all stored callbacks from before the Controller was initialized.
+ for (RemoteInputController.Callback cb : mControllerCallbacks) {
+ mRemoteInputController.addCallback(cb);
+ }
+ mControllerCallbacks.clear();
mRemoteInputController.addCallback(new RemoteInputController.Callback() {
@Override
public void onRemoteInputSent(NotificationEntry entry) {
@@ -377,6 +385,22 @@
});
}
+ public void addControllerCallback(RemoteInputController.Callback callback) {
+ if (mRemoteInputController != null) {
+ mRemoteInputController.addCallback(callback);
+ } else {
+ mControllerCallbacks.add(callback);
+ }
+ }
+
+ public void removeControllerCallback(RemoteInputController.Callback callback) {
+ if (mRemoteInputController != null) {
+ mRemoteInputController.removeCallback(callback);
+ } else {
+ mControllerCallbacks.remove(callback);
+ }
+ }
+
/**
* Activates a given {@link RemoteInput}
*
@@ -563,17 +587,12 @@
return mLifetimeExtenders;
}
- @Nullable
- public RemoteInputController getController() {
- return mRemoteInputController;
- }
-
@VisibleForTesting
void onPerformRemoveNotification(NotificationEntry entry, final String key) {
if (mKeysKeptForRemoteInputHistory.contains(key)) {
mKeysKeptForRemoteInputHistory.remove(key);
}
- if (mRemoteInputController.isRemoteInputActive(entry)) {
+ if (isRemoteInputActive(entry)) {
entry.mRemoteEditImeVisible = false;
mRemoteInputController.removeRemoteInput(entry, null);
}
@@ -582,7 +601,9 @@
public void onPanelCollapsed() {
for (int i = 0; i < mEntriesKeptForRemoteInputActive.size(); i++) {
NotificationEntry entry = mEntriesKeptForRemoteInputActive.valueAt(i);
- mRemoteInputController.removeRemoteInput(entry, null);
+ if (mRemoteInputController != null) {
+ mRemoteInputController.removeRemoteInput(entry, null);
+ }
if (mNotificationLifetimeFinishedCallback != null) {
mNotificationLifetimeFinishedCallback.onSafeToRemove(entry.getKey());
}
@@ -598,8 +619,7 @@
if (!FORCE_REMOTE_INPUT_HISTORY) {
return false;
}
- return (mRemoteInputController.isSpinning(entry.getKey())
- || entry.hasJustSentRemoteInput());
+ return isSpinning(entry.getKey()) || entry.hasJustSentRemoteInput();
}
/**
@@ -632,8 +652,8 @@
public void checkRemoteInputOutside(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_OUTSIDE // touch outside the source bar
&& event.getX() == 0 && event.getY() == 0 // a touch outside both bars
- && mRemoteInputController.isRemoteInputActive()) {
- mRemoteInputController.closeRemoteInputs();
+ && isRemoteInputActive()) {
+ closeRemoteInputs();
}
}
@@ -715,6 +735,24 @@
return mEntriesKeptForRemoteInputActive;
}
+ public boolean isRemoteInputActive() {
+ return mRemoteInputController != null && mRemoteInputController.isRemoteInputActive();
+ }
+
+ public boolean isRemoteInputActive(NotificationEntry entry) {
+ return mRemoteInputController != null && mRemoteInputController.isRemoteInputActive(entry);
+ }
+
+ public boolean isSpinning(String entryKey) {
+ return mRemoteInputController != null && mRemoteInputController.isSpinning(entryKey);
+ }
+
+ public void closeRemoteInputs() {
+ if (mRemoteInputController != null) {
+ mRemoteInputController.closeRemoteInputs();
+ }
+ }
+
/**
* NotificationRemoteInputManager has multiple reasons to keep notification lifetime extended
* so we implement multiple NotificationLifetimeExtenders
@@ -822,7 +860,7 @@
protected class RemoteInputActiveExtender extends RemoteInputExtender {
@Override
public boolean shouldExtendLifetime(@NonNull NotificationEntry entry) {
- return mRemoteInputController.isRemoteInputActive(entry);
+ return isRemoteInputActive(entry);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt b/packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt
index b34bfad..761a203 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/PulseExpansionHandler.kt
@@ -19,8 +19,8 @@
import android.animation.Animator
import android.animation.AnimatorListenerAdapter
import android.animation.ObjectAnimator
-import android.animation.ValueAnimator
import android.content.Context
+import android.content.res.Configuration
import android.os.PowerManager
import android.os.PowerManager.WAKE_REASON_GESTURE
import android.os.SystemClock
@@ -42,6 +42,7 @@
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController
import com.android.systemui.statusbar.phone.HeadsUpManagerPhone
import com.android.systemui.statusbar.phone.KeyguardBypassController
+import com.android.systemui.statusbar.policy.ConfigurationController
import javax.inject.Inject
import kotlin.math.max
@@ -56,18 +57,17 @@
private val bypassController: KeyguardBypassController,
private val headsUpManager: HeadsUpManagerPhone,
private val roundnessManager: NotificationRoundnessManager,
+ private val configurationController: ConfigurationController,
private val statusBarStateController: StatusBarStateController,
private val falsingManager: FalsingManager,
private val lockscreenShadeTransitionController: LockscreenShadeTransitionController,
private val falsingCollector: FalsingCollector
) : Gefingerpoken {
companion object {
- private val RUBBERBAND_FACTOR_STATIC = 0.25f
private val SPRING_BACK_ANIMATION_LENGTH_MS = 375
}
private val mPowerManager: PowerManager?
- private val mMinDragDistance: Int
private var mInitialTouchX: Float = 0.0f
private var mInitialTouchY: Float = 0.0f
var isExpanding: Boolean = false
@@ -81,6 +81,7 @@
topEntry?.let {
roundnessManager.setTrackingHeadsUp(it.row)
}
+ lockscreenShadeTransitionController.onPulseExpansionStarted()
} else {
roundnessManager.setTrackingHeadsUp(null)
if (!leavingLockscreen) {
@@ -93,8 +94,8 @@
}
var leavingLockscreen: Boolean = false
private set
- private val mTouchSlop: Float
- private lateinit var overStretchHandler: OverStretchHandler
+ private var touchSlop = 0f
+ private var minDragDistance = 0
private lateinit var stackScrollerController: NotificationStackScrollLayoutController
private val mTemp2 = IntArray(2)
private var mDraggedFarEnough: Boolean = false
@@ -102,9 +103,7 @@
private var mPulsing: Boolean = false
var isWakingToShadeLocked: Boolean = false
private set
- private var overStretchAmount: Float = 0.0f
- private var mWakeUpHeight: Float = 0.0f
- private var mReachedWakeUpHeight: Boolean = false
+
private var velocityTracker: VelocityTracker? = null
private val isFalseTouch: Boolean
@@ -114,12 +113,21 @@
var bouncerShowing: Boolean = false
init {
- mMinDragDistance = context.resources.getDimensionPixelSize(
- R.dimen.keyguard_drag_down_min_distance)
- mTouchSlop = ViewConfiguration.get(context).scaledTouchSlop.toFloat()
+ initResources(context)
+ configurationController.addCallback(object : ConfigurationController.ConfigurationListener {
+ override fun onConfigChanged(newConfig: Configuration?) {
+ initResources(context)
+ }
+ })
mPowerManager = context.getSystemService(PowerManager::class.java)
}
+ private fun initResources(context: Context) {
+ minDragDistance = context.resources.getDimensionPixelSize(
+ R.dimen.keyguard_drag_down_min_distance)
+ touchSlop = ViewConfiguration.get(context).scaledTouchSlop.toFloat()
+ }
+
override fun onInterceptTouchEvent(event: MotionEvent): Boolean {
return canHandleMotionEvent() && startExpansion(event)
}
@@ -148,14 +156,12 @@
MotionEvent.ACTION_MOVE -> {
val h = y - mInitialTouchY
- if (h > mTouchSlop && h > Math.abs(x - mInitialTouchX)) {
+ if (h > touchSlop && h > Math.abs(x - mInitialTouchX)) {
falsingCollector.onStartExpandingFromPulse()
isExpanding = true
captureStartingChild(mInitialTouchX, mInitialTouchY)
mInitialTouchY = y
mInitialTouchX = x
- mWakeUpHeight = wakeUpCoordinator.getWakeUpHeight()
- mReachedWakeUpHeight = false
return true
}
}
@@ -216,7 +222,6 @@
}
private fun finishExpansion() {
- resetClock()
val startingChild = mStartingChild
if (mStartingChild != null) {
setUserLocked(mStartingChild!!, false)
@@ -230,6 +235,7 @@
}
lockscreenShadeTransitionController.goToLockedShade(startingChild,
needsQSAnimation = false)
+ lockscreenShadeTransitionController.finishPulseAnimation(cancelled = false)
leavingLockscreen = true
isExpanding = false
if (mStartingChild is ExpandableNotificationRow) {
@@ -240,24 +246,19 @@
private fun updateExpansionHeight(height: Float) {
var expansionHeight = max(height, 0.0f)
- if (!mReachedWakeUpHeight && height > mWakeUpHeight) {
- mReachedWakeUpHeight = true
- }
if (mStartingChild != null) {
val child = mStartingChild!!
val newHeight = Math.min((child.collapsedHeight + expansionHeight).toInt(),
child.maxContentHeight)
child.actualHeight = newHeight
- expansionHeight = max(newHeight.toFloat(), expansionHeight)
} else {
- val target = if (mReachedWakeUpHeight) mWakeUpHeight else 0.0f
- wakeUpCoordinator.setNotificationsVisibleForExpansion(height > target,
- true /* animate */,
- true /* increaseSpeed */)
- expansionHeight = max(mWakeUpHeight, expansionHeight)
+ wakeUpCoordinator.setNotificationsVisibleForExpansion(
+ height
+ > lockscreenShadeTransitionController.distanceUntilShowingPulsingNotifications,
+ true /* animate */,
+ true /* increaseSpeed */)
}
- val dragDownAmount = wakeUpCoordinator.setPulseHeight(expansionHeight)
- setOverStretchAmount(dragDownAmount)
+ lockscreenShadeTransitionController.setPulseHeight(expansionHeight, animate = false)
}
private fun captureStartingChild(x: Float, y: Float) {
@@ -269,11 +270,6 @@
}
}
- private fun setOverStretchAmount(amount: Float) {
- overStretchAmount = amount
- overStretchHandler.setOverStretchAmount(amount)
- }
-
private fun reset(child: ExpandableView) {
if (child.actualHeight == child.collapsedHeight) {
setUserLocked(child, false)
@@ -297,25 +293,14 @@
}
}
- private fun resetClock() {
- val anim = ValueAnimator.ofFloat(overStretchAmount, 0f)
- anim.interpolator = Interpolators.FAST_OUT_SLOW_IN
- anim.duration = SPRING_BACK_ANIMATION_LENGTH_MS.toLong()
- anim.addUpdateListener {
- animation -> setOverStretchAmount(animation.animatedValue as Float)
- }
- anim.start()
- }
-
private fun cancelExpansion() {
isExpanding = false
falsingCollector.onExpansionFromPulseStopped()
if (mStartingChild != null) {
reset(mStartingChild!!)
mStartingChild = null
- } else {
- resetClock()
}
+ lockscreenShadeTransitionController.finishPulseAnimation(cancelled = true)
wakeUpCoordinator.setNotificationsVisibleForExpansion(false /* visible */,
true /* animate */,
false /* increaseSpeed */)
@@ -333,11 +318,7 @@
} else null
}
- fun setUp(
- stackScrollerController: NotificationStackScrollLayoutController,
- overStrechHandler: OverStretchHandler
- ) {
- this.overStretchHandler = overStrechHandler
+ fun setUp(stackScrollerController: NotificationStackScrollLayoutController) {
this.stackScrollerController = stackScrollerController
}
@@ -348,12 +329,4 @@
fun onStartedWakingUp() {
isWakingToShadeLocked = false
}
-
- interface OverStretchHandler {
-
- /**
- * Set the overstretch amount in pixels This will be rubberbanded later
- */
- fun setOverStretchAmount(amount: Float)
- }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java b/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java
index 180f81c..83701a0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/RemoteInputController.java
@@ -25,7 +25,6 @@
import android.util.ArrayMap;
import android.util.Pair;
-import com.android.internal.util.Preconditions;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.policy.RemoteInputUriController;
import com.android.systemui.statusbar.policy.RemoteInputView;
@@ -245,6 +244,10 @@
mCallbacks.add(callback);
}
+ public void removeCallback(Callback callback) {
+ mCallbacks.remove(callback);
+ }
+
public void remoteInputSent(NotificationEntry entry) {
int N = mCallbacks.size();
for (int i = 0; i < N; i++) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/events/PrivacyDotViewController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/events/PrivacyDotViewController.kt
index 19a00d2..c1f0578 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/events/PrivacyDotViewController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/events/PrivacyDotViewController.kt
@@ -70,7 +70,7 @@
private val configurationController: ConfigurationController,
private val contentInsetsProvider: StatusBarContentInsetsProvider,
private val animationScheduler: SystemStatusAnimationScheduler
-) : StatusBarContentInsetsChangedListener {
+) {
private var sbHeightPortrait = 0
private var sbHeightLandscape = 0
@@ -98,7 +98,13 @@
get() = if (!this::tl.isInitialized) sequenceOf() else sequenceOf(tl, tr, br, bl)
init {
- contentInsetsProvider.addCallback(this)
+ contentInsetsProvider.addCallback(object : StatusBarContentInsetsChangedListener {
+ override fun onStatusBarContentInsetsChanged() {
+ dlog("onStatusBarContentInsetsChanged: ")
+ setNewLayoutRects()
+ }
+ })
+
configurationController.addCallback(object : ConfigurationController.ConfigurationListener {
override fun onLayoutDirectionChanged(isRtl: Boolean) {
synchronized(this) {
@@ -533,11 +539,6 @@
return -1
}
- override fun onStatusBarContentInsetsChanged() {
- Log.d(TAG, "onStatusBarContentInsetsChanged: ")
- setNewLayoutRects()
- }
-
// Returns [left, top, right, bottom] aka [seascape, none, landscape, upside-down]
private fun getLayoutRects(): List<Rect> {
val left = contentInsetsProvider.getStatusBarContentInsetsForRotation(ROTATION_SEASCAPE)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt
index b0a7767..a2c9ffc 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt
@@ -374,10 +374,6 @@
}
}
- fun getWakeUpHeight(): Float {
- return mStackScrollerController.wakeUpHeight
- }
-
private fun updateHideAmount() {
val linearAmount = min(1.0f - mLinearVisibilityAmount, mLinearDozeAmount)
val amount = min(1.0f - mVisibilityAmount, mDozeAmount)
@@ -395,16 +391,6 @@
}
}
- /**
- * Set the height how tall notifications are pulsing. This is only set whenever we are expanding
- * from a pulse and determines how much the notifications are expanded.
- */
- fun setPulseHeight(height: Float): Float {
- val overflow = mStackScrollerController.setPulseHeight(height)
- // no overflow for the bypass experience
- return if (bypassController.bypassEnabled) 0.0f else overflow
- }
-
override fun onHeadsUpStateChanged(entry: NotificationEntry, isHeadsUp: Boolean) {
var animate = shouldAnimateVisibility()
if (!isHeadsUp) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/HeadsUpCoordinator.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/HeadsUpCoordinator.java
index be1383f..6e98c27 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/HeadsUpCoordinator.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/HeadsUpCoordinator.java
@@ -149,7 +149,7 @@
final String entryKey = entry.getKey();
if (mHeadsUpManager.isAlerting(entryKey)) {
boolean removeImmediatelyForRemoteInput =
- mRemoteInputManager.getController().isSpinning(entryKey)
+ mRemoteInputManager.isSpinning(entryKey)
&& !FORCE_REMOTE_INPUT_HISTORY;
mHeadsUpManager.removeNotification(entry.getKey(), removeImmediatelyForRemoteInput);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/HeadsUpController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/HeadsUpController.java
index 4d56e60..b1c69e4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/HeadsUpController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/HeadsUpController.java
@@ -152,7 +152,7 @@
// Also we should not defer the removal if reordering isn't allowed since otherwise
// some notifications can't disappear before the panel is closed.
boolean ignoreEarliestRemovalTime =
- mRemoteInputManager.getController().isSpinning(key)
+ mRemoteInputManager.isSpinning(key)
&& !FORCE_REMOTE_INPUT_HISTORY
|| !mVisualStabilityManager.isReorderingAllowed();
mHeadsUpManager.removeNotification(key, ignoreEarliestRemovalTime);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
index 93166f3..73bb6cd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
@@ -287,7 +287,7 @@
mGroupExpansionChanging = true;
final boolean wasExpanded = mGroupExpansionManager.isGroupExpanded(mEntry);
boolean nowExpanded = mGroupExpansionManager.toggleGroupExpansion(mEntry);
- mOnExpandClickListener.onExpandClicked(mEntry, nowExpanded);
+ mOnExpandClickListener.onExpandClicked(mEntry, v, nowExpanded);
MetricsLogger.action(mContext, MetricsEvent.ACTION_NOTIFICATION_GROUP_EXPANDER,
nowExpanded);
onExpansionChanged(true /* userAction */, wasExpanded);
@@ -310,7 +310,7 @@
setUserExpanded(nowExpanded);
}
notifyHeightChanged(true);
- mOnExpandClickListener.onExpandClicked(mEntry, nowExpanded);
+ mOnExpandClickListener.onExpandClicked(mEntry, v, nowExpanded);
MetricsLogger.action(mContext, MetricsEvent.ACTION_NOTIFICATION_EXPANDER,
nowExpanded);
}
@@ -3064,7 +3064,7 @@
}
public interface OnExpandClickListener {
- void onExpandClicked(NotificationEntry clickedEntry, boolean nowExpanded);
+ void onExpandClicked(NotificationEntry clickedEntry, View clickedView, boolean nowExpanded);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java
index 73c4b05..1530e523 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentInflater.java
@@ -874,7 +874,7 @@
mRow.getImageResolver().purgeCache();
}
- private class RtlEnabledContext extends ContextWrapper {
+ private static class RtlEnabledContext extends ContextWrapper {
private RtlEnabledContext(Context packageContext) {
super(packageContext);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index 50811c8e..940cf66 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -81,10 +81,9 @@
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.EmptyShadeView;
-import com.android.systemui.statusbar.NotificationRemoteInputManager;
+import com.android.systemui.statusbar.FeatureFlags;
import com.android.systemui.statusbar.NotificationShelf;
import com.android.systemui.statusbar.NotificationShelfController;
-import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.notification.ExpandAnimationParameters;
import com.android.systemui.statusbar.notification.FakeShadowView;
@@ -441,7 +440,6 @@
private final Rect mTmpRect = new Rect();
private DismissListener mDismissListener;
private DismissAllAnimationListener mDismissAllAnimationListener;
- private NotificationRemoteInputManager mRemoteInputManager;
private ShadeController mShadeController;
private Consumer<Boolean> mOnStackYChanged;
@@ -456,6 +454,7 @@
private float mLastSentExpandedHeight;
private boolean mWillExpand;
private int mGapHeight;
+ private boolean mIsRemoteInputActive;
/**
* The extra inset during the full shade transition
@@ -677,6 +676,10 @@
mSectionsManager.reinflateViews(LayoutInflater.from(mContext));
}
+ public void setIsRemoteInputActive(boolean isActive) {
+ mIsRemoteInputActive = isActive;
+ }
+
@VisibleForTesting
@ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
public void updateFooter() {
@@ -686,11 +689,10 @@
// TODO: move this logic to controller, which will invoke updateFooterView directly
boolean showDismissView = mClearAllEnabled &&
mController.hasActiveClearableNotifications(ROWS_ALL);
- RemoteInputController remoteInputController = mRemoteInputManager.getController();
boolean showFooterView = (showDismissView || getVisibleNotificationCount() > 0)
&& mStatusBarState != StatusBarState.KEYGUARD
&& !mUnlockedScreenOffAnimationController.isScreenOffAnimationPlaying()
- && (remoteInputController == null || !remoteInputController.isRemoteInputActive());
+ && !mIsRemoteInputActive;
boolean showHistory = Settings.Secure.getIntForUser(mContext.getContentResolver(),
Settings.Secure.NOTIFICATION_HISTORY_ENABLED, 0, UserHandle.USER_CURRENT) == 1;
@@ -5163,12 +5165,17 @@
* @return the overflow how much the height is further than he lowest notification
*/
public float setPulseHeight(float height) {
+ float overflow;
mAmbientState.setPulseHeight(height);
if (mKeyguardBypassEnabled) {
notifyAppearChangedListeners();
+ overflow = Math.max(0, height - getIntrinsicPadding());
+ } else {
+ overflow = Math.max(0, height
+ - mAmbientState.getInnerHeight(true /* ignorePulseHeight */));
}
requestChildrenUpdate();
- return Math.max(0, height - mAmbientState.getInnerHeight(true /* ignorePulseHeight */));
+ return overflow;
}
public float getPulseHeight() {
@@ -5228,12 +5235,9 @@
public float calculateAppearFractionBypass() {
float pulseHeight = getPulseHeight();
- float wakeUpHeight = getWakeUpHeight();
- float dragDownAmount = pulseHeight - wakeUpHeight;
-
// The total distance required to fully reveal the header
float totalDistance = getIntrinsicPadding();
- return MathUtils.smoothStep(0, totalDistance, dragDownAmount);
+ return MathUtils.smoothStep(0, totalDistance, pulseHeight);
}
public void setController(
@@ -5365,10 +5369,6 @@
mFooterDismissListener = listener;
}
- public void setRemoteInputManager(NotificationRemoteInputManager remoteInputManager) {
- mRemoteInputManager = remoteInputManager;
- }
-
void setShadeController(ShadeController shadeController) {
mShadeController = shadeController;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
index 8ee0cd1..f18513a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
@@ -682,7 +682,13 @@
NotificationPanelEvent.fromSelection(selection)));
mView.setFooterDismissListener(() ->
mMetricsLogger.action(MetricsEvent.ACTION_DISMISS_ALL_NOTES));
- mView.setRemoteInputManager(mRemoteInputManager);
+ mView.setIsRemoteInputActive(mRemoteInputManager.isRemoteInputActive());
+ mRemoteInputManager.addControllerCallback(new RemoteInputController.Callback() {
+ @Override
+ public void onRemoteInputActive(boolean active) {
+ mView.setIsRemoteInputActive(active);
+ }
+ });
mView.setShadeController(mShadeController);
if (mFgFeatureController.isForegroundServiceDismissalEnabled()) {
@@ -897,10 +903,6 @@
mView.setDozeAmount(amount);
}
- public float getWakeUpHeight() {
- return mView.getWakeUpHeight();
- }
-
public int getSpeedBumpIndex() {
return mView.getSpeedBumpIndex();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
index cbcccbe..b36dc56 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
@@ -399,7 +399,8 @@
ambientState.getExpansionFraction(), true /* notification */);
}
- if (view.mustStayOnScreen() && viewState.yTranslation >= 0) {
+ if (ambientState.isShadeExpanded() && view.mustStayOnScreen()
+ && viewState.yTranslation >= 0) {
// Even if we're not scrolled away we're in view and we're also not in the
// shelf. We can relax the constraints and let us scroll off the top!
float end = viewState.yTranslation + viewState.height + ambientState.getStackY();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java
index 14b39fe..6d6c0a3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CollapsedStatusBarFragment.java
@@ -205,6 +205,7 @@
public void onDestroyView() {
super.onDestroyView();
mStatusBarIconController.removeIconGroup(mDarkIconManager);
+ mAnimationScheduler.removeCallback(this);
if (mNetworkController.hasEmergencyCryptKeeperText()) {
mNetworkController.removeCallback(mSignalCallback);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
index ad4213d..f77c052 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
@@ -211,7 +211,7 @@
private int getStackScrollerPadding(int clockYPosition) {
if (mBypassEnabled) {
- return mUnlockedStackScrollerPadding;
+ return (int) (mUnlockedStackScrollerPadding + mOverStretchAmount);
} else if (mIsSplitShade) {
return clockYPosition;
} else {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java
index cfe95e0..6516abd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java
@@ -165,14 +165,14 @@
* Called by the Keyguard*ViewController whose view contains the aod icons.
*/
public void setupAodIcons(@NonNull NotificationIconContainer aodIcons) {
- boolean changed = mAodIcons != null;
+ boolean changed = mAodIcons != null && aodIcons != mAodIcons;
if (changed) {
mAodIcons.setAnimationsEnabled(false);
mAodIcons.removeAllViews();
}
mAodIcons = aodIcons;
mAodIcons.setOnLockScreen(true);
- updateAodIconsVisibility(false /* animate */);
+ updateAodIconsVisibility(false /* animate */, changed);
updateAnimations();
if (changed) {
updateAodNotificationIcons();
@@ -587,7 +587,7 @@
@Override
public void onStateChanged(int newState) {
- updateAodIconsVisibility(false /* animate */);
+ updateAodIconsVisibility(false /* animate */, false /* force */);
updateAnimations();
}
@@ -663,18 +663,18 @@
// since otherwise the unhide animation overlaps
animate &= fullyHidden;
}
- updateAodIconsVisibility(animate);
+ updateAodIconsVisibility(animate, false /* force */);
updateAodNotificationIcons();
}
@Override
public void onPulseExpansionChanged(boolean expandingChanged) {
if (expandingChanged) {
- updateAodIconsVisibility(true /* animate */);
+ updateAodIconsVisibility(true /* animate */, false /* force */);
}
}
- private void updateAodIconsVisibility(boolean animate) {
+ private void updateAodIconsVisibility(boolean animate, boolean forceUpdate) {
if (mAodIcons == null) {
return;
}
@@ -688,10 +688,11 @@
&& !mUnlockedScreenOffAnimationController.isScreenOffAnimationPlaying()) {
visible = false;
}
- if (visible && mWakeUpCoordinator.isPulseExpanding()) {
+ if (visible && mWakeUpCoordinator.isPulseExpanding()
+ && !mBypassController.getBypassEnabled()) {
visible = false;
}
- if (mAodIconsVisible != visible) {
+ if (mAodIconsVisible != visible || forceUpdate) {
mAodIconsVisible = visible;
mAodIcons.animate().cancel();
if (animate) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
index 9d94056..67fa796 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
@@ -18,6 +18,7 @@
import static android.view.View.GONE;
+import static androidx.constraintlayout.widget.ConstraintSet.BOTTOM;
import static androidx.constraintlayout.widget.ConstraintSet.END;
import static androidx.constraintlayout.widget.ConstraintSet.PARENT_ID;
import static androidx.constraintlayout.widget.ConstraintSet.START;
@@ -80,6 +81,7 @@
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.FrameLayout;
+import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintSet;
import com.android.internal.annotations.VisibleForTesting;
@@ -104,6 +106,11 @@
import com.android.systemui.biometrics.AuthController;
import com.android.systemui.classifier.Classifier;
import com.android.systemui.classifier.FalsingCollector;
+import com.android.systemui.communal.CommunalHostView;
+import com.android.systemui.communal.CommunalHostViewController;
+import com.android.systemui.communal.CommunalSource;
+import com.android.systemui.communal.CommunalSourceMonitor;
+import com.android.systemui.communal.dagger.CommunalViewComponent;
import com.android.systemui.dagger.qualifiers.DisplayId;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.doze.DozeLog;
@@ -172,6 +179,7 @@
import java.io.FileDescriptor;
import java.io.PrintWriter;
+import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -313,10 +321,12 @@
private final PulseExpansionHandler mPulseExpansionHandler;
private final KeyguardBypassController mKeyguardBypassController;
private final KeyguardUpdateMonitor mUpdateMonitor;
+ private final CommunalSourceMonitor mCommunalSourceMonitor;
private final ConversationNotificationManager mConversationNotificationManager;
private final AuthController mAuthController;
private final MediaHierarchyManager mMediaHierarchyManager;
private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
+ private final CommunalViewComponent.Factory mCommunalViewComponentFactory;
private final KeyguardStatusViewComponent.Factory mKeyguardStatusViewComponentFactory;
private final KeyguardQsUserSwitchComponent.Factory mKeyguardQsUserSwitchComponentFactory;
private final KeyguardUserSwitcherComponent.Factory mKeyguardUserSwitcherComponentFactory;
@@ -350,6 +360,8 @@
private ViewGroup mBigClockContainer;
@VisibleForTesting QS mQs;
private FrameLayout mQsFrame;
+ @Nullable
+ private CommunalHostViewController mCommunalViewController;
private KeyguardStatusViewController mKeyguardStatusViewController;
private LockIconViewController mLockIconViewController;
private NotificationsQuickSettingsContainer mNotificationContainerParent;
@@ -361,6 +373,8 @@
private VelocityTracker mQsVelocityTracker;
private boolean mQsTracking;
+ private CommunalHostView mCommunalView;
+
/**
* If set, the ongoing touch gesture might both trigger the expansion in {@link PanelView} and
* the expansion for quick settings.
@@ -508,6 +522,24 @@
mPanelAlphaAnimator.getProperty(), Interpolators.ALPHA_IN);
private final NotificationEntryManager mEntryManager;
+ private final CommunalSourceMonitor.Callback mCommunalSourceMonitorCallback =
+ new CommunalSourceMonitor.Callback() {
+ @Override
+ public void onSourceAvailable(WeakReference<CommunalSource> source) {
+ setCommunalSource(source);
+ }
+ };
+
+ private WeakReference<CommunalSource> mCommunalSource;
+
+ private final CommunalSource.Callback mCommunalSourceCallback =
+ new CommunalSource.Callback() {
+ @Override
+ public void onDisconnected() {
+ setCommunalSource(null /*source*/);
+ }
+ };
+
private final CommandQueue mCommandQueue;
private final NotificationLockscreenUserManager mLockscreenUserManager;
private final UserManager mUserManager;
@@ -614,6 +646,11 @@
* Is the current animator resetting the qs translation.
*/
private boolean mIsQsTranslationResetAnimator;
+
+ /**
+ * Is the current animator resetting the pulse expansion after a drag down
+ */
+ private boolean mIsPulseExpansionResetAnimator;
private final Rect mKeyguardStatusAreaClipBounds = new Rect();
private final Region mQsInterceptRegion = new Region();
@@ -690,7 +727,8 @@
DozeParameters dozeParameters, CommandQueue commandQueue, VibratorHelper vibratorHelper,
LatencyTracker latencyTracker, PowerManager powerManager,
AccessibilityManager accessibilityManager, @DisplayId int displayId,
- KeyguardUpdateMonitor keyguardUpdateMonitor, MetricsLogger metricsLogger,
+ KeyguardUpdateMonitor keyguardUpdateMonitor,
+ CommunalSourceMonitor communalSourceMonitor, MetricsLogger metricsLogger,
ActivityManager activityManager,
ConfigurationController configurationController,
Provider<FlingAnimationUtils.Builder> flingAnimationUtilsBuilder,
@@ -704,6 +742,7 @@
KeyguardQsUserSwitchComponent.Factory keyguardQsUserSwitchComponentFactory,
KeyguardUserSwitcherComponent.Factory keyguardUserSwitcherComponentFactory,
KeyguardStatusBarViewComponent.Factory keyguardStatusBarViewComponentFactory,
+ CommunalViewComponent.Factory communalViewComponentFactory,
LockscreenShadeTransitionController lockscreenShadeTransitionController,
QSDetailDisplayer qsDetailDisplayer,
NotificationGroupManagerLegacy groupManager,
@@ -746,6 +785,7 @@
mNotificationStackScrollLayoutController = notificationStackScrollLayoutController;
mGroupManager = groupManager;
mNotificationIconAreaController = notificationIconAreaController;
+ mCommunalViewComponentFactory = communalViewComponentFactory;
mKeyguardStatusViewComponentFactory = keyguardStatusViewComponentFactory;
mKeyguardStatusBarViewComponentFactory = keyguardStatusBarViewComponentFactory;
mDepthController = notificationShadeDepthController;
@@ -788,6 +828,7 @@
mThemeResId = mView.getContext().getThemeResId();
mKeyguardBypassController = bypassController;
mUpdateMonitor = keyguardUpdateMonitor;
+ mCommunalSourceMonitor = communalSourceMonitor;
mFirstBypassAttempt = mKeyguardBypassController.getBypassEnabled();
KeyguardStateController.Callback
keyguardMonitorCallback =
@@ -849,6 +890,7 @@
loadDimens();
mKeyguardStatusBar = mView.findViewById(R.id.keyguard_header);
mBigClockContainer = mView.findViewById(R.id.big_clock_container);
+ mCommunalView = mView.findViewById(R.id.communal_host);
UserAvatarView userAvatarView = null;
KeyguardUserSwitcherView keyguardUserSwitcherView = null;
@@ -867,7 +909,8 @@
mView.findViewById(R.id.keyguard_status_view),
userAvatarView,
mKeyguardStatusBar,
- keyguardUserSwitcherView);
+ keyguardUserSwitcherView,
+ mCommunalView);
mNotificationContainerParent = mView.findViewById(R.id.notification_container_parent);
NotificationStackScrollLayout stackScrollLayout = mView.findViewById(
R.id.notification_stack_scroller);
@@ -890,14 +933,7 @@
mWakeUpCoordinator.setStackScroller(mNotificationStackScrollLayoutController);
mQsFrame = mView.findViewById(R.id.qs_frame);
- mPulseExpansionHandler.setUp(mNotificationStackScrollLayoutController,
- amount -> {
- float progress = amount / mView.getHeight();
- float overstretch = Interpolators.getOvershootInterpolation(progress,
- (float) mMaxOverscrollAmountForPulse / mView.getHeight(),
- 0.2f);
- setOverStrechAmount(overstretch);
- });
+ mPulseExpansionHandler.setUp(mNotificationStackScrollLayoutController);
mWakeUpCoordinator.addListener(new NotificationWakeUpCoordinator.WakeUpListener() {
@Override
public void onFullyHiddenChanged(boolean isFullyHidden) {
@@ -909,7 +945,6 @@
if (mKeyguardBypassController.getBypassEnabled()) {
// Position the notifications while dragging down while pulsing
requestScrollerTopPaddingUpdate(false /* animate */);
- updateQSPulseExpansion();
}
}
});
@@ -967,7 +1002,8 @@
private void updateViewControllers(KeyguardStatusView keyguardStatusView,
UserAvatarView userAvatarView,
KeyguardStatusBarView keyguardStatusBarView,
- KeyguardUserSwitcherView keyguardUserSwitcherView) {
+ KeyguardUserSwitcherView keyguardUserSwitcherView,
+ CommunalHostView communalView) {
// Re-associate the KeyguardStatusViewController
KeyguardStatusViewComponent statusViewComponent =
mKeyguardStatusViewComponentFactory.build(keyguardStatusView);
@@ -980,6 +1016,13 @@
statusBarViewComponent.getKeyguardStatusBarViewController();
mKeyguarStatusBarViewController.init();
+ if (communalView != null) {
+ CommunalViewComponent communalViewComponent =
+ mCommunalViewComponentFactory.build(communalView);
+ mCommunalViewController =
+ communalViewComponent.getCommunalHostViewController();
+ }
+
if (mKeyguardUserSwitcherController != null) {
// Try to close the switcher so that callbacks are triggered if necessary.
// Otherwise, NPV can get into a state where some of the views are still hidden
@@ -1045,6 +1088,7 @@
ensureAllViewsHaveIds(mNotificationContainerParent);
ConstraintSet constraintSet = new ConstraintSet();
constraintSet.clone(mNotificationContainerParent);
+
if (mShouldUseSplitNotificationShade) {
// width = 0 to take up all available space within constraints
qsWidth = 0;
@@ -1139,7 +1183,7 @@
mBigClockContainer.removeAllViews();
updateViewControllers(mView.findViewById(R.id.keyguard_status_view), userAvatarView,
- mKeyguardStatusBar, keyguardUserSwitcherView);
+ mKeyguardStatusBar, keyguardUserSwitcherView, mCommunalView);
// Update keyguard bottom area
int index = mView.indexOfChild(mKeyguardBottomArea);
@@ -1348,6 +1392,10 @@
mKeyguardStatusViewController.updatePosition(
mClockPositionResult.clockX, mClockPositionResult.clockY,
mClockPositionResult.clockScale, animateClock);
+ // CommunalView's height is constrained to KeyguardStatusView. Match Y offset as well.
+ if (mCommunalViewController != null) {
+ mCommunalViewController.updatePositionY(mClockPositionResult.clockY, animateClock);
+ }
if (mKeyguardQsUserSwitchController != null) {
mKeyguardQsUserSwitchController.updatePosition(
mClockPositionResult.clockX,
@@ -1367,7 +1415,9 @@
private void updateKeyguardStatusViewAlignment(boolean animate) {
boolean hasVisibleNotifications = mNotificationStackScrollLayoutController
.getVisibleNotificationCount() != 0 || mMediaDataManager.hasActiveMedia();
- boolean shouldBeCentered = !mShouldUseSplitNotificationShade || !hasVisibleNotifications;
+ boolean hasCommunalSurface = mCommunalSource != null && mCommunalSource.get() != null;
+ boolean shouldBeCentered = !mShouldUseSplitNotificationShade
+ || (!hasVisibleNotifications && !hasCommunalSurface);
if (mStatusViewCentered != shouldBeCentered) {
mStatusViewCentered = shouldBeCentered;
ConstraintSet constraintSet = new ConstraintSet();
@@ -1380,6 +1430,21 @@
transition.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD);
TransitionManager.beginDelayedTransition(mNotificationContainerParent, transition);
}
+
+ // By default, the CommunalView is not shown. We set parameters as if it is shown, which
+ // are based on it being aligned with the start of the qs edge guide, like the
+ // notification stack scroller. These constraints cannot be expressed in the layout as
+ // they reference a peer rather than the parent.
+ constraintSet.connect(
+ R.id.communal_host, START,
+ R.id.qs_edge_guideline, START);
+ constraintSet.connect(
+ R.id.communal_host, TOP,
+ R.id.keyguard_status_view, TOP);
+ constraintSet.connect(
+ R.id.communal_host, BOTTOM,
+ R.id.keyguard_status_view, BOTTOM);
+
constraintSet.applyTo(mNotificationContainerParent);
}
}
@@ -1395,6 +1460,11 @@
* @return the maximum keyguard notifications that can fit on the screen
*/
private int computeMaxKeyguardNotifications() {
+ // Do not show any notifications on the keyguard if a communal source is set.
+ if (mCommunalSource != null && mCommunalSource.get() != null) {
+ return 0;
+ }
+
float minPadding = mClockPositionAlgorithm.getMinStackScrollerPadding();
int notificationPadding = Math.max(
1, mResources.getDimensionPixelSize(R.dimen.notification_divider_height));
@@ -1608,7 +1678,7 @@
private boolean isQsExpansionEnabled() {
return mQsExpansionEnabledPolicy && mQsExpansionEnabledAmbient
- && !mRemoteInputManager.getController().isRemoteInputActive();
+ && !mRemoteInputManager.isRemoteInputActive();
}
public void expandWithQs() {
@@ -2286,7 +2356,7 @@
}
}
- protected void updateQsExpansion() {
+ private void updateQsExpansion() {
if (mQs == null) return;
float qsExpansionFraction = computeQsExpansionFraction();
mQs.setQsExpansion(qsExpansionFraction, getHeaderTranslation());
@@ -2346,9 +2416,20 @@
top = mTransitionToFullShadeQSPosition;
} else {
final float notificationTop = getQSEdgePosition();
- top = (int) (isOnKeyguard() ? Math.min(qsPanelBottomY, notificationTop)
- : notificationTop);
+ if (isOnKeyguard()) {
+ if (mKeyguardBypassController.getBypassEnabled()) {
+ // When bypassing on the keyguard, let's use the panel bottom.
+ // this should go away once we unify the stackY position and don't have
+ // to do this min anymore below.
+ top = qsPanelBottomY;
+ } else {
+ top = (int) Math.min(qsPanelBottomY, notificationTop);
+ }
+ } else {
+ top = (int) notificationTop;
+ }
}
+ top += mOverStretchAmount;
bottom = getView().getBottom();
// notification bounds should take full screen width regardless of insets
left = 0;
@@ -2401,6 +2482,7 @@
public void onAnimationEnd(Animator animation) {
mQsClippingAnimation = null;
mIsQsTranslationResetAnimator = false;
+ mIsPulseExpansionResetAnimator = false;
}
});
mQsClippingAnimation.start();
@@ -2426,9 +2508,17 @@
}
if (mQs != null) {
float qsTranslation = 0;
- if (mTransitioningToFullShadeProgress > 0.0f || (mQsClippingAnimation != null
- && mIsQsTranslationResetAnimator)) {
- qsTranslation = (top - mQs.getHeader().getHeight()) * QS_PARALLAX_AMOUNT;
+ boolean pulseExpanding = mPulseExpansionHandler.isExpanding();
+ if (mTransitioningToFullShadeProgress > 0.0f || pulseExpanding
+ || (mQsClippingAnimation != null
+ && (mIsQsTranslationResetAnimator || mIsPulseExpansionResetAnimator))) {
+ if (pulseExpanding || mIsPulseExpansionResetAnimator) {
+ // qsTranslation should only be positive during pulse expansion because it's
+ // already translating in from the top
+ qsTranslation = Math.max(0, (top - mQs.getHeader().getHeight()) / 2.0f);
+ } else {
+ qsTranslation = (top - mQs.getHeader().getHeight()) * QS_PARALLAX_AMOUNT;
+ }
}
mQsTranslationForFullShadeTransition = qsTranslation;
updateQsFrameTranslation();
@@ -2557,14 +2647,6 @@
}
}
- private void updateQSPulseExpansion() {
- if (mQs != null) {
- mQs.setPulseExpanding(
- mKeyguardShowing && mKeyguardBypassController.getBypassEnabled()
- && mNotificationStackScrollLayoutController.isPulseExpanding());
- }
- }
-
/**
* Set the amount of pixels we have currently dragged down if we're transitioning to the full
* shade. 0.0f means we're not transitioning yet.
@@ -2616,6 +2698,15 @@
}
/**
+ * Notify the panel that the pulse expansion has finished and that we're going to the full
+ * shade
+ */
+ public void onPulseExpansionFinished() {
+ animateNextNotificationBounds(StackStateAnimator.ANIMATION_DURATION_GO_TO_FULL_SHADE, 0);
+ mIsPulseExpansionResetAnimator = true;
+ }
+
+ /**
* Set the alpha of the keyguard elements which only show on the lockscreen, but not in
* shade locked / shade. This is used when dragging down to the full shade.
*/
@@ -2972,19 +3063,7 @@
startHeight = -mQsExpansionHeight * QS_PARALLAX_AMOUNT;
}
if (mKeyguardBypassController.getBypassEnabled() && isOnKeyguard()) {
- if (mNotificationStackScrollLayoutController.isPulseExpanding()) {
- if (!mPulseExpansionHandler.isExpanding()
- && !mPulseExpansionHandler.getLeavingLockscreen()) {
- // If we aborted the expansion we need to make sure the header doesn't reappear
- // again after the header has animated away
- appearAmount = 0;
- } else {
- appearAmount = mNotificationStackScrollLayoutController
- .calculateAppearFractionBypass();
- }
- } else {
- appearAmount = 0.0f;
- }
+ appearAmount = mNotificationStackScrollLayoutController.calculateAppearFractionBypass();
startHeight = -mQs.getQsMinExpansionHeight();
}
float translation = MathUtils.lerp(startHeight, 0, Math.min(1.0f, appearAmount));
@@ -3587,7 +3666,6 @@
mQs.setPanelView(mHeightListener);
mQs.setExpandClickListener(mOnClickListener);
mQs.setHeaderClickable(isQsExpansionEnabled());
- updateQSPulseExpansion();
mQs.setOverscrolling(mStackScrollerOverscrolling);
mQs.setTranslateWhileExpanding(mShouldUseSplitNotificationShade);
@@ -3684,8 +3762,6 @@
public void setAmbientIndicationBottomPadding(int ambientIndicationBottomPadding) {
if (mAmbientIndicationBottomPadding != ambientIndicationBottomPadding) {
mAmbientIndicationBottomPadding = ambientIndicationBottomPadding;
- mLockIconViewController.setAmbientIndicationBottomPadding(
- mAmbientIndicationBottomPadding);
updateMaxDisplayedNotifications(true);
}
}
@@ -4468,7 +4544,6 @@
updateMaxDisplayedNotifications(false);
// The update needs to happen after the headerSlide in above, otherwise the translation
// would reset
- updateQSPulseExpansion();
maybeAnimateBottomAreaAlpha();
resetHorizontalPanelPosition();
updateQsState();
@@ -4501,11 +4576,34 @@
setExpandedFraction(1f);
}
+ private void setCommunalSource(WeakReference<CommunalSource> source) {
+ CommunalSource existingSource = mCommunalSource != null ? mCommunalSource.get() : null;
+
+ if (existingSource != null) {
+ existingSource.removeCallback(mCommunalSourceCallback);
+ mCommunalViewController.show(null /*source*/);
+ }
+
+ mCommunalSource = source;
+
+ CommunalSource currentSource = mCommunalSource != null ? mCommunalSource.get() : null;
+ // Set source and register callback
+ if (currentSource != null && mCommunalViewController != null) {
+ currentSource.addCallback(mCommunalSourceCallback);
+ mCommunalViewController.show(source);
+ }
+
+ updateKeyguardStatusViewAlignment(true /*animate*/);
+ updateMaxDisplayedNotifications(true /*recompute*/);
+ }
+
/**
* Sets the overstretch amount in raw pixels when dragging down.
*/
public void setOverStrechAmount(float amount) {
- mOverStretchAmount = amount;
+ float progress = amount / mView.getHeight();
+ float overstretch = Interpolators.getOvershootInterpolation(progress);
+ mOverStretchAmount = overstretch * mMaxOverscrollAmountForPulse;
positionClockAndNotifications(true /* forceUpdate */);
}
@@ -4517,6 +4615,7 @@
mStatusBarStateController.addCallback(mStatusBarStateListener);
mConfigurationController.addCallback(mConfigurationListener);
mUpdateMonitor.registerCallback(mKeyguardUpdateCallback);
+ mCommunalSourceMonitor.addCallback(mCommunalSourceMonitorCallback);
// Theme might have changed between inflating this view and attaching it to the
// window, so
// force a call to onThemeChanged
@@ -4534,6 +4633,9 @@
mStatusBarStateController.removeCallback(mStatusBarStateListener);
mConfigurationController.removeCallback(mConfigurationListener);
mUpdateMonitor.removeCallback(mKeyguardUpdateCallback);
+ mCommunalSourceMonitor.removeCallback(mCommunalSourceMonitorCallback);
+ // Clear source when detached.
+ setCommunalSource(null /*source*/);
mFalsingManager.removeTapListener(mFalsingTapListener);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index 3870b40..a9e949c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -1245,7 +1245,7 @@
@Override
public boolean shouldHideOnTouch() {
- return !mRemoteInputManager.getController().isRemoteInputActive();
+ return !mRemoteInputManager.isRemoteInputActive();
}
@Override
@@ -1465,7 +1465,7 @@
mNotificationInterruptStateProvider);
mNotificationShelfController.setOnActivatedListener(mPresenter);
- mRemoteInputManager.getController().addCallback(mNotificationShadeWindowController);
+ mRemoteInputManager.addControllerCallback(mNotificationShadeWindowController);
mNotificationActivityStarter =
mStatusBarNotificationActivityStarterBuilder
@@ -1640,7 +1640,7 @@
mKeyguardIndicationController
.setStatusBarKeyguardViewManager(mStatusBarKeyguardViewManager);
mBiometricUnlockController.setKeyguardViewController(mStatusBarKeyguardViewManager);
- mRemoteInputManager.getController().addCallback(mStatusBarKeyguardViewManager);
+ mRemoteInputManager.addControllerCallback(mStatusBarKeyguardViewManager);
mDynamicPrivacyController.setStatusBarKeyguardViewManager(mStatusBarKeyguardViewManager);
mLightBarController.setBiometricUnlockController(mBiometricUnlockController);
@@ -2762,6 +2762,11 @@
mScrimController.dump(fd, pw, args);
}
+ if (mLightRevealScrim != null) {
+ pw.println(
+ "mLightRevealScrim.getRevealAmount(): " + mLightRevealScrim.getRevealAmount());
+ }
+
if (mStatusBarKeyguardViewManager != null) {
mStatusBarKeyguardViewManager.dump(pw);
}
@@ -3058,9 +3063,7 @@
String action = intent.getAction();
if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)) {
KeyboardShortcuts.dismiss();
- if (mRemoteInputManager.getController() != null) {
- mRemoteInputManager.getController().closeRemoteInputs();
- }
+ mRemoteInputManager.closeRemoteInputs();
if (mBubblesOptional.isPresent() && mBubblesOptional.get().isStackExpanded()) {
mBubblesOptional.get().collapseStack();
}
@@ -3626,6 +3629,7 @@
mIsKeyguard = false;
Trace.beginSection("StatusBar#hideKeyguard");
boolean staying = mStatusBarStateController.leaveOpenOnKeyguardHide();
+ int previousState = mStatusBarStateController.getState();
if (!(mStatusBarStateController.setState(StatusBarState.SHADE, force))) {
//TODO: StatusBarStateController should probably know about hiding the keyguard and
// notify listeners.
@@ -3638,7 +3642,7 @@
mStatusBarStateController.setLeaveOpenOnKeyguardHide(false);
}
long delay = mKeyguardStateController.calculateGoingToFullShadeDelay();
- mLockscreenShadeTransitionController.onHideKeyguard(delay);
+ mLockscreenShadeTransitionController.onHideKeyguard(delay, previousState);
// Disable layout transitions in navbar for this transition because the load is just
// too heavy for the CPU and GPU on any device.
@@ -3989,7 +3993,7 @@
public void onUnlockHintStarted() {
mFalsingCollector.onUnlockHintStarted();
- mKeyguardIndicationController.showTransientIndication(R.string.keyguard_unlock);
+ mKeyguardIndicationController.showActionToUnlock();
}
public void onHintFinished() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt
index edcf261..1dd22b4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt
@@ -155,13 +155,30 @@
val dc = context.display.cutout
val currentRotation = RotationUtils.getExactRotation(context)
+ val isRtl = rotatedResources.configuration.layoutDirection == LAYOUT_DIRECTION_RTL
+ val roundedCornerPadding = rotatedResources
+ .getDimensionPixelSize(R.dimen.rounded_corner_content_padding)
+ val minDotWidth = rotatedResources
+ .getDimensionPixelSize(R.dimen.ongoing_appops_dot_min_padding)
+
+ val minLeft: Int
+ val minRight: Int
+ if (isRtl) {
+ minLeft = max(minDotWidth, roundedCornerPadding)
+ minRight = roundedCornerPadding
+ } else {
+ minLeft = roundedCornerPadding
+ minRight = max(minDotWidth, roundedCornerPadding)
+ }
+
return calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
dc,
windowManager.maximumWindowMetrics,
rotatedResources.getDimensionPixelSize(R.dimen.status_bar_height),
- rotatedResources.getDimensionPixelSize(R.dimen.rounded_corner_content_padding))
+ minLeft,
+ minRight)
}
override fun dump(fd: FileDescriptor, pw: PrintWriter, args: Array<out String>) {
@@ -212,9 +229,12 @@
* Calculates the exact left and right positions for the status bar contents for the given
* rotation
*
- * @param rot rotation for which to query the margins
- * @param context systemui context
- * @param rotatedResources resources constructed with the proper orientation set
+ * @param currentRotation current device rotation
+ * @param targetRotation rotation for which to calculate the status bar content rect
+ * @param displayCutout [DisplayCutout] for the curren display. possibly null
+ * @param windowMetrics [WindowMetrics] for the current window
+ * @param statusBarHeight height of the status bar for the target rotation
+ * @param roundedCornerPadding from rounded_corner_content_padding
*
* @see [RotationUtils#getResourcesForRotation]
*/
@@ -224,7 +244,8 @@
displayCutout: DisplayCutout?,
windowMetrics: WindowMetrics,
statusBarHeight: Int,
- roundedCornerPadding: Int
+ minLeft: Int,
+ minRight: Int
): Rect {
/*
TODO: Check if this is ever used for devices with no rounded corners
@@ -242,7 +263,8 @@
rotZeroBounds.bottom,
currentBounds.width(),
currentBounds.height(),
- roundedCornerPadding,
+ minLeft,
+ minRight,
targetRotation,
currentRotation)
@@ -256,7 +278,10 @@
* @param sbHeight appropriate status bar height for this rotation
* @param width display width calculated for ROTATION_NONE
* @param height display height calculated for ROTATION_NONE
- * @param roundedCornerPadding rounded_corner_content_padding dimension
+ * @param cWidth display width in our current rotation
+ * @param cHeight display height in our current rotation
+ * @param minLeft the minimum padding to enforce on the left
+ * @param minRight the minimum padding to enforce on the right
* @param targetRotation the rotation for which to calculate margins
* @param currentRotation the rotation from which the display cutout was generated
*
@@ -270,7 +295,8 @@
height: Int,
cWidth: Int,
cHeight: Int,
- roundedCornerPadding: Int,
+ minLeft: Int,
+ minRight: Int,
@Rotation targetRotation: Int,
@Rotation currentRotation: Int
): Rect {
@@ -279,9 +305,9 @@
val cutoutRects = dc?.boundingRects
if (cutoutRects == null || cutoutRects.isEmpty()) {
- return Rect(roundedCornerPadding,
+ return Rect(minLeft,
0,
- logicalDisplayWidth - roundedCornerPadding,
+ logicalDisplayWidth - minRight,
sbHeight)
}
@@ -294,8 +320,8 @@
// Size of the status bar window for the given rotation relative to our exact rotation
val sbRect = sbRect(relativeRotation, sbHeight, Pair(cWidth, cHeight))
- var leftMargin = roundedCornerPadding
- var rightMargin = roundedCornerPadding
+ var leftMargin = minLeft
+ var rightMargin = minRight
for (cutoutRect in cutoutRects) {
// There is at most one non-functional area per short edge of the device. So if the status
// bar doesn't share a short edge with the cutout, we can ignore its insets because there
@@ -306,11 +332,11 @@
if (cutoutRect.touchesLeftEdge(relativeRotation, cWidth, cHeight)) {
- val l = max(roundedCornerPadding, cutoutRect.logicalWidth(relativeRotation))
+ val l = max(minLeft, cutoutRect.logicalWidth(relativeRotation))
leftMargin = max(l, leftMargin)
} else if (cutoutRect.touchesRightEdge(relativeRotation, cWidth, cHeight)) {
val logicalWidth = cutoutRect.logicalWidth(relativeRotation)
- rightMargin = max(roundedCornerPadding, logicalWidth)
+ rightMargin = max(minRight, logicalWidth)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java
index 9a6dd38..1717b82 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarter.java
@@ -60,7 +60,6 @@
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
import com.android.systemui.statusbar.NotificationPresenter;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
-import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.notification.NotificationActivityStarter;
import com.android.systemui.statusbar.notification.NotificationEntryListener;
import com.android.systemui.statusbar.notification.NotificationEntryManager;
@@ -230,12 +229,11 @@
mLogger.logStartingActivityFromClick(sbn.getKey());
final NotificationEntry entry = row.getEntry();
- RemoteInputController controller = mRemoteInputManager.getController();
- if (controller.isRemoteInputActive(entry)
+ if (mRemoteInputManager.isRemoteInputActive(entry)
&& !TextUtils.isEmpty(row.getActiveRemoteInputText())) {
// We have an active remote input typed and the user clicked on the notification.
// this was probably unintentional, so we're closing the edit text instead.
- controller.closeRemoteInputs();
+ mRemoteInputManager.closeRemoteInputs();
return;
}
Notification notification = sbn.getNotification();
@@ -265,8 +263,7 @@
@Override
public boolean onDismiss() {
return handleNotificationClickAfterKeyguardDismissed(
- entry, row, controller, intent,
- isActivityIntent, animate, showOverLockscreen);
+ entry, row, intent, isActivityIntent, animate, showOverLockscreen);
}
@Override
@@ -286,7 +283,6 @@
private boolean handleNotificationClickAfterKeyguardDismissed(
NotificationEntry entry,
ExpandableNotificationRow row,
- RemoteInputController controller,
PendingIntent intent,
boolean isActivityIntent,
boolean animate,
@@ -294,8 +290,7 @@
mLogger.logHandleClickAfterKeyguardDismissed(entry.getKey());
final Runnable runnable = () -> handleNotificationClickAfterPanelCollapsed(
- entry, row, controller, intent,
- isActivityIntent, animate);
+ entry, row, intent, isActivityIntent, animate);
if (showOverLockscreen) {
mShadeController.addPostCollapseAction(runnable);
@@ -315,7 +310,6 @@
private void handleNotificationClickAfterPanelCollapsed(
NotificationEntry entry,
ExpandableNotificationRow row,
- RemoteInputController controller,
PendingIntent intent,
boolean isActivityIntent,
boolean animate) {
@@ -354,7 +348,8 @@
if (!TextUtils.isEmpty(entry.remoteInputText)) {
remoteInputText = entry.remoteInputText;
}
- if (!TextUtils.isEmpty(remoteInputText) && !controller.isSpinning(notificationKey)) {
+ if (!TextUtils.isEmpty(remoteInputText)
+ && !mRemoteInputManager.isSpinning(notificationKey)) {
fillInIntent = new Intent().putExtra(Notification.EXTRA_REMOTE_INPUT_DRAFT,
remoteInputText.toString());
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java
index aa58527..cb844d8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java
@@ -24,12 +24,14 @@
import android.content.Context;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.os.SystemClock;
import android.service.notification.NotificationListenerService;
import android.service.notification.StatusBarNotification;
import android.service.vr.IVrManager;
import android.service.vr.IVrStateCallbacks;
import android.util.Log;
import android.util.Slog;
+import android.view.View;
import android.view.accessibility.AccessibilityManager;
import android.widget.TextView;
@@ -179,8 +181,6 @@
remoteInputManager.setUpWithCallback(
Dependency.get(NotificationRemoteInputManager.Callback.class),
mNotificationPanel.createRemoteInputDelegate());
- remoteInputManager.getController().addCallback(
- Dependency.get(NotificationShadeWindowController.class));
initController.addPostInitTask(() -> {
NotificationEntryListener notificationEntryListener = new NotificationEntryListener() {
@@ -394,8 +394,10 @@
}
@Override
- public void onExpandClicked(NotificationEntry clickedEntry, boolean nowExpanded) {
+ public void onExpandClicked(NotificationEntry clickedEntry, View clickedView,
+ boolean nowExpanded) {
mHeadsUpManager.setExpanded(clickedEntry, nowExpanded);
+ mStatusBar.wakeUpIfDozing(SystemClock.uptimeMillis(), clickedView, "NOTIFICATION_CLICK");
if (nowExpanded) {
if (mStatusBarStateController.getState() == StatusBarState.KEYGUARD) {
mShadeTransitionController.goToLockedShade(clickedEntry.getRow());
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DevicePostureController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DevicePostureController.java
new file mode 100644
index 0000000..fbfa5e5
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DevicePostureController.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.policy;
+
+import static com.android.systemui.statusbar.policy.DevicePostureController.Callback;
+
+import android.annotation.IntDef;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * Listener for device posture changes. This can be used to query the current posture, or register
+ * for events when it changes.
+ */
+public interface DevicePostureController extends CallbackController<Callback> {
+ @IntDef(prefix = {"DEVICE_POSTURE_"}, value = {
+ DEVICE_POSTURE_UNKNOWN,
+ DEVICE_POSTURE_CLOSED,
+ DEVICE_POSTURE_HALF_OPENED,
+ DEVICE_POSTURE_OPENED,
+ DEVICE_POSTURE_FLIPPED
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ @interface DevicePostureInt {}
+
+ // NOTE: These constants **must** match those defined for Jetpack Sidecar. This is because we
+ // use the Device State -> Jetpack Posture map in DevicePostureControllerImpl to translate
+ // between the two.
+ int DEVICE_POSTURE_UNKNOWN = 0;
+ int DEVICE_POSTURE_CLOSED = 1;
+ int DEVICE_POSTURE_HALF_OPENED = 2;
+ int DEVICE_POSTURE_OPENED = 3;
+ int DEVICE_POSTURE_FLIPPED = 4;
+
+ /** Return the current device posture. */
+ @DevicePostureInt int getDevicePosture();
+
+ /** Callback to be notified about device posture changes. */
+ interface Callback {
+ /** Called when the posture changes. */
+ void onPostureChanged(@DevicePostureInt int posture);
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DevicePostureControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DevicePostureControllerImpl.java
new file mode 100644
index 0000000..8471e0a
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DevicePostureControllerImpl.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.policy;
+
+import android.content.Context;
+import android.hardware.devicestate.DeviceStateManager;
+import android.util.SparseIntArray;
+
+import androidx.annotation.NonNull;
+
+import com.android.internal.R;
+import com.android.systemui.dagger.SysUISingleton;
+import com.android.systemui.dagger.qualifiers.Main;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Executor;
+
+import javax.inject.Inject;
+
+/** Implementation of {@link DevicePostureController} using the DeviceStateManager. */
+@SysUISingleton
+public class DevicePostureControllerImpl implements DevicePostureController {
+ private final List<Callback> mListeners = new ArrayList<>();
+ private int mCurrentDevicePosture = DEVICE_POSTURE_UNKNOWN;
+
+ private final SparseIntArray mDeviceStateToPostureMap = new SparseIntArray();
+
+ @Inject
+ public DevicePostureControllerImpl(
+ Context context, DeviceStateManager deviceStateManager, @Main Executor executor) {
+ // Most of this is borrowed from WindowManager/Jetpack/DeviceStateManagerPostureProducer.
+ // Using the sidecar/extension libraries directly brings in a new dependency that it'd be
+ // good to avoid (along with the fact that sidecar is deprecated, and extensions isn't fully
+ // ready yet), and we'd have to make our own layer over the sidecar library anyway to easily
+ // allow the implementation to change, so it was easier to just interface with
+ // DeviceStateManager directly.
+ String[] deviceStatePosturePairs = context.getResources()
+ .getStringArray(R.array.config_device_state_postures);
+ for (String deviceStatePosturePair : deviceStatePosturePairs) {
+ String[] deviceStatePostureMapping = deviceStatePosturePair.split(":");
+ if (deviceStatePostureMapping.length != 2) {
+ continue;
+ }
+
+ int deviceState;
+ int posture;
+ try {
+ deviceState = Integer.parseInt(deviceStatePostureMapping[0]);
+ posture = Integer.parseInt(deviceStatePostureMapping[1]);
+ } catch (NumberFormatException e) {
+ continue;
+ }
+
+ mDeviceStateToPostureMap.put(deviceState, posture);
+ }
+
+ deviceStateManager.registerCallback(executor, state -> {
+ mCurrentDevicePosture =
+ mDeviceStateToPostureMap.get(state, DEVICE_POSTURE_UNKNOWN);
+
+ mListeners.forEach(l -> l.onPostureChanged(mCurrentDevicePosture));
+ });
+ }
+
+ @Override
+ public void addCallback(@NonNull Callback listener) {
+ mListeners.add(listener);
+ }
+
+ @Override
+ public void removeCallback(@NonNull Callback listener) {
+ mListeners.remove(listener);
+ }
+
+ @Override
+ public int getDevicePosture() {
+ return mCurrentDevicePosture;
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
index 6af632d..c3b61e7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
@@ -140,6 +140,7 @@
public final DetailAdapter mUserDetailAdapter;
private final Executor mUiBgExecutor;
private final boolean mGuestUserAutoCreated;
+ private final AtomicBoolean mGuestIsResetting;
private final AtomicBoolean mGuestCreationScheduled;
private FalsingManager mFalsingManager;
@@ -174,6 +175,7 @@
}
mGuestUserAutoCreated = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_guestUserAutoCreated);
+ mGuestIsResetting = new AtomicBoolean();
mGuestCreationScheduled = new AtomicBoolean();
mKeyguardStateController = keyguardStateController;
mHandler = handler;
@@ -323,7 +325,20 @@
boolean createIsRestricted = !addUsersWhenLocked;
if (guestRecord == null) {
- if (canCreateGuest) {
+ if (mGuestUserAutoCreated) {
+ // If mGuestIsResetting=true, the switch should be disabled since
+ // we will just use it as an indicator for "Resetting guest...".
+ // Otherwise, default to canSwitchUsers.
+ boolean isSwitchToGuestEnabled =
+ !mGuestIsResetting.get() && canSwitchUsers;
+ guestRecord = new UserRecord(null /* info */, null /* picture */,
+ true /* isGuest */, false /* isCurrent */,
+ false /* isAddUser */, false /* isRestricted */,
+ isSwitchToGuestEnabled);
+ // Don't call checkIfAddUserDisallowedByAdminOnly if
+ // config_guestUserAutoCreated=true.
+ records.add(guestRecord);
+ } else if (canCreateGuest) {
guestRecord = new UserRecord(null /* info */, null /* picture */,
true /* isGuest */, false /* isCurrent */,
false /* isAddUser */, createIsRestricted, canSwitchUsers);
@@ -685,6 +700,9 @@
switchToUserId(newGuestId);
mUserManager.removeUser(currentUser.id);
} else {
+ if (mGuestUserAutoCreated) {
+ mGuestIsResetting.set(true);
+ }
switchToUserId(targetUserId);
mUserManager.removeUser(currentUser.id);
}
@@ -701,10 +719,14 @@
mUiBgExecutor.execute(() -> {
int newGuestId = createGuest();
+ mGuestCreationScheduled.set(false);
+ mGuestIsResetting.set(false);
if (newGuestId == UserHandle.USER_NULL) {
Log.w(TAG, "Could not create new guest while exiting existing guest");
+ // Refresh users so that we still display "Guest" if
+ // config_guestUserAutoCreated=true
+ refreshUsers(UserHandle.USER_NULL);
}
- mGuestCreationScheduled.set(false);
});
}
@@ -807,12 +829,25 @@
? com.android.settingslib.R.string.guest_reset_guest
: com.android.settingslib.R.string.guest_exit_guest);
} else {
- // If config_guestUserAutoCreated, always show guest nickname instead of "Add
- // guest" to make it seem as though the device always has a guest ready for use
- return context.getString(
- item.info == null && !mController.mGuestUserAutoCreated
- ? com.android.settingslib.R.string.guest_new_guest
- : com.android.settingslib.R.string.guest_nickname);
+ if (item.info != null) {
+ return context.getString(com.android.settingslib.R.string.guest_nickname);
+ } else {
+ if (mController.mGuestUserAutoCreated) {
+ // If mGuestIsResetting=true, we expect the guest user to be created
+ // shortly, so display a "Resetting guest..." as an indicator that we
+ // are busy. Otherwise, if mGuestIsResetting=false, we probably failed
+ // to create a guest at some point. In this case, always show guest
+ // nickname instead of "Add guest" to make it seem as though the device
+ // always has a guest ready for use.
+ return context.getString(
+ mController.mGuestIsResetting.get()
+ ? com.android.settingslib.R.string.guest_resetting
+ : com.android.settingslib.R.string.guest_nickname);
+ } else {
+ return context.getString(
+ com.android.settingslib.R.string.guest_new_guest);
+ }
+ }
}
} else if (item.isAddUser) {
return context.getString(R.string.user_add_user);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/dagger/StatusBarPolicyModule.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/dagger/StatusBarPolicyModule.java
index 9fb0453..c224cf5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/dagger/StatusBarPolicyModule.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/dagger/StatusBarPolicyModule.java
@@ -28,6 +28,8 @@
import com.android.systemui.statusbar.policy.CastControllerImpl;
import com.android.systemui.statusbar.policy.DeviceControlsController;
import com.android.systemui.statusbar.policy.DeviceControlsControllerImpl;
+import com.android.systemui.statusbar.policy.DevicePostureController;
+import com.android.systemui.statusbar.policy.DevicePostureControllerImpl;
import com.android.systemui.statusbar.policy.ExtensionController;
import com.android.systemui.statusbar.policy.ExtensionControllerImpl;
import com.android.systemui.statusbar.policy.FlashlightController;
@@ -130,6 +132,11 @@
AccessPointControllerImpl accessPointControllerImpl);
/** */
+ @Binds
+ DevicePostureController provideDevicePostureController(
+ DevicePostureControllerImpl devicePostureControllerImpl);
+
+ /** */
@SysUISingleton
@Provides
static AccessPointControllerImpl provideAccessPointControllerImpl(
diff --git a/packages/SystemUI/tests/src/com/android/systemui/communal/CommunalHostViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/communal/CommunalHostViewControllerTest.java
new file mode 100644
index 0000000..e98cf1f
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/communal/CommunalHostViewControllerTest.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.communal;
+
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.testing.AndroidTestingRunner;
+import android.view.View;
+
+import androidx.test.filters.SmallTest;
+
+import com.android.systemui.SysuiTestCase;
+import com.android.systemui.plugins.statusbar.StatusBarStateController;
+import com.android.systemui.statusbar.policy.KeyguardStateController;
+import com.android.systemui.util.concurrency.FakeExecutor;
+import com.android.systemui.util.time.FakeSystemClock;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+import java.lang.ref.WeakReference;
+
+@SmallTest
+@RunWith(AndroidTestingRunner.class)
+public class CommunalHostViewControllerTest extends SysuiTestCase {
+ @Mock
+ private Context mContext;
+
+ @Mock
+ private KeyguardStateController mKeyguardStateController;
+
+ @Mock
+ private StatusBarStateController mStatusBarStateController;
+
+ @Mock
+ private CommunalHostView mCommunalView;
+
+ private FakeExecutor mFakeExecutor = new FakeExecutor(new FakeSystemClock());
+
+ private CommunalHostViewController mController;
+
+ @Mock
+ private CommunalSource mCommunalSource;
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+
+ when(mKeyguardStateController.isShowing()).thenReturn(true);
+
+ mController = new CommunalHostViewController(mFakeExecutor, mKeyguardStateController,
+ mStatusBarStateController, mCommunalView);
+ }
+
+ @Test
+ public void testShow() {
+ ArgumentCaptor<KeyguardStateController.Callback> callbackCapture =
+ ArgumentCaptor.forClass(KeyguardStateController.Callback.class);
+
+ // Capture callback value for later use.
+ verify(mKeyguardStateController).addCallback(callbackCapture.capture());
+
+ // Verify the communal view is shown when the controller is initialized with keyguard
+ // showing (see setup).
+ mController.show(new WeakReference<>(mCommunalSource));
+ mFakeExecutor.runAllReady();
+ verify(mCommunalView).setVisibility(View.VISIBLE);
+
+ // Trigger keyguard off to ensure visibility of communal view is changed accordingly.
+ when(mKeyguardStateController.isShowing()).thenReturn(false);
+ callbackCapture.getValue().onKeyguardShowingChanged();
+ mFakeExecutor.runAllReady();
+ verify(mCommunalView).setVisibility(View.INVISIBLE);
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java
index 8c53091..ad16e9d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java
@@ -54,6 +54,7 @@
import com.android.systemui.shared.plugins.PluginManager;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.phone.AutoTileManager;
+import com.android.systemui.statusbar.phone.KeyguardBypassController;
import com.android.systemui.statusbar.phone.StatusBar;
import com.android.systemui.statusbar.phone.StatusBarIconController;
import com.android.systemui.statusbar.policy.Clock;
@@ -91,6 +92,8 @@
@Mock
private MediaHost mQQSMediaHost;
@Mock
+ private KeyguardBypassController mBypassController;
+ @Mock
private FalsingManager mFalsingManager;
public QSFragmentTest() {
@@ -181,6 +184,7 @@
new QSDetailDisplayer(),
mQSMediaHost,
mQQSMediaHost,
+ mBypassController,
mQsComponentFactory,
mFalsingManager);
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java
index 298bd9a..f5ce673 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java
@@ -81,6 +81,7 @@
import com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController;
import com.android.systemui.plugins.FalsingManager;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
+import com.android.systemui.statusbar.phone.KeyguardBypassController;
import com.android.systemui.statusbar.phone.KeyguardIndicationTextView;
import com.android.systemui.statusbar.phone.LockIcon;
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
@@ -146,6 +147,8 @@
private LockPatternUtils mLockPatternUtils;
@Mock
private IActivityManager mIActivityManager;
+ @Mock
+ private KeyguardBypassController mKeyguardBypassController;
@Captor
private ArgumentCaptor<DockManager.AlignmentStateListener> mAlignmentListener;
@Captor
@@ -216,7 +219,8 @@
mController = new KeyguardIndicationController(mContext, mWakeLockBuilder,
mKeyguardStateController, mStatusBarStateController, mKeyguardUpdateMonitor,
mDockManager, mBroadcastDispatcher, mDevicePolicyManager, mIBatteryStats,
- mUserManager, mExecutor, mFalsingManager, mLockPatternUtils, mIActivityManager);
+ mUserManager, mExecutor, mFalsingManager, mLockPatternUtils, mIActivityManager,
+ mKeyguardBypassController);
mController.init();
mController.setIndicationArea(mIndicationArea);
verify(mStatusBarStateController).addCallback(mStatusBarStateListenerCaptor.capture());
@@ -507,6 +511,7 @@
createController();
String message = mContext.getString(R.string.keyguard_retry);
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(true);
+ when(mKeyguardUpdateMonitor.isFaceEnrolled()).thenReturn(true);
mController.setVisible(true);
mController.getKeyguardCallback().onBiometricError(FaceManager.FACE_ERROR_TIMEOUT,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/HeadsUpCoordinatorTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/HeadsUpCoordinatorTest.java
index 7e771ce..a3569e4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/HeadsUpCoordinatorTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/HeadsUpCoordinatorTest.java
@@ -31,7 +31,6 @@
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
-import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.notification.collection.NotifPipeline;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder;
@@ -72,7 +71,6 @@
@Mock private HeadsUpViewBinder mHeadsUpViewBinder;
@Mock private NotificationInterruptStateProvider mNotificationInterruptStateProvider;
@Mock private NotificationRemoteInputManager mRemoteInputManager;
- @Mock private RemoteInputController mRemoteInputController;
@Mock private NotifLifetimeExtender.OnEndLifetimeExtensionCallback mEndLifetimeExtension;
@Mock private NodeController mHeaderController;
@@ -81,7 +79,6 @@
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
- when(mRemoteInputManager.getController()).thenReturn(mRemoteInputController);
mCoordinator = new HeadsUpCoordinator(
mHeadsUpManager,
@@ -215,7 +212,7 @@
// WHEN mEntry is removed from the notification collection
mCollectionListener.onEntryRemoved(mEntry, /* cancellation reason */ 0);
- when(mRemoteInputController.isSpinning(any())).thenReturn(false);
+ when(mRemoteInputManager.isSpinning(any())).thenReturn(false);
// THEN heads up manager should remove the entry
verify(mHeadsUpManager).removeNotification(mEntry.getKey(), false);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java
index 6ee2f20..c56d085 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java
@@ -24,6 +24,7 @@
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
+import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
@@ -128,7 +129,6 @@
@Mock private ForegroundServiceDungeonView mForegroundServiceDungeonView;
@Mock private LayoutInflater mLayoutInflater;
@Mock private NotificationRemoteInputManager mRemoteInputManager;
- @Mock private RemoteInputController mRemoteInputController;
@Mock private VisualStabilityManager mVisualStabilityManager;
@Mock private ShadeController mShadeController;
@@ -145,7 +145,6 @@
when(mFeatureFlags.isNewNotifPipelineRenderingEnabled()).thenReturn(false);
when(mFgServicesSectionController.createView(mLayoutInflater))
.thenReturn(mForegroundServiceDungeonView);
- when(mRemoteInputManager.getController()).thenReturn(mRemoteInputController);
mController = new NotificationStackScrollLayoutController(
true,
@@ -402,6 +401,19 @@
any(ForegroundServiceDungeonView.class));
}
+ @Test
+ public void testUpdateFooter_remoteInput() {
+ ArgumentCaptor<RemoteInputController.Callback> callbackCaptor =
+ ArgumentCaptor.forClass(RemoteInputController.Callback.class);
+ doNothing().when(mRemoteInputManager).addControllerCallback(callbackCaptor.capture());
+ when(mRemoteInputManager.isRemoteInputActive()).thenReturn(false);
+ mController.attach(mNotificationStackScrollLayout);
+ verify(mNotificationStackScrollLayout).setIsRemoteInputActive(false);
+ RemoteInputController.Callback callback = callbackCaptor.getValue();
+ callback.onRemoteInputActive(true);
+ verify(mNotificationStackScrollLayout).setIsRemoteInputActive(true);
+ }
+
private LogMaker logMatcher(int category, int type) {
return argThat(new LogMatcher(category, type));
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
index 6185437..d02d77e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
@@ -52,10 +52,9 @@
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.statusbar.EmptyShadeView;
-import com.android.systemui.statusbar.NotificationRemoteInputManager;
+import com.android.systemui.statusbar.FeatureFlags;
import com.android.systemui.statusbar.NotificationShelf;
import com.android.systemui.statusbar.NotificationShelfController;
-import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
@@ -96,13 +95,10 @@
@Mock private NotificationGroupManagerLegacy mGroupExpansionManager;
@Mock private ExpandHelper mExpandHelper;
@Mock private EmptyShadeView mEmptyShadeView;
- @Mock private NotificationRemoteInputManager mRemoteInputManager;
- @Mock private RemoteInputController mRemoteInputController;
@Mock private NotificationRoundnessManager mNotificationRoundnessManager;
@Mock private KeyguardBypassController mBypassController;
@Mock private NotificationSectionsManager mNotificationSectionsManager;
@Mock private NotificationSection mNotificationSection;
- @Mock private SysuiStatusBarStateController mStatusBarStateController;
@Mock private NotificationSwipeHelper mNotificationSwipeHelper;
@Mock private NotificationStackScrollLayoutController mStackScrollLayoutController;
@Mock private UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController;
@@ -127,7 +123,6 @@
new NotificationSection[]{
mNotificationSection
});
- when(mRemoteInputManager.getController()).thenReturn(mRemoteInputController);
// Interact with real instance of AmbientState.
mAmbientState = new AmbientState(mContext, mNotificationSectionsManager, mBypassController);
@@ -153,7 +148,6 @@
when(mStackScrollLayoutController.getNoticationRoundessManager())
.thenReturn(mNotificationRoundnessManager);
mStackScroller.setController(mStackScrollLayoutController);
- mStackScroller.setRemoteInputManager(mRemoteInputManager);
// Stub out functionality that isn't necessary to test.
doNothing().when(mBar)
@@ -301,7 +295,7 @@
when(row.canViewBeDismissed()).thenReturn(true);
when(mStackScroller.getChildCount()).thenReturn(1);
when(mStackScroller.getChildAt(anyInt())).thenReturn(row);
- when(mRemoteInputController.isRemoteInputActive()).thenReturn(true);
+ mStackScroller.setIsRemoteInputActive(true);
when(mStackScrollLayoutController.hasActiveClearableNotifications(ROWS_ALL))
.thenReturn(true);
when(mStackScrollLayoutController.hasActiveNotifications()).thenReturn(true);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java
index a8a1b8b..c54607f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java
@@ -88,6 +88,11 @@
import com.android.systemui.biometrics.AuthController;
import com.android.systemui.classifier.FalsingCollectorFake;
import com.android.systemui.classifier.FalsingManagerFake;
+import com.android.systemui.communal.CommunalHostView;
+import com.android.systemui.communal.CommunalHostViewController;
+import com.android.systemui.communal.CommunalSource;
+import com.android.systemui.communal.CommunalSourceMonitor;
+import com.android.systemui.communal.dagger.CommunalViewComponent;
import com.android.systemui.doze.DozeLog;
import com.android.systemui.fragments.FragmentHostManager;
import com.android.systemui.fragments.FragmentService;
@@ -107,7 +112,6 @@
import com.android.systemui.statusbar.NotificationShadeDepthController;
import com.android.systemui.statusbar.NotificationShelfController;
import com.android.systemui.statusbar.PulseExpansionHandler;
-import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.StatusBarStateControllerImpl;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.VibratorHelper;
@@ -137,6 +141,7 @@
import org.mockito.MockitoAnnotations;
import org.mockito.stubbing.Answer;
+import java.lang.ref.WeakReference;
import java.util.List;
@SmallTest
@@ -247,6 +252,18 @@
@Mock
private KeyguardStatusBarViewComponent mKeyguardStatusBarViewComponent;
@Mock
+ private CommunalViewComponent.Factory mCommunalViewComponentFactory;
+ @Mock
+ private CommunalViewComponent mCommunalViewComponent;
+ @Mock
+ private CommunalHostViewController mCommunalHostViewController;
+ @Mock
+ private CommunalSourceMonitor mCommunalSourceMonitor;
+ @Mock
+ private CommunalSource mCommunalSource;
+ @Mock
+ private CommunalHostView mCommunalHostView;
+ @Mock
private KeyguardClockSwitchController mKeyguardClockSwitchController;
@Mock
private KeyguardStatusViewController mKeyguardStatusViewController;
@@ -297,8 +314,6 @@
@Mock
private NotificationRemoteInputManager mNotificationRemoteInputManager;
@Mock
- private RemoteInputController mRemoteInputController;
- @Mock
private RecordingController mRecordingController;
private SysuiStatusBarStateController mStatusBarStateController;
@@ -336,6 +351,7 @@
when(mView.findViewById(R.id.keyguard_clock_container)).thenReturn(mKeyguardClockSwitch);
when(mView.findViewById(R.id.notification_stack_scroller))
.thenReturn(mNotificationStackScrollLayout);
+ when(mView.findViewById(R.id.communal_host)).thenReturn(mCommunalHostView);
when(mNotificationStackScrollLayout.getController())
.thenReturn(mNotificationStackScrollLayoutController);
when(mNotificationStackScrollLayoutController.getHeight()).thenReturn(1000);
@@ -372,16 +388,17 @@
mKeyguardBypassController,
mDozeParameters,
mUnlockedScreenOffAnimationController);
+ mConfigurationController = new ConfigurationControllerImpl(mContext);
PulseExpansionHandler expansionHandler = new PulseExpansionHandler(
mContext,
coordinator,
mKeyguardBypassController, mHeadsUpManager,
mock(NotificationRoundnessManager.class),
+ mConfigurationController,
mStatusBarStateController,
mFalsingManager,
mLockscreenShadeTransitionController,
new FalsingCollectorFake());
- mConfigurationController = new ConfigurationControllerImpl(mContext);
when(mKeyguardStatusViewComponentFactory.build(any()))
.thenReturn(mKeyguardStatusViewComponent);
when(mKeyguardStatusViewComponent.getKeyguardClockSwitchController())
@@ -392,12 +409,15 @@
.thenReturn(mKeyguardStatusBarViewComponent);
when(mKeyguardStatusBarViewComponent.getKeyguardStatusBarViewController())
.thenReturn(mKeyguardStatusBarViewController);
+ when(mCommunalViewComponentFactory.build(any()))
+ .thenReturn(mCommunalViewComponent);
+ when(mCommunalViewComponent.getCommunalHostViewController())
+ .thenReturn(mCommunalHostViewController);
when(mLayoutInflater.inflate(eq(R.layout.keyguard_status_view), any(), anyBoolean()))
.thenReturn(mKeyguardStatusView);
when(mLayoutInflater.inflate(eq(R.layout.keyguard_bottom_area), any(), anyBoolean()))
.thenReturn(mKeyguardBottomArea);
- when(mNotificationRemoteInputManager.getController()).thenReturn(mRemoteInputController);
- when(mRemoteInputController.isRemoteInputActive()).thenReturn(false);
+ when(mNotificationRemoteInputManager.isRemoteInputActive()).thenReturn(false);
reset(mView);
@@ -411,7 +431,7 @@
mKeyguardStateController, mStatusBarStateController, mDozeLog,
mDozeParameters, mCommandQueue, mVibratorHelper,
mLatencyTracker, mPowerManager, mAccessibilityManager, 0, mUpdateMonitor,
- mMetricsLogger, mActivityManager, mConfigurationController,
+ mCommunalSourceMonitor, mMetricsLogger, mActivityManager, mConfigurationController,
() -> flingAnimationUtilsBuilder, mStatusBarTouchableRegionManager,
mConversationNotificationManager, mMediaHiearchyManager,
mBiometricUnlockController, mStatusBarKeyguardViewManager,
@@ -420,6 +440,7 @@
mKeyguardQsUserSwitchComponentFactory,
mKeyguardUserSwitcherComponentFactory,
mKeyguardStatusBarViewComponentFactory,
+ mCommunalViewComponentFactory,
mLockscreenShadeTransitionController,
mQSDetailDisplayer,
mGroupManager,
@@ -799,6 +820,28 @@
verify(mKeyguardStatusViewController, never()).displayClock(LARGE);
}
+ @Test
+ public void testCommunalSourceListening() {
+ final ArgumentCaptor<CommunalSourceMonitor.Callback> monitorCallback =
+ ArgumentCaptor.forClass(CommunalSourceMonitor.Callback.class);
+
+ givenViewAttached();
+ verify(mCommunalSourceMonitor).addCallback(monitorCallback.capture());
+
+ final ArgumentCaptor<WeakReference<CommunalSource>> sourceCapture =
+ ArgumentCaptor.forClass(WeakReference.class);
+
+ monitorCallback.getValue().onSourceAvailable(new WeakReference<>(mCommunalSource));
+ verify(mCommunalHostViewController).show(sourceCapture.capture());
+ assertThat(sourceCapture.getValue().get()).isEqualTo(mCommunalSource);
+
+ clearInvocations(mCommunalHostViewController);
+ givenViewDetached();
+ verify(mCommunalSourceMonitor).removeCallback(any());
+ verify(mCommunalHostViewController).show(sourceCapture.capture());
+ assertThat(sourceCapture.getValue()).isEqualTo(null);
+ }
+
private void triggerPositionClockAndNotifications() {
mNotificationPanelViewController.closeQs();
}
@@ -817,6 +860,13 @@
}
}
+ private void givenViewDetached() {
+ for (View.OnAttachStateChangeListener listener : mOnAttachStateChangeListeners) {
+ listener.onViewDetachedFromWindow(mView);
+ }
+ }
+
+
private View newViewWithId(int id) {
View view = new View(mContext);
view.setId(id);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProviderTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProviderTest.kt
index 4796cd7..10eb71f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProviderTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProviderTest.kt
@@ -47,7 +47,8 @@
@Test
fun testGetBoundingRectForPrivacyChipForRotation_noCutout() {
val screenBounds = Rect(0, 0, 1080, 2160)
- val roundedCornerPadding = 20
+ val minLeftPadding = 20
+ val minRightPadding = 20
val sbHeightPortrait = 100
val sbHeightLandscape = 60
val currentRotation = ROTATION_NONE
@@ -64,7 +65,8 @@
null,
windowMetrics,
sbHeightPortrait,
- roundedCornerPadding)
+ minLeftPadding,
+ minRightPadding)
var chipBounds = getPrivacyChipBoundingRectForInsets(bounds, dotWidth, chipWidth, isRtl)
/* 1080 - 20 (rounded corner) - 30 (chip),
@@ -92,7 +94,8 @@
dc,
windowMetrics,
sbHeightLandscape,
- roundedCornerPadding)
+ minLeftPadding,
+ minRightPadding)
chipBounds = getPrivacyChipBoundingRectForInsets(bounds, dotWidth, chipWidth, isRtl)
/* 2160 - 20 (rounded corner) - 30 (chip),
@@ -118,7 +121,8 @@
// GIVEN a device in portrait mode with width < height and a display cutout in the top-left
val screenBounds = Rect(0, 0, 1080, 2160)
val dcBounds = Rect(0, 0, 100, 100)
- val roundedCornerPadding = 20
+ val minLeftPadding = 20
+ val minRightPadding = 20
val sbHeightPortrait = 100
val sbHeightLandscape = 60
val currentRotation = ROTATION_NONE
@@ -131,7 +135,7 @@
var targetRotation = ROTATION_NONE
var expectedBounds = Rect(dcBounds.right,
0,
- screenBounds.right - roundedCornerPadding,
+ screenBounds.right - minRightPadding,
sbHeightPortrait)
var bounds = calculateInsetsForRotationWithRotatedResources(
@@ -140,14 +144,15 @@
dc,
windowMetrics,
sbHeightPortrait,
- roundedCornerPadding)
+ minLeftPadding,
+ minRightPadding)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
targetRotation = ROTATION_LANDSCAPE
expectedBounds = Rect(dcBounds.height(),
0,
- screenBounds.height() - roundedCornerPadding,
+ screenBounds.height() - minRightPadding,
sbHeightLandscape)
bounds = calculateInsetsForRotationWithRotatedResources(
@@ -156,16 +161,17 @@
dc,
windowMetrics,
sbHeightLandscape,
- roundedCornerPadding)
+ minLeftPadding,
+ minRightPadding)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
// THEN the side that does NOT share a short side with the display cutout ignores the
// display cutout bounds
targetRotation = ROTATION_UPSIDE_DOWN
- expectedBounds = Rect(roundedCornerPadding,
+ expectedBounds = Rect(minLeftPadding,
0,
- screenBounds.width() - roundedCornerPadding,
+ screenBounds.width() - minRightPadding,
sbHeightPortrait)
bounds = calculateInsetsForRotationWithRotatedResources(
@@ -174,13 +180,14 @@
dc,
windowMetrics,
sbHeightPortrait,
- roundedCornerPadding)
+ minLeftPadding,
+ minRightPadding)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
// Phone in portrait, seascape (rot_270) bounds
targetRotation = ROTATION_SEASCAPE
- expectedBounds = Rect(roundedCornerPadding,
+ expectedBounds = Rect(minLeftPadding,
0,
screenBounds.height() - dcBounds.height(),
sbHeightLandscape)
@@ -191,7 +198,8 @@
dc,
windowMetrics,
sbHeightLandscape,
- roundedCornerPadding)
+ minLeftPadding,
+ minRightPadding)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
}
@@ -205,7 +213,8 @@
val screenBounds = Rect(0, 0, 1080, 2160)
// cutout centered at the top
val dcBounds = Rect(490, 0, 590, 100)
- val roundedCornerPadding = 20
+ val minLeftPadding = 20
+ val minRightPadding = 20
val sbHeightPortrait = 100
val sbHeightLandscape = 60
val currentRotation = ROTATION_NONE
@@ -216,9 +225,9 @@
// THEN only the landscape/seascape rotations should avoid the cutout area because of the
// potential letterboxing
var targetRotation = ROTATION_NONE
- var expectedBounds = Rect(roundedCornerPadding,
+ var expectedBounds = Rect(minLeftPadding,
0,
- screenBounds.right - roundedCornerPadding,
+ screenBounds.right - minRightPadding,
sbHeightPortrait)
var bounds = calculateInsetsForRotationWithRotatedResources(
@@ -227,14 +236,15 @@
dc,
windowMetrics,
sbHeightPortrait,
- roundedCornerPadding)
+ minLeftPadding,
+ minRightPadding)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
targetRotation = ROTATION_LANDSCAPE
expectedBounds = Rect(dcBounds.height(),
0,
- screenBounds.height() - roundedCornerPadding,
+ screenBounds.height() - minRightPadding,
sbHeightLandscape)
bounds = calculateInsetsForRotationWithRotatedResources(
@@ -243,14 +253,15 @@
dc,
windowMetrics,
sbHeightLandscape,
- roundedCornerPadding)
+ minLeftPadding,
+ minRightPadding)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
targetRotation = ROTATION_UPSIDE_DOWN
- expectedBounds = Rect(roundedCornerPadding,
+ expectedBounds = Rect(minLeftPadding,
0,
- screenBounds.right - roundedCornerPadding,
+ screenBounds.right - minRightPadding,
sbHeightPortrait)
bounds = calculateInsetsForRotationWithRotatedResources(
@@ -259,12 +270,13 @@
dc,
windowMetrics,
sbHeightPortrait,
- roundedCornerPadding)
+ minLeftPadding,
+ minRightPadding)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
targetRotation = ROTATION_SEASCAPE
- expectedBounds = Rect(roundedCornerPadding,
+ expectedBounds = Rect(minLeftPadding,
0,
screenBounds.height() - dcBounds.height(),
sbHeightLandscape)
@@ -275,7 +287,8 @@
dc,
windowMetrics,
sbHeightLandscape,
- roundedCornerPadding)
+ minLeftPadding,
+ minRightPadding)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
}
@@ -285,7 +298,8 @@
// GIVEN device in portrait mode, where width < height and no cutout
val currentRotation = ROTATION_NONE
val screenBounds = Rect(0, 0, 1080, 2160)
- val roundedCornerPadding = 20
+ val minLeftPadding = 20
+ val minRightPadding = 20
val sbHeightPortrait = 100
val sbHeightLandscape = 60
@@ -293,9 +307,9 @@
// THEN content insets should only use rounded corner padding
var targetRotation = ROTATION_NONE
- var expectedBounds = Rect(roundedCornerPadding,
+ var expectedBounds = Rect(minLeftPadding,
0,
- screenBounds.right - roundedCornerPadding,
+ screenBounds.right - minRightPadding,
sbHeightPortrait)
var bounds = calculateInsetsForRotationWithRotatedResources(
@@ -304,13 +318,14 @@
null, /* no cutout */
windowMetrics,
sbHeightPortrait,
- roundedCornerPadding)
+ minLeftPadding,
+ minRightPadding)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
targetRotation = ROTATION_LANDSCAPE
- expectedBounds = Rect(roundedCornerPadding,
+ expectedBounds = Rect(minLeftPadding,
0,
- screenBounds.height() - roundedCornerPadding,
+ screenBounds.height() - minRightPadding,
sbHeightLandscape)
bounds = calculateInsetsForRotationWithRotatedResources(
@@ -319,13 +334,14 @@
null, /* no cutout */
windowMetrics,
sbHeightLandscape,
- roundedCornerPadding)
+ minLeftPadding,
+ minRightPadding)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
targetRotation = ROTATION_UPSIDE_DOWN
- expectedBounds = Rect(roundedCornerPadding,
+ expectedBounds = Rect(minLeftPadding,
0,
- screenBounds.width() - roundedCornerPadding,
+ screenBounds.width() - minRightPadding,
sbHeightPortrait)
bounds = calculateInsetsForRotationWithRotatedResources(
@@ -334,13 +350,14 @@
null, /* no cutout */
windowMetrics,
sbHeightPortrait,
- roundedCornerPadding)
+ minLeftPadding,
+ minRightPadding)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
targetRotation = ROTATION_LANDSCAPE
- expectedBounds = Rect(roundedCornerPadding,
+ expectedBounds = Rect(minLeftPadding,
0,
- screenBounds.height() - roundedCornerPadding,
+ screenBounds.height() - minRightPadding,
sbHeightLandscape)
bounds = calculateInsetsForRotationWithRotatedResources(
@@ -349,7 +366,41 @@
null, /* no cutout */
windowMetrics,
sbHeightLandscape,
- roundedCornerPadding)
+ minLeftPadding,
+ minRightPadding)
+ assertRects(expectedBounds, bounds, currentRotation, targetRotation)
+ }
+
+ @Test
+ fun testMinLeftRight_accountsForDisplayCutout() {
+ // GIVEN a device in portrait mode with width < height and a display cutout in the top-left
+ val screenBounds = Rect(0, 0, 1080, 2160)
+ val dcBounds = Rect(0, 0, 100, 100)
+ val minLeftPadding = 80
+ val minRightPadding = 150
+ val sbHeightPortrait = 100
+ val sbHeightLandscape = 60
+ val currentRotation = ROTATION_NONE
+
+ `when`(windowMetrics.bounds).thenReturn(screenBounds)
+ `when`(dc.boundingRects).thenReturn(listOf(dcBounds))
+
+ // THEN left should be set to the display cutout width, and right should use the minRight
+ var targetRotation = ROTATION_NONE
+ var expectedBounds = Rect(dcBounds.right,
+ 0,
+ screenBounds.right - minRightPadding,
+ sbHeightPortrait)
+
+ var bounds = calculateInsetsForRotationWithRotatedResources(
+ currentRotation,
+ targetRotation,
+ dc,
+ windowMetrics,
+ sbHeightPortrait,
+ minLeftPadding,
+ minRightPadding)
+
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java
index 37a6d21..83bf96b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java
@@ -61,7 +61,6 @@
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
import com.android.systemui.statusbar.NotificationPresenter;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
-import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.notification.NotificationActivityStarter;
import com.android.systemui.statusbar.notification.NotificationEntryManager;
@@ -111,8 +110,6 @@
@Mock
private NotificationRemoteInputManager mRemoteInputManager;
@Mock
- private RemoteInputController mRemoteInputController;
- @Mock
private StatusBar mStatusBar;
@Mock
private KeyguardStateController mKeyguardStateController;
@@ -153,8 +150,6 @@
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
- when(mRemoteInputManager.getController()).thenReturn(mRemoteInputController);
-
when(mContentIntent.isActivity()).thenReturn(true);
when(mContentIntent.getCreatorUserHandle()).thenReturn(UserHandle.of(1));
when(mContentIntent.getIntent()).thenReturn(mContentIntentInner);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenterTest.java
index ce45f26..fd85c44 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenterTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenterTest.java
@@ -46,7 +46,6 @@
import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.NotificationViewHierarchyManager;
-import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.notification.DynamicPrivacyController;
import com.android.systemui.statusbar.notification.NotificationEntryManager;
@@ -89,8 +88,6 @@
public void setup() {
NotificationRemoteInputManager notificationRemoteInputManager =
mock(NotificationRemoteInputManager.class);
- when(notificationRemoteInputManager.getController())
- .thenReturn(mock(RemoteInputController.class));
mMetricsLogger = new FakeMetricsLogger();
mDependency.injectTestDependency(MetricsLogger.class, mMetricsLogger);
mCommandQueue = new CommandQueue(mContext);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
index b351d52..2a58f7c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
@@ -111,7 +111,6 @@
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.NotificationViewHierarchyManager;
import com.android.systemui.statusbar.PulseExpansionHandler;
-import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.StatusBarStateControllerImpl;
import com.android.systemui.statusbar.SuperStatusBarViewFactory;
@@ -203,7 +202,6 @@
@Mock private KeyguardViewMediator mKeyguardViewMediator;
@Mock private NotificationLockscreenUserManager mLockscreenUserManager;
@Mock private NotificationRemoteInputManager mRemoteInputManager;
- @Mock private RemoteInputController mRemoteInputController;
@Mock private StatusBarStateControllerImpl mStatusBarStateController;
@Mock private BatteryController mBatteryController;
@Mock private DeviceProvisionedController mDeviceProvisionedController;
@@ -336,8 +334,6 @@
return null;
}).when(mStatusBarKeyguardViewManager).addAfterKeyguardGoneRunnable(any());
- when(mRemoteInputManager.getController()).thenReturn(mRemoteInputController);
-
WakefulnessLifecycle wakefulnessLifecycle =
new WakefulnessLifecycle(mContext, mWallpaperManager);
wakefulnessLifecycle.dispatchStartedWakingUp(PowerManager.WAKE_REASON_UNKNOWN);
diff --git a/packages/VpnDialogs/res/values-gu/strings.xml b/packages/VpnDialogs/res/values-gu/strings.xml
index b5a8831..5ffdcb1 100644
--- a/packages/VpnDialogs/res/values-gu/strings.xml
+++ b/packages/VpnDialogs/res/values-gu/strings.xml
@@ -29,7 +29,7 @@
<string name="always_on_disconnected_message" msgid="555634519845992917">"<xliff:g id="VPN_APP_0">%1$s</xliff:g>ને હંમેશાં જોડાયેલ રહેવા માટે સેટ કરેલ છે, પરંતુ તે હાલમાં કનેક્ટ કરી શકાતું નથી. તમારો ફોન જ્યાં સુધી <xliff:g id="VPN_APP_1">%1$s</xliff:g> સાથે ફરીથી કનેક્ટ ન થાય ત્યાં સુધી તે સાર્વજનિક નેટવર્કનો ઉપયોગ કરશે."</string>
<string name="always_on_disconnected_message_lockdown" msgid="4232225539869452120">"<xliff:g id="VPN_APP">%1$s</xliff:g>ને હંમેશાં જોડાયેલ રહેવા માટે સેટ કરેલ છે, પરંતુ તે હાલમાં કનેક્ટ કરી શકાતું નથી. VPN ફરીથી કનેક્ટ ન થઈ શકે ત્યાં સુધી તમારી પાસે કોઈ કનેક્શન હશે નહીં."</string>
<string name="always_on_disconnected_message_separator" msgid="3310614409322581371">" "</string>
- <string name="always_on_disconnected_message_settings_link" msgid="6172280302829992412">"VPN સેટિંગ્સ બદલો"</string>
+ <string name="always_on_disconnected_message_settings_link" msgid="6172280302829992412">"VPN સેટિંગ બદલો"</string>
<string name="configure" msgid="4905518375574791375">"ગોઠવો"</string>
<string name="disconnect" msgid="971412338304200056">"ડિસ્કનેક્ટ કરો"</string>
<string name="open_app" msgid="3717639178595958667">"ઍપ ખોલો"</string>
diff --git a/services/core/java/android/content/pm/PackageManagerInternal.java b/services/core/java/android/content/pm/PackageManagerInternal.java
index 230e380..bafa9913 100644
--- a/services/core/java/android/content/pm/PackageManagerInternal.java
+++ b/services/core/java/android/content/pm/PackageManagerInternal.java
@@ -845,7 +845,7 @@
/**
* Perform the given action for each installed package for a user.
- * Note that packages lock will be held while performin the actions.
+ * Note that packages lock will be held while performing the actions.
*/
public abstract void forEachInstalledPackage(
@NonNull Consumer<AndroidPackage> actionLocked, @UserIdInt int userId);
diff --git a/services/core/java/com/android/server/PersistentDataBlockService.java b/services/core/java/com/android/server/PersistentDataBlockService.java
index e336b6b..16645df 100644
--- a/services/core/java/com/android/server/PersistentDataBlockService.java
+++ b/services/core/java/com/android/server/PersistentDataBlockService.java
@@ -375,15 +375,38 @@
try {
FileChannel channel = getBlockOutputChannel();
+ // Format the data selectively.
+ //
+ // 1. write header, set length = 0
int header_size = DIGEST_SIZE_BYTES + HEADER_SIZE;
ByteBuffer buf = ByteBuffer.allocate(header_size);
buf.put(new byte[DIGEST_SIZE_BYTES]);
buf.putInt(PARTITION_TYPE_MARKER);
buf.putInt(0);
+ buf.flip();
channel.write(buf);
- // corrupt the payload explicitly
+ channel.force(true);
+
+ // 2. corrupt the legacy FRP data explicitly
int payload_size = (int) getBlockDeviceSize() - header_size;
- buf = ByteBuffer.allocate(payload_size);
+ buf = ByteBuffer.allocate(payload_size
+ - TEST_MODE_RESERVED_SIZE - FRP_CREDENTIAL_RESERVED_SIZE - 1);
+ channel.write(buf);
+ channel.force(true);
+
+ // 3. skip the test mode data and leave it unformat
+ // This is for a feature that enables testing.
+ channel.position(channel.position() + TEST_MODE_RESERVED_SIZE);
+
+ // 4. wipe the FRP_CREDENTIAL explicitly
+ buf = ByteBuffer.allocate(FRP_CREDENTIAL_RESERVED_SIZE);
+ channel.write(buf);
+ channel.force(true);
+
+ // 5. set unlock = 0 because it's a formatPartitionLocked
+ buf = ByteBuffer.allocate(FRP_CREDENTIAL_RESERVED_SIZE);
+ buf.put((byte)0);
+ buf.flip();
channel.write(buf);
channel.force(true);
} catch (IOException e) {
diff --git a/services/core/java/com/android/server/SensorPrivacyService.java b/services/core/java/com/android/server/SensorPrivacyService.java
index e4a30ad5..44dc929 100644
--- a/services/core/java/com/android/server/SensorPrivacyService.java
+++ b/services/core/java/com/android/server/SensorPrivacyService.java
@@ -232,14 +232,14 @@
public void onUserStarting(TargetUser user) {
if (mCurrentUser == -1) {
mCurrentUser = user.getUserIdentifier();
- setGlobalRestriction();
+ mSensorPrivacyServiceImpl.userSwitching(-1, user.getUserIdentifier());
}
}
@Override
public void onUserSwitching(TargetUser from, TargetUser to) {
mCurrentUser = to.getUserIdentifier();
- setGlobalRestriction();
+ mSensorPrivacyServiceImpl.userSwitching(from.getUserIdentifier(), to.getUserIdentifier());
}
class SensorPrivacyServiceImpl extends ISensorPrivacyManager.Stub implements
@@ -897,18 +897,22 @@
public boolean isIndividualSensorPrivacyEnabled(@UserIdInt int userId, int sensor) {
enforceObserveSensorPrivacyPermission();
synchronized (mLock) {
- SparseArray<SensorState> states = mIndividualEnabled.get(userId);
- if (states == null) {
- return false;
- }
- SensorState state = states.get(sensor);
- if (state == null) {
- return false;
- }
- return state.mEnabled;
+ return isIndividualSensorPrivacyEnabledLocked(userId, sensor);
}
}
+ private boolean isIndividualSensorPrivacyEnabledLocked(int userId, int sensor) {
+ SparseArray<SensorState> states = mIndividualEnabled.get(userId);
+ if (states == null) {
+ return false;
+ }
+ SensorState state = states.get(sensor);
+ if (state == null) {
+ return false;
+ }
+ return state.mEnabled;
+ }
+
/**
* Returns the state of sensor privacy from persistent storage.
*/
@@ -1149,11 +1153,27 @@
ISensorPrivacyListener listener) {
enforceObserveSensorPrivacyPermission();
if (listener == null) {
- throw new NullPointerException("listener cannot be null");
+ throw new IllegalArgumentException("listener cannot be null");
}
mHandler.addListener(userId, sensor, listener);
}
+
+ /**
+ * Registers a listener to be notified when the sensor privacy state changes. The callback
+ * can be called if the user changes and the setting is different between the transitioning
+ * users.
+ */
+ @Override
+ public void addUserGlobalIndividualSensorPrivacyListener(int sensor,
+ ISensorPrivacyListener listener) {
+ enforceObserveSensorPrivacyPermission();
+ if (listener == null) {
+ throw new IllegalArgumentException("listener cannot be null");
+ }
+ mHandler.addUserGlobalListener(sensor, listener);
+ }
+
/**
* Unregisters a listener from sensor privacy state change notifications.
*/
@@ -1174,12 +1194,22 @@
ISensorPrivacyListener listener) {
enforceObserveSensorPrivacyPermission();
if (listener == null) {
- throw new NullPointerException("listener cannot be null");
+ throw new IllegalArgumentException("listener cannot be null");
}
mHandler.removeListener(sensor, listener);
}
@Override
+ public void removeUserGlobalIndividualSensorPrivacyListener(int sensor,
+ ISensorPrivacyListener listener) {
+ enforceObserveSensorPrivacyPermission();
+ if (listener == null) {
+ throw new IllegalArgumentException("listener cannot be null");
+ }
+ mHandler.removeUserGlobalListener(sensor, listener);
+ }
+
+ @Override
public void suppressIndividualSensorPrivacyReminders(int userId, int sensor,
IBinder token, boolean suppress) {
enforceManageSensorPrivacyPermission();
@@ -1209,6 +1239,40 @@
}
}
+ private void userSwitching(int from, int to) {
+ boolean micState;
+ boolean camState;
+ boolean prevMicState;
+ boolean prevCamState;
+ synchronized (mLock) {
+ prevMicState = isIndividualSensorPrivacyEnabledLocked(from, MICROPHONE);
+ prevCamState = isIndividualSensorPrivacyEnabledLocked(from, CAMERA);
+ micState = isIndividualSensorPrivacyEnabledLocked(to, MICROPHONE);
+ camState = isIndividualSensorPrivacyEnabledLocked(to, CAMERA);
+ }
+ if (prevMicState != micState) {
+ mHandler.onUserGlobalSensorPrivacyChanged(MICROPHONE, micState);
+ setGlobalRestriction(MICROPHONE, micState);
+ }
+ if (prevCamState != camState) {
+ mHandler.onUserGlobalSensorPrivacyChanged(CAMERA, camState);
+ setGlobalRestriction(CAMERA, micState);
+ }
+ }
+
+ private void setGlobalRestriction(int sensor, boolean enabled) {
+ switch(sensor) {
+ case MICROPHONE:
+ mAppOpsManagerInternal.setGlobalRestriction(OP_RECORD_AUDIO, enabled,
+ mAppOpsRestrictionToken);
+ break;
+ case CAMERA:
+ mAppOpsManagerInternal.setGlobalRestriction(OP_CAMERA, enabled,
+ mAppOpsRestrictionToken);
+ break;
+ }
+ }
+
/**
* Remove a sensor use reminder suppression token.
*
@@ -1454,7 +1518,12 @@
@GuardedBy("mListenerLock")
private final SparseArray<SparseArray<RemoteCallbackList<ISensorPrivacyListener>>>
mIndividualSensorListeners = new SparseArray<>();
- private final ArrayMap<ISensorPrivacyListener, DeathRecipient> mDeathRecipients;
+ @GuardedBy("mListenerLock")
+ private final SparseArray<RemoteCallbackList<ISensorPrivacyListener>>
+ mUserGlobalIndividualSensorListeners = new SparseArray<>();
+ @GuardedBy("mListenerLock")
+ private final ArrayMap<ISensorPrivacyListener, Pair<DeathRecipient, Integer>>
+ mDeathRecipients;
private final Context mContext;
SensorPrivacyHandler(Looper looper, Context context) {
@@ -1479,18 +1548,22 @@
mSensorPrivacyServiceImpl));
}
+ public void onUserGlobalSensorPrivacyChanged(int sensor, boolean enabled) {
+ sendMessage(PooledLambda.obtainMessage(
+ SensorPrivacyHandler::handleUserGlobalSensorPrivacyChanged,
+ this, sensor, enabled));
+ }
+
public void addListener(ISensorPrivacyListener listener) {
synchronized (mListenerLock) {
- DeathRecipient deathRecipient = new DeathRecipient(listener);
- mDeathRecipients.put(listener, deathRecipient);
- mListeners.register(listener);
+ if (mListeners.register(listener)) {
+ addDeathRecipient(listener);
+ }
}
}
public void addListener(int userId, int sensor, ISensorPrivacyListener listener) {
synchronized (mListenerLock) {
- DeathRecipient deathRecipient = new DeathRecipient(listener);
- mDeathRecipients.put(listener, deathRecipient);
SparseArray<RemoteCallbackList<ISensorPrivacyListener>> listenersForUser =
mIndividualSensorListeners.get(userId);
if (listenersForUser == null) {
@@ -1502,32 +1575,55 @@
listeners = new RemoteCallbackList<>();
listenersForUser.put(sensor, listeners);
}
- listeners.register(listener);
+ if (listeners.register(listener)) {
+ addDeathRecipient(listener);
+ }
+ }
+ }
+
+ public void addUserGlobalListener(int sensor, ISensorPrivacyListener listener) {
+ synchronized (mListenerLock) {
+ RemoteCallbackList<ISensorPrivacyListener> listeners =
+ mUserGlobalIndividualSensorListeners.get(sensor);
+ if (listeners == null) {
+ listeners = new RemoteCallbackList<>();
+ mUserGlobalIndividualSensorListeners.put(sensor, listeners);
+ }
+ if (listeners.register(listener)) {
+ addDeathRecipient(listener);
+ }
}
}
public void removeListener(ISensorPrivacyListener listener) {
synchronized (mListenerLock) {
- DeathRecipient deathRecipient = mDeathRecipients.remove(listener);
- if (deathRecipient != null) {
- deathRecipient.destroy();
+ if (mListeners.unregister(listener)) {
+ removeDeathRecipient(listener);
}
- mListeners.unregister(listener);
}
}
public void removeListener(int sensor, ISensorPrivacyListener listener) {
synchronized (mListenerLock) {
- DeathRecipient deathRecipient = mDeathRecipients.remove(listener);
- if (deathRecipient != null) {
- deathRecipient.destroy();
- }
-
for (int i = 0, numUsers = mIndividualSensorListeners.size(); i < numUsers; i++) {
RemoteCallbackList callbacks =
mIndividualSensorListeners.valueAt(i).get(sensor);
if (callbacks != null) {
- callbacks.unregister(listener);
+ if (callbacks.unregister(listener)) {
+ removeDeathRecipient(listener);
+ }
+ }
+ }
+ }
+ }
+
+ public void removeUserGlobalListener(int sensor, ISensorPrivacyListener listener) {
+ synchronized (mListenerLock) {
+ RemoteCallbackList callbacks =
+ mUserGlobalIndividualSensorListeners.get(sensor);
+ if (callbacks != null) {
+ if (callbacks.unregister(listener)) {
+ removeDeathRecipient(listener);
}
}
}
@@ -1551,9 +1647,12 @@
SparseArray<RemoteCallbackList<ISensorPrivacyListener>> listenersForUser =
mIndividualSensorListeners.get(userId);
- setGlobalRestriction();
if (userId == mCurrentUser) {
- setGlobalRestriction();
+ mSensorPrivacyServiceImpl.setGlobalRestriction(sensor, enabled);
+ }
+
+ if (userId == mCurrentUser) {
+ onUserGlobalSensorPrivacyChanged(sensor, enabled);
}
if (listenersForUser == null) {
@@ -1563,16 +1662,42 @@
if (listeners == null) {
return;
}
- final int count = listeners.beginBroadcast();
- for (int i = 0; i < count; i++) {
- ISensorPrivacyListener listener = listeners.getBroadcastItem(i);
- try {
- listener.onSensorPrivacyChanged(enabled);
- } catch (RemoteException e) {
- Log.e(TAG, "Caught an exception notifying listener " + listener + ": ", e);
+ try {
+ final int count = listeners.beginBroadcast();
+ for (int i = 0; i < count; i++) {
+ ISensorPrivacyListener listener = listeners.getBroadcastItem(i);
+ try {
+ listener.onSensorPrivacyChanged(enabled);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Caught an exception notifying listener " + listener + ": ", e);
+ }
}
+ } finally {
+ listeners.finishBroadcast();
}
- listeners.finishBroadcast();
+ }
+
+ public void handleUserGlobalSensorPrivacyChanged(int sensor, boolean enabled) {
+ RemoteCallbackList<ISensorPrivacyListener> listeners =
+ mUserGlobalIndividualSensorListeners.get(sensor);
+
+ if (listeners == null) {
+ return;
+ }
+
+ try {
+ final int count = listeners.beginBroadcast();
+ for (int i = 0; i < count; i++) {
+ ISensorPrivacyListener listener = listeners.getBroadcastItem(i);
+ try {
+ listener.onSensorPrivacyChanged(enabled);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Caught an exception notifying listener " + listener + ": ", e);
+ }
+ }
+ } finally {
+ listeners.finishBroadcast();
+ }
}
public void removeSuppressPackageReminderToken(Pair<Integer, UserHandle> key,
@@ -1581,20 +1706,33 @@
SensorPrivacyServiceImpl::removeSuppressPackageReminderToken,
mSensorPrivacyServiceImpl, key, token));
}
- }
- private void setGlobalRestriction() {
- boolean camState =
- mSensorPrivacyServiceImpl
- .isIndividualSensorPrivacyEnabled(mCurrentUser, CAMERA);
- boolean micState =
- mSensorPrivacyServiceImpl
- .isIndividualSensorPrivacyEnabled(mCurrentUser, MICROPHONE);
+ private void addDeathRecipient(ISensorPrivacyListener listener) {
+ Pair<DeathRecipient, Integer> deathRecipient = mDeathRecipients.get(listener);
+ if (deathRecipient == null) {
+ deathRecipient = new Pair<>(new DeathRecipient(listener), 1);
+ } else {
+ int newRefCount = deathRecipient.second + 1;
+ deathRecipient = new Pair<>(deathRecipient.first, newRefCount);
+ }
+ mDeathRecipients.put(listener, deathRecipient);
+ }
- mAppOpsManagerInternal
- .setGlobalRestriction(OP_CAMERA, camState, mAppOpsRestrictionToken);
- mAppOpsManagerInternal
- .setGlobalRestriction(OP_RECORD_AUDIO, micState, mAppOpsRestrictionToken);
+ private void removeDeathRecipient(ISensorPrivacyListener listener) {
+ Pair<DeathRecipient, Integer> deathRecipient = mDeathRecipients.get(listener);
+ if (deathRecipient == null) {
+ return;
+ } else {
+ int newRefCount = deathRecipient.second - 1;
+ if (newRefCount == 0) {
+ mDeathRecipients.remove(listener);
+ deathRecipient.first.destroy();
+ return;
+ }
+ deathRecipient = new Pair<>(deathRecipient.first, newRefCount);
+ }
+ mDeathRecipients.put(listener, deathRecipient);
+ }
}
private final class DeathRecipient implements IBinder.DeathRecipient {
diff --git a/services/core/java/com/android/server/am/AppExitInfoTracker.java b/services/core/java/com/android/server/am/AppExitInfoTracker.java
index abb8243..979a9ee 100644
--- a/services/core/java/com/android/server/am/AppExitInfoTracker.java
+++ b/services/core/java/com/android/server/am/AppExitInfoTracker.java
@@ -430,7 +430,13 @@
final ApplicationExitInfo info = new ApplicationExitInfo(raw);
final String[] packages = raw.getPackageList();
- final int uid = raw.getPackageUid();
+ int uid = raw.getRealUid();
+ if (UserHandle.isIsolated(uid)) {
+ Integer k = mIsolatedUidRecords.getUidByIsolatedUid(uid);
+ if (k != null) {
+ uid = k;
+ }
+ }
for (int i = 0; i < packages.length; i++) {
addExitInfoInnerLocked(packages[i], uid, info);
}
@@ -833,14 +839,14 @@
pw.println(prefix + "package: " + packageName);
int size = array.size();
for (int i = 0; i < size; i++) {
- pw.println(prefix + " Historical Process Exit for userId=" + array.keyAt(i));
+ pw.println(prefix + " Historical Process Exit for uid=" + array.keyAt(i));
array.valueAt(i).dumpLocked(pw, prefix + " ", sdf);
}
}
@GuardedBy("mLock")
- private void addExitInfoInnerLocked(String packageName, int userId, ApplicationExitInfo info) {
- AppExitInfoContainer container = mData.get(packageName, userId);
+ private void addExitInfoInnerLocked(String packageName, int uid, ApplicationExitInfo info) {
+ AppExitInfoContainer container = mData.get(packageName, uid);
if (container == null) {
container = new AppExitInfoContainer(mAppExitInfoHistoryListSize);
if (UserHandle.isIsolated(info.getRealUid())) {
@@ -851,7 +857,7 @@
} else {
container.mUid = info.getRealUid();
}
- mData.put(packageName, userId, container);
+ mData.put(packageName, uid, container);
}
container.addExitInfoLocked(info);
}
@@ -997,7 +1003,7 @@
info.setPackageList(app.getPackageList());
info.setReason(ApplicationExitInfo.REASON_UNKNOWN);
info.setStatus(0);
- info.setImportance(procStateToImportance(app.mState.getSetProcState()));
+ info.setImportance(procStateToImportance(app.mState.getReportedProcState()));
info.setPss(app.mProfile.getLastPss());
info.setRss(app.mProfile.getLastRss());
info.setTimestamp(timestamp);
diff --git a/services/core/java/com/android/server/am/LmkdConnection.java b/services/core/java/com/android/server/am/LmkdConnection.java
index 1ecb9eb..598f086 100644
--- a/services/core/java/com/android/server/am/LmkdConnection.java
+++ b/services/core/java/com/android/server/am/LmkdConnection.java
@@ -50,7 +50,7 @@
* Used to hold the data for the statsd atoms logging
* Must be in sync with statslog.h
*/
- private static final int LMKD_REPLY_MAX_SIZE = 214;
+ private static final int LMKD_REPLY_MAX_SIZE = 222;
// connection listener interface
interface LmkdConnectionListener {
diff --git a/services/core/java/com/android/server/am/LmkdStatsReporter.java b/services/core/java/com/android/server/am/LmkdStatsReporter.java
index a8d0582..9158891 100644
--- a/services/core/java/com/android/server/am/LmkdStatsReporter.java
+++ b/services/core/java/com/android/server/am/LmkdStatsReporter.java
@@ -64,11 +64,14 @@
final int freeMemKb = inputData.readInt();
final int freeSwapKb = inputData.readInt();
final int killReason = inputData.readInt();
+ final int thrashing = inputData.readInt();
+ final int maxThrashing = inputData.readInt();
final String procName = inputData.readUTF();
FrameworkStatsLog.write(FrameworkStatsLog.LMK_KILL_OCCURRED, uid, procName, oomScore,
pgFault, pgMajFault, rssInBytes, cacheInBytes, swapInBytes, processStartTimeNS,
- minOomScore, freeMemKb, freeSwapKb, mapKillReason(killReason));
+ minOomScore, freeMemKb, freeSwapKb, mapKillReason(killReason), thrashing,
+ maxThrashing);
} catch (IOException e) {
Slog.e(TAG, "Invalid buffer data. Failed to log LMK_KILL_OCCURRED");
return;
diff --git a/services/core/java/com/android/server/am/PhantomProcessList.java b/services/core/java/com/android/server/am/PhantomProcessList.java
index 4f3438fe..ca31681 100644
--- a/services/core/java/com/android/server/am/PhantomProcessList.java
+++ b/services/core/java/com/android/server/am/PhantomProcessList.java
@@ -305,7 +305,7 @@
}
// Somehow our record doesn't match, remove it anyway
Slog.w(TAG, "Stale " + proc + ", removing");
- mPhantomProcesses.removeAt(index);
+ onPhantomProcessKilledLocked(proc);
} else {
// Is this one of the zombie processes we've known?
final int idx = mZombiePhantomProcesses.indexOfKey(pid);
diff --git a/services/core/java/com/android/server/am/ProcessStateRecord.java b/services/core/java/com/android/server/am/ProcessStateRecord.java
index 7520d88..dc6bcd8 100644
--- a/services/core/java/com/android/server/am/ProcessStateRecord.java
+++ b/services/core/java/com/android/server/am/ProcessStateRecord.java
@@ -1086,7 +1086,7 @@
mCurRawAdj = mSetRawAdj = mCurAdj = mSetAdj = mVerifiedAdj = ProcessList.INVALID_ADJ;
mCurCapability = mSetCapability = PROCESS_CAPABILITY_NONE;
mCurSchedGroup = mSetSchedGroup = ProcessList.SCHED_GROUP_BACKGROUND;
- mCurProcState = mRepProcState = mCurRawProcState = mSetProcState = mAllowStartFgsState =
+ mCurProcState = mCurRawProcState = mSetProcState = mAllowStartFgsState =
PROCESS_STATE_NONEXISTENT;
}
diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java
index a9905dc..ca844f5 100644
--- a/services/core/java/com/android/server/appop/AppOpsService.java
+++ b/services/core/java/com/android/server/appop/AppOpsService.java
@@ -1821,13 +1821,13 @@
for (int attributionNum = 0; attributionNum < numAttributions;
attributionNum++) {
ParsedAttribution attribution = pkg.getAttributions().get(attributionNum);
- attributionTags.add(attribution.tag);
+ attributionTags.add(attribution.getTag());
- int numInheritFrom = attribution.inheritFrom.size();
+ int numInheritFrom = attribution.getInheritFrom().size();
for (int inheritFromNum = 0; inheritFromNum < numInheritFrom;
inheritFromNum++) {
- dstAttributionTags.put(attribution.inheritFrom.get(inheritFromNum),
- attribution.tag);
+ dstAttributionTags.put(attribution.getInheritFrom().get(inheritFromNum),
+ attribution.getTag());
}
}
}
@@ -4621,7 +4621,7 @@
if (pkg.getAttributions() != null) {
int numAttributions = pkg.getAttributions().size();
for (int i = 0; i < numAttributions; i++) {
- if (pkg.getAttributions().get(i).tag.equals(attributionTag)) {
+ if (pkg.getAttributions().get(i).getTag().equals(attributionTag)) {
return true;
}
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/CoexCoordinator.java b/services/core/java/com/android/server/biometrics/sensors/CoexCoordinator.java
index f97cb8a..f732a14 100644
--- a/services/core/java/com/android/server/biometrics/sensors/CoexCoordinator.java
+++ b/services/core/java/com/android/server/biometrics/sensors/CoexCoordinator.java
@@ -268,11 +268,18 @@
AuthenticationClient<?> udfps = mClientMap.getOrDefault(SENSOR_TYPE_UDFPS, null);
AuthenticationClient<?> face = mClientMap.getOrDefault(SENSOR_TYPE_FACE, null);
if (isCurrentFaceAuth(client)) {
- // UDFPS should still be running in this case, do not vibrate. However, we
- // should notify the callback and finish the client, so that Keyguard and
- // BiometricScheduler do not get stuck.
- Slog.d(TAG, "Face rejected in multi-sensor auth, udfps: " + udfps);
- callback.handleLifecycleAfterAuth();
+ if (isUdfpsActivelyAuthing(udfps)) {
+ // UDFPS should still be running in this case, do not vibrate. However, we
+ // should notify the callback and finish the client, so that Keyguard and
+ // BiometricScheduler do not get stuck.
+ Slog.d(TAG, "Face rejected in multi-sensor auth, udfps: " + udfps);
+ callback.handleLifecycleAfterAuth();
+ } else {
+ // UDFPS is not actively authenticating (finger not touching, already
+ // rejected, etc).
+ callback.sendHapticFeedback();
+ callback.handleLifecycleAfterAuth();
+ }
} else if (isCurrentUdfps(client)) {
// Face should either be running, or have already finished
SuccessfulAuth auth = popSuccessfulFaceAuthIfExists(currentTimeMillis);
diff --git a/services/core/java/com/android/server/biometrics/sensors/LoggableMonitor.java b/services/core/java/com/android/server/biometrics/sensors/LoggableMonitor.java
index c8867ea..b4c82f2 100644
--- a/services/core/java/com/android/server/biometrics/sensors/LoggableMonitor.java
+++ b/services/core/java/com/android/server/biometrics/sensors/LoggableMonitor.java
@@ -48,6 +48,64 @@
private boolean mLightSensorEnabled = false;
private boolean mShouldLogMetrics = true;
+ /**
+ * Probe for loggable attributes that can be continuously monitored, such as ambient light.
+ *
+ * Disable probes when the sensors are in states that are not interesting for monitoring
+ * purposes to save power.
+ */
+ protected interface Probe {
+ /** Ensure the probe is actively sampling for new data. */
+ void enable();
+ /** Stop sampling data. */
+ void disable();
+ }
+
+ /**
+ * Client monitor callback that exposes a probe.
+ *
+ * Disables the probe when the operation completes.
+ */
+ protected static class CallbackWithProbe<T extends Probe>
+ implements BaseClientMonitor.Callback {
+ private final boolean mStartWithClient;
+ private final T mProbe;
+
+ public CallbackWithProbe(@NonNull T probe, boolean startWithClient) {
+ mProbe = probe;
+ mStartWithClient = startWithClient;
+ }
+
+ @Override
+ public void onClientStarted(@NonNull BaseClientMonitor clientMonitor) {
+ if (mStartWithClient) {
+ mProbe.enable();
+ }
+ }
+
+ @Override
+ public void onClientFinished(@NonNull BaseClientMonitor clientMonitor, boolean success) {
+ mProbe.disable();
+ }
+
+ @NonNull
+ public T getProbe() {
+ return mProbe;
+ }
+ }
+
+ private class ALSProbe implements Probe {
+ @Override
+ public void enable() {
+ setLightSensorLoggingEnabled(getAmbientLightSensor(mSensorManager));
+ }
+
+ @Override
+ public void disable() {
+ setLightSensorLoggingEnabled(null);
+ }
+ }
+
// report only the most recent value
// consider com.android.server.display.utils.AmbientFilter or similar if need arises
private volatile float mLastAmbientLux = 0;
@@ -285,21 +343,17 @@
return latency;
}
- /** Get a callback to start/stop ALS capture when client runs. */
+ /**
+ * Get a callback to start/stop ALS capture when client runs.
+ *
+ * If the probe should not run for the entire operation, do not set startWithClient and
+ * start/stop the problem when needed.
+ *
+ * @param startWithClient if probe should start automatically when the operation starts.
+ */
@NonNull
- protected BaseClientMonitor.Callback createALSCallback() {
- return new BaseClientMonitor.Callback() {
- @Override
- public void onClientStarted(@NonNull BaseClientMonitor clientMonitor) {
- setLightSensorLoggingEnabled(getAmbientLightSensor(mSensorManager));
- }
-
- @Override
- public void onClientFinished(@NonNull BaseClientMonitor clientMonitor,
- boolean success) {
- setLightSensorLoggingEnabled(null);
- }
- };
+ protected CallbackWithProbe<Probe> createALSCallback(boolean startWithClient) {
+ return new CallbackWithProbe<>(new ALSProbe(), startWithClient);
}
/** The sensor to use for ALS logging. */
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClient.java
index 35c1745..0c06b20 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceAuthenticationClient.java
@@ -98,7 +98,7 @@
@NonNull
@Override
protected Callback wrapCallbackForStart(@NonNull Callback callback) {
- return new CompositeCallback(createALSCallback(), callback);
+ return new CompositeCallback(createALSCallback(true /* startWithClient */), callback);
}
@Override
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceEnrollClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceEnrollClient.java
index 55c987a..a806277 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceEnrollClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceEnrollClient.java
@@ -109,7 +109,8 @@
@NonNull
@Override
protected Callback wrapCallbackForStart(@NonNull Callback callback) {
- return new CompositeCallback(mPreviewHandleDeleterCallback, createALSCallback(), callback);
+ return new CompositeCallback(mPreviewHandleDeleterCallback,
+ createALSCallback(true /* startWithClient */), callback);
}
@Override
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceAuthenticationClient.java b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceAuthenticationClient.java
index e65245b..868f379 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceAuthenticationClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceAuthenticationClient.java
@@ -88,7 +88,7 @@
@NonNull
@Override
protected Callback wrapCallbackForStart(@NonNull Callback callback) {
- return new CompositeCallback(createALSCallback(), callback);
+ return new CompositeCallback(createALSCallback(true /* startWithClient */), callback);
}
@Override
diff --git a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceEnrollClient.java b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceEnrollClient.java
index 455d6f8..80828cced 100644
--- a/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceEnrollClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/face/hidl/FaceEnrollClient.java
@@ -69,7 +69,7 @@
@NonNull
@Override
protected Callback wrapCallbackForStart(@NonNull Callback callback) {
- return new CompositeCallback(createALSCallback(), callback);
+ return new CompositeCallback(createALSCallback(true /* startWithClient */), callback);
}
@Override
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintAuthenticationClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintAuthenticationClient.java
index 14d1822..fb2f2ef 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintAuthenticationClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintAuthenticationClient.java
@@ -55,6 +55,7 @@
@NonNull private final LockoutCache mLockoutCache;
@Nullable private final IUdfpsOverlayController mUdfpsOverlayController;
@NonNull private final FingerprintSensorPropertiesInternal mSensorProps;
+ @NonNull private final CallbackWithProbe<Probe> mALSProbeCallback;
@Nullable private ICancellationSignal mCancellationSignal;
private boolean mIsPointerDown;
@@ -75,6 +76,7 @@
mLockoutCache = lockoutCache;
mUdfpsOverlayController = udfpsOverlayController;
mSensorProps = sensorProps;
+ mALSProbeCallback = createALSCallback(false /* startWithClient */);
}
@Override
@@ -92,7 +94,7 @@
@NonNull
@Override
protected Callback wrapCallbackForStart(@NonNull Callback callback) {
- return new CompositeCallback(createALSCallback(), callback);
+ return new CompositeCallback(mALSProbeCallback, callback);
}
@Override
@@ -170,7 +172,9 @@
try {
mIsPointerDown = true;
mState = STATE_STARTED;
+ mALSProbeCallback.getProbe().enable();
getFreshDaemon().onPointerDown(0 /* pointerId */, x, y, minor, major);
+
if (getListener() != null) {
getListener().onUdfpsPointerDown(getSensorId());
}
@@ -184,7 +188,9 @@
try {
mIsPointerDown = false;
mState = STATE_STARTED_PAUSED;
+ mALSProbeCallback.getProbe().disable();
getFreshDaemon().onPointerUp(0 /* pointerId */);
+
if (getListener() != null) {
getListener().onUdfpsPointerUp(getSensorId());
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintEnrollClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintEnrollClient.java
index e8200af..c420c5c 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintEnrollClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintEnrollClient.java
@@ -84,7 +84,7 @@
@NonNull
@Override
protected Callback wrapCallbackForStart(@NonNull Callback callback) {
- return new CompositeCallback(createALSCallback(), callback);
+ return new CompositeCallback(createALSCallback(true /* startWithClient */), callback);
}
@Override
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintAuthenticationClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintAuthenticationClient.java
index 9347244..5c9a764 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintAuthenticationClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintAuthenticationClient.java
@@ -54,6 +54,7 @@
private final LockoutFrameworkImpl mLockoutFrameworkImpl;
@Nullable private final IUdfpsOverlayController mUdfpsOverlayController;
@NonNull private final FingerprintSensorPropertiesInternal mSensorProps;
+ @NonNull private final CallbackWithProbe<Probe> mALSProbeCallback;
private boolean mIsPointerDown;
@@ -74,6 +75,7 @@
mLockoutFrameworkImpl = lockoutTracker;
mUdfpsOverlayController = udfpsOverlayController;
mSensorProps = sensorProps;
+ mALSProbeCallback = createALSCallback(false /* startWithClient */);
}
@Override
@@ -91,7 +93,7 @@
@NonNull
@Override
protected Callback wrapCallbackForStart(@NonNull Callback callback) {
- return new CompositeCallback(createALSCallback(), callback);
+ return new CompositeCallback(mALSProbeCallback, callback);
}
@Override
@@ -188,7 +190,9 @@
public void onPointerDown(int x, int y, float minor, float major) {
mIsPointerDown = true;
mState = STATE_STARTED;
+ mALSProbeCallback.getProbe().enable();
UdfpsHelper.onFingerDown(getFreshDaemon(), x, y, minor, major);
+
if (getListener() != null) {
try {
getListener().onUdfpsPointerDown(getSensorId());
@@ -202,7 +206,9 @@
public void onPointerUp() {
mIsPointerDown = false;
mState = STATE_STARTED_PAUSED;
+ mALSProbeCallback.getProbe().disable();
UdfpsHelper.onFingerUp(getFreshDaemon());
+
if (getListener() != null) {
try {
getListener().onUdfpsPointerUp(getSensorId());
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintEnrollClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintEnrollClient.java
index 250e132..dc70534 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintEnrollClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/FingerprintEnrollClient.java
@@ -77,7 +77,7 @@
@NonNull
@Override
protected Callback wrapCallbackForStart(@NonNull Callback callback) {
- return new CompositeCallback(createALSCallback(), callback);
+ return new CompositeCallback(createALSCallback(true /* startWithClient */), callback);
}
@Override
diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java
index 1edede5..59f536c 100644
--- a/services/core/java/com/android/server/display/DisplayPowerController.java
+++ b/services/core/java/com/android/server/display/DisplayPowerController.java
@@ -778,7 +778,7 @@
setUpAutoBrightness(mContext.getResources(), mHandler);
reloadReduceBrightColours();
mHbmController.resetHbmData(info.width, info.height, token,
- mDisplayDeviceConfig.getHighBrightnessModeData(), mBrightnessSetting);
+ mDisplayDeviceConfig.getHighBrightnessModeData());
}
private void sendUpdatePowerState() {
@@ -968,7 +968,6 @@
final boolean mustNotify;
final int previousPolicy;
boolean mustInitialize = false;
- boolean shouldSaveBrightnessInfo = true;
int brightnessAdjustmentFlags = 0;
mBrightnessReasonTemp.set(null);
synchronized (mLock) {
@@ -1099,7 +1098,6 @@
if (state == Display.STATE_OFF) {
brightnessState = PowerManager.BRIGHTNESS_OFF_FLOAT;
mBrightnessReasonTemp.setReason(BrightnessReason.REASON_SCREEN_OFF);
- shouldSaveBrightnessInfo = false;
}
// Always use the VR brightness when in the VR state.
@@ -1217,6 +1215,10 @@
brightnessAdjustmentFlags = 0;
}
} else {
+ // Any non-auto-brightness values such as override or temporary should still be subject
+ // to clamping so that they don't go beyond the current max as specified by HBM
+ // Controller.
+ brightnessState = clampScreenBrightness(brightnessState);
mAppliedAutoBrightness = false;
brightnessAdjustmentFlags = 0;
}
@@ -1224,9 +1226,8 @@
// Use default brightness when dozing unless overridden.
if ((Float.isNaN(brightnessState))
&& Display.isDozeState(state)) {
- brightnessState = mScreenBrightnessDozeConfig;
+ brightnessState = clampScreenBrightness(mScreenBrightnessDozeConfig);
mBrightnessReasonTemp.setReason(BrightnessReason.REASON_DOZE_DEFAULT);
- shouldSaveBrightnessInfo = false;
}
// Apply manual brightness.
@@ -1241,12 +1242,13 @@
mBrightnessReasonTemp.setReason(BrightnessReason.REASON_MANUAL);
}
- // Save out the brightness info now that the brightness state for this iteration has been
- // finalized and before we send out notifications about the brightness changing.
- if (shouldSaveBrightnessInfo) {
- saveBrightnessInfo(brightnessState);
-
- }
+ // The current brightness to use has been calculated at this point (minus the adjustments
+ // like low-power and dim), and HbmController should be notified so that it can accurately
+ // calculate HDR or HBM levels. We specifically do it here instead of having HbmController
+ // listen to the brightness setting because certain brightness sources (just as an app
+ // override) are not saved to the setting, but should be reflected in HBM
+ // calculations.
+ mHbmController.onBrightnessChanged(brightnessState);
if (updateScreenBrightnessSetting) {
// Tell the rest of the system about the new brightness in case we had to change it
@@ -1257,6 +1259,10 @@
putScreenBrightnessSetting(brightnessState, /* updateCurrent */ true);
}
+ // We save the brightness info *after* the brightness setting has been changed so that
+ // the brightness info reflects the latest value.
+ saveBrightnessInfo(getScreenBrightnessSetting());
+
// Apply dimming by at least some minimum amount when user activity
// timeout is about to expire.
if (mPowerRequest.policy == DisplayPowerRequest.POLICY_DIM) {
@@ -1533,7 +1539,7 @@
mHandler.post(mOnBrightnessChangeRunnable);
// TODO(b/192258832): Switch the HBMChangeCallback to a listener pattern.
mAutomaticBrightnessController.update();
- }, mContext, mBrightnessSetting);
+ }, mContext);
}
private void blockScreenOn() {
@@ -2336,7 +2342,7 @@
try {
// TODO(brightnessfloat): change BatteryStats to use float
mBatteryStats.noteScreenBrightness(BrightnessSynchronizer.brightnessFloatToInt(
- brightness));
+ brightness, null));
} catch (RemoteException e) {
// same process
}
diff --git a/services/core/java/com/android/server/display/HighBrightnessModeController.java b/services/core/java/com/android/server/display/HighBrightnessModeController.java
index 645131c..2791f6a 100644
--- a/services/core/java/com/android/server/display/HighBrightnessModeController.java
+++ b/services/core/java/com/android/server/display/HighBrightnessModeController.java
@@ -37,7 +37,6 @@
import android.view.SurfaceControlHdrLayerInfoListener;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.server.display.BrightnessSetting.BrightnessSettingListener;
import com.android.server.display.DisplayDeviceConfig.HighBrightnessModeData;
import com.android.server.display.DisplayManagerService.Clock;
@@ -70,7 +69,6 @@
private final Context mContext;
private final SettingsObserver mSettingsObserver;
private final Injector mInjector;
- private final BrightnessSettingListener mBrightnessSettingListener = this::onBrightnessChanged;
private HdrListener mHdrListener;
private HighBrightnessModeData mHbmData;
@@ -86,7 +84,6 @@
private boolean mIsBlockedByLowPowerMode = false;
private int mWidth;
private int mHeight;
- private BrightnessSetting mBrightnessSetting;
private float mAmbientLux;
/**
@@ -103,30 +100,30 @@
HighBrightnessModeController(Handler handler, int width, int height, IBinder displayToken,
float brightnessMin, float brightnessMax, HighBrightnessModeData hbmData,
- Runnable hbmChangeCallback, Context context, BrightnessSetting brightnessSetting) {
+ Runnable hbmChangeCallback, Context context) {
this(new Injector(), handler, width, height, displayToken, brightnessMin, brightnessMax,
- hbmData, hbmChangeCallback, context, brightnessSetting);
+ hbmData, hbmChangeCallback, context);
}
@VisibleForTesting
HighBrightnessModeController(Injector injector, Handler handler, int width, int height,
IBinder displayToken, float brightnessMin, float brightnessMax,
HighBrightnessModeData hbmData, Runnable hbmChangeCallback,
- Context context, BrightnessSetting brightnessSetting) {
+ Context context) {
mInjector = injector;
mContext = context;
mClock = injector.getClock();
mHandler = handler;
+ mBrightness = brightnessMin;
mBrightnessMin = brightnessMin;
mBrightnessMax = brightnessMax;
- mBrightness = brightnessSetting.getBrightness();
mHbmChangeCallback = hbmChangeCallback;
mSkinThermalStatusObserver = new SkinThermalStatusObserver(mInjector, mHandler);
mSettingsObserver = new SettingsObserver(mHandler);
mRecalcRunnable = this::recalculateTimeAllowance;
mHdrListener = new HdrListener();
- resetHbmData(width, height, displayToken, hbmData, brightnessSetting);
+ resetHbmData(width, height, displayToken, hbmData);
}
void setAutoBrightnessEnabled(boolean isEnabled) {
@@ -185,7 +182,6 @@
}
}
- @VisibleForTesting
void onBrightnessChanged(float brightness) {
if (!deviceSupportsHbm()) {
return;
@@ -224,12 +220,11 @@
mSettingsObserver.stopObserving();
}
- void resetHbmData(int width, int height, IBinder displayToken, HighBrightnessModeData hbmData,
- BrightnessSetting brightnessSetting) {
+ void resetHbmData(int width, int height, IBinder displayToken, HighBrightnessModeData hbmData) {
mWidth = width;
mHeight = height;
mHbmData = hbmData;
- resetBrightnessSetting(brightnessSetting);
+
unregisterHdrListener();
mSkinThermalStatusObserver.stopObserving();
mSettingsObserver.stopObserving();
@@ -261,9 +256,12 @@
pw.println(" mBrightness=" + mBrightness);
pw.println(" mCurrentMin=" + getCurrentBrightnessMin());
pw.println(" mCurrentMax=" + getCurrentBrightnessMax());
- pw.println(" mHbmMode=" + BrightnessInfo.hbmToString(mHbmMode));
+ pw.println(" mHbmMode=" + BrightnessInfo.hbmToString(mHbmMode)
+ + (mHbmMode == BrightnessInfo.HIGH_BRIGHTNESS_MODE_HDR
+ ? "(" + getHdrBrightnessValue() + ")" : ""));
pw.println(" mHbmData=" + mHbmData);
- pw.println(" mAmbientLux=" + mAmbientLux);
+ pw.println(" mAmbientLux=" + mAmbientLux
+ + (mIsAutoBrightnessEnabled ? "" : " (old/invalid)"));
pw.println(" mIsInAllowedAmbientRange=" + mIsInAllowedAmbientRange);
pw.println(" mIsAutoBrightnessEnabled=" + mIsAutoBrightnessEnabled);
pw.println(" mIsHdrLayerPresent=" + mIsHdrLayerPresent);
@@ -301,16 +299,6 @@
return event.startTimeMillis;
}
- private void resetBrightnessSetting(BrightnessSetting brightnessSetting) {
- if (mBrightnessSetting != null) {
- mBrightnessSetting.unregisterListener(mBrightnessSettingListener);
- }
- mBrightnessSetting = brightnessSetting;
- if (mBrightnessSetting != null) {
- mBrightnessSetting.registerListener(mBrightnessSettingListener);
- }
- }
-
private boolean isCurrentlyAllowed() {
// Returns true if HBM is allowed (above the ambient lux threshold) and there's still
// time within the current window for additional HBM usage. We return false if there is an
diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
index f953cc8..24d29d3 100644
--- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
@@ -795,11 +795,12 @@
mBacklightAdapter.setBacklight(sdrBacklight, sdrNits, backlight, nits);
Trace.traceCounter(Trace.TRACE_TAG_POWER,
"ScreenBrightness",
- BrightnessSynchronizer.brightnessFloatToInt(brightnessState));
+ BrightnessSynchronizer.brightnessFloatToInt(
+ brightnessState, null));
Trace.traceCounter(Trace.TRACE_TAG_POWER,
"SdrScreenBrightness",
BrightnessSynchronizer.brightnessFloatToInt(
- sdrBrightnessState));
+ sdrBrightnessState, null));
} finally {
Trace.traceEnd(Trace.TRACE_TAG_POWER);
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
index de65d76..3509062 100755
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
@@ -68,7 +68,6 @@
protected final HdmiControlService mService;
protected final int mDeviceType;
- protected int mAddress;
protected int mPreferredAddress;
@GuardedBy("mLock")
protected HdmiDeviceInfo mDeviceInfo;
@@ -187,7 +186,6 @@
protected HdmiCecLocalDevice(HdmiControlService service, int deviceType) {
mService = service;
mDeviceType = deviceType;
- mAddress = Constants.ADDR_UNREGISTERED;
mLock = service.getServiceLock();
}
@@ -254,7 +252,7 @@
protected int dispatchMessage(HdmiCecMessage message) {
assertRunOnServiceThread();
int dest = message.getDestination();
- if (dest != mAddress && dest != Constants.ADDR_BROADCAST) {
+ if (dest != mDeviceInfo.getLogicalAddress() && dest != Constants.ADDR_BROADCAST) {
return Constants.NOT_HANDLED;
}
// Cache incoming message if it is included in the list of cacheable opcodes.
@@ -388,7 +386,7 @@
} else {
HdmiCecMessage cecMessage =
HdmiCecMessageBuilder.buildReportPhysicalAddressCommand(
- mAddress, physicalAddress, mDeviceType);
+ mDeviceInfo.getLogicalAddress(), physicalAddress, mDeviceType);
mService.sendCecCommand(cecMessage);
}
return Constants.HANDLED;
@@ -403,7 +401,8 @@
mService.maySendFeatureAbortCommand(message, Constants.ABORT_UNABLE_TO_DETERMINE);
} else {
HdmiCecMessage cecMessage =
- HdmiCecMessageBuilder.buildDeviceVendorIdCommand(mAddress, vendorId);
+ HdmiCecMessageBuilder.buildDeviceVendorIdCommand(
+ mDeviceInfo.getLogicalAddress(), vendorId);
mService.sendCecCommand(cecMessage);
}
return Constants.HANDLED;
@@ -476,8 +475,8 @@
protected void buildAndSendSetOsdName(int dest) {
HdmiCecMessage cecMessage =
- HdmiCecMessageBuilder.buildSetOsdNameCommand(
- mAddress, dest, mDeviceInfo.getDisplayName());
+ HdmiCecMessageBuilder.buildSetOsdNameCommand(
+ mDeviceInfo.getLogicalAddress(), dest, mDeviceInfo.getDisplayName());
if (cecMessage != null) {
mService.sendCecCommand(cecMessage, new SendMessageCallback() {
@Override
@@ -525,7 +524,8 @@
if (cecDeviceInfo != null && cecDeviceInfo.getDisplayName().equals(
HdmiUtils.getDefaultDeviceName(address))) {
mService.sendCecCommand(
- HdmiCecMessageBuilder.buildGiveOsdNameCommand(mAddress, address));
+ HdmiCecMessageBuilder.buildGiveOsdNameCommand(
+ mDeviceInfo.getLogicalAddress(), address));
}
return Constants.HANDLED;
@@ -630,8 +630,13 @@
List<Integer> deviceFeatures = getDeviceFeatures();
mService.sendCecCommand(
- HdmiCecMessageBuilder.buildReportFeatures(mAddress, mService.getCecVersion(),
- localDeviceTypes, rcProfile, rcFeatures, deviceFeatures));
+ HdmiCecMessageBuilder.buildReportFeatures(
+ mDeviceInfo.getLogicalAddress(),
+ mService.getCecVersion(),
+ localDeviceTypes,
+ rcProfile,
+ rcFeatures,
+ deviceFeatures));
}
@ServiceThreadOnly
@@ -793,7 +798,9 @@
protected int handleGiveDevicePowerStatus(HdmiCecMessage message) {
mService.sendCecCommand(
HdmiCecMessageBuilder.buildReportPowerStatus(
- mAddress, message.getSource(), mService.getPowerStatus()));
+ mDeviceInfo.getLogicalAddress(),
+ message.getSource(),
+ mService.getPowerStatus()));
return Constants.HANDLED;
}
@@ -802,7 +809,9 @@
// Always report menu active to receive Remote Control.
mService.sendCecCommand(
HdmiCecMessageBuilder.buildReportMenuStatus(
- mAddress, message.getSource(), Constants.MENU_STATE_ACTIVATED));
+ mDeviceInfo.getLogicalAddress(),
+ message.getSource(),
+ Constants.MENU_STATE_ACTIVATED));
return Constants.HANDLED;
}
@@ -884,7 +893,7 @@
@ServiceThreadOnly
final void handleAddressAllocated(int logicalAddress, int reason) {
assertRunOnServiceThread();
- mAddress = mPreferredAddress = logicalAddress;
+ mPreferredAddress = logicalAddress;
if (mService.getCecVersion() >= HdmiControlManager.HDMI_CEC_VERSION_2_0) {
reportFeatures();
}
@@ -914,14 +923,7 @@
@ServiceThreadOnly
boolean isAddressOf(int addr) {
assertRunOnServiceThread();
- return addr == mAddress;
- }
-
- // Resets the logical address to unregistered(15), meaning the logical device is invalid.
- @ServiceThreadOnly
- void clearAddress() {
- assertRunOnServiceThread();
- mAddress = Constants.ADDR_UNREGISTERED;
+ return addr == mDeviceInfo.getLogicalAddress();
}
@ServiceThreadOnly
@@ -1184,7 +1186,8 @@
}
List<SendKeyAction> action = getActions(SendKeyAction.class);
int logicalAddress = findKeyReceiverAddress();
- if (logicalAddress == Constants.ADDR_INVALID || logicalAddress == mAddress) {
+ if (logicalAddress == Constants.ADDR_INVALID
+ || logicalAddress == mDeviceInfo.getLogicalAddress()) {
// Don't send key event to invalid device or itself.
Slog.w(
TAG,
@@ -1222,7 +1225,8 @@
}
List<SendKeyAction> action = getActions(SendKeyAction.class);
int logicalAddress = findAudioReceiverAddress();
- if (logicalAddress == Constants.ADDR_INVALID || logicalAddress == mAddress) {
+ if (logicalAddress == Constants.ADDR_INVALID
+ || logicalAddress == mDeviceInfo.getLogicalAddress()) {
// Don't send key event to invalid device or itself.
Slog.w(
TAG,
@@ -1276,9 +1280,11 @@
void sendUserControlPressedAndReleased(int targetAddress, int cecKeycode) {
mService.sendCecCommand(
- HdmiCecMessageBuilder.buildUserControlPressed(mAddress, targetAddress, cecKeycode));
+ HdmiCecMessageBuilder.buildUserControlPressed(
+ mDeviceInfo.getLogicalAddress(), targetAddress, cecKeycode));
mService.sendCecCommand(
- HdmiCecMessageBuilder.buildUserControlReleased(mAddress, targetAddress));
+ HdmiCecMessageBuilder.buildUserControlReleased(
+ mDeviceInfo.getLogicalAddress(), targetAddress));
}
void addActiveSourceHistoryItem(ActiveSource activeSource, boolean isActiveSource,
@@ -1298,7 +1304,6 @@
/** Dump internal status of HdmiCecLocalDevice object. */
protected void dump(final IndentingPrintWriter pw) {
pw.println("mDeviceType: " + mDeviceType);
- pw.println("mAddress: " + mAddress);
pw.println("mPreferredAddress: " + mPreferredAddress);
pw.println("mDeviceInfo: " + mDeviceInfo);
pw.println("mActiveSource: " + getActiveSource());
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java
index 93b0560..1fa6241 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java
@@ -254,9 +254,12 @@
}
mService.sendCecCommand(
HdmiCecMessageBuilder.buildReportPhysicalAddressCommand(
- mAddress, mService.getPhysicalAddress(), mDeviceType));
+ getDeviceInfo().getLogicalAddress(),
+ mService.getPhysicalAddress(),
+ mDeviceType));
mService.sendCecCommand(
- HdmiCecMessageBuilder.buildDeviceVendorIdCommand(mAddress, mService.getVendorId()));
+ HdmiCecMessageBuilder.buildDeviceVendorIdCommand(
+ getDeviceInfo().getLogicalAddress(), mService.getVendorId()));
mService.registerTvInputCallback(mTvInputCallback);
// Some TVs, for example Mi TV, need ARC on before turning System Audio Mode on
// to request Short Audio Descriptor. Since ARC and SAM are independent,
@@ -406,7 +409,9 @@
}
mService.sendCecCommand(
HdmiCecMessageBuilder.buildReportSystemAudioMode(
- mAddress, message.getSource(), isSystemAudioModeOnOrTurningOn));
+ getDeviceInfo().getLogicalAddress(),
+ message.getSource(),
+ isSystemAudioModeOnOrTurningOn));
return Constants.HANDLED;
}
@@ -488,7 +493,7 @@
} else {
mService.sendCecCommand(
HdmiCecMessageBuilder.buildReportShortAudioDescriptor(
- mAddress, message.getSource(), sadBytes));
+ getDeviceInfo().getLogicalAddress(), message.getSource(), sadBytes));
return Constants.HANDLED;
}
}
@@ -656,7 +661,9 @@
mService.sendCecCommand(
HdmiCecMessageBuilder.buildSetSystemAudioMode(
- mAddress, Constants.ADDR_BROADCAST, systemAudioStatusOn));
+ getDeviceInfo().getLogicalAddress(),
+ Constants.ADDR_BROADCAST,
+ systemAudioStatusOn));
if (systemAudioStatusOn) {
// If TV sends out SAM Request with a path of a non-CEC device, which should not show
@@ -754,7 +761,7 @@
mService.sendCecCommand(
HdmiCecMessageBuilder.buildReportAudioStatus(
- mAddress, source, scaledVolume, mute));
+ getDeviceInfo().getLogicalAddress(), source, scaledVolume, mute));
}
/**
@@ -908,7 +915,8 @@
setRoutingPort(portId);
setLocalActivePort(portId);
HdmiCecMessage routingChange =
- HdmiCecMessageBuilder.buildRoutingChange(mAddress, oldPath, newPath);
+ HdmiCecMessageBuilder.buildRoutingChange(
+ getDeviceInfo().getLogicalAddress(), oldPath, newPath);
mService.sendCecCommand(routingChange);
}
@@ -933,7 +941,7 @@
// send <Set System Audio Mode> [“Off”]
mService.sendCecCommand(
HdmiCecMessageBuilder.buildSetSystemAudioMode(
- mAddress, Constants.ADDR_BROADCAST, false));
+ getDeviceInfo().getLogicalAddress(), Constants.ADDR_BROADCAST, false));
}
}
@@ -981,7 +989,7 @@
setSystemAudioMode(true);
mService.sendCecCommand(
HdmiCecMessageBuilder.buildSetSystemAudioMode(
- mAddress, Constants.ADDR_BROADCAST, true));
+ getDeviceInfo().getLogicalAddress(), Constants.ADDR_BROADCAST, true));
return Constants.HANDLED;
}
// Check if TV supports System Audio Control.
@@ -992,7 +1000,9 @@
setSystemAudioMode(true);
mService.sendCecCommand(
HdmiCecMessageBuilder.buildSetSystemAudioMode(
- mAddress, Constants.ADDR_BROADCAST, true));
+ getDeviceInfo().getLogicalAddress(),
+ Constants.ADDR_BROADCAST,
+ true));
} else {
mService.maySendFeatureAbortCommand(message, Constants.ABORT_REFUSED);
}
@@ -1150,8 +1160,9 @@
return;
}
// Otherwise will switch to the current active port and broadcast routing information.
- mService.sendCecCommand(HdmiCecMessageBuilder.buildRoutingInformation(
- mAddress, routingInformationPath));
+ mService.sendCecCommand(
+ HdmiCecMessageBuilder.buildRoutingInformation(
+ getDeviceInfo().getLogicalAddress(), routingInformationPath));
routeToInputFromPortId(getRoutingPort());
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java
index 1276aa3..4376c9a 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java
@@ -75,10 +75,14 @@
getDeviceInfo().getDeviceType(), Constants.ADDR_BROADCAST,
"HdmiCecLocalDevicePlayback#onAddressAllocated()");
}
- mService.sendCecCommand(HdmiCecMessageBuilder.buildReportPhysicalAddressCommand(
- mAddress, mService.getPhysicalAddress(), mDeviceType));
- mService.sendCecCommand(HdmiCecMessageBuilder.buildDeviceVendorIdCommand(
- mAddress, mService.getVendorId()));
+ mService.sendCecCommand(
+ HdmiCecMessageBuilder.buildReportPhysicalAddressCommand(
+ getDeviceInfo().getLogicalAddress(),
+ mService.getPhysicalAddress(),
+ mDeviceType));
+ mService.sendCecCommand(
+ HdmiCecMessageBuilder.buildDeviceVendorIdCommand(
+ getDeviceInfo().getLogicalAddress(), mService.getVendorId()));
// Actively send out an OSD name to the TV to update the TV panel in case the TV
// does not query the OSD name on time. This is not a required behavior by the spec.
// It is used for some TVs that need the OSD name update but don't query it themselves.
@@ -87,8 +91,10 @@
// If current device is not a functional audio system device,
// send message to potential audio system device in the system to get the system
// audio mode status. If no response, set to false.
- mService.sendCecCommand(HdmiCecMessageBuilder.buildGiveSystemAudioModeStatus(
- mAddress, Constants.ADDR_AUDIO_SYSTEM), new SendMessageCallback() {
+ mService.sendCecCommand(
+ HdmiCecMessageBuilder.buildGiveSystemAudioModeStatus(
+ getDeviceInfo().getLogicalAddress(), Constants.ADDR_AUDIO_SYSTEM),
+ new SendMessageCallback() {
@Override
public void onSendCompleted(int error) {
if (error != SendMessageResult.SUCCESS) {
@@ -144,8 +150,9 @@
return;
}
if (initiatedByCec) {
- mService.sendCecCommand(HdmiCecMessageBuilder.buildInactiveSource(mAddress,
- mService.getPhysicalAddress()));
+ mService.sendCecCommand(
+ HdmiCecMessageBuilder.buildInactiveSource(
+ getDeviceInfo().getLogicalAddress(), mService.getPhysicalAddress()));
return;
}
switch (standbyAction) {
@@ -157,23 +164,28 @@
switch (powerControlMode) {
case HdmiControlManager.POWER_CONTROL_MODE_TV:
mService.sendCecCommand(
- HdmiCecMessageBuilder.buildStandby(mAddress, Constants.ADDR_TV));
+ HdmiCecMessageBuilder.buildStandby(
+ getDeviceInfo().getLogicalAddress(), Constants.ADDR_TV));
break;
case HdmiControlManager.POWER_CONTROL_MODE_TV_AND_AUDIO_SYSTEM:
mService.sendCecCommand(
- HdmiCecMessageBuilder.buildStandby(mAddress, Constants.ADDR_TV));
+ HdmiCecMessageBuilder.buildStandby(
+ getDeviceInfo().getLogicalAddress(), Constants.ADDR_TV));
mService.sendCecCommand(
- HdmiCecMessageBuilder.buildStandby(mAddress,
+ HdmiCecMessageBuilder.buildStandby(
+ getDeviceInfo().getLogicalAddress(),
Constants.ADDR_AUDIO_SYSTEM));
break;
case HdmiControlManager.POWER_CONTROL_MODE_BROADCAST:
mService.sendCecCommand(
- HdmiCecMessageBuilder.buildStandby(mAddress,
+ HdmiCecMessageBuilder.buildStandby(
+ getDeviceInfo().getLogicalAddress(),
Constants.ADDR_BROADCAST));
break;
case HdmiControlManager.POWER_CONTROL_MODE_NONE:
mService.sendCecCommand(
- HdmiCecMessageBuilder.buildInactiveSource(mAddress,
+ HdmiCecMessageBuilder.buildInactiveSource(
+ getDeviceInfo().getLogicalAddress(),
mService.getPhysicalAddress()));
break;
}
@@ -181,7 +193,8 @@
case HdmiControlService.STANDBY_SHUTDOWN:
// ACTION_SHUTDOWN is taken as a signal to power off all the devices.
mService.sendCecCommand(
- HdmiCecMessageBuilder.buildStandby(mAddress, Constants.ADDR_BROADCAST));
+ HdmiCecMessageBuilder.buildStandby(
+ getDeviceInfo().getLogicalAddress(), Constants.ADDR_BROADCAST));
break;
}
}
@@ -330,7 +343,7 @@
protected int handleSystemAudioModeStatus(HdmiCecMessage message) {
// Only directly addressed System Audio Mode Status message can change internal
// system audio mode status.
- if (message.getDestination() == mAddress
+ if (message.getDestination() == getDeviceInfo().getLogicalAddress()
&& message.getSource() == Constants.ADDR_AUDIO_SYSTEM) {
boolean setSystemAudioModeOn = HdmiUtils.parseCommandParamSystemAudioStatus(message);
if (mService.isSystemAudioActivated() != setSystemAudioModeOn) {
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceSource.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceSource.java
index 0c7b3f6..d4fa1df 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceSource.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceSource.java
@@ -111,13 +111,17 @@
HdmiControlManager.CEC_SETTING_NAME_POWER_CONTROL_MODE);
if (powerControlMode.equals(HdmiControlManager.POWER_CONTROL_MODE_BROADCAST)) {
mService.sendCecCommand(
- HdmiCecMessageBuilder.buildStandby(mAddress, Constants.ADDR_BROADCAST));
+ HdmiCecMessageBuilder.buildStandby(
+ getDeviceInfo().getLogicalAddress(), Constants.ADDR_BROADCAST));
return;
}
- mService.sendCecCommand(HdmiCecMessageBuilder.buildStandby(mAddress, Constants.ADDR_TV));
+ mService.sendCecCommand(
+ HdmiCecMessageBuilder.buildStandby(
+ getDeviceInfo().getLogicalAddress(), Constants.ADDR_TV));
if (powerControlMode.equals(HdmiControlManager.POWER_CONTROL_MODE_TV_AND_AUDIO_SYSTEM)) {
mService.sendCecCommand(
- HdmiCecMessageBuilder.buildStandby(mAddress, Constants.ADDR_AUDIO_SYSTEM));
+ HdmiCecMessageBuilder.buildStandby(
+ getDeviceInfo().getLogicalAddress(), Constants.ADDR_AUDIO_SYSTEM));
}
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
index 1d099da..b087507 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
@@ -168,10 +168,14 @@
mArcFeatureEnabled.put(port.getId(), port.isArcSupported());
}
mService.registerTvInputCallback(mTvInputCallback);
- mService.sendCecCommand(HdmiCecMessageBuilder.buildReportPhysicalAddressCommand(
- mAddress, mService.getPhysicalAddress(), mDeviceType));
- mService.sendCecCommand(HdmiCecMessageBuilder.buildDeviceVendorIdCommand(
- mAddress, mService.getVendorId()));
+ mService.sendCecCommand(
+ HdmiCecMessageBuilder.buildReportPhysicalAddressCommand(
+ getDeviceInfo().getLogicalAddress(),
+ mService.getPhysicalAddress(),
+ mDeviceType));
+ mService.sendCecCommand(
+ HdmiCecMessageBuilder.buildDeviceVendorIdCommand(
+ getDeviceInfo().getLogicalAddress(), mService.getVendorId()));
mService.getHdmiCecNetwork().addCecSwitch(
mService.getHdmiCecNetwork().getPhysicalAddress()); // TV is a CEC switch too.
mTvInputs.clear();
@@ -182,7 +186,9 @@
launchDeviceDiscovery();
startQueuedActions();
if (!mDelayedMessageBuffer.isBuffered(Constants.MESSAGE_ACTIVE_SOURCE)) {
- mService.sendCecCommand(HdmiCecMessageBuilder.buildRequestActiveSource(mAddress));
+ mService.sendCecCommand(
+ HdmiCecMessageBuilder.buildRequestActiveSource(
+ getDeviceInfo().getLogicalAddress()));
}
}
@@ -265,15 +271,19 @@
private void handleSelectInternalSource() {
assertRunOnServiceThread();
// Seq #18
- if (mService.isControlEnabled() && getActiveSource().logicalAddress != mAddress) {
- updateActiveSource(mAddress, mService.getPhysicalAddress(),
+ if (mService.isControlEnabled()
+ && getActiveSource().logicalAddress != getDeviceInfo().getLogicalAddress()) {
+ updateActiveSource(
+ getDeviceInfo().getLogicalAddress(),
+ mService.getPhysicalAddress(),
"HdmiCecLocalDeviceTv#handleSelectInternalSource()");
if (mSkipRoutingControl) {
mSkipRoutingControl = false;
return;
}
- HdmiCecMessage activeSource = HdmiCecMessageBuilder.buildActiveSource(
- mAddress, mService.getPhysicalAddress());
+ HdmiCecMessage activeSource =
+ HdmiCecMessageBuilder.buildActiveSource(
+ getDeviceInfo().getLogicalAddress(), mService.getPhysicalAddress());
mService.sendCecCommand(activeSource);
}
}
@@ -294,7 +304,7 @@
setActiveSource(newActive, caller);
int logicalAddress = newActive.logicalAddress;
if (mService.getHdmiCecNetwork().getCecDeviceInfo(logicalAddress) != null
- && logicalAddress != mAddress) {
+ && logicalAddress != getDeviceInfo().getLogicalAddress()) {
if (mService.pathToPortId(newActive.physicalAddress) == getActivePortId()) {
setPrevPortId(getActivePortId());
}
@@ -383,7 +393,8 @@
return;
}
HdmiCecMessage routingChange =
- HdmiCecMessageBuilder.buildRoutingChange(mAddress, oldPath, newPath);
+ HdmiCecMessageBuilder.buildRoutingChange(
+ getDeviceInfo().getLogicalAddress(), oldPath, newPath);
mService.sendCecCommand(routingChange);
removeAction(RoutingControlAction.class);
addAndStartAction(
@@ -485,9 +496,10 @@
protected int handleRequestActiveSource(HdmiCecMessage message) {
assertRunOnServiceThread();
// Seq #19
- if (mAddress == getActiveSource().logicalAddress) {
+ if (getDeviceInfo().getLogicalAddress() == getActiveSource().logicalAddress) {
mService.sendCecCommand(
- HdmiCecMessageBuilder.buildActiveSource(mAddress, getActivePath()));
+ HdmiCecMessageBuilder.buildActiveSource(
+ getDeviceInfo().getLogicalAddress(), getActivePath()));
}
return Constants.HANDLED;
}
@@ -506,8 +518,9 @@
@ServiceThreadOnly
boolean broadcastMenuLanguage(String language) {
assertRunOnServiceThread();
- HdmiCecMessage command = HdmiCecMessageBuilder.buildSetMenuLanguageCommand(
- mAddress, language);
+ HdmiCecMessage command =
+ HdmiCecMessageBuilder.buildSetMenuLanguageCommand(
+ getDeviceInfo().getLogicalAddress(), language);
if (command != null) {
mService.sendCecCommand(command);
return true;
@@ -1213,8 +1226,9 @@
setActivePath(activePath);
if (!routingForBootup
&& !mDelayedMessageBuffer.isBuffered(Constants.MESSAGE_ACTIVE_SOURCE)) {
- mService.sendCecCommand(HdmiCecMessageBuilder.buildActiveSource(mAddress,
- activePath));
+ mService.sendCecCommand(
+ HdmiCecMessageBuilder.buildActiveSource(
+ getDeviceInfo().getLogicalAddress(), activePath));
}
}
}
@@ -1336,8 +1350,9 @@
HdmiControlManager.CEC_SETTING_NAME_TV_SEND_STANDBY_ON_SLEEP)
== HdmiControlManager.TV_SEND_STANDBY_ON_SLEEP_ENABLED;
if (!initiatedByCec && sendStandbyOnSleep) {
- mService.sendCecCommand(HdmiCecMessageBuilder.buildStandby(
- mAddress, Constants.ADDR_BROADCAST));
+ mService.sendCecCommand(
+ HdmiCecMessageBuilder.buildStandby(
+ getDeviceInfo().getLogicalAddress(), Constants.ADDR_BROADCAST));
}
}
@@ -1410,7 +1425,9 @@
// Remove one touch record action so that other one touch record can be started.
removeAction(OneTouchRecordAction.class);
- mService.sendCecCommand(HdmiCecMessageBuilder.buildRecordOff(mAddress, recorderAddress));
+ mService.sendCecCommand(
+ HdmiCecMessageBuilder.buildRecordOff(
+ getDeviceInfo().getLogicalAddress(), recorderAddress));
Slog.i(TAG, "Stop [One Touch Record]-Target:" + recorderAddress);
}
@@ -1491,16 +1508,19 @@
HdmiCecMessage message = null;
switch (sourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
- message = HdmiCecMessageBuilder.buildClearDigitalTimer(mAddress, recorderAddress,
- recordSource);
+ message =
+ HdmiCecMessageBuilder.buildClearDigitalTimer(
+ getDeviceInfo().getLogicalAddress(), recorderAddress, recordSource);
break;
case TIMER_RECORDING_TYPE_ANALOGUE:
- message = HdmiCecMessageBuilder.buildClearAnalogueTimer(mAddress, recorderAddress,
- recordSource);
+ message =
+ HdmiCecMessageBuilder.buildClearAnalogueTimer(
+ getDeviceInfo().getLogicalAddress(), recorderAddress, recordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
- message = HdmiCecMessageBuilder.buildClearExternalTimer(mAddress, recorderAddress,
- recordSource);
+ message =
+ HdmiCecMessageBuilder.buildClearExternalTimer(
+ getDeviceInfo().getLogicalAddress(), recorderAddress, recordSource);
break;
default:
Slog.w(TAG, "Invalid source type:" + recorderAddress);
@@ -1568,7 +1588,9 @@
return;
}
int targetAddress = targetDevice.getLogicalAddress();
- mService.sendCecCommand(HdmiCecMessageBuilder.buildStandby(mAddress, targetAddress));
+ mService.sendCecCommand(
+ HdmiCecMessageBuilder.buildStandby(
+ getDeviceInfo().getLogicalAddress(), targetAddress));
}
@ServiceThreadOnly
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecNetwork.java b/services/core/java/com/android/server/hdmi/HdmiCecNetwork.java
index 7ceaa95..225785a 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecNetwork.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecNetwork.java
@@ -166,18 +166,6 @@
}
return false;
}
- /**
- * Clear all logical addresses registered in the device.
- *
- * <p>Declared as package-private. accessed by {@link HdmiControlService} only.
- */
- @ServiceThreadOnly
- void clearLogicalAddress() {
- assertRunOnServiceThread();
- for (int i = 0; i < mLocalDevices.size(); ++i) {
- mLocalDevices.valueAt(i).clearAddress();
- }
- }
@ServiceThreadOnly
void clearLocalDevices() {
@@ -862,7 +850,7 @@
private boolean isLocalDeviceAddress(int address) {
for (int i = 0; i < mLocalDevices.size(); i++) {
int key = mLocalDevices.keyAt(i);
- if (mLocalDevices.get(key).mAddress == address) {
+ if (mLocalDevices.get(key).getDeviceInfo().getLogicalAddress() == address) {
return true;
}
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecPowerStatusController.java b/services/core/java/com/android/server/hdmi/HdmiCecPowerStatusController.java
index c4dadaa..552ff37 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecPowerStatusController.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecPowerStatusController.java
@@ -77,8 +77,10 @@
private void sendReportPowerStatus(int powerStatus) {
for (HdmiCecLocalDevice localDevice : mHdmiControlService.getAllLocalDevices()) {
mHdmiControlService.sendCecCommand(
- HdmiCecMessageBuilder.buildReportPowerStatus(localDevice.mAddress,
- Constants.ADDR_BROADCAST, powerStatus));
+ HdmiCecMessageBuilder.buildReportPowerStatus(
+ localDevice.getDeviceInfo().getLogicalAddress(),
+ Constants.ADDR_BROADCAST,
+ powerStatus));
}
}
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index c7d0e9e..d3aa3fa 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -1239,13 +1239,11 @@
@ServiceThreadOnly
void onHotplug(int portId, boolean connected) {
assertRunOnServiceThread();
+ // initPortInfo at hotplug event.
+ mHdmiCecNetwork.initPortInfo();
if (connected && !isTvDevice()
&& getPortInfo(portId).getType() == HdmiPortInfo.PORT_OUTPUT) {
- if (isSwitchDevice()) {
- mHdmiCecNetwork.initPortInfo();
- HdmiLogger.debug("initPortInfo for switch device when onHotplug from tx.");
- }
ArrayList<HdmiCecLocalDevice> localDevices = new ArrayList<>();
for (int type : mLocalDevices) {
HdmiCecLocalDevice localDevice = mHdmiCecNetwork.getLocalDevice(type);
@@ -1395,8 +1393,9 @@
deviceInfo.getLogicalAddress(), deviceInfo.getPhysicalAddress(),
deviceInfo.getPortId(), deviceInfo.getDeviceType(), deviceInfo.getVendorId(),
newDisplayName, deviceInfo.getDevicePowerStatus(), deviceInfo.getCecVersion()));
- sendCecCommand(HdmiCecMessageBuilder.buildSetOsdNameCommand(
- device.mAddress, Constants.ADDR_TV, newDisplayName));
+ sendCecCommand(
+ HdmiCecMessageBuilder.buildSetOsdNameCommand(
+ deviceInfo.getLogicalAddress(), Constants.ADDR_TV, newDisplayName));
}
}
@@ -2294,7 +2293,9 @@
}
sendCecCommand(
HdmiCecMessageBuilder.buildSetSystemAudioMode(
- audioSystem().mAddress, Constants.ADDR_BROADCAST, true));
+ audioSystem().getDeviceInfo().getLogicalAddress(),
+ Constants.ADDR_BROADCAST,
+ true));
}
});
}
@@ -3200,7 +3201,6 @@
return;
}
mCecController.clearLogicalAddress();
- mHdmiCecNetwork.clearLogicalAddress();
mHdmiCecNetwork.clearLocalDevices();
}
diff --git a/services/core/java/com/android/server/hdmi/SendKeyAction.java b/services/core/java/com/android/server/hdmi/SendKeyAction.java
index 5ad7fab..adcef66 100644
--- a/services/core/java/com/android/server/hdmi/SendKeyAction.java
+++ b/services/core/java/com/android/server/hdmi/SendKeyAction.java
@@ -20,6 +20,7 @@
import android.hardware.tv.cec.V1_0.SendMessageResult;
import android.util.Slog;
import android.view.KeyEvent;
+
import com.android.server.hdmi.HdmiControlService.SendMessageCallback;
/**
@@ -152,7 +153,7 @@
// audio system device is still plugged in. Framework checks if the volume key forwarding is
// successful or not every time to make sure the System Audio Mode status is still updated.
if (mTargetAddress == Constants.ADDR_AUDIO_SYSTEM
- && localDevice().mAddress != Constants.ADDR_TV) {
+ && localDevice().getDeviceInfo().getLogicalAddress() != Constants.ADDR_TV) {
sendCommand(HdmiCecMessageBuilder.buildUserControlPressed(getSourceAddress(),
mTargetAddress, cecKeycodeAndParams), new SendMessageCallback() {
@Override
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index de78bec..50d5b66 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -154,8 +154,8 @@
import com.android.internal.content.PackageMonitor;
import com.android.internal.inputmethod.CallbackUtils;
import com.android.internal.inputmethod.IBooleanResultCallback;
-import com.android.internal.inputmethod.IIInputContentUriTokenResultCallback;
import com.android.internal.inputmethod.IInputContentUriToken;
+import com.android.internal.inputmethod.IInputContentUriTokenResultCallback;
import com.android.internal.inputmethod.IInputMethodPrivilegedOperations;
import com.android.internal.inputmethod.IVoidResultCallback;
import com.android.internal.inputmethod.ImeTracing;
@@ -5831,7 +5831,7 @@
@BinderThread
@Override
public void createInputContentUriToken(Uri contentUri, String packageName,
- IIInputContentUriTokenResultCallback resultCallback) {
+ IInputContentUriTokenResultCallback resultCallback) {
CallbackUtils.onResult(resultCallback,
() -> mImms.createInputContentUriToken(mToken, contentUri, packageName));
}
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
index 91f14de..bebe6ed 100644
--- a/services/core/java/com/android/server/lights/LightsService.java
+++ b/services/core/java/com/android/server/lights/LightsService.java
@@ -293,7 +293,7 @@
+ ": brightness=" + brightness);
return;
}
- int brightnessInt = BrightnessSynchronizer.brightnessFloatToInt(brightness);
+ int brightnessInt = BrightnessSynchronizer.brightnessFloatToInt(brightness, null);
int color = brightnessInt & 0x000000ff;
color = 0xff000000 | (color << 16) | (color << 8) | color;
setLightLocked(color, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
diff --git a/services/core/java/com/android/server/media/MediaSessionService.java b/services/core/java/com/android/server/media/MediaSessionService.java
index 491cd18..9aaa577 100644
--- a/services/core/java/com/android/server/media/MediaSessionService.java
+++ b/services/core/java/com/android/server/media/MediaSessionService.java
@@ -1302,6 +1302,10 @@
@Override
public void addSessionsListener(IActiveSessionsListener listener,
ComponentName componentName, int userId) throws RemoteException {
+ if (listener == null) {
+ Log.w(TAG, "addSessionsListener: listener is null, ignoring");
+ return;
+ }
final int pid = Binder.getCallingPid();
final int uid = Binder.getCallingUid();
final long token = Binder.clearCallingIdentity();
@@ -1348,6 +1352,10 @@
@Override
public void addSession2TokensListener(ISession2TokensListener listener,
int userId) {
+ if (listener == null) {
+ Log.w(TAG, "addSession2TokensListener: listener is null, ignoring");
+ return;
+ }
final int pid = Binder.getCallingPid();
final int uid = Binder.getCallingUid();
final long token = Binder.clearCallingIdentity();
@@ -1358,7 +1366,8 @@
synchronized (mLock) {
int index = findIndexOfSession2TokensListenerLocked(listener);
if (index >= 0) {
- Log.w(TAG, "addSession2TokensListener is already added, ignoring");
+ Log.w(TAG, "addSession2TokensListener: "
+ + "listener is already added, ignoring");
return;
}
mSession2TokensListenerRecords.add(
@@ -1515,6 +1524,10 @@
@Override
public void addOnMediaKeyEventDispatchedListener(
final IOnMediaKeyEventDispatchedListener listener) {
+ if (listener == null) {
+ Log.w(TAG, "addOnMediaKeyEventDispatchedListener: listener is null, ignoring");
+ return;
+ }
final int pid = Binder.getCallingPid();
final int uid = Binder.getCallingUid();
final int userId = UserHandle.getUserHandleForUid(uid).getIdentifier();
@@ -1543,6 +1556,10 @@
@Override
public void removeOnMediaKeyEventDispatchedListener(
final IOnMediaKeyEventDispatchedListener listener) {
+ if (listener == null) {
+ Log.w(TAG, "removeOnMediaKeyEventDispatchedListener: listener is null, ignoring");
+ return;
+ }
final int pid = Binder.getCallingPid();
final int uid = Binder.getCallingUid();
final int userId = UserHandle.getUserHandleForUid(uid).getIdentifier();
@@ -1571,6 +1588,10 @@
@Override
public void addOnMediaKeyEventSessionChangedListener(
final IOnMediaKeyEventSessionChangedListener listener) {
+ if (listener == null) {
+ Log.w(TAG, "addOnMediaKeyEventSessionChangedListener: lister is null, ignoring");
+ return;
+ }
final int pid = Binder.getCallingPid();
final int uid = Binder.getCallingUid();
final int userId = UserHandle.getUserHandleForUid(uid).getIdentifier();
@@ -1599,6 +1620,10 @@
@Override
public void removeOnMediaKeyEventSessionChangedListener(
final IOnMediaKeyEventSessionChangedListener listener) {
+ if (listener == null) {
+ Log.w(TAG, "removeOnMediaKeyEventSessionChangedListener: lister is null, ignoring");
+ return;
+ }
final int pid = Binder.getCallingPid();
final int uid = Binder.getCallingUid();
final int userId = UserHandle.getUserHandleForUid(uid).getIdentifier();
diff --git a/services/core/java/com/android/server/pm/InstantAppRegistry.java b/services/core/java/com/android/server/pm/InstantAppRegistry.java
index affacbb..d4ebbe3 100644
--- a/services/core/java/com/android/server/pm/InstantAppRegistry.java
+++ b/services/core/java/com/android/server/pm/InstantAppRegistry.java
@@ -23,6 +23,7 @@
import android.content.pm.ApplicationInfo;
import android.content.pm.InstantAppInfo;
import android.content.pm.PackageManager;
+import android.content.pm.PackageManagerInternal;
import android.content.pm.PermissionInfo;
import android.content.pm.SigningDetails;
import android.graphics.Bitmap;
@@ -123,6 +124,7 @@
private final PackageManagerService mService;
private final PermissionManagerServiceInternal mPermissionManager;
private final CookiePersistence mCookiePersistence;
+ private final PackageManagerInternal mPmInternal;
/** State for uninstalled instant apps */
@Watched
@@ -191,9 +193,11 @@
}
public InstantAppRegistry(PackageManagerService service,
- PermissionManagerServiceInternal permissionManager) {
+ PermissionManagerServiceInternal permissionManager,
+ PackageManagerInternal pmInternal) {
mService = service;
mPermissionManager = permissionManager;
+ mPmInternal = pmInternal;
mCookiePersistence = new CookiePersistence(BackgroundThread.getHandler().getLooper());
mUninstalledInstantApps = new WatchedSparseArray<List<UninstalledInstantAppState>>();
@@ -214,6 +218,7 @@
private InstantAppRegistry(InstantAppRegistry r) {
mService = r.mService;
mPermissionManager = r.mPermissionManager;
+ mPmInternal = r.mPmInternal;
mCookiePersistence = null;
mUninstalledInstantApps = new WatchedSparseArray<List<UninstalledInstantAppState>>(
@@ -366,7 +371,7 @@
@GuardedBy("mService.mLock")
public void onPackageInstalledLPw(@NonNull AndroidPackage pkg, @NonNull int[] userIds) {
- PackageSetting ps = mService.getPackageSetting(pkg.getPackageName());
+ PackageSetting ps = mPmInternal.getPackageSetting(pkg.getPackageName());
if (ps == null) {
return;
}
@@ -784,7 +789,7 @@
final int packageCount = mService.mPackages.size();
for (int i = 0; i < packageCount; i++) {
final AndroidPackage pkg = mService.mPackages.valueAt(i);
- final PackageSetting ps = mService.getPackageSetting(pkg.getPackageName());
+ final PackageSetting ps = mPmInternal.getPackageSetting(pkg.getPackageName());
if (ps == null) {
continue;
}
@@ -824,13 +829,13 @@
} else if (rhsPkg == null) {
return 1;
} else {
- final PackageSetting lhsPs = mService.getPackageSetting(
+ final PackageSetting lhsPs = mPmInternal.getPackageSetting(
lhsPkg.getPackageName());
if (lhsPs == null) {
return 0;
}
- final PackageSetting rhsPs = mService.getPackageSetting(
+ final PackageSetting rhsPs = mPmInternal.getPackageSetting(
rhsPkg.getPackageName());
if (rhsPs == null) {
return 0;
@@ -918,7 +923,7 @@
final int packageCount = mService.mPackages.size();
for (int i = 0; i < packageCount; i++) {
final AndroidPackage pkg = mService.mPackages.valueAt(i);
- final PackageSetting ps = mService.getPackageSetting(pkg.getPackageName());
+ final PackageSetting ps = mPmInternal.getPackageSetting(pkg.getPackageName());
if (ps == null || !ps.getInstantApp(userId)) {
continue;
}
@@ -940,7 +945,7 @@
InstantAppInfo createInstantAppInfoForPackage(
@NonNull AndroidPackage pkg, @UserIdInt int userId,
boolean addApplicationInfo) {
- PackageSetting ps = mService.getPackageSetting(pkg.getPackageName());
+ PackageSetting ps = mPmInternal.getPackageSetting(pkg.getPackageName());
if (ps == null) {
return null;
}
diff --git a/services/core/java/com/android/server/pm/OtaDexoptService.java b/services/core/java/com/android/server/pm/OtaDexoptService.java
index d6400f3..f968daf 100644
--- a/services/core/java/com/android/server/pm/OtaDexoptService.java
+++ b/services/core/java/com/android/server/pm/OtaDexoptService.java
@@ -23,6 +23,7 @@
import android.annotation.Nullable;
import android.content.Context;
import android.content.pm.IOtaDexopt;
+import android.content.pm.PackageManagerInternal;
import android.os.Environment;
import android.os.RemoteException;
import android.os.ResultReceiver;
@@ -33,6 +34,7 @@
import android.util.Slog;
import com.android.internal.logging.MetricsLogger;
+import com.android.server.LocalServices;
import com.android.server.pm.Installer.InstallerException;
import com.android.server.pm.dex.DexoptOptions;
import com.android.server.pm.parsing.pkg.AndroidPackage;
@@ -41,7 +43,6 @@
import java.io.File;
import java.io.FileDescriptor;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -371,8 +372,10 @@
return;
}
- // Look into all packages.
- Collection<AndroidPackage> pkgs = mPackageManagerService.getPackages();
+ // Make a copy of all packages and look into each package.
+ final PackageManagerInternal pmInt = LocalServices.getService(PackageManagerInternal.class);
+ final ArrayList<AndroidPackage> pkgs = new ArrayList<>();
+ pmInt.forEachPackage(pkgs::add);
int packagePaths = 0;
int pathsSuccessful = 0;
for (AndroidPackage pkg : pkgs) {
@@ -398,7 +401,7 @@
continue;
}
- PackageSetting pkgSetting = mPackageManagerService.getPackageSetting(pkg.getPackageName());
+ PackageSetting pkgSetting = pmInt.getPackageSetting(pkg.getPackageName());
final String[] instructionSets = getAppDexInstructionSets(
AndroidPackageUtils.getPrimaryCpuAbi(pkg, pkgSetting),
AndroidPackageUtils.getSecondaryCpuAbi(pkg, pkgSetting));
diff --git a/services/core/java/com/android/server/pm/PackageInstallerSession.java b/services/core/java/com/android/server/pm/PackageInstallerSession.java
index bf21d0f..ed6823f 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerSession.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerSession.java
@@ -2212,7 +2212,6 @@
@Override
public void transfer(String packageName) {
Preconditions.checkArgument(!TextUtils.isEmpty(packageName));
-
ApplicationInfo newOwnerAppInfo = mPm.getApplicationInfo(packageName, 0, userId);
if (newOwnerAppInfo == null) {
throw new ParcelableException(new PackageManager.NameNotFoundException(packageName));
@@ -2332,12 +2331,29 @@
(params.installFlags & PackageManager.INSTALL_DISABLE_ALLOWED_APEX_UPDATE_CHECK)
== 0;
synchronized (mLock) {
- if (checkApexUpdateAllowed && !isApexUpdateAllowed(mPackageName)) {
+ if (checkApexUpdateAllowed && !isApexUpdateAllowed(mPackageName,
+ mInstallSource.installerPackageName)) {
onSessionValidationFailure(PackageManager.INSTALL_FAILED_VERIFICATION_FAILURE,
- "Update of APEX package " + mPackageName + " is not allowed");
+ "Update of APEX package " + mPackageName + " is not allowed for "
+ + mInstallSource.installerPackageName);
return;
}
}
+
+ if (!params.isStaged) {
+ // For non-staged APEX installs also check if there is a staged session that
+ // contains the same APEX. If that's the case, we should fail this session.
+ synchronized (mLock) {
+ int sessionId = mStagingManager.getSessionIdByPackageName(mPackageName);
+ if (sessionId != -1) {
+ onSessionValidationFailure(
+ PackageManager.INSTALL_FAILED_VERIFICATION_FAILURE,
+ "Staged session " + sessionId + " already contains "
+ + mPackageName);
+ return;
+ }
+ }
+ }
}
if (params.isStaged) {
@@ -2762,7 +2778,8 @@
}
private long getApksSize(String packageName) {
- final PackageSetting ps = mPm.getPackageSetting(packageName);
+ final PackageManagerInternal pmi = LocalServices.getService(PackageManagerInternal.class);
+ final PackageSetting ps = pmi.getPackageSetting(packageName);
if (ps == null) {
return 0;
}
@@ -2824,9 +2841,23 @@
return sessionContains((s) -> !s.isApexSession());
}
- private boolean isApexUpdateAllowed(String apexPackageName) {
- return mPm.getModuleInfo(apexPackageName, 0) != null
- || SystemConfig.getInstance().getAllowedVendorApexes().contains(apexPackageName);
+ private boolean isApexUpdateAllowed(String apexPackageName, String installerPackageName) {
+ if (mPm.getModuleInfo(apexPackageName, 0) != null) {
+ final String modulesInstaller =
+ SystemConfig.getInstance().getModulesInstallerPackageName();
+ if (modulesInstaller == null) {
+ Slog.w(TAG, "No modules installer defined");
+ return false;
+ }
+ return modulesInstaller.equals(installerPackageName);
+ }
+ final String vendorApexInstaller =
+ SystemConfig.getInstance().getAllowedVendorApexes().get(apexPackageName);
+ if (vendorApexInstaller == null) {
+ Slog.w(TAG, apexPackageName + " is not allowed to be updated");
+ return false;
+ }
+ return vendorApexInstaller.equals(installerPackageName);
}
/**
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 31f9dea..4fa602f 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -7184,7 +7184,7 @@
}
}
- mInstantAppRegistry = new InstantAppRegistry(this, mPermissionManager);
+ mInstantAppRegistry = new InstantAppRegistry(this, mPermissionManager, mPmInternal);
mDirsToScanAsSystem = new ArrayList<>();
mDirsToScanAsSystem.addAll(injector.getSystemPartitions());
@@ -10060,24 +10060,26 @@
@Override
public int getUidForSharedUser(String sharedUserName) {
- if (getInstantAppPackageName(Binder.getCallingUid()) != null) {
- return -1;
- }
if (sharedUserName == null) {
- return -1;
+ return Process.INVALID_UID;
+ }
+ final int callingUid = Binder.getCallingUid();
+ if (getInstantAppPackageName(callingUid) != null) {
+ return Process.INVALID_UID;
}
// reader
synchronized (mLock) {
- SharedUserSetting suid;
try {
- suid = mSettings.getSharedUserLPw(sharedUserName, 0, 0, false);
- if (suid != null) {
+ final SharedUserSetting suid = mSettings.getSharedUserLPw(sharedUserName,
+ 0 /* pkgFlags */, 0 /* pkgPrivateFlags */, false /* create */);
+ if (suid != null && !shouldFilterApplicationLocked(suid, callingUid,
+ UserHandle.getUserId(callingUid))) {
return suid.userId;
}
} catch (PackageManagerException ignore) {
// can't happen, but, still need to catch it
}
- return -1;
+ return Process.INVALID_UID;
}
}
@@ -18836,12 +18838,12 @@
// Reflect the rename in scanned details
try {
- parsedPackage.setCodePath(afterCodeFile.getCanonicalPath());
+ parsedPackage.setPath(afterCodeFile.getCanonicalPath());
} catch (IOException e) {
Slog.e(TAG, "Failed to get path: " + afterCodeFile, e);
return false;
}
- parsedPackage.setBaseCodePath(FileUtils.rewriteAfterRename(beforeCodeFile,
+ parsedPackage.setBaseApkPath(FileUtils.rewriteAfterRename(beforeCodeFile,
afterCodeFile, parsedPackage.getBaseApkPath()));
parsedPackage.setSplitCodePaths(FileUtils.rewriteAfterRename(beforeCodeFile,
afterCodeFile, parsedPackage.getSplitCodePaths()));
@@ -28437,7 +28439,8 @@
}
@Nullable
- public PackageSetting getPackageSetting(String packageName) {
+ @VisibleForTesting(visibility = Visibility.PRIVATE)
+ PackageSetting getPackageSetting(String packageName) {
return mComputer.getPackageSetting(packageName);
}
@@ -28476,16 +28479,6 @@
}
/**
- * Return a <b>copy</b> of the collection of packages known to the package manager.
- * @return A copy of the values of mPackages.
- */
- Collection<AndroidPackage> getPackages() {
- synchronized (mLock) {
- return new ArrayList<>(mPackages.values());
- }
- }
-
- /**
* Logs process start information (including base APK hash) to the security log.
* @hide
*/
diff --git a/services/core/java/com/android/server/pm/StagingManager.java b/services/core/java/com/android/server/pm/StagingManager.java
index bbb92e8..9dcae3d 100644
--- a/services/core/java/com/android/server/pm/StagingManager.java
+++ b/services/core/java/com/android/server/pm/StagingManager.java
@@ -749,6 +749,26 @@
}
}
+ /**
+ * Returns id of a committed and non-finalized stated session that contains same
+ * {@code packageName}, or {@code -1} if no sessions have this {@code packageName} staged.
+ */
+ int getSessionIdByPackageName(@NonNull String packageName) {
+ synchronized (mStagedSessions) {
+ for (int i = 0; i < mStagedSessions.size(); i++) {
+ StagedSession stagedSession = mStagedSessions.valueAt(i);
+ if (!stagedSession.isCommitted() || stagedSession.isDestroyed()
+ || stagedSession.isInTerminalState()) {
+ continue;
+ }
+ if (stagedSession.getPackageName().equals(packageName)) {
+ return stagedSession.sessionId();
+ }
+ }
+ }
+ return -1;
+ }
+
@VisibleForTesting
void createSession(@NonNull StagedSession sessionInfo) {
synchronized (mStagedSessions) {
diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java
index 190e7bc..0d909a9 100644
--- a/services/core/java/com/android/server/pm/UserManagerService.java
+++ b/services/core/java/com/android/server/pm/UserManagerService.java
@@ -2357,6 +2357,9 @@
* {@link #canAddMoreProfilesToUser}.
*/
private boolean canAddMoreUsersOfType(UserTypeDetails userTypeDetails) {
+ if (!userTypeDetails.isEnabled()) {
+ return false;
+ }
final int max = userTypeDetails.getMaxAllowed();
if (max == UserTypeDetails.UNLIMITED_NUMBER_OF_USERS) {
return true; // Indicates that there is no max.
@@ -2397,7 +2400,7 @@
boolean allowedToRemoveOne) {
checkManageUsersPermission("check if more profiles can be added.");
final UserTypeDetails type = mUserTypes.get(userType);
- if (type == null) {
+ if (type == null || !type.isEnabled()) {
return false;
}
// Managed profiles have their own specific rules.
@@ -3553,6 +3556,12 @@
+ ") indicated SYSTEM user, which cannot be created.");
return null;
}
+ if (!userTypeDetails.isEnabled()) {
+ throwCheckedUserOperationException(
+ "Cannot add a user of disabled type " + userType + ".",
+ UserManager.USER_OPERATION_ERROR_MAX_USERS);
+ }
+
synchronized (mUsersLock) {
if (mForceEphemeralUsers) {
flags |= UserInfo.FLAG_EPHEMERAL;
diff --git a/services/core/java/com/android/server/pm/UserTypeDetails.java b/services/core/java/com/android/server/pm/UserTypeDetails.java
index 92ec31b..24dab9e 100644
--- a/services/core/java/com/android/server/pm/UserTypeDetails.java
+++ b/services/core/java/com/android/server/pm/UserTypeDetails.java
@@ -50,7 +50,7 @@
/** Name of the user type, such as {@link UserManager#USER_TYPE_PROFILE_MANAGED}. */
private final @NonNull String mName;
- // TODO(b/142482943): Currently unused. Hook this up.
+ /** Whether users of this type can be created. */
private final boolean mEnabled;
// TODO(b/142482943): Currently unused and not set. Hook this up.
@@ -195,7 +195,10 @@
return mName;
}
- // TODO(b/142482943) Hook this up or delete it.
+ /**
+ * Returns whether this user type is enabled.
+ * If it is not enabled, all future attempts to create users of this type will be rejected.
+ */
public boolean isEnabled() {
return mEnabled;
}
@@ -390,7 +393,7 @@
private @Nullable Bundle mDefaultSecureSettings = null;
private @Nullable List<DefaultCrossProfileIntentFilter> mDefaultCrossProfileIntentFilters =
null;
- private boolean mEnabled = true;
+ private int mEnabled = 1;
private int mLabel = Resources.ID_NULL;
private @Nullable int[] mBadgeLabels = null;
private @Nullable int[] mBadgeColors = null;
@@ -405,7 +408,7 @@
return this;
}
- public Builder setEnabled(boolean enabled) {
+ public Builder setEnabled(int enabled) {
mEnabled = enabled;
return this;
}
@@ -522,12 +525,25 @@
"UserTypeDetails %s has a non empty "
+ "defaultCrossProfileIntentFilters", mName);
}
- return new UserTypeDetails(mName, mEnabled, mMaxAllowed, mBaseType,
- mDefaultUserInfoPropertyFlags, mLabel, mMaxAllowedPerParent,
- mIconBadge, mBadgePlain, mBadgeNoBackground, mBadgeLabels, mBadgeColors,
+ return new UserTypeDetails(
+ mName,
+ mEnabled != 0,
+ mMaxAllowed,
+ mBaseType,
+ mDefaultUserInfoPropertyFlags,
+ mLabel,
+ mMaxAllowedPerParent,
+ mIconBadge,
+ mBadgePlain,
+ mBadgeNoBackground,
+ mBadgeLabels,
+ mBadgeColors,
mDarkThemeBadgeColors == null ? mBadgeColors : mDarkThemeBadgeColors,
- mDefaultRestrictions, mDefaultSystemSettings, mDefaultSecureSettings,
- mDefaultCrossProfileIntentFilters, mIsMediaSharedWithParent);
+ mDefaultRestrictions,
+ mDefaultSystemSettings,
+ mDefaultSecureSettings,
+ mDefaultCrossProfileIntentFilters,
+ mIsMediaSharedWithParent);
}
private boolean hasBadge() {
diff --git a/services/core/java/com/android/server/pm/UserTypeFactory.java b/services/core/java/com/android/server/pm/UserTypeFactory.java
index 30cb40c..5fcb843 100644
--- a/services/core/java/com/android/server/pm/UserTypeFactory.java
+++ b/services/core/java/com/android/server/pm/UserTypeFactory.java
@@ -376,6 +376,8 @@
setResAttribute(parser, "badge-no-background", builder::setBadgeNoBackground);
}
+ setIntAttribute(parser, "enabled", builder::setEnabled);
+
// Process child elements.
final int depth = parser.getDepth();
while (XmlUtils.nextElementWithin(parser, depth)) {
diff --git a/services/core/java/com/android/server/pm/parsing/pkg/PackageImpl.java b/services/core/java/com/android/server/pm/parsing/pkg/PackageImpl.java
index 2234022..3eb4bde 100644
--- a/services/core/java/com/android/server/pm/parsing/pkg/PackageImpl.java
+++ b/services/core/java/com/android/server/pm/parsing/pkg/PackageImpl.java
@@ -306,8 +306,8 @@
}
@Override
- public PackageImpl setCodePath(@NonNull String value) {
- this.mPath = value;
+ public PackageImpl setPath(@NonNull String path) {
+ this.mPath = path;
return this;
}
@@ -381,8 +381,8 @@
}
@Override
- public PackageImpl setBaseCodePath(@NonNull String baseCodePath) {
- this.mBaseApkPath = TextUtils.safeIntern(baseCodePath);
+ public PackageImpl setBaseApkPath(@NonNull String baseApkPath) {
+ this.mBaseApkPath = TextUtils.safeIntern(baseApkPath);
return this;
}
diff --git a/services/core/java/com/android/server/pm/parsing/pkg/ParsedPackage.java b/services/core/java/com/android/server/pm/parsing/pkg/ParsedPackage.java
index 8e4ee6a..0051bab 100644
--- a/services/core/java/com/android/server/pm/parsing/pkg/ParsedPackage.java
+++ b/services/core/java/com/android/server/pm/parsing/pkg/ParsedPackage.java
@@ -43,9 +43,9 @@
ParsedPackage clearProtectedBroadcasts();
- ParsedPackage setBaseCodePath(String baseCodePath);
+ ParsedPackage setBaseApkPath(String baseApkPath);
- ParsedPackage setCodePath(String codePath);
+ ParsedPackage setPath(String path);
ParsedPackage setNativeLibraryDir(String nativeLibraryDir);
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
index 56e6f9b..fbe14ce 100644
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
@@ -3385,7 +3385,7 @@
boolean allowed = false;
for (int i = 0, size = CompatibilityPermissionInfo.COMPAT_PERMS.length; i < size; i++) {
final CompatibilityPermissionInfo info = CompatibilityPermissionInfo.COMPAT_PERMS[i];
- if (info.name.equals(perm)
+ if (info.getName().equals(perm)
&& pkg.getTargetSdkVersion() < info.sdkVersion) {
allowed = true;
Log.i(TAG, "Auto-granting " + perm + " to old pkg "
diff --git a/services/core/java/com/android/server/vcn/VcnGatewayConnection.java b/services/core/java/com/android/server/vcn/VcnGatewayConnection.java
index 3c0a05b..450257f 100644
--- a/services/core/java/com/android/server/vcn/VcnGatewayConnection.java
+++ b/services/core/java/com/android/server/vcn/VcnGatewayConnection.java
@@ -195,6 +195,7 @@
@VisibleForTesting(visibility = Visibility.PRIVATE)
static final int SAFEMODE_TIMEOUT_SECONDS = 30;
+ private static final int SAFEMODE_TIMEOUT_SECONDS_TEST_MODE = 10;
private interface EventInfo {}
@@ -1082,7 +1083,9 @@
createScheduledAlarm(
SAFEMODE_TIMEOUT_ALARM,
delayedMessage,
- TimeUnit.SECONDS.toMillis(SAFEMODE_TIMEOUT_SECONDS));
+ mVcnContext.isInTestMode()
+ ? TimeUnit.SECONDS.toMillis(SAFEMODE_TIMEOUT_SECONDS_TEST_MODE)
+ : TimeUnit.SECONDS.toMillis(SAFEMODE_TIMEOUT_SECONDS));
}
private void cancelSafeModeAlarm() {
diff --git a/services/core/java/com/android/server/wm/ActivityClientController.java b/services/core/java/com/android/server/wm/ActivityClientController.java
index 1f5ff25..331b8de 100644
--- a/services/core/java/com/android/server/wm/ActivityClientController.java
+++ b/services/core/java/com/android/server/wm/ActivityClientController.java
@@ -1183,7 +1183,7 @@
try {
final Intent baseActivityIntent;
final boolean launchedFromHome;
-
+ final boolean isLastRunningActivity;
synchronized (mGlobalLock) {
final ActivityRecord r = ActivityRecord.isInRootTaskLocked(token);
if (r == null) return;
@@ -1195,7 +1195,9 @@
return;
}
- final Intent baseIntent = r.getTask().getBaseIntent();
+ final Task task = r.getTask();
+ isLastRunningActivity = task.topRunningActivity() == r;
+ final Intent baseIntent = task.getBaseIntent();
final boolean activityIsBaseActivity = baseIntent != null
&& r.mActivityComponent.equals(baseIntent.getComponent());
baseActivityIntent = activityIsBaseActivity ? r.intent : null;
@@ -1205,12 +1207,13 @@
// If the activity is one of the main entry points for the application, then we should
// refrain from finishing the activity and instead move it to the back to keep it in
// memory. The requirements for this are:
- // 1. The current activity is the base activity for the task.
- // 2. a. If the activity was launched by the home process, we trust that its intent
+ // 1. The activity is the last running activity in the task.
+ // 2. The current activity is the base activity for the task.
+ // 3. a. If the activity was launched by the home process, we trust that its intent
// was resolved, so we check if the it is a main intent for the application.
// b. Otherwise, we query Package Manager to verify whether the activity is a
// launcher activity for the application.
- if (baseActivityIntent != null
+ if (baseActivityIntent != null && isLastRunningActivity
&& ((launchedFromHome && ActivityRecord.isMainIntent(baseActivityIntent))
|| isLauncherActivity(baseActivityIntent.getComponent()))) {
moveActivityTaskToBack(token, false /* nonRoot */);
diff --git a/services/core/java/com/android/server/wm/ActivityMetricsLogger.java b/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
index b1163c4..005a62a 100644
--- a/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
+++ b/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
@@ -936,9 +936,11 @@
// This will avoid any races with other operations that modify the ActivityRecord.
final TransitionInfoSnapshot infoSnapshot = new TransitionInfoSnapshot(info);
if (info.isInterestingToLoggerAndObserver()) {
+ final long timestamp = info.mTransitionStartTimeNs;
+ final long uptime = info.mTransitionDeviceUptimeMs;
+ final int transitionDelay = info.mCurrentTransitionDelayMs;
mLoggerHandler.post(() -> logAppTransition(
- info.mTransitionDeviceUptimeMs, info.mCurrentTransitionDelayMs,
- infoSnapshot, isHibernating));
+ timestamp, uptime, transitionDelay, infoSnapshot, isHibernating));
}
mLoggerHandler.post(() -> logAppDisplayed(infoSnapshot));
if (info.mPendingFullyDrawn != null) {
@@ -949,8 +951,8 @@
}
// This gets called on another thread without holding the activity manager lock.
- private void logAppTransition(long transitionDeviceUptimeMs, int currentTransitionDelayMs,
- TransitionInfoSnapshot info, boolean isHibernating) {
+ private void logAppTransition(long transitionStartTimeNs, long transitionDeviceUptimeMs,
+ int currentTransitionDelayMs, TransitionInfoSnapshot info, boolean isHibernating) {
final LogMaker builder = new LogMaker(APP_TRANSITION);
builder.setPackageName(info.packageName);
builder.setType(info.type);
@@ -1001,7 +1003,7 @@
info.launchedActivityName,
info.launchedActivityLaunchedFromPackage,
isInstantApp,
- transitionDeviceUptimeMs,
+ 0 /* deprecated transitionDeviceUptimeMs */,
info.reason,
currentTransitionDelayMs,
info.startingWindowDelayMs,
@@ -1015,7 +1017,8 @@
isHibernating,
isIncremental,
isLoading,
- info.launchedActivityName.hashCode());
+ info.launchedActivityName.hashCode(),
+ TimeUnit.NANOSECONDS.toMillis(transitionStartTimeNs));
if (DEBUG_METRICS) {
Slog.i(TAG, String.format("APP_START_OCCURRED(%s, %s, %s, %s, %s)",
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index f3daf07..6e492d1 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -3446,6 +3446,10 @@
return;
}
finishing = true;
+ final TaskFragment taskFragment = getTaskFragment();
+ if (taskFragment != null) {
+ taskFragment.sendTaskFragmentInfoChanged();
+ }
if (stopped) {
abortAndClearOptionsAnimation();
}
@@ -5152,6 +5156,12 @@
void notifyAppStopped() {
ProtoLog.v(WM_DEBUG_ADD_REMOVE, "notifyAppStopped: %s", this);
mAppStopped = true;
+ // This is to fix the edge case that auto-enter-pip is finished in Launcher but app calls
+ // setAutoEnterEnabled(false) and transitions to STOPPED state, see b/191930787.
+ // Clear any surface transactions and content overlay in this case.
+ if (task != null && task.mLastRecentsAnimationTransaction != null) {
+ task.clearLastRecentsAnimationTransaction(true /* forceRemoveOverlay */);
+ }
// Reset the last saved PiP snap fraction on app stop.
mDisplayContent.mPinnedTaskController.onActivityHidden(mActivityComponent);
mDisplayContent.mUnknownAppVisibilityController.appRemovedOrHidden(this);
diff --git a/services/core/java/com/android/server/wm/ActivityStartController.java b/services/core/java/com/android/server/wm/ActivityStartController.java
index c3cd61a..b71ad2e 100644
--- a/services/core/java/com/android/server/wm/ActivityStartController.java
+++ b/services/core/java/com/android/server/wm/ActivityStartController.java
@@ -495,13 +495,17 @@
* @param taskFragment TaskFragment {@link TaskFragment} to start the activity in.
* @param activityIntent intent to start the activity.
* @param activityOptions ActivityOptions to start the activity with.
+ * @param resultTo the caller activity
* @return the start result.
*/
int startActivityInTaskFragment(@NonNull TaskFragment taskFragment,
- @NonNull Intent activityIntent, @Nullable Bundle activityOptions) {
+ @NonNull Intent activityIntent, @Nullable Bundle activityOptions,
+ @Nullable IBinder resultTo) {
return obtainStarter(activityIntent, "startActivityInTaskFragment")
.setActivityOptions(activityOptions)
.setInTaskFragment(taskFragment)
+ .setResultTo(resultTo)
+ .setRequestCode(-1)
.setCallingUid(Binder.getCallingUid())
.setCallingPid(Binder.getCallingPid())
.execute();
diff --git a/services/core/java/com/android/server/wm/PinnedTaskController.java b/services/core/java/com/android/server/wm/PinnedTaskController.java
index 7e95e7d..4f7c9a4 100644
--- a/services/core/java/com/android/server/wm/PinnedTaskController.java
+++ b/services/core/java/com/android/server/wm/PinnedTaskController.java
@@ -211,7 +211,9 @@
}
mFreezingTaskConfig = true;
mDestRotatedBounds = new Rect(bounds);
- continueOrientationChange();
+ if (!mService.mAtmService.getTransitionController().isShellTransitionsEnabled()) {
+ continueOrientationChange();
+ }
}
/**
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index 629d20e..24c5c82 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -2157,7 +2157,7 @@
rootTask.setLastRecentsAnimationTransaction(
task.mLastRecentsAnimationTransaction,
task.mLastRecentsAnimationOverlay);
- task.clearLastRecentsAnimationTransaction();
+ task.clearLastRecentsAnimationTransaction(false /* forceRemoveOverlay */);
}
// There are multiple activities in the task and moving the top activity should
@@ -2212,16 +2212,17 @@
ensureActivitiesVisible(null, 0, false /* preserveWindows */);
resumeFocusedTasksTopActivities();
- notifyActivityPipModeChanged(r);
+ notifyActivityPipModeChanged(r.getTask(), r);
}
/**
* Notifies when an activity enters or leaves PIP mode.
*
+ * @param task the task of {@param r}
* @param r indicates the activity currently in PIP, can be null to indicate no activity is
* currently in PIP mode.
*/
- void notifyActivityPipModeChanged(@Nullable ActivityRecord r) {
+ void notifyActivityPipModeChanged(@NonNull Task task, @Nullable ActivityRecord r) {
final boolean inPip = r != null;
if (inPip) {
mService.getTaskChangeNotificationController().notifyActivityPinned(r);
@@ -2229,6 +2230,9 @@
mService.getTaskChangeNotificationController().notifyActivityUnpinned();
}
mWindowManager.mPolicy.setPipVisibilityLw(inPip);
+ mWmService.mTransactionFactory.get()
+ .setTrustedOverlay(task.getSurfaceControl(), inPip)
+ .apply();
}
void executeAppTransitionForAllDisplay() {
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 5ffe7b6..8ba332b 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -1203,7 +1203,7 @@
&& (newParent == null || !newParent.inPinnedWindowingMode())) {
// Notify if a task from the root pinned task is being removed
// (or moved depending on the mode).
- mRootWindowContainer.notifyActivityPipModeChanged(null);
+ mRootWindowContainer.notifyActivityPipModeChanged(this, null);
}
}
@@ -3527,7 +3527,9 @@
StartingWindowInfo getStartingWindowInfo(ActivityRecord activity) {
final StartingWindowInfo info = new StartingWindowInfo();
info.taskInfo = getTaskInfo();
-
+ info.targetActivityInfo = info.taskInfo.topActivityInfo != null
+ && activity.info != info.taskInfo.topActivityInfo
+ ? activity.info : null;
info.isKeyguardOccluded =
mAtmService.mKeyguardController.isDisplayOccluded(DEFAULT_DISPLAY);
@@ -4576,7 +4578,7 @@
: WINDOWING_MODE_FULLSCREEN;
}
if (currentMode == WINDOWING_MODE_PINNED) {
- mRootWindowContainer.notifyActivityPipModeChanged(null);
+ mRootWindowContainer.notifyActivityPipModeChanged(this, null);
}
if (likelyResolvedMode == WINDOWING_MODE_PINNED) {
// In the case that we've disabled affecting the SysUI flags as a part of seamlessly
@@ -4634,7 +4636,8 @@
// From fullscreen to PiP.
if (topActivity != null && currentMode == WINDOWING_MODE_FULLSCREEN
- && windowingMode == WINDOWING_MODE_PINNED) {
+ && windowingMode == WINDOWING_MODE_PINNED
+ && !mAtmService.getTransitionController().isShellTransitionsEnabled()) {
mDisplayContent.mPinnedTaskController
.deferOrientationChangeForEnteringPipFromFullScreenIfNeeded();
}
@@ -6042,7 +6045,10 @@
mLastRecentsAnimationOverlay = overlay;
}
- void clearLastRecentsAnimationTransaction() {
+ void clearLastRecentsAnimationTransaction(boolean forceRemoveOverlay) {
+ if (forceRemoveOverlay && mLastRecentsAnimationOverlay != null) {
+ getPendingTransaction().remove(mLastRecentsAnimationOverlay);
+ }
mLastRecentsAnimationTransaction = null;
mLastRecentsAnimationOverlay = null;
// reset also the crop and transform introduced by mLastRecentsAnimationTransaction
diff --git a/services/core/java/com/android/server/wm/TaskFragment.java b/services/core/java/com/android/server/wm/TaskFragment.java
index 9159bbb..ba13546 100644
--- a/services/core/java/com/android/server/wm/TaskFragment.java
+++ b/services/core/java/com/android/server/wm/TaskFragment.java
@@ -1895,6 +1895,7 @@
mRemoteToken.toWindowContainerToken(),
getConfiguration(),
getChildCount() == 0,
+ hasRunningActivity(this),
isVisible(),
childActivities,
positionInParent);
diff --git a/services/core/java/com/android/server/wm/WindowOrganizerController.java b/services/core/java/com/android/server/wm/WindowOrganizerController.java
index e31b130..0be21cb 100644
--- a/services/core/java/com/android/server/wm/WindowOrganizerController.java
+++ b/services/core/java/com/android/server/wm/WindowOrganizerController.java
@@ -29,6 +29,7 @@
import static android.window.WindowContainerTransaction.HierarchyOp.HIERARCHY_OP_TYPE_REPARENT_ACTIVITY_TO_TASK_FRAGMENT;
import static android.window.WindowContainerTransaction.HierarchyOp.HIERARCHY_OP_TYPE_REPARENT_CHILDREN;
import static android.window.WindowContainerTransaction.HierarchyOp.HIERARCHY_OP_TYPE_SET_ADJACENT_ROOTS;
+import static android.window.WindowContainerTransaction.HierarchyOp.HIERARCHY_OP_TYPE_SET_ADJACENT_TASK_FRAGMENTS;
import static android.window.WindowContainerTransaction.HierarchyOp.HIERARCHY_OP_TYPE_SET_LAUNCH_ADJACENT_FLAG_ROOT;
import static android.window.WindowContainerTransaction.HierarchyOp.HIERARCHY_OP_TYPE_SET_LAUNCH_ROOT;
import static android.window.WindowContainerTransaction.HierarchyOp.HIERARCHY_OP_TYPE_START_ACTIVITY_IN_TASK_FRAGMENT;
@@ -683,7 +684,8 @@
final Bundle activityOptions = hop.getLaunchOptions();
final TaskFragment tf = mLaunchTaskFragments.get(fragmentToken);
final int result = mService.getActivityStartController()
- .startActivityInTaskFragment(tf, activityIntent, activityOptions);
+ .startActivityInTaskFragment(tf, activityIntent, activityOptions,
+ hop.getCallingActivity());
if (!isStartResultSuccessful(result)) {
final Throwable exception =
new ActivityNotFoundException("start activity in taskFragment failed");
@@ -714,6 +716,19 @@
}
reparentTaskFragment(oldParent, newParent, errorCallbackToken);
break;
+ case HIERARCHY_OP_TYPE_SET_ADJACENT_TASK_FRAGMENTS:
+ fragmentToken = hop.getContainer();
+ final IBinder adjacentFragmentToken = hop.getAdjacentRoot();
+ final TaskFragment tf1 = mLaunchTaskFragments.get(fragmentToken);
+ final TaskFragment tf2 = mLaunchTaskFragments.get(adjacentFragmentToken);
+ if (tf1 == null || tf2 == null) {
+ final Throwable exception = new IllegalArgumentException(
+ "Not allowed to set adjacent on invalid fragment tokens");
+ sendTaskFragmentOperationFailure(organizer, errorCallbackToken, exception);
+ break;
+ }
+ tf1.setAdjacentTaskFragment(tf2);
+ break;
}
return effects;
}
@@ -1046,9 +1061,11 @@
// valid.
case HIERARCHY_OP_TYPE_START_ACTIVITY_IN_TASK_FRAGMENT:
case HIERARCHY_OP_TYPE_REPARENT_ACTIVITY_TO_TASK_FRAGMENT:
+ case HIERARCHY_OP_TYPE_SET_ADJACENT_TASK_FRAGMENTS:
// We are allowing organizer to start/reparent activity to a TaskFragment it
- // created. Nothing to check here because the TaskFragment may not be created
- // yet, but will be created in the same transaction.
+ // created, or set two TaskFragments adjacent to each other. Nothing to check
+ // here because the TaskFragment may not be created yet, but will be created in
+ // the same transaction.
break;
case HIERARCHY_OP_TYPE_REPARENT_CHILDREN:
enforceTaskFragmentOrganized(func,
diff --git a/services/tests/PackageManagerServiceTests/appenumeration/AndroidTest.xml b/services/tests/PackageManagerServiceTests/appenumeration/AndroidTest.xml
index 7b821c0..67efa14 100644
--- a/services/tests/PackageManagerServiceTests/appenumeration/AndroidTest.xml
+++ b/services/tests/PackageManagerServiceTests/appenumeration/AndroidTest.xml
@@ -33,6 +33,7 @@
<target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
<option name="push" value="AppEnumerationSyncProviderTestApp.apk->/data/local/tmp/appenumerationtests/AppEnumerationSyncProviderTestApp.apk" />
<option name="push" value="AppEnumerationHasAppOpPermissionTestApp.apk->/data/local/tmp/appenumerationtests/AppEnumerationHasAppOpPermissionTestApp.apk" />
+ <option name="push" value="AppEnumerationSharedUserTestApp.apk->/data/local/tmp/appenumerationtests/AppEnumerationSharedUserTestApp.apk" />
</target_preparer>
<option name="test-tag" value="AppEnumerationInternalTest" />
diff --git a/services/tests/PackageManagerServiceTests/appenumeration/src/com/android/server/pm/test/appenumeration/AppEnumerationInternalTests.java b/services/tests/PackageManagerServiceTests/appenumeration/src/com/android/server/pm/test/appenumeration/AppEnumerationInternalTests.java
index 63aaf24..ab004be 100644
--- a/services/tests/PackageManagerServiceTests/appenumeration/src/com/android/server/pm/test/appenumeration/AppEnumerationInternalTests.java
+++ b/services/tests/PackageManagerServiceTests/appenumeration/src/com/android/server/pm/test/appenumeration/AppEnumerationInternalTests.java
@@ -23,6 +23,7 @@
import android.app.AppGlobals;
import android.content.pm.IPackageManager;
import android.content.pm.ProviderInfo;
+import android.os.Process;
import androidx.test.runner.AndroidJUnit4;
@@ -45,14 +46,18 @@
TEST_DATA_PATH + "AppEnumerationSyncProviderTestApp.apk";
private static final String HAS_APPOP_PERMISSION_APK_PATH =
TEST_DATA_PATH + "AppEnumerationHasAppOpPermissionTestApp.apk";
+ private static final String SHARED_USER_APK_PATH =
+ TEST_DATA_PATH + "AppEnumerationSharedUserTestApp.apk";
private static final String TARGET_SYNC_PROVIDER = "com.android.appenumeration.syncprovider";
private static final String TARGET_HAS_APPOP_PERMISSION =
"com.android.appenumeration.hasappoppermission";
+ private static final String TARGET_SHARED_USER = "com.android.appenumeration.shareduid";
private static final String SYNC_PROVIDER_AUTHORITY = TARGET_SYNC_PROVIDER;
private static final String PERMISSION_REQUEST_INSTALL_PACKAGES =
"android.permission.REQUEST_INSTALL_PACKAGES";
+ private static final String SHARED_USER_NAME = "com.android.appenumeration.shareduid";
private IPackageManager mIPackageManager;
@@ -65,6 +70,7 @@
public void tearDown() throws Exception {
uninstallPackage(TARGET_SYNC_PROVIDER);
uninstallPackage(TARGET_HAS_APPOP_PERMISSION);
+ uninstallPackage(TARGET_SHARED_USER);
}
@Test
@@ -111,6 +117,22 @@
assertThat(packageNames).asList().doesNotContain(TARGET_HAS_APPOP_PERMISSION);
}
+ @Test
+ public void getUidForSharedUser_canSeeForceQueryable() throws Exception {
+ installPackage(SHARED_USER_APK_PATH, true /* forceQueryable */);
+
+ final int uid = mIPackageManager.getUidForSharedUser(SHARED_USER_NAME);
+ assertThat(uid).isGreaterThan(Process.FIRST_APPLICATION_UID);
+ }
+
+ @Test
+ public void getUidForSharedUser_cannotSeeSharedUser() throws Exception {
+ installPackage(SHARED_USER_APK_PATH, false /* forceQueryable */);
+
+ final int uid = mIPackageManager.getUidForSharedUser(SHARED_USER_NAME);
+ assertThat(uid).isEqualTo(Process.INVALID_UID);
+ }
+
private static void installPackage(String apkPath, boolean forceQueryable) {
final StringBuilder cmd = new StringBuilder("pm install ");
if (forceQueryable) {
diff --git a/services/tests/PackageManagerServiceTests/appenumeration/test-apps/target/Android.bp b/services/tests/PackageManagerServiceTests/appenumeration/test-apps/target/Android.bp
index 7aa300b..e0f8327 100644
--- a/services/tests/PackageManagerServiceTests/appenumeration/test-apps/target/Android.bp
+++ b/services/tests/PackageManagerServiceTests/appenumeration/test-apps/target/Android.bp
@@ -48,3 +48,17 @@
test_suites: ["device-tests"],
platform_apis: true,
}
+
+android_test_helper_app {
+ name: "AppEnumerationSharedUserTestApp",
+ srcs: ["src/**/*.java"],
+ manifest: "AndroidManifest-sharedUser.xml",
+ dex_preopt: {
+ enabled: false,
+ },
+ optimize: {
+ enabled: false,
+ },
+ test_suites: ["device-tests"],
+ platform_apis: true,
+}
diff --git a/services/tests/PackageManagerServiceTests/appenumeration/test-apps/target/AndroidManifest-sharedUser.xml b/services/tests/PackageManagerServiceTests/appenumeration/test-apps/target/AndroidManifest-sharedUser.xml
new file mode 100644
index 0000000..b424298
--- /dev/null
+++ b/services/tests/PackageManagerServiceTests/appenumeration/test-apps/target/AndroidManifest-sharedUser.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2021 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.appenumeration.shareduid"
+ android:sharedUserId="com.android.appenumeration.shareduid">
+ <application>
+ <uses-library android:name="android.test.runner" />
+ </application>
+</manifest>
\ No newline at end of file
diff --git a/services/tests/mockingservicestests/src/com/android/server/alarm/AlarmManagerServiceTest.java b/services/tests/mockingservicestests/src/com/android/server/alarm/AlarmManagerServiceTest.java
index a254f68..16afef5 100644
--- a/services/tests/mockingservicestests/src/com/android/server/alarm/AlarmManagerServiceTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/alarm/AlarmManagerServiceTest.java
@@ -3002,7 +3002,8 @@
final PendingIntent pi = getNewMockPendingIntent();
setTestAlarm(ELAPSED_REALTIME, mNowElapsedTest + i, pi);
- verify(() -> MetricsHelper.pushAlarmScheduled(argThat(a -> a.matches(pi, null))));
+ verify(() -> MetricsHelper.pushAlarmScheduled(argThat(a -> a.matches(pi, null)),
+ anyInt()));
}
}
diff --git a/services/tests/mockingservicestests/src/com/android/server/am/ApplicationExitInfoTest.java b/services/tests/mockingservicestests/src/com/android/server/am/ApplicationExitInfoTest.java
index 803a0c1..26b5218 100644
--- a/services/tests/mockingservicestests/src/com/android/server/am/ApplicationExitInfoTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/am/ApplicationExitInfoTest.java
@@ -1003,7 +1003,7 @@
dummyPackageName, dummyClassName), "", definingUid));
}
app.mServices.setConnectionGroup(connectionGroup);
- app.mState.setSetProcState(procState);
+ app.mState.setReportedProcState(procState);
app.mProfile.setLastMemInfo(spy(new Debug.MemoryInfo()));
app.mProfile.setLastPss(pss);
app.mProfile.setLastRss(rss);
diff --git a/services/tests/mockingservicestests/src/com/android/server/app/GameManagerServiceTests.java b/services/tests/mockingservicestests/src/com/android/server/app/GameManagerServiceTests.java
index 8840057..85ef8f7 100644
--- a/services/tests/mockingservicestests/src/com/android/server/app/GameManagerServiceTests.java
+++ b/services/tests/mockingservicestests/src/com/android/server/app/GameManagerServiceTests.java
@@ -207,7 +207,7 @@
}
private void mockDeviceConfigInvalid() {
- String configString = "mode=2,downscaleFactor=0.55";
+ String configString = "";
when(DeviceConfig.getProperty(anyString(), anyString()))
.thenReturn(configString);
}
@@ -373,11 +373,12 @@
*/
@Test
public void testSetGameModePermissionDenied() {
+ mockModifyGameModeGranted();
+ mockDeviceConfigAll();
GameManagerService gameManagerService = new GameManagerService(mMockContext);
gameManagerService.onUserStarting(USER_ID_1);
// Update the game mode so we can read back something valid.
- mockModifyGameModeGranted();
gameManagerService.setGameMode(mPackageName, GameManager.GAME_MODE_STANDARD, USER_ID_1);
assertEquals(GameManager.GAME_MODE_STANDARD,
gameManagerService.getGameMode(mPackageName, USER_ID_1));
diff --git a/services/tests/mockingservicestests/src/com/android/server/appsearch/AppSearchConfigTest.java b/services/tests/mockingservicestests/src/com/android/server/appsearch/AppSearchConfigTest.java
index 8336663..9926953 100644
--- a/services/tests/mockingservicestests/src/com/android/server/appsearch/AppSearchConfigTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/appsearch/AppSearchConfigTest.java
@@ -50,6 +50,14 @@
AppSearchConfig.DEFAULT_SAMPLING_INTERVAL);
assertThat(appSearchConfig.getCachedSamplingIntervalForPutDocumentStats()).isEqualTo(
AppSearchConfig.DEFAULT_SAMPLING_INTERVAL);
+ assertThat(appSearchConfig.getCachedSamplingIntervalForInitializeStats()).isEqualTo(
+ AppSearchConfig.DEFAULT_SAMPLING_INTERVAL);
+ assertThat(appSearchConfig.getCachedSamplingIntervalForSearchStats()).isEqualTo(
+ AppSearchConfig.DEFAULT_SAMPLING_INTERVAL);
+ assertThat(appSearchConfig.getCachedSamplingIntervalForGlobalSearchStats()).isEqualTo(
+ AppSearchConfig.DEFAULT_SAMPLING_INTERVAL);
+ assertThat(appSearchConfig.getCachedSamplingIntervalForOptimizeStats()).isEqualTo(
+ AppSearchConfig.DEFAULT_SAMPLING_INTERVAL);
assertThat(appSearchConfig.getCachedLimitConfigMaxDocumentSizeBytes()).isEqualTo(
AppSearchConfig.DEFAULT_LIMIT_CONFIG_MAX_DOCUMENT_SIZE_BYTES);
assertThat(appSearchConfig.getCachedLimitConfigMaxDocumentCount()).isEqualTo(
@@ -100,6 +108,11 @@
final int samplingIntervalDefault = -1;
final int samplingIntervalPutDocumentStats = -2;
final int samplingIntervalBatchCallStats = -3;
+ final int samplingIntervalInitializeStats = -4;
+ final int samplingIntervalSearchStats = -5;
+ final int samplingIntervalGlobalSearchStats = -6;
+ final int samplingIntervalOptimizeStats = -7;
+
DeviceConfig.setProperty(DeviceConfig.NAMESPACE_APPSEARCH,
AppSearchConfig.KEY_SAMPLING_INTERVAL_DEFAULT,
Integer.toString(samplingIntervalDefault),
@@ -112,6 +125,22 @@
AppSearchConfig.KEY_SAMPLING_INTERVAL_FOR_BATCH_CALL_STATS,
Integer.toString(samplingIntervalBatchCallStats),
false);
+ DeviceConfig.setProperty(DeviceConfig.NAMESPACE_APPSEARCH,
+ AppSearchConfig.KEY_SAMPLING_INTERVAL_FOR_INITIALIZE_STATS,
+ Integer.toString(samplingIntervalInitializeStats),
+ false);
+ DeviceConfig.setProperty(DeviceConfig.NAMESPACE_APPSEARCH,
+ AppSearchConfig.KEY_SAMPLING_INTERVAL_FOR_SEARCH_STATS,
+ Integer.toString(samplingIntervalSearchStats),
+ false);
+ DeviceConfig.setProperty(DeviceConfig.NAMESPACE_APPSEARCH,
+ AppSearchConfig.KEY_SAMPLING_INTERVAL_FOR_GLOBAL_SEARCH_STATS,
+ Integer.toString(samplingIntervalGlobalSearchStats),
+ false);
+ DeviceConfig.setProperty(DeviceConfig.NAMESPACE_APPSEARCH,
+ AppSearchConfig.KEY_SAMPLING_INTERVAL_FOR_OPTIMIZE_STATS,
+ Integer.toString(samplingIntervalOptimizeStats),
+ false);
AppSearchConfig appSearchConfig = AppSearchConfig.create(DIRECT_EXECUTOR);
@@ -121,6 +150,14 @@
samplingIntervalPutDocumentStats);
assertThat(appSearchConfig.getCachedSamplingIntervalForBatchCallStats()).isEqualTo(
samplingIntervalBatchCallStats);
+ assertThat(appSearchConfig.getCachedSamplingIntervalForInitializeStats()).isEqualTo(
+ samplingIntervalInitializeStats);
+ assertThat(appSearchConfig.getCachedSamplingIntervalForSearchStats()).isEqualTo(
+ samplingIntervalSearchStats);
+ assertThat(appSearchConfig.getCachedSamplingIntervalForGlobalSearchStats()).isEqualTo(
+ samplingIntervalGlobalSearchStats);
+ assertThat(appSearchConfig.getCachedSamplingIntervalForOptimizeStats()).isEqualTo(
+ samplingIntervalOptimizeStats);
}
@Test
@@ -128,6 +165,10 @@
int samplingIntervalDefault = -1;
int samplingIntervalPutDocumentStats = -2;
int samplingIntervalBatchCallStats = -3;
+ int samplingIntervalInitializeStats = -4;
+ int samplingIntervalSearchStats = -5;
+ int samplingIntervalGlobalSearchStats = -6;
+ int samplingIntervalOptimizeStats = -7;
DeviceConfig.setProperty(DeviceConfig.NAMESPACE_APPSEARCH,
AppSearchConfig.KEY_SAMPLING_INTERVAL_DEFAULT,
Integer.toString(samplingIntervalDefault),
@@ -140,12 +181,32 @@
AppSearchConfig.KEY_SAMPLING_INTERVAL_FOR_BATCH_CALL_STATS,
Integer.toString(samplingIntervalBatchCallStats),
false);
+ DeviceConfig.setProperty(DeviceConfig.NAMESPACE_APPSEARCH,
+ AppSearchConfig.KEY_SAMPLING_INTERVAL_FOR_INITIALIZE_STATS,
+ Integer.toString(samplingIntervalInitializeStats),
+ false);
+ DeviceConfig.setProperty(DeviceConfig.NAMESPACE_APPSEARCH,
+ AppSearchConfig.KEY_SAMPLING_INTERVAL_FOR_SEARCH_STATS,
+ Integer.toString(samplingIntervalSearchStats),
+ false);
+ DeviceConfig.setProperty(DeviceConfig.NAMESPACE_APPSEARCH,
+ AppSearchConfig.KEY_SAMPLING_INTERVAL_FOR_GLOBAL_SEARCH_STATS,
+ Integer.toString(samplingIntervalGlobalSearchStats),
+ false);
+ DeviceConfig.setProperty(DeviceConfig.NAMESPACE_APPSEARCH,
+ AppSearchConfig.KEY_SAMPLING_INTERVAL_FOR_OPTIMIZE_STATS,
+ Integer.toString(samplingIntervalOptimizeStats),
+ false);
AppSearchConfig appSearchConfig = AppSearchConfig.create(DIRECT_EXECUTOR);
// Overrides
samplingIntervalDefault = -4;
samplingIntervalPutDocumentStats = -5;
samplingIntervalBatchCallStats = -6;
+ samplingIntervalInitializeStats = -7;
+ samplingIntervalSearchStats = -8;
+ samplingIntervalGlobalSearchStats = -9;
+ samplingIntervalOptimizeStats = -10;
DeviceConfig.setProperty(DeviceConfig.NAMESPACE_APPSEARCH,
AppSearchConfig.KEY_SAMPLING_INTERVAL_DEFAULT,
Integer.toString(samplingIntervalDefault),
@@ -158,6 +219,22 @@
AppSearchConfig.KEY_SAMPLING_INTERVAL_FOR_BATCH_CALL_STATS,
Integer.toString(samplingIntervalBatchCallStats),
false);
+ DeviceConfig.setProperty(DeviceConfig.NAMESPACE_APPSEARCH,
+ AppSearchConfig.KEY_SAMPLING_INTERVAL_FOR_INITIALIZE_STATS,
+ Integer.toString(samplingIntervalInitializeStats),
+ false);
+ DeviceConfig.setProperty(DeviceConfig.NAMESPACE_APPSEARCH,
+ AppSearchConfig.KEY_SAMPLING_INTERVAL_FOR_SEARCH_STATS,
+ Integer.toString(samplingIntervalSearchStats),
+ false);
+ DeviceConfig.setProperty(DeviceConfig.NAMESPACE_APPSEARCH,
+ AppSearchConfig.KEY_SAMPLING_INTERVAL_FOR_GLOBAL_SEARCH_STATS,
+ Integer.toString(samplingIntervalGlobalSearchStats),
+ false);
+ DeviceConfig.setProperty(DeviceConfig.NAMESPACE_APPSEARCH,
+ AppSearchConfig.KEY_SAMPLING_INTERVAL_FOR_OPTIMIZE_STATS,
+ Integer.toString(samplingIntervalOptimizeStats),
+ false);
assertThat(appSearchConfig.getCachedSamplingIntervalDefault()).isEqualTo(
samplingIntervalDefault);
@@ -165,6 +242,14 @@
samplingIntervalPutDocumentStats);
assertThat(appSearchConfig.getCachedSamplingIntervalForBatchCallStats()).isEqualTo(
samplingIntervalBatchCallStats);
+ assertThat(appSearchConfig.getCachedSamplingIntervalForInitializeStats()).isEqualTo(
+ samplingIntervalInitializeStats);
+ assertThat(appSearchConfig.getCachedSamplingIntervalForSearchStats()).isEqualTo(
+ samplingIntervalSearchStats);
+ assertThat(appSearchConfig.getCachedSamplingIntervalForGlobalSearchStats()).isEqualTo(
+ samplingIntervalGlobalSearchStats);
+ assertThat(appSearchConfig.getCachedSamplingIntervalForOptimizeStats()).isEqualTo(
+ samplingIntervalOptimizeStats);
}
/**
@@ -366,6 +451,18 @@
() -> appSearchConfig.getCachedSamplingIntervalForPutDocumentStats());
Assert.assertThrows("Trying to use a closed AppSearchConfig instance.",
IllegalStateException.class,
+ () -> appSearchConfig.getCachedSamplingIntervalForInitializeStats());
+ Assert.assertThrows("Trying to use a closed AppSearchConfig instance.",
+ IllegalStateException.class,
+ () -> appSearchConfig.getCachedSamplingIntervalForSearchStats());
+ Assert.assertThrows("Trying to use a closed AppSearchConfig instance.",
+ IllegalStateException.class,
+ () -> appSearchConfig.getCachedSamplingIntervalForGlobalSearchStats());
+ Assert.assertThrows("Trying to use a closed AppSearchConfig instance.",
+ IllegalStateException.class,
+ () -> appSearchConfig.getCachedSamplingIntervalForOptimizeStats());
+ Assert.assertThrows("Trying to use a closed AppSearchConfig instance.",
+ IllegalStateException.class,
() -> appSearchConfig.getCachedBytesOptimizeThreshold());
Assert.assertThrows("Trying to use a closed AppSearchConfig instance.",
IllegalStateException.class,
diff --git a/services/tests/mockingservicestests/src/com/android/server/job/controllers/QuotaControllerTest.java b/services/tests/mockingservicestests/src/com/android/server/job/controllers/QuotaControllerTest.java
index 906e6d2..dd70c87 100644
--- a/services/tests/mockingservicestests/src/com/android/server/job/controllers/QuotaControllerTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/job/controllers/QuotaControllerTest.java
@@ -5417,10 +5417,9 @@
timeout(remainingTimeMs / 2 + 2 * SECOND_IN_MILLIS).times(1))
.onControllerStateChanged(any());
// Top should still be "in quota" since it started before the app ran on top out of quota.
- assertFalse(jobBg.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
- assertTrue(jobTop.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
- assertFalse(
- jobUnstarted.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
+ assertFalse(jobBg.isExpeditedQuotaApproved());
+ assertTrue(jobTop.isExpeditedQuotaApproved());
+ assertFalse(jobUnstarted.isExpeditedQuotaApproved());
synchronized (mQuotaController.mLock) {
assertTrue(
0 >= mQuotaController
@@ -5445,18 +5444,18 @@
synchronized (mQuotaController.mLock) {
mQuotaController.prepareForExecutionLocked(jobTop2);
}
- assertTrue(jobTop2.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
- assertTrue(jobFg.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
- assertTrue(jobBg.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
- assertTrue(jobUnstarted.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
+ assertTrue(jobTop2.isExpeditedQuotaApproved());
+ assertTrue(jobFg.isExpeditedQuotaApproved());
+ assertTrue(jobBg.isExpeditedQuotaApproved());
+ assertTrue(jobUnstarted.isExpeditedQuotaApproved());
// App still in foreground so everything should be in quota.
advanceElapsedClock(20 * SECOND_IN_MILLIS);
setProcessState(ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE);
- assertTrue(jobTop2.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
- assertTrue(jobFg.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
- assertTrue(jobBg.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
- assertTrue(jobUnstarted.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
+ assertTrue(jobTop2.isExpeditedQuotaApproved());
+ assertTrue(jobFg.isExpeditedQuotaApproved());
+ assertTrue(jobBg.isExpeditedQuotaApproved());
+ assertTrue(jobUnstarted.isExpeditedQuotaApproved());
advanceElapsedClock(20 * SECOND_IN_MILLIS);
setProcessState(ActivityManager.PROCESS_STATE_SERVICE);
@@ -5464,13 +5463,12 @@
.onControllerStateChanged(any());
// App is now in background and out of quota. Fg should now change to out of quota since it
// wasn't started. Top should remain in quota since it started when the app was in TOP.
- assertTrue(jobTop2.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
- assertFalse(jobFg.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
- assertFalse(jobBg.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
+ assertTrue(jobTop2.isExpeditedQuotaApproved());
+ assertFalse(jobFg.isExpeditedQuotaApproved());
+ assertFalse(jobBg.isExpeditedQuotaApproved());
trackJobs(jobBg2);
- assertFalse(jobBg2.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
- assertFalse(
- jobUnstarted.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
+ assertFalse(jobBg2.isExpeditedQuotaApproved());
+ assertFalse(jobUnstarted.isExpeditedQuotaApproved());
synchronized (mQuotaController.mLock) {
assertTrue(
0 >= mQuotaController
@@ -5602,7 +5600,7 @@
verify(mJobSchedulerService,
timeout(remainingTimeMs + 2 * SECOND_IN_MILLIS).times(0))
.onControllerStateChanged(any());
- assertTrue(jobStatus.isConstraintSatisfied(JobStatus.CONSTRAINT_WITHIN_EXPEDITED_QUOTA));
+ assertTrue(jobStatus.isExpeditedQuotaApproved());
// The job used up the remaining quota, but in that time, the same amount of time in the
// old TimingSession also fell out of the quota window, so it should still have the same
// amount of remaining time left its quota.
diff --git a/services/tests/mockingservicestests/src/com/android/server/pm/StagingManagerTest.java b/services/tests/mockingservicestests/src/com/android/server/pm/StagingManagerTest.java
index ab43adc..ba5a58f 100644
--- a/services/tests/mockingservicestests/src/com/android/server/pm/StagingManagerTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/pm/StagingManagerTest.java
@@ -467,6 +467,66 @@
assertThat(apkSession.getErrorMessage()).isEqualTo("Another apex session failed");
}
+ @Test
+ public void getSessionIdByPackageName() throws Exception {
+ FakeStagedSession session = new FakeStagedSession(239);
+ session.setCommitted(true);
+ session.setSessionReady();
+ session.setPackageName("com.foo");
+
+ mStagingManager.createSession(session);
+ assertThat(mStagingManager.getSessionIdByPackageName("com.foo")).isEqualTo(239);
+ }
+
+ @Test
+ public void getSessionIdByPackageName_appliedSession_ignores() throws Exception {
+ FakeStagedSession session = new FakeStagedSession(37);
+ session.setCommitted(true);
+ session.setSessionApplied();
+ session.setPackageName("com.foo");
+
+ mStagingManager.createSession(session);
+ assertThat(mStagingManager.getSessionIdByPackageName("com.foo")).isEqualTo(-1);
+ }
+
+ @Test
+ public void getSessionIdByPackageName_failedSession_ignores() throws Exception {
+ FakeStagedSession session = new FakeStagedSession(73);
+ session.setCommitted(true);
+ session.setSessionFailed(1, "whatevs");
+ session.setPackageName("com.foo");
+
+ mStagingManager.createSession(session);
+ assertThat(mStagingManager.getSessionIdByPackageName("com.foo")).isEqualTo(-1);
+ }
+
+ @Test
+ public void getSessionIdByPackageName_destroyedSession_ignores() throws Exception {
+ FakeStagedSession session = new FakeStagedSession(23);
+ session.setCommitted(true);
+ session.setDestroyed(true);
+ session.setPackageName("com.foo");
+
+ mStagingManager.createSession(session);
+ assertThat(mStagingManager.getSessionIdByPackageName("com.foo")).isEqualTo(-1);
+ }
+
+ @Test
+ public void getSessionIdByPackageName_noSessions() throws Exception {
+ assertThat(mStagingManager.getSessionIdByPackageName("com.foo")).isEqualTo(-1);
+ }
+
+ @Test
+ public void getSessionIdByPackageName_noSessionHasThisPackage() throws Exception {
+ FakeStagedSession session = new FakeStagedSession(37);
+ session.setCommitted(true);
+ session.setSessionApplied();
+ session.setPackageName("com.foo");
+
+ mStagingManager.createSession(session);
+ assertThat(mStagingManager.getSessionIdByPackageName("com.bar")).isEqualTo(-1);
+ }
+
private StagingManager.StagedSession createSession(int sessionId, String packageName,
long committedMillis) {
PackageInstaller.SessionParams params = new PackageInstaller.SessionParams(
diff --git a/services/tests/servicestests/src/com/android/server/appsearch/external/localstorage/AppSearchImplTest.java b/services/tests/servicestests/src/com/android/server/appsearch/external/localstorage/AppSearchImplTest.java
index 5b067bc..f40a5ad 100644
--- a/services/tests/servicestests/src/com/android/server/appsearch/external/localstorage/AppSearchImplTest.java
+++ b/services/tests/servicestests/src/com/android/server/appsearch/external/localstorage/AppSearchImplTest.java
@@ -42,6 +42,7 @@
import com.android.server.appsearch.external.localstorage.converter.GenericDocumentToProtoConverter;
import com.android.server.appsearch.external.localstorage.stats.InitializeStats;
+import com.android.server.appsearch.external.localstorage.stats.OptimizeStats;
import com.android.server.appsearch.external.localstorage.util.PrefixUtil;
import com.android.server.appsearch.icing.proto.DocumentProto;
import com.android.server.appsearch.icing.proto.GetOptimizeInfoResultProto;
@@ -451,19 +452,26 @@
assertThat(optimizeInfo.getOptimizableDocs()).isEqualTo(1);
// Increase mutation counter and stop before reach the threshold
- mAppSearchImpl.checkForOptimize(AppSearchImpl.CHECK_OPTIMIZE_INTERVAL - 1);
+ mAppSearchImpl.checkForOptimize(
+ AppSearchImpl.CHECK_OPTIMIZE_INTERVAL - 1, /*builder=*/ null);
// Verify the optimize() isn't triggered.
optimizeInfo = mAppSearchImpl.getOptimizeInfoResultLocked();
assertThat(optimizeInfo.getOptimizableDocs()).isEqualTo(1);
// Increase the counter and reach the threshold, optimize() should be triggered.
- mAppSearchImpl.checkForOptimize(/*mutateBatchSize=*/ 1);
+ OptimizeStats.Builder builder = new OptimizeStats.Builder();
+ mAppSearchImpl.checkForOptimize(/*mutateBatchSize=*/ 1, builder);
// Verify optimize() is triggered.
optimizeInfo = mAppSearchImpl.getOptimizeInfoResultLocked();
assertThat(optimizeInfo.getOptimizableDocs()).isEqualTo(0);
assertThat(optimizeInfo.getEstimatedOptimizableBytes()).isEqualTo(0);
+
+ // Verify the stats have been set.
+ OptimizeStats oStats = builder.build();
+ assertThat(oStats.getOriginalDocumentCount()).isEqualTo(1);
+ assertThat(oStats.getDeletedDocumentCount()).isEqualTo(1);
}
@Test
diff --git a/services/tests/servicestests/src/com/android/server/appsearch/external/localstorage/AppSearchLoggerTest.java b/services/tests/servicestests/src/com/android/server/appsearch/external/localstorage/AppSearchLoggerTest.java
index 7bacbb6..7c97687 100644
--- a/services/tests/servicestests/src/com/android/server/appsearch/external/localstorage/AppSearchLoggerTest.java
+++ b/services/tests/servicestests/src/com/android/server/appsearch/external/localstorage/AppSearchLoggerTest.java
@@ -29,12 +29,14 @@
import com.android.server.appsearch.external.localstorage.stats.CallStats;
import com.android.server.appsearch.external.localstorage.stats.InitializeStats;
+import com.android.server.appsearch.external.localstorage.stats.OptimizeStats;
import com.android.server.appsearch.external.localstorage.stats.PutDocumentStats;
import com.android.server.appsearch.external.localstorage.stats.RemoveStats;
import com.android.server.appsearch.external.localstorage.stats.SearchStats;
import com.android.server.appsearch.icing.proto.DeleteStatsProto;
import com.android.server.appsearch.icing.proto.DocumentProto;
import com.android.server.appsearch.icing.proto.InitializeStatsProto;
+import com.android.server.appsearch.icing.proto.OptimizeStatsProto;
import com.android.server.appsearch.icing.proto.PutDocumentStatsProto;
import com.android.server.appsearch.icing.proto.PutResultProto;
import com.android.server.appsearch.icing.proto.QueryStatsProto;
@@ -81,6 +83,7 @@
@Nullable InitializeStats mInitializeStats;
@Nullable SearchStats mSearchStats;
@Nullable RemoveStats mRemoveStats;
+ @Nullable OptimizeStats mOptimizeStats;
@Override
public void logStats(@NonNull CallStats stats) {
@@ -106,6 +109,11 @@
public void logStats(@NonNull RemoveStats stats) {
mRemoveStats = stats;
}
+
+ @Override
+ public void logStats(@NonNull OptimizeStats stats) {
+ mOptimizeStats = stats;
+ }
}
@Test
@@ -286,6 +294,48 @@
assertThat(rStats.getDeletedDocumentCount()).isEqualTo(nativeNumDocumentDeleted);
}
+ @Test
+ public void testAppSearchLoggerHelper_testCopyNativeStats_optimize() {
+ int nativeLatencyMillis = 1;
+ int nativeDocumentStoreOptimizeLatencyMillis = 2;
+ int nativeIndexRestorationLatencyMillis = 3;
+ int nativeNumOriginalDocuments = 4;
+ int nativeNumDeletedDocuments = 5;
+ int nativeNumExpiredDocuments = 6;
+ long nativeStorageSizeBeforeBytes = Integer.MAX_VALUE + 1;
+ long nativeStorageSizeAfterBytes = Integer.MAX_VALUE + 2;
+ long nativeTimeSinceLastOptimizeMillis = Integer.MAX_VALUE + 3;
+ OptimizeStatsProto optimizeStatsProto =
+ OptimizeStatsProto.newBuilder()
+ .setLatencyMs(nativeLatencyMillis)
+ .setDocumentStoreOptimizeLatencyMs(nativeDocumentStoreOptimizeLatencyMillis)
+ .setIndexRestorationLatencyMs(nativeIndexRestorationLatencyMillis)
+ .setNumOriginalDocuments(nativeNumOriginalDocuments)
+ .setNumDeletedDocuments(nativeNumDeletedDocuments)
+ .setNumExpiredDocuments(nativeNumExpiredDocuments)
+ .setStorageSizeBefore(nativeStorageSizeBeforeBytes)
+ .setStorageSizeAfter(nativeStorageSizeAfterBytes)
+ .setTimeSinceLastOptimizeMs(nativeTimeSinceLastOptimizeMillis)
+ .build();
+ OptimizeStats.Builder oBuilder = new OptimizeStats.Builder();
+
+ AppSearchLoggerHelper.copyNativeStats(optimizeStatsProto, oBuilder);
+
+ OptimizeStats oStats = oBuilder.build();
+ assertThat(oStats.getNativeLatencyMillis()).isEqualTo(nativeLatencyMillis);
+ assertThat(oStats.getDocumentStoreOptimizeLatencyMillis())
+ .isEqualTo(nativeDocumentStoreOptimizeLatencyMillis);
+ assertThat(oStats.getIndexRestorationLatencyMillis())
+ .isEqualTo(nativeIndexRestorationLatencyMillis);
+ assertThat(oStats.getOriginalDocumentCount()).isEqualTo(nativeNumOriginalDocuments);
+ assertThat(oStats.getDeletedDocumentCount()).isEqualTo(nativeNumDeletedDocuments);
+ assertThat(oStats.getExpiredDocumentCount()).isEqualTo(nativeNumExpiredDocuments);
+ assertThat(oStats.getStorageSizeBeforeBytes()).isEqualTo(nativeStorageSizeBeforeBytes);
+ assertThat(oStats.getStorageSizeAfterBytes()).isEqualTo(nativeStorageSizeAfterBytes);
+ assertThat(oStats.getTimeSinceLastOptimizeMillis())
+ .isEqualTo(nativeTimeSinceLastOptimizeMillis);
+ }
+
//
// Testing actual logging
//
diff --git a/services/tests/servicestests/src/com/android/server/appsearch/external/localstorage/stats/AppSearchStatsTest.java b/services/tests/servicestests/src/com/android/server/appsearch/external/localstorage/stats/AppSearchStatsTest.java
index 57d9941..c1dc0e4 100644
--- a/services/tests/servicestests/src/com/android/server/appsearch/external/localstorage/stats/AppSearchStatsTest.java
+++ b/services/tests/servicestests/src/com/android/server/appsearch/external/localstorage/stats/AppSearchStatsTest.java
@@ -348,4 +348,49 @@
assertThat(rStats.getDeleteType()).isEqualTo(deleteType);
assertThat(rStats.getDeletedDocumentCount()).isEqualTo(documentDeletedCount);
}
+
+ @Test
+ public void testAppSearchStats_OptimizeStats() {
+ int nativeLatencyMillis = 1;
+ int nativeDocumentStoreOptimizeLatencyMillis = 2;
+ int nativeIndexRestorationLatencyMillis = 3;
+ int nativeNumOriginalDocuments = 4;
+ int nativeNumDeletedDocuments = 5;
+ int nativeNumExpiredDocuments = 6;
+ long nativeStorageSizeBeforeBytes = Integer.MAX_VALUE + 1;
+ long nativeStorageSizeAfterBytes = Integer.MAX_VALUE + 2;
+ long nativeTimeSinceLastOptimizeMillis = Integer.MAX_VALUE + 3;
+
+ final OptimizeStats oStats =
+ new OptimizeStats.Builder()
+ .setStatusCode(TEST_STATUS_CODE)
+ .setTotalLatencyMillis(TEST_TOTAL_LATENCY_MILLIS)
+ .setNativeLatencyMillis(nativeLatencyMillis)
+ .setDocumentStoreOptimizeLatencyMillis(
+ nativeDocumentStoreOptimizeLatencyMillis)
+ .setIndexRestorationLatencyMillis(nativeIndexRestorationLatencyMillis)
+ .setOriginalDocumentCount(nativeNumOriginalDocuments)
+ .setDeletedDocumentCount(nativeNumDeletedDocuments)
+ .setExpiredDocumentCount(nativeNumExpiredDocuments)
+ .setStorageSizeBeforeBytes(nativeStorageSizeBeforeBytes)
+ .setStorageSizeAfterBytes(nativeStorageSizeAfterBytes)
+ .setTimeSinceLastOptimizeMillis(nativeTimeSinceLastOptimizeMillis)
+ .build();
+
+ assertThat(oStats.getStatusCode()).isEqualTo(TEST_STATUS_CODE);
+ assertThat(oStats.getTotalLatencyMillis()).isEqualTo(TEST_TOTAL_LATENCY_MILLIS);
+ assertThat(oStats.getNativeLatencyMillis()).isEqualTo(nativeLatencyMillis);
+ assertThat(oStats.getNativeLatencyMillis()).isEqualTo(nativeLatencyMillis);
+ assertThat(oStats.getDocumentStoreOptimizeLatencyMillis())
+ .isEqualTo(nativeDocumentStoreOptimizeLatencyMillis);
+ assertThat(oStats.getIndexRestorationLatencyMillis())
+ .isEqualTo(nativeIndexRestorationLatencyMillis);
+ assertThat(oStats.getOriginalDocumentCount()).isEqualTo(nativeNumOriginalDocuments);
+ assertThat(oStats.getDeletedDocumentCount()).isEqualTo(nativeNumDeletedDocuments);
+ assertThat(oStats.getExpiredDocumentCount()).isEqualTo(nativeNumExpiredDocuments);
+ assertThat(oStats.getStorageSizeBeforeBytes()).isEqualTo(nativeStorageSizeBeforeBytes);
+ assertThat(oStats.getStorageSizeAfterBytes()).isEqualTo(nativeStorageSizeAfterBytes);
+ assertThat(oStats.getTimeSinceLastOptimizeMillis())
+ .isEqualTo(nativeTimeSinceLastOptimizeMillis);
+ }
}
diff --git a/services/tests/servicestests/src/com/android/server/biometrics/sensors/CoexCoordinatorTest.java b/services/tests/servicestests/src/com/android/server/biometrics/sensors/CoexCoordinatorTest.java
index fb05825..a169ebd 100644
--- a/services/tests/servicestests/src/com/android/server/biometrics/sensors/CoexCoordinatorTest.java
+++ b/services/tests/servicestests/src/com/android/server/biometrics/sensors/CoexCoordinatorTest.java
@@ -259,6 +259,74 @@
}
@Test
+ public void testKeyguard_faceRejectedWhenUdfpsTouching_thenUdfpsRejected() {
+ mCoexCoordinator.reset();
+
+ AuthenticationClient<?> faceClient = mock(AuthenticationClient.class);
+ when(faceClient.isKeyguard()).thenReturn(true);
+ when(faceClient.getState()).thenReturn(AuthenticationClient.STATE_STARTED);
+
+ AuthenticationClient<?> udfpsClient = mock(AuthenticationClient.class,
+ withSettings().extraInterfaces(Udfps.class));
+ when(udfpsClient.getState()).thenReturn(AuthenticationClient.STATE_STARTED);
+ when(udfpsClient.isKeyguard()).thenReturn(true);
+ when(((Udfps) udfpsClient).isPointerDown()).thenReturn(true);
+
+ mCoexCoordinator.addAuthenticationClient(SENSOR_TYPE_FACE, faceClient);
+ mCoexCoordinator.addAuthenticationClient(SENSOR_TYPE_UDFPS, udfpsClient);
+
+ mCoexCoordinator.onAuthenticationRejected(0 /* currentTimeMillis */, faceClient,
+ LockoutTracker.LOCKOUT_NONE, mCallback);
+ verify(mCallback, never()).sendHapticFeedback();
+ verify(mCallback).handleLifecycleAfterAuth();
+
+ // BiometricScheduler removes the face authentication client after rejection
+ mCoexCoordinator.removeAuthenticationClient(SENSOR_TYPE_FACE, faceClient);
+
+ // Then UDFPS rejected
+ CoexCoordinator.Callback udfpsCallback = mock(CoexCoordinator.Callback.class);
+ mCoexCoordinator.onAuthenticationRejected(1 /* currentTimeMillis */, udfpsClient,
+ LockoutTracker.LOCKOUT_NONE, udfpsCallback);
+ verify(udfpsCallback).sendHapticFeedback();
+ verify(udfpsCallback).sendAuthenticationResult(eq(false) /* addAuthTokenIfStrong */);
+ verify(mCallback, never()).sendHapticFeedback();
+ }
+
+ @Test
+ public void testKeyguard_udfpsRejected_thenFaceRejected() {
+ mCoexCoordinator.reset();
+
+ AuthenticationClient<?> faceClient = mock(AuthenticationClient.class);
+ when(faceClient.isKeyguard()).thenReturn(true);
+ when(faceClient.getState()).thenReturn(AuthenticationClient.STATE_STARTED);
+
+ AuthenticationClient<?> udfpsClient = mock(AuthenticationClient.class,
+ withSettings().extraInterfaces(Udfps.class));
+ when(udfpsClient.getState()).thenReturn(AuthenticationClient.STATE_STARTED);
+ when(udfpsClient.isKeyguard()).thenReturn(true);
+ when(((Udfps) udfpsClient).isPointerDown()).thenReturn(true);
+
+ mCoexCoordinator.addAuthenticationClient(SENSOR_TYPE_FACE, faceClient);
+ mCoexCoordinator.addAuthenticationClient(SENSOR_TYPE_UDFPS, udfpsClient);
+
+ mCoexCoordinator.onAuthenticationRejected(0 /* currentTimeMillis */, udfpsClient,
+ LockoutTracker.LOCKOUT_NONE, mCallback);
+ // Client becomes paused, but finger does not necessarily lift, since we suppress the haptic
+ when(udfpsClient.getState()).thenReturn(AuthenticationClient.STATE_STARTED_PAUSED);
+ verify(mCallback, never()).sendHapticFeedback();
+ verify(mCallback).handleLifecycleAfterAuth();
+
+ // Then face rejected. Note that scheduler leaves UDFPS in the CoexCoordinator since
+ // unlike face, its lifecycle becomes "paused" instead of "finished".
+ CoexCoordinator.Callback faceCallback = mock(CoexCoordinator.Callback.class);
+ mCoexCoordinator.onAuthenticationRejected(1 /* currentTimeMillis */, faceClient,
+ LockoutTracker.LOCKOUT_NONE, faceCallback);
+ verify(faceCallback).sendHapticFeedback();
+ verify(faceCallback).sendAuthenticationResult(eq(false) /* addAuthTokenIfStrong */);
+ verify(mCallback, never()).sendHapticFeedback();
+ }
+
+ @Test
public void testNonKeyguard_rejectAndNotLockedOut() {
mCoexCoordinator.reset();
diff --git a/services/tests/servicestests/src/com/android/server/display/HighBrightnessModeControllerTest.java b/services/tests/servicestests/src/com/android/server/display/HighBrightnessModeControllerTest.java
index 1ad8850..cc3591c8 100644
--- a/services/tests/servicestests/src/com/android/server/display/HighBrightnessModeControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/display/HighBrightnessModeControllerTest.java
@@ -92,7 +92,6 @@
@Mock IThermalService mThermalServiceMock;
@Mock Injector mInjectorMock;
- @Mock BrightnessSetting mBrightnessSetting;
@Captor ArgumentCaptor<IThermalEventListener> mThermalEventListenerCaptor;
@@ -123,7 +122,7 @@
initHandler(null);
final HighBrightnessModeController hbmc = new HighBrightnessModeController(
mInjectorMock, mHandler, DISPLAY_WIDTH, DISPLAY_HEIGHT, mDisplayToken, DEFAULT_MIN,
- DEFAULT_MAX, null, () -> {}, mContextSpy, mBrightnessSetting);
+ DEFAULT_MAX, null, () -> {}, mContextSpy);
assertState(hbmc, DEFAULT_MIN, DEFAULT_MAX, HIGH_BRIGHTNESS_MODE_OFF);
}
@@ -132,7 +131,7 @@
initHandler(null);
final HighBrightnessModeController hbmc = new HighBrightnessModeController(
mInjectorMock, mHandler, DISPLAY_WIDTH, DISPLAY_HEIGHT, mDisplayToken, DEFAULT_MIN,
- DEFAULT_MAX, null, () -> {}, mContextSpy, mBrightnessSetting);
+ DEFAULT_MAX, null, () -> {}, mContextSpy);
hbmc.setAutoBrightnessEnabled(true);
hbmc.onAmbientLuxChange(MINIMUM_LUX - 1); // below allowed range
assertState(hbmc, DEFAULT_MIN, DEFAULT_MAX, HIGH_BRIGHTNESS_MODE_OFF);
@@ -464,7 +463,7 @@
initHandler(clock);
return new HighBrightnessModeController(mInjectorMock, mHandler, DISPLAY_WIDTH,
DISPLAY_HEIGHT, mDisplayToken, DEFAULT_MIN, DEFAULT_MAX, DEFAULT_HBM_DATA, () -> {},
- mContextSpy, mBrightnessSetting);
+ mContextSpy);
}
private void initHandler(OffsettableClock clock) {
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/ActiveSourceActionTest.java b/services/tests/servicestests/src/com/android/server/hdmi/ActiveSourceActionTest.java
index a38a84b..88f70af 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/ActiveSourceActionTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/ActiveSourceActionTest.java
@@ -139,10 +139,14 @@
playbackDevice.addAndStartAction(action);
mTestLooper.dispatchAll();
- HdmiCecMessage activeSource = HdmiCecMessageBuilder.buildActiveSource(
- playbackDevice.mAddress, mPhysicalAddress);
- HdmiCecMessage menuStatus = HdmiCecMessageBuilder.buildReportMenuStatus(
- playbackDevice.mAddress, ADDR_TV, Constants.MENU_STATE_ACTIVATED);
+ HdmiCecMessage activeSource =
+ HdmiCecMessageBuilder.buildActiveSource(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), mPhysicalAddress);
+ HdmiCecMessage menuStatus =
+ HdmiCecMessageBuilder.buildReportMenuStatus(
+ playbackDevice.getDeviceInfo().getLogicalAddress(),
+ ADDR_TV,
+ Constants.MENU_STATE_ACTIVATED);
assertThat(mNativeWrapper.getResultMessages()).contains(activeSource);
assertThat(mNativeWrapper.getResultMessages()).contains(menuStatus);
@@ -162,8 +166,8 @@
playbackDevice.addAndStartAction(action);
mTestLooper.dispatchAll();
- assertThat(playbackDevice.getActiveSource().logicalAddress).isEqualTo(
- playbackDevice.mAddress);
+ assertThat(playbackDevice.getActiveSource().logicalAddress)
+ .isEqualTo(playbackDevice.getDeviceInfo().getLogicalAddress());
assertThat(playbackDevice.getActiveSource().physicalAddress).isEqualTo(mPhysicalAddress);
assertThat(playbackDevice.isActiveSource()).isTrue();
}
@@ -182,10 +186,14 @@
audioDevice.addAndStartAction(action);
mTestLooper.dispatchAll();
- HdmiCecMessage activeSource = HdmiCecMessageBuilder.buildActiveSource(audioDevice.mAddress,
- mPhysicalAddress);
- HdmiCecMessage menuStatus = HdmiCecMessageBuilder.buildReportMenuStatus(
- audioDevice.mAddress, ADDR_TV, Constants.MENU_STATE_ACTIVATED);
+ HdmiCecMessage activeSource =
+ HdmiCecMessageBuilder.buildActiveSource(
+ audioDevice.getDeviceInfo().getLogicalAddress(), mPhysicalAddress);
+ HdmiCecMessage menuStatus =
+ HdmiCecMessageBuilder.buildReportMenuStatus(
+ audioDevice.getDeviceInfo().getLogicalAddress(),
+ ADDR_TV,
+ Constants.MENU_STATE_ACTIVATED);
assertThat(mNativeWrapper.getResultMessages()).contains(activeSource);
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(menuStatus);
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/DetectTvSystemAudioModeSupportActionTest.java b/services/tests/servicestests/src/com/android/server/hdmi/DetectTvSystemAudioModeSupportActionTest.java
index f49b1c1..9c99240 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/DetectTvSystemAudioModeSupportActionTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/DetectTvSystemAudioModeSupportActionTest.java
@@ -73,7 +73,9 @@
mHdmiCecLocalDeviceAudioSystem.dispatchMessage(
HdmiCecMessageBuilder.buildFeatureAbortCommand(
Constants.ADDR_TV,
- mHdmiCecLocalDeviceAudioSystem.mAddress,
+ mHdmiCecLocalDeviceAudioSystem
+ .getDeviceInfo()
+ .getLogicalAddress(),
Constants.MESSAGE_SET_SYSTEM_AUDIO_MODE,
Constants.ABORT_UNRECOGNIZED_OPCODE));
}
@@ -106,6 +108,7 @@
}
};
mHdmiCecLocalDeviceAudioSystem.init();
+ mHdmiCecLocalDeviceAudioSystem.setDeviceInfo(mDeviceInfoForTests);
Looper looper = mTestLooper.getLooper();
hdmiControlService.setIoLooper(looper);
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/DevicePowerStatusActionTest.java b/services/tests/servicestests/src/com/android/server/hdmi/DevicePowerStatusActionTest.java
index fe8d691..57756f9 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/DevicePowerStatusActionTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/DevicePowerStatusActionTest.java
@@ -150,12 +150,16 @@
mPlaybackDevice.addAndStartAction(mDevicePowerStatusAction);
mTestLooper.dispatchAll();
- HdmiCecMessage expected = HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
- mPlaybackDevice.mAddress, ADDR_TV);
+ HdmiCecMessage expected =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ mPlaybackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(expected);
- HdmiCecMessage response = HdmiCecMessageBuilder.buildReportPowerStatus(
- ADDR_TV, mPlaybackDevice.mAddress, HdmiControlManager.POWER_STATUS_STANDBY);
+ HdmiCecMessage response =
+ HdmiCecMessageBuilder.buildReportPowerStatus(
+ ADDR_TV,
+ mPlaybackDevice.getDeviceInfo().getLogicalAddress(),
+ HdmiControlManager.POWER_STATUS_STANDBY);
mNativeWrapper.onCecMessage(response);
mTestLooper.dispatchAll();
@@ -177,8 +181,9 @@
public void queryDisplayStatus_sendsRequest_timeout_retriesSuccessfully() throws Exception {
mPlaybackDevice.addAndStartAction(mDevicePowerStatusAction);
- HdmiCecMessage expected = HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
- mPlaybackDevice.mAddress, ADDR_TV);
+ HdmiCecMessage expected =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ mPlaybackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
mTestLooper.dispatchAll();
assertThat(mNativeWrapper.getResultMessages()).contains(expected);
@@ -188,8 +193,11 @@
assertThat(mNativeWrapper.getResultMessages()).contains(expected);
- HdmiCecMessage response = HdmiCecMessageBuilder.buildReportPowerStatus(
- ADDR_TV, mPlaybackDevice.mAddress, HdmiControlManager.POWER_STATUS_STANDBY);
+ HdmiCecMessage response =
+ HdmiCecMessageBuilder.buildReportPowerStatus(
+ ADDR_TV,
+ mPlaybackDevice.getDeviceInfo().getLogicalAddress(),
+ HdmiControlManager.POWER_STATUS_STANDBY);
mNativeWrapper.onCecMessage(response);
mTestLooper.dispatchAll();
@@ -201,8 +209,9 @@
mPlaybackDevice.addAndStartAction(mDevicePowerStatusAction);
mTestLooper.dispatchAll();
- HdmiCecMessage expected = HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
- mPlaybackDevice.mAddress, ADDR_TV);
+ HdmiCecMessage expected =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ mPlaybackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(expected);
mNativeWrapper.clearResultMessages();
mTestLooper.moveTimeForward(TIMEOUT_MS);
@@ -225,12 +234,16 @@
mPlaybackDevice.addAndStartAction(mDevicePowerStatusAction);
mTestLooper.dispatchAll();
- HdmiCecMessage giveDevicePowerStatus = HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
- mPlaybackDevice.mAddress, ADDR_TV);
+ HdmiCecMessage giveDevicePowerStatus =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ mPlaybackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(giveDevicePowerStatus);
- HdmiCecMessage response = HdmiCecMessageBuilder.buildReportPowerStatus(
- ADDR_TV, mPlaybackDevice.mAddress, HdmiControlManager.POWER_STATUS_STANDBY);
+ HdmiCecMessage response =
+ HdmiCecMessageBuilder.buildReportPowerStatus(
+ ADDR_TV,
+ mPlaybackDevice.getDeviceInfo().getLogicalAddress(),
+ HdmiControlManager.POWER_STATUS_STANDBY);
mNativeWrapper.onCecMessage(response);
mTestLooper.dispatchAll();
@@ -254,8 +267,9 @@
mPlaybackDevice.addAndStartAction(mDevicePowerStatusAction);
mTestLooper.dispatchAll();
- HdmiCecMessage giveDevicePowerStatus = HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
- mPlaybackDevice.mAddress, ADDR_TV);
+ HdmiCecMessage giveDevicePowerStatus =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ mPlaybackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(giveDevicePowerStatus);
verify(mCallbackMock).onComplete(HdmiControlManager.POWER_STATUS_STANDBY);
@@ -278,12 +292,16 @@
mPlaybackDevice.addAndStartAction(mDevicePowerStatusAction);
mTestLooper.dispatchAll();
- HdmiCecMessage giveDevicePowerStatus = HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
- mPlaybackDevice.mAddress, ADDR_TV);
+ HdmiCecMessage giveDevicePowerStatus =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ mPlaybackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(giveDevicePowerStatus);
- HdmiCecMessage response = HdmiCecMessageBuilder.buildReportPowerStatus(
- ADDR_TV, mPlaybackDevice.mAddress, HdmiControlManager.POWER_STATUS_STANDBY);
+ HdmiCecMessage response =
+ HdmiCecMessageBuilder.buildReportPowerStatus(
+ ADDR_TV,
+ mPlaybackDevice.getDeviceInfo().getLogicalAddress(),
+ HdmiControlManager.POWER_STATUS_STANDBY);
mNativeWrapper.onCecMessage(response);
mTestLooper.dispatchAll();
@@ -298,8 +316,9 @@
mHdmiControlService.onStandby(HdmiControlService.STANDBY_SCREEN_OFF);
mTestLooper.dispatchAll();
- HdmiCecMessage standbyMessage = HdmiCecMessageBuilder.buildStandby(
- mPlaybackDevice.mAddress, ADDR_TV);
+ HdmiCecMessage standbyMessage =
+ HdmiCecMessageBuilder.buildStandby(
+ mPlaybackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(standbyMessage);
}
}
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystemTest.java b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystemTest.java
index e03e1be..7eb8990 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystemTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystemTest.java
@@ -795,12 +795,13 @@
@Test
public void setActiveSource_localDevice_playback() {
- mHdmiControlService.setActiveSource(mHdmiCecLocalDevicePlayback.mAddress,
+ mHdmiControlService.setActiveSource(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
SELF_PHYSICAL_ADDRESS,
"HdmiControlServiceTest");
- assertThat(mHdmiControlService.getLocalActiveSource().logicalAddress).isEqualTo(
- mHdmiCecLocalDevicePlayback.mAddress);
+ assertThat(mHdmiControlService.getLocalActiveSource().logicalAddress)
+ .isEqualTo(mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress());
assertThat(mHdmiControlService.getLocalActiveSource().physicalAddress).isEqualTo(
SELF_PHYSICAL_ADDRESS);
assertThat(mHdmiCecLocalDevicePlayback.isActiveSource()).isTrue();
@@ -809,12 +810,13 @@
@Test
public void setActiveSource_localDevice_audio() {
- mHdmiControlService.setActiveSource(mHdmiCecLocalDeviceAudioSystem.mAddress,
+ mHdmiControlService.setActiveSource(
+ mHdmiCecLocalDeviceAudioSystem.getDeviceInfo().getLogicalAddress(),
SELF_PHYSICAL_ADDRESS,
"HdmiControlServiceTest");
- assertThat(mHdmiControlService.getLocalActiveSource().logicalAddress).isEqualTo(
- mHdmiCecLocalDeviceAudioSystem.mAddress);
+ assertThat(mHdmiControlService.getLocalActiveSource().logicalAddress)
+ .isEqualTo(mHdmiCecLocalDeviceAudioSystem.getDeviceInfo().getLogicalAddress());
assertThat(mHdmiControlService.getLocalActiveSource().physicalAddress).isEqualTo(
SELF_PHYSICAL_ADDRESS);
assertThat(mHdmiCecLocalDevicePlayback.isActiveSource()).isFalse();
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDevicePlaybackTest.java b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDevicePlaybackTest.java
index 99e3d68..337276d 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDevicePlaybackTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDevicePlaybackTest.java
@@ -657,7 +657,9 @@
// Test should ignore it and still keep the system audio mode on.
HdmiCecMessage message =
HdmiCecMessageBuilder.buildSetSystemAudioMode(
- Constants.ADDR_AUDIO_SYSTEM, mHdmiCecLocalDevicePlayback.mAddress, false);
+ Constants.ADDR_AUDIO_SYSTEM,
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ false);
assertThat(mHdmiCecLocalDevicePlayback.handleSetSystemAudioMode(message))
.isEqualTo(Constants.HANDLED);
assertThat(mHdmiCecLocalDevicePlayback.mService.isSystemAudioActivated()).isTrue();
@@ -669,7 +671,9 @@
assertThat(mHdmiCecLocalDevicePlayback.mService.isSystemAudioActivated()).isFalse();
HdmiCecMessage message =
HdmiCecMessageBuilder.buildReportSystemAudioMode(
- Constants.ADDR_AUDIO_SYSTEM, mHdmiCecLocalDevicePlayback.mAddress, true);
+ Constants.ADDR_AUDIO_SYSTEM,
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ true);
assertThat(mHdmiCecLocalDevicePlayback.handleSystemAudioModeStatus(message))
.isEqualTo(Constants.HANDLED);
assertThat(mHdmiCecLocalDevicePlayback.mService.isSystemAudioActivated()).isTrue();
@@ -699,12 +703,17 @@
mHdmiCecLocalDevicePlayback.onStandby(false, HdmiControlService.STANDBY_SCREEN_OFF);
mTestLooper.dispatchAll();
- HdmiCecMessage standbyMessageToTv = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV);
- HdmiCecMessage standbyMessageToAudioSystem = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_AUDIO_SYSTEM);
- HdmiCecMessage standbyMessageBroadcast = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_BROADCAST);
+ HdmiCecMessage standbyMessageToTv =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(), ADDR_TV);
+ HdmiCecMessage standbyMessageToAudioSystem =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_AUDIO_SYSTEM);
+ HdmiCecMessage standbyMessageBroadcast =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_BROADCAST);
HdmiCecMessage inactiveSource = HdmiCecMessageBuilder.buildInactiveSource(
mPlaybackLogicalAddress, mPlaybackPhysicalAddress);
@@ -724,12 +733,17 @@
mHdmiCecLocalDevicePlayback.onStandby(false, HdmiControlService.STANDBY_SCREEN_OFF);
mTestLooper.dispatchAll();
- HdmiCecMessage standbyMessageToTv = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV);
- HdmiCecMessage standbyMessageToAudioSystem = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_AUDIO_SYSTEM);
- HdmiCecMessage standbyMessageBroadcast = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_BROADCAST);
+ HdmiCecMessage standbyMessageToTv =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(), ADDR_TV);
+ HdmiCecMessage standbyMessageToAudioSystem =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_AUDIO_SYSTEM);
+ HdmiCecMessage standbyMessageBroadcast =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_BROADCAST);
HdmiCecMessage inactiveSource = HdmiCecMessageBuilder.buildInactiveSource(
mPlaybackLogicalAddress, mPlaybackPhysicalAddress);
@@ -749,12 +763,17 @@
mHdmiCecLocalDevicePlayback.onStandby(false, HdmiControlService.STANDBY_SCREEN_OFF);
mTestLooper.dispatchAll();
- HdmiCecMessage standbyMessageToTv = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV);
- HdmiCecMessage standbyMessageToAudioSystem = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_AUDIO_SYSTEM);
- HdmiCecMessage standbyMessageBroadcast = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_BROADCAST);
+ HdmiCecMessage standbyMessageToTv =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(), ADDR_TV);
+ HdmiCecMessage standbyMessageToAudioSystem =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_AUDIO_SYSTEM);
+ HdmiCecMessage standbyMessageBroadcast =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_BROADCAST);
HdmiCecMessage inactiveSource = HdmiCecMessageBuilder.buildInactiveSource(
mPlaybackLogicalAddress, mPlaybackPhysicalAddress);
@@ -774,12 +793,17 @@
mHdmiCecLocalDevicePlayback.onStandby(false, HdmiControlService.STANDBY_SCREEN_OFF);
mTestLooper.dispatchAll();
- HdmiCecMessage standbyMessageToTv = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV);
- HdmiCecMessage standbyMessageToAudioSystem = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_AUDIO_SYSTEM);
- HdmiCecMessage standbyMessageBroadcast = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_BROADCAST);
+ HdmiCecMessage standbyMessageToTv =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(), ADDR_TV);
+ HdmiCecMessage standbyMessageToAudioSystem =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_AUDIO_SYSTEM);
+ HdmiCecMessage standbyMessageBroadcast =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_BROADCAST);
HdmiCecMessage inactiveSource = HdmiCecMessageBuilder.buildInactiveSource(
mPlaybackLogicalAddress, mPlaybackPhysicalAddress);
@@ -799,12 +823,17 @@
mHdmiCecLocalDevicePlayback.onStandby(false, HdmiControlService.STANDBY_SCREEN_OFF);
mTestLooper.dispatchAll();
- HdmiCecMessage standbyMessageToTv = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV);
- HdmiCecMessage standbyMessageToAudioSystem = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_AUDIO_SYSTEM);
- HdmiCecMessage standbyMessageBroadcast = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_BROADCAST);
+ HdmiCecMessage standbyMessageToTv =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(), ADDR_TV);
+ HdmiCecMessage standbyMessageToAudioSystem =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_AUDIO_SYSTEM);
+ HdmiCecMessage standbyMessageBroadcast =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_BROADCAST);
HdmiCecMessage inactiveSource = HdmiCecMessageBuilder.buildInactiveSource(
mPlaybackLogicalAddress, mPlaybackPhysicalAddress);
@@ -824,12 +853,17 @@
mHdmiCecLocalDevicePlayback.onStandby(false, HdmiControlService.STANDBY_SCREEN_OFF);
mTestLooper.dispatchAll();
- HdmiCecMessage standbyMessageToTv = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV);
- HdmiCecMessage standbyMessageToAudioSystem = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_AUDIO_SYSTEM);
- HdmiCecMessage standbyMessageBroadcast = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_BROADCAST);
+ HdmiCecMessage standbyMessageToTv =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(), ADDR_TV);
+ HdmiCecMessage standbyMessageToAudioSystem =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_AUDIO_SYSTEM);
+ HdmiCecMessage standbyMessageBroadcast =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_BROADCAST);
HdmiCecMessage inactiveSource = HdmiCecMessageBuilder.buildInactiveSource(
mPlaybackLogicalAddress, mPlaybackPhysicalAddress);
@@ -849,12 +883,17 @@
mHdmiCecLocalDevicePlayback.onStandby(false, HdmiControlService.STANDBY_SCREEN_OFF);
mTestLooper.dispatchAll();
- HdmiCecMessage standbyMessageToTv = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV);
- HdmiCecMessage standbyMessageToAudioSystem = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_AUDIO_SYSTEM);
- HdmiCecMessage standbyMessageBroadcast = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_BROADCAST);
+ HdmiCecMessage standbyMessageToTv =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(), ADDR_TV);
+ HdmiCecMessage standbyMessageToAudioSystem =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_AUDIO_SYSTEM);
+ HdmiCecMessage standbyMessageBroadcast =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_BROADCAST);
HdmiCecMessage inactiveSource = HdmiCecMessageBuilder.buildInactiveSource(
mPlaybackLogicalAddress, mPlaybackPhysicalAddress);
@@ -874,12 +913,17 @@
mHdmiCecLocalDevicePlayback.onStandby(false, HdmiControlService.STANDBY_SCREEN_OFF);
mTestLooper.dispatchAll();
- HdmiCecMessage standbyMessageToTv = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV);
- HdmiCecMessage standbyMessageToAudioSystem = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_AUDIO_SYSTEM);
- HdmiCecMessage standbyMessageBroadcast = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_BROADCAST);
+ HdmiCecMessage standbyMessageToTv =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(), ADDR_TV);
+ HdmiCecMessage standbyMessageToAudioSystem =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_AUDIO_SYSTEM);
+ HdmiCecMessage standbyMessageBroadcast =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_BROADCAST);
HdmiCecMessage inactiveSource = HdmiCecMessageBuilder.buildInactiveSource(
mPlaybackLogicalAddress, mPlaybackPhysicalAddress);
@@ -899,10 +943,13 @@
mHdmiCecLocalDevicePlayback.onStandby(true, HdmiControlService.STANDBY_SCREEN_OFF);
mTestLooper.dispatchAll();
- HdmiCecMessage standbyMessageToTv = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV);
- HdmiCecMessage standbyMessageBroadcast = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_BROADCAST);
+ HdmiCecMessage standbyMessageToTv =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(), ADDR_TV);
+ HdmiCecMessage standbyMessageBroadcast =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_BROADCAST);
HdmiCecMessage inactiveSource = HdmiCecMessageBuilder.buildInactiveSource(
mPlaybackLogicalAddress, mPlaybackPhysicalAddress);
@@ -1119,8 +1166,10 @@
HdmiControlManager.POWER_CONTROL_MODE_BROADCAST);
mStandby = false;
// 1. DUT is <AS>.
- HdmiCecMessage message1 = HdmiCecMessageBuilder.buildActiveSource(
- mHdmiCecLocalDevicePlayback.mAddress, mPlaybackPhysicalAddress);
+ HdmiCecMessage message1 =
+ HdmiCecMessageBuilder.buildActiveSource(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ mPlaybackPhysicalAddress);
assertThat(mHdmiCecLocalDevicePlayback.handleActiveSource(message1))
.isEqualTo(Constants.HANDLED);
assertThat(mHdmiCecLocalDevicePlayback.isActiveSource()).isTrue();
@@ -1137,16 +1186,20 @@
mPlaybackPhysicalAddress);
mHdmiCecLocalDevicePlayback.dispatchMessage(setStreamPath);
mTestLooper.dispatchAll();
- HdmiCecMessage activeSource = HdmiCecMessageBuilder.buildActiveSource(
- mHdmiCecLocalDevicePlayback.mAddress, mPlaybackPhysicalAddress);
+ HdmiCecMessage activeSource =
+ HdmiCecMessageBuilder.buildActiveSource(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ mPlaybackPhysicalAddress);
assertThat(mNativeWrapper.getResultMessages()).contains(activeSource);
assertThat(mWokenUp).isTrue();
assertThat(mHdmiCecLocalDevicePlayback.isActiveSource()).isTrue();
// 4. DUT turned off.
mHdmiControlService.onStandby(HdmiControlService.STANDBY_SCREEN_OFF);
mTestLooper.dispatchAll();
- HdmiCecMessage standbyMessageBroadcast = HdmiCecMessageBuilder.buildStandby(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_BROADCAST);
+ HdmiCecMessage standbyMessageBroadcast =
+ HdmiCecMessageBuilder.buildStandby(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_BROADCAST);
assertThat(mNativeWrapper.getResultMessages()).contains(standbyMessageBroadcast);
}
@@ -1158,11 +1211,14 @@
mHdmiCecLocalDevicePlayback.sendVolumeKeyEvent(KeyEvent.KEYCODE_VOLUME_UP, false);
mTestLooper.dispatchAll();
- HdmiCecMessage keyPressed = HdmiCecMessageBuilder.buildUserControlPressed(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV,
- HdmiCecKeycode.CEC_KEYCODE_VOLUME_UP);
- HdmiCecMessage keyReleased = HdmiCecMessageBuilder.buildUserControlReleased(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV);
+ HdmiCecMessage keyPressed =
+ HdmiCecMessageBuilder.buildUserControlPressed(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_TV,
+ HdmiCecKeycode.CEC_KEYCODE_VOLUME_UP);
+ HdmiCecMessage keyReleased =
+ HdmiCecMessageBuilder.buildUserControlReleased(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(keyPressed);
assertThat(mNativeWrapper.getResultMessages()).contains(keyReleased);
@@ -1176,11 +1232,14 @@
mHdmiCecLocalDevicePlayback.sendVolumeKeyEvent(KeyEvent.KEYCODE_VOLUME_DOWN, false);
mTestLooper.dispatchAll();
- HdmiCecMessage keyPressed = HdmiCecMessageBuilder.buildUserControlPressed(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV,
- HdmiCecKeycode.CEC_KEYCODE_VOLUME_DOWN);
- HdmiCecMessage keyReleased = HdmiCecMessageBuilder.buildUserControlReleased(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV);
+ HdmiCecMessage keyPressed =
+ HdmiCecMessageBuilder.buildUserControlPressed(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_TV,
+ HdmiCecKeycode.CEC_KEYCODE_VOLUME_DOWN);
+ HdmiCecMessage keyReleased =
+ HdmiCecMessageBuilder.buildUserControlReleased(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(keyPressed);
assertThat(mNativeWrapper.getResultMessages()).contains(keyReleased);
@@ -1194,11 +1253,14 @@
mHdmiCecLocalDevicePlayback.sendVolumeKeyEvent(KeyEvent.KEYCODE_VOLUME_MUTE, false);
mTestLooper.dispatchAll();
- HdmiCecMessage keyPressed = HdmiCecMessageBuilder.buildUserControlPressed(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV,
- HdmiCecKeycode.CEC_KEYCODE_MUTE);
- HdmiCecMessage keyReleased = HdmiCecMessageBuilder.buildUserControlReleased(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV);
+ HdmiCecMessage keyPressed =
+ HdmiCecMessageBuilder.buildUserControlPressed(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_TV,
+ HdmiCecKeycode.CEC_KEYCODE_MUTE);
+ HdmiCecMessage keyReleased =
+ HdmiCecMessageBuilder.buildUserControlReleased(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(keyPressed);
assertThat(mNativeWrapper.getResultMessages()).contains(keyReleased);
@@ -1212,11 +1274,14 @@
mHdmiCecLocalDevicePlayback.sendVolumeKeyEvent(KeyEvent.KEYCODE_VOLUME_UP, false);
mTestLooper.dispatchAll();
- HdmiCecMessage keyPressed = HdmiCecMessageBuilder.buildUserControlPressed(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV,
- HdmiCecKeycode.CEC_KEYCODE_VOLUME_UP);
- HdmiCecMessage keyReleased = HdmiCecMessageBuilder.buildUserControlReleased(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV);
+ HdmiCecMessage keyPressed =
+ HdmiCecMessageBuilder.buildUserControlPressed(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_TV,
+ HdmiCecKeycode.CEC_KEYCODE_VOLUME_UP);
+ HdmiCecMessage keyReleased =
+ HdmiCecMessageBuilder.buildUserControlReleased(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(keyPressed);
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(keyReleased);
@@ -1230,11 +1295,14 @@
mHdmiCecLocalDevicePlayback.sendVolumeKeyEvent(KeyEvent.KEYCODE_VOLUME_DOWN, false);
mTestLooper.dispatchAll();
- HdmiCecMessage keyPressed = HdmiCecMessageBuilder.buildUserControlPressed(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV,
- HdmiCecKeycode.CEC_KEYCODE_VOLUME_UP);
- HdmiCecMessage keyReleased = HdmiCecMessageBuilder.buildUserControlReleased(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV);
+ HdmiCecMessage keyPressed =
+ HdmiCecMessageBuilder.buildUserControlPressed(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_TV,
+ HdmiCecKeycode.CEC_KEYCODE_VOLUME_UP);
+ HdmiCecMessage keyReleased =
+ HdmiCecMessageBuilder.buildUserControlReleased(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(keyPressed);
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(keyReleased);
@@ -1248,11 +1316,14 @@
mHdmiCecLocalDevicePlayback.sendVolumeKeyEvent(KeyEvent.KEYCODE_VOLUME_MUTE, false);
mTestLooper.dispatchAll();
- HdmiCecMessage keyPressed = HdmiCecMessageBuilder.buildUserControlPressed(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV,
- HdmiCecKeycode.CEC_KEYCODE_VOLUME_UP);
- HdmiCecMessage keyReleased = HdmiCecMessageBuilder.buildUserControlReleased(
- mHdmiCecLocalDevicePlayback.mAddress, ADDR_TV);
+ HdmiCecMessage keyPressed =
+ HdmiCecMessageBuilder.buildUserControlPressed(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ ADDR_TV,
+ HdmiCecKeycode.CEC_KEYCODE_VOLUME_UP);
+ HdmiCecMessage keyReleased =
+ HdmiCecMessageBuilder.buildUserControlReleased(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(keyPressed);
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(keyReleased);
@@ -1347,8 +1418,10 @@
mHdmiCecLocalDevicePlayback.dispatchMessage(setStreamPath);
mTestLooper.dispatchAll();
- HdmiCecMessage activeSource = HdmiCecMessageBuilder.buildActiveSource(
- mHdmiCecLocalDevicePlayback.mAddress, mPlaybackPhysicalAddress);
+ HdmiCecMessage activeSource =
+ HdmiCecMessageBuilder.buildActiveSource(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ mPlaybackPhysicalAddress);
assertThat(mNativeWrapper.getResultMessages()).contains(activeSource);
}
@@ -1606,8 +1679,10 @@
@Test
public void getActiveSource_localPlaybackIsActiveSource() {
- mHdmiControlService.setActiveSource(mHdmiCecLocalDevicePlayback.mAddress,
- mHdmiControlService.getPhysicalAddress(), "HdmiControlServiceTest");
+ mHdmiControlService.setActiveSource(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ mHdmiControlService.getPhysicalAddress(),
+ "HdmiControlServiceTest");
assertThat(mHdmiControlService.getActiveSource()).isEqualTo(
mHdmiCecLocalDevicePlayback.getDeviceInfo());
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTest.java b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTest.java
index 6c2db36..2f72809 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTest.java
@@ -386,9 +386,13 @@
@Test
public void handleCecVersion_isHandled() {
- @Constants.HandleMessageResult int result = mHdmiLocalDevice.onMessage(
- HdmiCecMessageBuilder.buildCecVersion(ADDR_PLAYBACK_1, mHdmiLocalDevice.mAddress,
- HdmiControlManager.HDMI_CEC_VERSION_1_4_B));
+ @Constants.HandleMessageResult
+ int result =
+ mHdmiLocalDevice.onMessage(
+ HdmiCecMessageBuilder.buildCecVersion(
+ ADDR_PLAYBACK_1,
+ mHdmiLocalDevice.getDeviceInfo().getLogicalAddress(),
+ HdmiControlManager.HDMI_CEC_VERSION_1_4_B));
assertEquals(Constants.HANDLED, result);
}
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTvTest.java b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTvTest.java
index 5a2f7bb..a0fcd83 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTvTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTvTest.java
@@ -515,8 +515,11 @@
HdmiCecFeatureAction systemAudioAutoInitiationAction =
new SystemAudioAutoInitiationAction(mHdmiCecLocalDeviceTv, ADDR_AUDIO_SYSTEM);
mHdmiCecLocalDeviceTv.addAndStartAction(systemAudioAutoInitiationAction);
- HdmiCecMessage reportSystemAudioMode = HdmiCecMessageBuilder.buildReportSystemAudioMode(
- ADDR_AUDIO_SYSTEM, mHdmiCecLocalDeviceTv.mAddress, true);
+ HdmiCecMessage reportSystemAudioMode =
+ HdmiCecMessageBuilder.buildReportSystemAudioMode(
+ ADDR_AUDIO_SYSTEM,
+ mHdmiCecLocalDeviceTv.getDeviceInfo().getLogicalAddress(),
+ true);
mHdmiControlService.handleCecCommand(reportSystemAudioMode);
mTestLooper.dispatchAll();
@@ -548,8 +551,11 @@
new SystemAudioAutoInitiationAction(mHdmiCecLocalDeviceTv, ADDR_AUDIO_SYSTEM);
mHdmiCecLocalDeviceTv.addAndStartAction(systemAudioAutoInitiationAction);
- HdmiCecMessage reportSystemAudioMode = HdmiCecMessageBuilder.buildReportSystemAudioMode(
- ADDR_AUDIO_SYSTEM, mHdmiCecLocalDeviceTv.mAddress, true);
+ HdmiCecMessage reportSystemAudioMode =
+ HdmiCecMessageBuilder.buildReportSystemAudioMode(
+ ADDR_AUDIO_SYSTEM,
+ mHdmiCecLocalDeviceTv.getDeviceInfo().getLogicalAddress(),
+ true);
mHdmiControlService.handleCecCommand(reportSystemAudioMode);
HdmiCecMessage requestArcInitiation = HdmiCecMessageBuilder.buildInitiateArc(
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecPowerStatusControllerTest.java b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecPowerStatusControllerTest.java
index dc633a2..ceb41cf 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecPowerStatusControllerTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecPowerStatusControllerTest.java
@@ -184,9 +184,11 @@
mHdmiCecPowerStatusController.setPowerStatus(HdmiControlManager.POWER_STATUS_ON);
mTestLooper.dispatchAll();
- HdmiCecMessage reportPowerStatus = HdmiCecMessageBuilder.buildReportPowerStatus(
- mHdmiCecLocalDevicePlayback.mAddress, Constants.ADDR_BROADCAST,
- HdmiControlManager.POWER_STATUS_ON);
+ HdmiCecMessage reportPowerStatus =
+ HdmiCecMessageBuilder.buildReportPowerStatus(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ Constants.ADDR_BROADCAST,
+ HdmiControlManager.POWER_STATUS_ON);
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(reportPowerStatus);
}
@@ -197,9 +199,11 @@
HdmiControlManager.POWER_STATUS_TRANSIENT_TO_ON);
mTestLooper.dispatchAll();
- HdmiCecMessage reportPowerStatus = HdmiCecMessageBuilder.buildReportPowerStatus(
- mHdmiCecLocalDevicePlayback.mAddress, Constants.ADDR_BROADCAST,
- HdmiControlManager.POWER_STATUS_TRANSIENT_TO_ON);
+ HdmiCecMessage reportPowerStatus =
+ HdmiCecMessageBuilder.buildReportPowerStatus(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ Constants.ADDR_BROADCAST,
+ HdmiControlManager.POWER_STATUS_TRANSIENT_TO_ON);
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(reportPowerStatus);
}
@@ -210,9 +214,11 @@
HdmiControlManager.POWER_STATUS_TRANSIENT_TO_ON, false);
mTestLooper.dispatchAll();
- HdmiCecMessage reportPowerStatus = HdmiCecMessageBuilder.buildReportPowerStatus(
- mHdmiCecLocalDevicePlayback.mAddress, Constants.ADDR_BROADCAST,
- HdmiControlManager.POWER_STATUS_TRANSIENT_TO_ON);
+ HdmiCecMessage reportPowerStatus =
+ HdmiCecMessageBuilder.buildReportPowerStatus(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ Constants.ADDR_BROADCAST,
+ HdmiControlManager.POWER_STATUS_TRANSIENT_TO_ON);
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(reportPowerStatus);
}
@@ -222,9 +228,11 @@
mHdmiCecPowerStatusController.setPowerStatus(HdmiControlManager.POWER_STATUS_ON);
mTestLooper.dispatchAll();
- HdmiCecMessage reportPowerStatus = HdmiCecMessageBuilder.buildReportPowerStatus(
- mHdmiCecLocalDevicePlayback.mAddress, Constants.ADDR_BROADCAST,
- HdmiControlManager.POWER_STATUS_ON);
+ HdmiCecMessage reportPowerStatus =
+ HdmiCecMessageBuilder.buildReportPowerStatus(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ Constants.ADDR_BROADCAST,
+ HdmiControlManager.POWER_STATUS_ON);
assertThat(mNativeWrapper.getResultMessages()).contains(reportPowerStatus);
}
@@ -235,9 +243,11 @@
HdmiControlManager.POWER_STATUS_TRANSIENT_TO_ON);
mTestLooper.dispatchAll();
- HdmiCecMessage reportPowerStatus = HdmiCecMessageBuilder.buildReportPowerStatus(
- mHdmiCecLocalDevicePlayback.mAddress, Constants.ADDR_BROADCAST,
- HdmiControlManager.POWER_STATUS_TRANSIENT_TO_ON);
+ HdmiCecMessage reportPowerStatus =
+ HdmiCecMessageBuilder.buildReportPowerStatus(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ Constants.ADDR_BROADCAST,
+ HdmiControlManager.POWER_STATUS_TRANSIENT_TO_ON);
assertThat(mNativeWrapper.getResultMessages()).contains(reportPowerStatus);
}
@@ -248,9 +258,11 @@
HdmiControlManager.POWER_STATUS_TRANSIENT_TO_ON, false);
mTestLooper.dispatchAll();
- HdmiCecMessage reportPowerStatus = HdmiCecMessageBuilder.buildReportPowerStatus(
- mHdmiCecLocalDevicePlayback.mAddress, Constants.ADDR_BROADCAST,
- HdmiControlManager.POWER_STATUS_TRANSIENT_TO_ON);
+ HdmiCecMessage reportPowerStatus =
+ HdmiCecMessageBuilder.buildReportPowerStatus(
+ mHdmiCecLocalDevicePlayback.getDeviceInfo().getLogicalAddress(),
+ Constants.ADDR_BROADCAST,
+ HdmiControlManager.POWER_STATUS_TRANSIENT_TO_ON);
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(reportPowerStatus);
}
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/HdmiControlServiceTest.java b/services/tests/servicestests/src/com/android/server/hdmi/HdmiControlServiceTest.java
index 755eef3..2704308 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/HdmiControlServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/HdmiControlServiceTest.java
@@ -735,9 +735,11 @@
mHdmiControlServiceSpy.allocateLogicalAddress(mLocalDevices, INITIATED_BY_ENABLE_CEC);
mTestLooper.dispatchAll();
- HdmiCecMessage reportPowerStatus = HdmiCecMessageBuilder.buildReportPowerStatus(
- Constants.ADDR_TV,
- mHdmiControlServiceSpy.playback().mAddress, HdmiControlManager.POWER_STATUS_ON);
+ HdmiCecMessage reportPowerStatus =
+ HdmiCecMessageBuilder.buildReportPowerStatus(
+ Constants.ADDR_TV,
+ mHdmiControlServiceSpy.playback().getDeviceInfo().getLogicalAddress(),
+ HdmiControlManager.POWER_STATUS_ON);
mNativeWrapper.onCecMessage(reportPowerStatus);
mTestLooper.dispatchAll();
@@ -756,10 +758,11 @@
mHdmiControlServiceSpy.allocateLogicalAddress(mLocalDevices, INITIATED_BY_ENABLE_CEC);
mTestLooper.dispatchAll();
- HdmiCecMessage reportPowerStatus = HdmiCecMessageBuilder.buildReportPowerStatus(
- Constants.ADDR_TV,
- mHdmiControlServiceSpy.playback().mAddress,
- HdmiControlManager.POWER_STATUS_STANDBY);
+ HdmiCecMessage reportPowerStatus =
+ HdmiCecMessageBuilder.buildReportPowerStatus(
+ Constants.ADDR_TV,
+ mHdmiControlServiceSpy.playback().getDeviceInfo().getLogicalAddress(),
+ HdmiControlManager.POWER_STATUS_STANDBY);
mNativeWrapper.onCecMessage(reportPowerStatus);
mTestLooper.dispatchAll();
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/OneTouchPlayActionTest.java b/services/tests/servicestests/src/com/android/server/hdmi/OneTouchPlayActionTest.java
index 9466f52..d5b116f 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/OneTouchPlayActionTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/OneTouchPlayActionTest.java
@@ -175,20 +175,27 @@
playbackDevice.addAndStartAction(action);
mTestLooper.dispatchAll();
- HdmiCecMessage activeSource = HdmiCecMessageBuilder.buildActiveSource(
- playbackDevice.mAddress, mPhysicalAddress);
- HdmiCecMessage textViewOn = HdmiCecMessageBuilder.buildTextViewOn(playbackDevice.mAddress,
- ADDR_TV);
- HdmiCecMessage giveDevicePowerStatus = HdmiCecMessageBuilder
- .buildGiveDevicePowerStatus(playbackDevice.mAddress, ADDR_TV);
+ HdmiCecMessage activeSource =
+ HdmiCecMessageBuilder.buildActiveSource(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), mPhysicalAddress);
+ HdmiCecMessage textViewOn =
+ HdmiCecMessageBuilder.buildTextViewOn(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
+ HdmiCecMessage giveDevicePowerStatus =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(textViewOn);
assertThat(mNativeWrapper.getResultMessages()).contains(activeSource);
assertThat(mNativeWrapper.getResultMessages()).contains(giveDevicePowerStatus);
mNativeWrapper.clearResultMessages();
assertThat(actionTimer.getState()).isEqualTo(STATE_WAITING_FOR_REPORT_POWER_STATUS);
- HdmiCecMessage reportPowerStatusOn = new HdmiCecMessage(
- ADDR_TV, playbackDevice.mAddress, Constants.MESSAGE_REPORT_POWER_STATUS, POWER_ON);
+ HdmiCecMessage reportPowerStatusOn =
+ new HdmiCecMessage(
+ ADDR_TV,
+ playbackDevice.getDeviceInfo().getLogicalAddress(),
+ Constants.MESSAGE_REPORT_POWER_STATUS,
+ POWER_ON);
action.processCommand(reportPowerStatusOn);
mTestLooper.dispatchAll();
@@ -218,20 +225,27 @@
playbackDevice.addAndStartAction(action);
mTestLooper.dispatchAll();
- HdmiCecMessage activeSource = HdmiCecMessageBuilder.buildActiveSource(
- playbackDevice.mAddress, mPhysicalAddress);
- HdmiCecMessage textViewOn = HdmiCecMessageBuilder.buildTextViewOn(playbackDevice.mAddress,
- ADDR_TV);
- HdmiCecMessage giveDevicePowerStatus = HdmiCecMessageBuilder
- .buildGiveDevicePowerStatus(playbackDevice.mAddress, ADDR_TV);
+ HdmiCecMessage activeSource =
+ HdmiCecMessageBuilder.buildActiveSource(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), mPhysicalAddress);
+ HdmiCecMessage textViewOn =
+ HdmiCecMessageBuilder.buildTextViewOn(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
+ HdmiCecMessage giveDevicePowerStatus =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(textViewOn);
assertThat(mNativeWrapper.getResultMessages()).contains(activeSource);
assertThat(mNativeWrapper.getResultMessages()).contains(giveDevicePowerStatus);
mNativeWrapper.clearResultMessages();
assertThat(actionTimer.getState()).isEqualTo(STATE_WAITING_FOR_REPORT_POWER_STATUS);
- HdmiCecMessage reportPowerStatusOn = new HdmiCecMessage(
- ADDR_TV, playbackDevice.mAddress, Constants.MESSAGE_REPORT_POWER_STATUS, POWER_ON);
+ HdmiCecMessage reportPowerStatusOn =
+ new HdmiCecMessage(
+ ADDR_TV,
+ playbackDevice.getDeviceInfo().getLogicalAddress(),
+ Constants.MESSAGE_REPORT_POWER_STATUS,
+ POWER_ON);
action.processCommand(reportPowerStatusOn);
mTestLooper.dispatchAll();
@@ -261,21 +275,27 @@
playbackDevice.addAndStartAction(action);
mTestLooper.dispatchAll();
- HdmiCecMessage activeSource = HdmiCecMessageBuilder.buildActiveSource(
- playbackDevice.mAddress, mPhysicalAddress);
- HdmiCecMessage textViewOn = HdmiCecMessageBuilder.buildTextViewOn(playbackDevice.mAddress,
- ADDR_TV);
- HdmiCecMessage giveDevicePowerStatus = HdmiCecMessageBuilder
- .buildGiveDevicePowerStatus(playbackDevice.mAddress, ADDR_TV);
+ HdmiCecMessage activeSource =
+ HdmiCecMessageBuilder.buildActiveSource(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), mPhysicalAddress);
+ HdmiCecMessage textViewOn =
+ HdmiCecMessageBuilder.buildTextViewOn(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
+ HdmiCecMessage giveDevicePowerStatus =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(textViewOn);
assertThat(mNativeWrapper.getResultMessages()).contains(activeSource);
assertThat(mNativeWrapper.getResultMessages()).contains(giveDevicePowerStatus);
mNativeWrapper.clearResultMessages();
assertThat(actionTimer.getState()).isEqualTo(STATE_WAITING_FOR_REPORT_POWER_STATUS);
- HdmiCecMessage reportPowerStatusTransientToOn = new HdmiCecMessage(
- ADDR_TV, playbackDevice.mAddress, Constants.MESSAGE_REPORT_POWER_STATUS,
- POWER_TRANSIENT_TO_ON);
+ HdmiCecMessage reportPowerStatusTransientToOn =
+ new HdmiCecMessage(
+ ADDR_TV,
+ playbackDevice.getDeviceInfo().getLogicalAddress(),
+ Constants.MESSAGE_REPORT_POWER_STATUS,
+ POWER_TRANSIENT_TO_ON);
action.processCommand(reportPowerStatusTransientToOn);
action.handleTimerEvent(STATE_WAITING_FOR_REPORT_POWER_STATUS);
mTestLooper.dispatchAll();
@@ -283,8 +303,12 @@
assertThat(mNativeWrapper.getResultMessages()).contains(giveDevicePowerStatus);
mNativeWrapper.clearResultMessages();
- HdmiCecMessage reportPowerStatusOn = new HdmiCecMessage(
- ADDR_TV, playbackDevice.mAddress, Constants.MESSAGE_REPORT_POWER_STATUS, POWER_ON);
+ HdmiCecMessage reportPowerStatusOn =
+ new HdmiCecMessage(
+ ADDR_TV,
+ playbackDevice.getDeviceInfo().getLogicalAddress(),
+ Constants.MESSAGE_REPORT_POWER_STATUS,
+ POWER_ON);
action.processCommand(reportPowerStatusOn);
mTestLooper.dispatchAll();
@@ -314,12 +338,15 @@
playbackDevice.addAndStartAction(action);
mTestLooper.dispatchAll();
- HdmiCecMessage activeSource = HdmiCecMessageBuilder.buildActiveSource(
- playbackDevice.mAddress, mPhysicalAddress);
- HdmiCecMessage textViewOn = HdmiCecMessageBuilder.buildTextViewOn(playbackDevice.mAddress,
- ADDR_TV);
- HdmiCecMessage giveDevicePowerStatus = HdmiCecMessageBuilder
- .buildGiveDevicePowerStatus(playbackDevice.mAddress, ADDR_TV);
+ HdmiCecMessage activeSource =
+ HdmiCecMessageBuilder.buildActiveSource(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), mPhysicalAddress);
+ HdmiCecMessage textViewOn =
+ HdmiCecMessageBuilder.buildTextViewOn(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
+ HdmiCecMessage giveDevicePowerStatus =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(textViewOn);
assertThat(mNativeWrapper.getResultMessages()).contains(activeSource);
@@ -360,12 +387,15 @@
playbackDevice.addAndStartAction(action);
mTestLooper.dispatchAll();
- HdmiCecMessage activeSource = HdmiCecMessageBuilder.buildActiveSource(
- playbackDevice.mAddress, mPhysicalAddress);
- HdmiCecMessage textViewOn = HdmiCecMessageBuilder.buildTextViewOn(playbackDevice.mAddress,
- ADDR_TV);
- HdmiCecMessage giveDevicePowerStatus = HdmiCecMessageBuilder
- .buildGiveDevicePowerStatus(playbackDevice.mAddress, ADDR_TV);
+ HdmiCecMessage activeSource =
+ HdmiCecMessageBuilder.buildActiveSource(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), mPhysicalAddress);
+ HdmiCecMessage textViewOn =
+ HdmiCecMessageBuilder.buildTextViewOn(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
+ HdmiCecMessage giveDevicePowerStatus =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(textViewOn);
assertThat(mNativeWrapper.getResultMessages()).contains(activeSource);
@@ -395,20 +425,27 @@
playbackDevice.addAndStartAction(action);
mTestLooper.dispatchAll();
- HdmiCecMessage activeSource = HdmiCecMessageBuilder.buildActiveSource(
- playbackDevice.mAddress, mPhysicalAddress);
- HdmiCecMessage textViewOn = HdmiCecMessageBuilder.buildTextViewOn(playbackDevice.mAddress,
- ADDR_TV);
- HdmiCecMessage giveDevicePowerStatus = HdmiCecMessageBuilder
- .buildGiveDevicePowerStatus(playbackDevice.mAddress, ADDR_TV);
+ HdmiCecMessage activeSource =
+ HdmiCecMessageBuilder.buildActiveSource(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), mPhysicalAddress);
+ HdmiCecMessage textViewOn =
+ HdmiCecMessageBuilder.buildTextViewOn(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
+ HdmiCecMessage giveDevicePowerStatus =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(textViewOn);
assertThat(mNativeWrapper.getResultMessages()).contains(activeSource);
assertThat(mNativeWrapper.getResultMessages()).contains(giveDevicePowerStatus);
mNativeWrapper.clearResultMessages();
assertThat(actionTimer.getState()).isEqualTo(STATE_WAITING_FOR_REPORT_POWER_STATUS);
- HdmiCecMessage reportPowerStatusOn = new HdmiCecMessage(
- ADDR_TV, playbackDevice.mAddress, Constants.MESSAGE_REPORT_POWER_STATUS, POWER_ON);
+ HdmiCecMessage reportPowerStatusOn =
+ new HdmiCecMessage(
+ ADDR_TV,
+ playbackDevice.getDeviceInfo().getLogicalAddress(),
+ Constants.MESSAGE_REPORT_POWER_STATUS,
+ POWER_ON);
action.processCommand(reportPowerStatusOn);
mTestLooper.dispatchAll();
@@ -440,20 +477,27 @@
playbackDevice.addAndStartAction(action);
mTestLooper.dispatchAll();
- HdmiCecMessage activeSource = HdmiCecMessageBuilder.buildActiveSource(
- playbackDevice.mAddress, mPhysicalAddress);
- HdmiCecMessage textViewOn = HdmiCecMessageBuilder.buildTextViewOn(playbackDevice.mAddress,
- ADDR_TV);
- HdmiCecMessage giveDevicePowerStatus = HdmiCecMessageBuilder
- .buildGiveDevicePowerStatus(playbackDevice.mAddress, ADDR_TV);
+ HdmiCecMessage activeSource =
+ HdmiCecMessageBuilder.buildActiveSource(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), mPhysicalAddress);
+ HdmiCecMessage textViewOn =
+ HdmiCecMessageBuilder.buildTextViewOn(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
+ HdmiCecMessage giveDevicePowerStatus =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(textViewOn);
assertThat(mNativeWrapper.getResultMessages()).contains(activeSource);
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(giveDevicePowerStatus);
mNativeWrapper.clearResultMessages();
assertThat(actionTimer.getState()).isEqualTo(STATE_WAITING_FOR_REPORT_POWER_STATUS);
- HdmiCecMessage reportPowerStatusOn = new HdmiCecMessage(
- ADDR_TV, playbackDevice.mAddress, Constants.MESSAGE_REPORT_POWER_STATUS, POWER_ON);
+ HdmiCecMessage reportPowerStatusOn =
+ new HdmiCecMessage(
+ ADDR_TV,
+ playbackDevice.getDeviceInfo().getLogicalAddress(),
+ Constants.MESSAGE_REPORT_POWER_STATUS,
+ POWER_ON);
action.processCommand(reportPowerStatusOn);
mTestLooper.dispatchAll();
@@ -487,11 +531,11 @@
mTestLooper.dispatchAll();
- HdmiCecMessage reportPowerStatusMessage = HdmiCecMessageBuilder.buildReportPowerStatus(
- Constants.ADDR_TV,
- playbackDevice.mAddress,
- HdmiControlManager.POWER_STATUS_ON
- );
+ HdmiCecMessage reportPowerStatusMessage =
+ HdmiCecMessageBuilder.buildReportPowerStatus(
+ Constants.ADDR_TV,
+ playbackDevice.getDeviceInfo().getLogicalAddress(),
+ HdmiControlManager.POWER_STATUS_ON);
mNativeWrapper.onCecMessage(reportPowerStatusMessage);
mTestLooper.dispatchAll();
@@ -499,10 +543,12 @@
assertThat(mHdmiControlService.isAddressAllocated()).isTrue();
assertThat(callback.getResult()).isEqualTo(HdmiControlManager.RESULT_SUCCESS);
assertThat(playbackDevice.isActiveSource()).isTrue();
- HdmiCecMessage activeSource = HdmiCecMessageBuilder.buildActiveSource(
- playbackDevice.mAddress, mPhysicalAddress);
- HdmiCecMessage textViewOn = HdmiCecMessageBuilder.buildTextViewOn(playbackDevice.mAddress,
- ADDR_TV);
+ HdmiCecMessage activeSource =
+ HdmiCecMessageBuilder.buildActiveSource(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), mPhysicalAddress);
+ HdmiCecMessage textViewOn =
+ HdmiCecMessageBuilder.buildTextViewOn(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(activeSource);
assertThat(mNativeWrapper.getResultMessages()).contains(textViewOn);
}
@@ -523,21 +569,23 @@
TestCallback callback = new TestCallback();
mHdmiControlService.oneTouchPlay(callback);
- HdmiCecMessage reportPowerStatusMessage = HdmiCecMessageBuilder.buildReportPowerStatus(
- Constants.ADDR_TV,
- playbackDevice.mAddress,
- HdmiControlManager.POWER_STATUS_ON
- );
+ HdmiCecMessage reportPowerStatusMessage =
+ HdmiCecMessageBuilder.buildReportPowerStatus(
+ Constants.ADDR_TV,
+ playbackDevice.getDeviceInfo().getLogicalAddress(),
+ HdmiControlManager.POWER_STATUS_ON);
mNativeWrapper.onCecMessage(reportPowerStatusMessage);
mTestLooper.dispatchAll();
assertThat(callback.getResult()).isEqualTo(HdmiControlManager.RESULT_SUCCESS);
assertThat(playbackDevice.isActiveSource()).isTrue();
- HdmiCecMessage activeSource = HdmiCecMessageBuilder.buildActiveSource(
- playbackDevice.mAddress, mPhysicalAddress);
- HdmiCecMessage textViewOn = HdmiCecMessageBuilder.buildTextViewOn(playbackDevice.mAddress,
- ADDR_TV);
+ HdmiCecMessage activeSource =
+ HdmiCecMessageBuilder.buildActiveSource(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), mPhysicalAddress);
+ HdmiCecMessage textViewOn =
+ HdmiCecMessageBuilder.buildTextViewOn(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(activeSource);
assertThat(mNativeWrapper.getResultMessages()).contains(textViewOn);
}
@@ -574,8 +622,9 @@
mHdmiControlService.onStandby(HdmiControlService.STANDBY_SCREEN_OFF);
mTestLooper.dispatchAll();
- HdmiCecMessage standbyMessage = HdmiCecMessageBuilder.buildStandby(
- playbackDevice.mAddress, ADDR_TV);
+ HdmiCecMessage standbyMessage =
+ HdmiCecMessageBuilder.buildStandby(
+ playbackDevice.getDeviceInfo().getLogicalAddress(), ADDR_TV);
assertThat(mNativeWrapper.getResultMessages()).contains(standbyMessage);
}
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/PowerStatusMonitorActionTest.java b/services/tests/servicestests/src/com/android/server/hdmi/PowerStatusMonitorActionTest.java
index a9880c0..60c0f41 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/PowerStatusMonitorActionTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/PowerStatusMonitorActionTest.java
@@ -156,9 +156,9 @@
assertPowerStatus(ADDR_PLAYBACK_1, HdmiControlManager.POWER_STATUS_UNKNOWN);
mTestLooper.dispatchAll();
- HdmiCecMessage giveDevicePowerStatus = HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
- mTvDevice.mAddress,
- ADDR_PLAYBACK_1);
+ HdmiCecMessage giveDevicePowerStatus =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ mTvDevice.getDeviceInfo().getLogicalAddress(), ADDR_PLAYBACK_1);
assertThat(mNativeWrapper.getResultMessages()).contains(giveDevicePowerStatus);
reportPowerStatus(ADDR_PLAYBACK_1, false, HdmiControlManager.POWER_STATUS_ON);
@@ -195,9 +195,9 @@
assertPowerStatus(ADDR_PLAYBACK_1, HdmiControlManager.POWER_STATUS_ON);
mTestLooper.dispatchAll();
- HdmiCecMessage giveDevicePowerStatus = HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
- mTvDevice.mAddress,
- ADDR_PLAYBACK_1);
+ HdmiCecMessage giveDevicePowerStatus =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ mTvDevice.getDeviceInfo().getLogicalAddress(), ADDR_PLAYBACK_1);
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(giveDevicePowerStatus);
@@ -224,14 +224,14 @@
action.start();
mTestLooper.dispatchAll();
- HdmiCecMessage giveDevicePowerStatus = HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
- mTvDevice.mAddress,
- ADDR_PLAYBACK_1);
+ HdmiCecMessage giveDevicePowerStatus =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ mTvDevice.getDeviceInfo().getLogicalAddress(), ADDR_PLAYBACK_1);
assertThat(mNativeWrapper.getResultMessages()).contains(giveDevicePowerStatus);
- HdmiCecMessage giveDevicePowerStatus2 = HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
- mTvDevice.mAddress,
- ADDR_PLAYBACK_2);
+ HdmiCecMessage giveDevicePowerStatus2 =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ mTvDevice.getDeviceInfo().getLogicalAddress(), ADDR_PLAYBACK_2);
assertThat(mNativeWrapper.getResultMessages()).contains(giveDevicePowerStatus2);
}
@@ -249,15 +249,15 @@
action.start();
mTestLooper.dispatchAll();
- HdmiCecMessage giveDevicePowerStatus = HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
- mTvDevice.mAddress,
- ADDR_PLAYBACK_1);
+ HdmiCecMessage giveDevicePowerStatus =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ mTvDevice.getDeviceInfo().getLogicalAddress(), ADDR_PLAYBACK_1);
assertThat(mNativeWrapper.getResultMessages()).contains(giveDevicePowerStatus);
- HdmiCecMessage giveDevicePowerStatus2 = HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
- mTvDevice.mAddress,
- ADDR_PLAYBACK_2);
+ HdmiCecMessage giveDevicePowerStatus2 =
+ HdmiCecMessageBuilder.buildGiveDevicePowerStatus(
+ mTvDevice.getDeviceInfo().getLogicalAddress(), ADDR_PLAYBACK_2);
assertThat(mNativeWrapper.getResultMessages()).doesNotContain(giveDevicePowerStatus2);
}
@@ -270,7 +270,8 @@
}
private void reportPowerStatus(int logicalAddress, boolean broadcast, int powerStatus) {
- int destination = broadcast ? ADDR_BROADCAST : mTvDevice.mAddress;
+ int destination =
+ broadcast ? ADDR_BROADCAST : mTvDevice.getDeviceInfo().getLogicalAddress();
HdmiCecMessage reportPowerStatus = HdmiCecMessageBuilder.buildReportPowerStatus(
logicalAddress, destination,
powerStatus);
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/SystemAudioAutoInitiationActionTest.java b/services/tests/servicestests/src/com/android/server/hdmi/SystemAudioAutoInitiationActionTest.java
index 290e4b0..c650f4b 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/SystemAudioAutoInitiationActionTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/SystemAudioAutoInitiationActionTest.java
@@ -167,12 +167,16 @@
HdmiCecMessage giveSystemAudioModeStatus =
HdmiCecMessageBuilder.buildGiveSystemAudioModeStatus(
- mHdmiCecLocalDeviceTv.mAddress, ADDR_AUDIO_SYSTEM);
+ mHdmiCecLocalDeviceTv.getDeviceInfo().getLogicalAddress(),
+ ADDR_AUDIO_SYSTEM);
assertThat(mNativeWrapper.getResultMessages()).contains(giveSystemAudioModeStatus);
- HdmiCecMessage reportSystemAudioMode = HdmiCecMessageBuilder.buildReportSystemAudioMode(
- ADDR_AUDIO_SYSTEM, mHdmiCecLocalDeviceTv.mAddress, true);
+ HdmiCecMessage reportSystemAudioMode =
+ HdmiCecMessageBuilder.buildReportSystemAudioMode(
+ ADDR_AUDIO_SYSTEM,
+ mHdmiCecLocalDeviceTv.getDeviceInfo().getLogicalAddress(),
+ true);
mHdmiControlService.handleCecCommand(reportSystemAudioMode);
mTestLooper.dispatchAll();
@@ -193,12 +197,16 @@
HdmiCecMessage giveSystemAudioModeStatus =
HdmiCecMessageBuilder.buildGiveSystemAudioModeStatus(
- mHdmiCecLocalDeviceTv.mAddress, ADDR_AUDIO_SYSTEM);
+ mHdmiCecLocalDeviceTv.getDeviceInfo().getLogicalAddress(),
+ ADDR_AUDIO_SYSTEM);
assertThat(mNativeWrapper.getResultMessages()).contains(giveSystemAudioModeStatus);
- HdmiCecMessage reportSystemAudioMode = HdmiCecMessageBuilder.buildReportSystemAudioMode(
- ADDR_AUDIO_SYSTEM, mHdmiCecLocalDeviceTv.mAddress, true);
+ HdmiCecMessage reportSystemAudioMode =
+ HdmiCecMessageBuilder.buildReportSystemAudioMode(
+ ADDR_AUDIO_SYSTEM,
+ mHdmiCecLocalDeviceTv.getDeviceInfo().getLogicalAddress(),
+ true);
mHdmiControlService.handleCecCommand(reportSystemAudioMode);
mTestLooper.dispatchAll();
@@ -217,12 +225,16 @@
HdmiCecMessage giveSystemAudioModeStatus =
HdmiCecMessageBuilder.buildGiveSystemAudioModeStatus(
- mHdmiCecLocalDeviceTv.mAddress, ADDR_AUDIO_SYSTEM);
+ mHdmiCecLocalDeviceTv.getDeviceInfo().getLogicalAddress(),
+ ADDR_AUDIO_SYSTEM);
assertThat(mNativeWrapper.getResultMessages()).contains(giveSystemAudioModeStatus);
- HdmiCecMessage reportSystemAudioMode = HdmiCecMessageBuilder.buildReportSystemAudioMode(
- ADDR_AUDIO_SYSTEM, mHdmiCecLocalDeviceTv.mAddress, false);
+ HdmiCecMessage reportSystemAudioMode =
+ HdmiCecMessageBuilder.buildReportSystemAudioMode(
+ ADDR_AUDIO_SYSTEM,
+ mHdmiCecLocalDeviceTv.getDeviceInfo().getLogicalAddress(),
+ false);
mHdmiControlService.handleCecCommand(reportSystemAudioMode);
mTestLooper.dispatchAll();
@@ -244,12 +256,16 @@
HdmiCecMessage giveSystemAudioModeStatus =
HdmiCecMessageBuilder.buildGiveSystemAudioModeStatus(
- mHdmiCecLocalDeviceTv.mAddress, ADDR_AUDIO_SYSTEM);
+ mHdmiCecLocalDeviceTv.getDeviceInfo().getLogicalAddress(),
+ ADDR_AUDIO_SYSTEM);
assertThat(mNativeWrapper.getResultMessages()).contains(giveSystemAudioModeStatus);
- HdmiCecMessage reportSystemAudioMode = HdmiCecMessageBuilder.buildReportSystemAudioMode(
- ADDR_AUDIO_SYSTEM, mHdmiCecLocalDeviceTv.mAddress, true);
+ HdmiCecMessage reportSystemAudioMode =
+ HdmiCecMessageBuilder.buildReportSystemAudioMode(
+ ADDR_AUDIO_SYSTEM,
+ mHdmiCecLocalDeviceTv.getDeviceInfo().getLogicalAddress(),
+ true);
mHdmiControlService.handleCecCommand(reportSystemAudioMode);
mTestLooper.dispatchAll();
@@ -271,12 +287,16 @@
HdmiCecMessage giveSystemAudioModeStatus =
HdmiCecMessageBuilder.buildGiveSystemAudioModeStatus(
- mHdmiCecLocalDeviceTv.mAddress, ADDR_AUDIO_SYSTEM);
+ mHdmiCecLocalDeviceTv.getDeviceInfo().getLogicalAddress(),
+ ADDR_AUDIO_SYSTEM);
assertThat(mNativeWrapper.getResultMessages()).contains(giveSystemAudioModeStatus);
- HdmiCecMessage reportSystemAudioMode = HdmiCecMessageBuilder.buildReportSystemAudioMode(
- ADDR_AUDIO_SYSTEM, mHdmiCecLocalDeviceTv.mAddress, false);
+ HdmiCecMessage reportSystemAudioMode =
+ HdmiCecMessageBuilder.buildReportSystemAudioMode(
+ ADDR_AUDIO_SYSTEM,
+ mHdmiCecLocalDeviceTv.getDeviceInfo().getLogicalAddress(),
+ false);
mHdmiControlService.handleCecCommand(reportSystemAudioMode);
mTestLooper.dispatchAll();
@@ -296,7 +316,8 @@
HdmiCecMessage giveSystemAudioModeStatus =
HdmiCecMessageBuilder.buildGiveSystemAudioModeStatus(
- mHdmiCecLocalDeviceTv.mAddress, ADDR_AUDIO_SYSTEM);
+ mHdmiCecLocalDeviceTv.getDeviceInfo().getLogicalAddress(),
+ ADDR_AUDIO_SYSTEM);
assertThat(mNativeWrapper.getResultMessages()).contains(giveSystemAudioModeStatus);
mNativeWrapper.clearResultMessages();
@@ -321,7 +342,8 @@
HdmiCecMessage giveSystemAudioModeStatus =
HdmiCecMessageBuilder.buildGiveSystemAudioModeStatus(
- mHdmiCecLocalDeviceTv.mAddress, ADDR_AUDIO_SYSTEM);
+ mHdmiCecLocalDeviceTv.getDeviceInfo().getLogicalAddress(),
+ ADDR_AUDIO_SYSTEM);
assertThat(mNativeWrapper.getResultMessages()).contains(giveSystemAudioModeStatus);
for (int i = 0; i < RETRIES_ON_TIMEOUT; i++) {
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/SystemAudioInitiationActionFromAvrTest.java b/services/tests/servicestests/src/com/android/server/hdmi/SystemAudioInitiationActionFromAvrTest.java
index 2019a16..3a8808b 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/SystemAudioInitiationActionFromAvrTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/SystemAudioInitiationActionFromAvrTest.java
@@ -197,6 +197,7 @@
}
};
mHdmiCecLocalDeviceAudioSystem.init();
+ mHdmiCecLocalDeviceAudioSystem.setDeviceInfo(mDeviceInfoForTests);
}
@Test
diff --git a/services/tests/servicestests/src/com/android/server/pm/PackageParserTest.java b/services/tests/servicestests/src/com/android/server/pm/PackageParserTest.java
index a710839..e8c5fb3 100644
--- a/services/tests/servicestests/src/com/android/server/pm/PackageParserTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/PackageParserTest.java
@@ -520,10 +520,12 @@
final ParsedPackage pkg = new TestPackageParser2()
.parsePackage(testFile, 0 /*flags*/, false /*useCaches*/);
final List<String> compatPermissions =
- Arrays.stream(COMPAT_PERMS).map(p -> p.name).collect(toList());
+ Arrays.stream(COMPAT_PERMS).map(ParsedUsesPermission::getName)
+ .collect(toList());
assertWithMessage(
"Compatibility permissions shouldn't be added into uses permissions.")
- .that(pkg.getUsesPermissions().stream().map(p -> p.name).collect(toList()))
+ .that(pkg.getUsesPermissions().stream().map(ParsedUsesPermission::getName)
+ .collect(toList()))
.containsNoneIn(compatPermissions);
assertWithMessage(
"Compatibility permissions shouldn't be added into requested permissions.")
@@ -544,18 +546,19 @@
.parsePackage(testFile, 0 /*flags*/, false /*useCaches*/);
assertWithMessage(
"Compatibility permissions should be added into uses permissions.")
- .that(Arrays.stream(COMPAT_PERMS).map(p -> p.name)
- .allMatch(pkg.getUsesPermissions().stream().map(p -> p.name)
+ .that(Arrays.stream(COMPAT_PERMS).map(ParsedUsesPermission::getName)
+ .allMatch(pkg.getUsesPermissions().stream()
+ .map(ParsedUsesPermission::getName)
.collect(toList())::contains))
.isTrue();
assertWithMessage(
"Compatibility permissions should be added into requested permissions.")
- .that(Arrays.stream(COMPAT_PERMS).map(p -> p.name)
+ .that(Arrays.stream(COMPAT_PERMS).map(ParsedUsesPermission::getName)
.allMatch(pkg.getRequestedPermissions()::contains))
.isTrue();
assertWithMessage(
"Compatibility permissions should be added into implicit permissions.")
- .that(Arrays.stream(COMPAT_PERMS).map(p -> p.name)
+ .that(Arrays.stream(COMPAT_PERMS).map(ParsedUsesPermission::getName)
.allMatch(pkg.getImplicitPermissions()::contains))
.isTrue();
} finally {
@@ -954,8 +957,8 @@
.setVisibleToInstantApps(true)
.setSplitHasCode(0, true)
.hideAsParsed())
- .setBaseCodePath("foo5")
- .setCodePath("foo4")
+ .setBaseApkPath("foo5")
+ .setPath("foo4")
.setVersionCode(100)
.setRestrictUpdateHash(new byte[16])
.setVersionCodeMajor(100)
diff --git a/services/tests/servicestests/src/com/android/server/pm/ScanTests.java b/services/tests/servicestests/src/com/android/server/pm/ScanTests.java
index 8e1fc16..8153242 100644
--- a/services/tests/servicestests/src/com/android/server/pm/ScanTests.java
+++ b/services/tests/servicestests/src/com/android/server/pm/ScanTests.java
@@ -51,11 +51,11 @@
import android.util.Pair;
import com.android.server.compat.PlatformCompat;
-import com.android.server.pm.verify.domain.DomainVerificationManagerInternal;
import com.android.server.pm.parsing.PackageInfoUtils;
import com.android.server.pm.parsing.pkg.AndroidPackage;
import com.android.server.pm.parsing.pkg.PackageImpl;
import com.android.server.pm.parsing.pkg.ParsedPackage;
+import com.android.server.pm.verify.domain.DomainVerificationManagerInternal;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
@@ -241,7 +241,7 @@
.setPackageName("static.lib.pkg.123")
.setVersionCodeMajor(1)
.setVersionCode(234)
- .setBaseCodePath("/some/path.apk")
+ .setBaseApkPath("/some/path.apk")
.setSplitCodePaths(new String[] {"/some/other/path.apk"});
final PackageManagerService.ScanRequest scanRequest = new ScanRequestBuilder(pkg)
@@ -273,7 +273,7 @@
.hideAsParsed())
.setVersionCodeMajor(1)
.setVersionCode(234)
- .setBaseCodePath("/some/path.apk")
+ .setBaseApkPath("/some/path.apk")
.setSplitCodePaths(new String[] {"/some/other/path.apk"});
final PackageManagerService.ScanRequest scanRequest =
diff --git a/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceUserTypeTest.java b/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceUserTypeTest.java
index cd98d44..f1acc66 100644
--- a/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceUserTypeTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/UserManagerServiceUserTypeTest.java
@@ -81,7 +81,7 @@
/* letsPersonalDataIntoProfile= */false).build());
final UserTypeDetails type = new UserTypeDetails.Builder()
.setName("a.name")
- .setEnabled(true)
+ .setEnabled(1)
.setMaxAllowed(21)
.setBaseType(FLAG_PROFILE)
.setDefaultUserInfoPropertyFlags(FLAG_EPHEMERAL)
@@ -316,6 +316,7 @@
builders.put(userTypeFull, new UserTypeDetails.Builder()
.setName(userTypeFull)
.setBaseType(FLAG_FULL)
+ .setEnabled(0)
.setDefaultRestrictions(restrictions));
final XmlResourceParser parser = mResources.getXml(R.xml.usertypes_test_full);
@@ -323,6 +324,7 @@
UserTypeDetails details = builders.get(userTypeFull).createUserTypeDetails();
assertEquals(UNLIMITED_NUMBER_OF_USERS, details.getMaxAllowedPerParent());
+ assertFalse(details.isEnabled());
assertTrue(UserRestrictionsUtils.areEqual(
makeRestrictionsBundle("no_remove_user", "no_bluetooth"),
details.getDefaultRestrictions()));
diff --git a/services/tests/servicestests/src/com/android/server/systemconfig/SystemConfigTest.java b/services/tests/servicestests/src/com/android/server/systemconfig/SystemConfigTest.java
index 9044b27..5eb21a5 100644
--- a/services/tests/servicestests/src/com/android/server/systemconfig/SystemConfigTest.java
+++ b/services/tests/servicestests/src/com/android/server/systemconfig/SystemConfigTest.java
@@ -19,6 +19,7 @@
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertEquals;
+import static org.testng.Assert.expectThrows;
import android.platform.test.annotations.Presubmit;
import android.util.ArrayMap;
@@ -200,6 +201,46 @@
assertThat(mSysConfig.getWhitelistedStagedInstallers())
.containsExactly("com.android.package1");
+ assertThat(mSysConfig.getModulesInstallerPackageName()).isNull();
+ }
+
+ @Test
+ public void readPermissions_parsesStagedInstallerWhitelist_modulesInstaller()
+ throws IOException {
+ final String contents =
+ "<config>\n"
+ + " <whitelisted-staged-installer package=\"com.android.package1\" "
+ + " isModulesInstaller=\"true\" />\n"
+ + "</config>";
+ final File folder = createTempSubfolder("folder");
+ createTempFile(folder, "staged-installer-whitelist.xml", contents);
+
+ mSysConfig.readPermissions(folder, /* Grant all permission flags */ ~0);
+
+ assertThat(mSysConfig.getWhitelistedStagedInstallers())
+ .containsExactly("com.android.package1");
+ assertThat(mSysConfig.getModulesInstallerPackageName())
+ .isEqualTo("com.android.package1");
+ }
+
+ @Test
+ public void readPermissions_parsesStagedInstallerWhitelist_multipleModulesInstallers()
+ throws IOException {
+ final String contents =
+ "<config>\n"
+ + " <whitelisted-staged-installer package=\"com.android.package1\" "
+ + " isModulesInstaller=\"true\" />\n"
+ + " <whitelisted-staged-installer package=\"com.android.package2\" "
+ + " isModulesInstaller=\"true\" />\n"
+ + "</config>";
+ final File folder = createTempSubfolder("folder");
+ createTempFile(folder, "staged-installer-whitelist.xml", contents);
+
+ IllegalStateException e = expectThrows(
+ IllegalStateException.class,
+ () -> mSysConfig.readPermissions(folder, /* Grant all permission flags */ ~0));
+
+ assertThat(e).hasMessageThat().contains("Multiple modules installers");
}
/**
@@ -230,14 +271,16 @@
throws IOException {
final String contents =
"<config>\n"
- + " <allowed-vendor-apex package=\"com.android.apex1\" />\n"
+ + " <allowed-vendor-apex package=\"com.android.apex1\" "
+ + "installerPackage=\"com.installer\" />\n"
+ "</config>";
final File folder = createTempSubfolder("folder");
createTempFile(folder, "vendor-apex-allowlist.xml", contents);
mSysConfig.readPermissions(folder, /* Grant all permission flags */ ~0);
- assertThat(mSysConfig.getAllowedVendorApexes()).containsExactly("com.android.apex1");
+ assertThat(mSysConfig.getAllowedVendorApexes())
+ .containsExactly("com.android.apex1", "com.installer");
}
/**
diff --git a/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java b/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java
index 645fa63..9e46e1f 100644
--- a/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java
@@ -93,6 +93,7 @@
import android.view.Display;
import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.FlakyTest;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
@@ -103,7 +104,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.Mock;
@@ -502,6 +502,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testBoundWidgetPackageExempt() throws Exception {
assumeTrue(mInjector.getContext().getSystemService(AppWidgetManager.class) != null);
assertEquals(STANDBY_BUCKET_ACTIVE,
@@ -584,6 +585,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testIsAppIdle_Charging() throws Exception {
TestParoleListener paroleListener = new TestParoleListener();
mController.addListener(paroleListener);
@@ -616,6 +618,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testIsAppIdle_Enabled() throws Exception {
setChargingState(mController, false);
TestParoleListener paroleListener = new TestParoleListener();
@@ -715,6 +718,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testBuckets() throws Exception {
assertTimeout(mController, 0, STANDBY_BUCKET_NEVER);
@@ -747,6 +751,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testSetAppStandbyBucket() throws Exception {
// For a known package, standby bucket should be set properly
reportEvent(mController, USER_INTERACTION, 0, PACKAGE_1);
@@ -766,6 +771,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testAppStandbyBucketOnInstallAndUninstall() throws Exception {
// On package install, standby bucket should be ACTIVE
reportEvent(mController, USER_INTERACTION, 0, PACKAGE_UNKNOWN);
@@ -784,6 +790,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testScreenTimeAndBuckets() throws Exception {
mInjector.setDisplayOn(false);
@@ -807,6 +814,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testForcedIdle() throws Exception {
mController.forceIdleState(PACKAGE_1, USER_ID, true);
assertEquals(STANDBY_BUCKET_RARE, getStandbyBucket(mController, PACKAGE_1));
@@ -819,6 +827,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testNotificationEvent() throws Exception {
reportEvent(mController, USER_INTERACTION, 0, PACKAGE_1);
assertEquals(STANDBY_BUCKET_ACTIVE, getStandbyBucket(mController, PACKAGE_1));
@@ -832,6 +841,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testSlicePinnedEvent() throws Exception {
reportEvent(mController, USER_INTERACTION, 0, PACKAGE_1);
assertEquals(STANDBY_BUCKET_ACTIVE, getStandbyBucket(mController, PACKAGE_1));
@@ -845,6 +855,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testSlicePinnedPrivEvent() throws Exception {
mController.forceIdleState(PACKAGE_1, USER_ID, true);
reportEvent(mController, SLICE_PINNED_PRIV, mInjector.mElapsedRealtime, PACKAGE_1);
@@ -852,6 +863,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testPredictionTimedOut() throws Exception {
// Set it to timeout or usage, so that prediction can override it
mInjector.mElapsedRealtime = HOUR_MS;
@@ -882,6 +894,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testOverrides() throws Exception {
// Can force to NEVER
mInjector.mElapsedRealtime = HOUR_MS;
@@ -992,6 +1005,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testTimeout() throws Exception {
reportEvent(mController, USER_INTERACTION, 0, PACKAGE_1);
assertBucket(STANDBY_BUCKET_ACTIVE);
@@ -1015,6 +1029,7 @@
/** Test that timeouts still work properly even if invalid configuration values are set. */
@Test
+ @FlakyTest(bugId = 185169504)
public void testTimeout_InvalidThresholds() throws Exception {
mInjector.mSettingsBuilder
.setLong("screen_threshold_active", -1)
@@ -1052,6 +1067,7 @@
* timeout has passed.
*/
@Test
+ @FlakyTest(bugId = 185169504)
public void testTimeoutBeforeRestricted() throws Exception {
reportEvent(mController, USER_INTERACTION, 0, PACKAGE_1);
assertBucket(STANDBY_BUCKET_ACTIVE);
@@ -1078,6 +1094,7 @@
* Test that an app is put into the RESTRICTED bucket after enough time has passed.
*/
@Test
+ @FlakyTest(bugId = 185169504)
public void testRestrictedDelay() throws Exception {
reportEvent(mController, USER_INTERACTION, 0, PACKAGE_1);
assertBucket(STANDBY_BUCKET_ACTIVE);
@@ -1100,6 +1117,7 @@
* Test that an app is put into the RESTRICTED bucket after enough time has passed.
*/
@Test
+ @FlakyTest(bugId = 185169504)
public void testRestrictedDelay_DelayChange() throws Exception {
reportEvent(mController, USER_INTERACTION, 0, PACKAGE_1);
assertBucket(STANDBY_BUCKET_ACTIVE);
@@ -1124,6 +1142,7 @@
* a low bucket after the RESTRICTED timeout.
*/
@Test
+ @FlakyTest(bugId = 185169504)
public void testRestrictedTimeoutOverridesRestoredLowBucketPrediction() throws Exception {
reportEvent(mController, USER_INTERACTION, mInjector.mElapsedRealtime, PACKAGE_1);
assertBucket(STANDBY_BUCKET_ACTIVE);
@@ -1160,6 +1179,7 @@
* a low bucket after the RESTRICTED timeout.
*/
@Test
+ @FlakyTest(bugId = 185169504)
public void testRestrictedTimeoutOverridesPredictionLowBucket() throws Exception {
reportEvent(mController, USER_INTERACTION, mInjector.mElapsedRealtime, PACKAGE_1);
@@ -1187,6 +1207,7 @@
* interaction.
*/
@Test
+ @FlakyTest(bugId = 185169504)
public void testSystemInteractionOverridesRestrictedTimeout() throws Exception {
reportEvent(mController, USER_INTERACTION, mInjector.mElapsedRealtime, PACKAGE_1);
assertBucket(STANDBY_BUCKET_ACTIVE);
@@ -1213,6 +1234,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testRestrictedBucketDisabled() throws Exception {
mInjector.mIsRestrictedBucketEnabled = false;
// Get the controller to read the new value. Capturing the ContentObserver isn't possible
@@ -1238,6 +1260,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testRestrictedBucket_EnabledToDisabled() throws Exception {
reportEvent(mController, USER_INTERACTION, mInjector.mElapsedRealtime, PACKAGE_1);
mInjector.mElapsedRealtime += RESTRICTED_THRESHOLD;
@@ -1255,6 +1278,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testPredictionRaiseFromRestrictedTimeout_highBucket() throws Exception {
reportEvent(mController, USER_INTERACTION, mInjector.mElapsedRealtime, PACKAGE_1);
@@ -1272,6 +1296,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testPredictionRaiseFromRestrictedTimeout_lowBucket() throws Exception {
reportEvent(mController, USER_INTERACTION, mInjector.mElapsedRealtime, PACKAGE_1);
@@ -1289,6 +1314,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testCascadingTimeouts() throws Exception {
reportEvent(mController, USER_INTERACTION, 0, PACKAGE_1);
assertBucket(STANDBY_BUCKET_ACTIVE);
@@ -1312,6 +1338,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testOverlappingTimeouts() throws Exception {
reportEvent(mController, USER_INTERACTION, 0, PACKAGE_1);
assertBucket(STANDBY_BUCKET_ACTIVE);
@@ -1343,6 +1370,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testSystemInteractionTimeout() throws Exception {
reportEvent(mController, USER_INTERACTION, 0, PACKAGE_1);
// Fast forward to RARE
@@ -1366,6 +1394,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testInitialForegroundServiceTimeout() throws Exception {
mInjector.mElapsedRealtime = 1 * RARE_THRESHOLD + 100;
// Make sure app is in NEVER bucket
@@ -1399,6 +1428,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testPredictionNotOverridden() throws Exception {
reportEvent(mController, USER_INTERACTION, 0, PACKAGE_1);
assertBucket(STANDBY_BUCKET_ACTIVE);
@@ -1424,8 +1454,8 @@
assertBucket(STANDBY_BUCKET_ACTIVE);
}
- @Ignore
@Test
+ @FlakyTest(bugId = 185169504)
public void testPredictionStrikesBack() throws Exception {
reportEvent(mController, USER_INTERACTION, 0, PACKAGE_1);
assertBucket(STANDBY_BUCKET_ACTIVE);
@@ -1451,6 +1481,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testSystemForcedFlags_NotAddedForUserForce() throws Exception {
final int expectedReason = REASON_MAIN_FORCED_BY_USER;
mController.setAppStandbyBucket(PACKAGE_1, USER_ID, STANDBY_BUCKET_RESTRICTED,
@@ -1465,6 +1496,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testSystemForcedFlags_AddedForSystemForce() throws Exception {
mController.setAppStandbyBucket(PACKAGE_1, USER_ID, STANDBY_BUCKET_ACTIVE,
REASON_MAIN_DEFAULT);
@@ -1487,6 +1519,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testSystemForcedFlags_SystemForceChangesBuckets() throws Exception {
mController.setAppStandbyBucket(PACKAGE_1, USER_ID, STANDBY_BUCKET_ACTIVE,
REASON_MAIN_DEFAULT);
@@ -1524,6 +1557,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testRestrictApp_MainReason() throws Exception {
mController.setAppStandbyBucket(PACKAGE_1, USER_ID, STANDBY_BUCKET_ACTIVE,
REASON_MAIN_DEFAULT);
@@ -1598,6 +1632,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testUserInteraction_CrossProfile() throws Exception {
mInjector.mRunningUsers = new int[] {USER_ID, USER_ID2, USER_ID3};
mInjector.mCrossProfileTargets = Arrays.asList(USER_HANDLE_USER2);
@@ -1621,6 +1656,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testUnexemptedSyncScheduled() throws Exception {
rearmLatch(PACKAGE_1);
mController.addListener(mListener);
@@ -1642,6 +1678,7 @@
}
@Test
+ @FlakyTest(bugId = 185169504)
public void testExemptedSyncScheduled() throws Exception {
setAndAssertBucket(PACKAGE_1, USER_ID, STANDBY_BUCKET_RARE, REASON_MAIN_FORCED_BY_SYSTEM);
mInjector.mDeviceIdleMode = true;
diff --git a/services/tests/wmtests/src/com/android/server/wm/StubTransaction.java b/services/tests/wmtests/src/com/android/server/wm/StubTransaction.java
index e32b2aa..cac948c 100644
--- a/services/tests/wmtests/src/com/android/server/wm/StubTransaction.java
+++ b/services/tests/wmtests/src/com/android/server/wm/StubTransaction.java
@@ -270,4 +270,10 @@
public SurfaceControl.Transaction setColorSpace(SurfaceControl sc, ColorSpace colorSpace) {
return this;
}
+
+ @Override
+ public SurfaceControl.Transaction setTrustedOverlay(SurfaceControl sc,
+ boolean isTrustedOverlay) {
+ return this;
+ }
}
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 3dd3e81..f83f1cf 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskFragmentOrganizerControllerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskFragmentOrganizerControllerTest.java
@@ -319,8 +319,9 @@
// Allow organizer to create TaskFragment and start/reparent activity to TaskFragment.
mTransaction.createTaskFragment(mock(TaskFragmentCreationParams.class));
mTransaction.startActivityInTaskFragment(
- mFragmentToken, new Intent(), null /* activityOptions */);
+ mFragmentToken, null /* callerToken */, new Intent(), null /* activityOptions */);
mTransaction.reparentActivityToTaskFragment(mFragmentToken, mock(IBinder.class));
+ mTransaction.setAdjacentTaskFragments(mFragmentToken, mock(IBinder.class));
// It is expected to fail for the mock TaskFragmentCreationParams. It is ok as we are
// testing the security check here.
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/HotwordDetectionConnection.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/HotwordDetectionConnection.java
index e408cfc..965f126 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/HotwordDetectionConnection.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/HotwordDetectionConnection.java
@@ -87,14 +87,14 @@
*/
final class HotwordDetectionConnection {
private static final String TAG = "HotwordDetectionConnection";
- // TODO (b/177502877): Set the Debug flag to false before shipping.
- static final boolean DEBUG = true;
+ static final boolean DEBUG = false;
// TODO: These constants need to be refined.
private static final long VALIDATION_TIMEOUT_MILLIS = 3000;
private static final long MAX_UPDATE_TIMEOUT_MILLIS = 6000;
private static final Duration MAX_UPDATE_TIMEOUT_DURATION =
Duration.ofMillis(MAX_UPDATE_TIMEOUT_MILLIS);
+ private static final long RESET_DEBUG_HOTWORD_LOGGING_TIMEOUT_MILLIS = 60 * 60 * 1000; // 1 hour
private final Executor mAudioCopyExecutor = Executors.newCachedThreadPool();
// TODO: This may need to be a Handler(looper)
@@ -103,6 +103,7 @@
private final AtomicBoolean mUpdateStateAfterStartFinished = new AtomicBoolean(false);
private final IBinder.DeathRecipient mAudioServerDeathRecipient = this::audioServerDied;
private final @NonNull ServiceConnectionFactory mServiceConnectionFactory;
+ private final IHotwordRecognitionStatusCallback mCallback;
final Object mLock;
final int mVoiceInteractionServiceUid;
@@ -110,11 +111,11 @@
final int mUser;
final Context mContext;
volatile HotwordDetectionServiceIdentity mIdentity;
- private IHotwordRecognitionStatusCallback mCallback;
private IMicrophoneHotwordDetectionVoiceInteractionCallback mSoftwareCallback;
private Instant mLastRestartInstant;
private ScheduledFuture<?> mCancellationTaskFuture;
+ private ScheduledFuture<?> mDebugHotwordLoggingTimeoutFuture = null;
/** Identity used for attributing app ops when delivering data to the Interactor. */
@GuardedBy("mLock")
@@ -128,17 +129,24 @@
private boolean mPerformingSoftwareHotwordDetection;
private @NonNull ServiceConnection mRemoteHotwordDetectionService;
private IBinder mAudioFlinger;
+ private boolean mDebugHotwordLogging = false;
HotwordDetectionConnection(Object lock, Context context, int voiceInteractionServiceUid,
Identity voiceInteractorIdentity, ComponentName serviceName, int userId,
boolean bindInstantServiceAllowed, @Nullable PersistableBundle options,
- @Nullable SharedMemory sharedMemory, IHotwordRecognitionStatusCallback callback) {
+ @Nullable SharedMemory sharedMemory,
+ @NonNull IHotwordRecognitionStatusCallback callback) {
+ if (callback == null) {
+ Slog.w(TAG, "Callback is null while creating connection");
+ throw new IllegalArgumentException("Callback is null while creating connection");
+ }
mLock = lock;
mContext = context;
mVoiceInteractionServiceUid = voiceInteractionServiceUid;
mVoiceInteractorIdentity = voiceInteractorIdentity;
mDetectionComponentName = serviceName;
mUser = userId;
+ mCallback = callback;
final Intent intent = new Intent(HotwordDetectionService.SERVICE_INTERFACE);
intent.setComponent(mDetectionComponentName);
initAudioFlingerLocked();
@@ -147,22 +155,13 @@
mRemoteHotwordDetectionService = mServiceConnectionFactory.createLocked();
- if (callback == null) {
- updateStateLocked(options, sharedMemory);
- return;
- }
- mCallback = callback;
-
mLastRestartInstant = Instant.now();
updateStateAfterProcessStart(options, sharedMemory);
// TODO(volnov): we need to be smarter here, e.g. schedule it a bit more often, but wait
// until the current session is closed.
mCancellationTaskFuture = mScheduledExecutorService.scheduleAtFixedRate(() -> {
- if (DEBUG) {
- Slog.i(TAG, "Time to restart the process, TTL has passed");
- }
-
+ Slog.v(TAG, "Time to restart the process, TTL has passed");
synchronized (mLock) {
restartProcessLocked();
}
@@ -268,9 +267,9 @@
}
void cancelLocked() {
- if (DEBUG) {
- Slog.d(TAG, "cancelLocked");
- }
+ Slog.v(TAG, "cancelLocked");
+ clearDebugHotwordLoggingTimeoutLocked();
+ mDebugHotwordLogging = false;
if (mRemoteHotwordDetectionService.isBound()) {
mRemoteHotwordDetectionService.unbind();
LocalServices.getService(PermissionManagerServiceInternal.class)
@@ -288,6 +287,7 @@
// TODO(b/191742511): this logic needs a test
if (!mUpdateStateAfterStartFinished.get()
&& Instant.now().minus(MAX_UPDATE_TIMEOUT_DURATION).isBefore(mLastRestartInstant)) {
+ Slog.v(TAG, "call updateStateAfterProcessStart");
updateStateAfterProcessStart(options, sharedMemory);
} else {
mRemoteHotwordDetectionService.run(
@@ -330,6 +330,9 @@
if (result != null) {
Slog.i(TAG, "Egressed " + HotwordDetectedResult.getUsageSize(result)
+ " bits from hotword trusted process");
+ if (mDebugHotwordLogging) {
+ Slog.i(TAG, "Egressed detected result: " + result);
+ }
}
} else {
Slog.i(TAG, "Hotword detection has already completed");
@@ -407,15 +410,11 @@
private void detectFromDspSourceForTest(SoundTrigger.KeyphraseRecognitionEvent recognitionEvent,
IHotwordRecognitionStatusCallback externalCallback) {
- if (DEBUG) {
- Slog.d(TAG, "detectFromDspSourceForTest");
- }
+ Slog.v(TAG, "detectFromDspSourceForTest");
IDspHotwordDetectionCallback internalCallback = new IDspHotwordDetectionCallback.Stub() {
@Override
public void onDetected(HotwordDetectedResult result) throws RemoteException {
- if (DEBUG) {
- Slog.d(TAG, "onDetected");
- }
+ Slog.v(TAG, "onDetected");
synchronized (mLock) {
if (mValidatingDspTrigger) {
mValidatingDspTrigger = false;
@@ -424,6 +423,9 @@
if (result != null) {
Slog.i(TAG, "Egressed " + HotwordDetectedResult.getUsageSize(result)
+ " bits from hotword trusted process");
+ if (mDebugHotwordLogging) {
+ Slog.i(TAG, "Egressed detected result: " + result);
+ }
}
} else {
Slog.i(TAG, "Ignored hotword detected since trigger has been handled");
@@ -433,13 +435,14 @@
@Override
public void onRejected(HotwordRejectedResult result) throws RemoteException {
- if (DEBUG) {
- Slog.d(TAG, "onRejected");
- }
+ Slog.v(TAG, "onRejected");
synchronized (mLock) {
if (mValidatingDspTrigger) {
mValidatingDspTrigger = false;
externalCallback.onRejected(result);
+ if (mDebugHotwordLogging && result != null) {
+ Slog.i(TAG, "Egressed rejected result: " + result);
+ }
} else {
Slog.i(TAG, "Ignored hotword rejected since trigger has been handled");
}
@@ -482,6 +485,9 @@
if (result != null) {
Slog.i(TAG, "Egressed " + HotwordDetectedResult.getUsageSize(result)
+ " bits from hotword trusted process");
+ if (mDebugHotwordLogging) {
+ Slog.i(TAG, "Egressed detected result: " + result);
+ }
}
}
}
@@ -498,6 +504,9 @@
}
mValidatingDspTrigger = false;
externalCallback.onRejected(result);
+ if (mDebugHotwordLogging && result != null) {
+ Slog.i(TAG, "Egressed rejected result: " + result);
+ }
}
}
};
@@ -514,19 +523,37 @@
}
void forceRestart() {
- if (DEBUG) {
- Slog.i(TAG, "Requested to restart the service internally. Performing the restart");
- }
+ Slog.v(TAG, "Requested to restart the service internally. Performing the restart");
synchronized (mLock) {
restartProcessLocked();
}
}
- private void restartProcessLocked() {
- if (DEBUG) {
- Slog.i(TAG, "Restarting hotword detection process");
- }
+ void setDebugHotwordLoggingLocked(boolean logging) {
+ Slog.v(TAG, "setDebugHotwordLoggingLocked: " + logging);
+ clearDebugHotwordLoggingTimeoutLocked();
+ mDebugHotwordLogging = logging;
+ if (logging) {
+ // Reset mDebugHotwordLogging to false after one hour
+ mDebugHotwordLoggingTimeoutFuture = mScheduledExecutorService.schedule(() -> {
+ Slog.v(TAG, "Timeout to reset mDebugHotwordLogging to false");
+ synchronized (mLock) {
+ mDebugHotwordLogging = false;
+ }
+ }, RESET_DEBUG_HOTWORD_LOGGING_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
+ }
+ }
+
+ private void clearDebugHotwordLoggingTimeoutLocked() {
+ if (mDebugHotwordLoggingTimeoutFuture != null) {
+ mDebugHotwordLoggingTimeoutFuture.cancel(/* mayInterruptIfRunning= */true);
+ mDebugHotwordLoggingTimeoutFuture = null;
+ }
+ }
+
+ private void restartProcessLocked() {
+ Slog.v(TAG, "Restarting hotword detection process");
ServiceConnection oldConnection = mRemoteHotwordDetectionService;
// TODO(volnov): this can be done after connect() has been successful.
@@ -547,9 +574,7 @@
// Recreate connection to reset the cache.
mRemoteHotwordDetectionService = mServiceConnectionFactory.createLocked();
- if (DEBUG) {
- Slog.i(TAG, "Started the new process, issuing #onProcessRestarted");
- }
+ Slog.v(TAG, "Started the new process, issuing #onProcessRestarted");
try {
mCallback.onProcessRestarted();
} catch (RemoteException e) {
@@ -700,6 +725,9 @@
bestEffortClose(serviceAudioSource);
bestEffortClose(audioSource);
+ if (mDebugHotwordLogging && result != null) {
+ Slog.i(TAG, "Egressed rejected result: " + result);
+ }
// TODO: Propagate the HotwordRejectedResult.
}
@@ -714,6 +742,9 @@
if (triggerResult != null) {
Slog.i(TAG, "Egressed " + HotwordDetectedResult.getUsageSize(
triggerResult) + " bits from hotword trusted process");
+ if (mDebugHotwordLogging) {
+ Slog.i(TAG, "Egressed detected result: " + triggerResult);
+ }
}
// TODO: Add a delay before closing.
bestEffortClose(audioSource);
@@ -773,9 +804,7 @@
}
synchronized (mLock) {
if (!mRespectServiceConnectionStatusChanged) {
- if (DEBUG) {
- Slog.d(TAG, "Ignored onServiceConnectionStatusChanged event");
- }
+ Slog.v(TAG, "Ignored onServiceConnectionStatusChanged event");
return;
}
mIsBound = connected;
@@ -792,9 +821,7 @@
super.binderDied();
synchronized (mLock) {
if (!mRespectServiceConnectionStatusChanged) {
- if (DEBUG) {
- Slog.d(TAG, "Ignored #binderDied event");
- }
+ Slog.v(TAG, "Ignored #binderDied event");
return;
}
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
index ccf4267..71541ad 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
@@ -832,6 +832,17 @@
mImpl.forceRestartHotwordDetector();
}
+ // Called by Shell command
+ void setDebugHotwordLogging(boolean logging) {
+ synchronized (this) {
+ if (mImpl == null) {
+ Slog.w(TAG, "setTemporaryLogging without running voice interaction service");
+ return;
+ }
+ mImpl.setDebugHotwordLoggingLocked(logging);
+ }
+ }
+
@Override
public void showSession(Bundle args, int flags) {
synchronized (this) {
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java
index cbcbf52..558a9ac 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java
@@ -79,8 +79,7 @@
class VoiceInteractionManagerServiceImpl implements VoiceInteractionSessionConnection.Callback {
final static String TAG = "VoiceInteractionServiceManager";
- // TODO (b/177502877): Set the Debug flag to false before shipping.
- static final boolean DEBUG = true;
+ static final boolean DEBUG = false;
final static String CLOSE_REASON_VOICE_INTERACTION = "voiceinteraction";
@@ -420,9 +419,7 @@
@Nullable PersistableBundle options,
@Nullable SharedMemory sharedMemory,
IHotwordRecognitionStatusCallback callback) {
- if (DEBUG) {
- Slog.d(TAG, "updateStateLocked");
- }
+ Slog.v(TAG, "updateStateLocked");
if (mHotwordDetectionComponentName == null) {
Slog.w(TAG, "Hotword detection service name not found");
throw new IllegalStateException("Hotword detection service name not found");
@@ -584,6 +581,14 @@
mHotwordDetectionConnection.forceRestart();
}
+ void setDebugHotwordLoggingLocked(boolean logging) {
+ if (mHotwordDetectionConnection == null) {
+ Slog.w(TAG, "Failed to set temporary debug logging: no hotword detection active");
+ return;
+ }
+ mHotwordDetectionConnection.setDebugHotwordLoggingLocked(logging);
+ }
+
void resetHotwordDetectionConnectionLocked() {
if (DEBUG) {
Slog.d(TAG, "resetHotwordDetectionConnectionLocked");
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceShellCommand.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceShellCommand.java
index cdd8f7b..9bdf4e4 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceShellCommand.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceShellCommand.java
@@ -56,6 +56,8 @@
return requestDisable(pw);
case "restart-detection":
return requestRestartDetection(pw);
+ case "set-debug-hotword-logging":
+ return setDebugHotwordLogging(pw);
default:
return handleDefaultCommands(cmd);
}
@@ -76,9 +78,14 @@
pw.println("");
pw.println(" disable [true|false]");
pw.println(" Temporarily disable (when true) service");
+ pw.println("");
pw.println(" restart-detection");
pw.println(" Force a restart of a hotword detection service");
pw.println("");
+ pw.println(" set-debug-hotword-logging [true|false]");
+ pw.println(" Temporarily enable or disable debug logging for hotword result.");
+ pw.println(" The debug logging will be reset after one hour from last enable.");
+ pw.println("");
}
}
@@ -157,6 +164,17 @@
return 0;
}
+ private int setDebugHotwordLogging(PrintWriter pw) {
+ boolean logging = Boolean.parseBoolean(getNextArgRequired());
+ Slog.i(TAG, "setDebugHotwordLogging(): " + logging);
+ try {
+ mService.setDebugHotwordLogging(logging);
+ } catch (Exception e) {
+ return handleError(pw, "setDebugHotwordLogging()", e);
+ }
+ return 0;
+ }
+
private static int handleError(PrintWriter pw, String message, Exception e) {
Slog.e(TAG, "error calling " + message, e);
pw.printf("Error calling %s: %s\n", message, e);
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index 09e19d2..8e910c9 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -3538,7 +3538,7 @@
"nr_advanced_capable_pco_id_int";
/**
- * This configuration allows the framework to use user data communication to detect RRC state,
+ * This configuration allows the framework to use user data communication to detect Idle state,
* and this is used on the 5G icon.
*
* There is a new way for for RRC state detection at Android 12. If
@@ -3546,16 +3546,23 @@
* {@link TelephonyManager#CAPABILITY_PHYSICAL_CHANNEL_CONFIG_1_6_SUPPORTED}) returns true,
* then framework can use PHYSICAL_CHANNEL_CONFIG for RRC state detection. Based on this
* condition, some carriers want to use the legacy behavior that way is using user data
- * communication to detect the RRC state. Therefore, this configuration allows the framework
- * to use user data communication to detect RRC state.
+ * communication to detect the Idle state. Therefore, this configuration allows the framework
+ * to use user data communication to detect Idle state.
*
- * The precondition is
+ * There are 3 situations reflects the carrier define Idle state.
+ * 1. using PHYSICAL_CHANNEL_CONFIG to detect RRC Idle
+ * 2. using all of data connections to detect RRC Idle.
+ * 3. using data communication(consider internet data connection only) to detect data Idle.
+ *
+ * How to setup for above 3 cases?
+ * For below part, we call the condition#1 is device support
* {@link android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported}(
- * {@link TelephonyManager#CAPABILITY_PHYSICAL_CHANNEL_CONFIG_1_6_SUPPORTED}) returns true,
- * otherwise this config is not working.
- * If this is true, framework uses the user data communication for RRC state detection.
- * If this is false, framework uses the PHYSICAL_CHANNEL_CONFIG for RRC state detection.
+ * {@link TelephonyManager#CAPABILITY_PHYSICAL_CHANNEL_CONFIG_1_6_SUPPORTED}).
+ * The condition#2 is carrier enable the KEY_LTE_ENDC_USING_USER_DATA_FOR_RRC_DETECTION_BOOL.
*
+ * For case#1, the condition#1 is true and the condition#2 is false.
+ * For case#2, the condition#1 is false and the condition#2 is false.
+ * For case#3, the condition#2 is true.
* @hide
*/
public static final String KEY_LTE_ENDC_USING_USER_DATA_FOR_RRC_DETECTION_BOOL =
diff --git a/tests/StagedInstallTest/Android.bp b/tests/StagedInstallTest/Android.bp
index 1aa0499..cac14a7 100644
--- a/tests/StagedInstallTest/Android.bp
+++ b/tests/StagedInstallTest/Android.bp
@@ -32,6 +32,7 @@
test_suites: ["general-tests"],
java_resources: [
":com.android.apex.apkrollback.test_v2",
+ ":StagedInstallTestApexV2",
":StagedInstallTestApexV2_WrongSha",
":test.rebootless_apex_v1",
":test.rebootless_apex_v2",
diff --git a/tests/StagedInstallTest/app/src/com/android/tests/stagedinstallinternal/StagedInstallInternalTest.java b/tests/StagedInstallTest/app/src/com/android/tests/stagedinstallinternal/StagedInstallInternalTest.java
index 738e68e..4684f01 100644
--- a/tests/StagedInstallTest/app/src/com/android/tests/stagedinstallinternal/StagedInstallInternalTest.java
+++ b/tests/StagedInstallTest/app/src/com/android/tests/stagedinstallinternal/StagedInstallInternalTest.java
@@ -55,8 +55,11 @@
private static final TestApp TEST_APEX_WITH_APK_V2 = new TestApp("TestApexWithApkV2",
APK_IN_APEX_TESTAPEX_NAME, 2, /*isApex*/true, APK_IN_APEX_TESTAPEX_NAME + "_v2.apex");
private static final TestApp APEX_WRONG_SHA_V2 = new TestApp(
- "ApexWrongSha2", SHIM_APEX_PACKAGE_NAME, 2, /*isApex*/true,
+ "ApexWrongSha2", SHIM_APEX_PACKAGE_NAME, 2, /* isApex= */ true,
"com.android.apex.cts.shim.v2_wrong_sha.apex");
+ private static final TestApp APEX_V2 = new TestApp(
+ "ApexV2", SHIM_APEX_PACKAGE_NAME, 2, /* isApex= */ true,
+ "com.android.apex.cts.shim.v2.apex");
private File mTestStateFile = new File(
InstrumentationRegistry.getInstrumentation().getContext().getFilesDir(),
@@ -237,6 +240,96 @@
}
@Test
+ public void testApexInstallerNotInAllowListCanNotInstall_staged() throws Exception {
+ assertThat(InstallUtils.getInstalledVersion(SHIM_APEX_PACKAGE_NAME)).isEqualTo(1);
+ // We don't really care which APEX we are trying to install here, since the session creation
+ // should fail immediately.
+ InstallUtils.commitExpectingFailure(
+ SecurityException.class,
+ "Installer not allowed to commit staged install",
+ Install.single(APEX_WRONG_SHA_V2).setBypassStangedInstallerCheck(false)
+ .setStaged());
+ }
+
+ @Test
+ public void testApexInstallerNotInAllowListCanNotInstall_nonStaged() throws Exception {
+ assertThat(InstallUtils.getInstalledVersion(SHIM_APEX_PACKAGE_NAME)).isEqualTo(1);
+ // We don't really care which APEX we are trying to install here, since the session creation
+ // should fail immediately.
+ InstallUtils.commitExpectingFailure(
+ SecurityException.class,
+ "Installer not allowed to commit non-staged APEX install",
+ Install.single(APEX_WRONG_SHA_V2).setBypassStangedInstallerCheck(false));
+ }
+
+ @Test
+ public void testApexNotInAllowListCanNotInstall_staged() throws Exception {
+ assertThat(InstallUtils.getInstalledVersion("test.apex.rebootless")).isEqualTo(1);
+ TestApp apex = new TestApp("apex", "test.apex.rebootless", 2,
+ /* isApex= */ true, "test.rebootless_apex_v2.apex");
+ InstallUtils.commitExpectingFailure(
+ AssertionError.class,
+ "Update of APEX package test.apex.rebootless is not allowed "
+ + "for com.android.tests.stagedinstallinternal",
+ Install.single(apex).setBypassAllowedApexUpdateCheck(false).setStaged());
+ }
+
+ @Test
+ public void testApexNotInAllowListCanNotInstall_nonStaged() throws Exception {
+ assertThat(InstallUtils.getInstalledVersion("test.apex.rebootless")).isEqualTo(1);
+ TestApp apex = new TestApp("apex", "test.apex.rebootless", 2,
+ /* isApex= */ true, "test.rebootless_apex_v2.apex");
+ InstallUtils.commitExpectingFailure(
+ AssertionError.class,
+ "Update of APEX package test.apex.rebootless is not allowed "
+ + "for com.android.tests.stagedinstallinternal",
+ Install.single(apex).setBypassAllowedApexUpdateCheck(false));
+ }
+
+ @Test
+ public void testVendorApexWrongInstaller_staged() throws Exception {
+ assertThat(InstallUtils.getInstalledVersion("test.apex.rebootless")).isEqualTo(1);
+ TestApp apex = new TestApp("apex", "test.apex.rebootless", 2,
+ /* isApex= */ true, "test.rebootless_apex_v2.apex");
+ InstallUtils.commitExpectingFailure(
+ AssertionError.class,
+ "Update of APEX package test.apex.rebootless is not allowed "
+ + "for com.android.tests.stagedinstallinternal",
+ Install.single(apex).setBypassAllowedApexUpdateCheck(false).setStaged());
+ }
+
+ @Test
+ public void testVendorApexWrongInstaller_nonStaged() throws Exception {
+ assertThat(InstallUtils.getInstalledVersion("test.apex.rebootless")).isEqualTo(1);
+ TestApp apex = new TestApp("apex", "test.apex.rebootless", 2,
+ /* isApex= */ true, "test.rebootless_apex_v2.apex");
+ InstallUtils.commitExpectingFailure(
+ AssertionError.class,
+ "Update of APEX package test.apex.rebootless is not allowed "
+ + "for com.android.tests.stagedinstallinternal",
+ Install.single(apex).setBypassAllowedApexUpdateCheck(false));
+ }
+
+ @Test
+ public void testVendorApexCorrectInstaller_staged() throws Exception {
+ assertThat(InstallUtils.getInstalledVersion("test.apex.rebootless")).isEqualTo(1);
+ TestApp apex = new TestApp("apex", "test.apex.rebootless", 2,
+ /* isApex= */ true, "test.rebootless_apex_v2.apex");
+ int sessionId =
+ Install.single(apex).setBypassAllowedApexUpdateCheck(false).setStaged().commit();
+ InstallUtils.getPackageInstaller().abandonSession(sessionId);
+ }
+
+ @Test
+ public void testVendorApexCorrectInstaller_nonStaged() throws Exception {
+ assertThat(InstallUtils.getInstalledVersion("test.apex.rebootless")).isEqualTo(1);
+ TestApp apex = new TestApp("apex", "test.apex.rebootless", 2,
+ /* isApex= */ true, "test.rebootless_apex_v2.apex");
+ Install.single(apex).setBypassAllowedApexUpdateCheck(false).commit();
+ assertThat(InstallUtils.getInstalledVersion("test.apex.rebootless")).isEqualTo(2);
+ }
+
+ @Test
public void testRebootlessUpdates() throws Exception {
InstallUtils.dropShellPermissionIdentity();
InstallUtils.adoptShellPermissionIdentity(Manifest.permission.INSTALL_PACKAGE_UPDATES);
@@ -298,6 +391,19 @@
}
}
+ @Test
+ public void testRebootlessUpdate_hasStagedSessionWithSameApex_fails() throws Exception {
+ assertThat(InstallUtils.getInstalledVersion(SHIM_APEX_PACKAGE_NAME)).isEqualTo(1);
+
+ int sessionId = Install.single(APEX_V2).setStaged().commit();
+ assertSessionReady(sessionId);
+ InstallUtils.commitExpectingFailure(
+ AssertionError.class,
+ "Staged session " + sessionId + " already contains " + SHIM_APEX_PACKAGE_NAME,
+ Install.single(APEX_V2));
+
+ }
+
private static void assertSessionApplied(int sessionId) {
assertSessionState(sessionId, (session) -> {
assertThat(session.isStagedSessionApplied()).isTrue();
diff --git a/tests/StagedInstallTest/src/com/android/tests/stagedinstallinternal/host/StagedInstallInternalTest.java b/tests/StagedInstallTest/src/com/android/tests/stagedinstallinternal/host/StagedInstallInternalTest.java
index 3bd3767..5021009 100644
--- a/tests/StagedInstallTest/src/com/android/tests/stagedinstallinternal/host/StagedInstallInternalTest.java
+++ b/tests/StagedInstallTest/src/com/android/tests/stagedinstallinternal/host/StagedInstallInternalTest.java
@@ -43,7 +43,9 @@
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.io.BufferedWriter;
import java.io.File;
+import java.io.FileWriter;
import java.util.List;
import java.util.stream.Collectors;
@@ -60,6 +62,9 @@
private static final String APK_A = "TestAppAv1.apk";
private static final String APK_IN_APEX_TESTAPEX_NAME = "com.android.apex.apkrollback.test";
+ private static final String TEST_VENDOR_APEX_ALLOW_LIST =
+ "/vendor/etc/sysconfig/test-vendor-apex-allow-list.xml";
+
private final InstallUtilsHost mHostUtils = new InstallUtilsHost(this);
/**
@@ -87,7 +92,8 @@
"/data/apex/active/" + APK_IN_APEX_TESTAPEX_NAME + "*.apex",
"/data/apex/active/" + SHIM_APEX_PACKAGE_NAME + "*.apex",
"/system/apex/test.rebootless_apex_v1.apex",
- "/data/apex/active/test.apex.rebootless*.apex");
+ "/data/apex/active/test.apex.rebootless*.apex",
+ TEST_VENDOR_APEX_ALLOW_LIST);
}
@Before
@@ -134,7 +140,23 @@
}
getDevice().remountSystemWritable();
assertTrue(getDevice().pushFile(apex, "/system/apex/" + fileName));
- getDevice().reboot();
+ }
+
+ private void pushTestVendorApexAllowList(String installerPackageName) throws Exception {
+ if (!getDevice().isAdbRoot()) {
+ getDevice().enableAdbRoot();
+ }
+ getDevice().remountSystemWritable();
+ File file = File.createTempFile("test-vendor-apex-allow-list", ".xml");
+ try (BufferedWriter writer = new BufferedWriter(new FileWriter(file))) {
+ final String fmt =
+ "<config>\n"
+ + " <allowed-vendor-apex package=\"test.apex.rebootless\" "
+ + " installerPackage=\"%s\" />\n"
+ + "</config>";
+ writer.write(String.format(fmt, installerPackageName));
+ }
+ getDevice().pushFile(file, TEST_VENDOR_APEX_ALLOW_LIST);
}
/**
@@ -144,6 +166,8 @@
@LargeTest
public void testDuplicateApkInApexShouldFail() throws Exception {
pushTestApex(APK_IN_APEX_TESTAPEX_NAME + "_v1.apex");
+ getDevice().reboot();
+
runPhase("testDuplicateApkInApexShouldFail_Commit");
getDevice().reboot();
runPhase("testDuplicateApkInApexShouldFail_Verify");
@@ -389,11 +413,71 @@
}
@Test
+ public void testApexInstallerNotInAllowListCanNotInstall() throws Exception {
+ assumeTrue("Device does not support updating APEX",
+ mHostUtils.isApexUpdateSupported());
+
+ runPhase("testApexInstallerNotInAllowListCanNotInstall_staged");
+ runPhase("testApexInstallerNotInAllowListCanNotInstall_nonStaged");
+ }
+
+ @Test
+ @LargeTest
+ public void testApexNotInAllowListCanNotInstall() throws Exception {
+ assumeTrue("Device does not support updating APEX",
+ mHostUtils.isApexUpdateSupported());
+
+ pushTestApex("test.rebootless_apex_v1.apex");
+ getDevice().reboot();
+
+ runPhase("testApexNotInAllowListCanNotInstall_staged");
+ runPhase("testApexNotInAllowListCanNotInstall_nonStaged");
+ }
+
+ @Test
+ @LargeTest
+ public void testVendorApexWrongInstaller() throws Exception {
+ assumeTrue("Device does not support updating APEX",
+ mHostUtils.isApexUpdateSupported());
+
+ pushTestVendorApexAllowList("com.wrong.installer");
+ pushTestApex("test.rebootless_apex_v1.apex");
+ getDevice().reboot();
+
+ runPhase("testVendorApexWrongInstaller_staged");
+ runPhase("testVendorApexWrongInstaller_nonStaged");
+ }
+
+ @Test
+ @LargeTest
+ public void testVendorApexCorrectInstaller() throws Exception {
+ assumeTrue("Device does not support updating APEX",
+ mHostUtils.isApexUpdateSupported());
+
+ pushTestVendorApexAllowList("com.android.tests.stagedinstallinternal");
+ pushTestApex("test.rebootless_apex_v1.apex");
+ getDevice().reboot();
+
+ runPhase("testVendorApexCorrectInstaller_staged");
+ runPhase("testVendorApexCorrectInstaller_nonStaged");
+ }
+
+ @Test
public void testRebootlessUpdates() throws Exception {
pushTestApex("test.rebootless_apex_v1.apex");
+ getDevice().reboot();
+
runPhase("testRebootlessUpdates");
}
+ @Test
+ public void testRebootlessUpdate_hasStagedSessionWithSameApex_fails() throws Exception {
+ assumeTrue("Device does not support updating APEX",
+ mHostUtils.isApexUpdateSupported());
+
+ runPhase("testRebootlessUpdate_hasStagedSessionWithSameApex_fails");
+ }
+
private List<String> getStagingDirectories() throws DeviceNotAvailableException {
String baseDir = "/data/app-staging";
try {
diff --git a/tools/aapt2/SdkConstants.cpp b/tools/aapt2/SdkConstants.cpp
index f7a5ba1..ea886db 100644
--- a/tools/aapt2/SdkConstants.cpp
+++ b/tools/aapt2/SdkConstants.cpp
@@ -26,9 +26,8 @@
namespace aapt {
static ApiVersion sDevelopmentSdkLevel = 10000;
-static const auto sDevelopmentSdkCodeNames = std::unordered_set<StringPiece>({
- "Q", "R", "S", "T"
-});
+static const auto sDevelopmentSdkCodeNames =
+ std::unordered_set<StringPiece>({"Q", "R", "S", "Tiramisu"});
static const std::vector<std::pair<uint16_t, ApiVersion>> sAttrIdMap = {
{0x021c, 1},