Merge "Support to query TYPE_WIFI usage with subscriberId" into sc-dev
diff --git a/core/api/current.txt b/core/api/current.txt
index 37dd6b8..0bf47de 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -141,6 +141,7 @@
field public static final String REORDER_TASKS = "android.permission.REORDER_TASKS";
field public static final String REQUEST_COMPANION_PROFILE_WATCH = "android.permission.REQUEST_COMPANION_PROFILE_WATCH";
field public static final String REQUEST_COMPANION_RUN_IN_BACKGROUND = "android.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND";
+ field public static final String REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND = "android.permission.REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND";
field public static final String REQUEST_COMPANION_USE_DATA_IN_BACKGROUND = "android.permission.REQUEST_COMPANION_USE_DATA_IN_BACKGROUND";
field public static final String REQUEST_DELETE_PACKAGES = "android.permission.REQUEST_DELETE_PACKAGES";
field public static final String REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
@@ -9039,7 +9040,7 @@
method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public String getName();
method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getType();
method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public android.os.ParcelUuid[] getUuids();
- method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean setAlias(@NonNull String);
+ method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int setAlias(@Nullable String);
method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setPairingConfirmation(boolean);
method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean setPin(byte[]);
method public void writeToParcel(android.os.Parcel, int);
@@ -9487,6 +9488,15 @@
field public static final int TYPE_SCO = 2; // 0x2
}
+ public final class BluetoothStatusCodes {
+ field public static final int ERROR_BLUETOOTH_NOT_ALLOWED = 2; // 0x2
+ field public static final int ERROR_BLUETOOTH_NOT_ENABLED = 1; // 0x1
+ field public static final int ERROR_DEVICE_NOT_BONDED = 3; // 0x3
+ field public static final int ERROR_MISSING_BLUETOOTH_CONNECT_PERMISSION = 6; // 0x6
+ field public static final int ERROR_UNKNOWN = 2147483647; // 0x7fffffff
+ field public static final int SUCCESS = 0; // 0x0
+ }
+
}
package android.bluetooth.le {
@@ -31948,6 +31958,7 @@
method public long getUserCreationTime(android.os.UserHandle);
method public android.os.UserHandle getUserForSerialNumber(long);
method @NonNull @RequiresPermission(anyOf={"android.permission.MANAGE_USERS", android.Manifest.permission.GET_ACCOUNTS_PRIVILEGED, "android.permission.CREATE_USERS"}, conditional=true) public String getUserName();
+ method public int getUserPrivacySensitivity();
method public java.util.List<android.os.UserHandle> getUserProfiles();
method public android.os.Bundle getUserRestrictions();
method @RequiresPermission(anyOf={"android.permission.MANAGE_USERS", "android.permission.INTERACT_ACROSS_USERS"}, conditional=true) public android.os.Bundle getUserRestrictions(android.os.UserHandle);
@@ -31980,6 +31991,7 @@
field public static final String DISALLOW_AUTOFILL = "no_autofill";
field public static final String DISALLOW_BLUETOOTH = "no_bluetooth";
field public static final String DISALLOW_BLUETOOTH_SHARING = "no_bluetooth_sharing";
+ field public static final String DISALLOW_CAMERA_TOGGLE = "disallow_camera_toggle";
field public static final String DISALLOW_CONFIG_BLUETOOTH = "no_config_bluetooth";
field public static final String DISALLOW_CONFIG_BRIGHTNESS = "no_config_brightness";
field public static final String DISALLOW_CONFIG_CELL_BROADCASTS = "no_config_cell_broadcasts";
@@ -32004,6 +32016,7 @@
field public static final String DISALLOW_INSTALL_APPS = "no_install_apps";
field public static final String DISALLOW_INSTALL_UNKNOWN_SOURCES = "no_install_unknown_sources";
field public static final String DISALLOW_INSTALL_UNKNOWN_SOURCES_GLOBALLY = "no_install_unknown_sources_globally";
+ field public static final String DISALLOW_MICROPHONE_TOGGLE = "disallow_microphone_toggle";
field public static final String DISALLOW_MODIFY_ACCOUNTS = "no_modify_accounts";
field public static final String DISALLOW_MOUNT_PHYSICAL_MEDIA = "no_physical_media";
field public static final String DISALLOW_NETWORK_RESET = "no_network_reset";
@@ -32026,6 +32039,8 @@
field public static final String DISALLOW_USER_SWITCH = "no_user_switch";
field public static final String ENSURE_VERIFY_APPS = "ensure_verify_apps";
field public static final String KEY_RESTRICTIONS_PENDING = "restrictions_pending";
+ field public static final int PRIVACY_SENSITIVITY_DEFAULT = 0; // 0x0
+ field public static final int PRIVACY_SENSITIVITY_LOCATION = 1; // 0x1
field public static final int QUIET_MODE_DISABLE_ONLY_IF_CREDENTIAL_NOT_REQUIRED = 1; // 0x1
field public static final int USER_CREATION_FAILED_NOT_PERMITTED = 1; // 0x1
field public static final int USER_CREATION_FAILED_NO_MORE_USERS = 2; // 0x2
@@ -39223,7 +39238,8 @@
method @MainThread public static android.speech.SpeechRecognizer createSpeechRecognizer(android.content.Context);
method @MainThread public static android.speech.SpeechRecognizer createSpeechRecognizer(android.content.Context, android.content.ComponentName);
method public void destroy();
- method public static boolean isRecognitionAvailable(android.content.Context);
+ method public static boolean isOnDeviceRecognitionAvailable(@NonNull android.content.Context);
+ method public static boolean isRecognitionAvailable(@NonNull android.content.Context);
method @MainThread public void setRecognitionListener(android.speech.RecognitionListener);
method @MainThread public void startListening(android.content.Intent);
method @MainThread public void stopListening();
@@ -51415,7 +51431,6 @@
public final class AutofillManager {
method public void cancel();
- method public void clearAutofillRequestCallback();
method public void commit();
method public void disableAutofillServices();
method @Nullable public android.content.ComponentName getAutofillServiceComponentName();
@@ -51441,7 +51456,6 @@
method public void registerCallback(@Nullable android.view.autofill.AutofillManager.AutofillCallback);
method public void requestAutofill(@NonNull android.view.View);
method public void requestAutofill(@NonNull android.view.View, int, @NonNull android.graphics.Rect);
- method public void setAutofillRequestCallback(@NonNull java.util.concurrent.Executor, @NonNull android.view.autofill.AutofillRequestCallback);
method public void setUserData(@Nullable android.service.autofill.UserData);
method public void unregisterCallback(@Nullable android.view.autofill.AutofillManager.AutofillCallback);
field public static final String EXTRA_ASSIST_STRUCTURE = "android.view.autofill.extra.ASSIST_STRUCTURE";
@@ -51460,10 +51474,6 @@
field public static final int EVENT_INPUT_UNAVAILABLE = 3; // 0x3
}
- public interface AutofillRequestCallback {
- method public void onFillRequest(@Nullable android.view.inputmethod.InlineSuggestionsRequest, @NonNull android.os.CancellationSignal, @NonNull android.service.autofill.FillCallback);
- }
-
public final class AutofillValue implements android.os.Parcelable {
method public int describeContents();
method public static android.view.autofill.AutofillValue forDate(long);
@@ -51834,12 +51844,10 @@
ctor public InlineSuggestionsRequest.Builder(@NonNull java.util.List<android.widget.inline.InlinePresentationSpec>);
method @NonNull public android.view.inputmethod.InlineSuggestionsRequest.Builder addInlinePresentationSpecs(@NonNull android.widget.inline.InlinePresentationSpec);
method @NonNull public android.view.inputmethod.InlineSuggestionsRequest build();
- method @NonNull public android.view.inputmethod.InlineSuggestionsRequest.Builder setClientSupported(boolean);
method @NonNull public android.view.inputmethod.InlineSuggestionsRequest.Builder setExtras(@NonNull android.os.Bundle);
method @NonNull public android.view.inputmethod.InlineSuggestionsRequest.Builder setInlinePresentationSpecs(@NonNull java.util.List<android.widget.inline.InlinePresentationSpec>);
method @NonNull public android.view.inputmethod.InlineSuggestionsRequest.Builder setInlineTooltipPresentationSpec(@NonNull android.widget.inline.InlinePresentationSpec);
method @NonNull public android.view.inputmethod.InlineSuggestionsRequest.Builder setMaxSuggestionCount(int);
- method @NonNull public android.view.inputmethod.InlineSuggestionsRequest.Builder setServiceSupported(boolean);
method @NonNull public android.view.inputmethod.InlineSuggestionsRequest.Builder setSupportedLocales(@NonNull android.os.LocaleList);
}
@@ -52846,7 +52854,7 @@
method public int getTranslationFlags();
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.view.translation.TranslationContext> CREATOR;
- field public static final int FLAG_DICTIONARY_DESCRIPTION = 4; // 0x4
+ field public static final int FLAG_DEFINITIONS = 4; // 0x4
field public static final int FLAG_LOW_LATENCY = 1; // 0x1
field public static final int FLAG_TRANSLITERATION = 2; // 0x2
}
@@ -52931,12 +52939,13 @@
public final class TranslationResponseValue implements android.os.Parcelable {
method public int describeContents();
method @NonNull public static android.view.translation.TranslationResponseValue forError();
- method @Nullable public CharSequence getDictionaryDescription();
+ method @NonNull public android.os.Bundle getExtras();
method public int getStatusCode();
method @Nullable public CharSequence getText();
method @Nullable public CharSequence getTransliteration();
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.view.translation.TranslationResponseValue> CREATOR;
+ field public static final String EXTRA_DEFINITIONS = "android.view.translation.extra.DEFINITIONS";
field public static final int STATUS_ERROR = 1; // 0x1
field public static final int STATUS_SUCCESS = 0; // 0x0
}
@@ -52944,7 +52953,7 @@
public static final class TranslationResponseValue.Builder {
ctor public TranslationResponseValue.Builder(int);
method @NonNull public android.view.translation.TranslationResponseValue build();
- method @NonNull public android.view.translation.TranslationResponseValue.Builder setDictionaryDescription(@NonNull CharSequence);
+ method @NonNull public android.view.translation.TranslationResponseValue.Builder setExtras(@NonNull android.os.Bundle);
method @NonNull public android.view.translation.TranslationResponseValue.Builder setText(@NonNull CharSequence);
method @NonNull public android.view.translation.TranslationResponseValue.Builder setTransliteration(@NonNull CharSequence);
}
@@ -52976,7 +52985,7 @@
method public void onFinished();
method public void onPaused();
method public default void onResumed(@NonNull android.icu.util.ULocale, @NonNull android.icu.util.ULocale);
- method @Deprecated public void onStarted(@NonNull String, @NonNull String);
+ method @Deprecated public default void onStarted(@NonNull String, @NonNull String);
method public default void onStarted(@NonNull android.icu.util.ULocale, @NonNull android.icu.util.ULocale);
}
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 3b205ae..143d674b 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -1950,9 +1950,6 @@
field public static final int ACTIVE_DEVICE_ALL = 2; // 0x2
field public static final int ACTIVE_DEVICE_AUDIO = 0; // 0x0
field public static final int ACTIVE_DEVICE_PHONE_CALL = 1; // 0x1
- field public static final int OOB_ERROR_ADAPTER_DISABLED = 2; // 0x2
- field public static final int OOB_ERROR_ANOTHER_ACTIVE_REQUEST = 1; // 0x1
- field public static final int OOB_ERROR_UNKNOWN = 0; // 0x0
}
public static interface BluetoothAdapter.OnMetadataChangedListener {
@@ -2090,6 +2087,10 @@
field @Deprecated public static final int PRIORITY_ON = 100; // 0x64
}
+ public final class BluetoothStatusCodes {
+ field public static final int ERROR_ANOTHER_ACTIVE_OOB_REQUEST = 1000; // 0x3e8
+ }
+
public final class BluetoothUuid {
method public static boolean containsAnyUuid(@Nullable android.os.ParcelUuid[], @Nullable android.os.ParcelUuid[]);
method @NonNull public static android.os.ParcelUuid parseUuidFrom(@Nullable byte[]);
@@ -2245,7 +2246,7 @@
public final class CompanionDeviceManager {
method @RequiresPermission(android.Manifest.permission.ASSOCIATE_COMPANION_DEVICES) public void associate(@NonNull String, @NonNull android.net.MacAddress);
- method @RequiresPermission("android.permission.MANAGE_COMPANION_DEVICES") public boolean canPairWithoutPrompt(@NonNull String, @NonNull String, int);
+ method @RequiresPermission("android.permission.MANAGE_COMPANION_DEVICES") public boolean canPairWithoutPrompt(@NonNull String, @NonNull String, @NonNull android.os.UserHandle);
method @RequiresPermission("android.permission.MANAGE_COMPANION_DEVICES") public boolean isDeviceAssociatedForWifiConnection(@NonNull String, @NonNull android.net.MacAddress, @NonNull android.os.UserHandle);
}
@@ -12061,10 +12062,10 @@
field public static final int CALL_WAITING_STATUS_ENABLED = 1; // 0x1
field public static final int CALL_WAITING_STATUS_NOT_SUPPORTED = 4; // 0x4
field public static final int CALL_WAITING_STATUS_UNKNOWN_ERROR = 3; // 0x3
- field public static final String CAPABILITY_ALLOWED_NETWORK_TYPES_USED = "CAPABILITY_ALLOWED_NETWORK_TYPES_USED";
field public static final String CAPABILITY_NR_DUAL_CONNECTIVITY_CONFIGURATION_AVAILABLE = "CAPABILITY_NR_DUAL_CONNECTIVITY_CONFIGURATION_AVAILABLE";
field public static final String CAPABILITY_SECONDARY_LINK_BANDWIDTH_VISIBLE = "CAPABILITY_SECONDARY_LINK_BANDWIDTH_VISIBLE";
field public static final String CAPABILITY_THERMAL_MITIGATION_DATA_THROTTLING = "CAPABILITY_THERMAL_MITIGATION_DATA_THROTTLING";
+ field public static final String CAPABILITY_USES_ALLOWED_NETWORK_TYPES_BITMASK = "CAPABILITY_USES_ALLOWED_NETWORK_TYPES_BITMASK";
field public static final int CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES = -2; // 0xfffffffe
field public static final int CARRIER_PRIVILEGE_STATUS_HAS_ACCESS = 1; // 0x1
field public static final int CARRIER_PRIVILEGE_STATUS_NO_ACCESS = 0; // 0x0
@@ -14733,7 +14734,7 @@
method public String getDataDirectorySuffix();
method public String getErrorString(android.content.Context, int);
method public int getPackageId(android.content.res.Resources, String);
- method @NonNull public long[] getTimestamps();
+ method @NonNull public android.webkit.WebViewFactory.StartupTimestamps getStartupTimestamps();
method @Deprecated public void invokeDrawGlFunctor(android.view.View, long, boolean);
method public boolean isMultiProcessEnabled();
method public boolean isTraceTagEnabled();
@@ -14749,12 +14750,6 @@
method public static android.content.pm.PackageInfo getLoadedPackageInfo();
method public static int loadWebViewNativeLibraryFromPackage(String, ClassLoader);
method public static void prepareWebViewInZygote();
- field public static final int ADD_ASSETS_END = 4; // 0x4
- field public static final int ADD_ASSETS_START = 3; // 0x3
- field public static final int CREATE_CONTEXT_END = 2; // 0x2
- field public static final int CREATE_CONTEXT_START = 1; // 0x1
- field public static final int GET_CLASS_LOADER_END = 6; // 0x6
- field public static final int GET_CLASS_LOADER_START = 5; // 0x5
field public static final int LIBLOAD_ADDRESS_SPACE_NOT_RESERVED = 2; // 0x2
field public static final int LIBLOAD_FAILED_JNI_CALL = 7; // 0x7
field public static final int LIBLOAD_FAILED_LISTING_WEBVIEW_PACKAGES = 4; // 0x4
@@ -14765,11 +14760,20 @@
field public static final int LIBLOAD_FAILED_WAITING_FOR_WEBVIEW_REASON_UNKNOWN = 8; // 0x8
field public static final int LIBLOAD_SUCCESS = 0; // 0x0
field public static final int LIBLOAD_WRONG_PACKAGE_NAME = 1; // 0x1
- field public static final int NATIVE_LOAD_END = 8; // 0x8
- field public static final int NATIVE_LOAD_START = 7; // 0x7
- field public static final int PROVIDER_CLASS_FOR_NAME_END = 10; // 0xa
- field public static final int PROVIDER_CLASS_FOR_NAME_START = 9; // 0x9
- field public static final int WEBVIEW_LOAD_START = 0; // 0x0
+ }
+
+ public static class WebViewFactory.StartupTimestamps {
+ method public long getAddAssetsEnd();
+ method public long getAddAssetsStart();
+ method public long getCreateContextEnd();
+ method public long getCreateContextStart();
+ method public long getGetClassLoaderEnd();
+ method public long getGetClassLoaderStart();
+ method public long getNativeLoadEnd();
+ method public long getNativeLoadStart();
+ method public long getProviderClassForNameEnd();
+ method public long getProviderClassForNameStart();
+ method public long getWebViewLoadStart();
}
public interface WebViewFactoryProvider {
diff --git a/core/java/android/app/ActivityOptions.java b/core/java/android/app/ActivityOptions.java
index 80f1e6e..306b54d 100644
--- a/core/java/android/app/ActivityOptions.java
+++ b/core/java/android/app/ActivityOptions.java
@@ -327,6 +327,9 @@
private static final String KEY_LAUNCHED_FROM_BUBBLE =
"android.activity.launchTypeBubble";
+ /** See {@link #setTransientLaunch()}. */
+ private static final String KEY_TRANSIENT_LAUNCH = "android.activity.transientLaunch";
+
/**
* @see #setLaunchCookie
* @hide
@@ -414,6 +417,7 @@
private int mSplashScreenThemeResId;
private boolean mRemoveWithTaskOrganizer;
private boolean mLaunchedFromBubble;
+ private boolean mTransientLaunch;
/**
* Create an ActivityOptions specifying a custom animation to run when
@@ -1166,6 +1170,7 @@
mSplashScreenThemeResId = opts.getInt(KEY_SPLASH_SCREEN_THEME);
mRemoveWithTaskOrganizer = opts.getBoolean(KEY_REMOVE_WITH_TASK_ORGANIZER);
mLaunchedFromBubble = opts.getBoolean(KEY_LAUNCHED_FROM_BUBBLE);
+ mTransientLaunch = opts.getBoolean(KEY_TRANSIENT_LAUNCH);
}
/**
@@ -1663,6 +1668,28 @@
}
/**
+ * Sets whether the activity launch is part of a transient operation. If it is, it will not
+ * cause lifecycle changes in existing activities even if it were to occlude them (ie. other
+ * activities occluded by this one will not be paused or stopped until the launch is committed).
+ * As a consequence, it will start immediately since it doesn't need to wait for other
+ * lifecycles to evolve. Current user is recents.
+ * @hide
+ */
+ public ActivityOptions setTransientLaunch() {
+ mTransientLaunch = true;
+ return this;
+ }
+
+ /**
+ * @see #setTransientLaunch()
+ * @return whether the activity launch is part of a transient operation.
+ * @hide
+ */
+ public boolean getTransientLaunch() {
+ return mTransientLaunch;
+ }
+
+ /**
* Update the current values in this ActivityOptions from those supplied
* in <var>otherOptions</var>. Any values
* defined in <var>otherOptions</var> replace those in the base options.
@@ -1902,6 +1929,9 @@
if (mLaunchedFromBubble) {
b.putBoolean(KEY_LAUNCHED_FROM_BUBBLE, mLaunchedFromBubble);
}
+ if (mTransientLaunch) {
+ b.putBoolean(KEY_TRANSIENT_LAUNCH, mTransientLaunch);
+ }
return b;
}
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index f626d4b..92bdda3 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -36,6 +36,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.UserIdInt;
import android.app.assist.AssistContent;
import android.app.assist.AssistStructure;
import android.app.backup.BackupAgent;
@@ -61,6 +62,7 @@
import android.content.ContentProvider;
import android.content.ContentResolver;
import android.content.Context;
+import android.content.Context.CreatePackageOptions;
import android.content.IContentProvider;
import android.content.IIntentReceiver;
import android.content.Intent;
@@ -72,6 +74,7 @@
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.pm.PackageManager.ApplicationInfoFlags;
import android.content.pm.ParceledListSlice;
import android.content.pm.PermissionInfo;
import android.content.pm.ProviderInfo;
@@ -2367,16 +2370,22 @@
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public final LoadedApk getPackageInfo(String packageName, CompatibilityInfo compatInfo,
- int flags) {
+ @CreatePackageOptions int flags) {
return getPackageInfo(packageName, compatInfo, flags, UserHandle.myUserId());
}
public final LoadedApk getPackageInfo(String packageName, CompatibilityInfo compatInfo,
- int flags, int userId) {
+ @CreatePackageOptions int flags, @UserIdInt int userId) {
+ return getPackageInfo(packageName, compatInfo, flags, userId, 0 /* packageFlags */);
+ }
+
+ public final LoadedApk getPackageInfo(String packageName, CompatibilityInfo compatInfo,
+ @CreatePackageOptions int flags, @UserIdInt int userId,
+ @ApplicationInfoFlags int packageFlags) {
final boolean differentUser = (UserHandle.myUserId() != userId);
ApplicationInfo ai = PackageManager.getApplicationInfoAsUserCached(
packageName,
- PackageManager.GET_SHARED_LIBRARY_FILES
+ packageFlags | PackageManager.GET_SHARED_LIBRARY_FILES
| PackageManager.MATCH_DEBUG_TRIAGED_MISSING,
(userId < 0) ? UserHandle.myUserId() : userId);
synchronized (mResourcesManager) {
@@ -2419,7 +2428,7 @@
@UnsupportedAppUsage(trackingBug = 171933273)
public final LoadedApk getPackageInfo(ApplicationInfo ai, CompatibilityInfo compatInfo,
- int flags) {
+ @CreatePackageOptions int flags) {
boolean includeCode = (flags&Context.CONTEXT_INCLUDE_CODE) != 0;
boolean securityViolation = includeCode && ai.uid != 0
&& ai.uid != Process.SYSTEM_UID && (mBoundApplication != null
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java
index ed00436..92756b6 100644
--- a/core/java/android/app/AppOpsManager.java
+++ b/core/java/android/app/AppOpsManager.java
@@ -7413,8 +7413,18 @@
*/
public void setUserRestrictionForUser(int code, boolean restricted, IBinder token,
@Nullable Map<String, String[]> excludedPackageTags, int userId) {
+ setUserRestrictionForUser(code, restricted, token, excludedPackageTags, userId, false);
+ }
+
+ /**
+ * An empty array of attribution tags means exclude all tags under that package.
+ * @hide
+ */
+ public void setUserRestrictionForUser(int code, boolean restricted, IBinder token,
+ @Nullable Map<String, String[]> excludedPackageTags, int userId, boolean rejectBypass) {
try {
- mService.setUserRestriction(code, restricted, token, userId, excludedPackageTags);
+ mService.setUserRestriction(code, restricted, token, userId, excludedPackageTags,
+ rejectBypass);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 73c17b9..daef8b1 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;
@@ -47,6 +48,7 @@
import android.content.pm.ApplicationInfo;
import android.content.pm.IPackageManager;
import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.ApplicationInfoFlags;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.AssetManager;
import android.content.res.CompatResources;
@@ -60,7 +62,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;
@@ -2493,6 +2494,13 @@
@Override
public Context createPackageContextAsUser(String packageName, int flags, UserHandle user)
throws NameNotFoundException {
+ return createPackageContextAsUser(packageName, flags, user, 0 /* packageFlags */);
+ }
+
+ @Override
+ public Context createPackageContextAsUser(
+ @NonNull String packageName, @CreatePackageOptions int flags, @NonNull UserHandle user,
+ @ApplicationInfoFlags int packageFlags) throws PackageManager.NameNotFoundException {
if (packageName.equals("system") || packageName.equals("android")) {
// The system resources are loaded in every application, so we can safely copy
// the context without reloading Resources.
@@ -2503,7 +2511,7 @@
}
LoadedApk pi = mMainThread.getPackageInfo(packageName, mResources.getCompatibilityInfo(),
- flags | CONTEXT_REGISTER_PACKAGE, user.getIdentifier());
+ flags | CONTEXT_REGISTER_PACKAGE, user.getIdentifier(), packageFlags);
if (pi != null) {
ContextImpl c = new ContextImpl(this, mMainThread, pi, mParams,
mAttributionSource.getAttributionTag(),
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index fc2c6ac..20305e9 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -6478,10 +6478,11 @@
ApplicationInfo applicationInfo = n.extras.getParcelable(
EXTRA_BUILDER_APPLICATION_INFO);
Context builderContext;
- if (applicationInfo != null) {
+ if (applicationInfo != null && applicationInfo.packageName != null) {
try {
- builderContext = context.createApplicationContext(applicationInfo,
- Context.CONTEXT_RESTRICTED);
+ builderContext = context.createPackageContextAsUser(applicationInfo.packageName,
+ Context.CONTEXT_RESTRICTED,
+ UserHandle.getUserHandleForUid(applicationInfo.uid));
} catch (NameNotFoundException e) {
Log.e(TAG, "ApplicationInfo " + applicationInfo + " not found");
builderContext = context; // try with our context
diff --git a/core/java/android/app/admin/DelegatedAdminReceiver.java b/core/java/android/app/admin/DelegatedAdminReceiver.java
index 36097c9..c74ddb2 100644
--- a/core/java/android/app/admin/DelegatedAdminReceiver.java
+++ b/core/java/android/app/admin/DelegatedAdminReceiver.java
@@ -104,6 +104,10 @@
* receiver's manifest in order to receive this callback. The default implementation
* simply throws {@link UnsupportedOperationException}.
*
+ * <p>
+ * This callback is triggered by a foreground broadcast and the app should ensure that any
+ * long-running work is not executed synchronously inside the callback.
+ *
* @param context The running context as per {@link #onReceive}.
* @param intent The received intent as per {@link #onReceive}.
* @param batchToken The token representing the current batch of network logs.
@@ -130,6 +134,10 @@
* the receiver's manifest in order to receive this callback. The default implementation
* simply throws {@link UnsupportedOperationException}.
*
+ * <p>
+ * This callback is triggered by a foreground broadcast and the app should ensure that any
+ * long-running work is not executed synchronously inside the callback.
+ *
* @param context The running context as per {@link #onReceive}.
* @param intent The received intent as per {@link #onReceive}.
* @see DevicePolicyManager#retrieveSecurityLogs
diff --git a/core/java/android/app/admin/DeviceAdminReceiver.java b/core/java/android/app/admin/DeviceAdminReceiver.java
index da64dcd..27e8c46 100644
--- a/core/java/android/app/admin/DeviceAdminReceiver.java
+++ b/core/java/android/app/admin/DeviceAdminReceiver.java
@@ -942,7 +942,12 @@
*
* <p>This callback will be re-triggered if the logs are not retrieved.
*
- * <p>This callback is only applicable to device owners.
+ * <p>This callback is only applicable to device owners and profile owners of
+ * organization-owned managed profiles.
+ *
+ * <p>
+ * This callback is triggered by a foreground broadcast and the app should ensure that any
+ * long-running work is not executed synchronously inside the callback.
*
* @param context The running context as per {@link #onReceive}.
* @param intent The received intent as per {@link #onReceive}.
@@ -961,7 +966,11 @@
* possible to retrieve the network logs batch with the most recent {@code batchToken} provided
* by this callback. See {@link DevicePolicyManager#setAffiliationIds}.
*
- * <p>This callback is only applicable to device owners.
+ * <p>This callback is only applicable to device owners and profile owners.
+ *
+ * <p>
+ * This callback is triggered by a foreground broadcast and the app should ensure that any
+ * long-running work is not executed synchronously inside the callback.
*
* @param context The running context as per {@link #onReceive}.
* @param intent The received intent as per {@link #onReceive}.
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 38b19ae..c23cacb 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -10369,11 +10369,11 @@
/**
* Called by device owners to set the user's global location setting.
*
- * <p><b>Note: </b> this call is ignored on
- * {@link android.content.pm.PackageManager#FEATURE_AUTOMOTIVE automotive builds}.
*
* @param admin Which {@link DeviceAdminReceiver} this request is associated with
- * @param locationEnabled whether location should be enabled or disabled
+ * @param locationEnabled whether location should be enabled or disabled. <b>Note: </b> on
+ * {@link android.content.pm.PackageManager#FEATURE_AUTOMOTIVE automotive builds}, calls to
+ * disable will be ignored.
* @throws SecurityException if {@code admin} is not a device owner.
*/
public void setLocationEnabled(@NonNull ComponentName admin, boolean locationEnabled) {
diff --git a/core/java/android/app/usage/NetworkStatsManager.java b/core/java/android/app/usage/NetworkStatsManager.java
index 65b9facc8..fe99f85 100644
--- a/core/java/android/app/usage/NetworkStatsManager.java
+++ b/core/java/android/app/usage/NetworkStatsManager.java
@@ -658,14 +658,14 @@
}
/**
- * Notify {@code NetworkStatsService} about network status changed.
+ * Notify {@code NetworkStatsService} about network status changed.
*
- * Notifies NetworkStatsService of network state changes for data usage accounting purposes.
+ * Notifies NetworkStatsService of network state changes for data usage accounting purposes.
*
- * To avoid races that attribute data usage to wrong network, such as new network with
- * the same interface after SIM hot-swap, this function will not return until
- * {@code NetworkStatsService} finishes its work of retrieving traffic statistics from
- * all data sources.
+ * To avoid races that attribute data usage to wrong network, such as new network with
+ * the same interface after SIM hot-swap, this function will not return until
+ * {@code NetworkStatsService} finishes its work of retrieving traffic statistics from
+ * all data sources.
*
* @param defaultNetworks the list of all networks that could be used by network traffic that
* does not explicitly select a network.
@@ -692,8 +692,7 @@
Objects.requireNonNull(defaultNetworks);
Objects.requireNonNull(networkStateSnapshots);
Objects.requireNonNull(underlyingNetworkInfos);
- // TODO: Change internal namings after the name is decided.
- mService.forceUpdateIfaces(defaultNetworks.toArray(new Network[0]),
+ mService.notifyNetworkStatus(defaultNetworks.toArray(new Network[0]),
networkStateSnapshots.toArray(new NetworkStateSnapshot[0]), activeIface,
underlyingNetworkInfos.toArray(new UnderlyingNetworkInfo[0]));
} catch (RemoteException e) {
diff --git a/core/java/android/appwidget/AppWidgetHostView.java b/core/java/android/appwidget/AppWidgetHostView.java
index ba3fc1e..3b11a19 100644
--- a/core/java/android/appwidget/AppWidgetHostView.java
+++ b/core/java/android/appwidget/AppWidgetHostView.java
@@ -37,6 +37,7 @@
import android.os.Bundle;
import android.os.CancellationSignal;
import android.os.Parcelable;
+import android.os.UserHandle;
import android.util.AttributeSet;
import android.util.Log;
import android.util.Pair;
@@ -718,9 +719,10 @@
protected Context getRemoteContext() {
try {
// Return if cloned successfully, otherwise default
- Context newContext = mContext.createApplicationContext(
- mInfo.providerInfo.applicationInfo,
- Context.CONTEXT_RESTRICTED);
+ final ApplicationInfo info = mInfo.providerInfo.applicationInfo;
+ Context newContext = mContext.createPackageContextAsUser(info.packageName,
+ Context.CONTEXT_RESTRICTED,
+ UserHandle.getUserHandleForUid(info.uid));
if (mColorResources != null) {
mColorResources.apply(newContext);
}
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index 9fc1f88..5494172 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -3258,39 +3258,14 @@
/** @hide */
@Retention(RetentionPolicy.SOURCE)
- @IntDef(prefix = { "OOB_ERROR_" }, value = {
- OOB_ERROR_UNKNOWN,
- OOB_ERROR_ANOTHER_ACTIVE_REQUEST,
- OOB_ERROR_ADAPTER_DISABLED
+ @IntDef(value = {
+ BluetoothStatusCodes.ERROR_UNKNOWN,
+ BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED,
+ BluetoothStatusCodes.ERROR_ANOTHER_ACTIVE_OOB_REQUEST,
})
public @interface OobError {}
/**
- * An unknown error has occurred in the controller, stack, or callback pipeline.
- *
- * @hide
- */
- @SystemApi
- public static final int OOB_ERROR_UNKNOWN = 0;
-
- /**
- * If another application has already requested {@link OobData} then another fetch will be
- * disallowed until the callback is removed.
- *
- * @hide
- */
- @SystemApi
- public static final int OOB_ERROR_ANOTHER_ACTIVE_REQUEST = 1;
-
- /**
- * The adapter is currently disabled, please enable it.
- *
- * @hide
- */
- @SystemApi
- public static final int OOB_ERROR_ADAPTER_DISABLED = 2;
-
- /**
* Provides callback methods for receiving {@link OobData} from the host stack, as well as an
* error interface in order to allow the caller to determine next steps based on the {@code
* ErrorCode}.
@@ -3310,7 +3285,7 @@
/**
* Provides feedback when things don't go as expected.
*
- * @param errorCode - the code descibing the type of error that occurred.
+ * @param errorCode - the code describing the type of error that occurred.
*/
void onError(@OobError int errorCode);
}
@@ -3407,7 +3382,7 @@
Preconditions.checkNotNull(callback);
if (!isEnabled()) {
Log.w(TAG, "generateLocalOobData(): Adapter isn't enabled!");
- callback.onError(OOB_ERROR_ADAPTER_DISABLED);
+ callback.onError(BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED);
} else {
try {
mService.generateLocalOobData(transport, new WrappedOobDataCallback(callback,
@@ -4210,141 +4185,45 @@
*/
@Retention(RetentionPolicy.SOURCE)
@IntDef(prefix = { "REASON_" }, value = {
- REASON_UNKNOWN,
- REASON_LOCAL_REQUEST,
- REASON_REMOTE_REQUEST,
- REASON_LOCAL_ERROR,
- REASON_REMOTE_ERROR,
- REASON_TIMEOUT,
- REASON_SECURITY,
- REASON_SYSTEM_POLICY,
- REASON_RESOURCE_LIMIT_REACHED,
- REASON_CONNECTION_EXISTS,
- REASON_BAD_PARAMETERS})
+ BluetoothStatusCodes.ERROR_UNKNOWN,
+ BluetoothStatusCodes.ERROR_DISCONNECT_REASON_LOCAL_REQUEST,
+ BluetoothStatusCodes.ERROR_DISCONNECT_REASON_REMOTE_REQUEST,
+ BluetoothStatusCodes.ERROR_DISCONNECT_REASON_LOCAL,
+ BluetoothStatusCodes.ERROR_DISCONNECT_REASON_REMOTE,
+ BluetoothStatusCodes.ERROR_DISCONNECT_REASON_TIMEOUT,
+ BluetoothStatusCodes.ERROR_DISCONNECT_REASON_SECURITY,
+ BluetoothStatusCodes.ERROR_DISCONNECT_REASON_SYSTEM_POLICY,
+ BluetoothStatusCodes.ERROR_DISCONNECT_REASON_RESOURCE_LIMIT_REACHED,
+ BluetoothStatusCodes.ERROR_DISCONNECT_REASON_CONNECTION_ALREADY_EXISTS,
+ BluetoothStatusCodes.ERROR_DISCONNECT_REASON_BAD_PARAMETERS})
public @interface DisconnectReason {}
/**
- * Indicates that the ACL disconnected due to an unknown reason.
- */
- public static final int REASON_UNKNOWN = 0;
-
- /**
- * Indicates that the ACL disconnected due to an explicit request from the local device.
- * <p>
- * Example cause: This is a normal disconnect reason, e.g., user/app initiates
- * disconnection.
- */
- public static final int REASON_LOCAL_REQUEST = 1;
-
- /**
- * Indicates that the ACL disconnected due to an explicit request from the remote device.
- * <p>
- * Example cause: This is a normal disconnect reason, e.g., user/app initiates
- * disconnection.
- * <p>
- * Example solution: The app can also prompt the user to check their remote device.
- */
- public static final int REASON_REMOTE_REQUEST = 2;
-
- /**
- * Generic disconnect reason indicating the ACL disconnected due to an error on the local
- * device.
- * <p>
- * Example solution: Prompt the user to check their local device (e.g., phone, car
- * headunit).
- */
- public static final int REASON_LOCAL_ERROR = 3;
-
- /**
- * Generic disconnect reason indicating the ACL disconnected due to an error on the remote
- * device.
- * <p>
- * Example solution: Prompt the user to check their remote device (e.g., headset, car
- * headunit, watch).
- */
- public static final int REASON_REMOTE_ERROR = 4;
-
- /**
- * Indicates that the ACL disconnected due to a timeout.
- * <p>
- * Example cause: remote device might be out of range.
- * <p>
- * Example solution: Prompt user to verify their remote device is on or in
- * connection/pairing mode.
- */
- public static final int REASON_TIMEOUT = 5;
-
- /**
- * Indicates that the ACL disconnected due to link key issues.
- * <p>
- * Example cause: Devices are either unpaired or remote device is refusing our pairing
- * request.
- * <p>
- * Example solution: Prompt user to unpair and pair again.
- */
- public static final int REASON_SECURITY = 6;
-
- /**
- * Indicates that the ACL disconnected due to the local device's system policy.
- * <p>
- * Example cause: privacy policy, power management policy, permissions, etc.
- * <p>
- * Example solution: Prompt the user to check settings, or check with their system
- * administrator (e.g. some corp-managed devices do not allow OPP connection).
- */
- public static final int REASON_SYSTEM_POLICY = 7;
-
- /**
- * Indicates that the ACL disconnected due to resource constraints, either on the local
- * device or the remote device.
- * <p>
- * Example cause: controller is busy, memory limit reached, maximum number of connections
- * reached.
- * <p>
- * Example solution: The app should wait and try again. If still failing, prompt the user
- * to disconnect some devices, or toggle Bluetooth on the local and/or the remote device.
- */
- public static final int REASON_RESOURCE_LIMIT_REACHED = 8;
-
- /**
- * Indicates that the ACL disconnected because another ACL connection already exists.
- */
- public static final int REASON_CONNECTION_EXISTS = 9;
-
- /**
- * Indicates that the ACL disconnected due to incorrect parameters passed in from the app.
- * <p>
- * Example solution: Change parameters and try again. If error persists, the app can report
- * telemetry and/or log the error in a bugreport.
- */
- public static final int REASON_BAD_PARAMETERS = 10;
-
- /**
* Returns human-readable strings corresponding to {@link DisconnectReason}.
*/
public static String disconnectReasonText(@DisconnectReason int reason) {
switch (reason) {
- case REASON_UNKNOWN:
+ case BluetoothStatusCodes.ERROR_UNKNOWN:
return "Reason unknown";
- case REASON_LOCAL_REQUEST:
+ case BluetoothStatusCodes.ERROR_DISCONNECT_REASON_LOCAL_REQUEST:
return "Local request";
- case REASON_REMOTE_REQUEST:
+ case BluetoothStatusCodes.ERROR_DISCONNECT_REASON_REMOTE_REQUEST:
return "Remote request";
- case REASON_LOCAL_ERROR:
+ case BluetoothStatusCodes.ERROR_DISCONNECT_REASON_LOCAL:
return "Local error";
- case REASON_REMOTE_ERROR:
+ case BluetoothStatusCodes.ERROR_DISCONNECT_REASON_REMOTE:
return "Remote error";
- case REASON_TIMEOUT:
+ case BluetoothStatusCodes.ERROR_DISCONNECT_REASON_TIMEOUT:
return "Timeout";
- case REASON_SECURITY:
+ case BluetoothStatusCodes.ERROR_DISCONNECT_REASON_SECURITY:
return "Security";
- case REASON_SYSTEM_POLICY:
+ case BluetoothStatusCodes.ERROR_DISCONNECT_REASON_SYSTEM_POLICY:
return "System policy";
- case REASON_RESOURCE_LIMIT_REACHED:
+ case BluetoothStatusCodes.ERROR_DISCONNECT_REASON_RESOURCE_LIMIT_REACHED:
return "Resource constrained";
- case REASON_CONNECTION_EXISTS:
+ case BluetoothStatusCodes.ERROR_DISCONNECT_REASON_CONNECTION_ALREADY_EXISTS:
return "Connection already exists";
- case REASON_BAD_PARAMETERS:
+ case BluetoothStatusCodes.ERROR_DISCONNECT_REASON_BAD_PARAMETERS:
return "Bad parameters";
default:
return "Unrecognized disconnect reason: " + reason;
diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java
index 52d4c71..f2496fe 100644
--- a/core/java/android/bluetooth/BluetoothDevice.java
+++ b/core/java/android/bluetooth/BluetoothDevice.java
@@ -1351,6 +1351,17 @@
return null;
}
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(value = {
+ BluetoothStatusCodes.SUCCESS,
+ BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED,
+ BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ALLOWED,
+ BluetoothStatusCodes.ERROR_MISSING_BLUETOOTH_CONNECT_PERMISSION,
+ BluetoothStatusCodes.ERROR_DEVICE_NOT_BONDED
+ })
+ public @interface SetAliasReturnValues{}
+
/**
* Sets the locally modifiable name (alias) of the remote Bluetooth device. This method
* overwrites the previously stored alias. The new alias is saved in local
@@ -1358,34 +1369,35 @@
*
* <p>This method requires the calling app to be associated with Companion Device Manager (see
* {@link android.companion.CompanionDeviceManager#associate(AssociationRequest,
- * android.companion.CompanionDeviceManager.Callback, Handler)}) and have the {@link
- * android.Manifest.permission#BLUETOOTH} permission. Alternatively, if the caller has the
- * {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED} permission, they can bypass the
- * Companion Device Manager association requirement.
+ * android.companion.CompanionDeviceManager.Callback, Handler)}) and have the
+ * {@link android.Manifest.permission#BLUETOOTH_CONNECT} permission. Alternatively, if the
+ * caller has the {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED} permission, they can
+ * bypass the Companion Device Manager association requirement as well as other permission
+ * requirements.
*
- * @param alias is the new locally modifiable name for the remote Bluetooth device which must be
- * non-null and not the empty string.
- * @return {@code true} if the alias is successfully set, {@code false} on error
- * @throws IllegalArgumentException if the alias is {@code null} or the empty string
+ * @param alias is the new locally modifiable name for the remote Bluetooth device which must
+ * be the empty string. If null, we clear the alias.
+ * @return whether the alias was successfully changed
+ * @throws IllegalArgumentException if the alias is the empty string
*/
@RequiresLegacyBluetoothPermission
@RequiresBluetoothConnectPermission
@RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
- public boolean setAlias(@NonNull String alias) {
- if (alias == null || alias.isEmpty()) {
- throw new IllegalArgumentException("Cannot set the alias to null or the empty string");
+ public @SetAliasReturnValues int setAlias(@Nullable String alias) {
+ if (alias != null && alias.isEmpty()) {
+ throw new IllegalArgumentException("alias cannot be the empty string");
}
final IBluetooth service = sService;
if (service == null) {
Log.e(TAG, "BT not enabled. Cannot set Remote Device name");
- return false;
+ return BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED;
}
try {
return service.setRemoteAlias(this, alias, mAttributionSource);
} catch (RemoteException e) {
Log.e(TAG, "", e);
+ throw e.rethrowFromSystemServer();
}
- return false;
}
/**
diff --git a/core/java/android/bluetooth/BluetoothStatusCodes.java b/core/java/android/bluetooth/BluetoothStatusCodes.java
new file mode 100644
index 0000000..31bb0f6
--- /dev/null
+++ b/core/java/android/bluetooth/BluetoothStatusCodes.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 android.bluetooth;
+
+import android.annotation.SystemApi;
+
+/**
+ * A class with constants representing possible return values for Bluetooth APIs. General return
+ * values occupy the range 0 to 99. Profile-specific return values occupy the range 100-999.
+ * API-specific return values start at 1000. The exception to this is the "other" error code which
+ * occupies the max integer value.
+ */
+public final class BluetoothStatusCodes {
+
+ private BluetoothStatusCodes() {}
+
+ /**
+ * Indicates that the API call was successful
+ */
+ public static final int SUCCESS = 0;
+
+ /**
+ * Error code indicating that Bluetooth is not enabled
+ */
+ public static final int ERROR_BLUETOOTH_NOT_ENABLED = 1;
+
+ /**
+ * Error code indicating that the API call was initiated by neither the system nor the active
+ * Zuser
+ */
+ public static final int ERROR_BLUETOOTH_NOT_ALLOWED = 2;
+
+ /**
+ * Error code indicating that the Bluetooth Device specified is not bonded
+ */
+ public static final int ERROR_DEVICE_NOT_BONDED = 3;
+
+ /**
+ * Error code indicating that the Bluetooth Device specified is not connected, but is bonded
+ *
+ * @hide
+ */
+ public static final int ERROR_DEVICE_NOT_CONNECTED = 4;
+
+ /**
+ * Error code indicating that the caller does not have the
+ * {@link android.Manifest.permission#BLUETOOTH_ADVERTISE} permission
+ *
+ * @hide
+ */
+ public static final int ERROR_MISSING_BLUETOOTH_ADVERTISE_PERMISSION = 5;
+
+ /**
+ * Error code indicating that the caller does not have the
+ * {@link android.Manifest.permission#BLUETOOTH_CONNECT} permission
+ */
+ public static final int ERROR_MISSING_BLUETOOTH_CONNECT_PERMISSION = 6;
+
+ /**
+ * Error code indicating that the caller does not have the
+ * {@link android.Manifest.permission#BLUETOOTH_SCAN} permission
+ *
+ * @hide
+ */
+ public static final int ERROR_MISSING_BLUETOOTH_SCAN_PERMISSION = 7;
+
+ /**
+ * If another application has already requested {@link OobData} then another fetch will be
+ * disallowed until the callback is removed.
+ *
+ * @hide
+ */
+ @SystemApi
+ public static final int ERROR_ANOTHER_ACTIVE_OOB_REQUEST = 1000;
+
+ /**
+ * Indicates that the ACL disconnected due to an explicit request from the local device.
+ * <p>
+ * Example cause: This is a normal disconnect reason, e.g., user/app initiates
+ * disconnection.
+ *
+ * @hide
+ */
+ public static final int ERROR_DISCONNECT_REASON_LOCAL_REQUEST = 1100;
+
+ /**
+ * Indicates that the ACL disconnected due to an explicit request from the remote device.
+ * <p>
+ * Example cause: This is a normal disconnect reason, e.g., user/app initiates
+ * disconnection.
+ * <p>
+ * Example solution: The app can also prompt the user to check their remote device.
+ *
+ * @hide
+ */
+ public static final int ERROR_DISCONNECT_REASON_REMOTE_REQUEST = 1101;
+
+ /**
+ * Generic disconnect reason indicating the ACL disconnected due to an error on the local
+ * device.
+ * <p>
+ * Example solution: Prompt the user to check their local device (e.g., phone, car
+ * headunit).
+ *
+ * @hide
+ */
+ public static final int ERROR_DISCONNECT_REASON_LOCAL = 1102;
+
+ /**
+ * Generic disconnect reason indicating the ACL disconnected due to an error on the remote
+ * device.
+ * <p>
+ * Example solution: Prompt the user to check their remote device (e.g., headset, car
+ * headunit, watch).
+ *
+ * @hide
+ */
+ public static final int ERROR_DISCONNECT_REASON_REMOTE = 1103;
+
+ /**
+ * Indicates that the ACL disconnected due to a timeout.
+ * <p>
+ * Example cause: remote device might be out of range.
+ * <p>
+ * Example solution: Prompt user to verify their remote device is on or in
+ * connection/pairing mode.
+ *
+ * @hide
+ */
+ public static final int ERROR_DISCONNECT_REASON_TIMEOUT = 1104;
+
+ /**
+ * Indicates that the ACL disconnected due to link key issues.
+ * <p>
+ * Example cause: Devices are either unpaired or remote device is refusing our pairing
+ * request.
+ * <p>
+ * Example solution: Prompt user to unpair and pair again.
+ *
+ * @hide
+ */
+ public static final int ERROR_DISCONNECT_REASON_SECURITY = 1105;
+
+ /**
+ * Indicates that the ACL disconnected due to the local device's system policy.
+ * <p>
+ * Example cause: privacy policy, power management policy, permissions, etc.
+ * <p>
+ * Example solution: Prompt the user to check settings, or check with their system
+ * administrator (e.g. some corp-managed devices do not allow OPP connection).
+ *
+ * @hide
+ */
+ public static final int ERROR_DISCONNECT_REASON_SYSTEM_POLICY = 1106;
+
+ /**
+ * Indicates that the ACL disconnected due to resource constraints, either on the local
+ * device or the remote device.
+ * <p>
+ * Example cause: controller is busy, memory limit reached, maximum number of connections
+ * reached.
+ * <p>
+ * Example solution: The app should wait and try again. If still failing, prompt the user
+ * to disconnect some devices, or toggle Bluetooth on the local and/or the remote device.
+ *
+ * @hide
+ */
+ public static final int ERROR_DISCONNECT_REASON_RESOURCE_LIMIT_REACHED = 1107;
+
+ /**
+ * Indicates that the ACL disconnected because another ACL connection already exists.
+ *
+ * @hide
+ */
+ public static final int ERROR_DISCONNECT_REASON_CONNECTION_ALREADY_EXISTS = 1108;
+
+ /**
+ * Indicates that the ACL disconnected due to incorrect parameters passed in from the app.
+ * <p>
+ * Example solution: Change parameters and try again. If error persists, the app can report
+ * telemetry and/or log the error in a bugreport.
+ *
+ * @hide
+ */
+ public static final int ERROR_DISCONNECT_REASON_BAD_PARAMETERS = 1109;
+
+ /**
+ * Indicates that an unknown error has occurred has occurred.
+ */
+ public static final int ERROR_UNKNOWN = Integer.MAX_VALUE;
+}
diff --git a/core/java/android/companion/CompanionDeviceManager.java b/core/java/android/companion/CompanionDeviceManager.java
index 0e25d8a..e6ffded 100644
--- a/core/java/android/companion/CompanionDeviceManager.java
+++ b/core/java/android/companion/CompanionDeviceManager.java
@@ -338,21 +338,24 @@
*
* @param packageName the package name of the calling app
* @param deviceMacAddress the bluetooth device's mac address
- * @param userId the calling user's identifier
+ * @param user the user handle that currently hosts the package being queried for a companion
+ * device association
* @return true if it was recently associated and we can bypass the dialog, false otherwise
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.MANAGE_COMPANION_DEVICES)
public boolean canPairWithoutPrompt(@NonNull String packageName,
- @NonNull String deviceMacAddress, int userId) {
+ @NonNull String deviceMacAddress, @NonNull UserHandle user) {
if (!checkFeaturePresent()) {
return false;
}
Objects.requireNonNull(packageName, "package name cannot be null");
Objects.requireNonNull(deviceMacAddress, "device mac address cannot be null");
+ Objects.requireNonNull(user, "user handle cannot be null");
try {
- return mService.canPairWithoutPrompt(packageName, deviceMacAddress, userId);
+ return mService.canPairWithoutPrompt(packageName, deviceMacAddress,
+ user.getIdentifier());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 6a22491..fc676cf 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -46,6 +46,7 @@
import android.compat.annotation.UnsupportedAppUsage;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.ApplicationInfoFlags;
import android.content.res.AssetManager;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
@@ -6230,6 +6231,23 @@
}
/**
+ * Similar to {@link #createPackageContextAsUser(String, int, UserHandle)}, but also allows
+ * specifying the flags used to retrieve the {@link ApplicationInfo} of the package.
+ *
+ * @hide
+ */
+ @NonNull
+ public Context createPackageContextAsUser(
+ @NonNull String packageName, @CreatePackageOptions int flags, @NonNull UserHandle user,
+ @ApplicationInfoFlags int packageFlags)
+ throws PackageManager.NameNotFoundException {
+ if (Build.IS_ENG) {
+ throw new IllegalStateException("createPackageContextAsUser not overridden!");
+ }
+ return this;
+ }
+
+ /**
* Similar to {@link #createPackageContext(String, int)}, but for the own package with a
* different {@link UserHandle}. For example, {@link #getContentResolver()}
* will open any {@link Uri} as the given user.
@@ -6248,10 +6266,18 @@
/**
* Creates a context given an {@link android.content.pm.ApplicationInfo}.
*
+ * @deprecated use {@link #createPackageContextAsUser(String, int, UserHandle, int)}
+ * If an application caches an ApplicationInfo and uses it to call this method,
+ * the app will not get the most recent version of Runtime Resource Overlays for
+ * that application. To make things worse, the LoadedApk stored in
+ * {@code ActivityThread#mResourcePackages} is updated using the old ApplicationInfo
+ * causing further uses of the cached LoadedApk to return outdated information.
+ *
* @hide
*/
@SuppressWarnings("HiddenAbstractMethod")
@UnsupportedAppUsage
+ @Deprecated
public abstract Context createApplicationContext(ApplicationInfo application,
@CreatePackageOptions int flags) throws PackageManager.NameNotFoundException;
diff --git a/core/java/android/content/ContextWrapper.java b/core/java/android/content/ContextWrapper.java
index 6324d0e..cf0dc8c 100644
--- a/core/java/android/content/ContextWrapper.java
+++ b/core/java/android/content/ContextWrapper.java
@@ -1009,6 +1009,14 @@
/** @hide */
@Override
+ public Context createPackageContextAsUser(String packageName, int flags, UserHandle user,
+ int packageFlags)
+ throws PackageManager.NameNotFoundException {
+ return mBase.createPackageContextAsUser(packageName, flags, user, packageFlags);
+ }
+
+ /** @hide */
+ @Override
public Context createContextAsUser(UserHandle user, @CreatePackageOptions int flags) {
return mBase.createContextAsUser(user, flags);
}
diff --git a/core/java/android/content/res/ColorStateList.java b/core/java/android/content/res/ColorStateList.java
index 45b956b..5b727cc 100644
--- a/core/java/android/content/res/ColorStateList.java
+++ b/core/java/android/content/res/ColorStateList.java
@@ -35,6 +35,7 @@
import com.android.internal.R;
import com.android.internal.graphics.ColorUtils;
+import com.android.internal.graphics.cam.Cam;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.GrowingArrayUtils;
@@ -555,9 +556,8 @@
final int alpha = MathUtils.constrain((int) (baseAlpha * alphaMod + 0.5f), 0, 255);
if (validLStar) {
- final double[] labColor = new double[3];
- ColorUtils.colorToLAB(baseColor, labColor);
- baseColor = ColorUtils.LABToColor(lStar, labColor[1], labColor[2]);
+ final Cam baseCam = ColorUtils.colorToCAM(baseColor);
+ baseColor = ColorUtils.CAMToColor(baseCam.getHue(), baseCam.getChroma(), lStar);
}
return (baseColor & 0xFFFFFF) | (alpha << 24);
diff --git a/core/java/android/net/INetworkStatsService.aidl b/core/java/android/net/INetworkStatsService.aidl
index dc3b88a..12937b5 100644
--- a/core/java/android/net/INetworkStatsService.aidl
+++ b/core/java/android/net/INetworkStatsService.aidl
@@ -65,8 +65,8 @@
/** Increment data layer count of operations performed for UID and tag. */
void incrementOperationCount(int uid, int tag, int operationCount);
- /** Force update of ifaces. */
- void forceUpdateIfaces(
+ /** Notify {@code NetworkStatsService} about network status changed. */
+ void notifyNetworkStatus(
in Network[] defaultNetworks,
in NetworkStateSnapshot[] snapshots,
in String activeIface,
diff --git a/core/java/android/net/NetworkTemplate.java b/core/java/android/net/NetworkTemplate.java
index d3c8957..fd446cd 100644
--- a/core/java/android/net/NetworkTemplate.java
+++ b/core/java/android/net/NetworkTemplate.java
@@ -274,11 +274,14 @@
}
/**
- * Template to match all carrier networks with the given IMSI.
+ * Template to match all metered carrier networks with the given IMSI.
*/
- public static NetworkTemplate buildTemplateCarrier(@NonNull String subscriberId) {
+ public static NetworkTemplate buildTemplateCarrierMetered(@NonNull String subscriberId) {
Objects.requireNonNull(subscriberId);
- return new NetworkTemplate(MATCH_CARRIER, subscriberId, null);
+ return new NetworkTemplate(MATCH_CARRIER, subscriberId,
+ new String[] { subscriberId }, null /* networkId */, METERED_YES, ROAMING_ALL,
+ DEFAULT_NETWORK_ALL, NETWORK_TYPE_ALL, OEM_MANAGED_ALL,
+ SUBSCRIBER_ID_MATCH_RULE_EXACT);
}
private final int mMatchRule;
diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java
index 5f5a910..50f390b 100644
--- a/core/java/android/os/Parcel.java
+++ b/core/java/android/os/Parcel.java
@@ -680,13 +680,20 @@
/**
* Store or read an IBinder interface token in the parcel at the current
- * {@link #dataPosition}. This is used to validate that the marshalled
- * transaction is intended for the target interface.
+ * {@link #dataPosition}. This is used to validate that the marshalled
+ * transaction is intended for the target interface. This is typically written
+ * at the beginning of transactions as a header.
*/
public final void writeInterfaceToken(@NonNull String interfaceName) {
nativeWriteInterfaceToken(mNativePtr, interfaceName);
}
+ /**
+ * Read the header written by writeInterfaceToken and verify it matches
+ * the interface name in question. If the wrong interface type is present,
+ * {@link SecurityException} is thrown. When used over binder, this exception
+ * should propagate to the caller.
+ */
public final void enforceInterface(@NonNull String interfaceName) {
nativeEnforceInterface(mNativePtr, interfaceName);
}
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index 326012d..5848d2f 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -189,6 +189,28 @@
public @interface QuietModeFlag {}
/**
+ * Flag returned by {@link #getUserPrivacySensitivity} to indicate that the user isn't
+ * particularly sensitive about a certain aspect of privacy.
+ */
+ public static final int PRIVACY_SENSITIVITY_DEFAULT = 0x0;
+
+ /**
+ * Flag returned by {@link #getUserPrivacySensitivity} to indicate that the user is sensitive
+ * about location privacy.
+ */
+ public static final int PRIVACY_SENSITIVITY_LOCATION = 0x1;
+
+ /**
+ * List of flags available for the {@link #getUserPrivacySensitivity} method.
+ * @hide
+ */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(flag = true, prefix = { "PRIVACY_SENSITIVITY_" }, value = {
+ PRIVACY_SENSITIVITY_DEFAULT,
+ PRIVACY_SENSITIVITY_LOCATION})
+ public @interface PrivacySensitivityFlag {}
+
+ /**
* @hide
* No user restriction.
*/
@@ -1286,6 +1308,40 @@
"disallow_config_private_dns";
/**
+ * Specifies whether the microphone toggle is available to the user. If this restriction is set,
+ * the user will not be able to block microphone access via the system toggle. If microphone
+ * access is blocked when the restriction is added, it will be automatically re-enabled.
+ *
+ * This restriction can only be set by a device owner.
+ *
+ * <p>The default value is <code>false</code>.
+ *
+ * @see android.hardware.SensorPrivacyManager
+ * @see DevicePolicyManager#addUserRestriction(ComponentName, String)
+ * @see DevicePolicyManager#clearUserRestriction(ComponentName, String)
+ * @see #getUserRestrictions()
+ */
+ public static final String DISALLOW_MICROPHONE_TOGGLE =
+ "disallow_microphone_toggle";
+
+ /**
+ * Specifies whether the camera toggle is available to the user. If this restriction is set,
+ * the user will not be able to block camera access via the system toggle. If camera
+ * access is blocked when the restriction is added, it will be automatically re-enabled.
+ *
+ * This restriction can only be set by a device owner.
+ *
+ * <p>The default value is <code>false</code>.
+ *
+ * @see android.hardware.SensorPrivacyManager
+ * @see DevicePolicyManager#addUserRestriction(ComponentName, String)
+ * @see DevicePolicyManager#clearUserRestriction(ComponentName, String)
+ * @see #getUserRestrictions()
+ */
+ public static final String DISALLOW_CAMERA_TOGGLE =
+ "disallow_camera_toggle";
+
+ /**
* Application restriction key that is used to indicate the pending arrival
* of real restrictions for the app.
*
@@ -1376,6 +1432,8 @@
DISALLOW_SHARE_INTO_MANAGED_PROFILE,
DISALLOW_PRINTING,
DISALLOW_CONFIG_PRIVATE_DNS,
+ DISALLOW_MICROPHONE_TOGGLE,
+ DISALLOW_CAMERA_TOGGLE,
KEY_RESTRICTIONS_PENDING,
})
@Retention(RetentionPolicy.SOURCE)
@@ -3902,6 +3960,17 @@
}
/**
+ * Get the privacy sensitivity of the user.
+ *
+ * @return the privacy sensitivity of the user
+ */
+ @PrivacySensitivityFlag
+ public int getUserPrivacySensitivity() {
+ // TODO: Add actual implementation.
+ return PRIVACY_SENSITIVITY_DEFAULT;
+ }
+
+ /**
* Returns whether the given user has a badge (generally to put on profiles' icons).
*
* @param userId userId of the user in question
diff --git a/core/java/android/os/Vibrator.java b/core/java/android/os/Vibrator.java
index 95962c8..12538e6 100644
--- a/core/java/android/os/Vibrator.java
+++ b/core/java/android/os/Vibrator.java
@@ -227,6 +227,17 @@
}
/**
+ * Check whether the vibrator can be controlled by an external service with the
+ * {@link IExternalVibratorService}.
+ *
+ * @return True if the hardware can be controlled by an external service, otherwise false.
+ * @hide
+ */
+ public boolean hasExternalControl() {
+ return getInfo().hasCapability(IVibrator.CAP_EXTERNAL_CONTROL);
+ }
+
+ /**
* Gets the resonant frequency of the vibrator.
*
* @return the resonant frequency of the vibrator, or {@link Float#NaN NaN} if it's unknown or
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index b948ce2..0c23ae6 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -9515,6 +9515,20 @@
"power_menu_locked_show_content";
/**
+ * Whether home controls should be accessible from the lockscreen
+ *
+ * @hide
+ */
+ public static final String LOCKSCREEN_SHOW_CONTROLS = "lockscreen_show_controls";
+
+ /**
+ * Whether wallet should be accessible from the lockscreen
+ *
+ * @hide
+ */
+ public static final String LOCKSCREEN_SHOW_WALLET = "lockscreen_show_wallet";
+
+ /**
* Specifies whether the web action API is enabled.
*
* @hide
diff --git a/core/java/android/service/autofill/FillRequest.java b/core/java/android/service/autofill/FillRequest.java
index af846b6..62becc5 100644
--- a/core/java/android/service/autofill/FillRequest.java
+++ b/core/java/android/service/autofill/FillRequest.java
@@ -96,8 +96,6 @@
*/
public static final @RequestFlags int FLAG_VIEW_NOT_FOCUSED = 0x10;
- // The flag value 0x20 has been defined in AutofillManager.
-
/** @hide */
public static final int INVALID_REQUEST_ID = Integer.MIN_VALUE;
diff --git a/core/java/android/service/notification/StatusBarNotification.java b/core/java/android/service/notification/StatusBarNotification.java
index 8e4a68e..863d71f 100644
--- a/core/java/android/service/notification/StatusBarNotification.java
+++ b/core/java/android/service/notification/StatusBarNotification.java
@@ -434,11 +434,8 @@
public Context getPackageContext(Context context) {
if (mContext == null) {
try {
- ApplicationInfo ai = context.getPackageManager()
- .getApplicationInfoAsUser(pkg, PackageManager.MATCH_UNINSTALLED_PACKAGES,
- getUserId());
- mContext = context.createApplicationContext(ai,
- Context.CONTEXT_RESTRICTED);
+ mContext = context.createPackageContextAsUser(pkg, Context.CONTEXT_RESTRICTED, user,
+ PackageManager.MATCH_UNINSTALLED_PACKAGES);
} catch (PackageManager.NameNotFoundException e) {
mContext = null;
}
diff --git a/core/java/android/service/voice/VoiceInteractionManagerInternal.java b/core/java/android/service/voice/VoiceInteractionManagerInternal.java
index b38067b..f5c9591 100644
--- a/core/java/android/service/voice/VoiceInteractionManagerInternal.java
+++ b/core/java/android/service/voice/VoiceInteractionManagerInternal.java
@@ -41,4 +41,9 @@
public abstract boolean supportsLocalVoiceInteraction();
public abstract void stopLocalVoiceInteraction(IBinder callingActivity);
+
+ /**
+ * Returns whether the given package is currently in an active session
+ */
+ public abstract boolean hasActiveSession(String packageName);
}
\ No newline at end of file
diff --git a/core/java/android/speech/SpeechRecognizer.java b/core/java/android/speech/SpeechRecognizer.java
index b992007..37a97ca 100644
--- a/core/java/android/speech/SpeechRecognizer.java
+++ b/core/java/android/speech/SpeechRecognizer.java
@@ -40,6 +40,8 @@
import android.util.Log;
import android.util.Slog;
+import com.android.internal.R;
+
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -238,7 +240,7 @@
* @param context with which {@code SpeechRecognizer} will be created
* @return {@code true} if recognition is available, {@code false} otherwise
*/
- public static boolean isRecognitionAvailable(final Context context) {
+ public static boolean isRecognitionAvailable(@NonNull final Context context) {
// TODO(b/176578753): make sure this works well with system speech recognizers.
final List<ResolveInfo> list = context.getPackageManager().queryIntentServices(
new Intent(RecognitionService.SERVICE_INTERFACE), 0);
@@ -246,6 +248,38 @@
}
/**
+ * Checks whether an on-device speech recognition service is available on the system. If this
+ * method returns {@code false},
+ * {@link SpeechRecognizer#createOnDeviceSpeechRecognizer(Context)} will
+ * fail.
+ *
+ * @param context with which on-device {@code SpeechRecognizer} will be created
+ * @return {@code true} if on-device recognition is available, {@code false} otherwise
+ */
+ public static boolean isOnDeviceRecognitionAvailable(@NonNull final Context context) {
+ ComponentName componentName =
+ ComponentName.unflattenFromString(
+ context.getString(R.string.config_defaultOnDeviceSpeechRecognitionService));
+ if (componentName == null) {
+ return false;
+ }
+
+ List<ResolveInfo> resolveInfos =
+ context.getPackageManager().queryIntentServices(
+ new Intent(RecognitionService.SERVICE_INTERFACE), 0);
+ if (resolveInfos == null) {
+ return false;
+ }
+
+ for (ResolveInfo ri : resolveInfos) {
+ if (ri.serviceInfo != null && componentName.equals(ri.serviceInfo.getComponentName())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
* Factory method to create a new {@code SpeechRecognizer}. Please note that
* {@link #setRecognitionListener(RecognitionListener)} should be called before dispatching any
* command to the created {@code SpeechRecognizer}, otherwise no notifications will be
@@ -315,6 +349,8 @@
* notifications will be received.
*
* @param context in which to create {@code SpeechRecognizer}
+ * @throws UnsupportedOperationException iff {@link #isOnDeviceRecognitionAvailable(Context)}
+ * is false
* @return a new on-device {@code SpeechRecognizer}.
*/
@NonNull
@@ -324,6 +360,9 @@
throw new IllegalArgumentException("Context cannot be null");
}
checkIsCalledFromMainThread();
+ if (!isOnDeviceRecognitionAvailable(context)) {
+ throw new UnsupportedOperationException("On-device recognition is not available");
+ }
return new SpeechRecognizer(context, /* onDevice */ true);
}
diff --git a/core/java/android/view/InsetsAnimationControlImpl.java b/core/java/android/view/InsetsAnimationControlImpl.java
index a67ec10..3255dd6 100644
--- a/core/java/android/view/InsetsAnimationControlImpl.java
+++ b/core/java/android/view/InsetsAnimationControlImpl.java
@@ -86,6 +86,7 @@
private final InsetsState mInitialInsetsState;
private final @AnimationType int mAnimationType;
private final @InsetsType int mTypes;
+ private @InsetsType int mControllingTypes;
private final InsetsAnimationControlCallbacks mController;
private final WindowInsetsAnimation mAnimation;
/** @see WindowInsetsAnimationController#hasZeroInsetsIme */
@@ -112,6 +113,7 @@
mControls = controls;
mListener = listener;
mTypes = types;
+ mControllingTypes = types;
mController = controller;
mInitialInsetsState = new InsetsState(state, true /* copySources */);
if (frame != null) {
@@ -187,6 +189,16 @@
}
@Override
+ public int getControllingTypes() {
+ return mControllingTypes;
+ }
+
+ @Override
+ public void notifyControlRevoked(@InsetsType int types) {
+ mControllingTypes &= ~types;
+ }
+
+ @Override
public @AnimationType int getAnimationType() {
return mAnimationType;
}
diff --git a/core/java/android/view/InsetsAnimationControlRunner.java b/core/java/android/view/InsetsAnimationControlRunner.java
index 0275b52..7787af5 100644
--- a/core/java/android/view/InsetsAnimationControlRunner.java
+++ b/core/java/android/view/InsetsAnimationControlRunner.java
@@ -29,11 +29,22 @@
public interface InsetsAnimationControlRunner {
/**
- * @return The {@link InsetsType} the animation of this runner is controlling.
+ * @return The {@link InsetsType} the animation of this runner controls.
*/
@InsetsType int getTypes();
/**
+ * @return The {@link InsetsType} the animation of this runner is controlling. This can be
+ * changed if a control is revoked.
+ */
+ @InsetsType int getControllingTypes();
+
+ /**
+ * Notifies {@link InsetsType types} of control are getting revoked.
+ */
+ void notifyControlRevoked(@InsetsType int types);
+
+ /**
* Cancels the animation.
*/
void cancel();
diff --git a/core/java/android/view/InsetsAnimationThreadControlRunner.java b/core/java/android/view/InsetsAnimationThreadControlRunner.java
index 6122c90..436a17c 100644
--- a/core/java/android/view/InsetsAnimationThreadControlRunner.java
+++ b/core/java/android/view/InsetsAnimationThreadControlRunner.java
@@ -141,6 +141,17 @@
@Override
@UiThread
+ public int getControllingTypes() {
+ return mControl.getControllingTypes();
+ }
+
+ @Override
+ public void notifyControlRevoked(@InsetsType int types) {
+ mControl.notifyControlRevoked(types);
+ }
+
+ @Override
+ @UiThread
public void cancel() {
InsetsAnimationThread.getHandler().post(mControl::cancel);
}
diff --git a/core/java/android/view/InsetsController.java b/core/java/android/view/InsetsController.java
index def9ca4..de7cc18 100644
--- a/core/java/android/view/InsetsController.java
+++ b/core/java/android/view/InsetsController.java
@@ -1224,9 +1224,11 @@
}
void notifyControlRevoked(InsetsSourceConsumer consumer) {
+ final @InsetsType int types = toPublicType(consumer.getType());
for (int i = mRunningAnimations.size() - 1; i >= 0; i--) {
InsetsAnimationControlRunner control = mRunningAnimations.get(i).runner;
- if ((control.getTypes() & toPublicType(consumer.getType())) != 0) {
+ control.notifyControlRevoked(types);
+ if (control.getControllingTypes() == 0) {
cancelAnimation(control, true /* invokeCallback */);
}
}
diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java
index a169cb0..4df8fd2 100644
--- a/core/java/android/view/autofill/AutofillManager.java
+++ b/core/java/android/view/autofill/AutofillManager.java
@@ -25,7 +25,6 @@
import static android.view.autofill.Helper.toList;
import android.accessibilityservice.AccessibilityServiceInfo;
-import android.annotation.CallbackExecutor;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -46,21 +45,16 @@
import android.content.pm.ResolveInfo;
import android.graphics.Rect;
import android.metrics.LogMaker;
-import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
-import android.os.CancellationSignal;
import android.os.Handler;
import android.os.IBinder;
-import android.os.ICancellationSignal;
import android.os.Looper;
import android.os.Parcelable;
import android.os.RemoteException;
import android.os.SystemClock;
import android.service.autofill.AutofillService;
-import android.service.autofill.FillCallback;
import android.service.autofill.FillEventHistory;
-import android.service.autofill.IFillCallback;
import android.service.autofill.UserData;
import android.text.TextUtils;
import android.util.ArrayMap;
@@ -80,7 +74,6 @@
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.accessibility.AccessibilityNodeProvider;
import android.view.accessibility.AccessibilityWindowInfo;
-import android.view.inputmethod.InlineSuggestionsRequest;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;
@@ -106,7 +99,6 @@
import java.util.List;
import java.util.Objects;
import java.util.Set;
-import java.util.concurrent.Executor;
import sun.misc.Cleaner;
@@ -175,12 +167,6 @@
* shows an autofill save UI if the value of savable views have changed. If the user selects the
* option to Save, the current value of the views is then sent to the autofill service.
*
- * <p>There is another choice for the application to provide it's datasets to the Autofill framework
- * by setting an {@link AutofillRequestCallback} through
- * {@link #setAutofillRequestCallback(Executor, AutofillRequestCallback)}. The application can use
- * its callback instead of the default {@link AutofillService}. See
- * {@link AutofillRequestCallback} for more details.
- *
* <h3 id="additional-notes">Additional notes</h3>
*
* <p>It is safe to call <code>AutofillManager</code> methods from any thread.
@@ -306,7 +292,6 @@
/** @hide */ public static final int FLAG_ADD_CLIENT_DEBUG = 0x2;
/** @hide */ public static final int FLAG_ADD_CLIENT_VERBOSE = 0x4;
/** @hide */ public static final int FLAG_ADD_CLIENT_ENABLED_FOR_AUGMENTED_AUTOFILL_ONLY = 0x8;
- /** @hide */ public static final int FLAG_ENABLED_CLIENT_SUGGESTIONS = 0x20;
// NOTE: flag below is used by the session start receiver only, hence it can have values above
/** @hide */ public static final int RECEIVER_FLAG_SESSION_FOR_AUGMENTED_AUTOFILL_ONLY = 0x1;
@@ -607,11 +592,6 @@
@GuardedBy("mLock")
private boolean mEnabledForAugmentedAutofillOnly;
- @GuardedBy("mLock")
- @Nullable private AutofillRequestCallback mAutofillRequestCallback;
- @GuardedBy("mLock")
- @Nullable private Executor mRequestCallbackExecutor;
-
/** @hide */
public interface AutofillClient {
/**
@@ -1856,32 +1836,6 @@
return new AutofillId(parent.getAutofillViewId(), virtualId);
}
- /**
- * Sets the client's suggestions callback for autofill.
- *
- * @see AutofillRequestCallback
- *
- * @param executor specifies the thread upon which the callbacks will be invoked.
- * @param callback which handles autofill request to provide client's suggestions.
- */
- public void setAutofillRequestCallback(@NonNull @CallbackExecutor Executor executor,
- @NonNull AutofillRequestCallback callback) {
- synchronized (mLock) {
- mRequestCallbackExecutor = executor;
- mAutofillRequestCallback = callback;
- }
- }
-
- /**
- * clears the client's suggestions callback for autofill.
- */
- public void clearAutofillRequestCallback() {
- synchronized (mLock) {
- mRequestCallbackExecutor = null;
- mAutofillRequestCallback = null;
- }
- }
-
@GuardedBy("mLock")
private void startSessionLocked(@NonNull AutofillId id, @NonNull Rect bounds,
@NonNull AutofillValue value, int flags) {
@@ -1942,13 +1896,6 @@
}
}
- if (mAutofillRequestCallback != null) {
- if (sDebug) {
- Log.d(TAG, "startSession with the client suggestions provider");
- }
- flags |= FLAG_ENABLED_CLIENT_SUGGESTIONS;
- }
-
mService.startSession(client.autofillClientGetActivityToken(),
mServiceClient.asBinder(), id, bounds, value, mContext.getUserId(),
mCallback != null, flags, clientActivity,
@@ -2298,28 +2245,6 @@
}
}
- private void onFillRequest(InlineSuggestionsRequest request,
- CancellationSignal cancellationSignal, FillCallback callback) {
- final AutofillRequestCallback autofillRequestCallback;
- final Executor executor;
- synchronized (mLock) {
- autofillRequestCallback = mAutofillRequestCallback;
- executor = mRequestCallbackExecutor;
- }
- if (autofillRequestCallback != null && executor != null) {
- final long ident = Binder.clearCallingIdentity();
- try {
- executor.execute(() ->
- autofillRequestCallback.onFillRequest(
- request, cancellationSignal, callback));
- } finally {
- Binder.restoreCallingIdentity(ident);
- }
- } else {
- callback.onSuccess(null);
- }
- }
-
/** @hide */
public static final int SET_STATE_FLAG_ENABLED = 0x01;
/** @hide */
@@ -3699,23 +3624,6 @@
afm.post(() -> afm.requestShowSoftInput(id));
}
}
-
- @Override
- public void requestFillFromClient(int id, InlineSuggestionsRequest request,
- IFillCallback callback) {
- final AutofillManager afm = mAfm.get();
- if (afm != null) {
- ICancellationSignal transport = CancellationSignal.createTransport();
- try {
- callback.onCancellable(transport);
- } catch (RemoteException e) {
- Slog.w(TAG, "Error requesting a cancellation", e);
- }
-
- afm.onFillRequest(request, CancellationSignal.fromTransport(transport),
- new FillCallback(callback, id));
- }
- }
}
private static final class AugmentedAutofillManagerClient
diff --git a/core/java/android/view/autofill/AutofillRequestCallback.java b/core/java/android/view/autofill/AutofillRequestCallback.java
deleted file mode 100644
index e632a58..0000000
--- a/core/java/android/view/autofill/AutofillRequestCallback.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.view.autofill;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.os.CancellationSignal;
-import android.service.autofill.FillCallback;
-import android.view.inputmethod.InlineSuggestionsRequest;
-
-/**
- * <p>This class is used to provide some input suggestions to the Autofill framework.
- *
- * <P>When the user is requested to input something, Autofill will try to query input suggestions
- * for the user choosing. If the application want to provide some internal input suggestions,
- * implements this callback and register via
- * {@link AutofillManager#setAutofillRequestCallback(java.util.concurrent.Executor,
- * AutofillRequestCallback)}. Autofill will callback the
- * {@link #onFillRequest(InlineSuggestionsRequest, CancellationSignal, FillCallback)} to request
- * input suggestions.
- *
- * <P>To make sure the callback to take effect, must register before the autofill session starts.
- * If the autofill session is started, calls {@link AutofillManager#cancel()} to finish current
- * session, and then the callback will be used at the next restarted session.
- *
- * <P>To create a {@link android.service.autofill.FillResponse}, application should fetch
- * {@link AutofillId}s from its view structure. Below is an example:
- * <pre class="prettyprint">
- * AutofillId usernameId = findViewById(R.id.username).getAutofillId();
- * AutofillId passwordId = findViewById(R.id.password).getAutofillId();
- * </pre>
- * To learn more about creating a {@link android.service.autofill.FillResponse}, read
- * <a href="/guide/topics/text/autofill-services#fill">Fill out client views</a>.
- *
- * <P>To fallback to the default {@link android.service.autofill.AutofillService}, just respond
- * a null of the {@link android.service.autofill.FillResponse}. And then Autofill will do a fill
- * request with the default {@link android.service.autofill.AutofillService}. Or clear the callback
- * from {@link AutofillManager} via {@link AutofillManager#clearAutofillRequestCallback()}. If the
- * client would like to keep no suggestions for the field, respond with an empty
- * {@link android.service.autofill.FillResponse} which has no dataset.
- *
- * <P>IMPORTANT: This should not be used for displaying anything other than input suggestions, or
- * the keyboard may choose to block your app from the inline strip.
- */
-public interface AutofillRequestCallback {
- /**
- * Called by the Android system to decide if a screen can be autofilled by the callback.
- *
- * @param inlineSuggestionsRequest the {@link InlineSuggestionsRequest request} to handle if
- * currently inline suggestions are supported and can be displayed.
- * @param cancellationSignal signal for observing cancellation requests. The system will use
- * this to notify you that the fill result is no longer needed and you should stop
- * handling this fill request in order to save resources.
- * @param callback object used to notify the result of the request.
- */
- void onFillRequest(@Nullable InlineSuggestionsRequest inlineSuggestionsRequest,
- @NonNull CancellationSignal cancellationSignal, @NonNull FillCallback callback);
-}
diff --git a/core/java/android/view/autofill/IAutoFillManagerClient.aidl b/core/java/android/view/autofill/IAutoFillManagerClient.aidl
index 64507aa..1f833f6 100644
--- a/core/java/android/view/autofill/IAutoFillManagerClient.aidl
+++ b/core/java/android/view/autofill/IAutoFillManagerClient.aidl
@@ -24,11 +24,9 @@
import android.content.IntentSender;
import android.graphics.Rect;
import android.os.IBinder;
-import android.service.autofill.IFillCallback;
import android.view.autofill.AutofillId;
import android.view.autofill.AutofillValue;
import android.view.autofill.IAutofillWindowPresenter;
-import android.view.inputmethod.InlineSuggestionsRequest;
import android.view.KeyEvent;
import com.android.internal.os.IResultReceiver;
@@ -142,10 +140,4 @@
* Requests to show the soft input method if the focus is on the given id.
*/
void requestShowSoftInput(in AutofillId id);
-
- /**
- * Requests to determine if a screen can be autofilled by the client app.
- */
- void requestFillFromClient(int id, in InlineSuggestionsRequest request,
- in IFillCallback callback);
}
diff --git a/core/java/android/view/inputmethod/InlineSuggestionsRequest.java b/core/java/android/view/inputmethod/InlineSuggestionsRequest.java
index e1e1755..1eb1a93 100644
--- a/core/java/android/view/inputmethod/InlineSuggestionsRequest.java
+++ b/core/java/android/view/inputmethod/InlineSuggestionsRequest.java
@@ -111,22 +111,6 @@
private @Nullable InlinePresentationSpec mInlineTooltipPresentationSpec;
/**
- * Whether the IME supports inline suggestions from the default Autofill service that
- * provides the input view.
- *
- * Note: The default value is {@code true}.
- */
- private boolean mServiceSupported;
-
- /**
- * Whether the IME supports inline suggestions from the application that provides the
- * input view.
- *
- * Note: The default value is {@code true}.
- */
- private boolean mClientSupported;
-
- /**
* @hide
* @see {@link #mHostInputToken}.
*/
@@ -220,14 +204,6 @@
return Bundle.EMPTY;
}
- private static boolean defaultServiceSupported() {
- return true;
- }
-
- private static boolean defaultClientSupported() {
- return true;
- }
-
/** @hide */
abstract static class BaseBuilder {
abstract Builder setInlinePresentationSpecs(
@@ -240,25 +216,15 @@
abstract Builder setHostDisplayId(int value);
}
- /** @hide */
- public boolean isServiceSupported() {
- return mServiceSupported;
- }
-
- /** @hide */
- public boolean isClientSupported() {
- return mClientSupported;
- }
-
- // Code below generated by codegen v1.0.22.
+ // 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/view/inputmethod/InlineSuggestionsRequest.java
+ // $ codegen $ANDROID_BUILD_TOP/./frameworks/base/core/java/android/view/inputmethod/InlineSuggestionsRequest.java
//
// To exclude the generated code from IntelliJ auto-formatting enable (one-time):
// Settings > Editor > Code Style > Formatter Control
@@ -274,9 +240,7 @@
@NonNull Bundle extras,
@Nullable IBinder hostInputToken,
int hostDisplayId,
- @Nullable InlinePresentationSpec inlineTooltipPresentationSpec,
- boolean serviceSupported,
- boolean clientSupported) {
+ @Nullable InlinePresentationSpec inlineTooltipPresentationSpec) {
this.mMaxSuggestionCount = maxSuggestionCount;
this.mInlinePresentationSpecs = inlinePresentationSpecs;
com.android.internal.util.AnnotationValidations.validate(
@@ -293,8 +257,6 @@
this.mHostInputToken = hostInputToken;
this.mHostDisplayId = hostDisplayId;
this.mInlineTooltipPresentationSpec = inlineTooltipPresentationSpec;
- this.mServiceSupported = serviceSupported;
- this.mClientSupported = clientSupported;
onConstructed();
}
@@ -378,9 +340,7 @@
}
/**
- * The {@link InlinePresentationSpec} for the inline suggestion tooltip in the response.
- *
- * @see android.service.autofill.InlinePresentation#createTooltipPresentation(Slice, InlinePresentationSpec)
+ * Specifies the UI specification for the inline suggestion tooltip in the response.
*/
@DataClass.Generated.Member
public @Nullable InlinePresentationSpec getInlineTooltipPresentationSpec() {
@@ -401,9 +361,7 @@
"extras = " + mExtras + ", " +
"hostInputToken = " + mHostInputToken + ", " +
"hostDisplayId = " + mHostDisplayId + ", " +
- "inlineTooltipPresentationSpec = " + mInlineTooltipPresentationSpec + ", " +
- "serviceSupported = " + mServiceSupported + ", " +
- "clientSupported = " + mClientSupported +
+ "inlineTooltipPresentationSpec = " + mInlineTooltipPresentationSpec +
" }";
}
@@ -427,9 +385,7 @@
&& extrasEquals(that.mExtras)
&& java.util.Objects.equals(mHostInputToken, that.mHostInputToken)
&& mHostDisplayId == that.mHostDisplayId
- && java.util.Objects.equals(mInlineTooltipPresentationSpec, that.mInlineTooltipPresentationSpec)
- && mServiceSupported == that.mServiceSupported
- && mClientSupported == that.mClientSupported;
+ && java.util.Objects.equals(mInlineTooltipPresentationSpec, that.mInlineTooltipPresentationSpec);
}
@Override
@@ -447,8 +403,6 @@
_hash = 31 * _hash + java.util.Objects.hashCode(mHostInputToken);
_hash = 31 * _hash + mHostDisplayId;
_hash = 31 * _hash + java.util.Objects.hashCode(mInlineTooltipPresentationSpec);
- _hash = 31 * _hash + Boolean.hashCode(mServiceSupported);
- _hash = 31 * _hash + Boolean.hashCode(mClientSupported);
return _hash;
}
@@ -459,8 +413,6 @@
// void parcelFieldName(Parcel dest, int flags) { ... }
int flg = 0;
- if (mServiceSupported) flg |= 0x100;
- if (mClientSupported) flg |= 0x200;
if (mHostInputToken != null) flg |= 0x20;
if (mInlineTooltipPresentationSpec != null) flg |= 0x80;
dest.writeInt(flg);
@@ -486,8 +438,6 @@
// static FieldType unparcelFieldName(Parcel in) { ... }
int flg = in.readInt();
- boolean serviceSupported = (flg & 0x100) != 0;
- boolean clientSupported = (flg & 0x200) != 0;
int maxSuggestionCount = in.readInt();
List<InlinePresentationSpec> inlinePresentationSpecs = new ArrayList<>();
in.readParcelableList(inlinePresentationSpecs, InlinePresentationSpec.class.getClassLoader());
@@ -514,8 +464,6 @@
this.mHostInputToken = hostInputToken;
this.mHostDisplayId = hostDisplayId;
this.mInlineTooltipPresentationSpec = inlineTooltipPresentationSpec;
- this.mServiceSupported = serviceSupported;
- this.mClientSupported = clientSupported;
onConstructed();
}
@@ -549,8 +497,6 @@
private @Nullable IBinder mHostInputToken;
private int mHostDisplayId;
private @Nullable InlinePresentationSpec mInlineTooltipPresentationSpec;
- private boolean mServiceSupported;
- private boolean mClientSupported;
private long mBuilderFieldsSet = 0L;
@@ -683,9 +629,7 @@
}
/**
- * The {@link InlinePresentationSpec} for the inline suggestion tooltip in the response.
- *
- * @see android.service.autofill.InlinePresentation#createTooltipPresentation(Slice, InlinePresentationSpec)s
+ * Specifies the UI specification for the inline suggestion tooltip in the response.
*/
@DataClass.Generated.Member
public @NonNull Builder setInlineTooltipPresentationSpec(@NonNull InlinePresentationSpec value) {
@@ -695,38 +639,10 @@
return this;
}
- /**
- * Whether the IME supports inline suggestions from the default Autofill service that
- * provides the input view.
- *
- * Note: The default value is {@code true}.
- */
- @DataClass.Generated.Member
- public @NonNull Builder setServiceSupported(boolean value) {
- checkNotUsed();
- mBuilderFieldsSet |= 0x100;
- mServiceSupported = value;
- return this;
- }
-
- /**
- * Whether the IME supports inline suggestions from the application that provides the
- * input view.
- *
- * Note: The default value is {@code true}.
- */
- @DataClass.Generated.Member
- public @NonNull Builder setClientSupported(boolean value) {
- checkNotUsed();
- mBuilderFieldsSet |= 0x200;
- mClientSupported = value;
- return this;
- }
-
/** Builds the instance. This builder should not be touched after calling this! */
public @NonNull InlineSuggestionsRequest build() {
checkNotUsed();
- mBuilderFieldsSet |= 0x400; // Mark builder used
+ mBuilderFieldsSet |= 0x100; // Mark builder used
if ((mBuilderFieldsSet & 0x1) == 0) {
mMaxSuggestionCount = defaultMaxSuggestionCount();
@@ -749,12 +665,6 @@
if ((mBuilderFieldsSet & 0x80) == 0) {
mInlineTooltipPresentationSpec = defaultInlineTooltipPresentationSpec();
}
- if ((mBuilderFieldsSet & 0x100) == 0) {
- mServiceSupported = defaultServiceSupported();
- }
- if ((mBuilderFieldsSet & 0x200) == 0) {
- mClientSupported = defaultClientSupported();
- }
InlineSuggestionsRequest o = new InlineSuggestionsRequest(
mMaxSuggestionCount,
mInlinePresentationSpecs,
@@ -763,14 +673,12 @@
mExtras,
mHostInputToken,
mHostDisplayId,
- mInlineTooltipPresentationSpec,
- mServiceSupported,
- mClientSupported);
+ mInlineTooltipPresentationSpec);
return o;
}
private void checkNotUsed() {
- if ((mBuilderFieldsSet & 0x400) != 0) {
+ if ((mBuilderFieldsSet & 0x100) != 0) {
throw new IllegalStateException(
"This Builder should not be reused. Use a new Builder instance instead");
}
@@ -778,10 +686,10 @@
}
@DataClass.Generated(
- time = 1615798784918L,
- codegenVersion = "1.0.22",
+ time = 1621415989607L,
+ codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/view/inputmethod/InlineSuggestionsRequest.java",
- inputSignatures = "public static final int SUGGESTION_COUNT_UNLIMITED\nprivate final int mMaxSuggestionCount\nprivate final @android.annotation.NonNull java.util.List<android.widget.inline.InlinePresentationSpec> mInlinePresentationSpecs\nprivate @android.annotation.NonNull java.lang.String mHostPackageName\nprivate @android.annotation.NonNull android.os.LocaleList mSupportedLocales\nprivate @android.annotation.NonNull android.os.Bundle mExtras\nprivate @android.annotation.Nullable android.os.IBinder mHostInputToken\nprivate int mHostDisplayId\nprivate @android.annotation.Nullable android.widget.inline.InlinePresentationSpec mInlineTooltipPresentationSpec\nprivate boolean mServiceSupported\nprivate boolean mClientSupported\nprivate static final @android.compat.annotation.ChangeId @android.compat.annotation.EnabledSince long IME_AUTOFILL_DEFAULT_SUPPORTED_LOCALES_IS_EMPTY\npublic void setHostInputToken(android.os.IBinder)\nprivate boolean extrasEquals(android.os.Bundle)\nprivate void parcelHostInputToken(android.os.Parcel,int)\nprivate @android.annotation.Nullable android.os.IBinder unparcelHostInputToken(android.os.Parcel)\npublic void setHostDisplayId(int)\nprivate void onConstructed()\npublic void filterContentTypes()\nprivate static int defaultMaxSuggestionCount()\nprivate static java.lang.String defaultHostPackageName()\nprivate static android.widget.inline.InlinePresentationSpec defaultInlineTooltipPresentationSpec()\nprivate static android.os.LocaleList defaultSupportedLocales()\nprivate static @android.annotation.Nullable android.os.IBinder defaultHostInputToken()\nprivate static @android.annotation.Nullable int defaultHostDisplayId()\nprivate static @android.annotation.NonNull android.os.Bundle defaultExtras()\nprivate static boolean defaultServiceSupported()\nprivate static boolean defaultClientSupported()\npublic boolean isServiceSupported()\npublic boolean isClientSupported()\nclass InlineSuggestionsRequest extends java.lang.Object implements [android.os.Parcelable]\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setInlinePresentationSpecs(java.util.List<android.widget.inline.InlinePresentationSpec>)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostPackageName(java.lang.String)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostInputToken(android.os.IBinder)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostDisplayId(int)\nclass BaseBuilder extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genToString=true, genBuilder=true)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setInlinePresentationSpecs(java.util.List<android.widget.inline.InlinePresentationSpec>)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostPackageName(java.lang.String)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostInputToken(android.os.IBinder)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostDisplayId(int)\nclass BaseBuilder extends java.lang.Object implements []")
+ inputSignatures = "public static final int SUGGESTION_COUNT_UNLIMITED\nprivate final int mMaxSuggestionCount\nprivate final @android.annotation.NonNull java.util.List<android.widget.inline.InlinePresentationSpec> mInlinePresentationSpecs\nprivate @android.annotation.NonNull java.lang.String mHostPackageName\nprivate @android.annotation.NonNull android.os.LocaleList mSupportedLocales\nprivate @android.annotation.NonNull android.os.Bundle mExtras\nprivate @android.annotation.Nullable android.os.IBinder mHostInputToken\nprivate int mHostDisplayId\nprivate @android.annotation.Nullable android.widget.inline.InlinePresentationSpec mInlineTooltipPresentationSpec\nprivate static final @android.compat.annotation.ChangeId @android.compat.annotation.EnabledSince long IME_AUTOFILL_DEFAULT_SUPPORTED_LOCALES_IS_EMPTY\npublic void setHostInputToken(android.os.IBinder)\nprivate boolean extrasEquals(android.os.Bundle)\nprivate void parcelHostInputToken(android.os.Parcel,int)\nprivate @android.annotation.Nullable android.os.IBinder unparcelHostInputToken(android.os.Parcel)\npublic void setHostDisplayId(int)\nprivate void onConstructed()\npublic void filterContentTypes()\nprivate static int defaultMaxSuggestionCount()\nprivate static java.lang.String defaultHostPackageName()\nprivate static android.widget.inline.InlinePresentationSpec defaultInlineTooltipPresentationSpec()\nprivate static android.os.LocaleList defaultSupportedLocales()\nprivate static @android.annotation.Nullable android.os.IBinder defaultHostInputToken()\nprivate static @android.annotation.Nullable int defaultHostDisplayId()\nprivate static @android.annotation.NonNull android.os.Bundle defaultExtras()\nclass InlineSuggestionsRequest extends java.lang.Object implements [android.os.Parcelable]\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setInlinePresentationSpecs(java.util.List<android.widget.inline.InlinePresentationSpec>)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostPackageName(java.lang.String)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostInputToken(android.os.IBinder)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostDisplayId(int)\nclass BaseBuilder extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genToString=true, genBuilder=true)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setInlinePresentationSpecs(java.util.List<android.widget.inline.InlinePresentationSpec>)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostPackageName(java.lang.String)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostInputToken(android.os.IBinder)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostDisplayId(int)\nclass BaseBuilder extends java.lang.Object implements []")
@Deprecated
private void __metadata() {}
diff --git a/core/java/android/view/translation/TranslationContext.java b/core/java/android/view/translation/TranslationContext.java
index 1d3d182..2a5dedd 100644
--- a/core/java/android/view/translation/TranslationContext.java
+++ b/core/java/android/view/translation/TranslationContext.java
@@ -37,9 +37,9 @@
*/
public static final @TranslationFlag int FLAG_TRANSLITERATION = 0x2;
/**
- * This context will enable the {@link Translator} to return dictionary results.
+ * This context will enable the {@link Translator} to return dictionary definitions.
*/
- public static final @TranslationFlag int FLAG_DICTIONARY_DESCRIPTION = 0x4;
+ public static final @TranslationFlag int FLAG_DEFINITIONS = 0x4;
/**
* {@link TranslationSpec} describing the source data to be translated.
@@ -69,7 +69,7 @@
- // Code below generated by codegen v1.0.22.
+ // Code below generated by codegen v1.0.23.
//
// DO NOT MODIFY!
// CHECKSTYLE:OFF Generated code
@@ -86,7 +86,7 @@
@android.annotation.IntDef(flag = true, prefix = "FLAG_", value = {
FLAG_LOW_LATENCY,
FLAG_TRANSLITERATION,
- FLAG_DICTIONARY_DESCRIPTION
+ FLAG_DEFINITIONS
})
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE)
@DataClass.Generated.Member
@@ -106,8 +106,8 @@
return "FLAG_LOW_LATENCY";
case FLAG_TRANSLITERATION:
return "FLAG_TRANSLITERATION";
- case FLAG_DICTIONARY_DESCRIPTION:
- return "FLAG_DICTIONARY_DESCRIPTION";
+ case FLAG_DEFINITIONS:
+ return "FLAG_DEFINITIONS";
default: return Integer.toHexString(value);
}
}
@@ -129,7 +129,7 @@
mTranslationFlags,
FLAG_LOW_LATENCY
| FLAG_TRANSLITERATION
- | FLAG_DICTIONARY_DESCRIPTION);
+ | FLAG_DEFINITIONS);
// onConstructed(); // You can define this method to get a callback
}
@@ -209,7 +209,7 @@
mTranslationFlags,
FLAG_LOW_LATENCY
| FLAG_TRANSLITERATION
- | FLAG_DICTIONARY_DESCRIPTION);
+ | FLAG_DEFINITIONS);
// onConstructed(); // You can define this method to get a callback
}
@@ -295,10 +295,10 @@
}
@DataClass.Generated(
- time = 1616199021789L,
- codegenVersion = "1.0.22",
+ time = 1621034221152L,
+ codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/view/translation/TranslationContext.java",
- inputSignatures = "public static final @android.view.translation.TranslationContext.TranslationFlag int FLAG_LOW_LATENCY\npublic static final @android.view.translation.TranslationContext.TranslationFlag int FLAG_TRANSLITERATION\npublic static final @android.view.translation.TranslationContext.TranslationFlag int FLAG_DICTIONARY_DESCRIPTION\nprivate final @android.annotation.NonNull android.view.translation.TranslationSpec mSourceSpec\nprivate final @android.annotation.NonNull android.view.translation.TranslationSpec mTargetSpec\nprivate final @android.view.translation.TranslationContext.TranslationFlag int mTranslationFlags\nprivate static int defaultTranslationFlags()\nclass TranslationContext extends java.lang.Object implements [android.os.Parcelable]\nclass BaseBuilder extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genHiddenConstDefs=true, genToString=true, genBuilder=true)\nclass BaseBuilder extends java.lang.Object implements []")
+ inputSignatures = "public static final @android.view.translation.TranslationContext.TranslationFlag int FLAG_LOW_LATENCY\npublic static final @android.view.translation.TranslationContext.TranslationFlag int FLAG_TRANSLITERATION\npublic static final @android.view.translation.TranslationContext.TranslationFlag int FLAG_DEFINITIONS\nprivate final @android.annotation.NonNull android.view.translation.TranslationSpec mSourceSpec\nprivate final @android.annotation.NonNull android.view.translation.TranslationSpec mTargetSpec\nprivate final @android.view.translation.TranslationContext.TranslationFlag int mTranslationFlags\nprivate static int defaultTranslationFlags()\nclass TranslationContext extends java.lang.Object implements [android.os.Parcelable]\nclass BaseBuilder extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genHiddenConstDefs=true, genToString=true, genBuilder=true)\nclass BaseBuilder extends java.lang.Object implements []")
@Deprecated
private void __metadata() {}
diff --git a/core/java/android/view/translation/TranslationResponseValue.java b/core/java/android/view/translation/TranslationResponseValue.java
index e8e9868..a68ae56 100644
--- a/core/java/android/view/translation/TranslationResponseValue.java
+++ b/core/java/android/view/translation/TranslationResponseValue.java
@@ -18,6 +18,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
@@ -42,6 +43,17 @@
public static final int STATUS_ERROR = 1;
/**
+ * Name in the result of {@link #getExtras()} to pass dictionary definitions of the text
+ * categorized by parts of speech.
+ *
+ * <p>The dictionary definitions consists of groups of terms keyed by their corresponding parts
+ * of speech. This map-like structure is stored in a {@link Bundle}. The individual parts of
+ * speech can be traversed by {@link Bundle#keySet()} and used to get the corresponding list
+ * of terms as {@link CharSequence}s.</p>
+ */
+ public static final String EXTRA_DEFINITIONS = "android.view.translation.extra.DEFINITIONS";
+
+ /**
* The status code of this {@link TranslationResponseValue}.
*
* <p>If the status code is {@link #STATUS_ERROR}, no values are attached, and all getters will
@@ -56,11 +68,12 @@
private final CharSequence mText;
/**
- * The dictionary description of the translated text.
- * TODO: Describe the result structure.
+ * Extra results associated with the translated text.
+ *
+ * <p>The bundle includes {@link #EXTRA_DEFINITIONS}, obtained by {@link Bundle#getBundle}.</p>
*/
- @Nullable
- private final CharSequence mDictionaryDescription;
+ @NonNull
+ private final Bundle mExtras;
/**
* The transliteration result of the translated text.
@@ -74,15 +87,15 @@
*/
@NonNull
public static TranslationResponseValue forError() {
- return new TranslationResponseValue(STATUS_ERROR, null, null, null);
+ return new TranslationResponseValue(STATUS_ERROR, null, Bundle.EMPTY, null);
}
private static CharSequence defaultText() {
return null;
}
- private static CharSequence defaultDictionaryDescription() {
- return null;
+ private static Bundle defaultExtras() {
+ return Bundle.EMPTY;
}
private static CharSequence defaultTransliteration() {
@@ -96,7 +109,7 @@
- // Code below generated by codegen v1.0.22.
+ // Code below generated by codegen v1.0.23.
//
// DO NOT MODIFY!
// CHECKSTYLE:OFF Generated code
@@ -134,7 +147,7 @@
/* package-private */ TranslationResponseValue(
@Status int statusCode,
@Nullable CharSequence text,
- @Nullable CharSequence dictionaryDescription,
+ @NonNull Bundle extras,
@Nullable CharSequence transliteration) {
this.mStatusCode = statusCode;
@@ -147,7 +160,9 @@
}
this.mText = text;
- this.mDictionaryDescription = dictionaryDescription;
+ this.mExtras = extras;
+ com.android.internal.util.AnnotationValidations.validate(
+ NonNull.class, null, mExtras);
this.mTransliteration = transliteration;
// onConstructed(); // You can define this method to get a callback
@@ -173,12 +188,13 @@
}
/**
- * The dictionary description of the translated text.
- * TODO: Describe the result structure.
+ * Extra results associated with the translated text.
+ *
+ * <p>The bundle includes {@link #EXTRA_DEFINITIONS}, obtained by {@link Bundle#getBundle}.</p>
*/
@DataClass.Generated.Member
- public @Nullable CharSequence getDictionaryDescription() {
- return mDictionaryDescription;
+ public @NonNull Bundle getExtras() {
+ return mExtras;
}
/**
@@ -199,7 +215,7 @@
return "TranslationResponseValue { " +
"statusCode = " + statusToString(mStatusCode) + ", " +
"text = " + mText + ", " +
- "dictionaryDescription = " + mDictionaryDescription + ", " +
+ "extras = " + mExtras + ", " +
"transliteration = " + mTransliteration +
" }";
}
@@ -219,7 +235,7 @@
return true
&& mStatusCode == that.mStatusCode
&& Objects.equals(mText, that.mText)
- && Objects.equals(mDictionaryDescription, that.mDictionaryDescription)
+ && Objects.equals(mExtras, that.mExtras)
&& Objects.equals(mTransliteration, that.mTransliteration);
}
@@ -232,7 +248,7 @@
int _hash = 1;
_hash = 31 * _hash + mStatusCode;
_hash = 31 * _hash + Objects.hashCode(mText);
- _hash = 31 * _hash + Objects.hashCode(mDictionaryDescription);
+ _hash = 31 * _hash + Objects.hashCode(mExtras);
_hash = 31 * _hash + Objects.hashCode(mTransliteration);
return _hash;
}
@@ -245,12 +261,11 @@
byte flg = 0;
if (mText != null) flg |= 0x2;
- if (mDictionaryDescription != null) flg |= 0x4;
if (mTransliteration != null) flg |= 0x8;
dest.writeByte(flg);
dest.writeInt(mStatusCode);
if (mText != null) dest.writeCharSequence(mText);
- if (mDictionaryDescription != null) dest.writeCharSequence(mDictionaryDescription);
+ dest.writeBundle(mExtras);
if (mTransliteration != null) dest.writeCharSequence(mTransliteration);
}
@@ -268,7 +283,7 @@
byte flg = in.readByte();
int statusCode = in.readInt();
CharSequence text = (flg & 0x2) == 0 ? null : (CharSequence) in.readCharSequence();
- CharSequence dictionaryDescription = (flg & 0x4) == 0 ? null : (CharSequence) in.readCharSequence();
+ Bundle extras = in.readBundle();
CharSequence transliteration = (flg & 0x8) == 0 ? null : (CharSequence) in.readCharSequence();
this.mStatusCode = statusCode;
@@ -282,7 +297,9 @@
}
this.mText = text;
- this.mDictionaryDescription = dictionaryDescription;
+ this.mExtras = extras;
+ com.android.internal.util.AnnotationValidations.validate(
+ NonNull.class, null, mExtras);
this.mTransliteration = transliteration;
// onConstructed(); // You can define this method to get a callback
@@ -311,7 +328,7 @@
private @Status int mStatusCode;
private @Nullable CharSequence mText;
- private @Nullable CharSequence mDictionaryDescription;
+ private @NonNull Bundle mExtras;
private @Nullable CharSequence mTransliteration;
private long mBuilderFieldsSet = 0L;
@@ -351,14 +368,15 @@
}
/**
- * The dictionary description of the translated text.
- * TODO: Describe the result structure.
+ * Extra results associated with the translated text.
+ *
+ * <p>The bundle includes {@link #EXTRA_DEFINITIONS}, obtained by {@link Bundle#getBundle}.</p>
*/
@DataClass.Generated.Member
- public @NonNull Builder setDictionaryDescription(@NonNull CharSequence value) {
+ public @NonNull Builder setExtras(@NonNull Bundle value) {
checkNotUsed();
mBuilderFieldsSet |= 0x4;
- mDictionaryDescription = value;
+ mExtras = value;
return this;
}
@@ -383,7 +401,7 @@
mText = defaultText();
}
if ((mBuilderFieldsSet & 0x4) == 0) {
- mDictionaryDescription = defaultDictionaryDescription();
+ mExtras = defaultExtras();
}
if ((mBuilderFieldsSet & 0x8) == 0) {
mTransliteration = defaultTransliteration();
@@ -391,7 +409,7 @@
TranslationResponseValue o = new TranslationResponseValue(
mStatusCode,
mText,
- mDictionaryDescription,
+ mExtras,
mTransliteration);
return o;
}
@@ -405,10 +423,10 @@
}
@DataClass.Generated(
- time = 1614983829716L,
- codegenVersion = "1.0.22",
+ time = 1621034223313L,
+ codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/view/translation/TranslationResponseValue.java",
- inputSignatures = "public static final int STATUS_SUCCESS\npublic static final int STATUS_ERROR\nprivate final @android.view.translation.TranslationResponseValue.Status int mStatusCode\nprivate final @android.annotation.Nullable java.lang.CharSequence mText\nprivate final @android.annotation.Nullable java.lang.CharSequence mDictionaryDescription\nprivate final @android.annotation.Nullable java.lang.CharSequence mTransliteration\npublic static @android.annotation.NonNull android.view.translation.TranslationResponseValue forError()\nprivate static java.lang.CharSequence defaultText()\nprivate static java.lang.CharSequence defaultDictionaryDescription()\nprivate static java.lang.CharSequence defaultTransliteration()\nclass TranslationResponseValue extends java.lang.Object implements [android.os.Parcelable]\nclass BaseBuilder extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genBuilder=true, genToString=true, genEqualsHashCode=true, genHiddenConstDefs=true)\nclass BaseBuilder extends java.lang.Object implements []")
+ inputSignatures = "public static final int STATUS_SUCCESS\npublic static final int STATUS_ERROR\npublic static final java.lang.String EXTRA_DEFINITIONS\nprivate final @android.view.translation.TranslationResponseValue.Status int mStatusCode\nprivate final @android.annotation.Nullable java.lang.CharSequence mText\nprivate final @android.annotation.NonNull android.os.Bundle mExtras\nprivate final @android.annotation.Nullable java.lang.CharSequence mTransliteration\npublic static @android.annotation.NonNull android.view.translation.TranslationResponseValue forError()\nprivate static java.lang.CharSequence defaultText()\nprivate static android.os.Bundle defaultExtras()\nprivate static java.lang.CharSequence defaultTransliteration()\nclass TranslationResponseValue extends java.lang.Object implements [android.os.Parcelable]\nclass BaseBuilder extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genBuilder=true, genToString=true, genEqualsHashCode=true, genHiddenConstDefs=true)\nclass BaseBuilder extends java.lang.Object implements []")
@Deprecated
private void __metadata() {}
diff --git a/core/java/android/view/translation/UiTranslationController.java b/core/java/android/view/translation/UiTranslationController.java
index 9e350d9..f79c329 100644
--- a/core/java/android/view/translation/UiTranslationController.java
+++ b/core/java/android/view/translation/UiTranslationController.java
@@ -658,9 +658,7 @@
msg.append("text=").append(value.getText() == null
? "null"
: "string[" + value.getText().length() + "], ");
- msg.append("dict=").append(value.getDictionaryDescription() == null
- ? "null"
- : "string[" + value.getDictionaryDescription().length() + "], ");
+ //TODO: append dictionary results.
msg.append("transliteration=").append(value.getTransliteration() == null
? "null"
: "string[" + value.getTransliteration().length() + "]}, ");
diff --git a/core/java/android/view/translation/UiTranslationStateCallback.java b/core/java/android/view/translation/UiTranslationStateCallback.java
index 1bae0ef..9aa089d 100644
--- a/core/java/android/view/translation/UiTranslationStateCallback.java
+++ b/core/java/android/view/translation/UiTranslationStateCallback.java
@@ -31,7 +31,9 @@
* @deprecated use {@link #onStarted(ULocale, ULocale)} instead.
*/
@Deprecated
- void onStarted(@NonNull String sourceLocale, @NonNull String targetLocale);
+ default void onStarted(@NonNull String sourceLocale, @NonNull String targetLocale) {
+ // no-op
+ }
/**
* The system is requesting translation of the UI from {@code sourceLocale} to {@code
diff --git a/core/java/android/view/translation/ViewTranslationRequest.java b/core/java/android/view/translation/ViewTranslationRequest.java
index 00f6ef2..a41749a 100644
--- a/core/java/android/view/translation/ViewTranslationRequest.java
+++ b/core/java/android/view/translation/ViewTranslationRequest.java
@@ -36,7 +36,7 @@
* be used by {@link android.service.translation.TranslationService}.
*/
@DataClass(genBuilder = false, genToString = true, genEqualsHashCode = true, genGetters = false,
- genHiddenConstructor = true)
+ genHiddenConstructor = true, genHiddenConstDefs = true)
public final class ViewTranslationRequest implements Parcelable {
/**
@@ -46,6 +46,14 @@
public static final String ID_TEXT = "android:text";
/**
+ * Constant id for the default view content description to be translated. This is used by
+ * {@link Builder#setValue(String, TranslationRequestValue)}.
+ *
+ * @hide
+ */
+ public static final String ID_CONTENT_DESCRIPTION = "android:content_description";
+
+ /**
* The {@link AutofillId} of the view associated with this request.
*/
@NonNull
@@ -191,6 +199,15 @@
//@formatter:off
+ /** @hide */
+ @android.annotation.StringDef(prefix = "ID_", value = {
+ ID_TEXT,
+ ID_CONTENT_DESCRIPTION
+ })
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE)
+ @DataClass.Generated.Member
+ public @interface Id {}
+
/**
* Creates a new ViewTranslationRequest.
*
@@ -303,10 +320,10 @@
};
@DataClass.Generated(
- time = 1620259482911L,
+ time = 1621230365943L,
codegenVersion = "1.0.23",
sourceFile = "frameworks/base/core/java/android/view/translation/ViewTranslationRequest.java",
- inputSignatures = "public static final java.lang.String ID_TEXT\nprivate final @android.annotation.NonNull android.view.autofill.AutofillId mAutofillId\nprivate final @android.annotation.NonNull @com.android.internal.util.DataClass.PluralOf(\"translationRequestValue\") java.util.Map<java.lang.String,android.view.translation.TranslationRequestValue> mTranslationRequestValues\npublic @android.annotation.NonNull android.view.translation.TranslationRequestValue getValue(java.lang.String)\npublic @android.annotation.NonNull java.util.Set<java.lang.String> getKeys()\npublic @android.annotation.NonNull android.view.autofill.AutofillId getAutofillId()\nprivate static java.util.Map<java.lang.String,android.view.translation.TranslationRequestValue> defaultTranslationRequestValues()\nclass ViewTranslationRequest extends java.lang.Object implements [android.os.Parcelable]\nprivate @android.annotation.NonNull android.view.autofill.AutofillId mAutofillId\nprivate @android.annotation.NonNull java.util.Map<java.lang.String,android.view.translation.TranslationRequestValue> mTranslationRequestValues\nprivate long mBuilderFieldsSet\npublic @android.annotation.SuppressLint @android.annotation.NonNull android.view.translation.ViewTranslationRequest.Builder setValue(java.lang.String,android.view.translation.TranslationRequestValue)\npublic @android.annotation.NonNull android.view.translation.ViewTranslationRequest build()\n android.view.translation.ViewTranslationRequest.Builder setTranslationRequestValues(java.util.Map<java.lang.String,android.view.translation.TranslationRequestValue>)\nprivate void checkNotUsed()\nclass Builder extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genBuilder=false, genToString=true, genEqualsHashCode=true, genGetters=false, genHiddenConstructor=true)")
+ inputSignatures = "public static final java.lang.String ID_TEXT\npublic static final java.lang.String ID_CONTENT_DESCRIPTION\nprivate final @android.annotation.NonNull android.view.autofill.AutofillId mAutofillId\nprivate final @android.annotation.NonNull @com.android.internal.util.DataClass.PluralOf(\"translationRequestValue\") java.util.Map<java.lang.String,android.view.translation.TranslationRequestValue> mTranslationRequestValues\npublic @android.annotation.NonNull android.view.translation.TranslationRequestValue getValue(java.lang.String)\npublic @android.annotation.NonNull java.util.Set<java.lang.String> getKeys()\npublic @android.annotation.NonNull android.view.autofill.AutofillId getAutofillId()\nprivate static java.util.Map<java.lang.String,android.view.translation.TranslationRequestValue> defaultTranslationRequestValues()\nclass ViewTranslationRequest extends java.lang.Object implements [android.os.Parcelable]\nprivate @android.annotation.NonNull android.view.autofill.AutofillId mAutofillId\nprivate @android.annotation.NonNull java.util.Map<java.lang.String,android.view.translation.TranslationRequestValue> mTranslationRequestValues\nprivate long mBuilderFieldsSet\npublic @android.annotation.SuppressLint @android.annotation.NonNull android.view.translation.ViewTranslationRequest.Builder setValue(java.lang.String,android.view.translation.TranslationRequestValue)\npublic @android.annotation.NonNull android.view.translation.ViewTranslationRequest build()\n android.view.translation.ViewTranslationRequest.Builder setTranslationRequestValues(java.util.Map<java.lang.String,android.view.translation.TranslationRequestValue>)\nprivate void checkNotUsed()\nclass Builder extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genBuilder=false, genToString=true, genEqualsHashCode=true, genGetters=false, genHiddenConstructor=true, genHiddenConstDefs=true)")
@Deprecated
private void __metadata() {}
diff --git a/core/java/android/webkit/WebViewDelegate.java b/core/java/android/webkit/WebViewDelegate.java
index ad123c1..1b9ff44 100644
--- a/core/java/android/webkit/WebViewDelegate.java
+++ b/core/java/android/webkit/WebViewDelegate.java
@@ -19,7 +19,6 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
-import android.annotation.UptimeMillisLong;
import android.app.ActivityThread;
import android.app.Application;
import android.app.ResourcesManager;
@@ -221,14 +220,12 @@
}
/**
- * Returns an array of startup timestamps. For the specification of array
- * see {@link WebViewFactory.Timestamp}.
+ * Get the timestamps at which various WebView startup events occurred in this process.
* This method must be called on the same thread where the
* WebViewChromiumFactoryProvider#create method was invoked.
*/
@NonNull
- @UptimeMillisLong
- public long[] getTimestamps() {
- return WebViewFactory.getTimestamps();
+ public WebViewFactory.StartupTimestamps getStartupTimestamps() {
+ return WebViewFactory.getStartupTimestamps();
}
}
diff --git a/core/java/android/webkit/WebViewFactory.java b/core/java/android/webkit/WebViewFactory.java
index 9a38512..8d27cde 100644
--- a/core/java/android/webkit/WebViewFactory.java
+++ b/core/java/android/webkit/WebViewFactory.java
@@ -16,9 +16,9 @@
package android.webkit;
-import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.SystemApi;
+import android.annotation.UptimeMillisLong;
import android.app.ActivityManager;
import android.app.AppGlobals;
import android.app.Application;
@@ -33,13 +33,12 @@
import android.os.ServiceManager;
import android.os.SystemClock;
import android.os.Trace;
+import android.os.UserHandle;
import android.util.AndroidRuntimeException;
import android.util.ArraySet;
import android.util.Log;
import java.io.File;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
import java.lang.reflect.Method;
/**
@@ -72,44 +71,6 @@
private static boolean sWebViewDisabled;
private static String sDataDirectorySuffix; // stored here so it can be set without loading WV
- // Indices in sTimestamps array.
- /** @hide */
- @IntDef(value = {
- WEBVIEW_LOAD_START, CREATE_CONTEXT_START, CREATE_CONTEXT_END,
- ADD_ASSETS_START, ADD_ASSETS_END, GET_CLASS_LOADER_START, GET_CLASS_LOADER_END,
- NATIVE_LOAD_START, NATIVE_LOAD_END,
- PROVIDER_CLASS_FOR_NAME_START, PROVIDER_CLASS_FOR_NAME_END})
- @Retention(RetentionPolicy.SOURCE)
- public @interface Timestamp {
- }
-
- /** When the overall WebView provider load began. */
- public static final int WEBVIEW_LOAD_START = 0;
- /** Before creating the WebView APK Context. */
- public static final int CREATE_CONTEXT_START = 1;
- /** After creating the WebView APK Context. */
- public static final int CREATE_CONTEXT_END = 2;
- /** Before adding WebView assets to AssetManager. */
- public static final int ADD_ASSETS_START = 3;
- /** After adding WebView assets to AssetManager. */
- public static final int ADD_ASSETS_END = 4;
- /** Before creating the WebView ClassLoader. */
- public static final int GET_CLASS_LOADER_START = 5;
- /** After creating the WebView ClassLoader. */
- public static final int GET_CLASS_LOADER_END = 6;
- /** Before preloading the WebView native library. */
- public static final int NATIVE_LOAD_START = 7;
- /** After preloading the WebView native library. */
- public static final int NATIVE_LOAD_END = 8;
- /** Before looking up the WebView provider class. */
- public static final int PROVIDER_CLASS_FOR_NAME_START = 9;
- /** After looking up the WebView provider class. */
- public static final int PROVIDER_CLASS_FOR_NAME_END = 10;
- private static final int TIMESTAMPS_SIZE = 11;
-
- // WebView startup timestamps. To access elements use {@link Timestamp}.
- private static long[] sTimestamps = new long[TIMESTAMPS_SIZE];
-
// Error codes for loadWebViewNativeLibraryFromPackage
public static final int LIBLOAD_SUCCESS = 0;
public static final int LIBLOAD_WRONG_PACKAGE_NAME = 1;
@@ -130,6 +91,97 @@
// error for namespace lookup
public static final int LIBLOAD_FAILED_TO_FIND_NAMESPACE = 10;
+ /**
+ * Stores the timestamps at which various WebView startup events occurred in this process.
+ */
+ public static class StartupTimestamps {
+ long mWebViewLoadStart;
+ long mCreateContextStart;
+ long mCreateContextEnd;
+ long mAddAssetsStart;
+ long mAddAssetsEnd;
+ long mGetClassLoaderStart;
+ long mGetClassLoaderEnd;
+ long mNativeLoadStart;
+ long mNativeLoadEnd;
+ long mProviderClassForNameStart;
+ long mProviderClassForNameEnd;
+
+ StartupTimestamps() {}
+
+ /** When the overall WebView provider load began. */
+ @UptimeMillisLong
+ public long getWebViewLoadStart() {
+ return mWebViewLoadStart;
+ }
+
+ /** Before creating the WebView APK Context. */
+ @UptimeMillisLong
+ public long getCreateContextStart() {
+ return mCreateContextStart;
+ }
+
+ /** After creating the WebView APK Context. */
+ @UptimeMillisLong
+ public long getCreateContextEnd() {
+ return mCreateContextEnd;
+ }
+
+ /** Before adding WebView assets to AssetManager. */
+ @UptimeMillisLong
+ public long getAddAssetsStart() {
+ return mAddAssetsStart;
+ }
+
+ /** After adding WebView assets to AssetManager. */
+ @UptimeMillisLong
+ public long getAddAssetsEnd() {
+ return mAddAssetsEnd;
+ }
+
+ /** Before creating the WebView ClassLoader. */
+ @UptimeMillisLong
+ public long getGetClassLoaderStart() {
+ return mGetClassLoaderStart;
+ }
+
+ /** After creating the WebView ClassLoader. */
+ @UptimeMillisLong
+ public long getGetClassLoaderEnd() {
+ return mGetClassLoaderEnd;
+ }
+
+ /** Before preloading the WebView native library. */
+ @UptimeMillisLong
+ public long getNativeLoadStart() {
+ return mNativeLoadStart;
+ }
+
+ /** After preloading the WebView native library. */
+ @UptimeMillisLong
+ public long getNativeLoadEnd() {
+ return mNativeLoadEnd;
+ }
+
+ /** Before looking up the WebView provider class. */
+ @UptimeMillisLong
+ public long getProviderClassForNameStart() {
+ return mProviderClassForNameStart;
+ }
+
+ /** After looking up the WebView provider class. */
+ @UptimeMillisLong
+ public long getProviderClassForNameEnd() {
+ return mProviderClassForNameEnd;
+ }
+ }
+
+ static final StartupTimestamps sTimestamps = new StartupTimestamps();
+
+ @NonNull
+ static StartupTimestamps getStartupTimestamps() {
+ return sTimestamps;
+ }
private static String getWebViewPreparationErrorReason(int error) {
switch (error) {
@@ -273,7 +325,7 @@
// us honest and minimize usage of WebView internals when binding the proxy.
if (sProviderInstance != null) return sProviderInstance;
- sTimestamps[WEBVIEW_LOAD_START] = SystemClock.uptimeMillis();
+ sTimestamps.mWebViewLoadStart = SystemClock.uptimeMillis();
final int uid = android.os.Process.myUid();
if (uid == android.os.Process.ROOT_UID || uid == android.os.Process.SYSTEM_UID
|| uid == android.os.Process.PHONE_UID || uid == android.os.Process.NFC_UID
@@ -413,16 +465,19 @@
Trace.traceBegin(Trace.TRACE_TAG_WEBVIEW,
"initialApplication.createApplicationContext");
- sTimestamps[CREATE_CONTEXT_START] = SystemClock.uptimeMillis();
+ sTimestamps.mCreateContextStart = SystemClock.uptimeMillis();
try {
// Construct an app context to load the Java code into the current app.
- Context webViewContext = initialApplication.createApplicationContext(
- ai,
- Context.CONTEXT_INCLUDE_CODE | Context.CONTEXT_IGNORE_SECURITY);
+ Context webViewContext = initialApplication.createPackageContextAsUser(
+ ai.packageName,
+ Context.CONTEXT_INCLUDE_CODE | Context.CONTEXT_IGNORE_SECURITY,
+ UserHandle.getUserHandleForUid(ai.uid),
+ PackageManager.MATCH_UNINSTALLED_PACKAGES
+ | PackageManager.MATCH_DEBUG_TRIAGED_MISSING);
sPackageInfo = newPackageInfo;
return webViewContext;
} finally {
- sTimestamps[CREATE_CONTEXT_END] = SystemClock.uptimeMillis();
+ sTimestamps.mCreateContextEnd = SystemClock.uptimeMillis();
Trace.traceEnd(Trace.TRACE_TAG_WEBVIEW);
}
} catch (RemoteException | PackageManager.NameNotFoundException e) {
@@ -448,26 +503,26 @@
Trace.traceBegin(Trace.TRACE_TAG_WEBVIEW, "WebViewFactory.getChromiumProviderClass()");
try {
- sTimestamps[ADD_ASSETS_START] = SystemClock.uptimeMillis();
+ sTimestamps.mAddAssetsStart = SystemClock.uptimeMillis();
for (String newAssetPath : webViewContext.getApplicationInfo().getAllApkPaths()) {
initialApplication.getAssets().addAssetPathAsSharedLibrary(newAssetPath);
}
- sTimestamps[ADD_ASSETS_END] = sTimestamps[GET_CLASS_LOADER_START] =
+ sTimestamps.mAddAssetsEnd = sTimestamps.mGetClassLoaderStart =
SystemClock.uptimeMillis();
ClassLoader clazzLoader = webViewContext.getClassLoader();
Trace.traceBegin(Trace.TRACE_TAG_WEBVIEW, "WebViewFactory.loadNativeLibrary()");
- sTimestamps[GET_CLASS_LOADER_END] = sTimestamps[NATIVE_LOAD_START] =
+ sTimestamps.mGetClassLoaderEnd = sTimestamps.mNativeLoadStart =
SystemClock.uptimeMillis();
WebViewLibraryLoader.loadNativeLibrary(clazzLoader,
getWebViewLibrary(sPackageInfo.applicationInfo));
Trace.traceEnd(Trace.TRACE_TAG_WEBVIEW);
Trace.traceBegin(Trace.TRACE_TAG_WEBVIEW, "Class.forName()");
- sTimestamps[NATIVE_LOAD_END] = sTimestamps[PROVIDER_CLASS_FOR_NAME_START] =
+ sTimestamps.mNativeLoadEnd = sTimestamps.mProviderClassForNameStart =
SystemClock.uptimeMillis();
try {
return getWebViewProviderClass(clazzLoader);
} finally {
- sTimestamps[PROVIDER_CLASS_FOR_NAME_END] = SystemClock.uptimeMillis();
+ sTimestamps.mProviderClassForNameEnd = SystemClock.uptimeMillis();
Trace.traceEnd(Trace.TRACE_TAG_WEBVIEW);
}
} catch (ClassNotFoundException e) {
@@ -529,9 +584,4 @@
return IWebViewUpdateService.Stub.asInterface(
ServiceManager.getService(WEBVIEW_UPDATE_SERVICE_NAME));
}
-
- @NonNull
- static long[] getTimestamps() {
- return sTimestamps;
- }
}
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index ee7818c..25c84ba 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -5827,8 +5827,9 @@
return context;
}
try {
- return context.createApplicationContext(mApplication,
- Context.CONTEXT_RESTRICTED);
+ return context.createPackageContextAsUser(mApplication.packageName,
+ Context.CONTEXT_RESTRICTED,
+ UserHandle.getUserHandleForUid(mApplication.uid));
} catch (NameNotFoundException e) {
Log.e(LOG_TAG, "Package name " + mApplication.packageName + " not found");
}
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 1a37b59..e0238b9 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -13924,6 +13924,10 @@
// TODO(b/176488462): apply the view's important for translation
requestBuilder.setValue(ViewTranslationRequest.ID_TEXT,
TranslationRequestValue.forText(mText));
+ if (!TextUtils.isEmpty(getContentDescription())) {
+ requestBuilder.setValue(ViewTranslationRequest.ID_CONTENT_DESCRIPTION,
+ TranslationRequestValue.forText(getContentDescription()));
+ }
}
requestsCollector.accept(requestBuilder.build());
}
diff --git a/core/java/android/widget/TextViewTranslationCallback.java b/core/java/android/widget/TextViewTranslationCallback.java
index 0376061..92c9142 100644
--- a/core/java/android/widget/TextViewTranslationCallback.java
+++ b/core/java/android/widget/TextViewTranslationCallback.java
@@ -19,11 +19,13 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.Build;
+import android.text.TextUtils;
import android.text.method.TranslationTransformationMethod;
import android.util.Log;
import android.view.View;
import android.view.translation.UiTranslationManager;
import android.view.translation.ViewTranslationCallback;
+import android.view.translation.ViewTranslationRequest;
import android.view.translation.ViewTranslationResponse;
/**
@@ -46,6 +48,8 @@
private boolean mIsTextPaddingEnabled = false;
private CharSequence mPaddedText;
+ private CharSequence mContentDescription;
+
/**
* Invoked by the platform when receiving the successful {@link ViewTranslationResponse} for the
* view that provides the translatable information by {@link View#createTranslationRequest} and
@@ -86,6 +90,15 @@
}
if (mTranslationTransformation != null) {
((TextView) view).setTransformationMethod(mTranslationTransformation);
+ ViewTranslationResponse response = view.getViewTranslationResponse();
+ if (response.getKeys().contains(ViewTranslationRequest.ID_CONTENT_DESCRIPTION)) {
+ CharSequence translatedContentDescription =
+ response.getValue(ViewTranslationRequest.ID_CONTENT_DESCRIPTION).getText();
+ if (!TextUtils.isEmpty(translatedContentDescription)) {
+ mContentDescription = view.getContentDescription();
+ view.setContentDescription(translatedContentDescription);
+ }
+ }
} else {
if (DEBUG) {
// TODO(b/182433547): remove before S release
@@ -111,6 +124,9 @@
if (mTranslationTransformation != null) {
((TextView) view).setTransformationMethod(
mTranslationTransformation.getOriginalTransformationMethod());
+ if (!TextUtils.isEmpty(mContentDescription)) {
+ view.setContentDescription(mContentDescription);
+ }
} else {
if (DEBUG) {
// TODO(b/182433547): remove before S release
@@ -131,6 +147,7 @@
onHideTranslation(view);
clearTranslationTransformation();
mPaddedText = null;
+ mContentDescription = null;
} else {
if (DEBUG) {
// TODO(b/182433547): remove before S release
diff --git a/core/java/android/window/IWindowOrganizerController.aidl b/core/java/android/window/IWindowOrganizerController.aidl
index 0cd9b36..1223d72 100644
--- a/core/java/android/window/IWindowOrganizerController.aidl
+++ b/core/java/android/window/IWindowOrganizerController.aidl
@@ -78,17 +78,6 @@
IDisplayAreaOrganizerController getDisplayAreaOrganizerController();
/**
- * Take a screenshot of the requested Window token and place the content of the screenshot into
- * outSurfaceControl. The SurfaceControl will be a child of the token's parent, so it will be
- * a sibling of the token's window
- * @param token The token for the WindowContainer that should get a screenshot taken.
- * @param outSurfaceControl The SurfaceControl where the screenshot will be attached.
- *
- * @return true if the screenshot was successful, false otherwise.
- */
- boolean takeScreenshot(in WindowContainerToken token, out SurfaceControl outSurfaceControl);
-
- /**
* Registers a transition player with Core. There is only one of these at a time and calling
* this will replace the existing one if set.
*/
diff --git a/core/java/android/window/WindowOrganizer.java b/core/java/android/window/WindowOrganizer.java
index bcd0e8d..544d422 100644
--- a/core/java/android/window/WindowOrganizer.java
+++ b/core/java/android/window/WindowOrganizer.java
@@ -25,7 +25,6 @@
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Singleton;
-import android.view.SurfaceControl;
/**
* Base class for organizing specific types of windows like Tasks and DisplayAreas
@@ -112,28 +111,6 @@
}
/**
- * Take a screenshot for a specified Window
- * @param token The token for the WindowContainer that should get a screenshot taken.
- * @return A SurfaceControl where the screenshot will be attached, or null if failed.
- *
- * @hide
- */
- @Nullable
- @RequiresPermission(android.Manifest.permission.READ_FRAME_BUFFER)
- public SurfaceControl takeScreenshot(@NonNull WindowContainerToken token) {
- try {
- SurfaceControl surfaceControl = new SurfaceControl();
- if (getWindowOrganizerController().takeScreenshot(token, surfaceControl)) {
- return surfaceControl;
- } else {
- return null;
- }
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
* Register an ITransitionPlayer to handle transition animations.
* @hide
*/
diff --git a/core/java/com/android/internal/app/IAppOpsService.aidl b/core/java/com/android/internal/app/IAppOpsService.aidl
index 3cf4621..3cc7e64 100644
--- a/core/java/com/android/internal/app/IAppOpsService.aidl
+++ b/core/java/com/android/internal/app/IAppOpsService.aidl
@@ -92,7 +92,7 @@
void setAudioRestriction(int code, int usage, int uid, int mode, in String[] exceptionPackages);
void setUserRestrictions(in Bundle restrictions, IBinder token, int userHandle);
- void setUserRestriction(int code, boolean restricted, IBinder token, int userHandle, in Map<String, String[]> excludedPackageTags);
+ void setUserRestriction(int code, boolean restricted, IBinder token, int userHandle, in Map<String, String[]> excludedPackageTags, boolean rejectBypass);
void removeUser(int userHandle);
void startWatchingActive(in int[] ops, IAppOpsActiveCallback callback);
diff --git a/core/java/com/android/internal/util/LatencyTracker.java b/core/java/com/android/internal/util/LatencyTracker.java
index 61a5014..358e6ef 100644
--- a/core/java/com/android/internal/util/LatencyTracker.java
+++ b/core/java/com/android/internal/util/LatencyTracker.java
@@ -100,6 +100,11 @@
*/
public static final int ACTION_ROTATE_SCREEN_SENSOR = 9;
+ /**
+ * Time it takes to for the camera based algorithm to rotate the screen.
+ */
+ public static final int ACTION_ROTATE_SCREEN_CAMERA_CHECK = 10;
+
private static final int[] ACTIONS_ALL = {
ACTION_EXPAND_PANEL,
ACTION_TOGGLE_RECENTS,
@@ -110,7 +115,8 @@
ACTION_ROTATE_SCREEN,
ACTION_FACE_WAKE_AND_UNLOCK,
ACTION_START_RECENTS_ANIMATION,
- ACTION_ROTATE_SCREEN_SENSOR
+ ACTION_ROTATE_SCREEN_SENSOR,
+ ACTION_ROTATE_SCREEN_CAMERA_CHECK
};
/** @hide */
@@ -124,7 +130,8 @@
ACTION_ROTATE_SCREEN,
ACTION_FACE_WAKE_AND_UNLOCK,
ACTION_START_RECENTS_ANIMATION,
- ACTION_ROTATE_SCREEN_SENSOR
+ ACTION_ROTATE_SCREEN_SENSOR,
+ ACTION_ROTATE_SCREEN_CAMERA_CHECK
})
@Retention(RetentionPolicy.SOURCE)
public @interface Action {
@@ -140,7 +147,8 @@
FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_ROTATE_SCREEN,
FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_FACE_WAKE_AND_UNLOCK,
FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_START_RECENTS_ANIMATION,
- FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_ROTATE_SCREEN_SENSOR
+ FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_ROTATE_SCREEN_SENSOR,
+ FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_ROTATE_SCREEN_CAMERA_CHECK
};
private static LatencyTracker sLatencyTracker;
@@ -217,6 +225,8 @@
return "ACTION_FACE_WAKE_AND_UNLOCK";
case 9:
return "ACTION_START_RECENTS_ANIMATION";
+ case 10:
+ return "ACTION_ROTATE_SCREEN_CAMERA_CHECK";
case 11:
return "ACTION_ROTATE_SCREEN_SENSOR";
default:
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 3d892b5..bb409db 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -2898,6 +2898,12 @@
android:description="@string/permdesc_runInBackground"
android:protectionLevel="normal" />
+ <!-- Allows a companion app to start a foreground service from the background.
+ {@see android.Manifest.permission#REQUEST_COMPANION_RUN_IN_BACKGROUND}
+ -->
+ <permission android:name="android.permission.REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND"
+ android:protectionLevel="normal"/>
+
<!-- Allows a companion app to use data in the background.
<p>Protection level: normal
-->
diff --git a/core/res/res/layout/work_widget_mask_view.xml b/core/res/res/layout/work_widget_mask_view.xml
index 86c5d13..a6fb17a 100644
--- a/core/res/res/layout/work_widget_mask_view.xml
+++ b/core/res/res/layout/work_widget_mask_view.xml
@@ -15,12 +15,13 @@
limitations under the License.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/work_widget_mask_frame"
+ android:id="@android:id/background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/work_widget_mask_view_background"
android:importantForAccessibility="noHideDescendants"
- android:clickable="true">
+ android:clickable="true"
+ android:clipToOutline="true">
<com.android.internal.widget.DisableImageView
android:id="@+id/work_widget_app_icon"
diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml
index 2be8a5c..c9fa462 100644
--- a/core/res/res/values-af/strings.xml
+++ b/core/res/res/values-af/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"Vingerafdrukikoon"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"bestuur gesigslothardeware"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"bestuur Gesigslothardeware"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Laat program toe om metodes te benut om gesigtemplate vir gebruik by te voeg en uit te vee."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"gebruik gesigslothardeware"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Laat die program toe om gesigslothardeware vir stawing te gebruik"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"gebruik Gesigslothardeware"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Laat die program toe om Gesigslothardeware vir stawing te gebruik"</string>
<string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Gesigslot"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Skryf jou gesig weer in"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Skryf asseblief jou gesig weer in om herkenning te verbeter"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"Stel gesigslot op"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"Stel Gesigslot op"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"Ontsluit jou foon deur daarna te kyk"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"Stel meer maniere op om te ontsluit"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"Tik om \'n vingerafdruk by te voeg"</string>
@@ -643,19 +643,19 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"Kan nie gesig verifieer nie. Hardeware nie beskikbaar nie."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"Probeer gesigslot weer."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"Probeer Gesigslot weer."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"Kan nie nuwe gesigdata berg nie. Vee eers \'n ou een uit."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"Gesighandeling is gekanselleer."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"Gebruiker het gesigslot gekanselleer."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"Gebruiker het Gesigslot gekanselleer."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"Te veel pogings. Probeer later weer."</string>
<string name="face_error_lockout_permanent" msgid="8277853602168960343">"Te veel pogings. Gesigslot is gedeaktiveer."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"Kan nie gesig verifieer nie. Probeer weer."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"Jy het nie gesigslot opgestel nie."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"Jy het nie Gesigslot opgestel nie."</string>
<string name="face_error_hw_not_present" msgid="1070600921591729944">"Gesigslot word nie op hierdie toestel gesteun nie."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"Sensor is tydelik gedeaktiveer."</string>
<string name="face_name_template" msgid="3877037340223318119">"Gesig <xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"Gebruik gesigslot"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Gebruik gesig- of skermslot"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"Gebruik Gesigslot"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Gebruik Gesigslot of Skermslot"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"Gebruik jou gesig om voort te gaan"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"Gebruik jou gesig of skermslot om voort te gaan"</string>
<string-array name="face_error_vendor">
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Probeer weer"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Probeer weer"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Ontsluit vir alle kenmerke en data"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Maksimum gesigontsluit-pogings oorskry"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Maksimum Gesigslot-pogings oorskry"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"Geen SIM-kaart nie"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Geen SIM-kaart in tablet nie."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Geen SIM-kaart in jou Android TV-toestel nie."</string>
diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml
index 31dcceb5..6d44d15 100644
--- a/core/res/res/values-ar/strings.xml
+++ b/core/res/res/values-ar/strings.xml
@@ -621,14 +621,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"رمز بصمة الإصبع"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"إدارة أجهزة \"فتح القفل بالوجه\""</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"إدارة أجهزة ميزة \"فتح الجهاز بالتعرف على الوجه\""</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"السماح للتطبيق باستدعاء طرق لإضافة نماذج من الوجوه وحذفها"</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"استخدام أجهزة \"فتح القفل بالوجه\""</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"السماح للتطبيق باستخدام أجهزة \"فتح القفل بالوجه\" لإجراء المصادقة"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"فتح القفل بالوجه"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"استخدام أجهزة ميزة \"فتح الجهاز بالتعرف على الوجه\""</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"السماح للتطبيق باستخدام أجهزة ميزة \"فتح الجهاز بالتعرف على الوجه\" لإجراء المصادقة"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"فتح الجهاز بالتعرف على الوجه"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"إعادة تسجيل وجهك"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"لتحسين قدرة الجهاز على معرفة وجهك، يُرجى إعادة تسجيل الوجه."</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"إعداد ميزة \"فتح القفل بالوجه\""</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"إعداد ميزة \"فتح الجهاز بالتعرف على الوجه\""</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"يمكنك فتح قفل هاتفك بمجرّد النظر إلى الشاشة."</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"إعداد المزيد من الطرق لفتح قفل الجهاز"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"انقر لإضافة بصمة إصبع."</string>
@@ -655,19 +655,19 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"يتعذّر التحقُّق من الوجه. الجهاز غير مُتاح."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"حاول استخدام \"فتح القفل بالوجه\" مرة أخرى."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"جرِّب استخدام ميزة \"فتح الجهاز بالتعرف على الوجه\" مرة أخرى."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"يتعذَّر تخزين بيانات الوجه الجديد. احذف الوجه القديم أولاً."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"تمّ إلغاء عملية مصادقة الوجه."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"ألغى المستخدم \"فتح القفل بالوجه\"."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"ألغى المستخدم ميزة \"فتح الجهاز بالتعرف على الوجه\"."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"تمّ إجراء محاولات كثيرة. أعِد المحاولة لاحقًا."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"تم إجراء عدد كبير جدًا من المحاولات. وتم إيقاف \"فتح القفل بالوجه\"."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"تم إجراء محاولات كثيرة، ولذا تم إيقاف ميزة \"فتح الجهاز بالتعرف على الوجه\"."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"يتعذّر التحقق من الوجه. حاول مرة أخرى."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"لم يسبق لك إعداد \"فتح القفل بالوجه\"."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"\"فتح القفل بالوجه\" غير متوفر على هذا الجهاز."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"لم يسبق لك إعداد ميزة \"فتح الجهاز بالتعرف على الوجه\"."</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"ميزة \"فتح الجهاز بالتعرف على الوجه\" غير متوفرة بهذا الجهاز."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"تم إيقاف جهاز الاستشعار مؤقتًا."</string>
<string name="face_name_template" msgid="3877037340223318119">"الوجه <xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"استخدام \"فتح القفل بالوجه\""</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"استخدام ميزة \"فتح القفل بالوجه\" أو ميزة \"قفل الشاشة\""</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"فتح الجهاز بالتعرف على الوجه"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"استخدام ميزة \"فتح الجهاز بالتعرف على الوجه\" أو ميزة \"قفل الشاشة\""</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"استخدِم الوجه للمتابعة"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"استخدام ميزة \"فتح القفل بالوجه\" أو ميزة \"قفل الشاشة\" للمتابعة"</string>
<string-array name="face_error_vendor">
@@ -899,7 +899,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"أعد المحاولة"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"أعد المحاولة"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"فتح قفل جميع الميزات والبيانات"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"تم تجاوز الحد الأقصى لعدد محاولات تأمين الجهاز بالوجه"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"تم تجاوز الحد الأقصى لعدد محاولات فتح الجهاز بالتعرف على الوجه"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"ليست هناك شريحة SIM"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"ليس هناك شريحة SIM في الجهاز اللوحي."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"لا تتوفر شريحة SIM في جهاز Android TV."</string>
@@ -969,7 +969,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"توسيع منطقة فتح القفل."</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"فتح القفل باستخدام التمرير."</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"فتح القفل باستخدام النقش."</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"تأمين الجهاز بالوجه."</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"استخدام ميزة \"فتح الجهاز بالتعرف على الوجه\""</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"فتح القفل باستخدام رمز PIN."</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"فتح قفل رقم التعريف الشخصي لشريحة SIM."</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"فتح قفل مفتاح PUK لشريحة SIM."</string>
diff --git a/core/res/res/values-as/strings.xml b/core/res/res/values-as/strings.xml
index 1392510..569b628 100644
--- a/core/res/res/values-as/strings.xml
+++ b/core/res/res/values-as/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"ফিংগাৰপ্ৰিণ্ট আইকন"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"মুখাৱয়বৰদ্বাৰা আনলক হার্ডৱেৰ পৰিচালনা কৰক"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"ফেচ আনলক হার্ডৱেৰ পৰিচালনা কৰক"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"মুখমণ্ডলৰ টেম্প্লেট যোগ কৰাৰ বা মচাৰ পদ্ধতি কামত লগাবলৈ আহ্বান কৰিবলৈ এপটোক অনুমতি দিয়ে।"</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"মুখাৱয়বৰদ্বাৰা আনলক হার্ডৱেৰ ব্যৱহাৰ কৰক"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"বিশ্বাসযোগ্যতা প্ৰমাণীকৰণৰ বাবে এপ্ক মুখাৱয়বৰদ্বাৰা আনলক কৰা হাৰ্ডৱেৰ ব্যৱহাৰ কৰিবলৈ দিয়ে"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"মুখাৱয়বৰদ্বাৰা আনলক কৰা সুবিধা"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"ফেচ আনলক হার্ডৱেৰ ব্যৱহাৰ কৰক"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"বিশ্বাসযোগ্যতা প্ৰমাণীকৰণৰ বাবে এপ্ক ফেচ আনলক কৰা হাৰ্ডৱেৰ ব্যৱহাৰ কৰিবলৈ দিয়ে"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"ফেচ আনলক কৰা সুবিধা"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"আপোনাৰ মুখমণ্ডল পুনৰ পঞ্জীয়ণ কৰক"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"চিনাক্তকৰণৰ সুবিধাটো উন্নত কৰিবলৈ, অনুগ্ৰহ কৰি আপোনাৰ মুখমণ্ডল পুনৰ পঞ্জীয়ন কৰক"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"মুখাৱয়বৰদ্বাৰা আনলক কৰা সুবিধাটো ছেট আপ কৰক"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"ফেচ আনলক সুবিধাটো ছেট আপ কৰক"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"আপোনাৰ ফ’নটোলৈ চাই সেইটো আনলক কৰক"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"আনলক কৰাৰ অধিক উপায় ছেট আপ কৰক"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"এটা ফিংগাৰপ্ৰিণ্ট যোগ দিবলৈ টিপক"</string>
@@ -643,19 +643,19 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"মুখমণ্ডল সত্যাপন কৰিব পৰা নগ’ল। হাৰ্ডৱেৰ নাই।"</string>
- <string name="face_error_timeout" msgid="522924647742024699">"পুনৰ মুখাৱয়বৰদ্বাৰা আনলক কৰি চাওক।"</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"পুনৰ ফেচ আনলক কৰি চাওক।"</string>
<string name="face_error_no_space" msgid="5649264057026021723">"নতুন মুখমণ্ডলৰ ডেটা জমা কৰিব পৰা নাই। প্ৰথমে পুৰণি এখন মচক।"</string>
<string name="face_error_canceled" msgid="2164434737103802131">"মুখমণ্ডলৰ প্ৰক্ৰিয়া বাতিল কৰা হ’ল।"</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"ব্যৱহাৰকাৰীয়ে মুখাৱয়বৰদ্বাৰা আনলক কৰাটো বাতিল কৰিছে।"</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"ব্যৱহাৰকাৰীয়ে ফেচ আনলক কৰাটো বাতিল কৰিছে।"</string>
<string name="face_error_lockout" msgid="7864408714994529437">"অত্যধিক ভুল প্ৰয়াস। কিছুসময়ৰ পাছত আকৌ চেষ্টা কৰক।"</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"অতি বেছি প্ৰয়াস। মুখাৱয়বৰদ্বাৰা আনলক কৰাটো অক্ষম কৰা হৈছে।"</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"অতি বেছি প্ৰয়াস। ফেচ আনলক কৰাটো অক্ষম কৰা হৈছে।"</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"মুখমণ্ডল সত্যাপন কৰিব পৰা নগ’ল। আকৌ চেষ্টা কৰক।"</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"আপুনি মুখাৱয়বৰদ্বাৰা আনলক কৰাটো ছেট আপ কৰা নাই।"</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"এই ডিভাইচটোত মুখাৱয়বৰদ্বাৰা আনলক কৰা সুবিধাটো নচলে।"</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"আপুনি ফেচ আনলক ছেট আপ কৰা নাই।"</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"এই ডিভাইচটোত ফেচ আনলক কৰা সুবিধাটো নচলে।"</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"ছেন্সৰটো সাময়িকভাৱে অক্ষম হৈ আছে।"</string>
<string name="face_name_template" msgid="3877037340223318119">"মুখমণ্ডল <xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"মুখাৱয়বৰে আনলক কৰা ব্যৱহাৰ কৰক"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"মুখাৱয়বৰে আনলক কৰা অথবা স্ক্ৰীন লক ব্যৱহাৰ কৰক"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"ফেচ আনলক ব্যৱহাৰ কৰক"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"ফেচ আনলক অথবা স্ক্ৰীন লক ব্যৱহাৰ কৰক"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"অব্যাহত ৰাখিবলৈ নিজৰ মুখাৱয়ব ব্যৱহাৰ কৰক"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"অব্যাহত ৰাখিবলৈ আপোনাৰ মুখাৱয়ব অথবা স্ক্ৰীন লক ব্যৱহাৰ কৰক"</string>
<string-array name="face_error_vendor">
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"আকৌ চেষ্টা কৰক"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"আকৌ চেষ্টা কৰক"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"সকলো সুবিধা আৰু ডেটাৰ বাবে আনলক কৰক"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"গৰাকীৰ মুখাৱয়বৰ দ্বাৰা আনলক কৰা সর্বধিক সীমা অতিক্ৰম কৰা হ’ল"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"গৰাকীৰ ফেচ আনলক কৰা সৰ্বাধিক সীমা অতিক্ৰম কৰা হ’ল"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"কোনো ছিম কাৰ্ড নাই"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"টে\'বলেটত ছিম কার্ড নাই।"</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"আপোনাৰ Android TV ডিভাইচটোত কোনো ছিম কার্ড নাই।"</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"আনলক ক্ষেত্ৰ বিস্তাৰ কৰক।"</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"শ্লাইডৰদ্বাৰা আনলক।"</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"আৰ্হিৰদ্বাৰা আনলক।"</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"মুখাৱয়বৰদ্বাৰা আনলক।"</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"ফেচ আনলক।"</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"পিনৰদ্বাৰা আনলক।"</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"ছিম পিন আনলক।"</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"ছিম পিইউকে আনলক।"</string>
diff --git a/core/res/res/values-az/strings.xml b/core/res/res/values-az/strings.xml
index f4c6c99..6552e82 100644
--- a/core/res/res/values-az/strings.xml
+++ b/core/res/res/values-az/strings.xml
@@ -609,11 +609,11 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"Barmaq izi ikonası"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"üz kilidi avadanlığını idarə edin"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"Üz ilə kiliddən açma avadanlığını idarə edin"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Proqramdan istifadə üçün barmaq izi şablonlarını əlavə etmək və silmək məqsədilə üsullara müraciət etməyə imkan verir."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"üz kilidi avadanlığından istifadə edin"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"İdentifikasiya üçün tətbiqin üz kilidi avadanlığından istifadə etməsinə icazə verir"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Üz kilidi"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"üz ilə kiliddən açma işlədin"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"İdentifikasiya üçün tətbiqin Üz ilə Kiliddən Açmasına icazə verir"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Üz ilə Kiliddən Açma"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Üzünüzü yenidən qeydiyyatdan keçirin"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Tanınmanı təkmilləşdirmək üçün üzünüzü yenidən qeydiyyatdan keçirin"</string>
<string name="face_setup_notification_title" msgid="550617822603450009">"Üz ilə kiliddən çıxarmanı ayarlayın"</string>
@@ -643,15 +643,15 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"Üz doğrulanmadı. Avadanlıq əlçatan deyil."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"Üz kilidini yenidən sınayın."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"Üz ilə Kiliddən Açmanı yenidən sınayın."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"Yeni üz datası saxlanmadı. Əvvəlcə köhnə olanı silin."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"Üz əməliyyatı ləğv edildi."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"İstifadəçi üz kilidini ləğv edib."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"İstifadəçi Üz ilə Kiliddən Açmanı ləğv edib."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"Həddindən çox cəhd. Sonraya saxlayın."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Həddindən çox cəhd. Üz kilidi deaktiv edildi."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Həddindən çox cəhd. Üz ilə Kiliddən Açma deaktiv edildi."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"Üz doğrulanmadı. Yenidən cəhd edin."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"Üz kilidi quraşdırmamısınız."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"Üz kilidi bu cihazda dəstəklənmir."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"Üz ilə Kiliddən Açmanı quraşdırmamısınız."</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"Üz ilə Kiliddən Açma bu cihazda dəstəklənmir."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"Sensor müvəqqəti deaktivdir."</string>
<string name="face_name_template" msgid="3877037340223318119">"Üz <xliff:g id="FACEID">%d</xliff:g>"</string>
<string name="face_app_setting_name" msgid="8130135875458467243">"Üz ilə kiliddən çıxarmadan istifadə edin"</string>
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Bir də cəhd edin"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Bir daha cəhd et"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Bütün funksiyalar və data üçün kiliddən çıxarın"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Sifət kilidi cəhdləriniz bitdi"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Üz ilə Kiliddən Açma cəhdləriniz bitdi"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"SIM kart yoxdur."</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Planşetdə SIM kart yoxdur."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Android TV cihazında SIM kart yoxdur."</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"Kilidi açma sahəsini genişləndir."</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"Sürüşdürmə kilidi."</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"Kild açma modeli."</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Sifət Kilidi"</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Üz ilə Kiliddən Açma"</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"Pin kilid açması."</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"Sim Pin kilidini açın."</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"Sim Puk kilidini açın."</string>
diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml
index 9ae5c92..24243e4 100644
--- a/core/res/res/values-be/strings.xml
+++ b/core/res/res/values-be/strings.xml
@@ -893,7 +893,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Паўтарыце спробу"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Паўтарыце спробу"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Разблакіраваць для ўсіх функцый і даных"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Перавышана максімальная колькасць спроб разблакоўкі праз Фэйскантроль"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Перавышана максімальная колькасць спроб разблакоўкі праз распазнаванне твару"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"Няма SIM-карты"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Няма SIM-карты ў планшэце."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"У вашай прыладзе Android TV няма SIM-карты."</string>
diff --git a/core/res/res/values-bn/strings.xml b/core/res/res/values-bn/strings.xml
index 5597cd0..b1be0ca 100644
--- a/core/res/res/values-bn/strings.xml
+++ b/core/res/res/values-bn/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"আঙ্গুলের ছাপ আইকন"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"মুখের সাহায্যে আনলক করার হার্ডওয়্যার ম্যানেজ করা"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"ফেস আনলক হার্ডওয়্যার ম্যানেজ করা"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"ব্যবহার করার জন্য ফেস টেম্পলেট যোগ করা এবং মোছার পদ্ধতি গ্রহণ করতে অ্যাপটিকে অনুমতি দেয়৷"</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"মুখের সাহায্যে আনলক করার হার্ডওয়্যার ব্যবহার করা"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"অ্যাপকে যাচাইকরণের জন্য মুখের সাহায্যে আনলক করার হার্ডওয়্যার ব্যবহার করতে দেয়"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"মুখের সাহায্যে আনলক"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"ফেস আনলক হার্ডওয়্যার ব্যবহার করা"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"অ্যাপকে যাচাইকরণের জন্য ফেস আনলক হার্ডওয়্যার ব্যবহার করতে দেয়"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"ফেস আনলক"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"আপনার ফেস আবার এনরোল করুন"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"শনাক্তকরণের উন্নতি করতে আপনার ফেস আবার এনরোল করুন"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"মুখের সাহায্যে আনলক করার ফিচার সেট-আপ করুন"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"ফেস আনলক ফিচার সেট-আপ করুন"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"আপনার ফোনের দিকে তাকিয়ে এটিকে আনলক করুন"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"আনলক করার জন্য বিভিন্ন উপায়ে সেট আপ করুন"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"একটি আঙ্গুলের ছাপ যোগ করতে ট্যাপ করুন"</string>
@@ -643,19 +643,19 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"ফেস যাচাই করা যায়নি। হার্ডওয়্যার উপলভ্য নেই।"</string>
- <string name="face_error_timeout" msgid="522924647742024699">"আবার মুখের সাহায্যে আনলক করার চেষ্টা করুন।"</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"আবার ফেস আনলকের মাধ্যমে চেষ্টা করুন।"</string>
<string name="face_error_no_space" msgid="5649264057026021723">"নতুন ফেস ডেটা স্টোর করা যায়নি। প্রথমে পুরনোটি মুছে ফেলুন।"</string>
<string name="face_error_canceled" msgid="2164434737103802131">"ফেস অপারেশন বাতিল করা হয়েছে৷"</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"ব্যবহারকারী মুখের সাহায্যে আনলক বাতিল করে দিয়েছেন।"</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"ব্যবহারকারী ফেস আনলক বাতিল করে দিয়েছেন।"</string>
<string name="face_error_lockout" msgid="7864408714994529437">"অনেকবার চেষ্টা করা হয়েছে। পরে আবার চেষ্টা করুন।"</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"অনেকবার চেষ্টা করেছেন। মুখের সাহায্যে আনলক করার সুবিধা বন্ধ করা হয়েছে।"</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"অনেকবার চেষ্টা করেছেন। ফেস আনলক বন্ধ করা হয়েছে।"</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"আপনার মুখ যাচাই করা যাচ্ছে না। আবার চেষ্টা করুন।"</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"এখনও মুখের সাহায্যে আনলক করার সুবিধা সেট-আপ করেননি।"</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"এই ডিভাইসে মুখের সাহায্যে আনলক করার সুবিধাটি কাজ করে না।"</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"এখনও ফেস আনলক সেট-আপ করেননি।"</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"এই ডিভাইসে ফেস আনলক সুবিধাটি কাজ করে না।"</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"সেন্সর অস্থায়ীভাবে বন্ধ করা আছে।"</string>
<string name="face_name_template" msgid="3877037340223318119">"<xliff:g id="FACEID">%d</xliff:g> ফেস"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"মুখের সাহায্যে আনলক ব্যবহার করুন"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"মুখ অথবা স্ক্রিন লক ব্যবহার করুন"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"ফেস আনলক ব্যবহার করুন"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"ফেস অথবা স্ক্রিন লক ব্যবহার করুন"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"চালিয়ে যেতে আপনার মুখ ব্যবহার করুন"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"চালিয়ে যেতে আপনার ফেস বা স্ক্রিন লক ব্যবহার করুন"</string>
<string-array name="face_error_vendor">
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"আবার চেষ্টা করুন"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"আবার চেষ্টা করুন"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"সমস্ত বৈশিষ্ট্য এবং ডেটার জন্য আনলক করুন"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"মুখের সাহায্যে আনলক করার প্রচেষ্টা যতবার করা যায় তার সীমা পেরিয়ে গেছে"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"ফেস আনলক ফিচারের সাহায্যে আনলকের চেষ্টা সর্বোচ্চ সীমা পেরিয়ে গেছে"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"কোনো সিম কার্ড নেই"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"ট্যাবলেটের মধ্যে কোনো সিম কার্ড নেই৷"</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"আপনার Android TV ডিভাইসে কোনও সিম কার্ড নেই।"</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"আনলক এলাকা প্রসারিত করুন৷"</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"স্লাইড দিয়ে আনলক৷"</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"প্যাটার্ন দিয়ে আনলক৷"</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"মুখের সাহায্যে আনলক৷"</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"ফেস আনলক৷"</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"পিন দিয়ে আনলক৷"</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"সিম পিন আনলক।"</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"সিম পিইউকে আনলক।"</string>
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index dfe8f45..2b16b36 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -609,10 +609,10 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"Icona d\'empremta digital"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"gestiona el maquinari de desbloqueig facial"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"gestiona el maquinari de Desbloqueig facial"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Permet que l\'aplicació afegeixi i suprimeixi plantilles de cares que es puguin fer servir."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"utilitza el maquinari de desbloqueig facial"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Permet que l\'aplicació faci servir el maquinari de desbloqueig facial per a l\'autenticació"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"utilitza el maquinari de Desbloqueig facial"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Permet que l\'aplicació faci servir el maquinari de Desbloqueig facial per a l\'autenticació"</string>
<string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Desbloqueig facial"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Torna a registrar la cara"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Per millorar el reconeixement, torna a registrar la cara"</string>
@@ -648,7 +648,7 @@
<string name="face_error_canceled" msgid="2164434737103802131">"S\'ha cancel·lat el reconeixement facial."</string>
<string name="face_error_user_canceled" msgid="8553045452825849843">"L\'usuari ha cancel·lat el desbloqueig facial."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"Massa intents. Torna-ho a provar més tard."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Massa intents. S\'ha desactivat el desbloqueig facial."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Massa intents. S\'ha desactivat Desbloqueig facial."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"No es pot verificar la cara. Torna-ho a provar."</string>
<string name="face_error_not_enrolled" msgid="7369928733504691611">"No has configurat el desbloqueig facial"</string>
<string name="face_error_hw_not_present" msgid="1070600921591729944">"El desbloqueig facial no és compatible amb el dispositiu."</string>
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Torna-ho a provar"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Torna-ho a provar"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Desbl. per accedir a totes les funcions i dades"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"S\'ha superat el nombre màxim d\'intents de desbloqueig facial"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"S\'ha superat el nombre màxim d\'intents de Desbloqueig facial"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"No hi ha cap SIM"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"No hi ha cap SIM a la tauleta."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"No hi ha cap targeta SIM al dispositiu Android TV."</string>
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index 2c91f8a..432a7c7 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Prøv igen"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Prøv igen"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Lås op for at se alle funktioner og data"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Det maksimale antal forsøg på at bruge Ansigtslås er overskredet"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Det maksimale antal forsøg på at bruge ansigtslås er overskredet"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"Intet SIM-kort"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Der er ikke noget SIM-kort i tabletcomputeren."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Der er intet SIM-kort i din Android TV-enhed."</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"Udvid oplåsningsområdet."</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"Lås op ved at stryge."</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"Lås op med mønster."</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Lås op med ansigt."</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Ansigtslås."</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"Lås op med pinkode."</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"Lås op ved hjælp af pinkoden til SIM-kortet."</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"Lås op ved hjælp af PUK-koden til SIM-kortet."</string>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index f2904e0..bc8dafb 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"Fingerabdruck-Symbol"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"Face Unlock-Hardware verwalten"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"Hardware für Gesichtsentsperrung verwalten"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Ermöglicht der App, Gesichtsvorlagen hinzuzufügen oder zu entfernen."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"Face Unlock-Hardware verwenden"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Ermöglicht der App, zu Authentifizierungszwecken Face Unlock-Hardware zu verwenden"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Face Unlock"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"Hardware für Gesichtsentsperrung verwenden"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Ermöglicht der App, zur Authentifizierung Hardware für Gesichtsentsperrung zu verwenden"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Gesichtsentsperrung"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Gesicht neu scannen lassen"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Für bessere Erkennung Gesicht neu scannen lassen"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"Face Unlock einrichten"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"Gesichtsentsperrung einrichten"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"Entsperre dein Smartphone, indem du es ansiehst"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"Weitere Möglichkeiten zum Entsperren einrichten"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"Tippe, um einen Fingerabdruck hinzuzufügen"</string>
@@ -643,19 +643,19 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"Gesicht nicht erkannt. Hardware nicht verfügbar."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"Face Unlock noch einmal versuchen."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"Gesichtsentsperrung noch einmal versuchen."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"Kein Speicherplatz frei. Bitte erst ein Gesicht löschen."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"Gesichtserkennung abgebrochen."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"Face Unlock vom Nutzer abgebrochen."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"Gesichtsentsperrung vom Nutzer abgebrochen."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"Zu viele Versuche, bitte später noch einmal versuchen"</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Zu viele Versuche. Face Unlock wurde deaktiviert."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Zu viele Versuche. Gesichtsentsperrung wurde deaktiviert."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"Gesichtsprüfung nicht möglich. Noch mal versuchen."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"Face Unlock ist nicht eingerichtet."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"Face Unlock wird auf diesem Gerät nicht unterstützt."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"Gesichtsentsperrung ist nicht eingerichtet."</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"Gesichtsentsperrung wird auf diesem Gerät nicht unterstützt."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"Der Sensor ist vorübergehend deaktiviert."</string>
<string name="face_name_template" msgid="3877037340223318119">"Gesicht <xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"Face Unlock verwenden"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Face Unlock oder Displaysperre verwenden"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"Gesichtsentsperrung verwenden"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Gesichtsentsperrung oder Displaysperre verwenden"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"Gesichtserkennung verwenden, um fortzufahren"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"Verwende die Gesichtserkennung oder deine Display-Entsperrmethode, um fortzufahren"</string>
<string-array name="face_error_vendor">
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Erneut versuchen"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Erneut versuchen"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Entsperren, um alle Funktionen und Daten zu nutzen"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Die maximal zulässige Anzahl an Face Unlock-Versuchen wurde überschritten."</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Die maximal zulässige Anzahl an Versuchen zur Gesichtsentsperrung wurde überschritten."</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"Keine SIM-Karte"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Keine SIM-Karte im Tablet"</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Keine SIM-Karte in deinem Android TV-Gerät."</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"Entsperr-Bereich maximieren"</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"Entsperrung mit Fingerbewegung"</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"Entsperrung mit Muster"</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Face Unlock"</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Gesichtsentsperrung"</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"Entsperrung mit PIN"</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"SIM durch PIN-Eingabe entsperren."</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"SIM durch PUK-Eingabe entsperren."</string>
diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml
index 2ed6cda..d3715d3 100644
--- a/core/res/res/values-el/strings.xml
+++ b/core/res/res/values-el/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"Εικονίδιο δακτυλικών αποτυπωμάτων"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"διαχείριση εξοπλισμού Face Unlock"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"διαχείριση εξοπλισμού για ξεκλείδωμα με το πρόσωπο"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Επιτρέπει στην εφαρμογή να επικαλείται μεθόδους προσθήκης/διαγραφής προτύπων για χρήση."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"χρήση εξοπλισμού Face Unlock"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Επιτρέπει στην εφαρμογή να χρησιμοποιεί εξοπλισμό Face Unlock για έλεγχο ταυτότητας"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Face Unlock"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"χρήση εξοπλισμού για ξεκλείδωμα με το πρόσωπο"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Επιτρέπει στην εφαρμογή έλεγχο ταυτότητας με χρήση εξοπλισμού για ξεκλείδωμα με το πρόσωπο"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Ξεκλείδωμα με το πρόσωπο"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Εγγράψτε ξανά το πρόσωπό σας"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Για να βελτιώσετε την αναγνώριση, εγγράψτε ξανά το πρόσωπό σας"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"Ρυθμίστε το Face Unlock"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"Ρυθμίστε το ξεκλείδωμα με το πρόσωπο"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"Ξεκλειδώστε το τηλέφωνό σας απλώς κοιτώντας το"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"Ρυθμίστε περισσότερους τρόπους ξεκλειδώματος"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"Πατήστε για να προσθέσετε δακτυλικό αποτύπωμα"</string>
@@ -643,18 +643,18 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"Αδύν. επαλήθ. προσώπου. Μη διαθέσιμος εξοπλισμός."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"Δοκιμάστε ξανά το Face Unlock."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"Δοκιμάστε ξανά για ξεκλείδωμα με το πρόσωπο."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"Η αποθήκ. νέων δεδομ. προσώπ. είναι αδύν. Διαγρ. ένα παλιό."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"Η ενέργεια προσώπου ακυρώθηκε."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"Το Face Unlock ακυρώθηκε από τον χρήστη."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"Το ξεκλείδωμα με το πρόσωπο ακυρώθηκε από τον χρήστη."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"Πάρα πολλές προσπάθειες. Δοκιμάστε ξανά αργότερα."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Υπερβολικά πολλές προσπάθειες. Το Face Unlock απενεργοποιήθηκε."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Υπερβολικά πολλές προσπάθειες. Το ξεκλείδωμα με το πρόσωπο απενεργοποιήθηκε."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"Αδύνατη επαλήθευση του προσώπου. Επανάληψη."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"Δεν έχετε ρυθμίσει το Face Unlock."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"Το Face Unlock δεν υποστηρίζεται σε αυτήν τη συσκευή."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"Δεν έχετε ρυθμίσει το ξεκλείδωμα με το πρόσωπο."</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"Το Ξεκλείδωμα με το πρόσωπο δεν υποστηρίζεται σε αυτήν τη συσκευή."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"Ο αισθητήρας απενεργοποιήθηκε προσωρινά."</string>
<string name="face_name_template" msgid="3877037340223318119">"Πρόσωπο <xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"Χρήση Face Unlock"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"Χρήση ξεκλειδώματος με το πρόσωπο"</string>
<string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Χρήση προσώπου ή κλειδώματος οθόνης"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"Χρησιμοποιήστε το πρόσωπό σας για να συνεχίσετε"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"Χρησιμοποιήστε το πρόσωπό σας ή το κλείδωμα οθόνης για συνέχεια"</string>
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Προσπαθήστε ξανά"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Προσπαθήστε ξανά"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Ξεκλείδωμα για όλες τις λειτουργίες και δεδομένα"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Έγινε υπέρβαση του μέγιστου αριθμού προσπαθειών Face Unlock"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Έγινε υπέρβαση του μέγιστου αριθμού προσπαθειών για Ξεκλείδωμα με το πρόσωπο"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"Δεν υπάρχει κάρτα SIM"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Δεν υπάρχει κάρτα SIM στο tablet."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Δεν υπάρχει κάρτα SIM στη συσκευή σας Android TV."</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"Ανάπτυξη περιοχής ξεκλειδώματος."</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"Ξεκλείδωμα ολίσθησης."</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"Ξεκλείδωμα μοτίβου."</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Face unlock."</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Ξεκλείδωμα με το πρόσωπο."</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"Ξεκλείδωμα κωδικού ασφαλείας"</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"Ξεκλείδωμα αριθμού PIN κάρτας SIM."</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"Ξεκλείδωμα αριθμού PUK κάρτας SIM."</string>
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index 624a678..15b1ec8 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -655,7 +655,7 @@
<string name="face_error_security_update_required" msgid="5076017208528750161">"Se inhabilitó temporalmente el sensor."</string>
<string name="face_name_template" msgid="3877037340223318119">"Rostro <xliff:g id="FACEID">%d</xliff:g>"</string>
<string name="face_app_setting_name" msgid="8130135875458467243">"Usar desbloqueo facial"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Usar bloqueo facial o de pantalla"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Usar desbloqueo facial o de pantalla"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"Usa el rostro para continuar"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"Usa tu rostro o bloqueo de pantalla para continuar"</string>
<string-array name="face_error_vendor">
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index 8b1e889..5b147b4 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"Icono de huella digital"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"gestionar el hardware de desbloqueo facial"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"gestionar el hardware de Desbloqueo facial"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Permite que la app use métodos para añadir y suprimir plantillas de caras para su uso."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"Utilizar hardware de desbloqueo facial"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Permite que la aplicación utilice el hardware de desbloqueo facial para autenticarte"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"utilizar hardware de Desbloqueo facial"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Permite que la aplicación utilice el hardware de Desbloqueo facial para autenticarte"</string>
<string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Desbloqueo facial"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Volver a registrar la cara"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Para mejorar el reconocimiento, vuelve a registrar tu cara"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"Configura el desbloqueo facial"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"Configura Desbloqueo facial"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"Desbloquea el teléfono con solo mirarlo"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"Configura más formas de desbloqueo"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"Toca para añadir una huella digital"</string>
@@ -643,19 +643,19 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"No se puede verificar. Hardware no disponible."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"Vuelve a probar el desbloqueo facial."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"Vuelve a probar Desbloqueo facial."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"Para guardar nuevos datos faciales, borra otros antiguos."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"Se ha cancelado el reconocimiento facial."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"El usuario ha cancelado el desbloqueo facial."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"El usuario ha cancelado Desbloqueo facial."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"Demasiados intentos. Inténtalo de nuevo más tarde."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Muchos intentos. Se ha inhabilitado el desbloqueo facial."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Muchos intentos. Se ha inhabilitado Desbloqueo facial."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"No se ha verificado tu cara. Vuelve a intentarlo."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"No has configurado el desbloqueo facial."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"El desbloqueo facial no está disponible en este dispositivo."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"No has configurado Desbloqueo facial."</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"Desbloqueo facial no está disponible en este dispositivo."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"El sensor está inhabilitado en estos momentos."</string>
<string name="face_name_template" msgid="3877037340223318119">"Cara <xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"Usar desbloqueo facial"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Usar desbloqueo facial o bloqueo de pantalla"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"Usar Desbloqueo facial"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Usar Desbloqueo facial o Bloqueo de pantalla"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"Usa tu cara para continuar"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"Usa tu cara o tu bloqueo de pantalla para continuar"</string>
<string-array name="face_error_vendor">
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Vuelve a intentarlo"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Vuelve a intentarlo"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Desbloquear para todos los datos y funciones"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Se ha superado el número máximo de intentos de desbloqueo facial."</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Se ha superado el número máximo de intentos de Desbloqueo facial."</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"Falta la tarjeta SIM."</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"No se ha insertado ninguna tarjeta SIM en el tablet."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"No hay ninguna tarjeta SIM en tu dispositivo Android TV."</string>
diff --git a/core/res/res/values-et/strings.xml b/core/res/res/values-et/strings.xml
index 3d14705..d74cca6 100644
--- a/core/res/res/values-et/strings.xml
+++ b/core/res/res/values-et/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"Sõrmejälje ikoon"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"hallata Face Unlocki riistvara"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"hallata näoga avamise riistvara"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Lubab rakendusel tühistada meetodid kasutatavate näomallide lisamiseks ja kustutamiseks."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"kasutada Face Unlocki riistvara"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Võimaldab rakendusel autentimiseks kasutada Face Unlocki riistvara"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Face Unlock"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"kasutada näoga avamise riistvara"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Võimaldab rakendusel autentimiseks kasutada näoga avamise riistvara"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Näoga avamine"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Registreerige oma nägu uuesti"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Tuvastamise parandamiseks registreerige oma nägu uuesti"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"Seadistage Face Unlock"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"Seadistage näoga avamine"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"Avage telefon seda vaadates"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"Seadistage rohkem viise avamiseks"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"Puudutage sõrmejälje lisamiseks"</string>
@@ -643,19 +643,19 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"Nägu ei saa kinnitada. Riistvara pole saadaval."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"Proovige Face Unlocki uuesti."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"Proovige näoga avamist uuesti."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"Uue näo andmeid ei saa salvestada. Kustutage enne vanad."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"Näotuvastuse toiming tühistati."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"Kasutaja tühistas Face Unlocki."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"Kasutaja tühistas näoga avamise."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"Liiga palju katseid. Proovige hiljem uuesti."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Liiga palju katseid. Face Unlock on keelatud."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Liiga palju katseid. Näoga avamine on keelatud."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"Nägu ei saa kinnitada. Proovige uuesti."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"Face Unlocki ei ole seadistatud."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"Seade ei toeta Face Unlocki."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"Näoga avamine ei ole seadistatud."</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"Seade ei toeta näoga avamist."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"Andur on ajutiselt keelatud."</string>
<string name="face_name_template" msgid="3877037340223318119">"Nägu <xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"Face Unlocki kasutamine"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Face Unlocki või ekraaniluku kasutamine"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"Näoga avamise kasutamine"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Näoga avamise või ekraaniluku kasutamine"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"Jätkamiseks kasutage oma nägu"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"Jätkamiseks kasutage oma nägu või ekraanilukku"</string>
<string-array name="face_error_vendor">
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Proovige uuesti"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Proovige uuesti"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Ava kõigi funktsioonide ja andmete nägemiseks"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Maksimaalne teenusega Face Unlock avamise katsete arv on ületatud"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Maksimaalne näoga avamise katsete arv on ületatud"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"SIM-kaarti pole"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Tahvelarvutis pole SIM-kaarti."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Teie Android TV seadmes pole SIM-kaarti."</string>
diff --git a/core/res/res/values-eu/strings.xml b/core/res/res/values-eu/strings.xml
index a9e6c54..06e73b1 100644
--- a/core/res/res/values-eu/strings.xml
+++ b/core/res/res/values-eu/strings.xml
@@ -42,7 +42,7 @@
<string name="serviceErased" msgid="997354043770513494">"Behar bezala ezabatu da."</string>
<string name="passwordIncorrect" msgid="917087532676155877">"Pasahitz okerra."</string>
<string name="mmiComplete" msgid="6341884570892520140">"MMI osatu da."</string>
- <string name="badPin" msgid="888372071306274355">"Idatzi duzun PIN kode zaharra ez da zuzena."</string>
+ <string name="badPin" msgid="888372071306274355">"Idatzi duzun PIN zaharra ez da zuzena."</string>
<string name="badPuk" msgid="4232069163733147376">"Idatzi duzun PUK kode zaharra ez da zuzena. Saiatu berriro."</string>
<string name="mismatchPin" msgid="2929611853228707473">"Idatzi dituzun PIN kodeak ez datoz bat."</string>
<string name="invalidPin" msgid="7542498253319440408">"Idatzi 4 eta 8 zenbaki bitarteko PIN bat."</string>
diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml
index 4116187..5655d10 100644
--- a/core/res/res/values-fi/strings.xml
+++ b/core/res/res/values-fi/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"Sormenjälkikuvake"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"hallinnoida Face Unlock ‑laitteistoa"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"hallinnoida kasvojentunnistusavauksen laitteistoa"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Sallii sovelluksen käyttää menetelmiä, joilla voidaan lisätä tai poistaa kasvomalleja."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"käyttää Face Unlock ‑laitteistoa"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Sallii sovelluksen käyttää Face Unlock ‑laitteistoa todennukseen"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Face Unlock"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"käyttää kasvojentunnistusavauksen laitteistoa"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Sallii sovelluksen käyttää kasvojentunnistusavauksen laitteistoa todennukseen"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Kasvojentunnistusavaus"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Lisää kasvot uudelleen"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Lisää kasvosi uudelleen tunnistamisen parantamiseksi"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"Ota Face Unlock käyttöön"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"Ota kasvojentunnistusavaus käyttöön"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"Avaa puhelimesi lukitus katsomalla laitetta"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"Ota käyttöön lisää tapoja avata lukitus"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"Napauta lisätäksesi sormenjälki"</string>
@@ -643,19 +643,19 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"Kasvoja ei voi vahvistaa. Laitteisto ei käytettäv."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"Yritä käyttää Face Unlockia uudelleen."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"Yritä käyttää kasvojentunnistusavausta uudelleen."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"Uutta kasvodataa ei voi tallentaa. Poista ensin vanhaa."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"Kasvotoiminto peruutettu"</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"Käyttäjä peruutti Face Unlockin."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"Käyttäjä peruutti kasvojentunnistusavauksen."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"Liian monta yritystä. Yritä myöhemmin uudelleen."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Liian monta yritystä. Face Unlock poistettu käytöstä."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Liian monta yritystä. Kasvojentunnistusavaus poistettu käytöstä."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"Kasvoja ei voi vahvistaa. Yritä uudelleen."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"Et ole määrittänyt Face Unlockia."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"Tämä laite ei tue Face Unlockia."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"Et ole määrittänyt kasvojentunnistusavausta."</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"Tämä laite ei tue kasvojentunnistusavausta."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"Tunnistin poistettu väliaikaisesti käytöstä."</string>
<string name="face_name_template" msgid="3877037340223318119">"Kasvot <xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"Käytä Face Unlockia"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Käytä Face Unlockia tai näytön lukitusta"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"Käytä kasvojentunnistusavausta"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Käytä kasvojentunnistusavausta tai näytön lukitusta"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"Jatka kasvojesi avulla"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"Jatka kasvojentunnistuksen tai näytön lukituksen avulla"</string>
<string-array name="face_error_vendor">
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Yritä uudelleen"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Yritä uudelleen"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Käytä kaikkia ominaisuuksia avaamalla lukitus."</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Face Unlock -yrityksiä tehty suurin sallittu määrä."</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Kasvojentunnistusavauksen yrityksiä tehty suurin sallittu määrä."</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"Ei SIM-korttia"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Tablet-laitteessa ei ole SIM-korttia."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Android TV ‑laitteessa ei ole SIM-korttia."</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"Laajenna lukituksen poiston aluetta."</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"Lukituksen poisto liu\'uttamalla."</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"Lukituksen poisto salasanalla."</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Face Unlock"</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Kasvojentunnistusavaus"</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"Lukituksen poisto PIN-koodilla."</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"SIM-kortin PIN-koodin lukituksen avaus"</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"SIM-kortin PUK-koodin lukituksen avaus"</string>
diff --git a/core/res/res/values-fr-rCA/strings.xml b/core/res/res/values-fr-rCA/strings.xml
index b00bce0..ec73dad 100644
--- a/core/res/res/values-fr-rCA/strings.xml
+++ b/core/res/res/values-fr-rCA/strings.xml
@@ -612,7 +612,7 @@
<string name="permlab_manageFace" msgid="4569549381889283282">"gérer le matériel de déverrouillage par reconnaissance faciale"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Permet à l\'appli d\'employer des méthodes d\'aj. et de suppr. de modèles de reconn. visage."</string>
<string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"utiliser le matériel de déverrouillage par reconnaissance faciale"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Permet à l\'appli d\'utiliser du matériel de déverr. par reconn faciale pour l\'authentific."</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Permet à l\'appli d\'utiliser du matériel de déverr. par reconn. faciale pour l\'authentific."</string>
<string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Déverrouillage par reconnaissance faciale"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Inscrivez votre visage à nouveau"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Pour améliorer la reconnaissance, veuillez enregistrer à nouveau votre visage"</string>
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Réessayer"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Réessayer"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Déverr. pour acc. aux autres fonction. et données"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Nombre maximal autorisé de tentatives Face Unlock atteint."</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Nombre maximal atteint de tentatives de déverrouillage par reconnaissance faciale"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"Aucune carte SIM"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Aucune carte SIM n\'est insérée dans la tablette."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Aucune carte SIM ne se trouve dans votre appareil Android TV."</string>
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index bd2362b..22f699a 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"Icône d\'empreinte digitale"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"gérer les composants de Face Unlock"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"gérer le matériel de déverrouillage par authentification faciale"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Autorise l\'appli à invoquer des méthodes pour ajouter et supprimer des modèles de visages."</string>
<string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"utiliser le matériel de déverrouillage par authentification faciale"</string>
<string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Autorise l\'appli à utiliser le matériel de déverrouillage par authentification faciale"</string>
<string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Déverrouillage par authentification faciale"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Enregistrer à nouveau votre visage"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Pour améliorer la reconnaissance, veuillez enregistrer à nouveau votre visage"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"Configurer Face Unlock"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"Configurer le déverrouillage par authentification faciale"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"Déverrouillez votre téléphone en le regardant"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"Configurer d\'autres méthodes de déverrouillage"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"Appuyez pour ajouter une empreinte digitale"</string>
@@ -646,16 +646,16 @@
<string name="face_error_timeout" msgid="522924647742024699">"Réessayez d\'activer le déverrouillage."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"Impossible stocker nouv. visages. Veuillez en supprimer un."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"Opération de reconnaissance faciale annulée."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"Face Unlock annulé par l\'utilisateur."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"Déverrouillage par authentification faciale annulé par l\'utilisateur"</string>
<string name="face_error_lockout" msgid="7864408714994529437">"Trop de tentatives. Réessayez plus tard."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Tentatives trop nombreuses. Désactivation de Face Unlock."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Trop de tentatives. Déverrouillage par authentification faciale désactivé."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"Impossible de valider votre visage. Réessayez."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"Face Unlock n\'est pas configuré."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"Face Unlock n\'est pas compatible avec cet appareil."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"Déverrouillage par authentification faciale non configuré"</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"Déverrouillage par authentification faciale non compatible"</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"Capteur temporairement désactivé."</string>
<string name="face_name_template" msgid="3877037340223318119">"Visage <xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"Utiliser Face Unlock"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Utiliser Face Lock ou le verrouillage de l\'écran"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"Utiliser déverrouillage facial"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Utiliser déverrouillage par authent. faciale ou verrouillage écran"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"Utilisez la reconnaissance faciale pour continuer"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"Utilisez la reconnaissance faciale ou le verrouillage de l\'écran pour continuer"</string>
<string-array name="face_error_vendor">
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Veuillez réessayer."</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Veuillez réessayer."</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Déverr. pour autres fonctionnalités et données"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Nombre maximal autorisé de tentatives Face Unlock atteint."</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Nombre maximal de tentatives de déverrouillage par authentification faciale atteint"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"Pas de carte SIM"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Aucune carte SIM n\'est insérée dans la tablette."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Aucune carte SIM n\'est installée dans votre appareil Android TV."</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"Développer la zone de déverrouillage"</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"Déverrouillage en faisant glisser votre doigt sur l\'écran"</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"Déverrouillage par schéma"</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Déverrouillage par reconnaissance faciale"</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Déverrouillage par authentification faciale"</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"Déverrouillage par code PIN"</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"Déverrouillage de la carte SIM à l\'aide d\'un code."</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"Déverrouillage de la carte SIM à l\'aide d\'une clé PUK."</string>
diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml
index feaccee..422b4fa 100644
--- a/core/res/res/values-hi/strings.xml
+++ b/core/res/res/values-hi/strings.xml
@@ -611,9 +611,9 @@
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"फ़िंगरप्रिंट आइकॉन"</string>
<string name="permlab_manageFace" msgid="4569549381889283282">"\'मालिक का चेहरा पहचानकर अनलॉक\' वाला हार्डवेयर प्रबंधित करें"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"ऐप्लिकेशन को चेहरे के टेम्पलेट इस्तेमाल के तरीके जोड़ने और मिटाने की मंज़ूरी मिलती है."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"\'मालिक का चेहरा पहचानकर अनलॉक\' वाला हार्डवेयर इस्तेमाल करें"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"ऐप्लिकेशन को \'मालिक का चेहरा पहचानकर अनलॉक\' वाले हार्डवेयर के इस्तेमाल की मंज़ूरी देता है"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"मालिक का चेहरा पहचानकर अनलॉक"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"फ़ेस अनलॉक हार्डवेयर इस्तेमाल करें"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"फ़ेस अनलॉक हार्डवेयर के इस्तेमाल की मंज़ूरी देता है"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"फ़ेस अनलॉक"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"अपना चेहरा फिर से दर्ज करें"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"कृपया अपना चेहरा फिर से दर्ज करें ताकि आपको बेहतर तरीके से पहचाना जा सके"</string>
<string name="face_setup_notification_title" msgid="550617822603450009">"फ़ेस अनलॉक की सुविधा सेट अप करें"</string>
@@ -643,7 +643,7 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"चेहरा नहीं पहचान पा रहे. हार्डवेयर उपलब्ध नहीं है."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"\'मालिक का चेहरा पहचानकर अनलॉक\' फिर से आज़माएं."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"फ़ेस अनलॉक की सुविधा फिर से आज़माएं."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"चेहरे का नया डेटा सेव नहीं हो सकता. कोई पुराना डेटा मिटाएं."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"चेहरा पहचानने की कार्रवाई रद्द की गई."</string>
<string name="face_error_user_canceled" msgid="8553045452825849843">"उपयोगकर्ता ने \'मालिक का चेहरा पहचानकर अनलॉक\' रद्द की."</string>
@@ -651,7 +651,7 @@
<string name="face_error_lockout_permanent" msgid="8277853602168960343">"कई बार कोशिश की जा चुकी है. \'मालिक का चेहरा पहचानकर अनलॉक\' बंद है."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"चेहरा नहीं पहचान पा रहे. फिर से कोशिश करें."</string>
<string name="face_error_not_enrolled" msgid="7369928733504691611">"आपने \'मालिक का चेहरा पहचानकर अनलॉक\' सेट नहीं की है."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"इस डिवाइस पर \'मालिक का चेहरा पहचानकर अनलॉक\' काम नहीं करती है."</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"इस डिवाइस पर फ़ेस अनलॉक की सुविधा काम नहीं करती है."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"सेंसर कुछ समय के लिए बंद कर दिया गया है."</string>
<string name="face_name_template" msgid="3877037340223318119">"चेहरा <xliff:g id="FACEID">%d</xliff:g>"</string>
<string name="face_app_setting_name" msgid="8130135875458467243">"\'फ़ेस अनलॉक\' इस्तेमाल करें"</string>
diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml
index 490cb6e..acccfa9 100644
--- a/core/res/res/values-hr/strings.xml
+++ b/core/res/res/values-hr/strings.xml
@@ -658,7 +658,7 @@
<string name="face_error_security_update_required" msgid="5076017208528750161">"Senzor je privremeno onemogućen."</string>
<string name="face_name_template" msgid="3877037340223318119">"Lice <xliff:g id="FACEID">%d</xliff:g>"</string>
<string name="face_app_setting_name" msgid="8130135875458467243">"Upotreba otključavanja licem"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Upotreba lica ili zaključavanja zaslona"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Upotreba otključavanja licem ili zaključavanja zaslona"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"Autentificirajte se licem da biste nastavili"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"Za nastavak se identificirajte licem ili vjerodajnicom zaključavanja zaslona"</string>
<string-array name="face_error_vendor">
@@ -890,7 +890,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Pokušajte ponovo"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Pokušajte ponovo"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Otključajte za sve značajke i podatke"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Premašen je maksimalni broj Otključavanja licem"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Premašen je maksimalni broj pokušaja otključavanja licem"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"Nema SIM kartice"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"U tabletnom uređaju nema SIM kartice."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Na Android TV uređaju nema SIM kartice."</string>
diff --git a/core/res/res/values-hy/strings.xml b/core/res/res/values-hy/strings.xml
index 894c099..fe6be14 100644
--- a/core/res/res/values-hy/strings.xml
+++ b/core/res/res/values-hy/strings.xml
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Կրկին փորձեք"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Կրկին փորձեք"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Ապակողպեք՝ բոլոր գործառույթներն ու տվյալներն օգտագործելու համար"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Առավելագույն Դեմքով ապակողպման փորձերը գերազանցված են"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Դեմքով ապակողպման փորձերի առավելագույն քանակը գերազանցված են"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"SIM քարտ չկա"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Գրասալիկում SIM քարտ չկա:"</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Ձեր Android սարքում SIM քարտ չկա։"</string>
diff --git a/core/res/res/values-is/strings.xml b/core/res/res/values-is/strings.xml
index e8f807b..2d28175 100644
--- a/core/res/res/values-is/strings.xml
+++ b/core/res/res/values-is/strings.xml
@@ -612,7 +612,7 @@
<string name="permlab_manageFace" msgid="4569549381889283282">"stjórna vélbúnaði andlitsopnunar"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Leyfir forritinu að beita aðferðum til að bæta við og eyða andlitssniðmátum til notkunar."</string>
<string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"nota vélbúnað andlitsopnunar"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Leyfir forritinu að nota andlitsopnunarvélbúnað til auðkenningar"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Leyfir forritinu að nota vélbúnað andlitsopnunar til auðkenningar"</string>
<string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Andlitsopnun"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Skráðu andlitið þitt aftur"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Skráðu andlitið þitt til að bæta kennsl"</string>
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Reyndu aftur"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Reyndu aftur"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Taktu úr lás til að sjá alla eiginleika og gögn"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Hámarksfjölda tilrauna til að opna með andliti náð"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Hámarksfjölda tilrauna til andlitsopnunar náð"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"Ekkert SIM-kort"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Ekkert SIM-kort í spjaldtölvunni."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Ekkert SIM-kort er í Android TV tækinu."</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"Stækka opnunarsvæði."</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"Opnun með stroku."</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"Opnun með mynstri."</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Opnun með andliti."</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Andlitsopnun."</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"Opnun með PIN-númeri."</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"Taka PIN-númer SIM-korts úr lás."</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"Taka PUK-númer SIM-korts úr lás."</string>
diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml
index c4697ba..116b2082 100644
--- a/core/res/res/values-it/strings.xml
+++ b/core/res/res/values-it/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"Icona dell\'impronta"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"gestione dell\'hardware per Sblocco con il volto"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"gestione dell\'hardware per lo sblocco con il volto"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Consente all\'app di richiamare i metodi per aggiungere e rimuovere i modelli di volti."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"utilizzo dell\'hardware per Sblocco con il volto"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Consente all\'app di utilizzare hardware per l\'autenticazione con Sblocco con il volto"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"utilizzo dell\'hardware per lo sblocco con il volto"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Consente all\'app di usare hardware per l\'autenticazione mediante lo sblocco con il volto"</string>
<string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Sblocco con il volto"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Registra di nuovo il volto"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Per migliorare il riconoscimento, registra di nuovo il tuo volto"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"Configura Sblocco con il volto"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"Configura lo sblocco con il volto"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"Sblocca il telefono guardandolo"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"Configura altri modi per sbloccare"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"Tocca per aggiungere un\'impronta"</string>
@@ -643,19 +643,19 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"Imposs. verificare volto. Hardware non disponibile."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"Riprova Sblocco con il volto."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"Riprova lo sblocco con il volto."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"Imposs. salvare dati nuovi volti. Elimina un volto vecchio."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"Operazione associata al volto annullata."</string>
<string name="face_error_user_canceled" msgid="8553045452825849843">"Sblocco con il volto annullato dall\'utente."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"Troppi tentativi. Riprova più tardi."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Troppi tentativi. Sblocco con il volto disattivato"</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Troppi tentativi. Lo sblocco con il volto è disattivato."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"Impossibile verificare il volto. Riprova."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"Non hai configurato Sblocco con il volto."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"Non hai configurato lo sblocco con il volto."</string>
<string name="face_error_hw_not_present" msgid="1070600921591729944">"Sblocco con il volto non supportato su questo dispositivo."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"Sensore temporaneamente disattivato."</string>
<string name="face_name_template" msgid="3877037340223318119">"Volto <xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"Usa Sblocco con il volto"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Usa Sblocco con il volto o il blocco schermo"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"Usa lo sblocco con il volto"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Usa lo sblocco con il volto o il blocco schermo"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"Usa il tuo volto per continuare"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"Per continuare devi usare il tuo volto o il tuo blocco schermo"</string>
<string-array name="face_error_vendor">
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Riprova"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Riprova"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Sblocca per accedere a funzioni e dati"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Numero massimo di tentativi di Sblocco con il volto superato"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Numero massimo di tentativi di sblocco con il volto superato"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"Nessuna SIM"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Nessuna scheda SIM presente nel tablet."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Nessuna scheda SIM nel dispositivo Android TV."</string>
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index 55e90bc..b43fb55 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -615,14 +615,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"סמל טביעת אצבע"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"ניהול החומרה לשחרור נעילה על ידי זיהוי פנים"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"ניהול החומרה לפתיחה ע\"י זיהוי הפנים"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"מאפשרת לאפליקציה להפעיל שיטות להוספה ומחיקה של תבניות פנים שבהן ייעשה שימוש."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"שימוש בחומרה לשחרור נעילה על ידי זיהוי פנים"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"מאפשרת לאפליקציה להשתמש בחומרה לשחרור נעילה על ידי זיהוי פנים לצורך אימות"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"שחרור נעילה על ידי זיהוי פנים"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"שימוש בחומרה לפתיחה ע\"י זיהוי הפנים"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"מאפשרת לאפליקציה להשתמש בחומרה לפתיחה ע\"י זיהוי הפנים"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"פתיחה ע\"י זיהוי הפנים"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"יש לבצע סריקה חוזרת של הפנים שלך"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"לשיפור הזיהוי יש לסרוק מחדש את הפנים שלך"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"הגדרת שחרור נעילה על ידי זיהוי פנים"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"הגדרה של פתיחה ע\"י זיהוי הפנים"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"יש להביט בטלפון כדי לבטל את נעילתו"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"אפשר להגדיר דרכים נוספות לביטול נעילה"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"יש להקיש כדי להוסיף טביעת אצבע"</string>
@@ -649,18 +649,18 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"לא ניתן לאמת את הפנים. החומרה לא זמינה."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"יש לנסות שוב את שחרור הנעילה על ידי זיהוי פנים."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"יש לנסות שוב את הפתיחה ע\"י זיהוי הפנים."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"לא ניתן לאחסן נתוני פנים חדשים. תחילה יש למחוק את הנתונים הישנים."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"הפעולה לאימות הפנים בוטלה."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"שחרור הנעילה על ידי זיהוי פנים בוטל על ידי המשתמש."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"פתיחה ע\"י זיהוי הפנים בוטל על ידי המשתמש."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"יותר מדי ניסיונות. יש לנסות שוב מאוחר יותר."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"יותר מדי ניסיונות. שחרור נעילה על ידי זיהוי פנים מושבת."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"יותר מדי ניסיונות. \'פתיחה ע\"י זיהוי הפנים\' מושבת."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"לא ניתן לאמת את הפנים. יש לנסות שוב."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"לא הגדרת שחרור נעילה על ידי זיהוי פנים."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"המכשיר הזה לא תומך בשחרור נעילה על ידי זיהוי פנים."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"לא הגדרת פתיחה ע\"י זיהוי הפנים."</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"המכשיר הזה לא תומך בפתיחה ע\"י זיהוי הפנים."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"החיישן מושבת באופן זמני."</string>
<string name="face_name_template" msgid="3877037340223318119">"פנים <xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"שחרור נעילה על ידי זיהוי פנים"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"פתיחה ע\"י זיהוי הפנים"</string>
<string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"שימוש בזיהוי פנים או בנעילת מסך"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"יש להשתמש באימות פנים כדי להמשיך"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"יש להשתמש בזיהוי הפנים או בנעילת המסך כדי להמשיך"</string>
@@ -893,7 +893,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"כדאי לנסות שוב"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"כדאי לנסות שוב"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"צריך לבטל את הנעילה כדי שכל התכונות והנתונים יהיו זמינים"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"חרגת ממספר הניסיונות המרבי לשחרור נעילה על ידי זיהוי פנים"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"חרגת ממספר הניסיונות המרבי לפתיחה ע\"י זיהוי הפנים"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"אין כרטיס SIM"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"אין כרטיס SIM בטאבלט."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"אין כרטיס SIM במכשיר ה-Android TV."</string>
@@ -963,7 +963,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"הרחבה של אזור ביטול הנעילה."</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"ביטול נעילה באמצעות הסטה."</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"ביטול נעילה על ידי שרטוט קו."</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"שחרור נעילה על ידי זיהוי פנים."</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"פתיחה ע\"י זיהוי הפנים."</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"ביטול נעילה באמצעות קוד אימות."</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"ביטול הנעילה של קוד האימות ל-SIM."</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"ביטול נעילה של PUK ל-SIM."</string>
diff --git a/core/res/res/values-ka/strings.xml b/core/res/res/values-ka/strings.xml
index 0cea47a..bdad7f6 100644
--- a/core/res/res/values-ka/strings.xml
+++ b/core/res/res/values-ka/strings.xml
@@ -613,7 +613,7 @@
<string name="permdesc_manageFace" msgid="6204569688492710471">"საშუალებას აძლევს აპს, დაამატოს და წაშალოს სახეების შაბლონები."</string>
<string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"სახით განბლოკვის აპარატურის გამოყენება"</string>
<string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"საშუალებას აძლევს აპს, ამოცნობისთვის გამოიყენოს სახით განბლოკვის აპარატურა"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"განბლოკვა სახით"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"სახით განბლოკვა"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"დაარეგისტრირეთ თქვენი სახე ხელახლა"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"ამოცნობის გასაუმჯობესებლად, გთხოვთ, ხელახლა დაარეგისტრიროთ თქვენი სახე"</string>
<string name="face_setup_notification_title" msgid="550617822603450009">"სახით განბლოკვის დაყენება"</string>
@@ -646,16 +646,16 @@
<string name="face_error_timeout" msgid="522924647742024699">"ცადეთ ხელახლა სახით განბლოკვა."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"სახის ახალი მონაცემები ვერ ინახება. ჯერ ძველი წაშალეთ."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"სახის ამოცნობა გაუქმდა."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"განბლოკვა სახით გაუქმდა მომხმარებლის მიერ."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"სახით განბლოკვა გაუქმდა მომხმარებლის მიერ."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"დაფიქსირდა ბევრი მცდელობა. ცადეთ მოგვიანებით."</string>
<string name="face_error_lockout_permanent" msgid="8277853602168960343">"მეტისმეტად ბევრი მცდელობა იყო. სახით განბლოკვა გათიშულია."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"სახის დადასტურება ვერ ხერხდება. ცადეთ ხელახლა."</string>
<string name="face_error_not_enrolled" msgid="7369928733504691611">"თქვენ არ დაგიყენებიათ სახით განბლოკვა."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"განბლოკვა სახით ამ მოწყობილობაზე მხარდაჭერილი არ არის."</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"სახით განბლოკვა ამ მოწყობილობაზე მხარდაჭერილი არ არის."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"სენსორი დროებით გათიშულია."</string>
<string name="face_name_template" msgid="3877037340223318119">"სახე <xliff:g id="FACEID">%d</xliff:g>"</string>
<string name="face_app_setting_name" msgid="8130135875458467243">"გამოიყენეთ სახით განბლოკვა"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"გამოიყენეთ სახე ან ეკრანის დაბლოკვა"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"გამოიყენეთ სახით ან ეკრანის დაბლოკვა"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"გასაგრძელებლად გამოიყენეთ თქვენი სახე"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"გასაგრძელებლად გამოიყენეთ თქვენი სახე ან ეკრანის განბლოკვის ნიმუში"</string>
<string-array name="face_error_vendor">
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"კიდევ სცადეთ"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"კიდევ სცადეთ"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"ყველა ფუნქციისა და მონაცემის განბლოკვა"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"სახის ამოცნობით განბლოკვის მცდელობამ დაშვებულ რაოდენობას გადააჭარბა"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"სახით განბლოკვის მცდელობამ დაშვებულ რაოდენობას გადააჭარბა"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"SIM ბარათი არ არის"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"ტაბლეტში არ დევს SIM ბარათი."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"თქვენს Android TV მოწყობილობაში SIM ბარათი არ არის."</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"განბლოკვის სივრცის გაშლა."</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"გასრიალებით განბლოკვა"</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"განბლოკვა ნიმუშით."</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"განბლოკვა სახით"</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"სახით განბლოკვა"</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"განბლოკვა Pin-ით."</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"SIM-ის PIN-კოდით განბლოკვა."</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"SIM-ის PUK-კოდით განბლოკვა."</string>
diff --git a/core/res/res/values-kk/strings.xml b/core/res/res/values-kk/strings.xml
index 6938a08..43fc7b1 100644
--- a/core/res/res/values-kk/strings.xml
+++ b/core/res/res/values-kk/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"Саусақ ізі белгішесі"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"Face Unlock жабдығын басқару"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"Бет тану жабдығын басқару"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Қолданбаға пайдаланатын бет үлгілерін енгізу және жою әдістерін шақыруға мүмкіндік береді."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"Face Unlock жабдығын пайдалану"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Аутентификациялау үшін қолданбаға Face Unlock жабдығын пайдалануға рұқсат береді."</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Face Unlock"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"Бет тану жабдығын пайдалану"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Аутентификациялау үшін қолданбаға бет тану жабдығын пайдалануға рұқсат береді."</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Бет тану"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Бетті қайта тіркеу"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Құрылғы жүзіңізді жақсырақ тануы үшін, бетіңізді қайта тіркеңіз."</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"Face Unlock функциясын реттеу"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"Бет тану функциясын реттеу"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"Телефоныңызға қарап, оның құлпын ашыңыз."</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"Құлыпты ашудың басқа тәсілдерін реттеу"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"Саусақ ізін қосу үшін түртіңіз."</string>
@@ -643,18 +643,18 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"Бетті тану мүмкін емес. Жабдық қолжетімді емес."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"Face Unlock функциясын қайта қолданып көріңіз."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"Бет тану функциясын қайта қолданып көріңіз."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"Жаңа бетті сақтау мүмкін емес. Алдымен ескісін жойыңыз."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"Бетті танудан бас тартылды."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"Пайдаланушы Face Unlock функциясынан бас тартты."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"Пайдаланушы бет тану функциясынан бас тартты."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"Тым көп әрекет жасалды. Кейінірек қайталаңыз."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Тым көп әрекет жасалды. Face Unlock функциясы өшірілді."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Тым көп әрекет жасалды. Бет тану функциясы өшірілді."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"Бетті тану мүмкін емес. Әрекетті қайталаңыз."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"Face Unlock реттелмеді."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"Бұл құрылғыда Face Unlock функциясы істемейді."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"Бет тану реттелмеді."</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"Бұл құрылғыда бет тану функциясы істемейді."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"Датчик уақытша өшірулі."</string>
<string name="face_name_template" msgid="3877037340223318119">"<xliff:g id="FACEID">%d</xliff:g> беті"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"Face Unlock функциясын пайдалану"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"Бет тану функциясын пайдалану"</string>
<string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Face Lock функциясын немесе экран құлпын пайдалану"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"Жалғастыру үшін бетіңізді көрсетіңіз."</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"Жалғастыру үшін бетті анықтау функциясын немесе экран құлпын пайдаланыңыз."</string>
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Қайталап көріңіз"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Қайталап көріңіз"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Мүмкіндіктер мен деректер үшін құлыпты ашыңыз"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Бет-әлпет арқылы ашу әрекеттері анықталған шегінен асып кетті"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Бет тану арқылы ашу әрекеттері анықталған шегінен асып кетті"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"SIM картасы жоқ"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Планшетте SIM картасы жоқ."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Android TV құрылғыңызда SIM картасы жоқ."</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"Ашу аймағын кеңейту."</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"Сырғыту арқылы ашу."</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"Кескін арқылы ашу."</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Бет-әлпет арқылы ашу."</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Бет тану."</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"Pin арқылы ашу."</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"SIM құлпын PIN кодымен ашу"</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"SIM құлпын PUK кодымен ашу"</string>
diff --git a/core/res/res/values-km/strings.xml b/core/res/res/values-km/strings.xml
index 69de7d0..b5e5102 100644
--- a/core/res/res/values-km/strings.xml
+++ b/core/res/res/values-km/strings.xml
@@ -613,7 +613,7 @@
<string name="permdesc_manageFace" msgid="6204569688492710471">"អនុញ្ញាតឱ្យកម្មវិធីប្រើវិធីសាស្ត្រដើម្បីបញ្ចូល និងលុបទម្រង់គំរូផ្ទៃមុខសម្រាប់ប្រើប្រាស់។"</string>
<string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"ប្រើហាតវែរដោះសោតាមទម្រង់មុខ"</string>
<string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"អនុញ្ញាតឱ្យកម្មវិធីប្រើហាតវែរដោះសោតាមទម្រង់មុខសម្រាប់ការផ្ទៀងផ្ទាត់"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"ការដោះសោតាមទម្រង់មុខ"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"ដោះសោតាមទម្រង់មុខ"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"ស្កេនបញ្ចូលមុខរបស់អ្នកម្ដងទៀត"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"ដើម្បីធ្វើឱ្យការសម្គាល់មុខប្រសើរជាងមុន សូមស្កេនបញ្ចូលមុខរបស់អ្នកម្ដងទៀត"</string>
<string name="face_setup_notification_title" msgid="550617822603450009">"រៀបចំការដោះសោតាមទម្រង់មុខ"</string>
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index 68468a2c..4c3abec 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"지문 아이콘"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"얼굴인식 잠금해제 하드웨어 관리"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"얼굴 인식 잠금 해제 하드웨어 관리"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"사용할 얼굴 템플릿의 추가 및 삭제 메서드를 앱에서 호출하도록 허용합니다."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"얼굴인식 잠금해제 하드웨어 사용"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"앱에서 얼굴인식 잠금해제 하드웨어를 인증에 사용하도록 허용합니다."</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"얼굴인식 잠금해제"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"얼굴 인식 잠금 해제 하드웨어 사용"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"앱에서 얼굴 인식 잠금 해제 하드웨어를 인증에 사용하도록 허용합니다."</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"얼굴 인식 잠금 해제"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"얼굴 재등록 필요"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"인식률을 개선하려면 얼굴을 다시 등록하세요."</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"얼굴인식 잠금해제 설정"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"얼굴 인식 잠금 해제 설정"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"휴대전화의 화면을 응시하여 잠금 해제할 수 있습니다."</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"다른 잠금 해제 방법 설정"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"지문을 추가하려면 탭하세요."</string>
@@ -643,18 +643,18 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"얼굴을 확인할 수 없습니다. 하드웨어를 사용할 수 없습니다."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"얼굴인식 잠금해제를 다시 시도해 주세요."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"얼굴 인식 잠금 해제를 다시 시도해 주세요."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"새 얼굴 데이터를 저장할 수 없습니다. 먼저 기존 얼굴 데이터를 삭제하세요."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"얼굴 인식 작업이 취소되었습니다."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"사용자가 얼굴인식 잠금해제를 취소했습니다."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"사용자가 얼굴 인식 잠금 해제를 취소했습니다."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"시도 횟수가 너무 많습니다. 나중에 다시 시도하세요."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"시도 횟수가 너무 많습니다. 얼굴인식 잠금해제가 사용 중지되었습니다."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"시도 횟수가 너무 많습니다. 얼굴 인식 잠금 해제가 사용 중지되었습니다."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"얼굴을 확인할 수 없습니다. 다시 시도하세요."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"얼굴인식 잠금해제를 설정하지 않았습니다."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"이 기기에서는 얼굴인식 잠금해제가 지원되지 않습니다."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"얼굴 인식 잠금 해제를 설정하지 않았습니다."</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"이 기기에서는 얼굴 인식 잠금 해제가 지원되지 않습니다."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"센서가 일시적으로 사용 중지되었습니다."</string>
<string name="face_name_template" msgid="3877037340223318119">"얼굴 <xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"얼굴인식 잠금해제 사용"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"얼굴 인식 잠금 해제 사용"</string>
<string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"얼굴 또는 화면 잠금 사용"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"계속하려면 얼굴로 인증하세요"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"계속하려면 얼굴 또는 화면 잠금을 사용하세요"</string>
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"다시 시도"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"다시 시도"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"모든 기능 및 데이터 잠금 해제"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"얼굴 인식 잠금해제 최대 시도 횟수를 초과했습니다."</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"얼굴 인식 잠금 해제 최대 시도 횟수를 초과했습니다."</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"SIM 카드가 없습니다."</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"태블릿에 SIM 카드가 없습니다."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Android TV 기기에 SIM 카드가 없습니다."</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"잠금 해제 영역 확장"</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"슬라이드하여 잠금해제합니다."</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"패턴을 사용하여 잠금해제합니다."</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"얼굴 인식을 사용하여 잠금해제합니다."</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"얼굴을 인식하여 잠금 해제합니다."</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"핀을 사용하여 잠금해제합니다."</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"SIM PIN 잠금 해제"</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"SIM PUK 잠금 해제"</string>
diff --git a/core/res/res/values-lo/strings.xml b/core/res/res/values-lo/strings.xml
index 327faf9..d8c0ef1 100644
--- a/core/res/res/values-lo/strings.xml
+++ b/core/res/res/values-lo/strings.xml
@@ -611,7 +611,7 @@
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"ໄອຄອນລາຍນິ້ວມື"</string>
<string name="permlab_manageFace" msgid="4569549381889283282">"ຈັດການຮາດແວປົດລັອກດ້ວຍໜ້າ"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"ອະນຸຍາດໃຫ້ແອັບເປີດວິທີການຕ່າງໆເພື່ອເພີ່ມ ແລະ ລຶບແມ່ແບບໃບໜ້າສຳລັບການນຳໃຊ້."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"ໃຊ້ຮາດແວການປົດລັອກໃບໜ້າ"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"ໃຊ້ຮາດແວການປົດລັອກດ້ວຍໜ້າ"</string>
<string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"ອະນຸຍາດໃຫ້ແອັບໃຊ້ຮາດແວການປົດລັອກດ້ວຍໜ້າເພື່ອພິສູດຢືນຢັນ"</string>
<string name="face_recalibrate_notification_name" msgid="6006095897989257026">"ປົດລັອກດ້ວຍໜ້າ"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"ລົງທະບຽນໃບໜ້າຂອງທ່ານຄືນໃໝ່"</string>
diff --git a/core/res/res/values-mk/strings.xml b/core/res/res/values-mk/strings.xml
index dfa2aab..41ce969 100644
--- a/core/res/res/values-mk/strings.xml
+++ b/core/res/res/values-mk/strings.xml
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Обидете се повторно"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Обидете се повторно"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Отклучи за сите функции и податоци"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Максималниот број обиди на отклучување со лице е надминат"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Максималниот број обиди на отклучување со лик е надминат"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"Нема SIM картичка"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Во таблетот нема SIM картичка."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Нема SIM-картичка во вашиот уред Android TV."</string>
diff --git a/core/res/res/values-ml/strings.xml b/core/res/res/values-ml/strings.xml
index b66923c..715cd8d 100644
--- a/core/res/res/values-ml/strings.xml
+++ b/core/res/res/values-ml/strings.xml
@@ -611,12 +611,12 @@
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"ഫിംഗർപ്രിന്റ് ഐക്കൺ"</string>
<string name="permlab_manageFace" msgid="4569549381889283282">"മുഖം തിരിച്ചറിഞ്ഞുള്ള അൺലോക്ക് ഹാർഡ്വെയർ മാനേജ് ചെയ്യുക"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"ഉപയോഗിക്കാനായി, മുഖത്തിന്റെ ടെംപ്ലേറ്റുകൾ ചേർക്കാനും ഇല്ലാതാക്കാനുമുള്ള രീതികൾ അഭ്യർത്ഥിക്കാൻ ആപ്പിനെ അനുവദിക്കുന്നു."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"മുഖം തിരിച്ചറിഞ്ഞുള്ള അൺലോക്ക് ഹാർഡ്വെയർ ഉപയോഗിക്കുക"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"പരിശോധിച്ചുറപ്പിക്കാൻ മുഖം തിരിച്ചറിഞ്ഞുള്ള അൺലോക്ക് ഹാർഡ്വെയർ ഉപയോഗിക്കാൻ അനുവദിക്കുന്നു"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"മുഖം തിരിച്ചറിഞ്ഞുള്ള അൺലോക്ക്"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"ഫെയ്സ് അൺലോക്ക് ഹാർഡ്വെയർ ഉപയോഗിക്കുക"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"പരിശോധിച്ചുറപ്പിക്കാൻ ഫെയ്സ് അൺലോക്ക് ഹാർഡ്വെയർ ഉപയോഗിക്കാൻ അനുവദിക്കുന്നു"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"ഫെയ്സ് അൺലോക്ക്"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"നിങ്ങളുടെ മുഖം വീണ്ടും എൻറോൾ ചെയ്യൂ"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"തിരിച്ചറിയൽ മെച്ചപ്പെടുത്താൻ, നിങ്ങളുടെ മുഖം ദയവായി വീണ്ടും എൻറോൾ ചെയ്യൂ"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"മുഖം തിരിച്ചറിഞ്ഞുള്ള അൺലോക്ക് സജ്ജീകരിക്കുക"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"ഫെയ്സ് അൺലോക്ക് സജ്ജീകരിക്കുക"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"ഫോണിലേക്ക് നോക്കി അത് അൺലോക്ക് ചെയ്യുക"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"അൺലോക്ക് ചെയ്യുന്നതിനുള്ള കൂടുതൽ വഴികൾ സജ്ജീകരിക്കുക"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"ഫിംഗർപ്രിന്റ് ചേർക്കാൻ ടാപ്പ് ചെയ്യുക"</string>
@@ -643,19 +643,19 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"മുഖം പരിശോധിക്കാൻ കഴിയില്ല. ഹാർഡ്വെയർ ലഭ്യമല്ല."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"മുഖം തിരിച്ചറിഞ്ഞുള്ള അൺലോക്ക് വീണ്ടും പരീക്ഷിക്കൂ"</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"ഫെയ്സ് അൺലോക്ക് വീണ്ടും പരീക്ഷിക്കൂ"</string>
<string name="face_error_no_space" msgid="5649264057026021723">"പുതിയ മുഖ ഡാറ്റ സംഭരിക്കാനാകില്ല. ആദ്യം പഴയത് ഇല്ലാതാക്കുക."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"മുഖത്തിന്റെ പ്രവർത്തനം റദ്ദാക്കി."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"ഉപയോക്താവ് മുഖം തിരിച്ചറിഞ്ഞുള്ള അൺലോക്ക് റദ്ദാക്കി"</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"ഉപയോക്താവ് ഫെയ്സ് അൺലോക്ക് റദ്ദാക്കി"</string>
<string name="face_error_lockout" msgid="7864408714994529437">"നിരവധി തവണ ശ്രമിച്ചു. പിന്നീട് വീണ്ടും ശ്രമിക്കുക."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"വളരെയധികം ശ്രമങ്ങൾ. മുഖം തിരിച്ചറിഞ്ഞുള്ള അൺലോക്ക് പ്രവർത്തനരഹിതമാക്കി"</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"വളരെയധികം ശ്രമങ്ങൾ. ഫെയ്സ് അൺലോക്ക് പ്രവർത്തനരഹിതമാക്കി"</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"മുഖം പരിശോധിക്കാൻ കഴിയില്ല. വീണ്ടും ശ്രമിക്കൂ."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"മുഖം തിരിച്ചറിഞ്ഞുള്ള അൺലോക്ക് സജ്ജീകരിച്ചില്ല."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"മുഖം തിരിച്ചറിഞ്ഞുള്ള അൺലോക്ക് ഈ ഉപകരണം പിന്തുണയ്ക്കുന്നില്ല."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"ഫെയ്സ് അൺലോക്ക് സജ്ജീകരിച്ചില്ല."</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"ഫെയ്സ് അൺലോക്ക് ഈ ഉപകരണം പിന്തുണയ്ക്കുന്നില്ല."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"സെൻസർ താൽക്കാലികമായി പ്രവർത്തനരഹിതമാക്കി."</string>
<string name="face_name_template" msgid="3877037340223318119">"മുഖം <xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"മുഖം തിരിച്ചറിഞ്ഞുള്ള അൺലോക്ക് ഉപയോഗിക്കുക"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"മുഖം അല്ലെങ്കിൽ സ്ക്രീൻ ലോക്ക് ഉപയോഗിക്കുക"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"ഫെയ്സ് അൺലോക്ക് ഉപയോഗിക്കുക"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"ഫെയ്സ് അല്ലെങ്കിൽ സ്ക്രീൻ ലോക്ക് ഉപയോഗിക്കുക"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"തുടരാൻ നിങ്ങളുടെ മുഖം ഉപയോഗിക്കുക"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"തുടരാൻ നിങ്ങളുടെ മുഖം അല്ലെങ്കിൽ സ്ക്രീൻ ലോക്ക് ഉപയോഗിക്കുക"</string>
<string-array name="face_error_vendor">
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"അൺലോക്ക് ഏരിയ വിപുലീകരിക്കുക."</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"സ്ലൈഡ് അൺലോക്ക്."</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"പാറ്റേൺ അൺലോക്ക്."</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"മുഖം തിരിച്ചറിഞ്ഞുള്ള അൺലോക്ക്."</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"ഫെയ്സ് അൺലോക്ക്."</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"പിൻ അൺലോക്ക്."</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"സിം പിൻ അൺലോക്ക്."</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"സിം Puk അൺലോക്ക്."</string>
diff --git a/core/res/res/values-mr/strings.xml b/core/res/res/values-mr/strings.xml
index aae0c5b..a4c877f 100644
--- a/core/res/res/values-mr/strings.xml
+++ b/core/res/res/values-mr/strings.xml
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"पुन्हा प्रयत्न करा"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"पुन्हा प्रयत्न करा"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"सर्व वैशिष्ट्ये आणि डेटासाठी अनलॉक करा"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"कमाल चेहरा अनलॉक प्रयत्न ओलांडले"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"कमाल फेस अनलॉक प्रयत्न ओलांडले"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"सिम कार्ड नाही"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"टॅब्लेटमध्ये सिम कार्ड नाही."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"तुमच्या Android TV डिव्हाइसमध्ये सिम कार्ड नाही."</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"अनलॉक क्षेत्र विस्तृत करा."</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"स्लाइड अनलॉक."</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"पॅटर्न अनलॉक."</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"चेहरा अनलॉक."</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"फेस अनलॉक."</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"पिन अनलॉक."</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"सिम पिन अनलॉक करा"</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"सिम PUK अनलॉक करा"</string>
diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml
index 27647ad..a95b077 100644
--- a/core/res/res/values-ms/strings.xml
+++ b/core/res/res/values-ms/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"Ikon cap jari"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"urus perkakasan wajah buka kunci"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"urus perkakasan buka kunci wajah"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Membenarkan apl menggunakan kaedah untuk menambahkan dan memadamkan templat wajah untuk digunakan."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"gunakan perkakasan wajah buka kunci"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Membenarkan apl menggunakan perkakasan wajah buka kunci untuk pengesahan"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Wajah buka kunci"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"gunakan perkakasan buka kunci wajah"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Membenarkan apl menggunakan perkakasan buka kunci wajah untuk pengesahan"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Buka kunci wajah"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Daftarkan semula wajah anda"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Untuk meningkatkan pengecaman, sila daftarkan semula wajah anda"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"Sediakan wajah buka kunci"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"Sediakan buka kunci wajah"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"Buka kunci telefon anda dengan melihat telefon anda"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"Sediakan lebih banyak cara untuk membuka kunci"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"Ketik untuk menambahkan cap jari"</string>
@@ -643,18 +643,18 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"Tdk dpt sahkan wajah. Perkakasan tidak tersedia."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"Cuba wajah buka kunci sekali lagi."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"Cuba buka kunci wajah sekali lagi."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"Tdk dpt menyimpan data wajah baharu. Padamkan yg lama dahulu."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"Pengendalian wajah dibatalkan."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"Wajah buka kunci dibatalkan oleh pengguna."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"Buka kunci wajah dibatalkan oleh pengguna."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"Terlalu banyak percubaan. Cuba sebentar lagi."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Terlalu banyak percubaan. Wajah buka kunci dilumpuhkan."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Terlalu banyak percubaan. Buka kunci wajah dilumpuhkan."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"Tidak dapat mengesahkan wajah. Cuba lagi."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"Anda belum menyediakan wajah buka kunci."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"Wajah buka kunci tidak disokong pada peranti ini."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"Anda belum menyediakan buka kunci wajah."</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"Buka kunci wajah tidak disokong pada peranti ini."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"Penderia dilumpuhkan sementara."</string>
<string name="face_name_template" msgid="3877037340223318119">"Wajah <xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"Gunakan wajah buka kunci"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"Gunakan buka kunci wajah"</string>
<string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Gunakan kunci wajah atau skrin"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"Gunakan wajah untuk teruskan"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"Gunakan wajah atau kunci skrin anda untuk meneruskan"</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"Kembangkan bahagian buka kunci."</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"Buka kunci luncur."</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"Buka kunci corak."</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Wajah Buka Kunci"</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Buka Kunci Wajah"</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"Buka kunci pin."</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"Buka kunci Pin Sim."</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"Buka kunci Puk Sim."</string>
diff --git a/core/res/res/values-ne/strings.xml b/core/res/res/values-ne/strings.xml
index a0fd8cb..d94224a 100644
--- a/core/res/res/values-ne/strings.xml
+++ b/core/res/res/values-ne/strings.xml
@@ -476,8 +476,8 @@
<string name="permdesc_callCompanionApp" msgid="8474168926184156261">"एपलाई डिभाइसमा जारी रहेका कलहरू हेर्नुका साथै तिनीहरूलाई गर्ने अनुमति दिनुहोस्। यसमा गरिएका कलहरूको सङ्ख्या र कलहरूको अवस्था जस्ता जानकारी समावेश हुन्छन्।"</string>
<string name="permlab_exemptFromAudioRecordRestrictions" msgid="1164725468350759486">"अडियो रेकर्ड गर्ने कार्यमा लगाइएका प्रतिबन्धहरूबाट छुट दिनुहोस्"</string>
<string name="permdesc_exemptFromAudioRecordRestrictions" msgid="2425117015896871976">"यो एपलाई अडियो रेकर्ड गर्ने कार्यमा लगाइएका प्रतिबन्धहरूबाट छुट दिनुहोस्।"</string>
- <string name="permlab_acceptHandover" msgid="2925523073573116523">"अर्को अनुप्रयोगमा सुरु गरिएको कल जारी राख्नुहोस्"</string>
- <string name="permdesc_acceptHandovers" msgid="7129026180128626870">"यस एपलाई अर्को अनुप्रयोगमा सुरु गरिएको कल जारी राख्ने अनुमति दिन्छ।"</string>
+ <string name="permlab_acceptHandover" msgid="2925523073573116523">"अर्को एपमा सुरु गरिएको कल जारी राख्नुहोस्"</string>
+ <string name="permdesc_acceptHandovers" msgid="7129026180128626870">"यस एपलाई अर्को एपमा सुरु गरिएको कल जारी राख्ने अनुमति दिन्छ।"</string>
<string name="permlab_readPhoneNumbers" msgid="5668704794723365628">"फोन नम्बरहरू पढ्ने"</string>
<string name="permdesc_readPhoneNumbers" msgid="7368652482818338871">"उक्त एपलाई यस डिभाइसको फोन नम्बरहरूमाथि पहुँच राख्न दिनुहोस्।"</string>
<string name="permlab_wakeLock" product="automotive" msgid="1904736682319375676">"कारको स्क्रिन सक्रिय राख्नुहोस्"</string>
@@ -646,7 +646,7 @@
<string name="face_error_timeout" msgid="522924647742024699">"फेरि फेस अनलक प्रयोग गरी हेर्नुहोस्।"</string>
<string name="face_error_no_space" msgid="5649264057026021723">"अनुहारसम्बन्धी नयाँ डेटा भण्डारण गर्न सकिएन। पहिले कुनै पुरानो डेटा मेटाउनुहोस्।"</string>
<string name="face_error_canceled" msgid="2164434737103802131">"अनुहार पहिचान रद्द गरियो।"</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"प्रयोगकर्ताले फेस अनलकको कार्य रद्द गर्नुभयो।"</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"प्रयोगकर्ताले फेस अनलक रद्द गर्नुभयो।"</string>
<string name="face_error_lockout" msgid="7864408714994529437">"धेरैपटक प्रयासहरू भए। पछि फेरि प्रयास गर्नुहोस्।"</string>
<string name="face_error_lockout_permanent" msgid="8277853602168960343">"अत्यधिक प्रयासहरू भए। फेस अनलक असक्षम पारियो।"</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"अनुहार पुष्टि गर्न सकिएन। फेरि प्रयास गर्नुहोस्।"</string>
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"फेरि प्रयास गर्नुहोस्"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"फेरि प्रयास गर्नुहोस्"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"सबै सुविधाहरू र डेटाका लागि अनलक गर्नुहोस्"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"अत्यधिक मोहडा खोल्ने प्रयासहरू बढी भए।"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"फेस अनलक प्रयोग गरी अनलक गर्ने प्रयास अत्याधिक धेरै भयो"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"SIM कार्ड छैन"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"ट्याब्लेटमा SIM कार्ड छैन।"</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"तपाईंको Android टिभी डिभाइसमा SIM कार्ड छैन।"</string>
@@ -1009,7 +1009,7 @@
<string name="permdesc_writeHistoryBookmarks" product="tv" msgid="88642768580408561">"एपलाई तपाईंको Android टिभी डिभाइसमा भण्डार गरिएका ब्राउजरको इतिहास र पुस्तक चिन्हहरू परिमार्जन गर्ने अनुमति दिन्छ। यसले एपलाई ब्राउजरको डेटा मेटाउने वा परिमार्जन गर्ने अनुमति दिन सक्छ। ध्यान दिनुहोस्: तेस्रो पक्षीय ब्राउजर वा वेब ब्राउज गर्ने सुविधा प्रदान गर्ने अन्य एपहरूले यो अनुमति लागू गर्न सक्दैनन्।"</string>
<string name="permdesc_writeHistoryBookmarks" product="default" msgid="2245203087160913652">"तपाईँको फोनमा भण्डारण भएको ब्राउजरको इतिहास वा बुकमार्कहरू परिवर्तन गर्नको लागि एपलाई अनुमति दिन्छ। यसले सायद ब्राउजर डेटालाई मेट्न वा परिवर्तन गर्नको लागि एपलाई अनुमति दिन्छ। नोट: वेब ब्राउज गर्ने क्षमतासहितका अन्य एपहरू वा तेस्रो- पक्ष ब्राउजरद्वारा सायद यस अनुमतिलाई लागु गर्न सकिंदैन।"</string>
<string name="permlab_setAlarm" msgid="1158001610254173567">"एउटा आलर्म सेट गर्नुहोस्"</string>
- <string name="permdesc_setAlarm" msgid="2185033720060109640">"स्थापना गरिएको सङ्केत घडी अनुप्रयोगमा सङ्केत समय मिलाउन एपलाई अनुमति दिन्छ। केही सङ्केत घडी एपहरूले यो सुविधा कार्यान्वयन नगर्न सक्छन्।"</string>
+ <string name="permdesc_setAlarm" msgid="2185033720060109640">"स्थापना गरिएको सङ्केत घडी एपमा सङ्केत समय मिलाउन एपलाई अनुमति दिन्छ। केही सङ्केत घडी एपहरूले यो सुविधा कार्यान्वयन नगर्न सक्छन्।"</string>
<string name="permlab_addVoicemail" msgid="4770245808840814471">"भ्वाइसमेल थप गर्नुहोस्"</string>
<string name="permdesc_addVoicemail" msgid="5470312139820074324">"तपाईँको भ्वाइसमेल इनबक्समा सन्देश थप्नको लागि एपलाई अनुमति दिन्छ।"</string>
<string name="permlab_writeGeolocationPermissions" msgid="8605631647492879449">"भूस्थान अनुमतिहरू ब्राउजर परिवर्तन गर्नुहोस्"</string>
@@ -2064,7 +2064,7 @@
<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_signature_mismatch" msgid="579345304221605479">"अनुप्रयोगमा प्रयोग गरिने हस्ताक्षर नमिल्ने हुँदा सर्टकट पुनर्स्थापित गर्न सकिएन"</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>
<string name="harmful_app_warning_uninstall" msgid="6472912975664191772">"स्थापना रद्द गर्नु…"</string>
diff --git a/core/res/res/values-or/strings.xml b/core/res/res/values-or/strings.xml
index e69fe12..6ce5f3c 100644
--- a/core/res/res/values-or/strings.xml
+++ b/core/res/res/values-or/strings.xml
@@ -609,11 +609,11 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"ଟିପଚିହ୍ନ ଆଇକନ୍"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"ଫେସ୍ ଅନ୍ଲକ୍ ହାର୍ଡୱେର୍ ପରିଚାଳନା କରନ୍ତୁ"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"ଫେସ୍ ଅନଲକ୍ ହାର୍ଡୱେର୍ ପରିଚାଳନା କରନ୍ତୁ"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"ବ୍ୟବହାର ପାଇଁ ଆପ୍କୁ ଫେସିଆଲ୍ ଟେମ୍ପଲେଟ୍ ଯୋଡିବା ଓ ଡିଲିଟ୍ ର ପଦ୍ଧତି ପାଇଁ ଅନୁମତି ଦିଅନ୍ତୁ।"</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"ଫେସ୍ ଅନ୍ଲକ୍ ହାର୍ଡୱେର୍ ବ୍ୟବହାର କରନ୍ତୁ"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"ପ୍ରାମାଣିକତା ପାଇଁ ଫେସ୍ ଅନ୍ଲକ୍ ହାର୍ଡୱେର୍ର ବ୍ୟବହାର ପାଇଁ ଆପ୍କୁ ଅନୁମତି ଦିଅନ୍ତୁ।"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"ଫେସ୍ ଅନ୍ଲକ୍"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"ଫେସ୍ ଅନଲକ୍ ହାର୍ଡୱେର୍ ବ୍ୟବହାର କରନ୍ତୁ"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"ପ୍ରମାଣୀକରଣ ପାଇଁ ଫେସ୍ ଅନଲକ୍ ହାର୍ଡୱେର୍ର ବ୍ୟବହାର କରିବା ପାଇଁ ଆପ୍କୁ ଅନୁମତି ଦିଅନ୍ତୁ"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"ଫେସ୍ ଅନଲକ୍"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"ଆପଣଙ୍କର ମୁହଁ ପୁଣି-ଏନ୍ରୋଲ୍ କରନ୍ତୁ"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"ଚିହ୍ନଟକରଣକୁ ଉନ୍ନତ କରିବା ପାଇଁ, ଦୟାକରି ଆପଣଙ୍କର ମୁହଁ ପୁଣି-ଏନ୍ରୋଲ୍ କରନ୍ତୁ।"</string>
<string name="face_setup_notification_title" msgid="550617822603450009">"ଫେସ୍ ଅନଲକ୍ ସେଟ୍ ଅପ୍ କରନ୍ତୁ"</string>
@@ -643,15 +643,15 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"ମୁହଁ ଚିହ୍ନଟ କରିପାରିଲା ନାହିଁ। ହାର୍ଡୱେୟାର୍ ଉପଲବ୍ଧ ନାହିଁ।"</string>
- <string name="face_error_timeout" msgid="522924647742024699">"ଫେସ୍ ଅନ୍ଲକ୍ ପୁଣି ବ୍ୟବହାର କରି ଦେଖନ୍ତୁ"</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"ଫେସ୍ ଅନଲକ୍ ପୁଣି ବ୍ୟବହାର କରି ଦେଖନ୍ତୁ।"</string>
<string name="face_error_no_space" msgid="5649264057026021723">"ନୂଆ ମୁହଁ ଡାଟା ଷ୍ଟୋର୍ ହେବ ନାହିଁ। ପ୍ରଥମେ ପୁରୁଣାକୁ ଡିଲିଟ୍ କରନ୍ତୁ।"</string>
<string name="face_error_canceled" msgid="2164434737103802131">"ଫେସ୍ର ଅପରେଶନ୍ କ୍ୟାନ୍ସଲ୍ ହୋଇଗଲା"</string>
<string name="face_error_user_canceled" msgid="8553045452825849843">"ଉପଯୋଗକର୍ତ୍ତାଙ୍କ ଦ୍ୱାରା ଫେସ୍ ଅନଲକ୍ ବାତିଲ୍ କରାଯାଇଛି।"</string>
<string name="face_error_lockout" msgid="7864408714994529437">"ବାରମ୍ବାର ଚେଷ୍ଟା। ପରେ ପୁଣିଥରେ ଚେଷ୍ଟା କରନ୍ତୁ।"</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"ଅତ୍ୟଧିକ ପ୍ରଚେଷ୍ଟା. ଫେସ୍ ଅନ୍ଲକ୍ ଅକ୍ଷମ କରନ୍ତୁ"</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"ଅତ୍ୟଧିକ ପ୍ରଚେଷ୍ଟା। ଫେସ୍ ଅନଲକ୍ ଅକ୍ଷମ ହୋଇଛି।"</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"ମୁହଁ ଚିହ୍ନଟ କରିପାରିଲା ନାହିଁ। ପୁଣି ଚେଷ୍ଟା କରନ୍ତୁ।"</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"ଆପଣ ଫେସ୍ ଅନ୍ଲକ୍ ସେଟ୍ ଅପ୍ କରିନାହାଁନ୍ତି"</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"ଏହି ଡିଭାଇସ୍ରେ ଫେସ୍ ଅନ୍ଲକ୍ ସମର୍ଥିତ ନୁହେଁ।"</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"ଆପଣ ଫେସ୍ ଅନଲକ୍ ସେଟ୍ ଅପ୍ କରିନାହାଁନ୍ତି।"</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"ଏହି ଡିଭାଇସରେ ଫେସ୍ ଅନଲକ୍ ସମର୍ଥିତ ନୁହେଁ।"</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"ସେନ୍ସରକୁ ଅସ୍ଥାୟୀ ଭାବେ ଅକ୍ଷମ କରାଯାଇଛି।"</string>
<string name="face_name_template" msgid="3877037340223318119">"<xliff:g id="FACEID">%d</xliff:g>ଙ୍କ ଫେସ୍"</string>
<string name="face_app_setting_name" msgid="8130135875458467243">"ଫେସ୍ ଅନଲକ୍ ବ୍ୟବହାର କରନ୍ତୁ"</string>
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"ପୁଣି ଚେଷ୍ଟା କରନ୍ତୁ"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"ପୁଣି ଚେଷ୍ଟା କରନ୍ତୁ"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"ସମସ୍ତ ସୁବିଧା ତଥା ଡାଟା ପାଇଁ ଅନଲକ୍ କରନ୍ତୁ"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"ମାଲିକର ମୁହଁ ଚିହ୍ନି ଅନଲକ୍ କରିବାର ସର୍ବାଧିକ ଧାର୍ଯ୍ୟ ସୀମା ଅତିକ୍ରମ କଲା"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"ସର୍ବାଧିକ ଫେସ୍ ଅନଲକ୍ ପ୍ରଚେଷ୍ଟା ଅତିକ୍ରମ କରିଛି"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"କୌଣସି SIM କାର୍ଡ ନାହିଁ"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"ଟାବଲେଟ୍ରେ କୌଣସି SIM କାର୍ଡ ନାହିଁ।"</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"ଆପଣଙ୍କର Android TV ଡିଭାଇସ୍ରେ କୌଣସି SIM କାର୍ଡ ନାହିଁ।"</string>
diff --git a/core/res/res/values-pa/strings.xml b/core/res/res/values-pa/strings.xml
index f7568e5..ba4730c 100644
--- a/core/res/res/values-pa/strings.xml
+++ b/core/res/res/values-pa/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"ਫਿੰਗਰਪ੍ਰਿੰਟ ਪ੍ਰਤੀਕ"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"ਚਿਹਰਾ ਅਣਲਾਕ ਹਾਰਡਵੇਅਰ ਦਾ ਪ੍ਰਬੰਧਨ ਕਰੋ"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"ਫ਼ੇਸ ਅਣਲਾਕ ਹਾਰਡਵੇਅਰ ਦਾ ਪ੍ਰਬੰਧਨ ਕਰੋ"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"ਐਪ ਨੂੰ ਵਰਤਣ ਲਈ ਚਿਹਰਾ ਟੈਮਪਲੇਟ ਸ਼ਾਮਲ ਕਰਨ ਜਾਂ ਮਿਟਾਉਣ ਦੀਆਂ ਵਿਧੀਆਂ ਦੀ ਬੇਨਤੀ ਕਰਨ ਦਿੰਦੀ ਹੈ।"</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"ਚਿਹਰਾ ਅਣਲਾਕ ਹਾਰਡਵੇਅਰ ਵਰਤੋ"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"ਐਪ ਨੂੰ ਪ੍ਰਮਾਣੀਕਰਨ ਲਈ ਚਿਹਰਾ ਅਣਲਾਕ ਹਾਰਡਵੇਅਰ ਵਰਤਣ ਦਿੰਦੀ ਹੈ"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"ਚਿਹਰਾ ਅਣਲਾਕ"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"ਫ਼ੇਸ ਅਣਲਾਕ ਹਾਰਡਵੇਅਰ ਵਰਤੋ"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"ਐਪ ਨੂੰ ਪ੍ਰਮਾਣੀਕਰਨ ਲਈ ਫ਼ੇਸ ਅਣਲਾਕ ਹਾਰਡਵੇਅਰ ਵਰਤਣ ਦਿੰਦੀ ਹੈ"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"ਫ਼ੇਸ ਅਣਲਾਕ"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"ਆਪਣਾ ਚਿਹਰਾ ਮੁੜ-ਦਰਜ ਕਰੋ"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"ਪਛਾਣ ਨੂੰ ਬਿਹਤਰ ਬਣਾਉਣ ਲਈ, ਕਿਰਪਾ ਕਰਕੇ ਆਪਣੇ ਚਿਹਰੇ ਨੂੰ ਮੁੜ-ਦਰਜ ਕਰੋ"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"ਚਿਹਰਾ ਅਣਲਾਕ ਸੈੱਟਅੱਪ ਕਰੋ"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"ਫ਼ੇਸ ਅਣਲਾਕ ਸੈੱਟਅੱਪ ਕਰੋ"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"ਆਪਣੇ ਫ਼ੋਨ ਵੱਲ ਦੇਖ ਕੇ ਇਸਨੂੰ ਅਣਲਾਕ ਕਰੋ"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"ਅਣਲਾਕ ਕਰਨ ਦੇ ਹੋਰ ਤਰੀਕਿਆਂ ਦਾ ਸੈੱਟਅੱਪ ਕਰੋ"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"ਫਿੰਗਰਪ੍ਰਿੰਟ ਸ਼ਾਮਲ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ"</string>
@@ -643,19 +643,19 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"ਚਿਹਰੇ ਦੀ ਪੁਸ਼ਟੀ ਨਹੀਂ ਹੋ ਸਕੀ। ਹਾਰਡਵੇਅਰ ਉਪਲਬਧ ਨਹੀਂ।"</string>
- <string name="face_error_timeout" msgid="522924647742024699">"ਚਿਹਰਾ ਅਣਲਾਕ ਦੁਬਾਰਾ ਵਰਤ ਕੇ ਦੇਖੋ।"</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"ਫ਼ੇਸ ਅਣਲਾਕ ਦੁਬਾਰਾ ਵਰਤ ਕੇ ਦੇਖੋ।"</string>
<string name="face_error_no_space" msgid="5649264057026021723">"ਨਵਾਂ ਚਿਹਰਾ ਡਾਟਾ ਸਟੋਰ ਨਹੀਂ ਕੀਤਾ ਜਾ ਸਕਦਾ। ਪਹਿਲਾਂ ਪੁਰਾਣਾ ਹਟਾਓ।"</string>
<string name="face_error_canceled" msgid="2164434737103802131">"ਚਿਹਰਾ ਪਛਾਣਨ ਦੀ ਪ੍ਰਕਿਰਿਆ ਰੱਦ ਕੀਤੀ ਗਈ।"</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"ਵਰਤੋਂਕਾਰ ਨੇ ਚਿਹਰਾ ਅਣਲਾਕ ਰੱਦ ਕੀਤਾ।"</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"ਵਰਤੋਂਕਾਰ ਨੇ ਫ਼ੇਸ ਅਣਲਾਕ ਰੱਦ ਕੀਤਾ।"</string>
<string name="face_error_lockout" msgid="7864408714994529437">"ਹੱਦੋਂ ਵੱਧ ਕੋਸ਼ਿਸ਼ਾਂ। ਬਾਅਦ ਵਿੱਚ ਦੁਬਾਰਾ ਕੋਸ਼ਿਸ਼ ਕਰੋ।"</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"ਬਹੁਤ ਸਾਰੀਆਂ ਕੋਸ਼ਿਸ਼ਾਂ। ਚਿਹਰਾ ਅਣਲਾਕ ਬੰਦ ਕੀਤਾ ਗਿਆ।"</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"ਬਹੁਤ ਸਾਰੀਆਂ ਕੋਸ਼ਿਸ਼ਾਂ। ਫ਼ੇਸ ਅਣਲਾਕ ਬੰਦ ਕੀਤਾ ਗਿਆ।"</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"ਚਿਹਰੇ ਦੀ ਪੁਸ਼ਟੀ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕੀ। ਦੁਬਾਰਾ ਕੋਸ਼ਿਸ਼ ਕਰੋ।"</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"ਤੁਸੀਂ ਚਿਹਰਾ ਅਣਲਾਕ ਸੈੱਟਅੱਪ ਨਹੀਂ ਕੀਤਾ ਹੈ।"</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"ਇਸ ਡੀਵਾਈਸ ਵਿੱਚ ਚਿਹਰਾ ਅਣਲਾਕ ਦੀ ਸੁਵਿਧਾ ਨਹੀਂ ਹੈ।"</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"ਤੁਸੀਂ ਫ਼ੇਸ ਅਣਲਾਕ ਸੈੱਟਅੱਪ ਨਹੀਂ ਕੀਤਾ ਹੈ।"</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"ਇਸ ਡੀਵਾਈਸ ਵਿੱਚ ਫ਼ੇਸ ਅਣਲਾਕ ਦੀ ਸੁਵਿਧਾ ਨਹੀਂ ਹੈ।"</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"ਸੈਂਸਰ ਅਸਥਾਈ ਤੌਰ \'ਤੇ ਬੰਦ ਕੀਤਾ ਗਿਆ।"</string>
<string name="face_name_template" msgid="3877037340223318119">"ਚਿਹਰਾ <xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"ਚਿਹਰਾ ਅਣਲਾਕ ਦੀ ਵਰਤੋਂ ਕਰੋ"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"ਚਿਹਰਾ ਜਾਂ ਸਕ੍ਰੀਨ ਲਾਕ ਦੀ ਵਰਤੋਂ ਕਰੋ"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"ਫ਼ੇਸ ਅਣਲਾਕ ਦੀ ਵਰਤੋਂ ਕਰੋ"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"ਫ਼ੇਸ ਜਾਂ ਸਕ੍ਰੀਨ ਲਾਕ ਦੀ ਵਰਤੋਂ ਕਰੋ"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"ਜਾਰੀ ਰੱਖਣ ਲਈ ਆਪਣੇ ਚਿਹਰੇ ਦੀ ਵਰਤੋਂ ਕਰੋ"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"ਜਾਰੀ ਰੱਖਣ ਲਈ ਆਪਣਾ ਚਿਹਰਾ ਜਾਂ ਸਕ੍ਰੀਨ ਲਾਕ ਵਰਤੋ"</string>
<string-array name="face_error_vendor">
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"ਦੁਬਾਰਾ ਕੋਸ਼ਿਸ਼ ਕਰੋ"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"ਦੁਬਾਰਾ ਕੋਸ਼ਿਸ਼ ਕਰੋ"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"ਸਾਰੀਆਂ ਵਿਸ਼ੇਸ਼ਤਾਵਾਂ ਅਤੇ ਡਾਟੇ ਲਈ ਅਣਲਾਕ ਕਰੋ"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"ਅਧਿਕਤਮ ਚਿਹਰਾ ਅਣਲਾਕ ਕੋਸ਼ਿਸ਼ਾਂ ਵਧੀਆਂ"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"ਫ਼ੇਸ ਅਣਲਾਕ ਦੀਆਂ ਕੋਸ਼ਿਸ਼ਾਂ ਸੀਮਾ ਤੋਂ ਪਾਰ ਹੋ ਗਈਆਂ"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"ਕੋਈ ਸਿਮ ਕਾਰਡ ਨਹੀਂ"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"ਟੈਬਲੈੱਟ ਵਿੱਚ ਕੋਈ ਸਿਮ ਕਾਰਡ ਨਹੀਂ ਹੈ।"</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"ਤੁਹਾਡੇ Android TV ਡੀਵਾਈਸ ਵਿੱਚ ਕੋਈ ਸਿਮ ਕਾਰਡ ਮੌਜੂਦ ਨਹੀਂ।"</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"ਅਣਲਾਕ ਖੇਤਰ ਦਾ ਵਿਸਤਾਰ ਕਰੋ।"</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"ਅਣਲਾਕ ਸਲਾਈਡ ਕਰੋ।"</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"ਪੈਟਰਨ ਅਣਲਾਕ।"</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"ਚਿਹਰਾ ਅਣਲਾਕ।"</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"ਫ਼ੇਸ ਅਣਲਾਕ।"</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"ਪਿੰਨ ਅਣਲਾਕ।"</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"ਸਿਮ ਪਿੰਨ ਅਣਲਾਕ।"</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"ਸਿਮ Puk ਅਣਲਾਕ।"</string>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index 4478b89..0c143e8 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -649,7 +649,7 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"Nie można zweryfikować twarzy. Sprzęt niedostępny."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"Spróbuj rozpoznania twarzy ponownie."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"Spróbuj rozpoznawania twarzy ponownie."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"Nie można przechowywać nowych danych twarzy. Usuń stare."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"Analiza twarzy została anulowana."</string>
<string name="face_error_user_canceled" msgid="8553045452825849843">"Użytkownik anulował rozpoznawanie twarzy."</string>
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index bf58bd0..a202de6 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -658,7 +658,7 @@
<string name="face_error_security_update_required" msgid="5076017208528750161">"Senzorul este dezactivat temporar."</string>
<string name="face_name_template" msgid="3877037340223318119">"Chip <xliff:g id="FACEID">%d</xliff:g>"</string>
<string name="face_app_setting_name" msgid="8130135875458467243">"Folosiți deblocarea facială"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Folosiți blocarea ecranului sau blocarea facială"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Folosiți deblocarea facială sau ecranul de blocare"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"Folosiți-vă chipul ca să continuați"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"Folosiți-vă chipul sau blocarea ecranului pentru a continua"</string>
<string-array name="face_error_vendor">
diff --git a/core/res/res/values-si/strings.xml b/core/res/res/values-si/strings.xml
index 51c4077..e5e0367 100644
--- a/core/res/res/values-si/strings.xml
+++ b/core/res/res/values-si/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"ඇඟිලි සලකුණු නිරූපකය"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"මුහුණු අඟුලු ඇරීමේ දෘඪාංග කළමනා කරන්න"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"මුහුණෙන් අගුළු හැරීම දෘඪාංග කළමනා කරන්න"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"මුහුණු අච්චු එකතු කිරීමට සහ ඉවත් කිරීමට අදාළ ක්රම භාවිතය සඳහා මෙම යෙදුමට ඉඩ දෙයි."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"මුහුණු අඟුලු ඇරීමේ දෘඪාංග භෘවිත කරන්න"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"සත්යාපනය සඳහා මුහුණු අඟුලු ඇරීමේ දෘඪාංග භාවිත කිරීමට යෙදුමට ඉඩ දෙයි"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"මුහුණු අඟුලු ඇරීම"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"මුහුණෙන් අගුළු හැරීමේ දෘඪාංග භෘවිත කරන්න"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"සත්යාපනය සඳහා මුහුණෙන් අගුළු හැරීමේ දෘඪාංග භාවිත කිරීමට යෙදුමට ඉඩ දෙයි"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"මුහුණෙන් අගුළු හැරීම"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"ඔබේ මුහුණ යළි ලියාපදිංචි කරන්න"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"හඳුනා ගැනීම වැඩිදියුණු කිරීමට, ඔබේ මුහුණ යළි-ලියාපදිංචි කරන්න"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"මුහුණු අඟුලු හැරීම පිහිටුවන්න"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"මුහුණෙන් අගුළු හැරීම පිහිටුවන්න"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"ඔබගේ දුරකථනය දෙස බැලීමෙන් එහි අගුලු හරින්න"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"අගුලු හැරීමට තවත් ක්රම සකසන්න"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"ඇඟිලි සලකුණක් එක් කිරීමට තට්ටු කරන්න"</string>
@@ -643,19 +643,19 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"මුහුණ සත්යාපනය කළ නොහැක. දෘඩාංගය නොමැත."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"නැවතත් මුහුණු අඟුලු ඇරීම උත්සාහ කරන්න."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"නැවතත් මුහුණෙන් අගුළු හැරීම උත්සාහ කරන්න."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"නව මුහුණු දත්ත ගබඩා කළ නොහැක. පළමුව පැරණි එකක් මකන්න."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"මුහුණු මෙහෙයුම අවලංගු කරන ලදී."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"පරිශීලකයා මුහුණු අඟුලු ඇරීම අවලංගු කර ඇත."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"පරිශීලකයා මුහුණෙන් අගුළු හැරීම අවලංගු කර ඇත."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"උත්සාහයන් ඉතා වැඩි ගණනකි. පසුව නැවත උත්සාහ කරන්න."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"ප්රයත්න ගණන වැඩියි. මුහුණු අඟුලු ඇරීම අබලයි."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"ප්රයත්න ගණන වැඩියි. මුහුණෙන් අගුළු හැරීම අබලයි."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"මුහුණ සත්යාපන කළ නොහැක. නැවත උත්සාහ කරන්න."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"ඔබ මුහුණු අඟුලු ඇරීම සකසා නැත"</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"මෙම උපාංගයෙහි මුහුණු අඟුලු ඇරීමට සහය නොදැක්වේ"</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"ඔබ මුහුණෙන් අගුළු හැරීම සකසා නැත"</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"මෙම උපාංගයෙහි මුහුණෙන් අගුළු හැරීම සහය නොදැක්වේ"</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"සංවේදකය තාවකාලිකව අබල කර ඇත."</string>
<string name="face_name_template" msgid="3877037340223318119">"මුහුණු <xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"මුහුණු අගුලු හැරීම භාවිත කරන්න"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"මුහුණු අගුලු හැරීම හෝ තිර අගුල භාවිත කරන්න"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"මුහුණෙන් අගුළු හැරීම භාවිත කරන්න"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"මුහුණෙන් අගුළු හැරීම හෝ තිර අගුල භාවිත කරන්න"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"ඉදිරියට යාමට ඔබගේ මුහුණ භාවිත කරන්න"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"ඉදිරියට යාමට ඔබගේ මුහුණු හෝ තිර අගුල භාවිත කරන්න"</string>
<string-array name="face_error_vendor">
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"නැවත උත්සාහ කරන්න"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"නැවත උත්සාහ කරන්න"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"සියලු විශේෂාංග සහ දත්ත අනවහිර කරන්න"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"මුහුණ භාවිතයෙන් අඟුළු හැරීමේ උපරිම ප්රයන්තයන් ගණන ඉක්මවා ඇත"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"මුහුණෙන් අගුළු හැරීමේ උපරිම ප්රයන්තයන් ගණන ඉක්මවා ඇත"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"SIM පත නැත"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"ටැබ්ලටයේ SIM පත නොමැත."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"ඔබගේ Android TV උපාංගයේ SIM කාඩ්පතක් නොමැත."</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"අගුළු නොදැමූ ප්රදේශය පුළුල් කරන්න."</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"සර්පණ අගුළු ඇරීම."</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"රටා අගුළු ඇරීම."</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"මුහුණ භාවිතයෙන් අඟුළු හැරීම."</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"මුහුණෙන් අගුළු හැරීම."</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"PIN අගුළු ඇරීම."</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"Sim Pin අගුලු දැමීම."</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"Sim Puk අගුලු දැමීම."</string>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index 95974b4..556b590 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -617,8 +617,8 @@
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"Ikona odtlačku prsta"</string>
<string name="permlab_manageFace" msgid="4569549381889283282">"spravovať hardvér odomknutia tvárou"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Umožňuje aplikácii vyvolať metódy, ktoré pridávajú a odstraňujú šablóny tvárí."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"používať hardvér Odomknutia tvárou"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Umožňuje aplikácii používať na overenie totožnosti hardvér Odomknutia tvárou"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"používať hardvér odomknutia tvárou"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Umožňuje aplikácii používať na overenie totožnosti hardvér odomknutia tvárou"</string>
<string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Odomknutie tvárou"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Znova zaregistrujte svoju tvár"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Znova zaregistrujte svoju tvár, aby sa zlepšilo rozpoznávanie"</string>
diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml
index 760a5c0..c6df5f9 100644
--- a/core/res/res/values-sv/strings.xml
+++ b/core/res/res/values-sv/strings.xml
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Försök igen"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Försök igen"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Lås upp för alla funktioner och all data"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Du har försökt låsa upp med Ansiktslås för många gånger"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Du har försökt låsa upp med ansiktslås för många gånger"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"Inget SIM-kort"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Inget SIM-kort i surfplattan."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Inget SIM-kort i Android TV-enheten."</string>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index 20f0543..baca154 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Jaribu tena"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Jaribu tena"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Fungua kifaa ili upate data na vipengele vyote"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Umepitisha idadi ya juu ya mara ambazo unaweza kujaribu Kufungua kwa Uso"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Umepitisha idadi ya juu ya mara ambazo unaweza kujaribu kufungua kwa uso"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"Hakuna SIM kadi"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Hakuna SIM kadi katika kompyuta ndogo."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Hakuna SIM kadi kwenye kifaa chako cha Android TV."</string>
diff --git a/core/res/res/values-ta/strings.xml b/core/res/res/values-ta/strings.xml
index 2473bca..1f43483 100644
--- a/core/res/res/values-ta/strings.xml
+++ b/core/res/res/values-ta/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"கைரேகை ஐகான்"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"\'முகம் காட்டித் திறத்தலுக்கான\' வன்பொருளை நிர்வகித்தல்"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"\'முகம் காட்டித் திறத்தல்\' அம்சத்துக்கான வன்பொருளை நிர்வகித்தல்"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"உபயோகிப்பதற்காக முக டெம்ப்ளேட்டுகளை சேர்க்கும்/நீக்கும் முறைகளை இயக்க, ஆப்ஸை அனுமதிக்கும்."</string>
<string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"’முகம் காட்டித் திறத்தல்’ அம்சத்திற்கான வன்பொருளைப் பயன்படுத்துதல்"</string>
<string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"அடையாளம் காண \'முகம் காட்டித் திறத்தலுக்கான\' வன்பொருளைப் பயன்படுத்த ஆப்ஸை அனுமதிக்கும்"</string>
<string name="face_recalibrate_notification_name" msgid="6006095897989257026">"முகம் காட்டித் திறத்தல்"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"முகத்தை மீண்டும் பதிவுசெய்யவும்"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"அடையாளத்தை மேம்படுத்த முகத்தை மீண்டும் பதிவுசெய்யவும்"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"முகம் காட்டித் திறத்தலை அமையுங்கள்"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"முகம் காட்டித் திறத்தல் அம்சத்தை அமையுங்கள்"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"மொபைலைப் பார்ப்பதன் மூலம் அதைத் திறக்கலாம்"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"திறக்க, மேலும் பல வழிகளை அமையுங்கள்"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"கைரேகையைச் சேர்க்கத் தட்டுங்கள்"</string>
@@ -646,16 +646,16 @@
<string name="face_error_timeout" msgid="522924647742024699">"\'முகம் காட்டித் திறத்தலை\' மீண்டும் முயலவும்."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"புதிய முகங்களைச் சேர்க்க இயலவில்லை. பழையது ஒன்றை நீக்கவும்."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"முக அங்கீகாரச் செயல்பாடு ரத்துசெய்யப்பட்டது."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"\'முகம் காட்டித் திறத்தல்\' பயனரால் ரத்துசெய்யப்பட்டது."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"பயனர் \'முகம் காட்டித் திறத்தல்\' அம்சத்தை ரத்துசெய்தார்."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"பலமுறை முயன்றுவிட்டீர்கள். பிறகு முயலவும்."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"பலமுறை முயன்றுவிட்டீர்கள். \'முகம் காட்டித் திறத்தல்’ முடக்கப்பட்டது."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"பலமுறை முயன்றுவிட்டீர்கள். \'முகம் காட்டித் திறத்தல்’ அம்சம் முடக்கப்பட்டது."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"முகத்தைச் சரிபார்க்க இயலவில்லை. மீண்டும் முயலவும்."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"’முகம் காட்டித் திறத்தலை’ நீங்கள் அமைக்கவில்லை."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"‘முகம் காட்டித் திறத்தல்’ அம்சத்தை நீங்கள் அமைக்கவில்லை."</string>
<string name="face_error_hw_not_present" msgid="1070600921591729944">"இந்த சாதனத்தில் ’முகம் காட்டித் திறத்தல்’ ஆதரிக்கப்படவில்லை."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"சென்சார் தற்காலிகமாக முடக்கப்பட்டுள்ளது."</string>
<string name="face_name_template" msgid="3877037340223318119">"முகம் <xliff:g id="FACEID">%d</xliff:g>"</string>
<string name="face_app_setting_name" msgid="8130135875458467243">"முகம் காட்டித் திறத்தலை உபயோகி"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"முகத்தையோ திரைப் பூட்டையோ பயன்படுத்து"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"முகம் காட்டித் திறத்தல் / திரைப் பூட்டைப் பயன்படுத்து"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"தொடர்வதற்கு உங்கள் முகத்தைப் பயன்படுத்துங்கள்"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"தொடர, உங்கள் முகத்தையோ திரைப் பூட்டையோ பயன்படுத்துங்கள்"</string>
<string-array name="face_error_vendor">
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"மீண்டும் முயற்சிக்கவும்"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"மீண்டும் முயற்சிக்கவும்"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"எல்லா அம்சங்கள் & தரவை பெற, சாதனத்தை திறக்கவும்"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"முகம் திறப்பதற்கான அதிகபட்ச முயற்சிகள் கடந்தன"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"முகம் காட்டித் திறத்தல் அம்சத்தை அதிகமுறை பயன்படுத்துவிட்டீர்கள்"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"சிம் கார்டு இல்லை"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"டேப்லெட்டில் சிம் கார்டு இல்லை."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Android TVயில் SIM கார்டு இல்லை."</string>
diff --git a/core/res/res/values-te/strings.xml b/core/res/res/values-te/strings.xml
index 523a1e4..8444eac 100644
--- a/core/res/res/values-te/strings.xml
+++ b/core/res/res/values-te/strings.xml
@@ -609,10 +609,10 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"వేలిముద్ర చిహ్నం"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"ముఖంతో అన్లాక్ చేయగల హార్డ్వేర్ నిర్వహణ"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"ఫేస్ అన్లాక్ చేయగల హార్డ్వేర్ను మేనేజ్ చేయడం"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"వినియోగం కోసం ముఖ టెంప్లేట్లను జోడించే మరియు తొలగించే పద్ధతులను అమలు చేయడానికి యాప్ను అనుమతిస్తుంది."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"ముఖంతో అన్లాక్ చేయగల హార్డ్వేర్ వినియోగం"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"ప్రమాణీకరణ కోసం ముఖంతో అన్లాక్ చేయగల హార్డ్వేర్ను ఉపయోగించడానికి యాప్ను అనుమతిస్తుంది"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"ఫేస్ అన్లాక్ హార్డ్వేర్ను ఉపయోగించడం"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"ప్రామాణీకరణ కోసం ఫేస్తో అన్లాక్ చేయగల హార్డ్వేర్ ఉపయోగానికి యాప్ను అనుమతిస్తుంది"</string>
<string name="face_recalibrate_notification_name" msgid="6006095897989257026">"ఫేస్ అన్లాక్"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"మీ ముఖాన్ని తిరిగి నమోదు చేయండి"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"గుర్తింపును మెరుగుపరచడానికి, దయచేసి మీ ముఖంను తిరిగి నమోదు చేసుకోండి"</string>
@@ -643,19 +643,19 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"ముఖం ధృవీకరించలేరు. హార్డ్వేర్ అందుబాటులో లేదు."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"ముఖంతో అన్లాక్ను మళ్లీ ప్రయత్నించండి."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"ఫేస్ అన్లాక్ను మళ్లీ ప్రయత్నించండి."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"కొత్త ముఖం డేటాను నిల్వ చేయడం కాదు. మొదట పాతది తొలిగించండి."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"ముఖ కార్యకలాపం రద్దయింది."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"ముఖంతో అన్లాక్ను వినియోగదారు రద్దు చేశారు."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"ఫేస్ అన్లాక్ను యూజర్ రద్దు చేశారు."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"చాలా ఎక్కువ ప్రయత్నాలు చేసారు. తర్వాత మళ్లీ ప్రయత్నించండి."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"అనేకసార్లు ప్రయత్నించారు. ముఖంతో అన్లాక్ నిలిపివేయబడింది."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"చాలా సార్లు ప్రయత్నించారు. ఫేస్ అన్లాక్ డిజేబుల్ చేయబడింది."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"ముఖం ధృవీకరించలేకపోయింది. మళ్లీ ప్రయత్నించండి."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"మీరు ముఖంతో అన్లాక్ను సెటప్ చేయలేదు."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"ఈ పరికరంలో ముఖంతో అన్లాక్ను ఉపయోగించడానికి మద్దతు లేదు."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"మీరు ఫేస్ అన్లాక్ను సెటప్ చేయలేదు."</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"ఈ పరికరంలో ఫేస్ అన్లాక్ను ఉపయోగించడానికి సపోర్ట్ లేదు."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"సెన్సార్ తాత్కాలికంగా డిజేబుల్ చేయబడింది."</string>
<string name="face_name_template" msgid="3877037340223318119">"ముఖ <xliff:g id="FACEID">%d</xliff:g>"</string>
<string name="face_app_setting_name" msgid="8130135875458467243">"ఫేస్ అన్లాక్ను ఉపయోగించండి"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"ముఖం లేదా స్క్రీన్ లాక్ను ఉపయోగించండి"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"ఫేస్ లేదా స్క్రీన్ లాక్ను ఉపయోగించండి"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"కొనసాగించడానికి మీ ముఖాన్ని ఉపయోగించండి"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"కొనసాగించడానికి మీ ముఖం లేదా స్క్రీన్ లాక్ను ఉపయోగించండి"</string>
<string-array name="face_error_vendor">
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"మళ్లీ ప్రయత్నించండి"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"మళ్లీ ప్రయత్నించండి"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"అన్ని లక్షణాలు మరియు డేటా కోసం అన్లాక్ చేయండి"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"ముఖంతో అన్లాక్ ప్రయత్నాల గరిష్ట పరిమితి మించిపోయారు"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"ఫేస్ అన్లాక్ ప్రయత్నాల గరిష్ఠ పరిమితిని మించిపోయారు"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"సిమ్ కార్డు లేదు"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"టాబ్లెట్లో సిమ్ కార్డు లేదు."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"మీ Android TV పరికరంలో SIM కార్డ్ లేదు."</string>
diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml
index 8ba11b9..f3d5fc4 100644
--- a/core/res/res/values-tl/strings.xml
+++ b/core/res/res/values-tl/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"Icon ng fingerprint"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"pamahalaan ang hardware ng face unlock"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"pamahalaan ang hardware ng pag-unlock gamit ang mukha"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Pumapayag na mag-invoke ang app ng paraang magdagdag at mag-delete ng template ng mukha."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"gamitin ang hardware ng face unlock"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Pinapayagan ang app na gamitin ang hardware ng face unlock para sa pag-authenticate"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Face unlock"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"gamitin ang hardware ng Pag-unlock Gamit ang Mukha"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Pinapayagan ang app na gamitin ang hardware ng Pag-unlock Gamit ang Mukha para sa pag-authenticate"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Pag-unlock Gamit ang Mukha"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"I-enroll ulit ang iyong mukha"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Para mapahusay ang pagkilala, paki-enroll ulit ang iyong mukha"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"I-set up ang face unlock"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"I-set up ang pag-unlock gamit ang mukha"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"I-unlock ang iyong telepono sa pamamagitan ng pagtingin dito"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"Mag-set up ng higit pang paraan para mag-unlock"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"I-tap para magdagdag ng fingerprint"</string>
@@ -643,18 +643,18 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"Di ma-verify ang mukha. Di available ang hardware."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"Subukan ulit ang face unlock."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"Subukan ulit ang pag-unlock gamit ang mukha."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"Hindi ma-store ang data ng mukha. Mag-delete muna ng iba."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"Nakansela ang operation kaugnay ng mukha."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"Kinansela ng user ang face unlock."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"Kinansela ng user ang pag-unlock gamit ang mukha."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"Masyadong maraming pagsubok. Subukang muli mamaya."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Masyadong maraming pagsubok. Na-disable ang face unlock."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Masyadong maraming pagsubok. Na-disable ang pag-unlock gamit ang mukha."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"Hindi ma-verify ang mukha. Subukang muli."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"Hindi mo pa nase-set up ang face unlock."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"Hindi sinusuportahan ang face unlock sa device na ito."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"Hindi mo pa nase-set up ang pag-unlock gamit ang mukha."</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"Hindi sinusuportahan ang pag-unlock gamit ang mukha sa device na ito."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"Pansamantalang na-disable ang sensor."</string>
<string name="face_name_template" msgid="3877037340223318119">"Mukha <xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"Gumamit ng face unlock"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"Gumamit ng pag-unlock gamit ang mukha"</string>
<string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Gumamit ng mukha o lock ng screen"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"Gamitin ang iyong mukha para magpatuloy"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"Gamitin ang iyong mukha o lock ng screen para magpatuloy"</string>
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Subukang muli"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Subukang muli"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"I-unlock para sa lahat ng feature at data"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Nalagpasan na ang maximum na mga pagtatangka sa Face Unlock"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Nalagpasan na ang maximum na mga pagtatangka sa Pag-unlock Gamit ang Mukha"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"Walang SIM card"</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Walang SIM card sa tablet."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Walang SIM card sa iyong Android TV device."</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"Palakihin ang bahagi ng pag-unlock."</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"Pag-unlock ng slide."</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"Pag-unlock ng pattern."</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Face unlock."</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Pag-unlock gamit ang mukha."</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"Pag-unlock ng pin."</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"Pag-unlock ng Pin ng Sim."</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"Pag-unlock ng Puk ng Sim."</string>
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index 91430db..8c1561c 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"Kilit açma alanını genişletin."</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"Kaydırarak kilit açma."</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"Desenle kilit açma."</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Yüzle kilit açma."</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Yüzle tanıma kilidi."</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"Pin koduyla kilit açma."</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"SIM PIN kilidini açın."</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"SIM PUK kilidini açın."</string>
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index 0af700d..1b0fc49 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -615,10 +615,10 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"Значок відбитка пальця"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"керувати апаратним забезпечення для Фейсконтролю"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"керувати апаратним забезпечення фейсконтролю"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Додаток може активувати способи додавання й видалення шаблонів облич."</string>
<string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"використовувати апаратне забезпечення для Фейсконтролю"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Додаток може використовувати апаратне забезпечення для Фейсконтролю"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Додаток зможе використовувати для автентифікації апаратне забезпечення фейсконтролю"</string>
<string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Фейсконтроль"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Повторно проскануйте обличчя"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Повторно проскануйте обличчя для ефективнішого розпізнавання"</string>
@@ -649,15 +649,15 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"Не вдається перевірити обличчя. Апаратне забезпечення недоступне."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"Скористайтеся Фейсконтролем ще раз."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"Спробуйте скористатися фейсконтролем ще раз."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"Не вдається зберегти нові дані про обличчя. Видаліть старі."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"Дію з обличчям скасовано."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"Користувач скасував Фейсконтроль."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"Фейсконтроль: користувач скасував операцію."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"Забагато спроб. Повторіть пізніше."</string>
<string name="face_error_lockout_permanent" msgid="8277853602168960343">"Забагато спроб. Фейсконтроль вимкнено."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"Не вдається перевірити обличчя. Повторіть спробу."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"Ви не налаштували Фейсконтроль"</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"На цьому пристрої не підтримується Фейсконтроль."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"Ви не налаштували фейсконтроль"</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"На цьому пристрої не підтримується фейсконтроль."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"Датчик тимчасово вимкнено."</string>
<string name="face_name_template" msgid="3877037340223318119">"Обличчя <xliff:g id="FACEID">%d</xliff:g>"</string>
<string name="face_app_setting_name" msgid="8130135875458467243">"Доступ через фейсконтроль"</string>
diff --git a/core/res/res/values-ur/strings.xml b/core/res/res/values-ur/strings.xml
index d90e271..f50ee1d 100644
--- a/core/res/res/values-ur/strings.xml
+++ b/core/res/res/values-ur/strings.xml
@@ -655,7 +655,7 @@
<string name="face_error_security_update_required" msgid="5076017208528750161">"سینسر عارضی طور غیر فعال ہے۔"</string>
<string name="face_name_template" msgid="3877037340223318119">"چہرہ <xliff:g id="FACEID">%d</xliff:g>"</string>
<string name="face_app_setting_name" msgid="8130135875458467243">"فیس اَنلاک استعمال کریں"</string>
- <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"چہرہ یا اسکرین لاک استعمال کریں"</string>
+ <string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"فیس یا اسکرین لاک استعمال کریں"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"جاری رکھنے کے لیے اپنے چہرے کا استعمال کریں"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"جاری رکھنے کے لیے اپنے چہرے یا اسکرین لاک کا استعمال کریں"</string>
<string-array name="face_error_vendor">
diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml
index 72063f4..6841ef5 100644
--- a/core/res/res/values-vi/strings.xml
+++ b/core/res/res/values-vi/strings.xml
@@ -609,9 +609,9 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"Biểu tượng vân tay"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"quản lý phần cứng mở khóa bằng khuôn mặt"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"quản lý phần cứng của tính năng mở khóa bằng khuôn mặt"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Cho phép ứng dụng gọi ra các phương pháp để thêm và xóa mẫu khuôn mặt sử dụng."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"sử dụng phần cứng mở khóa bằng khuôn mặt"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"sử dụng phần cứng của tính năng mở khóa bằng khuôn mặt"</string>
<string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Cho phép ứng dụng dùng phần cứng mở khóa bằng khuôn mặt để tiến hành xác thực"</string>
<string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Mở khóa bằng khuôn mặt"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Đăng ký lại khuôn mặt của bạn"</string>
diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml
index 424551a..a857f9a9 100644
--- a/core/res/res/values-zu/strings.xml
+++ b/core/res/res/values-zu/strings.xml
@@ -609,14 +609,14 @@
<string-array name="fingerprint_error_vendor">
</string-array>
<string name="fingerprint_icon_content_description" msgid="4741068463175388817">"Isithonjana sezigxivizo zeminwe"</string>
- <string name="permlab_manageFace" msgid="4569549381889283282">"phatha izingxenyekazi zekhompuyutha ze-face unlock"</string>
+ <string name="permlab_manageFace" msgid="4569549381889283282">"phatha izingxenyekazi zekhompyutha zokuvula ngobuso"</string>
<string name="permdesc_manageFace" msgid="6204569688492710471">"Ivumela uhlelo lokusebenza ukuthi luhoxise izindlela zokungeza nokususa amathempulethi obuso azosetshenziswa."</string>
- <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"sebenzisa izingxenyekazi zekhompuyutha ze-face unlock"</string>
- <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Ivumela uhlelo lokusebenza ukuthi lusebenzise izingxenyekazi zekhompuyutha ze-face unlock ukuze kufakazelwe ubuqiniso"</string>
- <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"I-Face unlock"</string>
+ <string name="permlab_useFaceAuthentication" msgid="1011430526454859030">"sebenzisa izingxenyekazi zekhompuyutha zokuvula ngobuso"</string>
+ <string name="permdesc_useFaceAuthentication" msgid="3115697017684668012">"Ivumela i-app isebenzise izingxenyekazi zekhompyutha zokuvula ngobuso ukuze kuqinisekiswe"</string>
+ <string name="face_recalibrate_notification_name" msgid="6006095897989257026">"Ukuvula ngobuso"</string>
<string name="face_recalibrate_notification_title" msgid="5944930528030496897">"Phinda ubhalise ubuso bakho"</string>
<string name="face_recalibrate_notification_content" msgid="892757485125249962">"Ukuze uthuthukise ukubonwa, sicela uphinde ubhalise ubuso bakho"</string>
- <string name="face_setup_notification_title" msgid="550617822603450009">"Setha i-face unlock"</string>
+ <string name="face_setup_notification_title" msgid="550617822603450009">"Setha ukuvula ngobuso"</string>
<string name="face_setup_notification_content" msgid="5463999831057751676">"Vula ifoni yakho ngokuyibheka"</string>
<string name="fingerprint_setup_notification_title" msgid="2002630611398849495">"Setha izindlela eziningi zokuvula"</string>
<string name="fingerprint_setup_notification_content" msgid="205578121848324852">"Thepha ukuze ungeze izigxivizo zomunwe"</string>
@@ -643,18 +643,18 @@
<string-array name="face_acquired_vendor">
</string-array>
<string name="face_error_hw_not_available" msgid="5085202213036026288">"Ayikwazi ukuqinisekisa ubuso. Izingxenyekazi zekhompyutha azitholakali."</string>
- <string name="face_error_timeout" msgid="522924647742024699">"Zama i-face unlock futhi."</string>
+ <string name="face_error_timeout" msgid="522924647742024699">"Zama ukuvula ngobuso futhi."</string>
<string name="face_error_no_space" msgid="5649264057026021723">"Ayikwazi ukulondoloza idatha yobuso. Susa endala."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"Umsebenzi wobuso ukhanselwe."</string>
- <string name="face_error_user_canceled" msgid="8553045452825849843">"I-face unlock ikhanselwe umsebenzisi."</string>
+ <string name="face_error_user_canceled" msgid="8553045452825849843">"Ukuvula ngobuso kukhanselwe umsebenzisi."</string>
<string name="face_error_lockout" msgid="7864408714994529437">"Imizamo eminingi kakhulu. Zama futhi emuva kwesikhathi."</string>
- <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Imizamo eminingi kakhulu. I-Face unlock ikhutshaziwe."</string>
+ <string name="face_error_lockout_permanent" msgid="8277853602168960343">"Imizamo eminingi kakhulu. Ukuvula ngobuso kukhutshaziwe."</string>
<string name="face_error_unable_to_process" msgid="5723292697366130070">"Ayikwazi ukuqinisekisa ubuso. Zama futhi."</string>
- <string name="face_error_not_enrolled" msgid="7369928733504691611">"Awukakasethi i-face unlock."</string>
- <string name="face_error_hw_not_present" msgid="1070600921591729944">"I-face unlock ayisekelwe kule divayisi."</string>
+ <string name="face_error_not_enrolled" msgid="7369928733504691611">"Awukakusethi ukuvula ngobuso."</string>
+ <string name="face_error_hw_not_present" msgid="1070600921591729944">"Ukuvula ngobuso kusekelwe kule divayisi."</string>
<string name="face_error_security_update_required" msgid="5076017208528750161">"Inzwa ikhutshazwe okwesikhashana."</string>
<string name="face_name_template" msgid="3877037340223318119">"Ubuso be-<xliff:g id="FACEID">%d</xliff:g>"</string>
- <string name="face_app_setting_name" msgid="8130135875458467243">"Sebenzisa i-face unlock"</string>
+ <string name="face_app_setting_name" msgid="8130135875458467243">"Sebenzisa ukuvula ngobuso"</string>
<string name="face_or_screen_lock_app_setting_name" msgid="1603149075605709106">"Sebenzisa i-face lock noma ukukhiya isikrini"</string>
<string name="face_dialog_default_subtitle" msgid="6620492813371195429">"Sebenzisa ubuso bakho ukuze uqhubeke"</string>
<string name="face_or_screen_lock_dialog_default_subtitle" msgid="5006381531158341844">"Sebenzisa ubuso bakho noma ukukhiya isikrini ukuze uqhubeke"</string>
@@ -887,7 +887,7 @@
<string name="lockscreen_pattern_wrong" msgid="2940138714468358458">"Zama futhi"</string>
<string name="lockscreen_password_wrong" msgid="8605355913868947490">"Zama futhi"</string>
<string name="lockscreen_storage_locked" msgid="634993789186443380">"Vulela zonke izici nedatha"</string>
- <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Ukuzama Kokuvula Ubuso Okuningi kudluliwe"</string>
+ <string name="faceunlock_multiple_failures" msgid="681991538434031708">"Ukuzama Kokuvula ngobuso sekweqe umkhawulo"</string>
<string name="lockscreen_missing_sim_message_short" msgid="1248431165144893792">"Alikho ikhadi le-SIM."</string>
<string name="lockscreen_missing_sim_message" product="tablet" msgid="8596805728510570760">"Alikho ikhadi le-SIM efonini."</string>
<string name="lockscreen_missing_sim_message" product="tv" msgid="2582768023352171073">"Ayikho i-SIM card kudivayisi yakho ye-Android TV."</string>
@@ -957,7 +957,7 @@
<string name="keyguard_accessibility_expand_lock_area" msgid="4215280881346033434">"Nwebisa indawo yokuvula."</string>
<string name="keyguard_accessibility_slide_unlock" msgid="2968195219692413046">"Ukuvula ngokuslayida."</string>
<string name="keyguard_accessibility_pattern_unlock" msgid="8669128146589233293">"Ukuvula ngephethini."</string>
- <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Vula ngobuso"</string>
+ <string name="keyguard_accessibility_face_unlock" msgid="632407612842329815">"Ukuvula ngobuso"</string>
<string name="keyguard_accessibility_pin_unlock" msgid="4020864007967340068">"Ukuvula ngephinikhodi."</string>
<string name="keyguard_accessibility_sim_pin_unlock" msgid="4895939120871890557">"Ukuvulwa kwephinikhodi ye-Sim."</string>
<string name="keyguard_accessibility_sim_puk_unlock" msgid="3459003464041899101">"Ukuvulwa kwe-puk ye-Sim."</string>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index eca623a..46a1258 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -27,6 +27,8 @@
<!-- Do not translate. Defines the slots for the right-hand side icons. That is to say, the
icons in the status bar that are not notifications. -->
<string-array name="config_statusBarIcons">
+ <item><xliff:g id="id">@string/status_bar_no_calling</xliff:g></item>
+ <item><xliff:g id="id">@string/status_bar_call_strength</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_alarm_clock</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_rotate</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_headset</xliff:g></item>
@@ -58,8 +60,6 @@
<item><xliff:g id="id">@string/status_bar_hotspot</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_mobile</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_airplane</xliff:g></item>
- <item><xliff:g id="id">@string/status_bar_no_calling</xliff:g></item>
- <item><xliff:g id="id">@string/status_bar_call_strength</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_battery</xliff:g></item>
<item><xliff:g id="id">@string/status_bar_sensors_off</xliff:g></item>
</string-array>
@@ -1653,29 +1653,38 @@
<integer name="config_timeZoneRulesCheckRetryCount">5</integer>
<!-- Whether the geolocation time zone detection feature is enabled. Setting this to false means
- the feature cannot be used. Setting this to true means it may be used if other
- configuration allows (see provider configuration below, also compile time overlays). -->
+ the feature cannot be used. Setting this to true means system server components can be
+ tested and location time zone detection may be used if other configuration allows (see
+ location time zone provider configuration settings below). -->
<bool name="config_enableGeolocationTimeZoneDetection" translatable="false">true</bool>
- <!-- Whether the primary LocationTimeZoneProvider is enabled.
- Ignored if config_enableGeolocationTimeZoneDetection is false -->
+ <!-- Whether the primary location time zone provider is enabled.
+ This setting is ignored if config_enableGeolocationTimeZoneDetection is false.
+
+ AOSP does not configure a primary location time zone provider. -->
<bool name="config_enablePrimaryLocationTimeZoneProvider" translatable="false">false</bool>
- <!-- The package name providing the primary location time zone provider.
+
+ <!-- The package hosting the primary location time zone provider.
Only used when config_enableGeolocationTimeZoneDetection and
- enablePrimaryLocationTimeZoneProvider are true. -->
- <string name="config_primaryLocationTimeZoneProviderPackageName" translatable="false">@null</string>
+ config_enablePrimaryLocationTimeZoneProvider are true.
- <!-- Whether the secondary LocationTimeZoneProvider is enabled.
- Ignored if config_enableGeolocationTimeZoneDetection is false -->
- <bool name="config_enableSecondaryLocationTimeZoneProvider" translatable="false">true</bool>
- <!-- Package name providing the secondary location time zone provider. Used only when
- config_enableSecondaryLocationTimeZoneOverlay is false.
+ See android.service.timezone.TimeZoneProviderService for how to host location time zone
+ provider services. -->
+ <string name="config_primaryLocationTimeZoneProviderPackageName" translatable="false"></string>
- By default, set to "android" to pick up the default LocationTimeZoneProvider configured in
- the system server's AndroidManifest.xml. See the
- com.android.location.timezone.service.v1.SecondaryLocationTimeZoneProvider intent-filter
- definition there for more information. -->
- <string name="config_secondaryLocationTimeZoneProviderPackageName" translatable="false">android</string>
+ <!-- Whether the secondary location time zone provider is enabled.
+ This setting is ignored if config_enableGeolocationTimeZoneDetection is false.
+
+ AOSP does not configure a secondary location time zone provider. -->
+ <bool name="config_enableSecondaryLocationTimeZoneProvider" translatable="false">false</bool>
+
+ <!-- The package hosting the secondary location time zone provider.
+ Only used when config_enableGeolocationTimeZoneDetection and
+ config_enableSecondaryLocationTimeZoneProvider are true.
+
+ See android.service.timezone.TimeZoneProviderService for how to host location time zone
+ provider services. -->
+ <string name="config_secondaryLocationTimeZoneProviderPackageName" translatable="false"></string>
<!-- Whether to enable network location overlay which allows network location provider to be
replaced by an app at run-time. When disabled, only the
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index b836c4c..8f40974 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -5571,7 +5571,7 @@
<!-- Label of notification action button to learn more about the enhanced notifications [CHAR LIMIT=20] -->
<string name="nas_upgrade_notification_learn_more_action">Learn more</string>
<!-- Content of notification learn more dialog about the enhanced notifications [CHAR LIMIT=NONE] -->
- <string name="nas_upgrade_notification_learn_more_content">Enhanced notifications replaced Android Adaptive Notifications in Android 12. This feature shows suggested actions and replies, and organizes your notifications.\n\nEnhanced notifications can access notification content, including personal information like contact names and messages. This feature can also dismiss or respond to notifications, such as answering phone calls and controlling Do Not Disturb.</string>
+ <string name="nas_upgrade_notification_learn_more_content">Enhanced notifications replaced Android Adaptive Notifications in Android 12. This feature shows suggested actions and replies, and organizes your notifications.\n\nEnhanced notifications can access notification content, including personal information like contact names and messages. This feature can also dismiss or respond to notifications, such as answering phone calls, and control Do Not Disturb.</string>
<!-- Dynamic mode battery saver strings -->
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index f2328567..5bbe415 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2962,7 +2962,6 @@
<java-symbol type="string" name="importance_from_person" />
<java-symbol type="layout" name="work_widget_mask_view" />
- <java-symbol type="id" name="work_widget_mask_frame" />
<java-symbol type="id" name="work_widget_app_icon" />
<java-symbol type="id" name="work_widget_badge_icon" />
diff --git a/packages/SystemUI/res/drawable/circle_green_10dp.xml b/core/tests/coretests/res/color/color_with_lstar.xml
similarity index 69%
copy from packages/SystemUI/res/drawable/circle_green_10dp.xml
copy to core/tests/coretests/res/color/color_with_lstar.xml
index 571ec62..dcc3d6d 100644
--- a/packages/SystemUI/res/drawable/circle_green_10dp.xml
+++ b/core/tests/coretests/res/color/color_with_lstar.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- ~ 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.
@@ -14,9 +14,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="oval">
- <size android:height="10dp"
- android:width="10dp" />
- <solid android:color="#34A853" />
-</shape>
\ No newline at end of file
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:color="#ff0000" android:lStar="50" />
+</selector>
diff --git a/core/tests/coretests/res/values/colors.xml b/core/tests/coretests/res/values/colors.xml
index f01af84..029aa0d 100644
--- a/core/tests/coretests/res/values/colors.xml
+++ b/core/tests/coretests/res/values/colors.xml
@@ -25,5 +25,6 @@
<drawable name="yellow">#ffffff00</drawable>
<color name="testcolor1">#ff00ff00</color>
<color name="testcolor2">#ffff0000</color>
+ <color name="testcolor3">#fff00000</color>
<color name="failColor">#ff0000ff</color>
</resources>
diff --git a/core/tests/coretests/src/android/graphics/ColorStateListTest.java b/core/tests/coretests/src/android/graphics/ColorStateListTest.java
index 1d34f938..a3d52ea 100644
--- a/core/tests/coretests/src/android/graphics/ColorStateListTest.java
+++ b/core/tests/coretests/src/android/graphics/ColorStateListTest.java
@@ -67,4 +67,10 @@
int defaultColor = mResources.getColor(R.color.color_no_default);
assertEquals(mResources.getColor(R.color.testcolor1), defaultColor);
}
+
+ @SmallTest
+ public void testLstar() throws Exception {
+ int defaultColor = mResources.getColor(R.color.color_with_lstar);
+ assertEquals(mResources.getColor(R.color.testcolor3), defaultColor);
+ }
}
diff --git a/data/etc/privapp-permissions-platform.xml b/data/etc/privapp-permissions-platform.xml
index 194c4a2..19332c7 100644
--- a/data/etc/privapp-permissions-platform.xml
+++ b/data/etc/privapp-permissions-platform.xml
@@ -154,9 +154,6 @@
<permission name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
<permission name="android.permission.MODIFY_AUDIO_ROUTING" />
<permission name="android.permission.GET_RUNTIME_PERMISSION_GROUP_MAPPING" />
-
- <!-- For permission hub 2 debugging only -->
- <permission name="android.permission.GET_ACCOUNTS_PRIVILEGED"/>
</privapp-permissions>
<privapp-permissions package="com.android.phone">
@@ -440,6 +437,7 @@
<permission name="android.permission.MANAGE_DEBUGGING" />
<!-- Permissions required for CTS test - TimeManagerTest -->
<permission name="android.permission.MANAGE_TIME_AND_ZONE_DETECTION" />
+ <permission name="android.permission.SUGGEST_EXTERNAL_TIME" />
<!-- Permissions required for CTS test - android.server.biometrics -->
<permission name="android.permission.USE_BIOMETRIC" />
<permission name="android.permission.TEST_BIOMETRIC" />
diff --git a/graphics/java/android/graphics/HardwareRenderer.java b/graphics/java/android/graphics/HardwareRenderer.java
index 8f1223b..954d062 100644
--- a/graphics/java/android/graphics/HardwareRenderer.java
+++ b/graphics/java/android/graphics/HardwareRenderer.java
@@ -1195,6 +1195,7 @@
// 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.
mContext = null;
@@ -1315,6 +1316,8 @@
private static native void nSetSdrWhitePoint(long nativeProxy, float whitePoint);
+ private static native void nSetIsHighEndGfx(boolean isHighEndGfx);
+
private static native int nSyncAndDrawFrame(long nativeProxy, long[] frameInfo, int size);
private static native void nDestroy(long nativeProxy, long rootRenderNode);
diff --git a/graphics/java/android/graphics/RadialGradient.java b/graphics/java/android/graphics/RadialGradient.java
index 199365e..e582e66 100644
--- a/graphics/java/android/graphics/RadialGradient.java
+++ b/graphics/java/android/graphics/RadialGradient.java
@@ -122,14 +122,18 @@
* between the center and edge of the circle.
* @param tileMode The Shader tiling mode
*
- * @throws IllegalArgumentException If one of the following circumstances:
- * - There are less than two colors
- * - The colors do not share the same {@link ColorSpace}
- * - The colors do not use a valid {@link ColorSpace}
- * - The {@code stops} parameter is not {@code null} and has a different length
- * from {@code colors}.
- * - The {@param startRadius} is negative
- * - The {@param endRadius} is less than or equal to zero
+ * @throws IllegalArgumentException In one of the following circumstances:
+ * <ul>
+ * <li>There are less than two colors</li>
+ * <li>The colors do not share the same {@link ColorSpace}</li>
+ * <li>The colors do not use a valid {@link ColorSpace}</li>
+ * <li>
+ * The {@code stops} parameter is not {@code null} and has a different length from
+ * {@code colors}.
+ * </li>
+ * <li>The {@code startRadius} is negative</li>
+ * <li>The {@code endRadius} is less than or equal to zero</li>
+ * </ul>
*/
public RadialGradient(float startX, float startY, @FloatRange(from = 0.0f) float startRadius,
float endX, float endY, @FloatRange(from = 0.0f, fromInclusive = false) float endRadius,
diff --git a/libs/WindowManager/Shell/res/drawable/bubble_stack_user_education_bg.xml b/libs/WindowManager/Shell/res/drawable/bubble_stack_user_education_bg.xml
index 4b9219c..dcc7821 100644
--- a/libs/WindowManager/Shell/res/drawable/bubble_stack_user_education_bg.xml
+++ b/libs/WindowManager/Shell/res/drawable/bubble_stack_user_education_bg.xml
@@ -14,9 +14,10 @@
~ limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="rectangle">
- <solid android:color="?android:attr/colorAccent"/>
+ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
+ android:shape="rectangle">
<corners
android:bottomRightRadius="360dp"
android:topRightRadius="360dp" />
+ <solid android:color="?androidprv:attr/colorAccentPrimary" />
</shape>
\ No newline at end of file
diff --git a/libs/WindowManager/Shell/res/drawable/bubble_stack_user_education_bg_rtl.xml b/libs/WindowManager/Shell/res/drawable/bubble_stack_user_education_bg_rtl.xml
index c7baba1..70b63e6 100644
--- a/libs/WindowManager/Shell/res/drawable/bubble_stack_user_education_bg_rtl.xml
+++ b/libs/WindowManager/Shell/res/drawable/bubble_stack_user_education_bg_rtl.xml
@@ -14,9 +14,10 @@
~ limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
android:shape="rectangle">
- <solid android:color="?android:attr/colorAccent"/>
<corners
android:bottomLeftRadius="360dp"
android:topLeftRadius="360dp" />
+ <solid android:color="?androidprv:attr/colorAccentPrimary" />
</shape>
diff --git a/libs/WindowManager/Shell/res/layout/bubble_expanded_view.xml b/libs/WindowManager/Shell/res/layout/bubble_expanded_view.xml
index 81656fe..33e009e 100644
--- a/libs/WindowManager/Shell/res/layout/bubble_expanded_view.xml
+++ b/libs/WindowManager/Shell/res/layout/bubble_expanded_view.xml
@@ -35,6 +35,7 @@
android:layout_height="wrap_content"
android:focusable="true"
android:text="@string/manage_bubbles_text"
+ android:textSize="@*android:dimen/text_size_body_2_material"
android:textColor="?android:attr/textColorPrimary"
/>
diff --git a/libs/WindowManager/Shell/res/layout/bubble_overflow_container.xml b/libs/WindowManager/Shell/res/layout/bubble_overflow_container.xml
index 270186a..76fe3c9 100644
--- a/libs/WindowManager/Shell/res/layout/bubble_overflow_container.xml
+++ b/libs/WindowManager/Shell/res/layout/bubble_overflow_container.xml
@@ -55,6 +55,7 @@
android:text="@string/bubble_overflow_empty_title"
android:fontFamily="@*android:string/config_bodyFontFamilyMedium"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body2"
+ android:textSize="@*android:dimen/text_size_body_2_material"
android:textColor="?android:attr/textColorSecondary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -66,6 +67,7 @@
android:layout_height="wrap_content"
android:fontFamily="@*android:string/config_bodyFontFamily"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body2"
+ android:textSize="@*android:dimen/text_size_body_2_material"
android:textColor="?android:attr/textColorSecondary"
android:text="@string/bubble_overflow_empty_subtitle"
android:paddingBottom="@dimen/bubble_empty_overflow_subtitle_padding"
diff --git a/libs/WindowManager/Shell/res/layout/bubble_stack_user_education.xml b/libs/WindowManager/Shell/res/layout/bubble_stack_user_education.xml
index fe6a8bd..fd4c3ba 100644
--- a/libs/WindowManager/Shell/res/layout/bubble_stack_user_education.xml
+++ b/libs/WindowManager/Shell/res/layout/bubble_stack_user_education.xml
@@ -38,7 +38,7 @@
android:gravity="start"
android:textAlignment="viewStart"
android:text="@string/bubbles_user_education_title"
- android:textColor="?android:attr/textColorPrimaryInverse"
+ android:textColor="@android:color/system_neutral1_900"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Headline"/>
<TextView
@@ -49,7 +49,7 @@
android:gravity="start"
android:textAlignment="viewStart"
android:text="@string/bubbles_user_education_description"
- android:textColor="?android:attr/textColorPrimaryInverse"
+ android:textColor="@android:color/system_neutral1_900"
android:fontFamily="@*android:string/config_bodyFontFamily"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body2"/>
</LinearLayout>
diff --git a/libs/WindowManager/Shell/res/layout/bubbles_manage_button_education.xml b/libs/WindowManager/Shell/res/layout/bubbles_manage_button_education.xml
index 3d48e40..c5c42fc 100644
--- a/libs/WindowManager/Shell/res/layout/bubbles_manage_button_education.xml
+++ b/libs/WindowManager/Shell/res/layout/bubbles_manage_button_education.xml
@@ -41,7 +41,7 @@
android:ellipsize="end"
android:gravity="start"
android:textAlignment="viewStart"
- android:textColor="?android:attr/textColorPrimaryInverse"
+ android:textColor="@android:color/system_neutral1_900"
android:text="@string/bubbles_user_education_manage_title"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Headline"/>
@@ -56,7 +56,7 @@
android:ellipsize="end"
android:gravity="start"
android:textAlignment="viewStart"
- android:textColor="?android:attr/textColorPrimaryInverse"
+ android:textColor="@android:color/system_neutral1_900"
android:fontFamily="@*android:string/config_bodyFontFamily"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body2"/>
@@ -75,7 +75,7 @@
android:focusable="true"
android:clickable="false"
android:text="@string/manage_bubbles_text"
- android:textColor="?android:attr/textColorPrimaryInverse"
+ android:textColor="@android:color/system_neutral1_900"
/>
<com.android.wm.shell.common.AlphaOptimizedButton
@@ -86,7 +86,7 @@
android:layout_height="wrap_content"
android:focusable="true"
android:text="@string/bubbles_user_education_got_it"
- android:textColor="?android:attr/textColorPrimaryInverse"
+ android:textColor="@android:color/system_neutral1_900"
/>
</LinearLayout>
</LinearLayout>
diff --git a/libs/WindowManager/Shell/res/values/dimen.xml b/libs/WindowManager/Shell/res/values/dimen.xml
index d94030d..9b1beb3 100644
--- a/libs/WindowManager/Shell/res/values/dimen.xml
+++ b/libs/WindowManager/Shell/res/values/dimen.xml
@@ -97,7 +97,7 @@
<!-- How much the bubble flyout text container is elevated. -->
<dimen name="bubble_flyout_elevation">4dp</dimen>
<!-- How much padding is around the left and right sides of the flyout text. -->
- <dimen name="bubble_flyout_padding_x">12dp</dimen>
+ <dimen name="bubble_flyout_padding_x">14dp</dimen>
<!-- How much padding is around the top and bottom of the flyout text. -->
<dimen name="bubble_flyout_padding_y">10dp</dimen>
<!-- Size of the triangle that points from the flyout to the bubble stack. -->
diff --git a/libs/WindowManager/Shell/res/values/ids.xml b/libs/WindowManager/Shell/res/values/ids.xml
index 434a000..8831b61 100644
--- a/libs/WindowManager/Shell/res/values/ids.xml
+++ b/libs/WindowManager/Shell/res/values/ids.xml
@@ -16,6 +16,8 @@
-->
<resources>
<item type="id" name="action_pip_resize" />
+ <item type="id" name="action_pip_stash" />
+ <item type="id" name="action_pip_unstash" />
<!-- Accessibility actions for the docked stack divider -->
<item type="id" name="action_move_tl_full" />
diff --git a/libs/WindowManager/Shell/res/values/strings.xml b/libs/WindowManager/Shell/res/values/strings.xml
index b1425e4..e512698 100644
--- a/libs/WindowManager/Shell/res/values/strings.xml
+++ b/libs/WindowManager/Shell/res/values/strings.xml
@@ -48,6 +48,12 @@
<!-- Accessibility action for resizing PIP [CHAR LIMIT=NONE] -->
<string name="accessibility_action_pip_resize">Resize</string>
+ <!-- Accessibility action for stashing PIP [CHAR LIMIT=NONE] -->
+ <string name="accessibility_action_pip_stash">Stash</string>
+
+ <!-- Accessibility action for unstashing PIP [CHAR LIMIT=NONE] -->
+ <string name="accessibility_action_pip_unstash">Unstash</string>
+
<!-- TODO Deprecated. Label for PIP action to Minimize the PIP. DO NOT TRANSLATE [CHAR LIMIT=25] -->
<string name="pip_phone_minimize">Minimize</string>
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java
index 6a0f061..7dcedfe 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java
@@ -715,7 +715,7 @@
}
if (newConfig.fontScale != mFontScale) {
mFontScale = newConfig.fontScale;
- mStackView.updateFontScale(mFontScale);
+ mStackView.updateFontScale();
}
if (newConfig.getLayoutDirection() != mLayoutDirection) {
mLayoutDirection = newConfig.getLayoutDirection();
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java
index d8ec650..a87da88 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java
@@ -46,6 +46,7 @@
import android.os.RemoteException;
import android.util.AttributeSet;
import android.util.Log;
+import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.SurfaceControl;
import android.view.View;
@@ -250,26 +251,14 @@
protected void onFinishInflate() {
super.onFinishInflate();
- Resources res = getResources();
+ mSettingsIcon = findViewById(R.id.settings_button);
+ mSettingsIconHeight = getContext().getResources().getDimensionPixelSize(
+ R.dimen.bubble_manage_button_height);
mPointerView = findViewById(R.id.pointer_view);
- mPointerWidth = res.getDimensionPixelSize(R.dimen.bubble_pointer_width);
- mPointerHeight = res.getDimensionPixelSize(R.dimen.bubble_pointer_height);
-
- mTopPointer = new ShapeDrawable(TriangleShape.create(
- mPointerWidth, mPointerHeight, true /* pointUp */));
- mLeftPointer = new ShapeDrawable(TriangleShape.createHorizontal(
- mPointerWidth, mPointerHeight, true /* pointLeft */));
- mRightPointer = new ShapeDrawable(TriangleShape.createHorizontal(
- mPointerWidth, mPointerHeight, false /* pointLeft */));
-
mCurrentPointer = mTopPointer;
mPointerView.setVisibility(INVISIBLE);
- mSettingsIconHeight = getContext().getResources().getDimensionPixelSize(
- R.dimen.bubble_manage_button_height);
- mSettingsIcon = findViewById(R.id.settings_button);
-
- // Set ActivityView's alpha value as zero, since there is no view content to be shown.
+ // Set TaskView's alpha value as zero, since there is no view content to be shown.
setContentVisibility(false);
mExpandedViewContainer.setOutlineProvider(new ViewOutlineProvider() {
@@ -293,7 +282,6 @@
applyThemeAttrs();
- mExpandedViewPadding = res.getDimensionPixelSize(R.dimen.bubble_expanded_view_padding);
setClipToPadding(false);
setOnTouchListener((view, motionEvent) -> {
if (mTaskView == null) {
@@ -354,7 +342,41 @@
Resources res = getResources();
mMinHeight = res.getDimensionPixelSize(R.dimen.bubble_expanded_default_height);
mOverflowHeight = res.getDimensionPixelSize(R.dimen.bubble_overflow_height);
+ mExpandedViewPadding = res.getDimensionPixelSize(R.dimen.bubble_expanded_view_padding);
+
mPointerMargin = res.getDimensionPixelSize(R.dimen.bubble_pointer_margin);
+ mPointerWidth = res.getDimensionPixelSize(R.dimen.bubble_pointer_width);
+ mPointerHeight = res.getDimensionPixelSize(R.dimen.bubble_pointer_height);
+
+ mTopPointer = new ShapeDrawable(TriangleShape.create(
+ mPointerWidth, mPointerHeight, true /* pointUp */));
+ mLeftPointer = new ShapeDrawable(TriangleShape.createHorizontal(
+ mPointerWidth, mPointerHeight, true /* pointLeft */));
+ mRightPointer = new ShapeDrawable(TriangleShape.createHorizontal(
+ mPointerWidth, mPointerHeight, false /* pointLeft */));
+
+ final float fontSize = mContext.getResources()
+ .getDimensionPixelSize(com.android.internal.R.dimen.text_size_body_2_material);
+ if (mSettingsIcon != null) {
+ mSettingsIcon.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize);
+ }
+ if (mOverflowView != null) {
+ mOverflowView.updateFontSize();
+ }
+ if (mPointerView != null) {
+ updatePointerView();
+ }
+ }
+
+ void updateFontSize() {
+ final float fontSize = mContext.getResources()
+ .getDimensionPixelSize(com.android.internal.R.dimen.text_size_body_2_material);
+ if (mSettingsIcon != null) {
+ mSettingsIcon.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize);
+ }
+ if (mOverflowView != null) {
+ mOverflowView.updateFontSize();
+ }
}
void applyThemeAttrs() {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleFlyoutView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleFlyoutView.java
index 57a2b6c..79f77d7 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleFlyoutView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleFlyoutView.java
@@ -65,6 +65,9 @@
private static final long FLYOUT_FADE_OUT_DURATION = 150L;
private static final long FLYOUT_FADE_IN_DURATION = 250L;
+ // Whether the flyout view should show a pointer to the bubble.
+ private static final boolean SHOW_POINTER = false;
+
private final int mFlyoutPadding;
private final int mFlyoutSpaceFromBubble;
private final int mPointerSize;
@@ -166,14 +169,16 @@
final Resources res = getResources();
mFlyoutPadding = res.getDimensionPixelSize(R.dimen.bubble_flyout_padding_x);
mFlyoutSpaceFromBubble = res.getDimensionPixelSize(R.dimen.bubble_flyout_space_from_bubble);
- mPointerSize = res.getDimensionPixelSize(R.dimen.bubble_flyout_pointer_size);
+ mPointerSize = SHOW_POINTER
+ ? res.getDimensionPixelSize(R.dimen.bubble_flyout_pointer_size)
+ : 0;
mBubbleElevation = res.getDimensionPixelSize(R.dimen.bubble_elevation);
mFlyoutElevation = res.getDimensionPixelSize(R.dimen.bubble_flyout_elevation);
final TypedArray ta = mContext.obtainStyledAttributes(
new int[] {
- android.R.attr.colorBackgroundFloating,
+ com.android.internal.R.attr.colorSurface,
android.R.attr.dialogCornerRadius});
mFloatingBackgroundColor = ta.getColor(0, Color.WHITE);
mCornerRadius = ta.getDimensionPixelSize(1, 0);
@@ -182,7 +187,7 @@
// Add padding for the pointer on either side, onDraw will draw it in this space.
setPadding(mPointerSize, 0, mPointerSize, 0);
setWillNotDraw(false);
- setClipChildren(false);
+ setClipChildren(!SHOW_POINTER);
setTranslationZ(mFlyoutElevation);
setOutlineProvider(new ViewOutlineProvider() {
@Override
@@ -216,12 +221,11 @@
super.onDraw(canvas);
}
- void updateFontSize(float fontScale) {
+ void updateFontSize() {
final float fontSize = mContext.getResources()
.getDimensionPixelSize(com.android.internal.R.dimen.text_size_body_2_material);
- final float newFontSize = fontSize * fontScale;
- mMessageText.setTextSize(TypedValue.COMPLEX_UNIT_PX, newFontSize);
- mSenderText.setTextSize(TypedValue.COMPLEX_UNIT_PX, newFontSize);
+ mMessageText.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize);
+ mSenderText.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize);
}
/*
@@ -462,6 +466,7 @@
/** Renders the 'pointer' triangle that points from the flyout to the bubble stack. */
private void renderPointerTriangle(
Canvas canvas, float currentFlyoutWidth, float currentFlyoutHeight) {
+ if (!SHOW_POINTER) return;
canvas.save();
// Translation to apply for the 'retraction' effect as the flyout collapses.
@@ -489,13 +494,12 @@
// current position.
relevantTriangle.getOutline(mTriangleOutline);
mTriangleOutline.offset((int) arrowTranslationX, (int) arrowTranslationY);
-
canvas.restore();
}
/** Builds an outline that includes the transformed flyout background and triangle. */
private void getOutline(Outline outline) {
- if (!mTriangleOutline.isEmpty()) {
+ if (!mTriangleOutline.isEmpty() || !SHOW_POINTER) {
// Draw the rect into the outline as a path so we can merge the triangle path into it.
final Path rectPath = new Path();
final float interpolatedRadius = getInterpolatedRadius();
@@ -504,7 +508,7 @@
outline.setPath(rectPath);
// Get rid of the triangle path once it has disappeared behind the flyout.
- if (mPercentStillFlyout > 0.5f) {
+ if (SHOW_POINTER && mPercentStillFlyout > 0.5f) {
outline.mPath.addPath(mTriangleOutline.mPath);
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt
index 36908b8..e4b1f64 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflow.kt
@@ -82,7 +82,7 @@
fun updateResources() {
bitmapSize = positioner.bubbleBitmapSize
- iconBitmapSize = (bitmapSize * 0.46f).toInt()
+ iconBitmapSize = (bitmapSize * ICON_BITMAP_SIZE_PERCENT).toInt()
val bubbleSize = positioner.bubbleSize
overflowBtn?.layoutParams = FrameLayout.LayoutParams(bubbleSize, bubbleSize)
expandedView?.updateDimensions()
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java
index af5b3a6..d3b7ae2 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleOverflowContainerView.java
@@ -27,6 +27,7 @@
import android.graphics.Color;
import android.util.AttributeSet;
import android.util.Log;
+import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -181,6 +182,13 @@
mEmptyStateSubtitle.setTextColor(textColor);
}
+ public void updateFontSize() {
+ final float fontSize = mContext.getResources()
+ .getDimensionPixelSize(com.android.internal.R.dimen.text_size_body_2_material);
+ mEmptyStateTitle.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize);
+ mEmptyStateSubtitle.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize);
+ }
+
private final BubbleData.Listener mDataListener = new BubbleData.Listener() {
@Override
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 07d16b5..64a3b8f 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
@@ -1180,8 +1180,17 @@
addView(mFlyout, new FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT));
}
- void updateFontScale(float fontScale) {
- mFlyout.updateFontSize(fontScale);
+ void updateFontScale() {
+ setUpManageMenu();
+ mFlyout.updateFontSize();
+ for (Bubble b : mBubbleData.getBubbles()) {
+ if (b.getExpandedView() != null) {
+ b.getExpandedView().updateFontSize();
+ }
+ }
+ if (mBubbleOverflow != null) {
+ mBubbleOverflow.getExpandedView().updateFontSize();
+ }
}
private void updateOverflow() {
@@ -1244,6 +1253,8 @@
/** Respond to the display size change by recalculating view size and location. */
public void onDisplaySizeChanged() {
updateOverflow();
+ setUpManageMenu();
+ setUpFlyout();
mBubbleSize = mPositioner.getBubbleSize();
for (Bubble b : mBubbleData.getBubbles()) {
if (b.getIconView() == null) {
@@ -1251,6 +1262,9 @@
continue;
}
b.getIconView().setLayoutParams(new LayoutParams(mBubbleSize, mBubbleSize));
+ if (b.getExpandedView() != null) {
+ b.getExpandedView().updateDimensions();
+ }
}
mBubbleOverflow.getIconView().setLayoutParams(new LayoutParams(mBubbleSize, mBubbleSize));
mExpandedAnimationController.updateResources();
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/ScreenshotUtils.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/ScreenshotUtils.java
new file mode 100644
index 0000000..e59845c
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/ScreenshotUtils.java
@@ -0,0 +1,68 @@
+/*
+ * 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.wm.shell.common;
+
+import android.graphics.GraphicBuffer;
+import android.graphics.PixelFormat;
+import android.graphics.Rect;
+import android.view.SurfaceControl;
+
+/**
+ * Helpers for working with screenshots.
+ */
+public class ScreenshotUtils {
+
+ /**
+ * Take a screenshot of the specified SurfaceControl.
+ *
+ * @param t the transaction used to set changes on the resulting screenshot.
+ * @param sc the SurfaceControl to take a screenshot of
+ * @param crop the crop to use when capturing the screenshot
+ *
+ * @return A SurfaceControl where the screenshot will be attached, or null if failed.
+ */
+ public static SurfaceControl takeScreenshot(SurfaceControl.Transaction t, SurfaceControl sc,
+ Rect crop) {
+ final SurfaceControl.ScreenshotHardwareBuffer buffer = SurfaceControl.captureLayers(
+ new SurfaceControl.LayerCaptureArgs.Builder(sc)
+ .setSourceCrop(crop)
+ .setCaptureSecureLayers(true)
+ .setAllowProtected(true)
+ .build()
+ );
+ if (buffer == null || buffer.getHardwareBuffer() == null) {
+ return null;
+ }
+ final GraphicBuffer graphicBuffer = GraphicBuffer.createFromHardwareBuffer(
+ buffer.getHardwareBuffer());
+ final SurfaceControl screenshot = new SurfaceControl.Builder()
+ .setName("ScreenshotUtils screenshot")
+ .setFormat(PixelFormat.TRANSLUCENT)
+ .setSecure(buffer.containsSecureLayers())
+ .setCallsite("ScreenshotUtils.takeScreenshot")
+ .setBLASTLayer()
+ .build();
+
+ t.setBuffer(screenshot, graphicBuffer);
+ t.setColorSpace(screenshot, buffer.getColorSpace());
+ t.reparent(screenshot, sc);
+ t.setLayer(screenshot, Integer.MAX_VALUE);
+ t.show(screenshot);
+ t.apply();
+ return screenshot;
+ }
+}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java
index a920f9c..cba019a 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java
@@ -131,11 +131,10 @@
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
- mVelocityTracker.addMovement(event);
releaseTouching();
-
if (!mMoving) break;
+ mVelocityTracker.addMovement(event);
mVelocityTracker.computeCurrentVelocity(1000 /* units */);
final float velocity = isLandscape
? mVelocityTracker.getXVelocity()
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java
index 0f16c8a..7e4010d 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/DividerView.java
@@ -521,12 +521,14 @@
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
- mVelocityTracker.addMovement(event);
-
- if (!mMoving) break;
+ if (!mMoving) {
+ stopDragging();
+ break;
+ }
x = (int) event.getRawX();
y = (int) event.getRawY();
+ mVelocityTracker.addMovement(event);
mVelocityTracker.computeCurrentVelocity(1000);
int position = calculatePosition(x, y);
stopDragging(position, isHorizontalDivision() ? mVelocityTracker.getYVelocity()
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 17e0d1b..a2c6567 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
@@ -89,6 +89,11 @@
|| direction == TRANSITION_DIRECTION_LEAVE_PIP_TO_SPLIT_SCREEN;
}
+ /** Whether the given direction represents removing PIP. */
+ public static boolean isRemovePipDirection(@TransitionDirection int direction) {
+ return direction == TRANSITION_DIRECTION_REMOVE_STACK;
+ }
+
private final PipSurfaceTransactionHelper mSurfaceTransactionHelper;
private final ThreadLocal<AnimationHandler> mSfAnimationHandlerThreadLocal =
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java
index 7b834b2..046c320 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java
@@ -367,7 +367,15 @@
* the default stack bounds when first entering PiP.
*/
public float getSnapFraction(Rect stackBounds) {
- return mSnapAlgorithm.getSnapFraction(stackBounds, getMovementBounds(stackBounds));
+ return getSnapFraction(stackBounds, getMovementBounds(stackBounds));
+ }
+
+ /**
+ * @return the default snap fraction to apply instead of the default gravity when calculating
+ * the default stack bounds when first entering PiP.
+ */
+ public float getSnapFraction(Rect stackBounds, Rect movementBounds) {
+ return mSnapAlgorithm.getSnapFraction(stackBounds, movementBounds);
}
/**
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsState.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsState.java
index 561dff0..e3674dc 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsState.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsState.java
@@ -55,7 +55,7 @@
STASH_TYPE_RIGHT
})
@Retention(RetentionPolicy.SOURCE)
- @interface StashType {}
+ public @interface StashType {}
private static final String TAG = PipBoundsState.class.getSimpleName();
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 b352871..fe64769 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
@@ -39,6 +39,7 @@
import static com.android.wm.shell.pip.PipAnimationController.TRANSITION_DIRECTION_USER_RESIZE;
import static com.android.wm.shell.pip.PipAnimationController.isInPipDirection;
import static com.android.wm.shell.pip.PipAnimationController.isOutPipDirection;
+import static com.android.wm.shell.pip.PipAnimationController.isRemovePipDirection;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -70,6 +71,7 @@
import com.android.wm.shell.ShellTaskOrganizer;
import com.android.wm.shell.animation.Interpolators;
import com.android.wm.shell.common.DisplayController;
+import com.android.wm.shell.common.ScreenshotUtils;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.SyncTransactionQueue;
import com.android.wm.shell.common.annotations.ShellMainThread;
@@ -185,8 +187,17 @@
mDeferredAnimEndTransaction = tx;
return;
}
- finishResize(tx, destinationBounds, direction, animationType);
- sendOnPipTransitionFinished(direction);
+ final boolean isExitPipDirection = isOutPipDirection(direction)
+ || isRemovePipDirection(direction);
+ if (mState != State.EXITING_PIP || isExitPipDirection) {
+ // Finish resize as long as we're not exiting PIP, or, if we are, only if this is
+ // the end of an exit PIP animation.
+ // This is necessary in case there was a resize animation ongoing when exit PIP
+ // started, in which case the first resize will be skipped to let the exit
+ // operation handle the final resize out of PIP mode. See b/185306679.
+ finishResize(tx, destinationBounds, direction, animationType);
+ sendOnPipTransitionFinished(direction);
+ }
if (direction == TRANSITION_DIRECTION_TO_PIP) {
// TODO (b//169221267): Add jank listener for transactions without buffer updates.
//InteractionJankMonitor.getInstance().end(
@@ -1119,6 +1130,7 @@
private void finishResize(SurfaceControl.Transaction tx, Rect destinationBounds,
@PipAnimationController.TransitionDirection int direction,
@PipAnimationController.AnimationType int type) {
+ final Rect preResizeBounds = new Rect(mPipBoundsState.getBounds());
mPipBoundsState.setBounds(destinationBounds);
if (direction == TRANSITION_DIRECTION_REMOVE_STACK) {
removePipImmediately();
@@ -1142,23 +1154,26 @@
&& mPictureInPictureParams != null
&& !mPictureInPictureParams.isSeamlessResizeEnabled();
if (animateCrossFadeResize) {
- // Take a snapshot of the PIP task and hide it. We'll show it and fade it out after
- // the wct transaction is applied and the activity is laid out again.
- final SurfaceControl snapshotSurface = mTaskOrganizer.takeScreenshot(mToken);
- mSurfaceTransactionHelper.reparentAndShowSurfaceSnapshot(
- mSurfaceControlTransactionFactory.getTransaction(), mLeash, snapshotSurface);
- mSyncTransactionQueue.queue(wct);
- mSyncTransactionQueue.runInSync(t -> {
- // Scale the snapshot from its pre-resize bounds to the post-resize bounds.
- final Rect snapshotSrc = new Rect(0, 0, snapshotSurface.getWidth(),
- snapshotSurface.getHeight());
- final Rect snapshotDest = new Rect(0, 0, destinationBounds.width(),
- destinationBounds.height());
- mSurfaceTransactionHelper.scale(t, snapshotSurface, snapshotSrc, snapshotDest);
+ // Take a snapshot of the PIP task and show it. We'll fade it out after the wct
+ // transaction is applied and the activity is laid out again.
+ preResizeBounds.offsetTo(0, 0);
+ final Rect snapshotDest = new Rect(0, 0, destinationBounds.width(),
+ destinationBounds.height());
+ final SurfaceControl snapshotSurface = ScreenshotUtils.takeScreenshot(
+ mSurfaceControlTransactionFactory.getTransaction(), mLeash, preResizeBounds);
+ if (snapshotSurface != null) {
+ mSyncTransactionQueue.queue(wct);
+ mSyncTransactionQueue.runInSync(t -> {
+ // Scale the snapshot from its pre-resize bounds to the post-resize bounds.
+ mSurfaceTransactionHelper.scale(t, snapshotSurface, preResizeBounds,
+ snapshotDest);
- // Start animation to fade out the snapshot.
- fadeOutAndRemoveOverlay(snapshotSurface);
- });
+ // Start animation to fade out the snapshot.
+ fadeOutAndRemoveOverlay(snapshotSurface);
+ });
+ } else {
+ applyFinishBoundsResize(wct, direction);
+ }
} else {
applyFinishBoundsResize(wct, direction);
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java
index 052653e..140f32f9 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PhonePipMenuController.java
@@ -173,13 +173,6 @@
detachPipMenuView();
}
-
- void onPinnedStackAnimationEnded() {
- if (isMenuVisible()) {
- mPipMenuView.onPipAnimationEnded();
- }
- }
-
private void attachPipMenuView() {
// In case detach was not called (e.g. PIP unexpectedly closed)
if (mPipMenuView != null) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipAccessibilityInteractionConnection.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipAccessibilityInteractionConnection.java
index 3b65899..47a8c67 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipAccessibilityInteractionConnection.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipAccessibilityInteractionConnection.java
@@ -15,6 +15,8 @@
*/
package com.android.wm.shell.pip.phone;
+import static com.android.wm.shell.pip.PipBoundsState.STASH_TYPE_NONE;
+
import android.annotation.NonNull;
import android.content.Context;
import android.graphics.Rect;
@@ -59,6 +61,7 @@
private final PipTaskOrganizer mTaskOrganizer;
private final PipSnapAlgorithm mSnapAlgorithm;
private final Runnable mUpdateMovementBoundCallback;
+ private final Runnable mUnstashCallback;
private final AccessibilityCallbacks mCallbacks;
private final IAccessibilityInteractionConnection mConnectionImpl;
@@ -72,7 +75,7 @@
@NonNull PipBoundsState pipBoundsState, PipMotionHelper motionHelper,
PipTaskOrganizer taskOrganizer, PipSnapAlgorithm snapAlgorithm,
AccessibilityCallbacks callbacks, Runnable updateMovementBoundCallback,
- ShellExecutor mainExcutor) {
+ Runnable unstashCallback, ShellExecutor mainExcutor) {
mContext = context;
mMainExcutor = mainExcutor;
mPipBoundsState = pipBoundsState;
@@ -80,6 +83,7 @@
mTaskOrganizer = taskOrganizer;
mSnapAlgorithm = snapAlgorithm;
mUpdateMovementBoundCallback = updateMovementBoundCallback;
+ mUnstashCallback = unstashCallback;
mCallbacks = callbacks;
mConnectionImpl = new PipAccessibilityInteractionConnectionImpl();
}
@@ -118,6 +122,13 @@
setToNormalBounds();
}
result = true;
+ } else if (action == R.id.action_pip_stash) {
+ mMotionHelper.animateToStashedClosestEdge();
+ result = true;
+ } else if (action == R.id.action_pip_unstash) {
+ mUnstashCallback.run();
+ mPipBoundsState.setStashed(STASH_TYPE_NONE);
+ result = true;
} else {
switch (action) {
case AccessibilityNodeInfo.ACTION_CLICK:
@@ -246,6 +257,10 @@
info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_EXPAND);
info.addAction(new AccessibilityNodeInfo.AccessibilityAction(R.id.action_pip_resize,
context.getString(R.string.accessibility_action_pip_resize)));
+ info.addAction(new AccessibilityNodeInfo.AccessibilityAction(R.id.action_pip_stash,
+ context.getString(R.string.accessibility_action_pip_stash)));
+ info.addAction(new AccessibilityNodeInfo.AccessibilityAction(R.id.action_pip_unstash,
+ context.getString(R.string.accessibility_action_pip_unstash)));
info.setImportantForAccessibility(true);
info.setClickable(true);
info.setVisibleToUser(true);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
index f80b161..4f3ec96 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
@@ -36,7 +36,6 @@
import android.graphics.Rect;
import android.os.IBinder;
import android.os.RemoteException;
-import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserManager;
import android.util.Log;
@@ -52,6 +51,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.wm.shell.R;
import com.android.wm.shell.WindowManagerShellWrapper;
import com.android.wm.shell.common.DisplayChangeController;
@@ -169,7 +169,8 @@
}
};
- private final DisplayController.OnDisplaysChangedListener mDisplaysChangedListener =
+ @VisibleForTesting
+ final DisplayController.OnDisplaysChangedListener mDisplaysChangedListener =
new DisplayController.OnDisplaysChangedListener() {
@Override
public void onFixedRotationStarted(int displayId, int newRotation) {
@@ -451,7 +452,7 @@
null /* windowContainerTransaction */);
};
- if (saveRestoreSnapFraction) {
+ if (mPipTaskOrganizer.isInPip() && saveRestoreSnapFraction) {
// Calculate the snap fraction of the current stack along the old movement bounds
final PipSnapAlgorithm pipSnapAlgorithm = mPipBoundsAlgorithm.getSnapAlgorithm();
final Rect postChangeStackBounds = new Rect(mPipBoundsState.getBounds());
@@ -606,7 +607,6 @@
// Re-enable touches after the animation completes
mTouchHandler.setTouchEnabled(true);
mTouchHandler.onPinnedStackAnimationEnded(direction);
- mMenuController.onPinnedStackAnimationEnded();
}
private void updateMovementBounds(@Nullable Rect toBounds, boolean fromRotation,
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
index 7b17fe4..e210835 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java
@@ -40,7 +40,6 @@
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Rect;
-import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
@@ -279,11 +278,17 @@
mMenuContainerAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
+ mAllowTouches = true;
notifyMenuStateChangeFinish(menuState);
if (allowMenuTimeout) {
repostDelayedHide(INITIAL_DISMISS_DELAY);
}
}
+
+ @Override
+ public void onAnimationCancel(Animator animation) {
+ mAllowTouches = true;
+ }
});
if (withDelay) {
// starts the menu container animation after window expansion is completed
@@ -326,10 +331,6 @@
cancelDelayedHide();
}
- void onPipAnimationEnded() {
- mAllowTouches = true;
- }
-
void updateMenuLayout(Rect bounds) {
mPipMenuIconsAlgorithm.onBoundsChanged(bounds);
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java
index 9401cd6..15e7f07 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java
@@ -21,7 +21,9 @@
import static androidx.dynamicanimation.animation.SpringForce.STIFFNESS_MEDIUM;
import static com.android.wm.shell.pip.PipAnimationController.TRANSITION_DIRECTION_EXPAND_OR_UNEXPAND;
+import static com.android.wm.shell.pip.PipBoundsState.STASH_TYPE_LEFT;
import static com.android.wm.shell.pip.PipBoundsState.STASH_TYPE_NONE;
+import static com.android.wm.shell.pip.PipBoundsState.STASH_TYPE_RIGHT;
import static com.android.wm.shell.pip.phone.PipMenuView.ANIM_TYPE_DISMISS;
import static com.android.wm.shell.pip.phone.PipMenuView.ANIM_TYPE_NONE;
@@ -499,6 +501,28 @@
}
/**
+ * Animates the PiP to the stashed state, choosing the closest edge.
+ */
+ void animateToStashedClosestEdge() {
+ Rect tmpBounds = new Rect();
+ final Rect insetBounds = mPipBoundsState.getDisplayLayout().stableInsets();
+ final int stashType =
+ mPipBoundsState.getBounds().left == mPipBoundsState.getMovementBounds().left
+ ? STASH_TYPE_LEFT : STASH_TYPE_RIGHT;
+ final float leftEdge = stashType == STASH_TYPE_LEFT
+ ? mPipBoundsState.getStashOffset()
+ - mPipBoundsState.getBounds().width() + insetBounds.left
+ : mPipBoundsState.getDisplayBounds().right
+ - mPipBoundsState.getStashOffset() - insetBounds.right;
+ tmpBounds.set((int) leftEdge,
+ mPipBoundsState.getBounds().top,
+ (int) (leftEdge + mPipBoundsState.getBounds().width()),
+ mPipBoundsState.getBounds().bottom);
+ resizeAndAnimatePipUnchecked(tmpBounds, UNSTASH_DURATION);
+ mPipBoundsState.setStashed(stashType);
+ }
+
+ /**
* Animates the PiP from stashed state into un-stashed, popping it out from the edge.
*/
void animateToUnStashedBounds(Rect unstashedBounds) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java
index f9a196d..32553f9 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java
@@ -517,7 +517,18 @@
|| mLastResizeBounds.height() >= PINCH_RESIZE_AUTO_MAX_RATIO * mMaxSize.y) {
resizeRectAboutCenter(mLastResizeBounds, mMaxSize.x, mMaxSize.y);
}
- final float snapFraction = mPipBoundsAlgorithm.getSnapFraction(mLastResizeBounds);
+ final int leftEdge = mLastResizeBounds.left;
+ final Rect movementBounds =
+ mPipBoundsAlgorithm.getMovementBounds(mLastResizeBounds);
+ final int fromLeft = Math.abs(leftEdge - movementBounds.left);
+ final int fromRight = Math.abs(movementBounds.right - leftEdge);
+ // The PIP will be snapped to either the right or left edge, so calculate which one
+ // is closest to the current position.
+ final int newLeft = fromLeft < fromRight
+ ? movementBounds.left : movementBounds.right;
+ mLastResizeBounds.offsetTo(newLeft, mLastResizeBounds.top);
+ final float snapFraction = mPipBoundsAlgorithm.getSnapFraction(
+ mLastResizeBounds, movementBounds);
mPipBoundsAlgorithm.applySnapFraction(mLastResizeBounds, snapFraction);
mPipTaskOrganizer.scheduleAnimateResizePip(startBounds, mLastResizeBounds,
PINCH_RESIZE_SNAP_DURATION, mAngle, callback);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java
index f2e250a..304390d 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java
@@ -204,7 +204,8 @@
mainExecutor);
mConnection = new PipAccessibilityInteractionConnection(mContext, pipBoundsState,
mMotionHelper, pipTaskOrganizer, mPipBoundsAlgorithm.getSnapAlgorithm(),
- this::onAccessibilityShowMenu, this::updateMovementBounds, mainExecutor);
+ this::onAccessibilityShowMenu, this::updateMovementBounds,
+ this::animateToUnStashedState, mainExecutor);
}
public void init() {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/TaskSnapshotWindow.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/TaskSnapshotWindow.java
index b468462..8147b47 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/TaskSnapshotWindow.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/TaskSnapshotWindow.java
@@ -16,7 +16,6 @@
package com.android.wm.shell.startingsurface;
-import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.graphics.Color.WHITE;
import static android.graphics.Color.alpha;
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
@@ -63,7 +62,6 @@
import android.hardware.HardwareBuffer;
import android.os.IBinder;
import android.os.RemoteException;
-import android.os.SystemClock;
import android.os.Trace;
import android.util.MergedConfiguration;
import android.util.Slog;
@@ -94,9 +92,6 @@
* @hide
*/
public class TaskSnapshotWindow {
-
- private static final long SIZE_MISMATCH_MINIMUM_TIME_MS = 450;
-
/**
* When creating the starting window, we use the exact same layout flags such that we end up
* with a window with the exact same dimensions etc. However, these flags are not used in layout
@@ -136,10 +131,8 @@
private final RectF mTmpDstFrame = new RectF();
private final CharSequence mTitle;
private boolean mHasDrawn;
- private long mShownTime;
private boolean mSizeMismatch;
private final Paint mBackgroundPaint = new Paint();
- private final int mActivityType;
private final int mStatusBarColor;
private final SystemBarBackgroundPainter mSystemBarBackgroundPainter;
private final int mOrientationOnCreation;
@@ -195,8 +188,6 @@
final Point taskSize = snapshot.getTaskSize();
final Rect taskBounds = new Rect(0, 0, taskSize.x, taskSize.y);
final int orientation = snapshot.getOrientation();
-
- final int activityType = runningTaskInfo.topActivityType;
final int displayId = runningTaskInfo.displayId;
final IWindowSession session = WindowManagerGlobal.getWindowSession();
@@ -216,7 +207,7 @@
final TaskSnapshotWindow snapshotSurface = new TaskSnapshotWindow(
surfaceControl, snapshot, layoutParams.getTitle(), taskDescription, appearance,
- windowFlags, windowPrivateFlags, taskBounds, orientation, activityType,
+ windowFlags, windowPrivateFlags, taskBounds, orientation,
topWindowInsetsState, clearWindowHandler, mainExecutor);
final Window window = snapshotSurface.mWindow;
@@ -256,8 +247,8 @@
public TaskSnapshotWindow(SurfaceControl surfaceControl,
TaskSnapshot snapshot, CharSequence title, TaskDescription taskDescription,
int appearance, int windowFlags, int windowPrivateFlags, Rect taskBounds,
- int currentOrientation, int activityType, InsetsState topWindowInsetsState,
- Runnable clearWindowHandler, ShellExecutor splashScreenExecutor) {
+ int currentOrientation, InsetsState topWindowInsetsState, Runnable clearWindowHandler,
+ ShellExecutor splashScreenExecutor) {
mSplashScreenExecutor = splashScreenExecutor;
mSession = WindowManagerGlobal.getWindowSession();
mWindow = new Window();
@@ -272,7 +263,6 @@
windowPrivateFlags, appearance, taskDescription, 1f, topWindowInsetsState);
mStatusBarColor = taskDescription.getStatusBarColor();
mOrientationOnCreation = currentOrientation;
- mActivityType = activityType;
mTransaction = new SurfaceControl.Transaction();
mClearWindowHandler = clearWindowHandler;
}
@@ -295,17 +285,6 @@
}
void remove() {
- final long now = SystemClock.uptimeMillis();
- if (mSizeMismatch && now - mShownTime < SIZE_MISMATCH_MINIMUM_TIME_MS
- // Show the latest content as soon as possible for unlocking to home.
- && mActivityType != ACTIVITY_TYPE_HOME) {
- final long delayTime = mShownTime + SIZE_MISMATCH_MINIMUM_TIME_MS - now;
- mSplashScreenExecutor.executeDelayed(() -> remove(), delayTime);
- if (DEBUG) {
- Slog.d(TAG, "Defer removing snapshot surface in " + delayTime);
- }
- return;
- }
try {
if (DEBUG) {
Slog.d(TAG, "Removing snapshot surface, mHasDrawn: " + mHasDrawn);
@@ -346,7 +325,6 @@
} else {
drawSizeMatchSnapshot();
}
- mShownTime = SystemClock.uptimeMillis();
mHasDrawn = true;
reportDrawn();
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java
index 3251abc..60707cc 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java
@@ -22,6 +22,7 @@
import static android.view.WindowManager.TRANSIT_OPEN;
import static android.view.WindowManager.TRANSIT_TO_BACK;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
+import static android.window.TransitionInfo.FLAG_IS_WALLPAPER;
import static android.window.TransitionInfo.FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT;
import static com.android.wm.shell.common.ExecutorUtils.executeRemoteCallWithTaskPermission;
@@ -226,18 +227,11 @@
}
/**
- * Reparents all participants into a shared parent and orders them based on: the global transit
- * type, their transit mode, and their destination z-order.
+ * Sets up visibility/alpha/transforms to resemble the starting state of an animation.
*/
private static void setupStartState(@NonNull TransitionInfo info,
@NonNull SurfaceControl.Transaction t, @NonNull SurfaceControl.Transaction finishT) {
boolean isOpening = isOpeningType(info.getType());
- if (info.getRootLeash().isValid()) {
- t.show(info.getRootLeash());
- }
- // Put animating stuff above this line and put static stuff below it.
- int zSplitLine = info.getChanges().size();
- // changes should be ordered top-to-bottom in z
for (int i = info.getChanges().size() - 1; i >= 0; --i) {
final TransitionInfo.Change change = info.getChanges().get(i);
final SurfaceControl leash = change.getLeash();
@@ -254,6 +248,52 @@
continue;
}
+ if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT) {
+ t.show(leash);
+ t.setMatrix(leash, 1, 0, 0, 1);
+ if (isOpening
+ // If this is a transferred starting window, we want it immediately visible.
+ && (change.getFlags() & FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT) == 0) {
+ t.setAlpha(leash, 0.f);
+ // fix alpha in finish transaction in case the animator itself no-ops.
+ finishT.setAlpha(leash, 1.f);
+ }
+ } else if (mode == TRANSIT_CLOSE || mode == TRANSIT_TO_BACK) {
+ // Wallpaper is a bit of an anomaly: it's visibility is tied to other WindowStates.
+ // As a result, we actually can't hide it's WindowToken because there may not be a
+ // transition associated with it becoming visible again. Fortunately, since it is
+ // always z-ordered to the back, we don't have to worry about it flickering to the
+ // front during reparenting, so the hide here isn't necessary for it.
+ if ((change.getFlags() & FLAG_IS_WALLPAPER) == 0) {
+ finishT.hide(leash);
+ }
+ }
+ }
+ }
+
+ /**
+ * Reparents all participants into a shared parent and orders them based on: the global transit
+ * type, their transit mode, and their destination z-order.
+ */
+ private static void setupAnimHierarchy(@NonNull TransitionInfo info,
+ @NonNull SurfaceControl.Transaction t, @NonNull SurfaceControl.Transaction finishT) {
+ boolean isOpening = isOpeningType(info.getType());
+ if (info.getRootLeash().isValid()) {
+ t.show(info.getRootLeash());
+ }
+ // Put animating stuff above this line and put static stuff below it.
+ int zSplitLine = info.getChanges().size();
+ // changes should be ordered top-to-bottom in z
+ for (int i = info.getChanges().size() - 1; i >= 0; --i) {
+ final TransitionInfo.Change change = info.getChanges().get(i);
+ final SurfaceControl leash = change.getLeash();
+ final int mode = info.getChanges().get(i).getMode();
+
+ // Don't reparent anything that isn't independent within its parents
+ if (!TransitionInfo.isIndependent(change, info)) {
+ continue;
+ }
+
boolean hasParent = change.getParent() != null;
if (!hasParent) {
@@ -263,24 +303,12 @@
}
// Put all the OPEN/SHOW on top
if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT) {
- t.show(leash);
- t.setMatrix(leash, 1, 0, 0, 1);
if (isOpening) {
- // put on top with 0 alpha
+ // put on top
t.setLayer(leash, zSplitLine + info.getChanges().size() - i);
- if ((change.getFlags() & FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT) != 0) {
- // This received a transferred starting window, so make it immediately
- // visible.
- t.setAlpha(leash, 1.f);
- } else {
- t.setAlpha(leash, 0.f);
- // fix alpha in finish transaction in case the animator itself no-ops.
- finishT.setAlpha(leash, 1.f);
- }
} else {
- // put on bottom and leave it visible
+ // put on bottom
t.setLayer(leash, zSplitLine - i);
- t.setAlpha(leash, 1.f);
}
} else if (mode == TRANSIT_CLOSE || mode == TRANSIT_TO_BACK) {
if (isOpening) {
@@ -290,7 +318,7 @@
// put on top
t.setLayer(leash, zSplitLine + info.getChanges().size() - i);
}
- } else { // CHANGE
+ } else { // CHANGE or other
t.setLayer(leash, zSplitLine + info.getChanges().size() - i);
}
}
@@ -329,6 +357,8 @@
active.mInfo = info;
active.mStartT = t;
active.mFinishT = finishT;
+ setupStartState(active.mInfo, active.mStartT, active.mFinishT);
+
if (activeIdx > 0) {
// This is now playing at the same time as an existing animation, so try merging it.
attemptMergeTransition(mActiveTransitions.get(0), active);
@@ -357,7 +387,7 @@
}
void playTransition(@NonNull ActiveTransition active) {
- setupStartState(active.mInfo, active.mStartT, active.mFinishT);
+ setupAnimHierarchy(active.mInfo, active.mStartT, active.mFinishT);
// If a handler already chose to run this animation, try delegating to it first.
if (active.mHandler != null) {
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/EnterSplitScreenFromDetachedRecentTask.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/EnterSplitScreenFromDetachedRecentTask.kt
new file mode 100644
index 0000000..f91f634
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/EnterSplitScreenFromDetachedRecentTask.kt
@@ -0,0 +1,92 @@
+/*
+ * 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.wm.shell.flicker.legacysplitscreen
+
+import android.platform.test.annotations.Presubmit
+import android.view.Surface
+import androidx.test.filters.RequiresDevice
+import com.android.server.wm.flicker.FlickerParametersRunnerFactory
+import com.android.server.wm.flicker.FlickerTestParameter
+import com.android.server.wm.flicker.FlickerTestParameterFactory
+import com.android.server.wm.flicker.dsl.FlickerBuilder
+import com.android.server.wm.flicker.helpers.launchSplitScreen
+import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
+import com.android.wm.shell.flicker.dockedStackDividerIsVisible
+import com.android.wm.shell.flicker.helpers.SplitScreenHelper
+import org.junit.FixMethodOrder
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.MethodSorters
+import org.junit.runners.Parameterized
+
+/**
+ * Test enter split screen from a detached recent task
+ *
+ * To run this test: `atest WMShellFlickerTests:EnterSplitScreenFromDetachedRecentTask`
+ */
+@RequiresDevice
+@RunWith(Parameterized::class)
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
+class EnterSplitScreenFromDetachedRecentTask(
+ testSpec: FlickerTestParameter
+) : LegacySplitScreenTransition(testSpec) {
+
+ override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
+ get() = { configuration ->
+ cleanSetup(this, configuration)
+ setup {
+ eachRun {
+ splitScreenApp.launchViaIntent(wmHelper)
+ // Press back to remove the task, but it should still be shown in recent.
+ device.pressBack()
+ }
+ }
+ transitions {
+ device.launchSplitScreen(wmHelper)
+ }
+ }
+
+ override val ignoredWindows: List<String>
+ get() = listOf(LAUNCHER_PACKAGE_NAME,
+ WindowManagerStateHelper.SPLASH_SCREEN_NAME,
+ WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME,
+ splitScreenApp.defaultWindowName)
+
+ @Presubmit
+ @Test
+ fun dockedStackDividerIsVisible() = testSpec.dockedStackDividerIsVisible()
+
+ @Presubmit
+ @Test
+ fun appWindowIsVisible() {
+ testSpec.assertWmEnd {
+ isVisible(splitScreenApp.defaultWindowName)
+ }
+ }
+
+ companion object {
+ @Parameterized.Parameters(name = "{0}")
+ @JvmStatic
+ fun getParams(): Collection<FlickerTestParameter> {
+ return FlickerTestParameterFactory.getInstance().getConfigNonRotationTests(
+ repetitions = SplitScreenHelper.TEST_REPETITIONS,
+ supportedRotations = listOf(Surface.ROTATION_0) // bugId = 179116910
+ )
+ }
+ }
+}
\ No newline at end of file
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java
index c61302b..935f669 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java
@@ -30,6 +30,7 @@
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
+import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.RemoteException;
import android.test.suitebuilder.annotation.SmallTest;
@@ -40,12 +41,14 @@
import com.android.wm.shell.ShellTestCase;
import com.android.wm.shell.WindowManagerShellWrapper;
import com.android.wm.shell.common.DisplayController;
+import com.android.wm.shell.common.DisplayLayout;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.TaskStackListenerImpl;
import com.android.wm.shell.onehanded.OneHandedController;
import com.android.wm.shell.pip.PipBoundsAlgorithm;
import com.android.wm.shell.pip.PipBoundsState;
import com.android.wm.shell.pip.PipMediaController;
+import com.android.wm.shell.pip.PipSnapAlgorithm;
import com.android.wm.shell.pip.PipTaskOrganizer;
import com.android.wm.shell.pip.PipTransitionController;
@@ -70,16 +73,21 @@
@Mock private PhonePipMenuController mMockPhonePipMenuController;
@Mock private PipAppOpsListener mMockPipAppOpsListener;
@Mock private PipBoundsAlgorithm mMockPipBoundsAlgorithm;
+ @Mock private PipSnapAlgorithm mMockPipSnapAlgorithm;
@Mock private PipMediaController mMockPipMediaController;
@Mock private PipTaskOrganizer mMockPipTaskOrganizer;
@Mock private PipTransitionController mMockPipTransitionController;
@Mock private PipTouchHandler mMockPipTouchHandler;
+ @Mock private PipMotionHelper mMockPipMotionHelper;
@Mock private WindowManagerShellWrapper mMockWindowManagerShellWrapper;
@Mock private PipBoundsState mMockPipBoundsState;
@Mock private TaskStackListenerImpl mMockTaskStackListener;
@Mock private ShellExecutor mMockExecutor;
@Mock private Optional<OneHandedController> mMockOneHandedController;
+ @Mock private DisplayLayout mMockDisplayLayout1;
+ @Mock private DisplayLayout mMockDisplayLayout2;
+
@Before
public void setUp() throws RemoteException {
MockitoAnnotations.initMocks(this);
@@ -92,6 +100,8 @@
mMockPipMediaController, mMockPhonePipMenuController, mMockPipTaskOrganizer,
mMockPipTouchHandler, mMockPipTransitionController, mMockWindowManagerShellWrapper,
mMockTaskStackListener, mMockOneHandedController, mMockExecutor);
+ when(mMockPipBoundsAlgorithm.getSnapAlgorithm()).thenReturn(mMockPipSnapAlgorithm);
+ when(mMockPipTouchHandler.getMotionHelper()).thenReturn(mMockPipMotionHelper);
}
@Test
@@ -167,4 +177,36 @@
verify(mMockPipBoundsState).saveReentryState(new Size(30, 30), 1.0f);
}
+
+ @Test
+ public void onDisplayConfigurationChanged_inPip_movePip() {
+ final int displayId = 1;
+ final Rect bounds = new Rect(0, 0, 10, 10);
+ when(mMockPipBoundsAlgorithm.getDefaultBounds()).thenReturn(bounds);
+ when(mMockPipBoundsState.getDisplayId()).thenReturn(displayId);
+ when(mMockPipBoundsState.getDisplayLayout()).thenReturn(mMockDisplayLayout1);
+ when(mMockDisplayController.getDisplayLayout(displayId)).thenReturn(mMockDisplayLayout2);
+
+ when(mMockPipTaskOrganizer.isInPip()).thenReturn(true);
+ mPipController.mDisplaysChangedListener.onDisplayConfigurationChanged(
+ displayId, new Configuration());
+
+ verify(mMockPipMotionHelper).movePip(any(Rect.class));
+ }
+
+ @Test
+ public void onDisplayConfigurationChanged_notInPip_doesNotMovePip() {
+ final int displayId = 1;
+ final Rect bounds = new Rect(0, 0, 10, 10);
+ when(mMockPipBoundsAlgorithm.getDefaultBounds()).thenReturn(bounds);
+ when(mMockPipBoundsState.getDisplayId()).thenReturn(displayId);
+ when(mMockPipBoundsState.getDisplayLayout()).thenReturn(mMockDisplayLayout1);
+ when(mMockDisplayController.getDisplayLayout(displayId)).thenReturn(mMockDisplayLayout2);
+
+ when(mMockPipTaskOrganizer.isInPip()).thenReturn(false);
+ mPipController.mDisplaysChangedListener.onDisplayConfigurationChanged(
+ displayId, new Configuration());
+
+ verify(mMockPipMotionHelper, never()).movePip(any(Rect.class));
+ }
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/TaskSnapshotWindowTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/TaskSnapshotWindowTest.java
index b908df2..5945840 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/TaskSnapshotWindowTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/TaskSnapshotWindowTest.java
@@ -16,7 +16,6 @@
package com.android.wm.shell.startingsurface;
-import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
import static android.view.WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS;
@@ -82,7 +81,7 @@
mWindow = new TaskSnapshotWindow(new SurfaceControl(), snapshot, "Test",
createTaskDescription(Color.WHITE, Color.RED, Color.BLUE),
0 /* appearance */, windowFlags /* windowFlags */, 0 /* privateWindowFlags */,
- taskBounds, ORIENTATION_PORTRAIT, ACTIVITY_TYPE_STANDARD, new InsetsState(),
+ taskBounds, ORIENTATION_PORTRAIT, new InsetsState(),
null /* clearWindow */, new TestShellExecutor());
}
diff --git a/libs/hwui/DamageAccumulator.cpp b/libs/hwui/DamageAccumulator.cpp
index 0adc0f6..9db47c3 100644
--- a/libs/hwui/DamageAccumulator.cpp
+++ b/libs/hwui/DamageAccumulator.cpp
@@ -157,7 +157,7 @@
static inline void mapRect(const RenderProperties& props, const SkRect& in, SkRect* out) {
if (in.isEmpty()) return;
SkRect temp(in);
- if (Properties::stretchEffectBehavior == StretchEffectBehavior::UniformScale) {
+ if (Properties::getStretchEffectBehavior() == StretchEffectBehavior::UniformScale) {
const StretchEffect& stretch = props.layerProperties().getStretchEffect();
if (!stretch.isEmpty()) {
applyMatrix(stretch.makeLinearStretch(props.getWidth(), props.getHeight()), &temp);
diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp
index a4614a9..f0995c4 100644
--- a/libs/hwui/Properties.cpp
+++ b/libs/hwui/Properties.cpp
@@ -137,10 +137,6 @@
targetCpuTimePercentage = base::GetIntProperty(PROPERTY_TARGET_CPU_TIME_PERCENTAGE, 70);
if (targetCpuTimePercentage <= 0 || targetCpuTimePercentage > 100) targetCpuTimePercentage = 70;
- int stretchType = base::GetIntProperty(PROPERTY_STRETCH_EFFECT_TYPE, 0);
- stretchType = std::clamp(stretchType, 0, static_cast<int>(StretchEffectBehavior::UniformScale));
- stretchEffectBehavior = static_cast<StretchEffectBehavior>(stretchType);
-
return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw);
}
diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h
index 9964254..f5fd003 100644
--- a/libs/hwui/Properties.h
+++ b/libs/hwui/Properties.h
@@ -171,8 +171,6 @@
*/
#define PROPERTY_TARGET_CPU_TIME_PERCENTAGE "debug.hwui.target_cpu_time_percent"
-#define PROPERTY_STRETCH_EFFECT_TYPE "debug.hwui.stretch_mode"
-
/**
* Property for whether this is running in the emulator.
*/
@@ -278,9 +276,26 @@
static bool useHintManager;
static int targetCpuTimePercentage;
- static StretchEffectBehavior stretchEffectBehavior;
+ static StretchEffectBehavior getStretchEffectBehavior() {
+ return stretchEffectBehavior;
+ }
+
+ static void setIsHighEndGfx(bool isHighEndGfx) {
+ stretchEffectBehavior = isHighEndGfx ?
+ StretchEffectBehavior::ShaderHWUI :
+ StretchEffectBehavior::UniformScale;
+ }
+
+ /**
+ * Used for testing. Typical configuration of stretch behavior is done
+ * through setIsHighEndGfx
+ */
+ static void setStretchEffectBehavior(StretchEffectBehavior behavior) {
+ stretchEffectBehavior = behavior;
+ }
private:
+ static StretchEffectBehavior stretchEffectBehavior;
static ProfileType sProfileType;
static bool sDisableProfileBars;
static RenderPipelineType sRenderPipelineType;
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index ad2cd8c..ded7994 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -478,7 +478,7 @@
}
}
- if (Properties::stretchEffectBehavior == StretchEffectBehavior::UniformScale) {
+ if (Properties::getStretchEffectBehavior() == StretchEffectBehavior::UniformScale) {
const StretchEffect& stretch = properties().layerProperties().getStretchEffect();
if (!stretch.isEmpty()) {
matrix.multiply(
diff --git a/libs/hwui/effects/StretchEffect.h b/libs/hwui/effects/StretchEffect.h
index 0e1a654..a92ef5b 100644
--- a/libs/hwui/effects/StretchEffect.h
+++ b/libs/hwui/effects/StretchEffect.h
@@ -111,7 +111,7 @@
bool requiresLayer() const {
return !(isEmpty() ||
- Properties::stretchEffectBehavior == StretchEffectBehavior::UniformScale);
+ Properties::getStretchEffectBehavior() == StretchEffectBehavior::UniformScale);
}
private:
diff --git a/libs/hwui/jni/android_graphics_HardwareRenderer.cpp b/libs/hwui/jni/android_graphics_HardwareRenderer.cpp
index dd78d58..82bc5a1 100644
--- a/libs/hwui/jni/android_graphics_HardwareRenderer.cpp
+++ b/libs/hwui/jni/android_graphics_HardwareRenderer.cpp
@@ -324,6 +324,11 @@
Properties::defaultSdrWhitePoint = sdrWhitePoint;
}
+static void android_view_ThreadedRenderer_setIsHighEndGfx(JNIEnv* env, jobject clazz,
+ jboolean jIsHighEndGfx) {
+ Properties::setIsHighEndGfx(jIsHighEndGfx);
+}
+
static int android_view_ThreadedRenderer_syncAndDrawFrame(JNIEnv* env, jobject clazz,
jlong proxyPtr, jlongArray frameInfo, jint frameInfoSize) {
LOG_ALWAYS_FATAL_IF(frameInfoSize != UI_THREAD_FRAME_INFO_SIZE,
@@ -795,6 +800,7 @@
{"nSetOpaque", "(JZ)V", (void*)android_view_ThreadedRenderer_setOpaque},
{"nSetColorMode", "(JI)V", (void*)android_view_ThreadedRenderer_setColorMode},
{"nSetSdrWhitePoint", "(JF)V", (void*)android_view_ThreadedRenderer_setSdrWhitePoint},
+ {"nSetIsHighEndGfx", "(Z)V", (void*)android_view_ThreadedRenderer_setIsHighEndGfx},
{"nSyncAndDrawFrame", "(J[JI)I", (void*)android_view_ThreadedRenderer_syncAndDrawFrame},
{"nDestroy", "(JJ)V", (void*)android_view_ThreadedRenderer_destroy},
{"nRegisterAnimatingRenderNode", "(JJ)V",
diff --git a/libs/hwui/jni/android_graphics_RenderNode.cpp b/libs/hwui/jni/android_graphics_RenderNode.cpp
index a096ed0..002bd83 100644
--- a/libs/hwui/jni/android_graphics_RenderNode.cpp
+++ b/libs/hwui/jni/android_graphics_RenderNode.cpp
@@ -574,7 +574,7 @@
uirenderer::Rect bounds(props.getWidth(), props.getHeight());
bool useStretchShader =
- Properties::stretchEffectBehavior != StretchEffectBehavior::UniformScale;
+ Properties::getStretchEffectBehavior() != StretchEffectBehavior::UniformScale;
if (useStretchShader && info.stretchEffectCount) {
handleStretchEffect(info, bounds);
}
@@ -680,7 +680,8 @@
stretchTargetBounds(*effect, result.width, result.height,
childRelativeBounds,targetBounds);
- if (Properties::stretchEffectBehavior == StretchEffectBehavior::Shader) {
+ if (Properties::getStretchEffectBehavior() ==
+ StretchEffectBehavior::Shader) {
JNIEnv* env = jnienv();
jobject localref = env->NewLocalRef(mWeakRef);
diff --git a/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp b/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
index 1c5515c7d..c8247e7 100644
--- a/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
+++ b/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
@@ -248,7 +248,7 @@
const StretchEffect& stretch = properties.layerProperties().getStretchEffect();
if (stretch.isEmpty() ||
- Properties::stretchEffectBehavior == StretchEffectBehavior::UniformScale) {
+ Properties::getStretchEffectBehavior() == StretchEffectBehavior::UniformScale) {
// If we don't have any stretch effects, issue the filtered
// canvas draw calls to make sure we still punch a hole
// with the same canvas transformation + clip into the target
@@ -327,7 +327,7 @@
canvas->concat(*properties.getTransformMatrix());
}
}
- if (Properties::stretchEffectBehavior == StretchEffectBehavior::UniformScale) {
+ if (Properties::getStretchEffectBehavior() == StretchEffectBehavior::UniformScale) {
const StretchEffect& stretch = properties.layerProperties().getStretchEffect();
if (!stretch.isEmpty()) {
canvas->concat(
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index 891a994..c1f61e08 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -677,20 +677,8 @@
}
if (frameInfo != nullptr) {
- if (gpuCompleteTime == -1) {
- gpuCompleteTime = frameInfo->get(FrameInfoIndex::SwapBuffersCompleted);
- }
- if (gpuCompleteTime < frameInfo->get(FrameInfoIndex::IssueDrawCommandsStart)) {
- // On Vulkan the GPU commands are flushed to the GPU during IssueDrawCommands rather
- // than after SwapBuffers. So if the GPU signals before issue draw commands, then
- // something probably went wrong. Anything after that could just be expected
- // pipeline differences
- ALOGW("Impossible GPU complete time issueCommandsStart=%" PRIi64
- " gpuComplete=%" PRIi64,
- frameInfo->get(FrameInfoIndex::IssueDrawCommandsStart), gpuCompleteTime);
- gpuCompleteTime = frameInfo->get(FrameInfoIndex::SwapBuffersCompleted);
- }
- frameInfo->set(FrameInfoIndex::FrameCompleted) = gpuCompleteTime;
+ frameInfo->set(FrameInfoIndex::FrameCompleted) = std::max(gpuCompleteTime,
+ frameInfo->get(FrameInfoIndex::SwapBuffersCompleted));
frameInfo->set(FrameInfoIndex::GpuCompleted) = gpuCompleteTime;
instance->mJankTracker.finishFrame(*frameInfo, instance->mFrameMetricsReporter);
}
diff --git a/libs/hwui/tests/common/scenes/StretchyListViewAnimation.cpp b/libs/hwui/tests/common/scenes/StretchyListViewAnimation.cpp
index c451112..e677549 100644
--- a/libs/hwui/tests/common/scenes/StretchyListViewAnimation.cpp
+++ b/libs/hwui/tests/common/scenes/StretchyListViewAnimation.cpp
@@ -186,7 +186,7 @@
void doFrame(int frameNr) override {
if (frameNr == 0) {
- Properties::stretchEffectBehavior = stretchBehavior();
+ Properties::setStretchEffectBehavior(stretchBehavior());
if (forceLayer()) {
mListView->mutateStagingProperties().mutateLayerProperties().setType(
LayerType::RenderLayer);
diff --git a/packages/Connectivity/framework/src/android/net/NetworkRequest.java b/packages/Connectivity/framework/src/android/net/NetworkRequest.java
index a71dbbf..afc76d6 100644
--- a/packages/Connectivity/framework/src/android/net/NetworkRequest.java
+++ b/packages/Connectivity/framework/src/android/net/NetworkRequest.java
@@ -200,8 +200,9 @@
private final NetworkCapabilities mNetworkCapabilities;
- // A boolean that represents the user modified NOT_VCN_MANAGED capability.
- private boolean mModifiedNotVcnManaged = false;
+ // A boolean that represents whether the NOT_VCN_MANAGED capability should be deduced when
+ // the NetworkRequest object is built.
+ private boolean mShouldDeduceNotVcnManaged = true;
/**
* Default constructor for Builder.
@@ -223,7 +224,7 @@
// If the caller constructed the builder from a request, it means the user
// might explicitly want the capabilities from the request. Thus, the NOT_VCN_MANAGED
// capabilities should not be touched later.
- mModifiedNotVcnManaged = true;
+ mShouldDeduceNotVcnManaged = false;
}
/**
@@ -254,7 +255,7 @@
public Builder addCapability(@NetworkCapabilities.NetCapability int capability) {
mNetworkCapabilities.addCapability(capability);
if (capability == NetworkCapabilities.NET_CAPABILITY_NOT_VCN_MANAGED) {
- mModifiedNotVcnManaged = true;
+ mShouldDeduceNotVcnManaged = false;
}
return this;
}
@@ -268,7 +269,7 @@
public Builder removeCapability(@NetworkCapabilities.NetCapability int capability) {
mNetworkCapabilities.removeCapability(capability);
if (capability == NetworkCapabilities.NET_CAPABILITY_NOT_VCN_MANAGED) {
- mModifiedNotVcnManaged = true;
+ mShouldDeduceNotVcnManaged = false;
}
return this;
}
@@ -357,7 +358,7 @@
mNetworkCapabilities.clearAll();
// If the caller explicitly clear all capabilities, the NOT_VCN_MANAGED capabilities
// should not be add back later.
- mModifiedNotVcnManaged = true;
+ mShouldDeduceNotVcnManaged = false;
return this;
}
@@ -458,6 +459,9 @@
throw new IllegalArgumentException("A MatchAllNetworkSpecifier is not permitted");
}
mNetworkCapabilities.setNetworkSpecifier(networkSpecifier);
+ // Do not touch NOT_VCN_MANAGED if the caller needs to access to a very specific
+ // Network.
+ mShouldDeduceNotVcnManaged = false;
return this;
}
@@ -491,12 +495,13 @@
* {@link #VCN_SUPPORTED_CAPABILITIES}, add the NET_CAPABILITY_NOT_VCN_MANAGED to
* allow the callers automatically utilize VCN networks if available.
* 2. For the requests that explicitly add or remove NET_CAPABILITY_NOT_VCN_MANAGED,
+ * or has clear intention of tracking specific network,
* do not alter them to allow user fire request that suits their need.
*
* @hide
*/
private void deduceNotVcnManagedCapability(final NetworkCapabilities nc) {
- if (mModifiedNotVcnManaged) return;
+ if (!mShouldDeduceNotVcnManaged) return;
for (final int cap : nc.getCapabilities()) {
if (!VCN_SUPPORTED_CAPABILITIES.contains(cap)) return;
}
diff --git a/packages/Connectivity/framework/src/android/net/apf/ApfCapabilities.java b/packages/Connectivity/framework/src/android/net/apf/ApfCapabilities.java
index 85b24713..663c1b3 100644
--- a/packages/Connectivity/framework/src/android/net/apf/ApfCapabilities.java
+++ b/packages/Connectivity/framework/src/android/net/apf/ApfCapabilities.java
@@ -131,43 +131,21 @@
* @return Whether the APF Filter in the device should filter out IEEE 802.3 Frames.
*/
public static boolean getApfDrop8023Frames() {
- // TODO(b/183076074): remove reading resources from system resources
+ // TODO: deprecate/remove this method (now unused in the platform), as the resource was
+ // moved to NetworkStack.
final Resources systemRes = Resources.getSystem();
final int id = systemRes.getIdentifier("config_apfDrop802_3Frames", "bool", "android");
return systemRes.getBoolean(id);
}
/**
- * @return Whether the APF Filter in the device should filter out IEEE 802.3 Frames.
- * @hide
- */
- public static boolean getApfDrop8023Frames(@NonNull Context context) {
- final ConnectivityResources res = getResources(context);
- // TODO(b/183076074): use R.bool.config_apfDrop802_3Frames directly
- final int id = res.get().getIdentifier("config_apfDrop802_3Frames", "bool",
- res.getResourcesContext().getPackageName());
- return res.get().getBoolean(id);
- }
-
- /**
* @return An array of denylisted EtherType, packets with EtherTypes within it will be dropped.
*/
public static @NonNull int[] getApfEtherTypeBlackList() {
- // TODO(b/183076074): remove reading resources from system resources
+ // TODO: deprecate/remove this method (now unused in the platform), as the resource was
+ // moved to NetworkStack.
final Resources systemRes = Resources.getSystem();
final int id = systemRes.getIdentifier("config_apfEthTypeBlackList", "array", "android");
return systemRes.getIntArray(id);
}
-
- /**
- * @return An array of denylisted EtherType, packets with EtherTypes within it will be dropped.
- * @hide
- */
- public static @NonNull int[] getApfEtherTypeDenyList(@NonNull Context context) {
- final ConnectivityResources res = getResources(context);
- // TODO(b/183076074): use R.array.config_apfEthTypeDenyList directly
- final int id = res.get().getIdentifier("config_apfEthTypeDenyList", "array",
- res.getResourcesContext().getPackageName());
- return res.get().getIntArray(id);
- }
}
diff --git a/packages/Connectivity/service/ServiceConnectivityResources/res/values/config.xml b/packages/Connectivity/service/ServiceConnectivityResources/res/values/config.xml
index 82d8e4f..70ddb9a 100644
--- a/packages/Connectivity/service/ServiceConnectivityResources/res/values/config.xml
+++ b/packages/Connectivity/service/ServiceConnectivityResources/res/values/config.xml
@@ -52,22 +52,6 @@
<item>12,60000</item><!-- mobile_cbs -->
</string-array>
- <!-- Whether the APF Filter in the device should filter out IEEE 802.3 Frames
- Those frames are identified by the field Eth-type having values
- less than 0x600 -->
- <bool translatable="false" name="config_apfDrop802_3Frames">true</bool>
-
- <!-- An array of Denylisted EtherType, packets with EtherTypes within this array
- will be dropped
- TODO: need to put proper values, these are for testing purposes only -->
- <integer-array translatable="false" name="config_apfEthTypeDenyList">
- <item>0x88A2</item>
- <item>0x88A4</item>
- <item>0x88B8</item>
- <item>0x88CD</item>
- <item>0x88E3</item>
- </integer-array>
-
<!-- Default supported concurrent socket keepalive slots per transport type, used by
ConnectivityManager.createSocketKeepalive() for calculating the number of keepalive
offload slots that should be reserved for privileged access. This string array should be
diff --git a/packages/Connectivity/service/ServiceConnectivityResources/res/values/overlayable.xml b/packages/Connectivity/service/ServiceConnectivityResources/res/values/overlayable.xml
index 568deca..fd23566 100644
--- a/packages/Connectivity/service/ServiceConnectivityResources/res/values/overlayable.xml
+++ b/packages/Connectivity/service/ServiceConnectivityResources/res/values/overlayable.xml
@@ -21,8 +21,6 @@
<item type="string" name="config_networkCaptivePortalServerUrl"/>
<item type="integer" name="config_networkTransitionTimeout"/>
<item type="array" name="config_wakeonlan_supported_interfaces"/>
- <item type="bool" name="config_apfDrop802_3Frames"/>
- <item type="array" name="config_apfEthTypeDenyList"/>
<item type="integer" name="config_networkMeteredMultipathPreference"/>
<item type="array" name="config_networkSupportedKeepaliveCount"/>
<item type="integer" name="config_networkAvoidBadWifi"/>
diff --git a/packages/Connectivity/service/src/com/android/server/ConnectivityService.java b/packages/Connectivity/service/src/com/android/server/ConnectivityService.java
index daf231f..6027a99 100644
--- a/packages/Connectivity/service/src/com/android/server/ConnectivityService.java
+++ b/packages/Connectivity/service/src/com/android/server/ConnectivityService.java
@@ -1497,12 +1497,7 @@
ConnectivitySettingsManager.WIFI_ALWAYS_REQUESTED, false /* defaultValue */);
final boolean vehicleAlwaysRequested = mResources.get().getBoolean(
R.bool.config_vehicleInternalNetworkAlwaysRequested);
- // TODO (b/183076074): remove legacy fallback after migrating overlays
- final boolean legacyAlwaysRequested = mContext.getResources().getBoolean(
- mContext.getResources().getIdentifier(
- "config_vehicleInternalNetworkAlwaysRequested", "bool", "android"));
- handleAlwaysOnNetworkRequest(mDefaultVehicleRequest,
- vehicleAlwaysRequested || legacyAlwaysRequested);
+ handleAlwaysOnNetworkRequest(mDefaultVehicleRequest, vehicleAlwaysRequested);
}
private void registerSettingsCallbacks() {
@@ -2218,7 +2213,7 @@
@NonNull
public List<NetworkStateSnapshot> getAllNetworkStateSnapshots() {
// This contains IMSI details, so make sure the caller is privileged.
- PermissionUtils.enforceNetworkStackPermission(mContext);
+ enforceNetworkStackOrSettingsPermission();
final ArrayList<NetworkStateSnapshot> result = new ArrayList<>();
for (Network network : getAllNetworks()) {
@@ -6823,14 +6818,6 @@
int mark = mResources.get().getInteger(R.integer.config_networkWakeupPacketMark);
int mask = mResources.get().getInteger(R.integer.config_networkWakeupPacketMask);
- // TODO (b/183076074): remove legacy fallback after migrating overlays
- final int legacyMark = mContext.getResources().getInteger(mContext.getResources()
- .getIdentifier("config_networkWakeupPacketMark", "integer", "android"));
- final int legacyMask = mContext.getResources().getInteger(mContext.getResources()
- .getIdentifier("config_networkWakeupPacketMask", "integer", "android"));
- mark = mark == 0 ? legacyMark : mark;
- mask = mask == 0 ? legacyMask : mask;
-
// Mask/mark of zero will not detect anything interesting.
// Don't install rules unless both values are nonzero.
if (mark == 0 || mask == 0) {
@@ -8584,11 +8571,7 @@
final UnderlyingNetworkInfo[] underlyingNetworkInfos = getAllVpnInfo();
try {
final ArrayList<NetworkStateSnapshot> snapshots = new ArrayList<>();
- // TODO: Directly use NetworkStateSnapshot when feasible.
- for (final NetworkState state : getAllNetworkState()) {
- final NetworkStateSnapshot snapshot = new NetworkStateSnapshot(state.network,
- state.networkCapabilities, state.linkProperties, state.subscriberId,
- state.legacyNetworkType);
+ for (final NetworkStateSnapshot snapshot : getAllNetworkStateSnapshots()) {
snapshots.add(snapshot);
}
mStatsManager.notifyNetworkStatus(getDefaultNetworks(),
diff --git a/packages/Connectivity/service/src/com/android/server/connectivity/KeepaliveTracker.java b/packages/Connectivity/service/src/com/android/server/connectivity/KeepaliveTracker.java
index acf39f0..7d922a4 100644
--- a/packages/Connectivity/service/src/com/android/server/connectivity/KeepaliveTracker.java
+++ b/packages/Connectivity/service/src/com/android/server/connectivity/KeepaliveTracker.java
@@ -114,18 +114,11 @@
mContext = context;
mSupportedKeepalives = KeepaliveUtils.getSupportedKeepalives(mContext);
- // TODO (b/183076074): stop reading legacy resources after migrating overlays
- final int legacyReservedSlots = mContext.getResources().getInteger(
- mContext.getResources().getIdentifier(
- "config_reservedPrivilegedKeepaliveSlots", "integer", "android"));
- final int legacyAllowedSlots = mContext.getResources().getInteger(
- mContext.getResources().getIdentifier(
- "config_allowedUnprivilegedKeepalivePerUid", "integer", "android"));
final ConnectivityResources res = new ConnectivityResources(mContext);
- mReservedPrivilegedSlots = Math.min(legacyReservedSlots, res.get().getInteger(
- R.integer.config_reservedPrivilegedKeepaliveSlots));
- mAllowedUnprivilegedSlotsForUid = Math.min(legacyAllowedSlots, res.get().getInteger(
- R.integer.config_allowedUnprivilegedKeepalivePerUid));
+ mReservedPrivilegedSlots = res.get().getInteger(
+ R.integer.config_reservedPrivilegedKeepaliveSlots);
+ mAllowedUnprivilegedSlotsForUid = res.get().getInteger(
+ R.integer.config_allowedUnprivilegedKeepalivePerUid);
}
/**
diff --git a/packages/Connectivity/service/src/com/android/server/connectivity/PermissionMonitor.java b/packages/Connectivity/service/src/com/android/server/connectivity/PermissionMonitor.java
index 5886b1a..9bda59c 100644
--- a/packages/Connectivity/service/src/com/android/server/connectivity/PermissionMonitor.java
+++ b/packages/Connectivity/service/src/com/android/server/connectivity/PermissionMonitor.java
@@ -24,6 +24,7 @@
import static android.content.pm.PackageInfo.REQUESTED_PERMISSION_GRANTED;
import static android.content.pm.PackageManager.GET_PERMISSIONS;
import static android.content.pm.PackageManager.MATCH_ANY_USER;
+import static android.net.ConnectivitySettingsManager.APPS_ALLOWED_ON_RESTRICTED_NETWORKS;
import static android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK;
import static android.os.Process.INVALID_UID;
import static android.os.Process.SYSTEM_UID;
@@ -39,6 +40,8 @@
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
+import android.database.ContentObserver;
+import android.net.ConnectivitySettingsManager;
import android.net.INetd;
import android.net.UidRange;
import android.net.Uri;
@@ -48,7 +51,9 @@
import android.os.SystemConfigManager;
import android.os.UserHandle;
import android.os.UserManager;
+import android.provider.Settings;
import android.system.OsConstants;
+import android.util.ArraySet;
import android.util.Log;
import android.util.SparseArray;
import android.util.SparseIntArray;
@@ -66,7 +71,6 @@
import java.util.Map.Entry;
import java.util.Set;
-
/**
* A utility class to inform Netd of UID permisisons.
* Does a mass update at boot and then monitors for app install/remove.
@@ -105,6 +109,14 @@
@GuardedBy("this")
private final Set<Integer> mAllApps = new HashSet<>();
+ // A set of apps which are allowed to use restricted networks. These apps can't hold the
+ // CONNECTIVITY_USE_RESTRICTED_NETWORKS permission because they can't be signature|privileged
+ // apps. However, these apps should still be able to use restricted networks under certain
+ // conditions (e.g. government app using emergency services). So grant netd system permission
+ // to uids whose package name is listed in APPS_ALLOWED_ON_RESTRICTED_NETWORKS setting.
+ @GuardedBy("this")
+ private final Set<String> mAppsAllowedOnRestrictedNetworks = new ArraySet<>();
+
private BroadcastReceiver mIntentReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
@@ -135,6 +147,22 @@
public int getDeviceFirstSdkInt() {
return Build.VERSION.DEVICE_INITIAL_SDK_INT;
}
+
+ /**
+ * Get apps allowed to use restricted networks via ConnectivitySettingsManager.
+ */
+ public Set<String> getAppsAllowedOnRestrictedNetworks(@NonNull Context context) {
+ return ConnectivitySettingsManager.getAppsAllowedOnRestrictedNetworks(context);
+ }
+
+ /**
+ * Register ContentObserver for given Uri.
+ */
+ public void registerContentObserver(@NonNull Context context, @NonNull Uri uri,
+ boolean notifyForDescendants, @NonNull ContentObserver observer) {
+ context.getContentResolver().registerContentObserver(
+ uri, notifyForDescendants, observer);
+ }
}
public PermissionMonitor(@NonNull final Context context, @NonNull final INetd netd) {
@@ -157,14 +185,31 @@
public synchronized void startMonitoring() {
log("Monitoring");
+ final Context userAllContext = mContext.createContextAsUser(UserHandle.ALL, 0 /* flags */);
final IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
intentFilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
intentFilter.addDataScheme("package");
- mContext.createContextAsUser(UserHandle.ALL, 0 /* flags */).registerReceiver(
+ userAllContext.registerReceiver(
mIntentReceiver, intentFilter, null /* broadcastPermission */,
null /* scheduler */);
+ // Register APPS_ALLOWED_ON_RESTRICTED_NETWORKS setting observer
+ mDeps.registerContentObserver(
+ userAllContext,
+ Settings.Secure.getUriFor(APPS_ALLOWED_ON_RESTRICTED_NETWORKS),
+ false /* notifyForDescendants */,
+ new ContentObserver(null) {
+ @Override
+ public void onChange(boolean selfChange) {
+ onSettingChanged();
+ }
+ });
+
+ // Read APPS_ALLOWED_ON_RESTRICTED_NETWORKS setting and update
+ // mAppsAllowedOnRestrictedNetworks.
+ updateAppsAllowedOnRestrictedNetworks(mDeps.getAppsAllowedOnRestrictedNetworks(mContext));
+
List<PackageInfo> apps = mPackageManager.getInstalledPackages(GET_PERMISSIONS
| MATCH_ANY_USER);
if (apps == null) {
@@ -220,11 +265,33 @@
}
@VisibleForTesting
+ void updateAppsAllowedOnRestrictedNetworks(final Set<String> apps) {
+ mAppsAllowedOnRestrictedNetworks.clear();
+ mAppsAllowedOnRestrictedNetworks.addAll(apps);
+ }
+
+ @VisibleForTesting
static boolean isVendorApp(@NonNull ApplicationInfo appInfo) {
return appInfo.isVendor() || appInfo.isOem() || appInfo.isProduct();
}
@VisibleForTesting
+ boolean isCarryoverPackage(final ApplicationInfo appInfo) {
+ if (appInfo == null) return false;
+ return (appInfo.targetSdkVersion < VERSION_Q && isVendorApp(appInfo))
+ // Backward compatibility for b/114245686, on devices that launched before Q daemons
+ // and apps running as the system UID are exempted from this check.
+ || (appInfo.uid == SYSTEM_UID && mDeps.getDeviceFirstSdkInt() < VERSION_Q);
+ }
+
+ @VisibleForTesting
+ boolean isAppAllowedOnRestrictedNetworks(@NonNull final PackageInfo app) {
+ // Check whether package name is in allowed on restricted networks app list. If so, this app
+ // can have netd system permission.
+ return mAppsAllowedOnRestrictedNetworks.contains(app.packageName);
+ }
+
+ @VisibleForTesting
boolean hasPermission(@NonNull final PackageInfo app, @NonNull final String permission) {
if (app.requestedPermissions == null || app.requestedPermissionsFlags == null) {
return false;
@@ -241,22 +308,10 @@
@VisibleForTesting
boolean hasRestrictedNetworkPermission(@NonNull final PackageInfo app) {
- // TODO : remove this check in the future(b/31479477). All apps should just
- // request the appropriate permission for their use case since android Q.
- if (app.applicationInfo != null) {
- // Backward compatibility for b/114245686, on devices that launched before Q daemons
- // and apps running as the system UID are exempted from this check.
- if (app.applicationInfo.uid == SYSTEM_UID && mDeps.getDeviceFirstSdkInt() < VERSION_Q) {
- return true;
- }
-
- if (app.applicationInfo.targetSdkVersion < VERSION_Q
- && isVendorApp(app.applicationInfo)) {
- return true;
- }
- }
-
- return hasPermission(app, PERMISSION_MAINLINE_NETWORK_STACK)
+ // TODO : remove carryover package check in the future(b/31479477). All apps should just
+ // request the appropriate permission for their use case since android Q.
+ return isCarryoverPackage(app.applicationInfo) || isAppAllowedOnRestrictedNetworks(app)
+ || hasPermission(app, PERMISSION_MAINLINE_NETWORK_STACK)
|| hasPermission(app, NETWORK_STACK)
|| hasPermission(app, CONNECTIVITY_USE_RESTRICTED_NETWORKS);
}
@@ -410,6 +465,20 @@
mAllApps.add(UserHandle.getAppId(uid));
}
+ private Boolean highestUidNetworkPermission(int uid) {
+ Boolean permission = null;
+ final String[] packages = mPackageManager.getPackagesForUid(uid);
+ if (!CollectionUtils.isEmpty(packages)) {
+ for (String name : packages) {
+ permission = highestPermissionForUid(permission, name);
+ if (permission == SYSTEM) {
+ break;
+ }
+ }
+ }
+ return permission;
+ }
+
/**
* Called when a package is removed.
*
@@ -440,19 +509,14 @@
}
Map<Integer, Boolean> apps = new HashMap<>();
- Boolean permission = null;
- String[] packages = mPackageManager.getPackagesForUid(uid);
- if (packages != null && packages.length > 0) {
- for (String name : packages) {
- permission = highestPermissionForUid(permission, name);
- if (permission == SYSTEM) {
- // An app with this UID still has the SYSTEM permission.
- // Therefore, this UID must already have the SYSTEM permission.
- // Nothing to do.
- return;
- }
- }
+ final Boolean permission = highestUidNetworkPermission(uid);
+ if (permission == SYSTEM) {
+ // An app with this UID still has the SYSTEM permission.
+ // Therefore, this UID must already have the SYSTEM permission.
+ // Nothing to do.
+ return;
}
+
if (permission == mApps.get(uid)) {
// The permissions of this UID have not changed. Nothing to do.
return;
@@ -705,6 +769,38 @@
return mVpnUidRanges.get(iface);
}
+ private synchronized void onSettingChanged() {
+ // Step1. Update apps allowed to use restricted networks and compute the set of packages to
+ // update.
+ final Set<String> packagesToUpdate = new ArraySet<>(mAppsAllowedOnRestrictedNetworks);
+ updateAppsAllowedOnRestrictedNetworks(mDeps.getAppsAllowedOnRestrictedNetworks(mContext));
+ packagesToUpdate.addAll(mAppsAllowedOnRestrictedNetworks);
+
+ final Map<Integer, Boolean> updatedApps = new HashMap<>();
+ final Map<Integer, Boolean> removedApps = new HashMap<>();
+
+ // Step2. For each package to update, find out its new permission.
+ for (String app : packagesToUpdate) {
+ final PackageInfo info = getPackageInfo(app);
+ if (info == null || info.applicationInfo == null) continue;
+
+ final int uid = info.applicationInfo.uid;
+ final Boolean permission = highestUidNetworkPermission(uid);
+
+ if (null == permission) {
+ removedApps.put(uid, NETWORK); // Doesn't matter which permission is set here.
+ mApps.remove(uid);
+ } else {
+ updatedApps.put(uid, permission);
+ mApps.put(uid, permission);
+ }
+ }
+
+ // Step3. Update or revoke permission for uids with netd.
+ update(mUsers, updatedApps, true /* add */);
+ update(mUsers, removedApps, false /* add */);
+ }
+
/** Dump info to dumpsys */
public void dump(IndentingPrintWriter pw) {
pw.println("Interface filtering rules:");
diff --git a/packages/Connectivity/tests/common/java/android/net/apf/ApfCapabilitiesTest.java b/packages/Connectivity/tests/common/java/android/net/apf/ApfCapabilitiesTest.java
index d50406f..88996d9 100644
--- a/packages/Connectivity/tests/common/java/android/net/apf/ApfCapabilitiesTest.java
+++ b/packages/Connectivity/tests/common/java/android/net/apf/ApfCapabilitiesTest.java
@@ -18,6 +18,7 @@
import static com.android.testutils.ParcelUtils.assertParcelSane;
+import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
@@ -25,12 +26,17 @@
import static org.junit.Assert.assertTrue;
import android.content.Context;
+import android.os.Build;
import androidx.test.InstrumentationRegistry;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
+import com.android.testutils.DevSdkIgnoreRule;
+import com.android.testutils.DevSdkIgnoreRule.IgnoreUpTo;
+
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -39,6 +45,9 @@
@RunWith(AndroidJUnit4.class)
@SmallTest
public class ApfCapabilitiesTest {
+ @Rule
+ public final DevSdkIgnoreRule mIgnoreRule = new DevSdkIgnoreRule();
+
private Context mContext;
@Before
@@ -85,6 +94,17 @@
assertEquals(shouldDrop8023Frames, actual);
}
+ @Test @IgnoreUpTo(Build.VERSION_CODES.R)
+ public void testGetApfDrop8023Frames_S() {
+ // IpClient does not call getApfDrop8023Frames() since S, so any customization of the return
+ // value on S+ is a configuration error as it will not be used by IpClient.
+ assertTrue("android.R.bool.config_apfDrop802_3Frames has been modified to false, but "
+ + "starting from S its value is not used by IpClient. If the modification is "
+ + "intentional, use a runtime resource overlay for the NetworkStack package to "
+ + "overlay com.android.networkstack.R.bool.config_apfDrop802_3Frames instead.",
+ ApfCapabilities.getApfDrop8023Frames());
+ }
+
@Test
public void testGetApfEtherTypeBlackList() {
// Get com.android.internal.R.array.config_apfEthTypeBlackList. The test cannot directly
@@ -96,4 +116,17 @@
assertNotNull(actual);
assertTrue(Arrays.equals(blacklistedEtherTypeArray, actual));
}
+
+ @Test @IgnoreUpTo(Build.VERSION_CODES.R)
+ public void testGetApfEtherTypeBlackList_S() {
+ // IpClient does not call getApfEtherTypeBlackList() since S, so any customization of the
+ // return value on S+ is a configuration error as it will not be used by IpClient.
+ assertArrayEquals("android.R.array.config_apfEthTypeBlackList has been modified, but "
+ + "starting from S its value is not used by IpClient. If the modification "
+ + "is intentional, use a runtime resource overlay for the NetworkStack "
+ + "package to overlay "
+ + "com.android.networkstack.R.array.config_apfEthTypeDenyList instead.",
+ new int[] { 0x88a2, 0x88a4, 0x88b8, 0x88cd, 0x88e3 },
+ ApfCapabilities.getApfEtherTypeBlackList());
+ }
}
diff --git a/packages/Connectivity/tests/unit/java/android/net/NetworkTemplateTest.kt b/packages/Connectivity/tests/unit/java/android/net/NetworkTemplateTest.kt
index ab6b2f4..cb39a0c 100644
--- a/packages/Connectivity/tests/unit/java/android/net/NetworkTemplateTest.kt
+++ b/packages/Connectivity/tests/unit/java/android/net/NetworkTemplateTest.kt
@@ -40,7 +40,7 @@
import android.net.NetworkTemplate.SUBSCRIBER_ID_MATCH_RULE_EXACT
import android.net.NetworkTemplate.buildTemplateWifi
import android.net.NetworkTemplate.buildTemplateWifiWildcard
-import android.net.NetworkTemplate.buildTemplateCarrier
+import android.net.NetworkTemplate.buildTemplateCarrierMetered
import android.net.NetworkTemplate.buildTemplateMobileWithRatType
import android.telephony.TelephonyManager
import com.android.testutils.assertParcelSane
@@ -73,11 +73,12 @@
type: Int,
subscriberId: String? = null,
ssid: String? = null,
- oemManaged: Int = OEM_NONE
+ oemManaged: Int = OEM_NONE,
+ metered: Boolean = true
): NetworkStateSnapshot {
val lp = LinkProperties()
val caps = NetworkCapabilities().apply {
- setCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED, false)
+ setCapability(NetworkCapabilities.NET_CAPABILITY_NOT_METERED, !metered)
setCapability(NetworkCapabilities.NET_CAPABILITY_NOT_ROAMING, true)
setSSID(ssid)
setCapability(NetworkCapabilities.NET_CAPABILITY_OEM_PAID,
@@ -167,25 +168,38 @@
}
@Test
- fun testCarrierMatches() {
- val templateCarrierImsi1 = buildTemplateCarrier(TEST_IMSI1)
+ fun testCarrierMeteredMatches() {
+ val templateCarrierImsi1Metered = buildTemplateCarrierMetered(TEST_IMSI1)
- val identMobile1 = buildNetworkIdentity(mockContext, buildMobileNetworkState(TEST_IMSI1),
- false, TelephonyManager.NETWORK_TYPE_UMTS)
- val identMobile2 = buildNetworkIdentity(mockContext, buildMobileNetworkState(TEST_IMSI2),
- false, TelephonyManager.NETWORK_TYPE_UMTS)
- val identWifiSsid1 = buildNetworkIdentity(
- mockContext, buildWifiNetworkState(null, TEST_SSID1), true, 0)
- val identCarrierWifiImsi1 = buildNetworkIdentity(
- mockContext, buildWifiNetworkState(TEST_IMSI1, TEST_SSID1), true, 0)
- val identCarrierWifiImsi2 = buildNetworkIdentity(
- mockContext, buildWifiNetworkState(TEST_IMSI2, TEST_SSID1), true, 0)
+ val mobileImsi1 = buildMobileNetworkState(TEST_IMSI1)
+ val mobileImsi1Unmetered = buildNetworkState(TYPE_MOBILE, TEST_IMSI1, null /* ssid */,
+ OEM_NONE, false /* metered */)
+ val mobileImsi2 = buildMobileNetworkState(TEST_IMSI2)
+ val wifiSsid1 = buildWifiNetworkState(null /* subscriberId */, TEST_SSID1)
+ val wifiImsi1Ssid1 = buildWifiNetworkState(TEST_IMSI1, TEST_SSID1)
+ val wifiImsi1Ssid1Unmetered = buildNetworkState(TYPE_WIFI, TEST_IMSI1, TEST_SSID1,
+ OEM_NONE, false /* metered */)
- templateCarrierImsi1.assertMatches(identCarrierWifiImsi1)
- templateCarrierImsi1.assertDoesNotMatch(identCarrierWifiImsi2)
- templateCarrierImsi1.assertDoesNotMatch(identWifiSsid1)
- templateCarrierImsi1.assertMatches(identMobile1)
- templateCarrierImsi1.assertDoesNotMatch(identMobile2)
+ val identMobileImsi1Metered = buildNetworkIdentity(mockContext,
+ mobileImsi1, false /* defaultNetwork */, TelephonyManager.NETWORK_TYPE_UMTS)
+ val identMobileImsi1Unmetered = buildNetworkIdentity(mockContext,
+ mobileImsi1Unmetered, false /* defaultNetwork */,
+ TelephonyManager.NETWORK_TYPE_UMTS)
+ val identMobileImsi2Metered = buildNetworkIdentity(mockContext,
+ mobileImsi2, false /* defaultNetwork */, TelephonyManager.NETWORK_TYPE_UMTS)
+ val identWifiSsid1Metered = buildNetworkIdentity(
+ mockContext, wifiSsid1, true /* defaultNetwork */, 0 /* subType */)
+ val identCarrierWifiImsi1Metered = buildNetworkIdentity(
+ mockContext, wifiImsi1Ssid1, true /* defaultNetwork */, 0 /* subType */)
+ val identCarrierWifiImsi1NonMetered = buildNetworkIdentity(mockContext,
+ wifiImsi1Ssid1Unmetered, true /* defaultNetwork */, 0 /* subType */)
+
+ templateCarrierImsi1Metered.assertMatches(identMobileImsi1Metered)
+ templateCarrierImsi1Metered.assertDoesNotMatch(identMobileImsi1Unmetered)
+ templateCarrierImsi1Metered.assertDoesNotMatch(identMobileImsi2Metered)
+ templateCarrierImsi1Metered.assertDoesNotMatch(identWifiSsid1Metered)
+ templateCarrierImsi1Metered.assertMatches(identCarrierWifiImsi1Metered)
+ templateCarrierImsi1Metered.assertDoesNotMatch(identCarrierWifiImsi1NonMetered)
}
@Test
diff --git a/packages/Connectivity/tests/unit/java/com/android/server/connectivity/PermissionMonitorTest.java b/packages/Connectivity/tests/unit/java/com/android/server/connectivity/PermissionMonitorTest.java
index 02a5808..c75618f 100644
--- a/packages/Connectivity/tests/unit/java/com/android/server/connectivity/PermissionMonitorTest.java
+++ b/packages/Connectivity/tests/unit/java/com/android/server/connectivity/PermissionMonitorTest.java
@@ -30,6 +30,8 @@
import static android.content.pm.PackageInfo.REQUESTED_PERMISSION_REQUIRED;
import static android.content.pm.PackageManager.GET_PERMISSIONS;
import static android.content.pm.PackageManager.MATCH_ANY_USER;
+import static android.net.ConnectivitySettingsManager.APPS_ALLOWED_ON_RESTRICTED_NETWORKS;
+import static android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK;
import static android.os.Process.SYSTEM_UID;
import static com.android.server.connectivity.PermissionMonitor.NETWORK;
@@ -43,8 +45,10 @@
import static org.junit.Assert.assertTrue;
import static org.mockito.AdditionalMatchers.aryEq;
import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doReturn;
@@ -61,6 +65,7 @@
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
+import android.database.ContentObserver;
import android.net.INetd;
import android.net.UidRange;
import android.net.Uri;
@@ -68,6 +73,7 @@
import android.os.SystemConfigManager;
import android.os.UserHandle;
import android.os.UserManager;
+import android.util.ArraySet;
import android.util.SparseIntArray;
import androidx.test.InstrumentationRegistry;
@@ -136,6 +142,7 @@
final Context asUserCtx = mock(Context.class, AdditionalAnswers.delegatesTo(mContext));
doReturn(UserHandle.ALL).when(asUserCtx).getUser();
when(mContext.createContextAsUser(eq(UserHandle.ALL), anyInt())).thenReturn(asUserCtx);
+ when(mDeps.getAppsAllowedOnRestrictedNetworks(any())).thenReturn(new ArraySet<>());
mPermissionMonitor = spy(new PermissionMonitor(mContext, mNetdService, mDeps));
@@ -145,8 +152,15 @@
private boolean hasRestrictedNetworkPermission(String partition, int targetSdkVersion, int uid,
String... permissions) {
+ return hasRestrictedNetworkPermission(
+ partition, targetSdkVersion, "" /* packageName */, uid, permissions);
+ }
+
+ private boolean hasRestrictedNetworkPermission(String partition, int targetSdkVersion,
+ String packageName, int uid, String... permissions) {
final PackageInfo packageInfo =
packageInfoWithPermissions(REQUESTED_PERMISSION_GRANTED, permissions, partition);
+ packageInfo.packageName = packageName;
packageInfo.applicationInfo.targetSdkVersion = targetSdkVersion;
packageInfo.applicationInfo.uid = uid;
return mPermissionMonitor.hasRestrictedNetworkPermission(packageInfo);
@@ -280,6 +294,8 @@
PARTITION_SYSTEM, VERSION_P, MOCK_UID1, CONNECTIVITY_USE_RESTRICTED_NETWORKS));
assertFalse(hasRestrictedNetworkPermission(
PARTITION_SYSTEM, VERSION_P, MOCK_UID1, CHANGE_WIFI_STATE));
+ assertTrue(hasRestrictedNetworkPermission(
+ PARTITION_SYSTEM, VERSION_P, MOCK_UID1, PERMISSION_MAINLINE_NETWORK_STACK));
assertFalse(hasRestrictedNetworkPermission(PARTITION_SYSTEM, VERSION_Q, MOCK_UID1));
assertFalse(hasRestrictedNetworkPermission(
@@ -324,6 +340,90 @@
PARTITION_VENDOR, VERSION_Q, MOCK_UID1, CHANGE_NETWORK_STATE));
}
+ @Test
+ public void testHasRestrictedNetworkPermissionAppAllowedOnRestrictedNetworks() {
+ mPermissionMonitor.updateAppsAllowedOnRestrictedNetworks(
+ new ArraySet<>(new String[] { MOCK_PACKAGE1 }));
+ assertTrue(hasRestrictedNetworkPermission(
+ PARTITION_VENDOR, VERSION_Q, MOCK_PACKAGE1, MOCK_UID1));
+ assertTrue(hasRestrictedNetworkPermission(
+ PARTITION_VENDOR, VERSION_Q, MOCK_PACKAGE1, MOCK_UID1, CHANGE_NETWORK_STATE));
+ assertTrue(hasRestrictedNetworkPermission(
+ PARTITION_VENDOR, VERSION_Q, MOCK_PACKAGE1, MOCK_UID1, CONNECTIVITY_INTERNAL));
+
+ assertFalse(hasRestrictedNetworkPermission(
+ PARTITION_VENDOR, VERSION_Q, MOCK_PACKAGE2, MOCK_UID1));
+ assertFalse(hasRestrictedNetworkPermission(
+ PARTITION_VENDOR, VERSION_Q, MOCK_PACKAGE2, MOCK_UID1, CHANGE_NETWORK_STATE));
+ assertFalse(hasRestrictedNetworkPermission(
+ PARTITION_VENDOR, VERSION_Q, MOCK_PACKAGE2, MOCK_UID1, CONNECTIVITY_INTERNAL));
+
+ }
+
+ private boolean wouldBeCarryoverPackage(String partition, int targetSdkVersion, int uid) {
+ final PackageInfo packageInfo = packageInfoWithPermissions(
+ REQUESTED_PERMISSION_GRANTED, new String[] {}, partition);
+ packageInfo.applicationInfo.targetSdkVersion = targetSdkVersion;
+ packageInfo.applicationInfo.uid = uid;
+ return mPermissionMonitor.isCarryoverPackage(packageInfo.applicationInfo);
+ }
+
+ @Test
+ public void testIsCarryoverPackage() {
+ doReturn(VERSION_P).when(mDeps).getDeviceFirstSdkInt();
+ assertTrue(wouldBeCarryoverPackage(PARTITION_SYSTEM, VERSION_P, SYSTEM_UID));
+ assertTrue(wouldBeCarryoverPackage(PARTITION_VENDOR, VERSION_P, SYSTEM_UID));
+ assertFalse(wouldBeCarryoverPackage(PARTITION_SYSTEM, VERSION_P, MOCK_UID1));
+ assertTrue(wouldBeCarryoverPackage(PARTITION_VENDOR, VERSION_P, MOCK_UID1));
+ assertTrue(wouldBeCarryoverPackage(PARTITION_SYSTEM, VERSION_Q, SYSTEM_UID));
+ assertTrue(wouldBeCarryoverPackage(PARTITION_VENDOR, VERSION_Q, SYSTEM_UID));
+ assertFalse(wouldBeCarryoverPackage(PARTITION_SYSTEM, VERSION_Q, MOCK_UID1));
+ assertFalse(wouldBeCarryoverPackage(PARTITION_VENDOR, VERSION_Q, MOCK_UID1));
+
+ doReturn(VERSION_Q).when(mDeps).getDeviceFirstSdkInt();
+ assertFalse(wouldBeCarryoverPackage(PARTITION_SYSTEM, VERSION_P, SYSTEM_UID));
+ assertTrue(wouldBeCarryoverPackage(PARTITION_VENDOR, VERSION_P, SYSTEM_UID));
+ assertFalse(wouldBeCarryoverPackage(PARTITION_SYSTEM, VERSION_P, MOCK_UID1));
+ assertTrue(wouldBeCarryoverPackage(PARTITION_VENDOR, VERSION_P, MOCK_UID1));
+ assertFalse(wouldBeCarryoverPackage(PARTITION_SYSTEM, VERSION_Q, SYSTEM_UID));
+ assertFalse(wouldBeCarryoverPackage(PARTITION_VENDOR, VERSION_Q, SYSTEM_UID));
+ assertFalse(wouldBeCarryoverPackage(PARTITION_SYSTEM, VERSION_Q, MOCK_UID1));
+ assertFalse(wouldBeCarryoverPackage(PARTITION_VENDOR, VERSION_Q, MOCK_UID1));
+
+ assertFalse(wouldBeCarryoverPackage(PARTITION_OEM, VERSION_Q, SYSTEM_UID));
+ assertFalse(wouldBeCarryoverPackage(PARTITION_PRODUCT, VERSION_Q, SYSTEM_UID));
+ assertFalse(wouldBeCarryoverPackage(PARTITION_OEM, VERSION_Q, MOCK_UID1));
+ assertFalse(wouldBeCarryoverPackage(PARTITION_PRODUCT, VERSION_Q, MOCK_UID1));
+ }
+
+ private boolean wouldBeAppAllowedOnRestrictedNetworks(String packageName) {
+ final PackageInfo packageInfo = new PackageInfo();
+ packageInfo.packageName = packageName;
+ return mPermissionMonitor.isAppAllowedOnRestrictedNetworks(packageInfo);
+ }
+
+ @Test
+ public void testIsAppAllowedOnRestrictedNetworks() {
+ mPermissionMonitor.updateAppsAllowedOnRestrictedNetworks(new ArraySet<>());
+ assertFalse(wouldBeAppAllowedOnRestrictedNetworks(MOCK_PACKAGE1));
+ assertFalse(wouldBeAppAllowedOnRestrictedNetworks(MOCK_PACKAGE2));
+
+ mPermissionMonitor.updateAppsAllowedOnRestrictedNetworks(
+ new ArraySet<>(new String[] { MOCK_PACKAGE1 }));
+ assertTrue(wouldBeAppAllowedOnRestrictedNetworks(MOCK_PACKAGE1));
+ assertFalse(wouldBeAppAllowedOnRestrictedNetworks(MOCK_PACKAGE2));
+
+ mPermissionMonitor.updateAppsAllowedOnRestrictedNetworks(
+ new ArraySet<>(new String[] { MOCK_PACKAGE2 }));
+ assertFalse(wouldBeAppAllowedOnRestrictedNetworks(MOCK_PACKAGE1));
+ assertTrue(wouldBeAppAllowedOnRestrictedNetworks(MOCK_PACKAGE2));
+
+ mPermissionMonitor.updateAppsAllowedOnRestrictedNetworks(
+ new ArraySet<>(new String[] { "com.android.test" }));
+ assertFalse(wouldBeAppAllowedOnRestrictedNetworks(MOCK_PACKAGE1));
+ assertFalse(wouldBeAppAllowedOnRestrictedNetworks(MOCK_PACKAGE2));
+ }
+
private void assertBackgroundPermission(boolean hasPermission, String name, int uid,
String... permissions) throws Exception {
when(mPackageManager.getPackageInfo(eq(name), anyInt()))
@@ -800,4 +900,102 @@
mNetdServiceMonitor.expectPermission(INetd.PERMISSION_UNINSTALLED, new int[] { MOCK_UID1 });
}
-}
+ @Test
+ public void testAppsAllowedOnRestrictedNetworksChanged() throws Exception {
+ final NetdMonitor mNetdMonitor = new NetdMonitor(mNetdService);
+ final ArgumentCaptor<ContentObserver> captor =
+ ArgumentCaptor.forClass(ContentObserver.class);
+ verify(mDeps, times(1)).registerContentObserver(any(),
+ argThat(uri -> uri.getEncodedPath().contains(APPS_ALLOWED_ON_RESTRICTED_NETWORKS)),
+ anyBoolean(), captor.capture());
+ final ContentObserver contentObserver = captor.getValue();
+
+ mPermissionMonitor.onUserAdded(MOCK_USER1);
+ // Prepare PackageInfo for MOCK_PACKAGE1
+ final PackageInfo packageInfo = buildPackageInfo(
+ false /* hasSystemPermission */, MOCK_UID1, MOCK_USER1);
+ packageInfo.packageName = MOCK_PACKAGE1;
+ when(mPackageManager.getPackageInfo(eq(MOCK_PACKAGE1), anyInt())).thenReturn(packageInfo);
+ when(mPackageManager.getPackagesForUid(MOCK_UID1)).thenReturn(new String[]{MOCK_PACKAGE1});
+ // Prepare PackageInfo for MOCK_PACKAGE2
+ final PackageInfo packageInfo2 = buildPackageInfo(
+ false /* hasSystemPermission */, MOCK_UID2, MOCK_USER1);
+ packageInfo2.packageName = MOCK_PACKAGE2;
+ when(mPackageManager.getPackageInfo(eq(MOCK_PACKAGE2), anyInt())).thenReturn(packageInfo2);
+ when(mPackageManager.getPackagesForUid(MOCK_UID2)).thenReturn(new String[]{MOCK_PACKAGE2});
+
+ // MOCK_PACKAGE1 is listed in setting that allow to use restricted networks, MOCK_UID1
+ // should have SYSTEM permission.
+ when(mDeps.getAppsAllowedOnRestrictedNetworks(any())).thenReturn(
+ new ArraySet<>(new String[] { MOCK_PACKAGE1 }));
+ contentObserver.onChange(true /* selfChange */);
+ mNetdMonitor.expectPermission(SYSTEM, new UserHandle[]{MOCK_USER1}, new int[]{MOCK_UID1});
+ mNetdMonitor.expectNoPermission(new UserHandle[]{MOCK_USER1}, new int[]{MOCK_UID2});
+
+ // MOCK_PACKAGE2 is listed in setting that allow to use restricted networks, MOCK_UID2
+ // should have SYSTEM permission but MOCK_UID1 should revoke permission.
+ when(mDeps.getAppsAllowedOnRestrictedNetworks(any())).thenReturn(
+ new ArraySet<>(new String[] { MOCK_PACKAGE2 }));
+ contentObserver.onChange(true /* selfChange */);
+ mNetdMonitor.expectPermission(SYSTEM, new UserHandle[]{MOCK_USER1}, new int[]{MOCK_UID2});
+ mNetdMonitor.expectNoPermission(new UserHandle[]{MOCK_USER1}, new int[]{MOCK_UID1});
+
+ // No app lists in setting, should revoke permission from all uids.
+ when(mDeps.getAppsAllowedOnRestrictedNetworks(any())).thenReturn(new ArraySet<>());
+ contentObserver.onChange(true /* selfChange */);
+ mNetdMonitor.expectNoPermission(
+ new UserHandle[]{MOCK_USER1}, new int[]{MOCK_UID1, MOCK_UID2});
+ }
+
+ @Test
+ public void testAppsAllowedOnRestrictedNetworksChangedWithSharedUid() throws Exception {
+ final NetdMonitor mNetdMonitor = new NetdMonitor(mNetdService);
+ final ArgumentCaptor<ContentObserver> captor =
+ ArgumentCaptor.forClass(ContentObserver.class);
+ verify(mDeps, times(1)).registerContentObserver(any(),
+ argThat(uri -> uri.getEncodedPath().contains(APPS_ALLOWED_ON_RESTRICTED_NETWORKS)),
+ anyBoolean(), captor.capture());
+ final ContentObserver contentObserver = captor.getValue();
+
+ mPermissionMonitor.onUserAdded(MOCK_USER1);
+ // Prepare PackageInfo for MOCK_PACKAGE1 and MOCK_PACKAGE2 with shared uid MOCK_UID1.
+ final PackageInfo packageInfo = systemPackageInfoWithPermissions(CHANGE_NETWORK_STATE);
+ packageInfo.applicationInfo.uid = MOCK_USER1.getUid(MOCK_UID1);
+ packageInfo.packageName = MOCK_PACKAGE1;
+ final PackageInfo packageInfo2 = buildPackageInfo(
+ false /* hasSystemPermission */, MOCK_UID1, MOCK_USER1);
+ packageInfo2.packageName = MOCK_PACKAGE2;
+ when(mPackageManager.getPackageInfo(eq(MOCK_PACKAGE1), anyInt())).thenReturn(packageInfo);
+ when(mPackageManager.getPackageInfo(eq(MOCK_PACKAGE2), anyInt())).thenReturn(packageInfo2);
+ when(mPackageManager.getPackagesForUid(MOCK_UID1))
+ .thenReturn(new String[]{MOCK_PACKAGE1, MOCK_PACKAGE2});
+
+ // MOCK_PACKAGE1 have CHANGE_NETWORK_STATE, MOCK_UID1 should have NETWORK permission.
+ addPackageForUsers(new UserHandle[]{MOCK_USER1}, MOCK_PACKAGE1, MOCK_UID1);
+ mNetdMonitor.expectPermission(NETWORK, new UserHandle[]{MOCK_USER1}, new int[]{MOCK_UID1});
+
+ // MOCK_PACKAGE2 is listed in setting that allow to use restricted networks, MOCK_UID1
+ // should upgrade to SYSTEM permission.
+ when(mDeps.getAppsAllowedOnRestrictedNetworks(any())).thenReturn(
+ new ArraySet<>(new String[] { MOCK_PACKAGE2 }));
+ contentObserver.onChange(true /* selfChange */);
+ mNetdMonitor.expectPermission(SYSTEM, new UserHandle[]{MOCK_USER1}, new int[]{MOCK_UID1});
+
+ // MOCK_PACKAGE1 is listed in setting that allow to use restricted networks, MOCK_UID1
+ // should still have SYSTEM permission.
+ when(mDeps.getAppsAllowedOnRestrictedNetworks(any())).thenReturn(
+ new ArraySet<>(new String[] { MOCK_PACKAGE1 }));
+ contentObserver.onChange(true /* selfChange */);
+ mNetdMonitor.expectPermission(SYSTEM, new UserHandle[]{MOCK_USER1}, new int[]{MOCK_UID1});
+
+ // No app lists in setting, MOCK_UID1 should downgrade to NETWORK permission.
+ when(mDeps.getAppsAllowedOnRestrictedNetworks(any())).thenReturn(new ArraySet<>());
+ contentObserver.onChange(true /* selfChange */);
+ mNetdMonitor.expectPermission(NETWORK, new UserHandle[]{MOCK_USER1}, new int[]{MOCK_UID1});
+
+ // MOCK_PACKAGE1 removed, should revoke permission from MOCK_UID1.
+ when(mPackageManager.getPackagesForUid(MOCK_UID1)).thenReturn(new String[]{MOCK_PACKAGE2});
+ removePackageForUsers(new UserHandle[]{MOCK_USER1}, MOCK_PACKAGE1, MOCK_UID1);
+ mNetdMonitor.expectNoPermission(new UserHandle[]{MOCK_USER1}, new int[]{MOCK_UID1});
+ }
+}
\ No newline at end of file
diff --git a/packages/Connectivity/tests/unit/java/com/android/server/net/NetworkStatsServiceTest.java b/packages/Connectivity/tests/unit/java/com/android/server/net/NetworkStatsServiceTest.java
index 87b4aee..c32c1d2 100644
--- a/packages/Connectivity/tests/unit/java/com/android/server/net/NetworkStatsServiceTest.java
+++ b/packages/Connectivity/tests/unit/java/com/android/server/net/NetworkStatsServiceTest.java
@@ -307,7 +307,7 @@
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_WIFI, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_WIFI, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
}
@@ -388,7 +388,7 @@
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_WIFI, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_WIFI, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// verify service has empty history for wifi
@@ -462,7 +462,7 @@
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_WIFI, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_WIFI, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// modify some number on wifi, and trigger poll event
@@ -503,7 +503,7 @@
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_MOBILE, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_MOBILE, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// create some traffic on first network
@@ -538,7 +538,7 @@
.insertEntry(TEST_IFACE, UID_RED, SET_DEFAULT, 0xF00D, 512L, 4L, 512L, 4L, 0L)
.insertEntry(TEST_IFACE, UID_BLUE, SET_DEFAULT, TAG_NONE, 512L, 4L, 0L, 0L, 0L));
- mService.forceUpdateIfaces(NETWORKS_MOBILE, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_MOBILE, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
forcePollAndWaitForIdle();
@@ -578,7 +578,7 @@
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_WIFI, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_WIFI, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// create some traffic
@@ -646,7 +646,7 @@
expectNetworkStatsUidDetail(buildEmptyStats());
setMobileRatTypeAndWaitForIdle(TelephonyManager.NETWORK_TYPE_UMTS);
- mService.forceUpdateIfaces(NETWORKS_MOBILE, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_MOBILE, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// Create some traffic.
@@ -738,7 +738,7 @@
new int[]{NetworkCapabilities.NET_CAPABILITY_OEM_PAID})};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_MOBILE, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_MOBILE, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// Create some traffic.
@@ -753,7 +753,7 @@
new int[]{NetworkCapabilities.NET_CAPABILITY_OEM_PRIVATE})};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_MOBILE, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_MOBILE, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// Create some traffic.
@@ -769,7 +769,7 @@
NetworkCapabilities.NET_CAPABILITY_OEM_PAID})};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_MOBILE, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_MOBILE, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// Create some traffic.
@@ -783,7 +783,7 @@
states = new NetworkStateSnapshot[]{buildOemManagedMobileState(IMSI_1, false, new int[]{})};
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_MOBILE, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_MOBILE, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// Create some traffic.
@@ -836,7 +836,7 @@
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_WIFI, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_WIFI, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// create some traffic for two apps
@@ -895,7 +895,7 @@
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_WIFI, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_WIFI, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
NetworkStats.Entry entry1 = new NetworkStats.Entry(
@@ -939,7 +939,7 @@
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_WIFI, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_WIFI, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
NetworkStats.Entry uidStats = new NetworkStats.Entry(
@@ -970,7 +970,7 @@
// mStatsFactory#readNetworkStatsDetail() has the following invocations:
// 1) NetworkStatsService#systemReady from #setUp.
- // 2) mService#forceUpdateIfaces in the test above.
+ // 2) mService#notifyNetworkStatus in the test above.
//
// Additionally, we should have one call from the above call to mService#getDetailedUidStats
// with the augmented ifaceFilter.
@@ -994,7 +994,7 @@
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_WIFI, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_WIFI, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// create some initial traffic
@@ -1052,7 +1052,7 @@
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_WIFI, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_WIFI, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// create some initial traffic
@@ -1092,7 +1092,7 @@
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_MOBILE, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_MOBILE, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// Create some traffic
@@ -1131,7 +1131,7 @@
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_MOBILE, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_MOBILE, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// create some tethering traffic
@@ -1188,7 +1188,7 @@
expectNetworkStatsSummary(buildEmptyStats());
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_WIFI, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_WIFI, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// verify service has empty history for wifi
@@ -1294,7 +1294,7 @@
mService.registerNetworkStatsProvider("TEST", provider);
assertNotNull(cb);
- mService.forceUpdateIfaces(NETWORKS_WIFI, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_WIFI, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// Verifies that one requestStatsUpdate will be called during iface update.
@@ -1359,7 +1359,7 @@
mService.registerNetworkStatsProvider("TEST", provider);
assertNotNull(cb);
- mService.forceUpdateIfaces(NETWORKS_MOBILE, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_MOBILE, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// Verifies that one requestStatsUpdate will be called during iface update.
@@ -1417,7 +1417,7 @@
expectDefaultSettings();
NetworkStateSnapshot[] states =
new NetworkStateSnapshot[]{buildWifiState(true /* isMetered */, TEST_IFACE)};
- mService.forceUpdateIfaces(NETWORKS_WIFI, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_WIFI, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// Register custom provider and retrieve callback.
@@ -1467,7 +1467,7 @@
// 3G network comes online.
setMobileRatTypeAndWaitForIdle(TelephonyManager.NETWORK_TYPE_UMTS);
- mService.forceUpdateIfaces(NETWORKS_MOBILE, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_MOBILE, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// Create some traffic.
@@ -1489,7 +1489,8 @@
setCombineSubtypeEnabled(true);
// Call handleOnCollapsedRatTypeChanged manually to simulate the callback fired
- // when stopping monitor, this is needed by NetworkStatsService to trigger updateIfaces.
+ // when stopping monitor, this is needed by NetworkStatsService to trigger
+ // handleNotifyNetworkStatus.
mService.handleOnCollapsedRatTypeChanged();
HandlerUtils.waitForIdle(mHandlerThread, WAIT_TIMEOUT);
// Create some traffic.
@@ -1538,7 +1539,7 @@
NetworkStateSnapshot[] states = new NetworkStateSnapshot[]{
buildWifiState(true /*isMetered*/, TEST_IFACE2), buildMobile3gState(IMSI_1)};
expectNetworkStatsUidDetail(buildEmptyStats());
- mService.forceUpdateIfaces(NETWORKS_WIFI, states, getActiveIface(states),
+ mService.notifyNetworkStatus(NETWORKS_WIFI, states, getActiveIface(states),
new UnderlyingNetworkInfo[0]);
// Create some traffic on mobile network.
diff --git a/packages/SettingsLib/BannerMessagePreference/Android.bp b/packages/SettingsLib/BannerMessagePreference/Android.bp
index 82e837b..c6a9562 100644
--- a/packages/SettingsLib/BannerMessagePreference/Android.bp
+++ b/packages/SettingsLib/BannerMessagePreference/Android.bp
@@ -14,9 +14,10 @@
resource_dirs: ["res"],
static_libs: [
- "androidx.preference_preference",
+ "androidx.preference_preference",
+ "SettingsLibSettingsTheme",
],
sdk_version: "system_current",
- min_sdk_version: "21",
+ min_sdk_version: "28",
}
diff --git a/packages/SettingsLib/BannerMessagePreference/AndroidManifest.xml b/packages/SettingsLib/BannerMessagePreference/AndroidManifest.xml
index 56b886f..dd51ea3 100644
--- a/packages/SettingsLib/BannerMessagePreference/AndroidManifest.xml
+++ b/packages/SettingsLib/BannerMessagePreference/AndroidManifest.xml
@@ -18,6 +18,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.settingslib.widget">
- <uses-sdk android:minSdkVersion="21"/>
+ <uses-sdk android:minSdkVersion="28"/>
</manifest>
diff --git a/packages/SettingsLib/BannerMessagePreference/lint-baseline.xml b/packages/SettingsLib/BannerMessagePreference/lint-baseline.xml
deleted file mode 100644
index ba02a1f..0000000
--- a/packages/SettingsLib/BannerMessagePreference/lint-baseline.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<issues format="5" by="lint 4.1.0" client="cli" variant="all" version="4.1.0">
-
- <issue
- id="NewApi"
- message="`@android:style/Widget.DeviceDefault.Button.Borderless.Colored` requires API level 28 (current min is 21)"
- errorLine1=" style="@android:style/Widget.DeviceDefault.Button.Borderless.Colored"/>"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="frameworks/base/packages/SettingsLib/BannerMessagePreference/res/layout/banner_message.xml"
- line="65"
- column="13"/>
- </issue>
-
- <issue
- id="NewApi"
- message="`@android:style/Widget.DeviceDefault.Button.Borderless.Colored` requires API level 28 (current min is 21)"
- errorLine1=" style="@android:style/Widget.DeviceDefault.Button.Borderless.Colored"/>"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="frameworks/base/packages/SettingsLib/BannerMessagePreference/res/layout/banner_message.xml"
- line="71"
- column="13"/>
- </issue>
-
- <issue
- id="NewApi"
- message="`?android:attr/colorError` requires API level 26 (current min is 21)"
- errorLine1=" android:fillColor="?android:attr/colorError""
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="frameworks/base/packages/SettingsLib/BannerMessagePreference/res/drawable/ic_warning.xml"
- line="24"
- column="9"/>
- </issue>
-
-</issues>
diff --git a/packages/SettingsLib/BannerMessagePreference/res/drawable-v31/settingslib_card_background.xml b/packages/SettingsLib/BannerMessagePreference/res/drawable-v31/settingslib_card_background.xml
new file mode 100644
index 0000000..072eb58
--- /dev/null
+++ b/packages/SettingsLib/BannerMessagePreference/res/drawable-v31/settingslib_card_background.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.
+ -->
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+ <solid android:color="?android:attr/background" />
+ <corners android:radius="28dp"/>
+</shape>
\ No newline at end of file
diff --git a/packages/SettingsLib/BannerMessagePreference/res/drawable-v31/settingslib_ic_cross.xml b/packages/SettingsLib/BannerMessagePreference/res/drawable-v31/settingslib_ic_cross.xml
new file mode 100644
index 0000000..d926cc6
--- /dev/null
+++ b/packages/SettingsLib/BannerMessagePreference/res/drawable-v31/settingslib_ic_cross.xml
@@ -0,0 +1,25 @@
+<!--
+ 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.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="?android:attr/textColorSecondary"
+ android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12 19,6.41z"/>
+</vector>
diff --git a/packages/SettingsLib/BannerMessagePreference/res/layout-v31/settingslib_banner_message.xml b/packages/SettingsLib/BannerMessagePreference/res/layout-v31/settingslib_banner_message.xml
new file mode 100644
index 0000000..904b78c
--- /dev/null
+++ b/packages/SettingsLib/BannerMessagePreference/res/layout-v31/settingslib_banner_message.xml
@@ -0,0 +1,90 @@
+<?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.
+ -->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ style="@style/Banner.Preference.SettingsLib">
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingBottom="8dp"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@+id/banner_icon"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
+ android:layout_alignParentStart="true"
+ android:importantForAccessibility="no" />
+
+ <ImageButton
+ android:id="@+id/banner_dismiss_btn"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/settingslib_ic_cross"
+ android:layout_alignParentEnd="true"
+ android:contentDescription="@string/accessibility_banner_message_dismiss"
+ style="@style/Banner.Dismiss.SettingsLib" />
+ </RelativeLayout>
+
+ <TextView
+ android:id="@+id/banner_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingBottom="4dp"
+ android:textAppearance="@style/Banner.Title.SettingsLib"/>
+
+ <TextView
+ android:id="@+id/banner_subtitle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingBottom="4dp"
+ android:textAppearance="@style/Banner.Subtitle.SettingsLib"
+ android:visibility="gone"/>
+
+ <TextView
+ android:id="@+id/banner_summary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingTop="4dp"
+ android:paddingBottom="8dp"
+ android:textAppearance="@style/Banner.Summary.SettingsLib"/>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:minHeight="8dp"
+ android:gravity="end">
+
+ <Button
+ android:id="@+id/banner_negative_btn"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ style="@style/Banner.ButtonText.SettingsLib"/>
+
+ <Button
+ android:id="@+id/banner_positive_btn"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ style="@style/Banner.ButtonText.SettingsLib"/>
+ </LinearLayout>
+</LinearLayout>
\ No newline at end of file
diff --git a/packages/SettingsLib/BannerMessagePreference/res/layout/banner_message.xml b/packages/SettingsLib/BannerMessagePreference/res/layout/settingslib_banner_message.xml
similarity index 81%
rename from packages/SettingsLib/BannerMessagePreference/res/layout/banner_message.xml
rename to packages/SettingsLib/BannerMessagePreference/res/layout/settingslib_banner_message.xml
index 977e196..80cb1d5 100644
--- a/packages/SettingsLib/BannerMessagePreference/res/layout/banner_message.xml
+++ b/packages/SettingsLib/BannerMessagePreference/res/layout/settingslib_banner_message.xml
@@ -30,8 +30,10 @@
android:orientation="horizontal">
<ImageView
+ android:id="@+id/banner_icon"
android:layout_width="24dp"
android:layout_height="24dp"
+ android:importantForAccessibility="no"
android:src="@drawable/ic_warning"/>
<LinearLayout
@@ -70,4 +72,19 @@
android:layout_height="wrap_content"
style="@android:style/Widget.DeviceDefault.Button.Borderless.Colored"/>
</LinearLayout>
+
+ <!-- Not supported before v31 -->
+ <TextView
+ android:id="@+id/banner_subtitle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone"/>
+
+ <!-- Not supported before v31 -->
+ <ImageButton
+ android:id="@+id/banner_dismiss_btn"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:contentDescription="@string/accessibility_banner_message_dismiss"
+ android:visibility="gone"/>
</LinearLayout>
\ No newline at end of file
diff --git a/packages/SettingsLib/BannerMessagePreference/res/values-night/colors.xml b/packages/SettingsLib/BannerMessagePreference/res/values-night/colors.xml
new file mode 100644
index 0000000..50141a8
--- /dev/null
+++ b/packages/SettingsLib/BannerMessagePreference/res/values-night/colors.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2021 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<resources>
+ <color name="banner_background_attention_high">#3B2D2C</color> <!-- red card background -->
+ <color name="banner_background_attention_medium">#333121</color> <!-- yellow card background -->
+ <color name="banner_background_attention_low">#2B3328</color> <!-- green card background -->
+ <color name="banner_accent_attention_high">#F28B82</color> <!-- red accent color -->
+ <color name="banner_accent_attention_medium">#FDD663</color> <!-- yellow accent color -->
+ <color name="banner_accent_attention_low">#81C995</color> <!-- green accent color -->
+</resources>
diff --git a/packages/SettingsLib/BannerMessagePreference/res/values-v31/styles.xml b/packages/SettingsLib/BannerMessagePreference/res/values-v31/styles.xml
new file mode 100644
index 0000000..a39e779
--- /dev/null
+++ b/packages/SettingsLib/BannerMessagePreference/res/values-v31/styles.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2020 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<resources>
+
+ <style name="Banner.Preference.SettingsLib"
+ parent="android:Widget.DeviceDefault">
+ <item name="android:paddingStart">20dp</item>
+ <item name="android:paddingEnd">20dp</item>
+ <item name="android:paddingTop">20dp</item>
+ <item name="android:paddingBottom">8dp</item>
+ <item name="android:layout_marginTop">8dp</item>
+ <item name="android:layout_marginStart">16dp</item>
+ <item name="android:layout_marginBottom">8dp</item>
+ <item name="android:layout_marginEnd">16dp</item>
+ <item name="android:background">@drawable/settingslib_card_background</item>
+ </style>
+
+ <style name="Banner.Title.SettingsLib"
+ parent="@android:style/TextAppearance.Material.Subhead">
+ <item name="android:textSize">20sp</item>
+ <item name="android:fontFamily">@*android:string/config_headlineFontFamilyMedium</item>
+ <item name="android:textColor">?android:attr/textColorPrimary</item>
+ </style>
+
+ <style name="Banner.Subtitle.SettingsLib"
+ parent="@*android:style/TextAppearance.DeviceDefault.Body1">
+ <item name="android:textColor">?android:attr/textColorSecondary</item>
+ <item name="android:textSize">14sp</item>
+ </style>
+
+ <style name="Banner.Summary.SettingsLib"
+ parent="@*android:style/TextAppearance.DeviceDefault.Body1">
+ <item name="android:textColor">?android:attr/textColorSecondary</item>
+ <item name="android:textSize">14sp</item>
+ </style>
+
+ <style name="Banner.Dismiss.SettingsLib"
+ parent="android:Widget.DeviceDefault.ImageButton">
+ <item name="android:background">@android:color/transparent</item>
+ </style>
+
+ <style name="Banner.ButtonText.SettingsLib"
+ parent="android:Widget.DeviceDefault.Button.Borderless.Colored">
+ <item name="android:textColor">?android:attr/colorAccent</item>
+ </style>
+</resources>
\ No newline at end of file
diff --git a/packages/SettingsLib/BannerMessagePreference/res/values/attrs.xml b/packages/SettingsLib/BannerMessagePreference/res/values/attrs.xml
new file mode 100644
index 0000000..96634a5
--- /dev/null
+++ b/packages/SettingsLib/BannerMessagePreference/res/values/attrs.xml
@@ -0,0 +1,27 @@
+<?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>
+ <declare-styleable name="BannerMessagePreference">
+ <attr format="enum" name="attentionLevel">
+ <enum name="high" value="0"/>
+ <enum name="medium" value="1"/>
+ <enum name="low" value="2"/>
+ </attr>
+ <attr format="string" name="subtitle" />
+ </declare-styleable>
+</resources>
\ No newline at end of file
diff --git a/packages/SettingsLib/BannerMessagePreference/res/values/colors.xml b/packages/SettingsLib/BannerMessagePreference/res/values/colors.xml
new file mode 100644
index 0000000..53d72d1
--- /dev/null
+++ b/packages/SettingsLib/BannerMessagePreference/res/values/colors.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2021 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<resources>
+ <color name="banner_background_attention_high">#FFDAD5</color> <!-- red card background -->
+ <color name="banner_background_attention_medium">#F0E3A8</color> <!-- yellow card background -->
+ <color name="banner_background_attention_low">#CFEBC0</color> <!-- green card background -->
+ <color name="banner_accent_attention_high">#BB3322</color> <!-- red accent color -->
+ <color name="banner_accent_attention_medium">#895900</color> <!-- yellow accent color -->
+ <color name="banner_accent_attention_low">#1D7233</color> <!-- green accent color -->
+</resources>
diff --git a/packages/SettingsLib/BannerMessagePreference/res/values/strings.xml b/packages/SettingsLib/BannerMessagePreference/res/values/strings.xml
new file mode 100644
index 0000000..a1af38a
--- /dev/null
+++ b/packages/SettingsLib/BannerMessagePreference/res/values/strings.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.
+ -->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+ <!-- Content description of the dismiss button on a banner message for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
+ <string name="accessibility_banner_message_dismiss">Dismiss</string>
+</resources>
+
+
diff --git a/packages/SettingsLib/BannerMessagePreference/src/com/android/settingslib/widget/BannerMessagePreference.java b/packages/SettingsLib/BannerMessagePreference/src/com/android/settingslib/widget/BannerMessagePreference.java
index 5352552..5bedd7a1 100644
--- a/packages/SettingsLib/BannerMessagePreference/src/com/android/settingslib/widget/BannerMessagePreference.java
+++ b/packages/SettingsLib/BannerMessagePreference/src/com/android/settingslib/widget/BannerMessagePreference.java
@@ -17,13 +17,25 @@
package com.android.settingslib.widget;
import android.content.Context;
+import android.content.res.Resources;
+import android.content.res.TypedArray;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffColorFilter;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
+import android.widget.ImageButton;
+import android.widget.ImageView;
import android.widget.TextView;
+import androidx.annotation.ColorInt;
+import androidx.annotation.ColorRes;
+import androidx.annotation.RequiresApi;
import androidx.annotation.StringRes;
+import androidx.core.os.BuildCompat;
import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
@@ -33,55 +45,151 @@
*/
public class BannerMessagePreference extends Preference {
+ public enum AttentionLevel {
+ HIGH(0, R.color.banner_background_attention_high, R.color.banner_accent_attention_high),
+ MEDIUM(1,
+ R.color.banner_background_attention_medium,
+ R.color.banner_accent_attention_medium),
+ LOW(2, R.color.banner_background_attention_low, R.color.banner_accent_attention_low);
+
+ // Corresponds to the enum valye of R.attr.attentionLevel
+ private final int mAttrValue;
+ @ColorRes private final int mBackgroundColorResId;
+ @ColorRes private final int mAccentColorResId;
+
+ AttentionLevel(int attrValue, @ColorRes int backgroundColorResId,
+ @ColorRes int accentColorResId) {
+ mAttrValue = attrValue;
+ mBackgroundColorResId = backgroundColorResId;
+ mAccentColorResId = accentColorResId;
+ }
+
+ static AttentionLevel fromAttr(int attrValue) {
+ for (AttentionLevel level : values()) {
+ if (level.mAttrValue == attrValue) {
+ return level;
+ }
+ }
+ throw new IllegalArgumentException();
+ }
+
+ @ColorRes int getAccentColorResId() {
+ return mAccentColorResId;
+ }
+
+ @ColorRes int getBackgroundColorResId() {
+ return mBackgroundColorResId;
+ }
+ }
+
private static final String TAG = "BannerPreference";
- private BannerMessagePreference.ButtonInfo mPositiveButtonInfo;
- private BannerMessagePreference.ButtonInfo mNegativeButtonInfo;
+ private static final boolean IS_AT_LEAST_S = BuildCompat.isAtLeastS();
+
+ private final BannerMessagePreference.ButtonInfo mPositiveButtonInfo =
+ new BannerMessagePreference.ButtonInfo();
+ private final BannerMessagePreference.ButtonInfo mNegativeButtonInfo =
+ new BannerMessagePreference.ButtonInfo();
+ private final BannerMessagePreference.DismissButtonInfo mDismissButtonInfo =
+ new BannerMessagePreference.DismissButtonInfo();
+
+ // Default attention level is High.
+ private AttentionLevel mAttentionLevel = AttentionLevel.HIGH;
+ private String mSubtitle;
public BannerMessagePreference(Context context) {
super(context);
- init();
+ init(context, null /* attrs */);
}
public BannerMessagePreference(Context context, AttributeSet attrs) {
super(context, attrs);
- init();
+ init(context, attrs);
}
public BannerMessagePreference(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
- init();
+ init(context, attrs);
}
public BannerMessagePreference(Context context, AttributeSet attrs, int defStyleAttr,
int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
- init();
+ init(context, attrs);
+ }
+
+ private void init(Context context, AttributeSet attrs) {
+ setSelectable(false);
+ setLayoutResource(R.layout.settingslib_banner_message);
+
+ if (IS_AT_LEAST_S) {
+ if (attrs != null) {
+ // Get attention level and subtitle from layout XML
+ TypedArray a =
+ context.obtainStyledAttributes(attrs, R.styleable.BannerMessagePreference);
+ int mAttentionLevelValue =
+ a.getInt(R.styleable.BannerMessagePreference_attentionLevel, 0);
+ mAttentionLevel = AttentionLevel.fromAttr(mAttentionLevelValue);
+ mSubtitle = a.getString(R.styleable.BannerMessagePreference_subtitle);
+ a.recycle();
+ }
+ }
}
@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
- holder.setDividerAllowedAbove(true);
- holder.setDividerAllowedBelow(true);
+ final Context context = getContext();
+
+ final TextView titleView = (TextView) holder.findViewById(R.id.banner_title);
+ CharSequence title = getTitle();
+ titleView.setText(title);
+ titleView.setVisibility(title == null ? View.GONE : View.VISIBLE);
+
+ final TextView summaryView = (TextView) holder.findViewById(R.id.banner_summary);
+ summaryView.setText(getSummary());
mPositiveButtonInfo.mButton = (Button) holder.findViewById(R.id.banner_positive_btn);
mNegativeButtonInfo.mButton = (Button) holder.findViewById(R.id.banner_negative_btn);
+ if (IS_AT_LEAST_S) {
+ final Resources.Theme theme = context.getTheme();
+ @ColorInt final int accentColor =
+ context.getResources().getColor(mAttentionLevel.getAccentColorResId(), theme);
+ @ColorInt final int backgroundColor =
+ context.getResources().getColor(
+ mAttentionLevel.getBackgroundColorResId(), theme);
+
+ holder.setDividerAllowedAbove(false);
+ holder.setDividerAllowedBelow(false);
+ holder.itemView.getBackground().setTint(backgroundColor);
+
+ mPositiveButtonInfo.mColor = accentColor;
+ mNegativeButtonInfo.mColor = accentColor;
+
+ mDismissButtonInfo.mButton = (ImageButton) holder.findViewById(R.id.banner_dismiss_btn);
+ mDismissButtonInfo.setUpButton();
+
+ final TextView subtitleView = (TextView) holder.findViewById(R.id.banner_subtitle);
+ subtitleView.setText(mSubtitle);
+ subtitleView.setVisibility(mSubtitle == null ? View.GONE : View.VISIBLE);
+
+ final ImageView iconView = (ImageView) holder.findViewById(R.id.banner_icon);
+ if (iconView != null) {
+ Drawable icon = getIcon();
+ iconView.setImageDrawable(
+ icon == null
+ ? getContext().getDrawable(R.drawable.ic_warning)
+ : icon);
+ iconView.setColorFilter(
+ new PorterDuffColorFilter(accentColor, PorterDuff.Mode.SRC_IN));
+ }
+ } else {
+ holder.setDividerAllowedAbove(true);
+ holder.setDividerAllowedBelow(true);
+ }
+
mPositiveButtonInfo.setUpButton();
mNegativeButtonInfo.setUpButton();
-
- final TextView titleView = (TextView) holder.findViewById(R.id.banner_title);
- final TextView summaryView = (TextView) holder.findViewById(R.id.banner_summary);
-
- titleView.setText(getTitle());
- summaryView.setText(getSummary());
- }
-
- private void init() {
- mPositiveButtonInfo = new BannerMessagePreference.ButtonInfo();
- mNegativeButtonInfo = new BannerMessagePreference.ButtonInfo();
- setSelectable(false);
- setLayoutResource(R.layout.banner_message);
}
/**
@@ -107,6 +215,18 @@
}
/**
+ * Set the visibility state of dismiss button.
+ */
+ @RequiresApi(Build.VERSION_CODES.S)
+ public BannerMessagePreference setDismissButtonVisible(boolean isVisible) {
+ if (isVisible != mDismissButtonInfo.mIsVisible) {
+ mDismissButtonInfo.mIsVisible = isVisible;
+ notifyChanged();
+ }
+ return this;
+ }
+
+ /**
* Register a callback to be invoked when positive button is clicked.
*/
public BannerMessagePreference setPositiveButtonOnClickListener(
@@ -131,12 +251,31 @@
}
/**
+ * Register a callback to be invoked when the dismiss button is clicked.
+ */
+ @RequiresApi(Build.VERSION_CODES.S)
+ public BannerMessagePreference setDismissButtonOnClickListener(
+ View.OnClickListener listener) {
+ if (listener != mDismissButtonInfo.mListener) {
+ mDismissButtonInfo.mListener = listener;
+ notifyChanged();
+ }
+ return this;
+ }
+
+ /**
* Sets the text to be displayed in positive button.
*/
public BannerMessagePreference setPositiveButtonText(@StringRes int textResId) {
- final String newText = getContext().getString(textResId);
- if (!TextUtils.equals(newText, mPositiveButtonInfo.mText)) {
- mPositiveButtonInfo.mText = newText;
+ return setPositiveButtonText(getContext().getString(textResId));
+ }
+
+ /**
+ * Sets the text to be displayed in positive button.
+ */
+ public BannerMessagePreference setPositiveButtonText(String positiveButtonText) {
+ if (!TextUtils.equals(positiveButtonText, mPositiveButtonInfo.mText)) {
+ mPositiveButtonInfo.mText = positiveButtonText;
notifyChanged();
}
return this;
@@ -146,9 +285,51 @@
* Sets the text to be displayed in negative button.
*/
public BannerMessagePreference setNegativeButtonText(@StringRes int textResId) {
- final String newText = getContext().getString(textResId);
- if (!TextUtils.equals(newText, mNegativeButtonInfo.mText)) {
- mNegativeButtonInfo.mText = newText;
+ return setNegativeButtonText(getContext().getString(textResId));
+ }
+
+ /**
+ * Sets the text to be displayed in negative button.
+ */
+ public BannerMessagePreference setNegativeButtonText(String negativeButtonText) {
+ if (!TextUtils.equals(negativeButtonText, mNegativeButtonInfo.mText)) {
+ mNegativeButtonInfo.mText = negativeButtonText;
+ notifyChanged();
+ }
+ return this;
+ }
+
+ /**
+ * Sets the subtitle.
+ */
+ @RequiresApi(Build.VERSION_CODES.S)
+ public BannerMessagePreference setSubtitle(@StringRes int textResId) {
+ return setSubtitle(getContext().getString(textResId));
+ }
+
+ /**
+ * Sets the subtitle.
+ */
+ @RequiresApi(Build.VERSION_CODES.S)
+ public BannerMessagePreference setSubtitle(String subtitle) {
+ if (!TextUtils.equals(subtitle, mSubtitle)) {
+ mSubtitle = subtitle;
+ notifyChanged();
+ }
+ return this;
+ }
+
+ /**
+ * Sets the attention level. This will update the color theme of the preference.
+ */
+ @RequiresApi(Build.VERSION_CODES.S)
+ public BannerMessagePreference setAttentionLevel(AttentionLevel attentionLevel) {
+ if (attentionLevel == mAttentionLevel) {
+ return this;
+ }
+
+ if (attentionLevel != null) {
+ mAttentionLevel = attentionLevel;
notifyChanged();
}
return this;
@@ -159,11 +340,16 @@
private CharSequence mText;
private View.OnClickListener mListener;
private boolean mIsVisible = true;
+ @ColorInt private int mColor;
void setUpButton() {
mButton.setText(mText);
mButton.setOnClickListener(mListener);
+ if (IS_AT_LEAST_S) {
+ mButton.setTextColor(mColor);
+ }
+
if (shouldBeVisible()) {
mButton.setVisibility(View.VISIBLE);
} else {
@@ -179,4 +365,26 @@
return mIsVisible && (!TextUtils.isEmpty(mText));
}
}
+
+ static class DismissButtonInfo {
+ private ImageButton mButton;
+ private View.OnClickListener mListener;
+ private boolean mIsVisible = true;
+
+ void setUpButton() {
+ mButton.setOnClickListener(mListener);
+ if (shouldBeVisible()) {
+ mButton.setVisibility(View.VISIBLE);
+ } else {
+ mButton.setVisibility(View.GONE);
+ }
+ }
+
+ /**
+ * By default, dismiss button is visible if it has a click listener.
+ */
+ private boolean shouldBeVisible() {
+ return mIsVisible && (mListener != null);
+ }
+ }
}
diff --git a/packages/SettingsLib/FooterPreference/res/layout-v31/preference_footer.xml b/packages/SettingsLib/FooterPreference/res/layout-v31/preference_footer.xml
index 205485d..3b50acc 100644
--- a/packages/SettingsLib/FooterPreference/res/layout-v31/preference_footer.xml
+++ b/packages/SettingsLib/FooterPreference/res/layout-v31/preference_footer.xml
@@ -49,7 +49,6 @@
android:layout_height="wrap_content"
android:paddingBottom="16dp"
android:paddingTop="16dp"
- android:maxLines="10"
android:textColor="?android:attr/textColorSecondary"
android:ellipsize="marquee" />
diff --git a/packages/SettingsLib/FooterPreference/res/layout/preference_footer.xml b/packages/SettingsLib/FooterPreference/res/layout/preference_footer.xml
index 7567c17..87e8358 100644
--- a/packages/SettingsLib/FooterPreference/res/layout/preference_footer.xml
+++ b/packages/SettingsLib/FooterPreference/res/layout/preference_footer.xml
@@ -48,7 +48,6 @@
android:layout_height="wrap_content"
android:paddingBottom="16dp"
android:paddingTop="16dp"
- android:maxLines="10"
android:textColor="?android:attr/textColorSecondary"
android:ellipsize="marquee" />
diff --git a/packages/SettingsLib/src/com/android/settingslib/enterprise/ActionDisabledByAdminController.java b/packages/SettingsLib/src/com/android/settingslib/enterprise/ActionDisabledByAdminController.java
new file mode 100644
index 0000000..8730af1
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/enterprise/ActionDisabledByAdminController.java
@@ -0,0 +1,53 @@
+/*
+ * 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.settingslib.enterprise;
+
+import android.app.Activity;
+import android.content.Context;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AlertDialog.Builder;
+
+import com.android.settingslib.RestrictedLockUtils;
+
+/**
+ * A controller used to customize the action disabled by admin dialog.
+ */
+public interface ActionDisabledByAdminController {
+
+ /**
+ * Handles the adding and setting up of the learn more button. If button is not needed, then
+ * this method can be left empty.
+ */
+ void setupLearnMoreButton(Activity activity, Builder builder);
+
+ /**
+ * Returns the admin support dialog's title resource id.
+ */
+ String getAdminSupportTitle(@Nullable String restriction);
+
+ /**
+ * Returns the admin support dialog's content string.
+ */
+ CharSequence getAdminSupportContentString(
+ Context context, @Nullable CharSequence supportMessage);
+
+ /**
+ * Updates the enforced admin
+ */
+ void updateEnforcedAdmin(RestrictedLockUtils.EnforcedAdmin admin, int adminUserId);
+}
diff --git a/packages/SettingsLib/src/com/android/settingslib/enterprise/ActionDisabledByAdminControllerFactory.java b/packages/SettingsLib/src/com/android/settingslib/enterprise/ActionDisabledByAdminControllerFactory.java
new file mode 100644
index 0000000..7eecd19
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/enterprise/ActionDisabledByAdminControllerFactory.java
@@ -0,0 +1,47 @@
+/*
+ * 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.settingslib.enterprise;
+
+import static android.app.admin.DevicePolicyManager.DEVICE_OWNER_TYPE_FINANCED;
+
+import android.app.admin.DevicePolicyManager;
+
+/**
+ * A factory that returns the relevant instance of {@link ActionDisabledByAdminController}.
+ */
+public class ActionDisabledByAdminControllerFactory {
+
+ /**
+ * Returns the relevant instance of {@link ActionDisabledByAdminController}.
+ */
+ public static ActionDisabledByAdminController createInstance(
+ DevicePolicyManager dpm,
+ ActionDisabledLearnMoreButtonLauncher helper,
+ DeviceAdminStringProvider deviceAdminStringProvider) {
+ if (isFinancedDevice(dpm)) {
+ return new FinancedDeviceActionDisabledByAdminController(
+ helper, deviceAdminStringProvider);
+ }
+ return new ManagedDeviceActionDisabledByAdminController(
+ helper, deviceAdminStringProvider);
+ }
+
+ private static boolean isFinancedDevice(DevicePolicyManager dpm) {
+ return dpm.isDeviceManaged() && dpm.getDeviceOwnerType(
+ dpm.getDeviceOwnerComponentOnAnyUser()) == DEVICE_OWNER_TYPE_FINANCED;
+ }
+}
diff --git a/packages/SettingsLib/src/com/android/settingslib/enterprise/ActionDisabledLearnMoreButtonLauncher.java b/packages/SettingsLib/src/com/android/settingslib/enterprise/ActionDisabledLearnMoreButtonLauncher.java
new file mode 100644
index 0000000..9d2df23
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/enterprise/ActionDisabledLearnMoreButtonLauncher.java
@@ -0,0 +1,46 @@
+/*
+ * 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.settingslib.enterprise;
+
+import android.app.Activity;
+
+import androidx.appcompat.app.AlertDialog;
+
+import com.android.settingslib.RestrictedLockUtils;
+
+/**
+ * Helper interface meant to set up the "Learn more" button in the action disabled dialog.
+ */
+public interface ActionDisabledLearnMoreButtonLauncher {
+
+ /**
+ * Sets up a "learn more" button which shows a screen with device policy settings
+ */
+ void setupLearnMoreButtonToShowAdminPolicies(
+ Activity activity,
+ AlertDialog.Builder builder,
+ int enforcementAdminUserId,
+ RestrictedLockUtils.EnforcedAdmin enforcedAdmin);
+
+ /**
+ * Sets up a "learn more" button which launches a help page
+ */
+ void setupLearnMoreButtonToLaunchHelpPage(
+ Activity activity,
+ AlertDialog.Builder builder,
+ String url);
+}
diff --git a/packages/SettingsLib/src/com/android/settingslib/enterprise/DeviceAdminStringProvider.java b/packages/SettingsLib/src/com/android/settingslib/enterprise/DeviceAdminStringProvider.java
new file mode 100644
index 0000000..c47d789
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/enterprise/DeviceAdminStringProvider.java
@@ -0,0 +1,75 @@
+/*
+ * 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.settingslib.enterprise;
+
+/**
+ * A {@code String} provider for the action disabled by admin dialog.
+ */
+public interface DeviceAdminStringProvider {
+
+ /**
+ * Returns the default dialog title for the case when an action is disabled by policy on a
+ * managed device.
+ */
+ String getDefaultDisabledByPolicyTitle();
+
+ /**
+ * Returns the dialog title for the case when volume adjusting is disabled.
+ */
+ String getDisallowAdjustVolumeTitle();
+
+ /**
+ * Returns the dialog title for the case when outgoing calls are disabled.
+ */
+ String getDisallowOutgoingCallsTitle();
+
+ /**
+ * Returns the dialog title for the case when sending SMS is disabled.
+ */
+ String getDisallowSmsTitle();
+
+ /**
+ * Returns the dialog title for the case when the camera is disabled.
+ */
+ String getDisableCameraTitle();
+
+ /**
+ * Returns the dialog title for the case when screen capturing is disabled.
+ */
+ String getDisableScreenCaptureTitle();
+
+ /**
+ * Returns the dialog title for the case when suspending apps is disabled.
+ */
+ String getSuspendPackagesTitle();
+
+ /**
+ * Returns the default dialog content for the case when an action is disabled by policy.
+ */
+ String getDefaultDisabledByPolicyContent();
+
+ /**
+ * Returns the URL for the page to be shown when the learn more button is chosen.
+ */
+ String getLearnMoreHelpPageUrl();
+
+ /**
+ * Returns the default dialog title for the case when an action is disabled by policy on
+ * a financed device.
+ */
+ String getDisabledByPolicyTitleForFinancedDevice();
+}
diff --git a/packages/SettingsLib/src/com/android/settingslib/enterprise/FinancedDeviceActionDisabledByAdminController.java b/packages/SettingsLib/src/com/android/settingslib/enterprise/FinancedDeviceActionDisabledByAdminController.java
new file mode 100644
index 0000000..587979d
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/enterprise/FinancedDeviceActionDisabledByAdminController.java
@@ -0,0 +1,72 @@
+/*
+ * 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.settingslib.enterprise;
+
+import static java.util.Objects.requireNonNull;
+
+import android.annotation.UserIdInt;
+import android.app.Activity;
+import android.content.Context;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AlertDialog.Builder;
+
+import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
+
+/**
+ * An {@link ActionDisabledByAdminController} to be used with financed devices.
+ */
+public class FinancedDeviceActionDisabledByAdminController
+ implements ActionDisabledByAdminController {
+
+ private @UserIdInt int mEnforcementAdminUserId;
+ private EnforcedAdmin mEnforcedAdmin;
+ private final ActionDisabledLearnMoreButtonLauncher mHelper;
+ private final DeviceAdminStringProvider mDeviceAdminStringProvider;
+
+ FinancedDeviceActionDisabledByAdminController(
+ ActionDisabledLearnMoreButtonLauncher helper,
+ DeviceAdminStringProvider deviceAdminStringProvider) {
+ mHelper = requireNonNull(helper);
+ mDeviceAdminStringProvider = requireNonNull(deviceAdminStringProvider);
+ }
+
+ @Override
+ public void updateEnforcedAdmin(EnforcedAdmin admin, int adminUserId) {
+ mEnforcementAdminUserId = adminUserId;
+ mEnforcedAdmin = requireNonNull(admin);
+ }
+
+ @Override
+ public void setupLearnMoreButton(Activity activity, Builder builder) {
+ mHelper.setupLearnMoreButtonToShowAdminPolicies(
+ activity,
+ builder,
+ mEnforcementAdminUserId,
+ mEnforcedAdmin);
+ }
+
+ @Override
+ public String getAdminSupportTitle(@Nullable String restriction) {
+ return mDeviceAdminStringProvider.getDisabledByPolicyTitleForFinancedDevice();
+ }
+
+ @Override
+ public CharSequence getAdminSupportContentString(Context context, CharSequence supportMessage) {
+ return supportMessage;
+ }
+}
diff --git a/packages/SettingsLib/src/com/android/settingslib/enterprise/ManagedDeviceActionDisabledByAdminController.java b/packages/SettingsLib/src/com/android/settingslib/enterprise/ManagedDeviceActionDisabledByAdminController.java
new file mode 100644
index 0000000..624c88e
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/enterprise/ManagedDeviceActionDisabledByAdminController.java
@@ -0,0 +1,99 @@
+/*
+ * 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.settingslib.enterprise;
+
+import static java.util.Objects.requireNonNull;
+
+import android.annotation.UserIdInt;
+import android.app.Activity;
+import android.app.admin.DevicePolicyManager;
+import android.content.Context;
+import android.os.UserManager;
+import android.text.TextUtils;
+
+import androidx.appcompat.app.AlertDialog.Builder;
+
+import com.android.settingslib.RestrictedLockUtils;
+
+/**
+ * An {@link ActionDisabledByAdminController} to be used with managed devices.
+ */
+class ManagedDeviceActionDisabledByAdminController implements
+ ActionDisabledByAdminController {
+ private @UserIdInt int mEnforcementAdminUserId;
+ private RestrictedLockUtils.EnforcedAdmin mEnforcedAdmin;
+ private final ActionDisabledLearnMoreButtonLauncher mHelper;
+ private final DeviceAdminStringProvider mStringProvider;
+
+ ManagedDeviceActionDisabledByAdminController(
+ ActionDisabledLearnMoreButtonLauncher helper,
+ DeviceAdminStringProvider stringProvider) {
+ mHelper = requireNonNull(helper);
+ mStringProvider = requireNonNull(stringProvider);
+ }
+
+ @Override
+ public void updateEnforcedAdmin(RestrictedLockUtils.EnforcedAdmin admin, int adminUserId) {
+ mEnforcementAdminUserId = adminUserId;
+ mEnforcedAdmin = requireNonNull(admin);
+ }
+
+ @Override
+ public void setupLearnMoreButton(Activity activity, Builder builder) {
+ String url = mStringProvider.getLearnMoreHelpPageUrl();
+ if (TextUtils.isEmpty(url)) {
+ mHelper.setupLearnMoreButtonToShowAdminPolicies(
+ activity,
+ builder,
+ mEnforcementAdminUserId,
+ mEnforcedAdmin);
+ } else {
+ mHelper.setupLearnMoreButtonToLaunchHelpPage(activity, builder, url);
+ }
+ }
+
+ @Override
+ public String getAdminSupportTitle(String restriction) {
+ if (restriction == null) {
+ return mStringProvider.getDefaultDisabledByPolicyTitle();
+ }
+ switch (restriction) {
+ case UserManager.DISALLOW_ADJUST_VOLUME:
+ return mStringProvider.getDisallowAdjustVolumeTitle();
+ case UserManager.DISALLOW_OUTGOING_CALLS:
+ return mStringProvider.getDisallowOutgoingCallsTitle();
+ case UserManager.DISALLOW_SMS:
+ return mStringProvider.getDisallowSmsTitle();
+ case DevicePolicyManager.POLICY_DISABLE_CAMERA:
+ return mStringProvider.getDisableCameraTitle();
+ case DevicePolicyManager.POLICY_DISABLE_SCREEN_CAPTURE:
+ return mStringProvider.getDisableScreenCaptureTitle();
+ case DevicePolicyManager.POLICY_SUSPEND_PACKAGES:
+ return mStringProvider.getSuspendPackagesTitle();
+ default:
+ return mStringProvider.getDefaultDisabledByPolicyTitle();
+ }
+ }
+
+ @Override
+ public CharSequence getAdminSupportContentString(Context context, CharSequence supportMessage) {
+ if (supportMessage != null) {
+ return supportMessage;
+ }
+ return mStringProvider.getDefaultDisabledByPolicyContent();
+ }
+}
diff --git a/packages/SettingsLib/src/com/android/settingslib/location/RecentLocationAccesses.java b/packages/SettingsLib/src/com/android/settingslib/location/RecentLocationAccesses.java
index 35499c9..877dd2d 100644
--- a/packages/SettingsLib/src/com/android/settingslib/location/RecentLocationAccesses.java
+++ b/packages/SettingsLib/src/com/android/settingslib/location/RecentLocationAccesses.java
@@ -25,6 +25,7 @@
import android.graphics.drawable.Drawable;
import android.os.UserHandle;
import android.os.UserManager;
+import android.permission.PermissionManager;
import android.text.format.DateUtils;
import android.util.IconDrawableFactory;
import android.util.Log;
@@ -132,7 +133,8 @@
}
}
}
- if (showApp) {
+ if (showApp && PermissionManager.shouldShowPackageForIndicatorCached(mContext,
+ packageName)) {
Access access = getAccessFromOps(now, ops);
if (access != null) {
accesses.add(access);
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiStatusTracker.java b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiStatusTracker.java
index 2c2ca3b..0696916 100644
--- a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiStatusTracker.java
+++ b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiStatusTracker.java
@@ -80,36 +80,41 @@
@Override
public void onCapabilitiesChanged(
Network network, NetworkCapabilities networkCapabilities) {
- if (!mNetworks.contains(network.getNetId())) {
- // New network
- boolean isVcnOverWifi =
- networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR)
- && (Utils.tryGetWifiInfoForVcn(networkCapabilities) != null);
- boolean isWifi =
- networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI);
- if (isVcnOverWifi || isWifi) {
- mNetworks.add(network.getNetId());
- }
- }
-
+ boolean isVcnOverWifi = false;
+ boolean isWifi = false;
WifiInfo wifiInfo = null;
if (networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR)) {
wifiInfo = Utils.tryGetWifiInfoForVcn(networkCapabilities);
+ isVcnOverWifi = (wifiInfo != null);
} else if (networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)) {
wifiInfo = (WifiInfo) networkCapabilities.getTransportInfo();
+ isWifi = true;
}
- String log = new StringBuilder()
- .append(SSDF.format(System.currentTimeMillis())).append(",")
- .append("onCapabilitiesChanged: ")
- .append("network=").append(network).append(",")
- .append("networkCapabilities=").append(networkCapabilities)
- .toString();
- recordLastWifiNetwork(log);
- if (wifiInfo != null) {
- updateWifiInfo(wifiInfo);
- updateStatusLabel();
- mCallback.run();
+ // As long as it is a WiFi network, we will log it in the dumpsys for debugging.
+ if (isVcnOverWifi || isWifi) {
+ String log = new StringBuilder()
+ .append(SSDF.format(System.currentTimeMillis())).append(",")
+ .append("onCapabilitiesChanged: ")
+ .append("network=").append(network).append(",")
+ .append("networkCapabilities=").append(networkCapabilities)
+ .toString();
+ recordLastWifiNetwork(log);
}
+ // Ignore the WiFi network if it doesn't contain any valid WifiInfo, or it is not the
+ // primary WiFi.
+ if (wifiInfo == null || !wifiInfo.isPrimary()) {
+ // Remove the network from the tracking list once it becomes non-primary.
+ if (mNetworks.contains(network.getNetId())) {
+ mNetworks.remove(network.getNetId());
+ }
+ return;
+ }
+ if (!mNetworks.contains(network.getNetId())) {
+ mNetworks.add(network.getNetId());
+ }
+ updateWifiInfo(wifiInfo);
+ updateStatusLabel();
+ mCallback.run();
}
@Override
diff --git a/packages/SettingsLib/tests/robotests/Android.bp b/packages/SettingsLib/tests/robotests/Android.bp
index dc661c2..63cfe59 100644
--- a/packages/SettingsLib/tests/robotests/Android.bp
+++ b/packages/SettingsLib/tests/robotests/Android.bp
@@ -43,6 +43,8 @@
srcs: ["src/**/*.java"],
static_libs: [
"SettingsLib-robo-testutils",
+ "androidx.test.core",
+ "androidx.core_core",
],
java_resource_dirs: ["config"],
instrumentation_for: "SettingsLibShell",
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/enterprise/ActionDisabledByAdminControllerTestUtils.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/enterprise/ActionDisabledByAdminControllerTestUtils.java
new file mode 100644
index 0000000..e0c9424
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/enterprise/ActionDisabledByAdminControllerTestUtils.java
@@ -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 com.android.settingslib.enterprise;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.app.Activity;
+
+import androidx.appcompat.app.AlertDialog;
+
+import com.android.settingslib.RestrictedLockUtils;
+
+/**
+ * Utils related to the action disabled by admin dialogs.
+ */
+class ActionDisabledByAdminControllerTestUtils {
+ static final int LEARN_MORE_ACTION_NONE = 0;
+ static final int LEARN_MORE_ACTION_SHOW_ADMIN_POLICIES = 1;
+ static final int LEARN_MORE_ACTION_LAUNCH_HELP_PAGE = 2;
+
+ private int mLearnMoreButtonAction = LEARN_MORE_ACTION_NONE;
+
+ ActionDisabledLearnMoreButtonLauncher createLearnMoreButtonLauncher() {
+ return new ActionDisabledLearnMoreButtonLauncher() {
+ @Override
+ public void setupLearnMoreButtonToShowAdminPolicies(Activity activity,
+ AlertDialog.Builder builder, int enforcementAdminUserId,
+ RestrictedLockUtils.EnforcedAdmin enforcedAdmin) {
+ mLearnMoreButtonAction = LEARN_MORE_ACTION_SHOW_ADMIN_POLICIES;
+ }
+
+ @Override
+ public void setupLearnMoreButtonToLaunchHelpPage(Activity activity,
+ AlertDialog.Builder builder, String url) {
+ mLearnMoreButtonAction = LEARN_MORE_ACTION_LAUNCH_HELP_PAGE;
+ }
+ };
+ }
+
+ void assertLearnMoreAction(int learnMoreActionShowAdminPolicies) {
+ assertThat(learnMoreActionShowAdminPolicies).isEqualTo(mLearnMoreButtonAction);
+ }
+
+ AlertDialog createAlertDialog(ActionDisabledByAdminController mController, Activity activity) {
+ AlertDialog.Builder builder = new AlertDialog.Builder(activity);
+ mController.setupLearnMoreButton(activity, builder);
+ AlertDialog alertDialog = builder.create();
+ alertDialog.show();
+ return alertDialog;
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/enterprise/FakeDeviceAdminStringProvider.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/enterprise/FakeDeviceAdminStringProvider.java
new file mode 100644
index 0000000..8c07d75
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/enterprise/FakeDeviceAdminStringProvider.java
@@ -0,0 +1,89 @@
+/*
+ * 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.settingslib.enterprise;
+
+import android.annotation.Nullable;
+
+class FakeDeviceAdminStringProvider implements DeviceAdminStringProvider {
+
+ static final String DEFAULT_DISABLED_BY_POLICY_TITLE = "default_disabled_by_policy_title";
+ static final String DISALLOW_ADJUST_VOLUME_TITLE = "disallow_adjust_volume_title";
+ static final String DISALLOW_OUTGOING_CALLS_TITLE = "disallow_outgoing_calls_title";
+ static final String DISALLOW_SMS_TITLE = "disallow_sms_title";
+ static final String DISABLE_CAMERA_TITLE = "disable_camera_title";
+ static final String DISABLE_SCREEN_CAPTURE_TITLE = "disable_screen_capture_title";
+ static final String SUSPENDED_PACKAGES_TITLE = "suspended_packages_title";
+ static final String DEFAULT_DISABLED_BY_POLICY_CONTENT = "default_disabled_by_policy_content";
+ static final String DEFAULT_DISABLED_BY_POLICY_TITLE_FINANCED_DEVICE =
+ "default_disabled_by_policy_title_financed_device";
+
+ private final String mUrl;
+
+ FakeDeviceAdminStringProvider(@Nullable String url) {
+ mUrl = url;
+ }
+
+ @Override
+ public String getDefaultDisabledByPolicyTitle() {
+ return DEFAULT_DISABLED_BY_POLICY_TITLE;
+ }
+
+ @Override
+ public String getDisallowAdjustVolumeTitle() {
+ return DISALLOW_ADJUST_VOLUME_TITLE;
+ }
+
+ @Override
+ public String getDisallowOutgoingCallsTitle() {
+ return DISALLOW_OUTGOING_CALLS_TITLE;
+ }
+
+ @Override
+ public String getDisallowSmsTitle() {
+ return DISALLOW_SMS_TITLE;
+ }
+
+ @Override
+ public String getDisableCameraTitle() {
+ return DISABLE_CAMERA_TITLE;
+ }
+
+ @Override
+ public String getDisableScreenCaptureTitle() {
+ return DISABLE_SCREEN_CAPTURE_TITLE;
+ }
+
+ @Override
+ public String getSuspendPackagesTitle() {
+ return SUSPENDED_PACKAGES_TITLE;
+ }
+
+ @Override
+ public String getDefaultDisabledByPolicyContent() {
+ return DEFAULT_DISABLED_BY_POLICY_CONTENT;
+ }
+
+ @Override
+ public String getLearnMoreHelpPageUrl() {
+ return mUrl;
+ }
+
+ @Override
+ public String getDisabledByPolicyTitleForFinancedDevice() {
+ return DEFAULT_DISABLED_BY_POLICY_TITLE_FINANCED_DEVICE;
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/enterprise/FinancedDeviceActionDisabledByAdminControllerTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/enterprise/FinancedDeviceActionDisabledByAdminControllerTest.java
new file mode 100644
index 0000000..2fe2262
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/enterprise/FinancedDeviceActionDisabledByAdminControllerTest.java
@@ -0,0 +1,113 @@
+/*
+ * 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.settingslib.enterprise;
+
+import static com.android.settingslib.enterprise.ActionDisabledByAdminControllerTestUtils.LEARN_MORE_ACTION_SHOW_ADMIN_POLICIES;
+import static com.android.settingslib.enterprise.FakeDeviceAdminStringProvider.DEFAULT_DISABLED_BY_POLICY_TITLE_FINANCED_DEVICE;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.app.Activity;
+import android.app.Dialog;
+import android.content.ComponentName;
+import android.content.Context;
+import android.os.UserHandle;
+
+import androidx.appcompat.app.AlertDialog;
+import androidx.test.core.app.ApplicationProvider;
+
+import com.android.settingslib.R;
+import com.android.settingslib.RestrictedLockUtils;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.android.controller.ActivityController;
+
+@RunWith(RobolectricTestRunner.class)
+public class FinancedDeviceActionDisabledByAdminControllerTest {
+ private static final int ENFORCEMENT_ADMIN_USER_ID = 123;
+ private static final ComponentName ADMIN_COMPONENT =
+ new ComponentName("some.package.name", "some.package.name.SomeClass");
+ private static final String SUPPORT_MESSAGE = "support message";
+ private static final DeviceAdminStringProvider DEVICE_ADMIN_STRING_PROVIDER =
+ new FakeDeviceAdminStringProvider(/* url = */ null);
+ private static final RestrictedLockUtils.EnforcedAdmin ENFORCED_ADMIN =
+ new RestrictedLockUtils.EnforcedAdmin(
+ ADMIN_COMPONENT, UserHandle.of(ENFORCEMENT_ADMIN_USER_ID));
+
+ private final Context mContext = ApplicationProvider.getApplicationContext();
+ private final Activity mActivity = ActivityController.of(new Activity()).get();
+ private final ActionDisabledByAdminControllerTestUtils mTestUtils =
+ new ActionDisabledByAdminControllerTestUtils();
+ private final ActionDisabledLearnMoreButtonLauncher mLauncher =
+ mTestUtils.createLearnMoreButtonLauncher();
+
+ @Before
+ public void setUp() {
+ mActivity.setTheme(R.style.Theme_AppCompat_DayNight);
+ }
+
+ @Test
+ public void setupLearnMoreButton_negativeButtonSet() {
+ FinancedDeviceActionDisabledByAdminController mController = createController(mLauncher);
+ AlertDialog alertDialog = mTestUtils.createAlertDialog(mController, mActivity);
+
+ alertDialog.getButton(Dialog.BUTTON_NEUTRAL).performClick();
+
+ mTestUtils.assertLearnMoreAction(LEARN_MORE_ACTION_SHOW_ADMIN_POLICIES);
+ }
+
+ @Test
+ public void getAdminSupportTitleResource_works() {
+ FinancedDeviceActionDisabledByAdminController mController = createController();
+
+ assertThat(mController.getAdminSupportTitle(null))
+ .isEqualTo(DEFAULT_DISABLED_BY_POLICY_TITLE_FINANCED_DEVICE);
+ }
+
+ @Test
+ public void getAdminSupportContentString_withSupportMessage_returnsSupportMessage() {
+ FinancedDeviceActionDisabledByAdminController mController = createController();
+
+ assertThat(mController.getAdminSupportContentString(mContext, SUPPORT_MESSAGE))
+ .isEqualTo(SUPPORT_MESSAGE);
+ }
+
+ @Test
+ public void getAdminSupportContentString_noSupportMessage_returnsNull() {
+ FinancedDeviceActionDisabledByAdminController mController = createController();
+
+ assertThat(mController.getAdminSupportContentString(mContext, /* supportMessage= */ null))
+ .isNull();
+ }
+
+ private FinancedDeviceActionDisabledByAdminController createController() {
+ return createController(mLauncher);
+ }
+
+ private FinancedDeviceActionDisabledByAdminController createController(
+ ActionDisabledLearnMoreButtonLauncher buttonHelper) {
+ FinancedDeviceActionDisabledByAdminController controller =
+ new FinancedDeviceActionDisabledByAdminController(
+ buttonHelper,
+ DEVICE_ADMIN_STRING_PROVIDER);
+ controller.updateEnforcedAdmin(ENFORCED_ADMIN, ENFORCEMENT_ADMIN_USER_ID);
+ return controller;
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/enterprise/ManagedDeviceActionDisabledByAdminControllerTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/enterprise/ManagedDeviceActionDisabledByAdminControllerTest.java
new file mode 100644
index 0000000..eb1dc96
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/enterprise/ManagedDeviceActionDisabledByAdminControllerTest.java
@@ -0,0 +1,136 @@
+/*
+ * 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.settingslib.enterprise;
+
+import static com.android.settingslib.enterprise.ActionDisabledByAdminControllerTestUtils.LEARN_MORE_ACTION_LAUNCH_HELP_PAGE;
+import static com.android.settingslib.enterprise.ActionDisabledByAdminControllerTestUtils.LEARN_MORE_ACTION_SHOW_ADMIN_POLICIES;
+import static com.android.settingslib.enterprise.FakeDeviceAdminStringProvider.DEFAULT_DISABLED_BY_POLICY_CONTENT;
+import static com.android.settingslib.enterprise.FakeDeviceAdminStringProvider.DEFAULT_DISABLED_BY_POLICY_TITLE;
+import static com.android.settingslib.enterprise.FakeDeviceAdminStringProvider.DISALLOW_ADJUST_VOLUME_TITLE;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.app.Activity;
+import android.app.Dialog;
+import android.content.ComponentName;
+import android.os.UserHandle;
+import android.os.UserManager;
+
+import androidx.appcompat.app.AlertDialog;
+
+import com.android.settingslib.R;
+import com.android.settingslib.RestrictedLockUtils;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.android.controller.ActivityController;
+
+@RunWith(RobolectricTestRunner.class)
+public class ManagedDeviceActionDisabledByAdminControllerTest {
+ private static final int ENFORCEMENT_ADMIN_USER_ID = 123;
+ private static final ComponentName ADMIN_COMPONENT =
+ new ComponentName("some.package.name", "some.package.name.SomeClass");
+ private static final String SUPPORT_MESSAGE = "support message";
+ private static final String RESTRICTION = UserManager.DISALLOW_ADJUST_VOLUME;
+ private static final String URL = "https://testexample.com";
+ private static final String EMPTY_URL = "";
+ private static final RestrictedLockUtils.EnforcedAdmin ENFORCED_ADMIN =
+ new RestrictedLockUtils.EnforcedAdmin(
+ ADMIN_COMPONENT, UserHandle.of(ENFORCEMENT_ADMIN_USER_ID));
+ private static final String SUPPORT_TITLE_FOR_RESTRICTION = DISALLOW_ADJUST_VOLUME_TITLE;
+
+ private final Activity mActivity = ActivityController.of(new Activity()).get();
+ private final ActionDisabledByAdminControllerTestUtils mTestUtils =
+ new ActionDisabledByAdminControllerTestUtils();
+ private final ActionDisabledLearnMoreButtonLauncher mLauncher =
+ mTestUtils.createLearnMoreButtonLauncher();
+
+ @Before
+ public void setUp() {
+ mActivity.setTheme(R.style.Theme_AppCompat_DayNight);
+ }
+
+ @Test
+ public void setupLearnMoreButton_validUrl_negativeButtonSet() {
+ ManagedDeviceActionDisabledByAdminController mController =
+ createController(mLauncher, URL);
+ AlertDialog alertDialog = mTestUtils.createAlertDialog(mController, mActivity);
+
+ alertDialog.getButton(Dialog.BUTTON_NEUTRAL).performClick();
+
+ mTestUtils.assertLearnMoreAction(LEARN_MORE_ACTION_LAUNCH_HELP_PAGE);
+ }
+
+ @Test
+ public void setupLearnMoreButton_noUrl_negativeButtonSet() {
+ ManagedDeviceActionDisabledByAdminController mController =
+ createController(mLauncher, EMPTY_URL);
+ AlertDialog alertDialog = mTestUtils.createAlertDialog(mController, mActivity);
+
+ alertDialog.getButton(Dialog.BUTTON_NEUTRAL).performClick();
+
+ mTestUtils.assertLearnMoreAction(LEARN_MORE_ACTION_SHOW_ADMIN_POLICIES);
+ }
+
+ @Test
+ public void getAdminSupportTitleResource_noRestriction_works() {
+ ManagedDeviceActionDisabledByAdminController mController = createController();
+
+ assertThat(mController.getAdminSupportTitle(null))
+ .isEqualTo(DEFAULT_DISABLED_BY_POLICY_TITLE);
+ }
+
+ @Test
+ public void getAdminSupportTitleResource_withRestriction_works() {
+ ManagedDeviceActionDisabledByAdminController mController = createController();
+
+ assertThat(mController.getAdminSupportTitle(RESTRICTION))
+ .isEqualTo(SUPPORT_TITLE_FOR_RESTRICTION);
+ }
+
+ @Test
+ public void getAdminSupportContentString_withSupportMessage_returnsSupportMessage() {
+ ManagedDeviceActionDisabledByAdminController mController = createController();
+
+ assertThat(mController.getAdminSupportContentString(mActivity, SUPPORT_MESSAGE))
+ .isEqualTo(SUPPORT_MESSAGE);
+ }
+
+ @Test
+ public void getAdminSupportContentString_noSupportMessage_returnsDefault() {
+ ManagedDeviceActionDisabledByAdminController mController = createController();
+
+ assertThat(mController.getAdminSupportContentString(mActivity, /* supportMessage= */ null))
+ .isEqualTo(DEFAULT_DISABLED_BY_POLICY_CONTENT);
+ }
+
+ private ManagedDeviceActionDisabledByAdminController createController() {
+ return createController(mLauncher, /* url= */ null);
+ }
+
+ private ManagedDeviceActionDisabledByAdminController createController(
+ ActionDisabledLearnMoreButtonLauncher buttonHelper, String url) {
+ ManagedDeviceActionDisabledByAdminController controller =
+ new ManagedDeviceActionDisabledByAdminController(
+ buttonHelper,
+ new FakeDeviceAdminStringProvider(url));
+ controller.updateEnforcedAdmin(ENFORCED_ADMIN, ENFORCEMENT_ADMIN_USER_ID);
+ return controller;
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/BannerMessagePreferenceTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/BannerMessagePreferenceTest.java
index 8ab0298..6670ed3 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/BannerMessagePreferenceTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/BannerMessagePreferenceTest.java
@@ -18,18 +18,35 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+
import android.content.Context;
+import android.graphics.ColorFilter;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffColorFilter;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
+import android.widget.ImageButton;
+import android.widget.ImageView;
import android.widget.TextView;
+import androidx.annotation.ColorRes;
import androidx.preference.PreferenceViewHolder;
+import androidx.preference.R;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
+import org.robolectric.Shadows;
+import org.robolectric.shadows.ShadowDrawable;
+import org.robolectric.util.ReflectionHelpers;
@RunWith(RobolectricTestRunner.class)
public class BannerMessagePreferenceTest {
@@ -39,16 +56,22 @@
private BannerMessagePreference mBannerPreference;
private PreferenceViewHolder mHolder;
+ private boolean mClickListenerCalled = false;
+ private final View.OnClickListener mClickListener = v -> mClickListenerCalled = true;
+
+ private static final int TEST_STRING_RES_ID =
+ R.string.accessibility_banner_message_dismiss;
+
@Before
public void setUp() {
mContext = RuntimeEnvironment.application;
- mRootView = View.inflate(mContext, R.layout.banner_message, null /* parent */);
- mHolder = PreferenceViewHolder.createInstanceForTests(mRootView);
+ mClickListenerCalled = false;
mBannerPreference = new BannerMessagePreference(mContext);
+ setUpViewHolder();
}
@Test
- public void onBindViewHolder_shouldSetTitle() {
+ public void onBindViewHolder_whenTitleSet_shouldSetTitle() {
mBannerPreference.setTitle("test");
mBannerPreference.onBindViewHolder(mHolder);
@@ -58,7 +81,7 @@
}
@Test
- public void onBindViewHolder_shouldSetSummary() {
+ public void onBindViewHolder_whenSummarySet_shouldSetSummary() {
mBannerPreference.setSummary("test");
mBannerPreference.onBindViewHolder(mHolder);
@@ -68,30 +91,114 @@
}
@Test
- public void setPositiveButtonText_shouldShowPositiveButton() {
- mBannerPreference.setPositiveButtonText(R.string.tts_settings_title);
+ public void onBindViewHolder_whenPreS_shouldBindView() {
+ assumeAndroidR();
+ mBannerPreference.setSummary("test");
mBannerPreference.onBindViewHolder(mHolder);
- assertThat(((Button) mRootView.findViewById(R.id.banner_positive_btn)).getVisibility())
- .isEqualTo(View.VISIBLE);
+ assertThat(((TextView) mRootView.findViewById(R.id.banner_summary)).getText())
+ .isEqualTo("test");
+ }
+
+ @Test
+ public void onBindViewHolder_whenAtLeastS_whenSubtitleSetByString_shouldSetSubtitle() {
+ assumeAndroidS();
+ mBannerPreference.setSubtitle("test");
+
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ TextView mSubtitleView = mRootView.findViewById(R.id.banner_subtitle);
+ assertThat(mSubtitleView.getText()).isEqualTo("test");
+ assertThat(mSubtitleView.getVisibility()).isEqualTo(View.VISIBLE);
+ }
+
+ @Test
+ public void onBindViewHolder_whenAtLeastS_whenSubtitleSetByResId_shouldSetSubtitle() {
+ assumeAndroidS();
+ mBannerPreference.setSubtitle(TEST_STRING_RES_ID);
+
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ TextView mSubtitleView = mRootView.findViewById(R.id.banner_subtitle);
+ assertThat(mSubtitleView.getText()).isEqualTo(mContext.getString(TEST_STRING_RES_ID));
+ assertThat(mSubtitleView.getVisibility()).isEqualTo(View.VISIBLE);
+ }
+
+ @Test
+ public void onBindViewHolder_whenAtLeastS_whenSubtitleXmlAttribute_shouldSetSubtitle() {
+ assumeAndroidS();
+ AttributeSet mAttributeSet = Robolectric.buildAttributeSet()
+ .addAttribute(R.attr.subtitle, "Test")
+ .build();
+ mBannerPreference = new BannerMessagePreference(mContext, mAttributeSet);
+
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ TextView mSubtitleView = mRootView.findViewById(R.id.banner_subtitle);
+ assertThat(mSubtitleView.getText()).isEqualTo("Test");
+ assertThat(mSubtitleView.getVisibility()).isEqualTo(View.VISIBLE);
+ }
+
+ @Test
+ public void onBindViewHolder_whenAtLeastS_shouldNotShowSubtitleIfUnset() {
+ assumeAndroidS();
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ TextView mSubtitleView = mRootView.findViewById(R.id.banner_subtitle);
+ assertThat(mSubtitleView.getVisibility()).isEqualTo(View.GONE);
+ }
+
+ @Test
+ public void onBindViewHolder_whenAtLeastS_whenIconSet_shouldSetIcon() {
+ assumeAndroidS();
+ mBannerPreference.setIcon(R.drawable.settingslib_ic_cross);
+
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ ImageView mIcon = mRootView.findViewById(R.id.banner_icon);
+ ShadowDrawable shadowDrawable = Shadows.shadowOf(mIcon.getDrawable());
+ assertThat(shadowDrawable.getCreatedFromResId())
+ .isEqualTo(R.drawable.settingslib_ic_cross);
+ }
+
+ @Test
+ public void onBindViewHolder_whenAtLeastS_whenNoIconSet_shouldSetIconToDefault() {
+ assumeAndroidS();
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ ImageView mIcon = mRootView.findViewById(R.id.banner_icon);
+ ShadowDrawable shadowDrawable = Shadows.shadowOf(mIcon.getDrawable());
+ assertThat(shadowDrawable.getCreatedFromResId()).isEqualTo(R.drawable.ic_warning);
+ }
+
+ @Test
+ public void setPositiveButtonText_shouldShowPositiveButton() {
+ mBannerPreference.setPositiveButtonText(TEST_STRING_RES_ID);
+
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ Button mPositiveButton = mRootView.findViewById(R.id.banner_positive_btn);
+ assertThat(mPositiveButton.getVisibility()).isEqualTo(View.VISIBLE);
+ assertThat(mPositiveButton.getText()).isEqualTo(mContext.getString(TEST_STRING_RES_ID));
}
@Test
public void setNegativeButtonText_shouldShowNegativeButton() {
- mBannerPreference.setNegativeButtonText(R.string.tts_settings_title);
+ mBannerPreference.setNegativeButtonText(TEST_STRING_RES_ID);
mBannerPreference.onBindViewHolder(mHolder);
- assertThat(((Button) mRootView.findViewById(R.id.banner_negative_btn)).getVisibility())
- .isEqualTo(View.VISIBLE);
+ Button mNegativeButton = mRootView.findViewById(R.id.banner_negative_btn);
+ assertThat(mNegativeButton.getVisibility()).isEqualTo(View.VISIBLE);
+ assertThat(mNegativeButton.getText()).isEqualTo(mContext.getString(TEST_STRING_RES_ID));
}
@Test
public void withoutSetPositiveButtonText_shouldHidePositiveButton() {
mBannerPreference.onBindViewHolder(mHolder);
- assertThat(((Button) mRootView.findViewById(R.id.banner_positive_btn)).getVisibility())
+ assertThat(mRootView.findViewById(R.id.banner_positive_btn).getVisibility())
.isEqualTo(View.GONE);
}
@@ -99,51 +206,290 @@
public void withoutSetNegativeButtonText_shouldHideNegativeButton() {
mBannerPreference.onBindViewHolder(mHolder);
- assertThat(((Button) mRootView.findViewById(R.id.banner_negative_btn)).getVisibility())
+ assertThat(mRootView.findViewById(R.id.banner_negative_btn).getVisibility())
.isEqualTo(View.GONE);
}
@Test
public void setPositiveButtonVisible_withTrue_shouldShowPositiveButton() {
- mBannerPreference.setPositiveButtonText(R.string.tts_settings_title);
+ mBannerPreference.setPositiveButtonText(TEST_STRING_RES_ID);
mBannerPreference.setPositiveButtonVisible(true);
mBannerPreference.onBindViewHolder(mHolder);
- assertThat(((Button) mRootView.findViewById(R.id.banner_positive_btn)).getVisibility())
+ assertThat((mRootView.findViewById(R.id.banner_positive_btn)).getVisibility())
.isEqualTo(View.VISIBLE);
}
@Test
public void setPositiveButtonVisible_withFalse_shouldHidePositiveButton() {
- mBannerPreference.setPositiveButtonText(R.string.tts_settings_title);
+ mBannerPreference.setPositiveButtonText(TEST_STRING_RES_ID);
mBannerPreference.setPositiveButtonVisible(false);
mBannerPreference.onBindViewHolder(mHolder);
- assertThat(((Button) mRootView.findViewById(R.id.banner_positive_btn)).getVisibility())
+ assertThat(mRootView.findViewById(R.id.banner_positive_btn).getVisibility())
.isEqualTo(View.GONE);
}
@Test
public void setNegativeButtonVisible_withTrue_shouldShowNegativeButton() {
- mBannerPreference.setNegativeButtonText(R.string.tts_settings_title);
+ mBannerPreference.setNegativeButtonText(TEST_STRING_RES_ID);
mBannerPreference.setNegativeButtonVisible(true);
mBannerPreference.onBindViewHolder(mHolder);
- assertThat(((Button) mRootView.findViewById(R.id.banner_negative_btn)).getVisibility())
+ assertThat(mRootView.findViewById(R.id.banner_negative_btn).getVisibility())
.isEqualTo(View.VISIBLE);
}
@Test
public void setNegativeButtonVisible_withFalse_shouldHideNegativeButton() {
- mBannerPreference.setNegativeButtonText(R.string.tts_settings_title);
+ mBannerPreference.setNegativeButtonText(TEST_STRING_RES_ID);
mBannerPreference.setNegativeButtonVisible(false);
mBannerPreference.onBindViewHolder(mHolder);
- assertThat(((Button) mRootView.findViewById(R.id.banner_negative_btn)).getVisibility())
+ assertThat(mRootView.findViewById(R.id.banner_negative_btn).getVisibility())
.isEqualTo(View.GONE);
}
+
+ @Test
+ public void setPositiveButtonOnClickListener_setsClickListener() {
+ mBannerPreference.setPositiveButtonOnClickListener(mClickListener);
+
+ mBannerPreference.onBindViewHolder(mHolder);
+ mRootView.findViewById(R.id.banner_positive_btn).callOnClick();
+
+ assertThat(mClickListenerCalled).isTrue();
+ }
+
+ @Test
+ public void setNegativeButtonOnClickListener_setsClickListener() {
+ mBannerPreference.setNegativeButtonOnClickListener(mClickListener);
+
+ mBannerPreference.onBindViewHolder(mHolder);
+ mRootView.findViewById(R.id.banner_negative_btn).callOnClick();
+
+ assertThat(mClickListenerCalled).isTrue();
+ }
+
+ @Test
+ public void setDismissButtonOnClickListener_whenAtLeastS_setsClickListener() {
+ assumeAndroidS();
+ mBannerPreference.setDismissButtonOnClickListener(mClickListener);
+
+ mBannerPreference.onBindViewHolder(mHolder);
+ mRootView.findViewById(R.id.banner_dismiss_btn).callOnClick();
+
+ assertThat(mClickListenerCalled).isTrue();
+ }
+
+ @Test
+ public void onBindViewHolder_whenAtLeastS_withDismissOnClickListener_dismissIsVisible() {
+ assumeAndroidS();
+ mBannerPreference.setDismissButtonOnClickListener(mClickListener);
+
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ assertThat((mRootView.findViewById(R.id.banner_dismiss_btn)).getVisibility())
+ .isEqualTo(View.VISIBLE);
+ }
+
+ @Test
+ public void onBindViewHolder_whenAtLeastS_withNoDismissClickListener_dimissButtonIsGone() {
+ assumeAndroidS();
+
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ assertThat((mRootView.findViewById(R.id.banner_dismiss_btn)).getVisibility())
+ .isEqualTo(View.GONE);
+ }
+
+ @Test
+ public void onBindViewHolder_whenAtLeastS_withNoClickListenerAndVisible_dimissButtonIsGone() {
+ assumeAndroidS();
+ mBannerPreference.setDismissButtonVisible(true);
+
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ assertThat(mRootView.findViewById(R.id.banner_dismiss_btn).getVisibility())
+ .isEqualTo(View.GONE);
+ }
+
+ @Test
+ public void onBindViewHolder_whenAtLeastS_withClickListenerAndNotVisible_dimissButtonIsGone() {
+ assumeAndroidS();
+ mBannerPreference.setDismissButtonOnClickListener(mClickListener);
+ mBannerPreference.setDismissButtonVisible(false);
+
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ ImageButton mDismissButton = mRootView.findViewById(R.id.banner_dismiss_btn);
+ assertThat(mDismissButton.getVisibility()).isEqualTo(View.GONE);
+ }
+
+ @Test
+ public void onBindViewHolder_whenAtLeastS_whenAttentionUnset_setsHighTheme() {
+ assumeAndroidS();
+ Drawable mCardBackgroundSpy = spy(mRootView.getBackground());
+ mRootView.setBackground(mCardBackgroundSpy);
+
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ assertThat(((ImageView) mHolder.findViewById(R.id.banner_icon)).getColorFilter())
+ .isEqualTo(getColorFilter(R.color.banner_accent_attention_high));
+ assertThat(getButtonColor(R.id.banner_positive_btn))
+ .isEqualTo(getColorId(R.color.banner_accent_attention_high));
+ assertThat(getButtonColor(R.id.banner_negative_btn))
+ .isEqualTo(getColorId(R.color.banner_accent_attention_high));
+ verify(mCardBackgroundSpy).setTint(getColorId(R.color.banner_background_attention_high));
+ }
+
+ @Test
+ public void onBindViewHolder_whenAtLeastS_whenAttentionHighByXML_setsHighTheme() {
+ assumeAndroidS();
+ Drawable mCardBackgroundSpy = spy(mRootView.getBackground());
+ mRootView.setBackground(mCardBackgroundSpy);
+ AttributeSet mAttributeSet = Robolectric.buildAttributeSet()
+ .addAttribute(R.attr.attentionLevel, "high")
+ .build();
+ mBannerPreference = new BannerMessagePreference(mContext, mAttributeSet);
+
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ assertThat(((ImageView) mHolder.findViewById(R.id.banner_icon)).getColorFilter())
+ .isEqualTo(getColorFilter(R.color.banner_accent_attention_high));
+ assertThat(getButtonColor(R.id.banner_positive_btn))
+ .isEqualTo(getColorId(R.color.banner_accent_attention_high));
+ assertThat(getButtonColor(R.id.banner_negative_btn))
+ .isEqualTo(getColorId(R.color.banner_accent_attention_high));
+ verify(mCardBackgroundSpy).setTint(getColorId(R.color.banner_background_attention_high));
+ }
+
+ @Test
+ public void onBindViewHolder_whenAtLeastS_whenAttentionMediumByXML_setsMediumTheme() {
+ assumeAndroidS();
+ Drawable mCardBackgroundSpy = spy(mRootView.getBackground());
+ mRootView.setBackground(mCardBackgroundSpy);
+ AttributeSet mAttributeSet = Robolectric.buildAttributeSet()
+ .addAttribute(R.attr.attentionLevel, "medium")
+ .build();
+ mBannerPreference = new BannerMessagePreference(mContext, mAttributeSet);
+
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ assertThat(((ImageView) mHolder.findViewById(R.id.banner_icon)).getColorFilter())
+ .isEqualTo(getColorFilter(R.color.banner_accent_attention_medium));
+ assertThat(getButtonColor(R.id.banner_positive_btn))
+ .isEqualTo(getColorId(R.color.banner_accent_attention_medium));
+ assertThat(getButtonColor(R.id.banner_negative_btn))
+ .isEqualTo(getColorId(R.color.banner_accent_attention_medium));
+ verify(mCardBackgroundSpy).setTint(getColorId(R.color.banner_background_attention_medium));
+ }
+
+ @Test
+ public void onBindViewHolder_whenAtLeastS_whenAttentionLowByXML_setsLowTheme() {
+ assumeAndroidS();
+ Drawable mCardBackgroundSpy = spy(mRootView.getBackground());
+ mRootView.setBackground(mCardBackgroundSpy);
+ AttributeSet mAttributeSet = Robolectric.buildAttributeSet()
+ .addAttribute(R.attr.attentionLevel, "low")
+ .build();
+ mBannerPreference = new BannerMessagePreference(mContext, mAttributeSet);
+
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ assertThat(((ImageView) mHolder.findViewById(R.id.banner_icon)).getColorFilter())
+ .isEqualTo(getColorFilter(R.color.banner_accent_attention_low));
+ assertThat(getButtonColor(R.id.banner_positive_btn))
+ .isEqualTo(getColorId(R.color.banner_accent_attention_low));
+ assertThat(getButtonColor(R.id.banner_negative_btn))
+ .isEqualTo(getColorId(R.color.banner_accent_attention_low));
+ verify(mCardBackgroundSpy).setTint(getColorId(R.color.banner_background_attention_low));
+ }
+
+ @Test
+ public void setAttentionLevel_whenAtLeastS_whenHighAttention_setsHighTheme() {
+ assumeAndroidS();
+ Drawable mCardBackgroundSpy = spy(mRootView.getBackground());
+ mRootView.setBackground(mCardBackgroundSpy);
+ mBannerPreference.setAttentionLevel(BannerMessagePreference.AttentionLevel.HIGH);
+
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ assertThat(((ImageView) mHolder.findViewById(R.id.banner_icon)).getColorFilter())
+ .isEqualTo(getColorFilter(R.color.banner_accent_attention_high));
+ assertThat(getButtonColor(R.id.banner_positive_btn))
+ .isEqualTo(getColorId(R.color.banner_accent_attention_high));
+ assertThat(getButtonColor(R.id.banner_negative_btn))
+ .isEqualTo(getColorId(R.color.banner_accent_attention_high));
+ verify(mCardBackgroundSpy).setTint(getColorId(R.color.banner_background_attention_high));
+ }
+
+ @Test
+ public void setAttentionLevel_whenAtLeastS_whenMedAttention_setsMediumTheme() {
+ assumeAndroidS();
+ Drawable mCardBackgroundSpy = spy(mRootView.getBackground());
+ mRootView.setBackground(mCardBackgroundSpy);
+ mBannerPreference.setAttentionLevel(BannerMessagePreference.AttentionLevel.MEDIUM);
+
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ assertThat(((ImageView) mHolder.findViewById(R.id.banner_icon)).getColorFilter())
+ .isEqualTo(getColorFilter(R.color.banner_accent_attention_medium));
+ assertThat(getButtonColor(R.id.banner_positive_btn))
+ .isEqualTo(getColorId(R.color.banner_accent_attention_medium));
+ assertThat(getButtonColor(R.id.banner_negative_btn))
+ .isEqualTo(getColorId(R.color.banner_accent_attention_medium));
+ verify(mCardBackgroundSpy).setTint(getColorId(R.color.banner_background_attention_medium));
+ }
+
+ @Test
+ public void setAttentionLevel_whenAtLeastS_whenLowAttention_setsLowTheme() {
+ assumeAndroidS();
+ Drawable mCardBackgroundSpy = spy(mRootView.getBackground());
+ mRootView.setBackground(mCardBackgroundSpy);
+ mBannerPreference.setAttentionLevel(BannerMessagePreference.AttentionLevel.LOW);
+
+ mBannerPreference.onBindViewHolder(mHolder);
+
+ assertThat(((ImageView) mHolder.findViewById(R.id.banner_icon)).getColorFilter())
+ .isEqualTo(getColorFilter(R.color.banner_accent_attention_low));
+ assertThat(getButtonColor(R.id.banner_positive_btn))
+ .isEqualTo(getColorId(R.color.banner_accent_attention_low));
+ assertThat(getButtonColor(R.id.banner_negative_btn))
+ .isEqualTo(getColorId(R.color.banner_accent_attention_low));
+ verify(mCardBackgroundSpy).setTint(getColorId(R.color.banner_background_attention_low));
+ }
+
+ private int getButtonColor(int buttonResId) {
+ Button mButton = mRootView.findViewById(buttonResId);
+ return mButton.getTextColors().getDefaultColor();
+ }
+
+ private ColorFilter getColorFilter(@ColorRes int colorResId) {
+ return new PorterDuffColorFilter(getColorId(colorResId), PorterDuff.Mode.SRC_IN);
+ }
+
+ private int getColorId(@ColorRes int colorResId) {
+ return mContext.getResources().getColor(colorResId, mContext.getTheme());
+ }
+
+ private void assumeAndroidR() {
+ ReflectionHelpers.setStaticField(Build.VERSION.class, "SDK_INT", 30);
+ // Reset view holder to use correct layout.
+ }
+
+ private void assumeAndroidS() {
+ ReflectionHelpers.setStaticField(Build.VERSION.class, "SDK_INT", 31);
+ // Re-inflate view to update layout.
+ setUpViewHolder();
+ }
+
+ private void setUpViewHolder() {
+ mRootView =
+ View.inflate(mContext, mBannerPreference.getLayoutResource(), null /* parent */);
+ mHolder = PreferenceViewHolder.createInstanceForTests(mRootView);
+ }
}
diff --git a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
index 1cfdff8..cf54083 100644
--- a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
+++ b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
@@ -190,5 +190,7 @@
Settings.Secure.ACCESSIBILITY_FLOATING_MENU_FADE_ENABLED,
Settings.Secure.NOTIFICATION_BUBBLES,
Settings.Secure.LOCATION_TIME_ZONE_DETECTION_ENABLED,
+ Settings.Secure.LOCKSCREEN_SHOW_CONTROLS,
+ Settings.Secure.LOCKSCREEN_SHOW_WALLET,
};
}
diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
index 36f5dba..50fab4f 100644
--- a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
+++ b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
@@ -146,6 +146,8 @@
VALIDATORS.put(Secure.QS_TILES, TILE_LIST_VALIDATOR);
VALIDATORS.put(Secure.CONTROLS_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(Secure.POWER_MENU_LOCKED_SHOW_CONTENT, BOOLEAN_VALIDATOR);
+ VALIDATORS.put(Secure.LOCKSCREEN_SHOW_CONTROLS, BOOLEAN_VALIDATOR);
+ VALIDATORS.put(Secure.LOCKSCREEN_SHOW_WALLET, BOOLEAN_VALIDATOR);
VALIDATORS.put(Secure.DOZE_ENABLED, BOOLEAN_VALIDATOR);
VALIDATORS.put(Secure.DOZE_ALWAYS_ON, BOOLEAN_VALIDATOR);
VALIDATORS.put(Secure.DOZE_PICK_UP_GESTURE, BOOLEAN_VALIDATOR);
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index 959b6ba..bce576d 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -3547,7 +3547,7 @@
}
private final class UpgradeController {
- private static final int SETTINGS_VERSION = 202;
+ private static final int SETTINGS_VERSION = 203;
private final int mUserId;
@@ -5130,6 +5130,27 @@
currentVersion = 202;
}
+ if (currentVersion == 202) {
+ // Version 202: Power menu has been removed, and the privacy setting
+ // has been split into two for wallet and controls
+ final SettingsState secureSettings = getSecureSettingsLocked(userId);
+ final Setting showLockedContent = secureSettings.getSettingLocked(
+ Secure.POWER_MENU_LOCKED_SHOW_CONTENT);
+ if (!showLockedContent.isNull()) {
+ String currentValue = showLockedContent.getValue();
+
+ secureSettings.insertSettingOverrideableByRestoreLocked(
+ Secure.LOCKSCREEN_SHOW_CONTROLS,
+ currentValue, null /* tag */, false /* makeDefault */,
+ SettingsState.SYSTEM_PACKAGE_NAME);
+ secureSettings.insertSettingOverrideableByRestoreLocked(
+ Secure.LOCKSCREEN_SHOW_WALLET,
+ currentValue, null /* tag */, false /* makeDefault */,
+ SettingsState.SYSTEM_PACKAGE_NAME);
+ }
+ currentVersion = 203;
+ }
+
// vXXX: Add new settings above this point.
if (currentVersion != newVersion) {
diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml
index 4bf4094..6e256c1 100644
--- a/packages/Shell/AndroidManifest.xml
+++ b/packages/Shell/AndroidManifest.xml
@@ -455,8 +455,9 @@
<!-- Permission needed for CTS test - MatchContentFrameRateTest -->
<uses-permission android:name="android.permission.MODIFY_REFRESH_RATE_SWITCHING_TYPE" />
- <!-- Permission needed for CTS test - TimeManagerTest -->
+ <!-- Permissions needed for CTS test - TimeManagerTest -->
<uses-permission android:name="android.permission.MANAGE_TIME_AND_ZONE_DETECTION" />
+ <uses-permission android:name="android.permission.SUGGEST_EXTERNAL_TIME" />
<!-- Permission required for CTS test - android.server.biometrics -->
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index d698975..8c092ae 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -588,13 +588,15 @@
android:label="@string/people_tile_title"
android:enabled="true"
android:exported="true"
+ android:windowDisablePreview="true"
android:theme="@style/Theme.PeopleTileConfigActivity">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
</intent-filter>
</activity>
- <activity android:name=".people.widget.LaunchConversationActivity" />
+ <activity android:name=".people.widget.LaunchConversationActivity"
+ android:windowDisablePreview="true" />
<!-- People Space Widget -->
<receiver
diff --git a/packages/SystemUI/res-keyguard/values-eu/strings.xml b/packages/SystemUI/res-keyguard/values-eu/strings.xml
index 9f00e66..83a0a32 100644
--- a/packages/SystemUI/res-keyguard/values-eu/strings.xml
+++ b/packages/SystemUI/res-keyguard/values-eu/strings.xml
@@ -24,7 +24,7 @@
<string name="keyguard_password_enter_pin_code" msgid="8582296866585566671">"Idatzi PIN kodea"</string>
<string name="keyguard_password_enter_puk_code" msgid="3813154965969758868">"Idatzi SIM txartelaren PUK kodea eta PIN kode berria"</string>
<string name="keyguard_password_enter_puk_prompt" msgid="3529260761374385243">"SIM txartelaren PUK kodea"</string>
- <string name="keyguard_password_enter_pin_prompt" msgid="2304037870481240781">"SIM txartelaren PIN kode berria"</string>
+ <string name="keyguard_password_enter_pin_prompt" msgid="2304037870481240781">"SIM txartelaren PIN berria"</string>
<string name="keyguard_password_entry_touch_hint" msgid="6180028658339706333"><font size="17">"Pasahitza idazteko, sakatu hau"</font></string>
<string name="keyguard_password_enter_password_code" msgid="7393393239623946777">"Idatzi desblokeatzeko pasahitza"</string>
<string name="keyguard_password_enter_pin_password_code" msgid="3692259677395250509">"Idatzi desblokeatzeko PIN kodea"</string>
@@ -63,7 +63,7 @@
<string name="kg_forgot_pattern_button_text" msgid="3304688032024541260">"Eredua ahaztu zaizu"</string>
<string name="kg_wrong_pattern" msgid="5907301342430102842">"Eredua ez da zuzena"</string>
<string name="kg_wrong_password" msgid="4143127991071670512">"Pasahitza ez da zuzena"</string>
- <string name="kg_wrong_pin" msgid="4160978845968732624">"PIN kode hori ez da zuzena"</string>
+ <string name="kg_wrong_pin" msgid="4160978845968732624">"PIN hori ez da zuzena"</string>
<plurals name="kg_too_many_failed_attempts_countdown" formatted="false" msgid="991400408675793914">
<item quantity="other">Saiatu berriro <xliff:g id="NUMBER">%d</xliff:g> segundo igarotakoan.</item>
<item quantity="one">Saiatu berriro segundo bat igarotakoan.</item>
diff --git a/packages/SystemUI/res/drawable/circle_green_10dp.xml b/packages/SystemUI/res/drawable/availability_dot_10dp.xml
similarity index 75%
rename from packages/SystemUI/res/drawable/circle_green_10dp.xml
rename to packages/SystemUI/res/drawable/availability_dot_10dp.xml
index 571ec62..ab40eb0 100644
--- a/packages/SystemUI/res/drawable/circle_green_10dp.xml
+++ b/packages/SystemUI/res/drawable/availability_dot_10dp.xml
@@ -15,8 +15,10 @@
~ limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="oval">
- <size android:height="10dp"
- android:width="10dp" />
- <solid android:color="#34A853" />
+ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
+ android:shape="oval">
+ <size
+ android:height="10dp"
+ android:width="10dp" />
+ <solid android:color="?androidprv:attr/colorAccentPrimaryVariant" />
</shape>
\ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/people_space_messages_count_background.xml b/packages/SystemUI/res/drawable/people_space_messages_count_background.xml
index 0fc112e..97752d0 100644
--- a/packages/SystemUI/res/drawable/people_space_messages_count_background.xml
+++ b/packages/SystemUI/res/drawable/people_space_messages_count_background.xml
@@ -14,7 +14,8 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<shape xmlns:android="http://schemas.android.com/apk/res/android" >
- <solid android:color="#9ED582" />
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
+ <solid android:color="?androidprv:attr/colorAccentPrimary" />
<corners android:radius="@dimen/people_space_messages_count_radius" />
</shape>
diff --git a/packages/SystemUI/res/layout-land/global_screenshot_preview.xml b/packages/SystemUI/res/layout-land/global_screenshot_preview.xml
deleted file mode 100644
index 93664da..0000000
--- a/packages/SystemUI/res/layout-land/global_screenshot_preview.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2020 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-<ImageView
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:id="@+id/global_screenshot_preview"
- android:layout_width="wrap_content"
- android:layout_height="@dimen/global_screenshot_x_scale"
- android:layout_gravity="center"
- android:layout_marginStart="@dimen/screenshot_offset_x"
- android:layout_marginBottom="@dimen/screenshot_offset_y"
- android:scaleType="fitStart"
- android:elevation="@dimen/screenshot_preview_elevation"
- android:visibility="invisible"
- android:background="@drawable/screenshot_rounded_corners"
- android:adjustViewBounds="true"
- android:contentDescription="@string/screenshot_edit_label"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toStartOf="parent"/>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/people_tile_large_empty.xml b/packages/SystemUI/res/layout/people_tile_large_empty.xml
index 69e2770..2c6acbc 100644
--- a/packages/SystemUI/res/layout/people_tile_large_empty.xml
+++ b/packages/SystemUI/res/layout/people_tile_large_empty.xml
@@ -14,30 +14,28 @@
~ limitations under the License.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/item"
+ android:background="@drawable/people_space_tile_view_card"
android:theme="@android:style/Theme.DeviceDefault.DayNight"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:paddingHorizontal="16dp"
+ android:paddingTop="14dp"
+ android:paddingBottom="16dp">
<LinearLayout
- android:id="@+id/item"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:gravity="center"
- android:background="@drawable/people_space_tile_view_card"
- android:orientation="vertical"
- android:paddingHorizontal="16dp"
- android:paddingVertical="16dp">
+ android:layout_height="wrap_content"
+ android:gravity="top|center_horizontal"
+ android:orientation="vertical">
<ImageView
android:id="@+id/person_icon"
- android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/name"
- android:layout_gravity="center"
android:paddingTop="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -45,24 +43,22 @@
android:singleLine="true"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
android:textColor="?android:attr/textColorPrimary"
- android:textSize="16sp" />
+ android:textSize="@dimen/name_text_size_for_large" />
<TextView
android:id="@+id/last_interaction"
- android:layout_gravity="center"
android:text="@string/empty_status"
android:textColor="?android:attr/textColorSecondary"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
- android:textSize="14sp"
+ android:textSize="@dimen/content_text_size_for_large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"/>
- <ImageView
- android:id="@+id/availability"
- android:layout_gravity="center"
- android:layout_width="10dp"
- android:layout_height="26dp"
- android:paddingTop="16dp"
- android:background="@drawable/circle_green_10dp"/>
</LinearLayout>
+ <ImageView
+ android:id="@+id/availability"
+ android:layout_gravity="bottom|center_horizontal"
+ android:layout_width="10dp"
+ android:layout_height="10dp"
+ android:background="@drawable/availability_dot_10dp"/>
</FrameLayout>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/people_tile_large_with_content.xml b/packages/SystemUI/res/layout/people_tile_large_with_content.xml
index b77670e..4994c69 100644
--- a/packages/SystemUI/res/layout/people_tile_large_with_content.xml
+++ b/packages/SystemUI/res/layout/people_tile_large_with_content.xml
@@ -13,147 +13,136 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:background="@drawable/people_space_tile_view_card"
- android:id="@+id/item"
- android:clipToOutline="true"
- android:theme="@android:style/Theme.DeviceDefault.DayNight"
- android:layout_gravity="center"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:layout_gravity="center"
+ android:padding="16dp"
+ android:orientation="vertical">
- <include layout="@layout/people_status_scrim_layout" />
-
- <LinearLayout
+ <RelativeLayout
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_gravity="center"
- android:padding="16dp"
- android:orientation="vertical">
+ android:layout_height="wrap_content"
+ android:gravity="start|top">
- <RelativeLayout
- android:layout_width="match_parent"
+ <LinearLayout
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:gravity="start|top">
+ android:layout_alignParentStart="true"
+ android:gravity="start|top"
+ android:orientation="horizontal">
- <LinearLayout
+ <ImageView
+ android:id="@+id/person_icon"
+ android:layout_marginStart="-2dp"
+ android:layout_marginTop="-2dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentStart="true"
- android:gravity="start|top"
+ android:layout_weight="1" />
+
+ <ImageView
+ android:id="@+id/availability"
+ android:layout_marginStart="-2dp"
+ android:layout_width="10dp"
+ android:layout_height="10dp"
+ android:background="@drawable/availability_dot_10dp" />
+ </LinearLayout>
+
+ <TextView
+ android:id="@+id/messages_count"
+ android:layout_alignParentEnd="true"
+ android:paddingStart="8dp"
+ android:paddingEnd="8dp"
+ android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
+ android:textColor="?android:attr/textColorPrimary"
+ android:background="@drawable/people_space_messages_count_background"
+ android:textSize="14sp"
+ android:maxLines="1"
+ android:ellipsize="end"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone" />
+ </RelativeLayout>
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <include layout="@layout/people_tile_punctuation_background_large" />
+
+ <include layout="@layout/people_tile_emoji_background_large" />
+
+ <TextView
+ android:layout_gravity="top"
+ android:id="@+id/name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingBottom="@dimen/below_name_text_padding"
+ android:gravity="start|top"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:text="@string/empty_user_name"
+ android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
+ android:textColor="?android:attr/textColorPrimary"
+ android:textSize="@dimen/name_text_size_for_content" />
+
+ <LinearLayout
+ android:id="@+id/content"
+ android:layout_below="@id/name"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:id="@+id/status_icon_and_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingBottom="4dp"
+ android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
- android:id="@+id/person_icon"
- android:layout_marginStart="-2dp"
- android:layout_marginTop="-2dp"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_weight="1" />
-
- <ImageView
- android:id="@+id/availability"
- android:layout_marginStart="-2dp"
- android:layout_width="10dp"
- android:layout_height="10dp"
- android:background="@drawable/circle_green_10dp" />
- </LinearLayout>
-
- <TextView
- android:id="@+id/messages_count"
- android:layout_alignParentEnd="true"
- android:paddingStart="8dp"
- android:paddingEnd="8dp"
- android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
- android:textColor="?android:attr/textColorPrimary"
- android:background="@drawable/people_space_messages_count_background"
- android:textSize="14sp"
- android:maxLines="1"
- android:ellipsize="end"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:visibility="gone" />
- </RelativeLayout>
-
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <include layout="@layout/people_tile_punctuation_background_large" />
-
- <include layout="@layout/people_tile_emoji_background_large" />
-
- <LinearLayout
- android:id="@+id/content"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
+ android:id="@+id/predefined_icon"
+ android:tint="?android:attr/colorAccent"
+ android:gravity="start|center_vertical"
+ android:layout_width="@dimen/regular_predefined_icon"
+ android:layout_height="@dimen/regular_predefined_icon" />
<TextView
android:layout_gravity="center"
- android:id="@+id/name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingBottom="12dp"
- android:gravity="start"
- android:singleLine="true"
- android:ellipsize="end"
- android:text="@string/empty_user_name"
- android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
- android:textColor="?android:attr/textColorPrimary"
- android:textSize="14sp" />
-
- <LinearLayout
- android:id="@+id/status_icon_and_label"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:id="@+id/subtext"
android:paddingBottom="4dp"
android:gravity="center_vertical"
- android:orientation="horizontal">
-
- <ImageView
- android:id="@+id/predefined_icon"
- android:tint="?android:attr/colorAccent"
- android:gravity="start|center_vertical"
- android:paddingEnd="6dp"
- android:layout_width="24dp"
- android:layout_height="18dp" />
-
- <TextView
- android:layout_gravity="center"
- android:id="@+id/subtext"
- android:gravity="center_vertical"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:ellipsize="end"
- android:singleLine="true"
- android:text="@string/empty_user_name"
- android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
- android:textColor="?android:attr/textColorSecondary"
- android:textSize="12sp" />
- </LinearLayout>
-
- <ImageView
- android:id="@+id/image"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@drawable/people_space_content_background"
- android:gravity="center"
- android:scaleType="centerCrop" />
-
- <TextView
- android:layout_gravity="center"
- android:id="@+id/text_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
- android:maxLines="2"
- android:singleLine="false"
- android:text="@string/empty_status"
+ android:singleLine="true"
+ android:text="@string/empty_user_name"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
- android:textColor="?android:attr/textColorPrimary"
- android:textSize="@dimen/content_text_size_for_large" />
+ android:textColor="?android:attr/textColorSecondary"
+ android:textSize="12sp" />
</LinearLayout>
- </RelativeLayout>
- </LinearLayout>
-</RelativeLayout>
\ No newline at end of file
+
+ <ImageView
+ android:id="@+id/image"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@drawable/people_space_content_background"
+ android:gravity="center"
+ android:scaleType="centerCrop" />
+
+ <TextView
+ android:layout_gravity="center"
+ android:id="@+id/text_content"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:ellipsize="end"
+ android:maxLines="2"
+ android:singleLine="false"
+ android:text="@string/empty_status"
+ android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
+ android:textColor="?android:attr/textColorPrimary"
+ android:textSize="@dimen/content_text_size_for_large" />
+ </LinearLayout>
+ </RelativeLayout>
+</LinearLayout>
diff --git a/packages/SystemUI/res/layout/people_tile_large_with_notification_content.xml b/packages/SystemUI/res/layout/people_tile_large_with_notification_content.xml
new file mode 100644
index 0000000..60ff68e
--- /dev/null
+++ b/packages/SystemUI/res/layout/people_tile_large_with_notification_content.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.
+ -->
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:background="@drawable/people_space_tile_view_card"
+ android:id="@+id/item"
+ android:clipToOutline="true"
+ android:theme="@android:style/Theme.DeviceDefault.DayNight"
+ android:layout_gravity="center"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <include layout="@layout/people_tile_large_with_content" />
+</RelativeLayout>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/people_tile_large_with_status_content.xml b/packages/SystemUI/res/layout/people_tile_large_with_status_content.xml
new file mode 100644
index 0000000..cbc6ea8
--- /dev/null
+++ b/packages/SystemUI/res/layout/people_tile_large_with_status_content.xml
@@ -0,0 +1,27 @@
+<?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.
+ -->
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:background="@drawable/people_space_tile_view_card"
+ android:id="@+id/item"
+ android:clipToOutline="true"
+ android:theme="@android:style/Theme.DeviceDefault.DayNight"
+ android:layout_gravity="center"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <include layout="@layout/people_status_scrim_layout" />
+ <include layout="@layout/people_tile_large_with_content" />
+</RelativeLayout>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/people_tile_medium_empty.xml b/packages/SystemUI/res/layout/people_tile_medium_empty.xml
index 4236493..bebc872 100644
--- a/packages/SystemUI/res/layout/people_tile_medium_empty.xml
+++ b/packages/SystemUI/res/layout/people_tile_medium_empty.xml
@@ -35,13 +35,14 @@
android:layout_height="64dp" />
<ImageView
android:id="@+id/availability"
+ android:gravity="top"
android:layout_marginStart="-2dp"
android:layout_width="10dp"
android:layout_height="10dp"
- android:background="@drawable/circle_green_10dp" />
+ android:background="@drawable/availability_dot_10dp" />
<LinearLayout
android:orientation="vertical"
- android:paddingStart="6dp"
+ android:paddingStart="4dp"
android:gravity="top"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@@ -50,7 +51,7 @@
android:text="@string/empty_user_name"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
android:textColor="?android:attr/textColorPrimary"
- android:textSize="14sp"
+ android:textSize="@dimen/empty_name_text_size_for_medium"
android:maxLines="1"
android:ellipsize="end"
android:layout_width="wrap_content"
@@ -60,7 +61,7 @@
android:text="@string/empty_status"
android:textColor="?android:attr/textColorSecondary"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
- android:textSize="12sp"
+ android:textSize="@dimen/content_text_size_for_medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="3"
diff --git a/packages/SystemUI/res/layout/people_tile_medium_with_content.xml b/packages/SystemUI/res/layout/people_tile_medium_with_content.xml
index 8df0bf8..a7a6354 100644
--- a/packages/SystemUI/res/layout/people_tile_medium_with_content.xml
+++ b/packages/SystemUI/res/layout/people_tile_medium_with_content.xml
@@ -57,12 +57,14 @@
android:layout_marginStart="-2dp"
android:layout_width="10dp"
android:layout_height="10dp"
- android:background="@drawable/circle_green_10dp" />
+ android:background="@drawable/availability_dot_10dp" />
<LinearLayout
+ android:id="@+id/medium_content"
android:orientation="vertical"
android:gravity="top|start"
android:paddingStart="12dp"
+ android:paddingBottom="@dimen/medium_content_padding_above_name"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@@ -72,7 +74,7 @@
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
android:textColor="?android:attr/textColorSecondary"
android:textSize="12sp"
- android:paddingBottom="4dp"
+ android:paddingBottom="8dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
@@ -104,9 +106,9 @@
android:gravity="bottom"
android:layout_gravity="center_vertical"
android:orientation="horizontal"
- android:paddingTop="2dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:minHeight="18dp"
android:clipToOutline="true">
<TextView
android:id="@+id/name"
@@ -115,9 +117,10 @@
android:text="@string/empty_user_name"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
android:textColor="?android:attr/textColorPrimary"
- android:textSize="14sp"
+ android:textSize="@dimen/name_text_size_for_content"
android:singleLine="true"
android:ellipsize="end"
+ android:paddingEnd="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
@@ -139,9 +142,8 @@
android:id="@+id/predefined_icon"
android:tint="?android:attr/colorAccent"
android:gravity="end|center_vertical"
- android:paddingStart="6dp"
- android:layout_width="24dp"
- android:layout_height="18dp" />
+ android:layout_width="@dimen/regular_predefined_icon"
+ android:layout_height="@dimen/regular_predefined_icon" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
diff --git a/packages/SystemUI/res/layout/people_tile_small.xml b/packages/SystemUI/res/layout/people_tile_small.xml
index 7c28fc1..4e5c04c 100644
--- a/packages/SystemUI/res/layout/people_tile_small.xml
+++ b/packages/SystemUI/res/layout/people_tile_small.xml
@@ -48,12 +48,11 @@
android:id="@+id/messages_count"
android:layout_gravity="center"
android:gravity="center"
- android:paddingStart="8dp"
- android:paddingEnd="8dp"
+ android:paddingHorizontal="8dp"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
android:textColor="?android:attr/textColorPrimary"
android:background="@drawable/people_space_messages_count_background"
- android:textSize="14sp"
+ android:textSize="@dimen/name_text_size_for_small"
android:maxLines="1"
android:ellipsize="end"
android:layout_width="wrap_content"
@@ -71,6 +70,6 @@
android:paddingHorizontal="4dp"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.ListItem"
android:textColor="?android:attr/textColorPrimary"
- android:textSize="14sp" />
+ android:textSize="@dimen/name_text_size_for_small" />
</LinearLayout>
</FrameLayout>
\ No newline at end of file
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index e7d714e..b292d7e 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -1293,7 +1293,7 @@
<dimen name="magnification_drag_view_size">36dp</dimen>
<dimen name="magnification_controls_size">90dp</dimen>
<dimen name="magnification_switch_button_size">48dp</dimen>
- <dimen name="magnification_switch_button_padding">6dp</dimen>
+ <dimen name="magnification_switch_button_margin">16dp</dimen>
<dimen name="magnifier_left_right_controls_width">35dp</dimen>
<dimen name="magnifier_left_right_controls_height">45dp</dimen>
<dimen name="magnifier_up_down_controls_width">45dp</dimen>
@@ -1433,19 +1433,29 @@
<dimen name="people_space_image_radius">20dp</dimen>
<dimen name="people_space_messages_count_radius">12dp</dimen>
<dimen name="people_space_widget_background_padding">6dp</dimen>
- <dimen name="required_width_for_medium">146dp</dimen>
+ <dimen name="required_width_for_medium">136dp</dimen>
<dimen name="required_width_for_large">138dp</dimen>
- <dimen name="required_height_for_large">182dp</dimen>
+ <dimen name="required_height_for_large">168dp</dimen>
<dimen name="default_width">146dp</dimen>
<dimen name="default_height">92dp</dimen>
<dimen name="avatar_size_for_medium">52dp</dimen>
<dimen name="max_people_avatar_size_for_large_content">64dp</dimen>
<dimen name="max_people_avatar_size">108dp</dimen>
<dimen name="name_text_size_for_small">14sp</dimen>
- <dimen name="name_text_size_for_medium">14sp</dimen>
- <dimen name="name_text_size_for_large">24sp</dimen>
+ <dimen name="name_text_size_for_content">12sp</dimen>
+ <dimen name="empty_name_text_size_for_medium">12sp</dimen>
+ <dimen name="max_name_text_size_for_medium">14sp</dimen>
+ <dimen name="medium_height_for_max_name_text_size">104dp</dimen>
+ <dimen name="name_text_size_for_large">16sp</dimen>
<dimen name="content_text_size_for_medium">12sp</dimen>
<dimen name="content_text_size_for_large">14sp</dimen>
+ <dimen name="below_name_text_padding">16dp</dimen>
+ <dimen name="above_notification_text_padding">22dp</dimen>
+ <dimen name="regular_predefined_icon">18dp</dimen>
+ <dimen name="large_predefined_icon">24dp</dimen>
+ <dimen name="availability_dot_status_padding">8dp</dimen>
+ <dimen name="availability_dot_notification_padding">12dp</dimen>
+ <dimen name="medium_content_padding_above_name">4dp</dimen>
<!-- Accessibility floating menu -->
<dimen name="accessibility_floating_menu_elevation">5dp</dimen>
diff --git a/packages/SystemUI/res/values/ids.xml b/packages/SystemUI/res/values/ids.xml
index bb9d331..bdc7bdb 100644
--- a/packages/SystemUI/res/values/ids.xml
+++ b/packages/SystemUI/res/values/ids.xml
@@ -157,9 +157,6 @@
<item type="id" name="accessibility_action_qs_move_to_position" />
<item type="id" name="accessibility_action_qs_add_to_position" />
- <!-- Accessibility actions for PIP -->
- <item type="id" name="action_pip_resize" />
-
<!-- Accessibility actions for window magnification. -->
<item type="id" name="accessibility_action_zoom_in"/>
<item type="id" name="accessibility_action_zoom_out"/>
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index 36a1bb3..71382f3 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -2881,12 +2881,16 @@
<string name="recent_conversations">Recent conversations</string>
<!-- Text for button dismissing configuration activity with no conversations [CHAR LIMIT=20] -->
<string name="okay">Okay</string>
- <!-- Timestamp for notification with exact time [CHAR LIMIT=25] -->
- <string name="timestamp"><xliff:g id="duration" example="5 hours">%1$s</xliff:g> ago</string>
- <!-- Timestamp for notification when less than a certain time window [CHAR LIMIT=25] -->
- <string name="less_than_timestamp">Less than <xliff:g id="duration" example="5 hours">%1$s</xliff:g> ago</string>
- <!-- Timestamp for notification when over a certain time window [CHAR LIMIT=25] -->
- <string name="over_timestamp">Over <xliff:g id="duration" example="1 week">%1$s</xliff:g> ago</string>
+ <!-- Timestamp for notification with exact time in days plural [CHAR LIMIT=25] -->
+ <string name="days_timestamp"><xliff:g id="duration" example="5">%1$s</xliff:g> days ago</string>
+ <!-- Timestamp for notification from one week ago[CHAR LIMIT=25] -->
+ <string name="one_week_timestamp">1 week ago</string>
+ <!-- Timestamp for notification from two weeks ago [CHAR LIMIT=25] -->
+ <string name="two_weeks_timestamp">2 weeks ago</string>
+ <!-- Timestamp for notification when over one week ago [CHAR LIMIT=25] -->
+ <string name="over_one_week_timestamp">Over 1 week ago</string>
+ <!-- Timestamp for notification when over two weeks ago [CHAR LIMIT=25] -->
+ <string name="over_two_weeks_timestamp">Over 2 weeks ago</string>
<!-- Status text on the Conversation widget for a birthday today [CHAR LIMIT=20] -->
<string name="birthday_status">Birthday</string>
<!-- Content description text on the Conversation widget for a birthday today [CHAR LIMIT=150] -->
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/plugins/PluginInstanceManager.java b/packages/SystemUI/shared/src/com/android/systemui/shared/plugins/PluginInstanceManager.java
index 2b35bcd..c90833c 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/plugins/PluginInstanceManager.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/plugins/PluginInstanceManager.java
@@ -345,7 +345,7 @@
// Create our own ClassLoader so we can use our own code as the parent.
ClassLoader classLoader = mManager.getClassLoader(info);
Context pluginContext = new PluginContextWrapper(
- mContext.createApplicationContext(info, 0), classLoader);
+ mContext.createPackageContext(pkg, 0), classLoader);
Class<?> pluginClass = Class.forName(cls, true, classLoader);
// TODO: Only create the plugin before version check if we need it for
// legacy version check.
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationAdapterCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationAdapterCompat.java
index 22d934e..ee55bf0 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationAdapterCompat.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationAdapterCompat.java
@@ -28,6 +28,7 @@
import android.annotation.SuppressLint;
import android.os.IBinder;
import android.os.RemoteException;
+import android.util.ArrayMap;
import android.util.Log;
import android.view.IRemoteAnimationFinishedCallback;
import android.view.IRemoteAnimationRunner;
@@ -158,10 +159,11 @@
public void startAnimation(IBinder token, TransitionInfo info,
SurfaceControl.Transaction t,
IRemoteTransitionFinishedCallback finishCallback) {
+ final ArrayMap<SurfaceControl, SurfaceControl> leashMap = new ArrayMap<>();
final RemoteAnimationTargetCompat[] appsCompat =
- RemoteAnimationTargetCompat.wrap(info, false /* wallpapers */);
+ RemoteAnimationTargetCompat.wrap(info, false /* wallpapers */, t, leashMap);
final RemoteAnimationTargetCompat[] wallpapersCompat =
- RemoteAnimationTargetCompat.wrap(info, true /* wallpapers */);
+ RemoteAnimationTargetCompat.wrap(info, true /* wallpapers */, t, leashMap);
// TODO(bc-unlock): Build wrapped object for non-apps target.
final RemoteAnimationTargetCompat[] nonAppsCompat =
new RemoteAnimationTargetCompat[0];
@@ -211,7 +213,7 @@
// Need to "boost" the closing things since that's what launcher expects.
for (int i = info.getChanges().size() - 1; i >= 0; --i) {
final TransitionInfo.Change change = info.getChanges().get(i);
- final SurfaceControl leash = change.getLeash();
+ final SurfaceControl leash = leashMap.get(change.getLeash());
final int mode = info.getChanges().get(i).getMode();
// Only deal with independent layers
if (!TransitionInfo.isIndependent(change, info)) continue;
@@ -227,14 +229,14 @@
}
} else {
if (launcherTask != null) {
- counterLauncher.addChild(t, launcherTask.getLeash());
+ counterLauncher.addChild(t, leashMap.get(launcherTask.getLeash()));
}
if (wallpaper != null && rotateDelta != 0 && wallpaper.getParent() != null) {
counterWallpaper.setup(t, info.getChange(wallpaper.getParent()).getLeash(),
rotateDelta, displayW, displayH);
if (counterWallpaper.mSurface != null) {
t.setLayer(counterWallpaper.mSurface, -1);
- counterWallpaper.addChild(t, wallpaper.getLeash());
+ counterWallpaper.addChild(t, leashMap.get(wallpaper.getLeash()));
}
}
}
@@ -252,6 +254,12 @@
for (int i = 0; i < info.getChanges().size(); ++i) {
info.getChanges().get(i).getLeash().release();
}
+ SurfaceControl.Transaction t = new SurfaceControl.Transaction();
+ for (int i = 0; i < leashMap.size(); ++i) {
+ if (leashMap.keyAt(i) == leashMap.valueAt(i)) continue;
+ t.remove(leashMap.valueAt(i));
+ }
+ t.apply();
finishCallback.onTransitionFinished(null /* wct */);
} catch (RemoteException e) {
Log.e("ActivityOptionsCompat", "Failed to call app controlled animation"
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java
index fcab71c..2407d21 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java
@@ -17,11 +17,21 @@
package com.android.systemui.shared.system;
import static android.view.WindowManager.LayoutParams.INVALID_WINDOW_TYPE;
+import static android.view.WindowManager.TRANSIT_CHANGE;
+import static android.view.WindowManager.TRANSIT_CLOSE;
+import static android.view.WindowManager.TRANSIT_OPEN;
+import static android.view.WindowManager.TRANSIT_TO_BACK;
+import static android.view.WindowManager.TRANSIT_TO_FRONT;
+import static android.window.TransitionInfo.FLAG_IS_WALLPAPER;
+import static android.window.TransitionInfo.FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT;
+import android.annotation.NonNull;
+import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.app.WindowConfiguration;
import android.graphics.Point;
import android.graphics.Rect;
+import android.util.ArrayMap;
import android.view.RemoteAnimationTarget;
import android.view.SurfaceControl;
import android.view.WindowManager;
@@ -97,10 +107,94 @@
}
}
- public RemoteAnimationTargetCompat(TransitionInfo.Change change, int order) {
+
+ /**
+ * Almost a copy of Transitions#setupStartState.
+ * TODO: remove when there is proper cross-process transaction sync.
+ */
+ @SuppressLint("NewApi")
+ private static void setupLeash(@NonNull SurfaceControl leash,
+ @NonNull TransitionInfo.Change change, int layer,
+ @NonNull TransitionInfo info, @NonNull SurfaceControl.Transaction t) {
+ boolean isOpening = info.getType() == TRANSIT_OPEN || info.getType() == TRANSIT_TO_FRONT;
+ // Put animating stuff above this line and put static stuff below it.
+ int zSplitLine = info.getChanges().size();
+ // changes should be ordered top-to-bottom in z
+ final int mode = change.getMode();
+
+ // Don't move anything that isn't independent within its parents
+ if (!TransitionInfo.isIndependent(change, info)) {
+ if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT || mode == TRANSIT_CHANGE) {
+ t.show(leash);
+ t.setPosition(leash, change.getEndRelOffset().x, change.getEndRelOffset().y);
+ }
+ return;
+ }
+
+ boolean hasParent = change.getParent() != null;
+
+ if (!hasParent) {
+ t.reparent(leash, info.getRootLeash());
+ t.setPosition(leash, change.getStartAbsBounds().left - info.getRootOffset().x,
+ change.getStartAbsBounds().top - info.getRootOffset().y);
+ }
+ t.show(leash);
+ // Put all the OPEN/SHOW on top
+ if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT) {
+ if (isOpening) {
+ t.setLayer(leash, zSplitLine + info.getChanges().size() - layer);
+ if ((change.getFlags() & FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT) == 0) {
+ // if transferred, it should be left visible.
+ t.setAlpha(leash, 0.f);
+ }
+ } else {
+ // put on bottom and leave it visible
+ t.setLayer(leash, zSplitLine - layer);
+ }
+ } else if (mode == TRANSIT_CLOSE || mode == TRANSIT_TO_BACK) {
+ if (isOpening) {
+ // put on bottom and leave visible
+ t.setLayer(leash, zSplitLine - layer);
+ } else {
+ // put on top
+ t.setLayer(leash, zSplitLine + info.getChanges().size() - layer);
+ }
+ } else { // CHANGE
+ t.setLayer(leash, zSplitLine + info.getChanges().size() - layer);
+ }
+ }
+
+ @SuppressLint("NewApi")
+ private static SurfaceControl createLeash(TransitionInfo info, TransitionInfo.Change change,
+ int order, SurfaceControl.Transaction t) {
+ // TODO: once we can properly sync transactions across process, then get rid of this leash.
+ if (change.getParent() != null && (change.getFlags() & FLAG_IS_WALLPAPER) != 0) {
+ // Special case for wallpaper atm. Normally these are left alone; but, a quirk of
+ // making leashes means we have to handle them specially.
+ return change.getLeash();
+ }
+ SurfaceControl leashSurface = new SurfaceControl.Builder()
+ .setName(change.getLeash().toString() + "_transition-leash")
+ .setContainerLayer().setParent(change.getParent() == null ? info.getRootLeash()
+ : info.getChange(change.getParent()).getLeash()).build();
+ // Copied Transitions setup code (which expects bottom-to-top order, so we swap here)
+ setupLeash(leashSurface, change, info.getChanges().size() - order, info, t);
+ t.reparent(change.getLeash(), leashSurface);
+ t.setAlpha(change.getLeash(), 1.0f);
+ t.show(change.getLeash());
+ t.setPosition(change.getLeash(), 0, 0);
+ t.setLayer(change.getLeash(), 0);
+ return leashSurface;
+ }
+
+ public RemoteAnimationTargetCompat(TransitionInfo.Change change, int order,
+ TransitionInfo info, SurfaceControl.Transaction t) {
taskId = change.getTaskInfo() != null ? change.getTaskInfo().taskId : -1;
mode = newModeToLegacyMode(change.getMode());
- leash = new SurfaceControlCompat(change.getLeash());
+
+ // TODO: once we can properly sync transactions across process, then get rid of this leash.
+ leash = new SurfaceControlCompat(createLeash(info, change, order, t));
+
isTranslucent = (change.getFlags() & TransitionInfo.FLAG_TRANSLUCENT) != 0
|| (change.getFlags() & TransitionInfo.FLAG_SHOW_WALLPAPER) != 0;
clipRect = null;
@@ -139,15 +233,21 @@
*
* @param wallpapers If true, this will return wallpaper targets; otherwise it returns
* non-wallpaper targets.
+ * @param leashMap Temporary map of change leash -> launcher leash. Is an output, so should be
+ * populated by this function. If null, it is ignored.
*/
- public static RemoteAnimationTargetCompat[] wrap(TransitionInfo info, boolean wallpapers) {
+ public static RemoteAnimationTargetCompat[] wrap(TransitionInfo info, boolean wallpapers,
+ SurfaceControl.Transaction t, ArrayMap<SurfaceControl, SurfaceControl> leashMap) {
final ArrayList<RemoteAnimationTargetCompat> out = new ArrayList<>();
for (int i = 0; i < info.getChanges().size(); i++) {
boolean changeIsWallpaper =
(info.getChanges().get(i).getFlags() & TransitionInfo.FLAG_IS_WALLPAPER) != 0;
if (wallpapers != changeIsWallpaper) continue;
out.add(new RemoteAnimationTargetCompat(info.getChanges().get(i),
- info.getChanges().size() - i));
+ info.getChanges().size() - i, info, t));
+ if (leashMap == null) continue;
+ leashMap.put(info.getChanges().get(i).getLeash(),
+ out.get(out.size() - 1).leash.mSurfaceControl);
}
return out.toArray(new RemoteAnimationTargetCompat[out.size()]);
}
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 1729997a..653d730 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
@@ -29,6 +29,7 @@
import android.os.IBinder;
import android.os.Parcelable;
import android.os.RemoteException;
+import android.util.ArrayMap;
import android.util.Log;
import android.view.IRecentsAnimationController;
import android.view.SurfaceControl;
@@ -108,10 +109,11 @@
public void startAnimation(IBinder transition, TransitionInfo info,
SurfaceControl.Transaction t,
IRemoteTransitionFinishedCallback finishedCallback) {
+ final ArrayMap<SurfaceControl, SurfaceControl> leashMap = new ArrayMap<>();
final RemoteAnimationTargetCompat[] apps =
- RemoteAnimationTargetCompat.wrap(info, false /* wallpapers */);
+ RemoteAnimationTargetCompat.wrap(info, false /* wallpapers */, t, leashMap);
final RemoteAnimationTargetCompat[] wallpapers =
- RemoteAnimationTargetCompat.wrap(info, true /* wallpapers */);
+ RemoteAnimationTargetCompat.wrap(info, true /* wallpapers */, t, leashMap);
// TODO(b/177438007): Move this set-up logic into launcher's animation impl.
mToken = transition;
// This transition is for opening recents, so recents is on-top. We want to draw
@@ -120,7 +122,8 @@
for (int i = info.getChanges().size() - 1; i >= 0; --i) {
final TransitionInfo.Change change = info.getChanges().get(i);
if (change.getMode() == TRANSIT_CLOSE || change.getMode() == TRANSIT_TO_BACK) {
- t.setLayer(change.getLeash(), info.getChanges().size() * 3 - i);
+ t.setLayer(leashMap.get(change.getLeash()),
+ info.getChanges().size() * 3 - i);
if (change.getTaskInfo() != null) {
pausingTask = change.getTaskInfo().token;
}
@@ -131,7 +134,8 @@
t.setAlpha(wallpapers[i].leash.mSurfaceControl, 1);
}
t.apply();
- mRecentsSession.setup(controller, info, finishedCallback, pausingTask);
+ mRecentsSession.setup(controller, info, finishedCallback, pausingTask,
+ leashMap);
recents.onAnimationStart(mRecentsSession, apps, wallpapers, new Rect(0, 0, 0, 0),
new Rect());
}
@@ -173,9 +177,11 @@
private WindowContainerToken mPausingTask = null;
private TransitionInfo mInfo = null;
private SurfaceControl mOpeningLeash = null;
+ private ArrayMap<SurfaceControl, SurfaceControl> mLeashMap = null;
void setup(RecentsAnimationControllerCompat wrapped, TransitionInfo info,
- IRemoteTransitionFinishedCallback finishCB, WindowContainerToken pausingTask) {
+ IRemoteTransitionFinishedCallback finishCB, WindowContainerToken pausingTask,
+ ArrayMap<SurfaceControl, SurfaceControl> leashMap) {
if (mInfo != null) {
throw new IllegalStateException("Trying to run a new recents animation while"
+ " recents is already active.");
@@ -184,6 +190,7 @@
mInfo = info;
mFinishCB = finishCB;
mPausingTask = pausingTask;
+ mLeashMap = leashMap;
}
@SuppressLint("NewApi")
@@ -211,11 +218,14 @@
}
// We are receiving a new opening task, so convert to onTaskAppeared.
final int layer = mInfo.getChanges().size() * 3;
- t.reparent(mOpeningLeash, mInfo.getRootLeash());
- t.setLayer(mOpeningLeash, layer);
- t.hide(mOpeningLeash);
+ final RemoteAnimationTargetCompat target = new RemoteAnimationTargetCompat(
+ openingTask, layer, mInfo, t);
+ mLeashMap.put(mOpeningLeash, target.leash.mSurfaceControl);
+ t.reparent(target.leash.mSurfaceControl, mInfo.getRootLeash());
+ t.setLayer(target.leash.mSurfaceControl, layer);
+ t.hide(target.leash.mSurfaceControl);
t.apply();
- recents.onTaskAppeared(new RemoteAnimationTargetCompat(openingTask, layer));
+ recents.onTaskAppeared(target);
return true;
}
@@ -272,6 +282,12 @@
}
// Release surface references now. This is apparently to free GPU
// memory while doing quick operations (eg. during CTS).
+ SurfaceControl.Transaction t = new SurfaceControl.Transaction();
+ for (int i = 0; i < mLeashMap.size(); ++i) {
+ if (mLeashMap.keyAt(i) == mLeashMap.valueAt(i)) continue;
+ t.remove(mLeashMap.valueAt(i));
+ }
+ t.apply();
for (int i = 0; i < mInfo.getChanges().size(); ++i) {
mInfo.getChanges().get(i).getLeash().release();
}
@@ -281,6 +297,7 @@
mPausingTask = null;
mInfo = null;
mOpeningLeash = null;
+ mLeashMap = null;
}
@Override public void setDeferCancelUntilNextTransition(boolean defer, boolean screenshot) {
diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
index 7127444..0ea01fd 100644
--- a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
+++ b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java
@@ -45,6 +45,7 @@
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.phone.dagger.StatusBarComponent;
+import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.util.ViewController;
@@ -68,6 +69,7 @@
@NonNull private final FalsingManager mFalsingManager;
@NonNull private final AuthController mAuthController;
@NonNull private final AccessibilityManager mAccessibilityManager;
+ @NonNull private final ConfigurationController mConfigurationController;
private boolean mHasUdfpsOrFaceAuthFeatures;
private boolean mUdfpsEnrolled;
@@ -103,7 +105,8 @@
@NonNull FalsingManager falsingManager,
@NonNull AuthController authController,
@NonNull DumpManager dumpManager,
- @NonNull AccessibilityManager accessibilityManager
+ @NonNull AccessibilityManager accessibilityManager,
+ @NonNull ConfigurationController configurationController
) {
super(view);
mStatusBarStateController = statusBarStateController;
@@ -113,6 +116,7 @@
mKeyguardStateController = keyguardStateController;
mFalsingManager = falsingManager;
mAccessibilityManager = accessibilityManager;
+ mConfigurationController = configurationController;
final Context context = view.getContext();
mButton = context.getResources().getDrawable(
@@ -178,10 +182,8 @@
mCanDismissLockScreen = mKeyguardStateController.canDismissLockScreen();
mStatusBarState = mStatusBarStateController.getState();
- mUnlockIcon.setTint(Utils.getColorAttrDefaultColor(mView.getContext(),
- R.attr.wallpaperTextColorAccent));
- mLockIcon.setTint(Utils.getColorAttrDefaultColor(mView.getContext(),
- R.attr.wallpaperTextColorAccent));
+ updateColors();
+ mConfigurationController.addCallback(mConfigurationListener);
mKeyguardUpdateMonitor.registerCallback(mKeyguardUpdateMonitorCallback);
mStatusBarStateController.addCallback(mStatusBarStateListener);
@@ -194,6 +196,7 @@
@Override
protected void onViewDetached() {
+ mConfigurationController.removeCallback(mConfigurationListener);
mKeyguardUpdateMonitor.removeCallback(mKeyguardUpdateMonitorCallback);
mStatusBarStateController.removeCallback(mStatusBarStateListener);
mKeyguardStateController.removeCallback(mKeyguardStateCallback);
@@ -306,6 +309,13 @@
&& !mKeyguardStateController.isKeyguardGoingAway();
}
+ private void updateColors() {
+ final int color = Utils.getColorAttrDefaultColor(mView.getContext(),
+ R.attr.wallpaperTextColorAccent);
+ mUnlockIcon.setTint(color);
+ mLockIcon.setTint(color);
+ }
+
@Override
public void dump(@NonNull FileDescriptor fd, @NonNull PrintWriter pw, @NonNull String[] args) {
pw.println(" mShowBouncerButton: " + mShowButton);
@@ -385,6 +395,24 @@
}
};
+ private final ConfigurationController.ConfigurationListener mConfigurationListener =
+ new ConfigurationController.ConfigurationListener() {
+ @Override
+ public void onUiModeChanged() {
+ updateColors();
+ }
+
+ @Override
+ public void onThemeChanged() {
+ updateColors();
+ }
+
+ @Override
+ public void onOverlayChanged() {
+ updateColors();
+ }
+ };
+
private final AccessibilityManager.TouchExplorationStateChangeListener
mTouchExplorationStateChangeListener = enabled -> updateClickListener();
}
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java b/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java
index 9f77b7d..ee7eb4b 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java
@@ -22,14 +22,17 @@
import android.annotation.UiContext;
import android.content.Context;
import android.content.pm.ActivityInfo;
+import android.graphics.Insets;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.UserHandle;
import android.provider.Settings;
+import android.util.MathUtils;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
+import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
import android.view.accessibility.AccessibilityManager;
@@ -38,6 +41,7 @@
import android.widget.ImageView;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.graphics.SfVsyncFrameCallbackProvider;
import com.android.systemui.R;
import java.util.Collections;
@@ -45,8 +49,8 @@
/**
* Shows/hides a {@link android.widget.ImageView} on the screen and changes the values of
* {@link Settings.Secure#ACCESSIBILITY_MAGNIFICATION_MODE} when the UI is toggled.
- * The button icon is movable by dragging. And the button UI would automatically be dismissed after
- * displaying for a period of time.
+ * The button icon is movable by dragging and it would not overlap navigation bar window.
+ * And the button UI would automatically be dismissed after displaying for a period of time.
*/
class MagnificationModeSwitch implements MagnificationGestureDetector.OnGestureListener {
@@ -64,25 +68,30 @@
private final AccessibilityManager mAccessibilityManager;
private final WindowManager mWindowManager;
private final ImageView mImageView;
+ private final Runnable mWindowInsetChangeRunnable;
+ private final SfVsyncFrameCallbackProvider mSfVsyncFrameProvider;
private int mMagnificationMode = Settings.Secure.ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN;
private final LayoutParams mParams;
+ @VisibleForTesting
+ final Rect mDraggableWindowBounds = new Rect();
private boolean mIsVisible = false;
private final MagnificationGestureDetector mGestureDetector;
private boolean mSingleTapDetected = false;
+ private boolean mToLeftScreenEdge = false;
MagnificationModeSwitch(@UiContext Context context) {
- this(context, createView(context));
+ this(context, createView(context), new SfVsyncFrameCallbackProvider());
}
@VisibleForTesting
- MagnificationModeSwitch(Context context, @NonNull ImageView imageView) {
+ MagnificationModeSwitch(Context context, @NonNull ImageView imageView,
+ SfVsyncFrameCallbackProvider sfVsyncFrameProvider) {
mContext = context;
mAccessibilityManager = mContext.getSystemService(AccessibilityManager.class);
- mWindowManager = (WindowManager) mContext.getSystemService(
- Context.WINDOW_SERVICE);
+ mWindowManager = mContext.getSystemService(WindowManager.class);
+ mSfVsyncFrameProvider = sfVsyncFrameProvider;
mParams = createLayoutParams(context);
mImageView = imageView;
- applyResourcesValues();
mImageView.setOnTouchListener(this::onTouch);
mImageView.setAccessibilityDelegate(new View.AccessibilityDelegate() {
@Override
@@ -107,6 +116,15 @@
return super.performAccessibilityAction(host, action, args);
}
});
+ mWindowInsetChangeRunnable = this::onWindowInsetChanged;
+ mImageView.setOnApplyWindowInsetsListener((v, insets) -> {
+ // Adds a pending post check to avoiding redundant calculation because this callback
+ // is sent frequently when the switch icon window dragged by the users.
+ if (!mImageView.getHandler().hasCallbacks(mWindowInsetChangeRunnable)) {
+ mImageView.getHandler().post(mWindowInsetChangeRunnable);
+ }
+ return v.onApplyWindowInsets(insets);
+ });
mFadeInAnimationTask = () -> {
mImageView.animate()
@@ -133,11 +151,17 @@
return mContext.getResources().getString(stringId);
}
- private void applyResourcesValues() {
- final int padding = mContext.getResources().getDimensionPixelSize(
- R.dimen.magnification_switch_button_padding);
- mImageView.setPadding(padding, padding, padding, padding);
- mImageView.setImageResource(getIconResId(mMagnificationMode));
+ private void applyResourcesValuesWithDensityChanged() {
+ final int size = mContext.getResources().getDimensionPixelSize(
+ R.dimen.magnification_switch_button_size);
+ mParams.height = size;
+ mParams.width = size;
+ if (mIsVisible) {
+ stickToScreenEdge(mToLeftScreenEdge);
+ // Reset button to make its window layer always above the mirror window.
+ removeButton();
+ showButton(mMagnificationMode, /* resetPosition= */false);
+ }
}
private boolean onTouch(View v, MotionEvent event) {
@@ -168,6 +192,12 @@
@Override
public boolean onFinish(float xOffset, float yOffset) {
+ if (mIsVisible) {
+ final int windowWidth = mWindowManager.getCurrentWindowMetrics().getBounds().width();
+ final int halfWindowWidth = windowWidth / 2;
+ mToLeftScreenEdge = (mParams.x < halfWindowWidth);
+ stickToScreenEdge(mToLeftScreenEdge);
+ }
if (!mSingleTapDetected) {
showButton(mMagnificationMode);
}
@@ -175,10 +205,18 @@
return true;
}
+ private void stickToScreenEdge(boolean toLeftScreenEdge) {
+ mParams.x = toLeftScreenEdge
+ ? mDraggableWindowBounds.left : mDraggableWindowBounds.right;
+ updateButtonViewLayoutIfNeeded();
+ }
+
private void moveButton(float offsetX, float offsetY) {
- mParams.x -= offsetX;
- mParams.y -= offsetY;
- mWindowManager.updateViewLayout(mImageView, mParams);
+ mSfVsyncFrameProvider.postFrameCallback(l -> {
+ mParams.x += offsetX;
+ mParams.y += offsetY;
+ updateButtonViewLayoutIfNeeded();
+ });
}
void removeButton() {
@@ -193,16 +231,32 @@
mImageView.setAlpha(0f);
mWindowManager.removeView(mImageView);
mIsVisible = false;
- mParams.x = 0;
- mParams.y = 0;
}
void showButton(int mode) {
+ showButton(mode, true);
+ }
+
+ /**
+ * Shows magnification switch button for the specified magnification mode.
+ * When the button is going to be visible by calling this method, the layout position can be
+ * reset depending on the flag.
+ *
+ * @param mode The magnification mode
+ * @param resetPosition if the button position needs be reset
+ */
+ private void showButton(int mode, boolean resetPosition) {
if (mMagnificationMode != mode) {
mMagnificationMode = mode;
mImageView.setImageResource(getIconResId(mode));
}
if (!mIsVisible) {
+ if (resetPosition) {
+ mDraggableWindowBounds.set(getDraggableWindowBounds());
+ mParams.x = mDraggableWindowBounds.right;
+ mParams.y = mDraggableWindowBounds.bottom;
+ mToLeftScreenEdge = false;
+ }
mWindowManager.addView(mImageView, mParams);
// Exclude magnification switch button from system gesture area.
setSystemGestureExclusion();
@@ -229,12 +283,7 @@
void onConfigurationChanged(int configDiff) {
if ((configDiff & ActivityInfo.CONFIG_DENSITY) != 0) {
- applyResourcesValues();
- if (mIsVisible) {
- mWindowManager.updateViewLayout(mImageView, mParams);
- // Exclude magnification switch button from system gesture area.
- setSystemGestureExclusion();
- }
+ applyResourcesValuesWithDensityChanged();
return;
}
if ((configDiff & ActivityInfo.CONFIG_LOCALE) != 0) {
@@ -243,6 +292,25 @@
}
}
+ private void onWindowInsetChanged() {
+ final Rect newBounds = getDraggableWindowBounds();
+ if (mDraggableWindowBounds.equals(newBounds)) {
+ return;
+ }
+ mDraggableWindowBounds.set(newBounds);
+ stickToScreenEdge(mToLeftScreenEdge);
+ }
+
+ private void updateButtonViewLayoutIfNeeded() {
+ if (mIsVisible) {
+ mParams.x = MathUtils.constrain(mParams.x, mDraggableWindowBounds.left,
+ mDraggableWindowBounds.right);
+ mParams.y = MathUtils.constrain(mParams.y, mDraggableWindowBounds.top,
+ mDraggableWindowBounds.bottom);
+ mWindowManager.updateViewLayout(mImageView, mParams);
+ }
+ }
+
private void updateAccessibilityWindowTitle() {
mParams.accessibilityTitle = getAccessibilityWindowTitle(mContext);
if (mIsVisible) {
@@ -283,17 +351,34 @@
}
private static LayoutParams createLayoutParams(Context context) {
+ final int size = context.getResources().getDimensionPixelSize(
+ R.dimen.magnification_switch_button_size);
final LayoutParams params = new LayoutParams(
- LayoutParams.WRAP_CONTENT,
- LayoutParams.WRAP_CONTENT,
+ size,
+ size,
LayoutParams.TYPE_ACCESSIBILITY_MAGNIFICATION_OVERLAY,
LayoutParams.FLAG_NOT_FOCUSABLE,
PixelFormat.TRANSPARENT);
- params.gravity = Gravity.BOTTOM | Gravity.RIGHT;
+ params.gravity = Gravity.TOP | Gravity.LEFT;
params.accessibilityTitle = getAccessibilityWindowTitle(context);
return params;
}
+ private Rect getDraggableWindowBounds() {
+ final int layoutMargin = mContext.getResources().getDimensionPixelSize(
+ R.dimen.magnification_switch_button_margin);
+ final Rect boundRect = new Rect(mWindowManager.getCurrentWindowMetrics().getBounds());
+ final Insets systemBars =
+ mWindowManager.getCurrentWindowMetrics().getWindowInsets()
+ .getInsetsIgnoringVisibility(WindowInsets.Type.systemBars());
+ final Rect insets = new Rect(layoutMargin,
+ systemBars.top + layoutMargin,
+ mParams.width + layoutMargin,
+ mParams.height + layoutMargin + systemBars.bottom);
+ boundRect.inset(insets);
+ return boundRect;
+ }
+
private static String getAccessibilityWindowTitle(Context context) {
return context.getString(com.android.internal.R.string.android_system_label);
}
@@ -305,5 +390,4 @@
new Rect(0, 0, mImageView.getWidth(), mImageView.getHeight())));
});
}
-
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardDrawable.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardDrawable.java
index 6f7e6c3..8894093 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardDrawable.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardDrawable.java
@@ -69,7 +69,8 @@
mHintAnimator.setInterpolator(Interpolators.FAST_OUT_SLOW_IN);
mHintAnimator.addUpdateListener(anim -> setStrokeWidth((float) anim.getAnimatedValue()));
- mLockScreenColor = Utils.getColorAttrDefaultColor(mContext, R.attr.wallpaperTextColor);
+ mLockScreenColor = Utils.getColorAttrDefaultColor(mContext,
+ R.attr.wallpaperTextColorAccent);
mAmbientDisplayColor = Color.WHITE;
updateIcon();
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java
index 2f9f6bc..78588b2 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java
@@ -272,7 +272,7 @@
private void updateAlpha() {
// fade icon on transition to showing bouncer
int alpha = mShowingUdfpsBouncer ? 255
- : Math.abs((int) MathUtils.map(.4f, 0f, .7f, 255f,
+ : Math.abs((int) MathUtils.constrainedMap(0f, 255f, .4f, .7f,
mInputBouncerHiddenAmount));
mView.setUnpausedAlpha(alpha);
}
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java
index 0f202b0..9697369 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java
@@ -257,7 +257,9 @@
@Override
public void onTouchEvent(MotionEvent ev) {
- if (!mKeyguardStateController.isShowing() || mStatusBarStateController.isDozing()) {
+ if (!mKeyguardStateController.isShowing()
+ || (mStatusBarStateController.isDozing()
+ && !mStatusBarStateController.isPulsing())) {
avoidGesture();
return;
}
diff --git a/packages/SystemUI/src/com/android/systemui/controls/dagger/ControlsComponent.kt b/packages/SystemUI/src/com/android/systemui/controls/dagger/ControlsComponent.kt
index 5557c86..469e60a 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/dagger/ControlsComponent.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/dagger/ControlsComponent.kt
@@ -51,7 +51,6 @@
private val userTracker: UserTracker,
private val secureSettings: SecureSettings
) {
-
private val contentResolver: ContentResolver
get() = context.contentResolver
@@ -66,7 +65,7 @@
init {
if (featureEnabled) {
secureSettings.registerContentObserver(
- Settings.Secure.getUriFor(Settings.Secure.POWER_MENU_LOCKED_SHOW_CONTENT),
+ Settings.Secure.getUriFor(Settings.Secure.LOCKSCREEN_SHOW_CONTROLS),
false, /* notifyForDescendants */
showWhileLockedObserver
)
@@ -116,7 +115,7 @@
private fun updateShowWhileLocked() {
canShowWhileLockedSetting = secureSettings.getInt(
- Settings.Secure.POWER_MENU_LOCKED_SHOW_CONTENT, 0) != 0
+ Settings.Secure.LOCKSCREEN_SHOW_CONTROLS, 0) != 0
}
enum class Visibility {
diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt
index b15bb45..47e749c 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlViewHolder.kt
@@ -47,6 +47,7 @@
import android.widget.ImageView
import android.widget.TextView
import androidx.annotation.ColorInt
+import androidx.annotation.VisibleForTesting
import com.android.internal.graphics.ColorUtils
import com.android.systemui.R
import com.android.systemui.animation.Interpolators
@@ -454,7 +455,8 @@
}
}
- private fun updateStatusRow(
+ @VisibleForTesting
+ internal fun updateStatusRow(
enabled: Boolean,
text: CharSequence,
drawable: Drawable,
@@ -469,11 +471,8 @@
status.setTextColor(color)
control?.getCustomIcon()?.let {
- // do not tint custom icons, assume the intended icon color is correct
- if (icon.imageTintList != null) {
- icon.imageTintList = null
- }
icon.setImageIcon(it)
+ icon.imageTintList = it.tintList
} ?: run {
if (drawable is StateListDrawable) {
// Only reset the drawable if it is a different resource, as it will interfere
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarOverlayController.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarOverlayController.java
index 40f908b..9f2fb50 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarOverlayController.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarOverlayController.java
@@ -17,6 +17,7 @@
package com.android.systemui.navigationbar;
import android.content.Context;
+import android.graphics.Rect;
import android.view.View;
import com.android.systemui.dagger.SysUISingleton;
@@ -47,7 +48,8 @@
/**
* Initialize the controller with visibility change callback.
*/
- public void init(Consumer<Boolean> visibilityChangeCallback) {}
+ public void init(Consumer<Boolean> visibilityChangeCallback,
+ Consumer<Rect> excludeBackRegionCallback) {}
/**
* Set whether the view can be shown.
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
index fcbd596..7af4853 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
@@ -323,10 +323,6 @@
mOverviewProxyService = Dependency.get(OverviewProxyService.class);
mRecentsOnboarding = new RecentsOnboarding(context, mOverviewProxyService);
- mNavBarOverlayController = Dependency.get(NavigationBarOverlayController.class);
- if (mNavBarOverlayController.isNavigationBarOverlayEnabled()) {
- mNavBarOverlayController.init(mNavbarOverlayVisibilityChangeCallback);
- }
mConfiguration = new Configuration();
mTmpLastConfiguration = new Configuration();
@@ -371,6 +367,12 @@
return isGesturalModeOnDefaultDisplay(getContext(), mNavBarMode);
}
});
+
+ mNavBarOverlayController = Dependency.get(NavigationBarOverlayController.class);
+ if (mNavBarOverlayController.isNavigationBarOverlayEnabled()) {
+ mNavBarOverlayController.init(mNavbarOverlayVisibilityChangeCallback,
+ mEdgeBackGestureHandler::updateNavigationBarOverlayExcludeRegion);
+ }
}
public void setAutoHideController(AutoHideController autoHideController) {
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/gestural/EdgeBackGestureHandler.java b/packages/SystemUI/src/com/android/systemui/navigationbar/gestural/EdgeBackGestureHandler.java
index fc615de..be513f3 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/gestural/EdgeBackGestureHandler.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/gestural/EdgeBackGestureHandler.java
@@ -187,6 +187,7 @@
private final Executor mMainExecutor;
private final Rect mPipExcludedBounds = new Rect();
+ private final Rect mNavBarOverlayExcludedBounds = new Rect();
private final Region mExcludeRegion = new Region();
private final Region mUnrestrictedExcludeRegion = new Region();
@@ -366,6 +367,10 @@
mTouchSlop = mViewConfiguration.getScaledTouchSlop() * backGestureSlop;
}
+ public void updateNavigationBarOverlayExcludeRegion(Rect exclude) {
+ mNavBarOverlayExcludedBounds.set(exclude);
+ }
+
private void onNavigationSettingsChanged() {
boolean wasBackAllowed = isHandlingGestures();
updateCurrentUserResources();
@@ -629,8 +634,9 @@
return false;
}
- // If the point is inside the PiP excluded bounds, then drop it.
- if (mPipExcludedBounds.contains(x, y)) {
+ // If the point is inside the PiP or Nav bar overlay excluded bounds, then ignore the back
+ // gesture
+ if (mPipExcludedBounds.contains(x, y) || mNavBarOverlayExcludedBounds.contains(x, y)) {
return false;
}
@@ -893,6 +899,7 @@
pw.println(" mExcludeRegion=" + mExcludeRegion);
pw.println(" mUnrestrictedExcludeRegion=" + mUnrestrictedExcludeRegion);
pw.println(" mPipExcludedBounds=" + mPipExcludedBounds);
+ pw.println(" mNavBarOverlayExcludedBounds=" + mNavBarOverlayExcludedBounds);
pw.println(" mEdgeWidthLeft=" + mEdgeWidthLeft);
pw.println(" mEdgeWidthRight=" + mEdgeWidthRight);
pw.println(" mLeftInset=" + mLeftInset);
diff --git a/packages/SystemUI/src/com/android/systemui/people/PeopleStoryIconFactory.java b/packages/SystemUI/src/com/android/systemui/people/PeopleStoryIconFactory.java
index 81df107..f3cb359 100644
--- a/packages/SystemUI/src/com/android/systemui/people/PeopleStoryIconFactory.java
+++ b/packages/SystemUI/src/com/android/systemui/people/PeopleStoryIconFactory.java
@@ -28,7 +28,6 @@
import android.graphics.drawable.Drawable;
import android.util.IconDrawableFactory;
import android.util.Log;
-import android.util.TypedValue;
import com.android.settingslib.Utils;
import com.android.systemui.R;
@@ -37,7 +36,7 @@
private static final int PADDING = 2;
private static final int RING_WIDTH = 2;
- private static final int MAX_BADGE_SIZE = 36;
+ private static final int MAX_BADGE_SIZE = 40;
final PackageManager mPackageManager;
final IconDrawableFactory mIconDrawableFactory;
@@ -51,15 +50,15 @@
PeopleStoryIconFactory(Context context, PackageManager pm,
IconDrawableFactory iconDrawableFactory, int iconSizeDp) {
+ context.setTheme(android.R.style.Theme_DeviceDefault_DayNight);
mIconBitmapSize = (int) (iconSizeDp * context.getResources().getDisplayMetrics().density);
mDensity = context.getResources().getDisplayMetrics().density;
mIconSize = mDensity * iconSizeDp;
mPackageManager = pm;
mIconDrawableFactory = iconDrawableFactory;
mImportantConversationColor = context.getColor(R.color.important_conversation);
- TypedValue typedValue = new TypedValue();
- context.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true);
- mAccentColor = context.getColor(typedValue.resourceId);
+ mAccentColor = Utils.getColorAttr(context,
+ com.android.internal.R.attr.colorAccentPrimary).getDefaultColor();
mContext = context;
}
diff --git a/packages/SystemUI/src/com/android/systemui/people/PeopleTileViewHelper.java b/packages/SystemUI/src/com/android/systemui/people/PeopleTileViewHelper.java
index 9fc9cad..59c7fd1 100644
--- a/packages/SystemUI/src/com/android/systemui/people/PeopleTileViewHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/people/PeopleTileViewHelper.java
@@ -55,6 +55,7 @@
import android.util.IconDrawableFactory;
import android.util.Log;
import android.util.Pair;
+import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.widget.RemoteViews;
@@ -87,7 +88,6 @@
private static final int DAYS_IN_A_WEEK = 7;
private static final int ONE_DAY = 1;
- private static final int MAX_WEEKS = 2;
public static final int LAYOUT_SMALL = 0;
public static final int LAYOUT_MEDIUM = 1;
@@ -95,10 +95,11 @@
private static final int MIN_CONTENT_MAX_LINES = 2;
- private static final int FIXED_HEIGHT_DIMENS_FOR_LARGE_CONTENT = 14 + 12 + 4 + 16;
+ private static final int FIXED_HEIGHT_DIMENS_FOR_LARGE_NOTIF_CONTENT = 16 + 22 + 8 + 16;
+ private static final int FIXED_HEIGHT_DIMENS_FOR_LARGE_STATUS_CONTENT = 16 + 16 + 24 + 4 + 16;
private static final int MIN_MEDIUM_VERTICAL_PADDING = 4;
private static final int MAX_MEDIUM_PADDING = 16;
- private static final int FIXED_HEIGHT_DIMENS_FOR_MEDIUM_CONTENT_BEFORE_PADDING = 4 + 4;
+ private static final int FIXED_HEIGHT_DIMENS_FOR_MEDIUM_CONTENT_BEFORE_PADDING = 8 + 4;
private static final int FIXED_HEIGHT_DIMENS_FOR_SMALL = 6 + 4 + 8;
private static final int FIXED_WIDTH_DIMENS_FOR_SMALL = 4 + 4;
@@ -276,12 +277,15 @@
}
private void setMaxLines(RemoteViews views, boolean showSender) {
- int textSize = mLayoutSize == LAYOUT_LARGE ? getSizeInDp(
- R.dimen.content_text_size_for_large)
- : getSizeInDp(R.dimen.content_text_size_for_medium);
- int lineHeight = getLineHeight(textSize);
- int notificationContentHeight = getContentHeightForLayout(lineHeight);
- int maxAdaptiveLines = Math.floorDiv(notificationContentHeight, lineHeight);
+ int nameHeight = getLineHeightFromResource(R.dimen.name_text_size_for_content);
+ boolean isStatusLayout =
+ views.getLayoutId() == R.layout.people_tile_large_with_status_content;
+ int contentHeight = getContentHeightForLayout(nameHeight, isStatusLayout);
+ int textSizeResId = mLayoutSize == LAYOUT_LARGE
+ ? R.dimen.content_text_size_for_large
+ : R.dimen.content_text_size_for_medium;
+ int lineHeight = getLineHeightFromResource(textSizeResId);
+ int maxAdaptiveLines = Math.floorDiv(contentHeight, lineHeight);
int maxLines = Math.max(MIN_CONTENT_MAX_LINES, maxAdaptiveLines);
// Save a line for sender's name, if present.
@@ -289,10 +293,12 @@
views.setInt(R.id.text_content, "setMaxLines", maxLines);
}
- private int getLineHeight(int textSize) {
+ private int getLineHeightFromResource(int resId) {
try {
TextView text = new TextView(mContext);
- text.setTextSize(textSize);
+ text.setTextSize(TypedValue.COMPLEX_UNIT_PX,
+ mContext.getResources().getDimension(resId));
+ text.setTextAppearance(android.R.style.TextAppearance_DeviceDefault);
int lineHeight = (int) (text.getLineHeight() / mDensity);
return lineHeight;
} catch (Exception e) {
@@ -310,15 +316,17 @@
return (int) (context.getResources().getDimension(dimenResourceId) / density);
}
- private int getContentHeightForLayout(int lineHeight) {
+ private int getContentHeightForLayout(int lineHeight, boolean hasPredefinedIcon) {
switch (mLayoutSize) {
case LAYOUT_MEDIUM:
return mHeight - (lineHeight + FIXED_HEIGHT_DIMENS_FOR_MEDIUM_CONTENT_BEFORE_PADDING
+ mMediumVerticalPadding * 2);
case LAYOUT_LARGE:
+ int fixedHeight = hasPredefinedIcon ? FIXED_HEIGHT_DIMENS_FOR_LARGE_STATUS_CONTENT
+ : FIXED_HEIGHT_DIMENS_FOR_LARGE_NOTIF_CONTENT;
return mHeight - (getSizeInDp(
R.dimen.max_people_avatar_size_for_large_content) + lineHeight
- + FIXED_HEIGHT_DIMENS_FOR_LARGE_CONTENT);
+ + fixedHeight);
default:
return -1;
}
@@ -326,7 +334,7 @@
/** Calculates the best layout relative to the size in {@code options}. */
private int getLayoutSize() {
- if (mHeight >= getSizeInDp(R.dimen.required_width_for_large)
+ if (mHeight >= getSizeInDp(R.dimen.required_height_for_large)
&& mWidth >= getSizeInDp(R.dimen.required_width_for_large)) {
if (DEBUG) Log.d(TAG, "Large view for mWidth: " + mWidth + " mHeight: " + mHeight);
return LAYOUT_LARGE;
@@ -334,8 +342,9 @@
// Small layout used below a certain minimum mWidth with any mHeight.
if (mWidth >= getSizeInDp(R.dimen.required_width_for_medium)) {
int spaceAvailableForPadding =
- mHeight - (getSizeInDp(R.dimen.avatar_size_for_medium) + 4 + getLineHeight(
- getSizeInDp(R.dimen.name_text_size_for_medium)));
+ mHeight - (getSizeInDp(R.dimen.avatar_size_for_medium)
+ + getLineHeightFromResource(
+ R.dimen.name_text_size_for_content));
if (DEBUG) {
Log.d(TAG, "Medium view for mWidth: " + mWidth + " mHeight: " + mHeight
+ " with padding space: " + spaceAvailableForPadding);
@@ -365,26 +374,32 @@
// Calculate adaptive avatar size for remaining layouts.
if (layoutId == R.layout.people_tile_small) {
int avatarHeightSpace = mHeight - (FIXED_HEIGHT_DIMENS_FOR_SMALL + Math.max(18,
- getLineHeight(getSizeInDp(
- R.dimen.name_text_size_for_small))));
+ getLineHeightFromResource(
+ R.dimen.name_text_size_for_small)));
int avatarWidthSpace = mWidth - FIXED_WIDTH_DIMENS_FOR_SMALL;
avatarSize = Math.min(avatarHeightSpace, avatarWidthSpace);
}
- if (layoutId == R.layout.people_tile_large_with_content) {
- avatarSize = mHeight - (FIXED_HEIGHT_DIMENS_FOR_LARGE_CONTENT + (getLineHeight(
- getSizeInDp(R.dimen.content_text_size_for_large))
- * 3));
+ if (layoutId == R.layout.people_tile_large_with_notification_content) {
+ avatarSize = mHeight - (FIXED_HEIGHT_DIMENS_FOR_LARGE_NOTIF_CONTENT + (
+ getLineHeightFromResource(
+ R.dimen.content_text_size_for_large)
+ * 3));
+ return Math.min(avatarSize, getSizeInDp(
+ R.dimen.max_people_avatar_size_for_large_content));
+ } else if (layoutId == R.layout.people_tile_large_with_status_content) {
+ avatarSize = mHeight - (FIXED_HEIGHT_DIMENS_FOR_LARGE_STATUS_CONTENT + (
+ getLineHeightFromResource(R.dimen.content_text_size_for_large)
+ * 3));
return Math.min(avatarSize, getSizeInDp(
R.dimen.max_people_avatar_size_for_large_content));
}
if (layoutId == R.layout.people_tile_large_empty) {
- int avatarHeightSpace = mHeight - (14 + 14 + getLineHeight(
- getSizeInDp(R.dimen.name_text_size_for_large))
- + getLineHeight(
- getSizeInDp(R.dimen.content_text_size_for_large))
- + 16 + 10 + 14);
+ int avatarHeightSpace = mHeight - (14 + 14 + getLineHeightFromResource(
+ R.dimen.name_text_size_for_large)
+ + getLineHeightFromResource(R.dimen.content_text_size_for_large)
+ + 16 + 10 + 16);
int avatarWidthSpace = mWidth - (14 + 14);
avatarSize = Math.min(avatarHeightSpace, avatarWidthSpace);
}
@@ -449,17 +464,28 @@
}
private RemoteViews createMissedCallRemoteViews() {
- RemoteViews views = getViewForContentLayout();
+ RemoteViews views = setViewForContentLayout(new RemoteViews(mContext.getPackageName(),
+ getLayoutForContent()));
views.setViewVisibility(R.id.predefined_icon, View.VISIBLE);
+ views.setViewVisibility(R.id.text_content, View.VISIBLE);
views.setViewVisibility(R.id.messages_count, View.GONE);
setMaxLines(views, false);
views.setTextViewText(R.id.text_content, mTile.getNotificationContent());
+ views.setColorAttr(R.id.text_content, "setTextColor", android.R.attr.colorError);
+ views.setColorAttr(R.id.predefined_icon, "setColorFilter", android.R.attr.colorError);
views.setImageViewResource(R.id.predefined_icon, R.drawable.ic_phone_missed);
+ if (mLayoutSize == LAYOUT_LARGE) {
+ views.setInt(R.id.content, "setGravity", Gravity.BOTTOM);
+ views.setViewLayoutHeightDimen(R.id.predefined_icon, R.dimen.large_predefined_icon);
+ views.setViewLayoutWidthDimen(R.id.predefined_icon, R.dimen.large_predefined_icon);
+ }
+ setAvailabilityDotPadding(views, R.dimen.availability_dot_notification_padding);
return views;
}
private RemoteViews createNotificationRemoteViews() {
- RemoteViews views = getViewForContentLayout();
+ RemoteViews views = setViewForContentLayout(new RemoteViews(mContext.getPackageName(),
+ getLayoutForNotificationContent()));
CharSequence sender = mTile.getNotificationSender();
Uri image = mTile.getNotificationDataUri();
if (image != null) {
@@ -474,6 +500,11 @@
views = decorateBackground(views, content);
views.setColorAttr(R.id.text_content, "setTextColor", android.R.attr.textColorPrimary);
views.setTextViewText(R.id.text_content, mTile.getNotificationContent());
+ if (mLayoutSize == LAYOUT_LARGE) {
+ views.setViewPadding(R.id.name, 0, 0, 0,
+ mContext.getResources().getDimensionPixelSize(
+ R.dimen.above_notification_text_padding));
+ }
views.setViewVisibility(R.id.image, View.GONE);
views.setImageViewResource(R.id.predefined_icon, R.drawable.ic_message);
}
@@ -491,6 +522,7 @@
} else {
views.setViewVisibility(R.id.subtext, View.GONE);
}
+ setAvailabilityDotPadding(views, R.dimen.availability_dot_notification_padding);
return views;
}
@@ -513,7 +545,8 @@
}
private RemoteViews createStatusRemoteViews(ConversationStatus status) {
- RemoteViews views = getViewForContentLayout();
+ RemoteViews views = setViewForContentLayout(new RemoteViews(mContext.getPackageName(),
+ getLayoutForContent()));
CharSequence statusText = status.getDescription();
if (TextUtils.isEmpty(statusText)) {
statusText = getStatusTextByType(status.getActivity());
@@ -545,11 +578,27 @@
android.R.attr.textColorSecondary);
setMaxLines(views, false);
}
+ setAvailabilityDotPadding(views, R.dimen.availability_dot_status_padding);
// TODO: Set status pre-defined icons
views.setImageViewResource(R.id.predefined_icon, R.drawable.ic_person);
return views;
}
+ /**
+ * Update the padding of the availability dot. The padding on the availability dot decreases
+ * on the status layouts compared to all other layouts.
+ */
+ private void setAvailabilityDotPadding(RemoteViews views, int resId) {
+ boolean isLeftToRight = TextUtils.getLayoutDirectionFromLocale(Locale.getDefault())
+ == View.LAYOUT_DIRECTION_LTR;
+ int startPadding = mContext.getResources().getDimensionPixelSize(resId);
+ int bottomPadding = mContext.getResources().getDimensionPixelSize(
+ R.dimen.medium_content_padding_above_name);
+ views.setViewPadding(R.id.medium_content,
+ isLeftToRight ? startPadding : 0, 0, isLeftToRight ? 0 : startPadding,
+ bottomPadding);
+ }
+
@Nullable
private ConversationStatus getBirthdayStatus(
List<ConversationStatus> statuses) {
@@ -718,9 +767,7 @@
return null;
}
- private RemoteViews getViewForContentLayout() {
- RemoteViews views = new RemoteViews(mContext.getPackageName(),
- getLayoutForContent());
+ private RemoteViews setViewForContentLayout(RemoteViews views) {
if (mLayoutSize == LAYOUT_SMALL) {
views.setViewVisibility(R.id.predefined_icon, View.VISIBLE);
views.setViewVisibility(R.id.name, View.GONE);
@@ -734,13 +781,34 @@
}
if (mLayoutSize == LAYOUT_MEDIUM) {
+ // Maximize vertical padding with an avatar size of 48dp and name on medium.
if (DEBUG) Log.d(TAG, "Set vertical padding: " + mMediumVerticalPadding);
int horizontalPadding = (int) Math.floor(MAX_MEDIUM_PADDING * mDensity);
int verticalPadding = (int) Math.floor(mMediumVerticalPadding * mDensity);
views.setViewPadding(R.id.content, horizontalPadding, verticalPadding,
horizontalPadding,
verticalPadding);
+ // Expand the name font on medium if there's space.
+ int heightRequiredForMaxContentText = (int) (mContext.getResources().getDimension(
+ R.dimen.medium_height_for_max_name_text_size) / mDensity);
+ if (mHeight > heightRequiredForMaxContentText) {
+ views.setTextViewTextSize(R.id.name, TypedValue.COMPLEX_UNIT_PX,
+ (int) mContext.getResources().getDimension(
+ R.dimen.max_name_text_size_for_medium));
+ }
}
+
+ if (mLayoutSize == LAYOUT_LARGE) {
+ // Decrease the view padding below the name on all layouts besides notification "text".
+ views.setViewPadding(R.id.name, 0, 0, 0,
+ mContext.getResources().getDimensionPixelSize(
+ R.dimen.below_name_text_padding));
+ }
+
+ // For all layouts except Missed Calls, ensure predefined icon is regular sized.
+ views.setViewLayoutHeightDimen(R.id.predefined_icon, R.dimen.regular_predefined_icon);
+ views.setViewLayoutWidthDimen(R.id.predefined_icon, R.dimen.regular_predefined_icon);
+
views.setViewVisibility(R.id.messages_count, View.GONE);
if (mTile.getUserName() != null) {
views.setTextViewText(R.id.name, mTile.getUserName());
@@ -784,12 +852,24 @@
}
}
+ private int getLayoutForNotificationContent() {
+ switch (mLayoutSize) {
+ case LAYOUT_MEDIUM:
+ return R.layout.people_tile_medium_with_content;
+ case LAYOUT_LARGE:
+ return R.layout.people_tile_large_with_notification_content;
+ case LAYOUT_SMALL:
+ default:
+ return R.layout.people_tile_small;
+ }
+ }
+
private int getLayoutForContent() {
switch (mLayoutSize) {
case LAYOUT_MEDIUM:
return R.layout.people_tile_medium_with_content;
case LAYOUT_LARGE:
- return R.layout.people_tile_large_with_content;
+ return R.layout.people_tile_large_with_status_content;
case LAYOUT_SMALL:
default:
return R.layout.people_tile_small;
@@ -832,19 +912,18 @@
if (durationSinceLastInteraction.toDays() <= ONE_DAY) {
return null;
} else if (durationSinceLastInteraction.toDays() < DAYS_IN_A_WEEK) {
- return context.getString(R.string.timestamp, formatter.formatMeasures(
+ return context.getString(R.string.days_timestamp, formatter.formatMeasures(
new Measure(durationSinceLastInteraction.toDays(),
MeasureUnit.DAY)));
- } else if (durationSinceLastInteraction.toDays() <= DAYS_IN_A_WEEK * 2) {
- return context.getString(durationSinceLastInteraction.toDays() == DAYS_IN_A_WEEK
- ? R.string.timestamp : R.string.over_timestamp,
- formatter.formatMeasures(
- new Measure(durationSinceLastInteraction.toDays() / DAYS_IN_A_WEEK,
- MeasureUnit.WEEK)));
+ } else if (durationSinceLastInteraction.toDays() == DAYS_IN_A_WEEK) {
+ return context.getString(R.string.one_week_timestamp);
+ } else if (durationSinceLastInteraction.toDays() < DAYS_IN_A_WEEK * 2) {
+ return context.getString(R.string.over_one_week_timestamp);
+ } else if (durationSinceLastInteraction.toDays() == DAYS_IN_A_WEEK * 2) {
+ return context.getString(R.string.two_weeks_timestamp);
} else {
// Over 2 weeks ago
- return context.getString(R.string.over_timestamp,
- formatter.formatMeasures(new Measure(MAX_WEEKS, MeasureUnit.WEEK)));
+ return context.getString(R.string.over_two_weeks_timestamp);
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/DeviceControlsTile.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/DeviceControlsTile.kt
index 71f42d8..11b0e01 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/DeviceControlsTile.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/DeviceControlsTile.kt
@@ -40,6 +40,7 @@
import com.android.systemui.qs.QSHost
import com.android.systemui.qs.logging.QSLogger
import com.android.systemui.qs.tileimpl.QSTileImpl
+import com.android.systemui.statusbar.policy.KeyguardStateController
import java.util.concurrent.atomic.AtomicBoolean
import javax.inject.Inject
@@ -52,7 +53,8 @@
statusBarStateController: StatusBarStateController,
activityStarter: ActivityStarter,
qsLogger: QSLogger,
- private val controlsComponent: ControlsComponent
+ private val controlsComponent: ControlsComponent,
+ private val keyguardStateController: KeyguardStateController
) : QSTileImpl<QSTile.State>(
host,
backgroundLooper,
@@ -101,11 +103,15 @@
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK)
putExtra(ControlsUiController.EXTRA_ANIMATE, true)
}
-
- val animationController = view?.let {
- ActivityLaunchAnimator.Controller.fromView(it)
+ if (keyguardStateController.isUnlocked()) {
+ val animationController = view?.let {
+ ActivityLaunchAnimator.Controller.fromView(it)
+ }
+ mActivityStarter.startActivity(i, true /* dismissShade */, animationController)
+ } else {
+ mHost.collapsePanels()
+ mContext.startActivity(i)
}
- mActivityStarter.startActivity(i, true /* dismissShade */, animationController)
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java
index 7c2d476..1f9221c 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotController.java
@@ -401,9 +401,6 @@
if (DEBUG_UI) {
Log.d(TAG, "reloadAssets()");
}
- if (mScreenshotView != null && mScreenshotView.isAttachedToWindow()) {
- mWindow.clearContentView(); // Is there a simpler way to say "remove screenshotView?"
- }
// respect the display cutout in landscape (since we'd otherwise overlap) but not portrait
int orientation = mContext.getResources().getConfiguration().orientation;
@@ -497,6 +494,17 @@
saveScreenshot(screenshot, finisher, screenRect, Insets.NONE, true);
}
+ private void updateDisplayCutout() {
+ // respect the display cutout in landscape (since we'd otherwise overlap) but not portrait
+ int orientation = mContext.getResources().getConfiguration().orientation;
+ mWindowLayoutParams.setFitInsetsTypes(
+ orientation == ORIENTATION_PORTRAIT ? 0 : WindowInsets.Type.displayCutout());
+ final View decorView = mWindow.peekDecorView();
+ if (decorView != null && decorView.isAttachedToWindow()) {
+ mWindowManager.updateViewLayout(decorView, mWindowLayoutParams);
+ }
+ }
+
private void saveScreenshot(Bitmap screenshot, Consumer<Uri> finisher, Rect screenRect,
Insets screenInsets, boolean showFlash) {
if (mAccessibilityManager.isEnabled()) {
@@ -507,12 +515,6 @@
mAccessibilityManager.sendAccessibilityEvent(event);
}
- if (mConfigChanges.applyNewConfig(mContext.getResources())) {
- if (DEBUG_UI) {
- Log.d(TAG, "saveScreenshot: reloading assets");
- }
- reloadAssets();
- }
if (mScreenshotView.isAttachedToWindow()) {
// if we didn't already dismiss for another reason
@@ -526,6 +528,9 @@
mScreenshotView.reset();
}
+ int orientation = mContext.getResources().getConfiguration().orientation;
+ mScreenshotView.updateOrientation(orientation == ORIENTATION_PORTRAIT);
+
mScreenBitmap = screenshot;
if (!isUserSetupComplete()) {
@@ -556,6 +561,12 @@
mLastScrollCaptureRequest = mScrollCaptureClient.request(DEFAULT_DISPLAY);
mLastScrollCaptureRequest.addListener(() ->
onScrollCaptureResponseReady(mLastScrollCaptureRequest), mMainExecutor);
+ mWindow.peekDecorView().getViewRootImpl().setActivityConfigCallback(
+ (overrideConfig, newDisplayId) -> {
+ if (mConfigChanges.applyNewConfig(mContext.getResources())) {
+ updateDisplayCutout();
+ }
+ });
});
attachWindow();
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java
index 70b1133..71a152d 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotView.java
@@ -60,6 +60,7 @@
import android.view.MotionEvent;
import android.view.TouchDelegate;
import android.view.View;
+import android.view.ViewGroup;
import android.view.ViewOutlineProvider;
import android.view.ViewTreeObserver;
import android.view.WindowInsets;
@@ -350,6 +351,23 @@
mScreenshotPreview.setImageDrawable(createScreenDrawable(mResources, bitmap, screenInsets));
}
+ void updateOrientation(boolean portrait) {
+ mOrientationPortrait = portrait;
+ int screenshotFixedSize =
+ mContext.getResources().getDimensionPixelSize(R.dimen.global_screenshot_x_scale);
+ ViewGroup.LayoutParams params = mScreenshotPreview.getLayoutParams();
+ if (portrait) {
+ params.width = screenshotFixedSize;
+ params.height = LayoutParams.WRAP_CONTENT;
+ mScreenshotPreview.setScaleType(ImageView.ScaleType.FIT_START);
+ } else {
+ params.width = LayoutParams.WRAP_CONTENT;
+ params.height = screenshotFixedSize;
+ mScreenshotPreview.setScaleType(ImageView.ScaleType.FIT_END);
+ }
+ mScreenshotPreview.setLayoutParams(params);
+ }
+
AnimatorSet createScreenshotDropInAnimation(Rect bounds, boolean showFlash) {
if (DEBUG_ANIM) {
Log.d(TAG, "createAnim: bounds=" + bounds + " showFlash=" + showFlash);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
index e49ca13..b93da4b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
@@ -336,8 +336,13 @@
ActivatableNotificationView anv =
(ActivatableNotificationView) child;
+ final boolean isUnlockedHeadsUp = !mAmbientState.isOnKeyguard()
+ && !mAmbientState.isShadeExpanded()
+ && child instanceof ExpandableView
+ && ((ExpandableNotificationRow) child).isHeadsUp();
if (viewStart < shelfStart
&& !mHostLayoutController.isViewAffectedBySwipe(anv)
+ && !isUnlockedHeadsUp
&& !mAmbientState.isPulsing()
&& !mAmbientState.isDozing()) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
index b94b5d3c..7c63763 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -852,7 +852,7 @@
setScrimAlpha(mScrimForBubble, mBubbleAlpha);
}
// The animation could have all already finished, let's call onFinished just in case
- onFinished();
+ onFinished(mState);
dispatchScrimsVisible();
}
@@ -919,7 +919,6 @@
Trace.traceCounter(Trace.TRACE_TAG_APP, getScrimName(scrimView) + "_tint",
Color.alpha(tint));
-
scrimView.setTint(tint);
scrimView.setViewAlpha(alpha);
} else {
@@ -950,12 +949,13 @@
anim.setStartDelay(mAnimationDelay);
anim.setDuration(mAnimationDuration);
anim.addListener(new AnimatorListenerAdapter() {
- private Callback lastCallback = mCallback;
+ private final ScrimState mLastState = mState;
+ private final Callback mLastCallback = mCallback;
@Override
public void onAnimationEnd(Animator animation) {
scrim.setTag(TAG_KEY_ANIM, null);
- onFinished(lastCallback);
+ onFinished(mLastCallback, mLastState);
dispatchScrimsVisible();
}
@@ -1009,11 +1009,14 @@
return true;
}
- private void onFinished() {
- onFinished(mCallback);
+ /**
+ * @param state that finished
+ */
+ private void onFinished(ScrimState state) {
+ onFinished(mCallback, state);
}
- private void onFinished(Callback callback) {
+ private void onFinished(Callback callback, ScrimState state) {
if (mPendingFrameCallback != null) {
// No animations can finish while we're waiting on the blanking to finish
return;
@@ -1045,7 +1048,7 @@
// When unlocking with fingerprint, we'll fade the scrims from black to transparent.
// At the end of the animation we need to remove the tint.
- if (mState == ScrimState.UNLOCKED) {
+ if (state == ScrimState.UNLOCKED) {
mInFrontTint = Color.TRANSPARENT;
mBehindTint = mState.getBehindTint();
mNotificationsTint = mState.getNotifTint();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationModeSwitchTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationModeSwitchTest.java
index 3d504fb..d9a240f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationModeSwitchTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationModeSwitchTest.java
@@ -22,6 +22,7 @@
import static android.view.MotionEvent.ACTION_DOWN;
import static android.view.MotionEvent.ACTION_MOVE;
import static android.view.MotionEvent.ACTION_UP;
+import static android.view.WindowInsets.Type.systemBars;
import static android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction.ACTION_CLICK;
import static com.android.systemui.accessibility.MagnificationModeSwitch.DEFAULT_FADE_OUT_ANIMATION_DELAY_MS;
@@ -33,6 +34,7 @@
import static org.hamcrest.CoreMatchers.hasItems;
import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
@@ -41,19 +43,27 @@
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.content.Context;
import android.content.pm.ActivityInfo;
+import android.graphics.Insets;
+import android.graphics.Rect;
+import android.os.Handler;
import android.os.SystemClock;
import android.os.UserHandle;
import android.provider.Settings;
import android.testing.AndroidTestingRunner;
+import android.testing.TestableLooper;
+import android.view.Choreographer;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewPropertyAnimator;
+import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityNodeInfo;
@@ -61,6 +71,7 @@
import androidx.test.filters.SmallTest;
+import com.android.internal.graphics.SfVsyncFrameCallbackProvider;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
@@ -69,6 +80,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
+import org.mockito.InOrder;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
@@ -77,6 +89,7 @@
@SmallTest
@RunWith(AndroidTestingRunner.class)
+@TestableLooper.RunWithLooper
public class MagnificationModeSwitchTest extends SysuiTestCase {
private static final float FADE_IN_ALPHA = 1f;
@@ -86,7 +99,10 @@
@Mock
private AccessibilityManager mAccessibilityManager;
@Mock
- private WindowManager mWindowManager;
+ private SfVsyncFrameCallbackProvider mSfVsyncFrameProvider;
+ @Mock
+ private Handler mHandler;
+ private TestableWindowManager mWindowManager;
private ViewPropertyAnimator mViewPropertyAnimator;
private MagnificationModeSwitch mMagnificationModeSwitch;
private View.OnTouchListener mTouchListener;
@@ -96,10 +112,8 @@
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
- WindowManager wm = mContext.getSystemService(WindowManager.class);
- doAnswer(invocation ->
- wm.getMaximumWindowMetrics()
- ).when(mWindowManager).getMaximumWindowMetrics();
+ final WindowManager wm = mContext.getSystemService(WindowManager.class);
+ mWindowManager = spy(new TestableWindowManager(wm));
mContext.addMockSystemService(Context.WINDOW_SERVICE, mWindowManager);
mContext.addMockSystemService(Context.ACCESSIBILITY_SERVICE, mAccessibilityManager);
mSpyImageView = Mockito.spy(new ImageView(mContext));
@@ -110,7 +124,14 @@
return null;
}).when(mSpyImageView).setOnTouchListener(
any(View.OnTouchListener.class));
- mMagnificationModeSwitch = new MagnificationModeSwitch(mContext, mSpyImageView);
+ doAnswer(invocation -> {
+ Choreographer.FrameCallback callback = invocation.getArgument(0);
+ callback.doFrame(0);
+ return null;
+ }).when(mSfVsyncFrameProvider).postFrameCallback(
+ any(Choreographer.FrameCallback.class));
+ mMagnificationModeSwitch = new MagnificationModeSwitch(mContext, mSpyImageView,
+ mSfVsyncFrameProvider);
assertNotNull(mTouchListener);
}
@@ -178,20 +199,65 @@
}
@Test
- public void onConfigurationChanged_buttonIsShowing_updateResourcesAndLayout() {
+ public void onDensityChanged_buttonIsShowing_updateResourcesAndLayout() {
mMagnificationModeSwitch.showButton(ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN);
resetAndStubMockImageViewAndAnimator();
mMagnificationModeSwitch.onConfigurationChanged(ActivityInfo.CONFIG_DENSITY);
- verify(mSpyImageView).setPadding(anyInt(), anyInt(), anyInt(), anyInt());
- verify(mSpyImageView).setImageResource(
- getIconResId(ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN));
- verify(mWindowManager).updateViewLayout(eq(mSpyImageView), any());
+ InOrder inOrder = Mockito.inOrder(mWindowManager);
+ inOrder.verify(mWindowManager).updateViewLayout(eq(mSpyImageView), any());
+ inOrder.verify(mWindowManager).removeView(eq(mSpyImageView));
+ inOrder.verify(mWindowManager).addView(eq(mSpyImageView), any());
verify(mSpyImageView).setSystemGestureExclusionRects(any(List.class));
}
@Test
+ public void onApplyWindowInsetsWithBoundsChange_buttonIsShowing_updateLayoutPosition() {
+ mMagnificationModeSwitch.showButton(ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN);
+
+ mMagnificationModeSwitch.mDraggableWindowBounds.inset(10, 10);
+ mSpyImageView.onApplyWindowInsets(WindowInsets.CONSUMED);
+
+ verify(mWindowManager).updateViewLayout(eq(mSpyImageView),
+ any(WindowManager.LayoutParams.class));
+ assertLayoutPosition(/* toLeftScreenEdge= */ false);
+ }
+
+ @Test
+ public void onApplyWindowInsetsWithWindowInsetsChange_buttonIsShowing_draggableBoundsChanged() {
+ mMagnificationModeSwitch.showButton(ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN);
+ final Rect oldDraggableBounds = new Rect(mMagnificationModeSwitch.mDraggableWindowBounds);
+
+ mWindowManager.setWindowInsets(new WindowInsets.Builder()
+ .setInsetsIgnoringVisibility(systemBars(), Insets.of(0, 20, 0, 20))
+ .build());
+ mSpyImageView.onApplyWindowInsets(WindowInsets.CONSUMED);
+
+ assertNotEquals(oldDraggableBounds, mMagnificationModeSwitch.mDraggableWindowBounds);
+ }
+
+ @Test
+ public void onDraggingGestureFinish_buttonIsShowing_stickToRightEdge() {
+ final int windowHalfWidth =
+ mWindowManager.getCurrentWindowMetrics().getBounds().width() / 2;
+ mMagnificationModeSwitch.showButton(ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN);
+
+ // Drag button to right side on screen
+ final int offset = ViewConfiguration.get(mContext).getScaledTouchSlop() + 10;
+ final long downTime = SystemClock.uptimeMillis();
+ mTouchListener.onTouch(mSpyImageView, obtainMotionEvent(
+ downTime, 0, ACTION_DOWN, 100, 100));
+ mTouchListener.onTouch(mSpyImageView,
+ obtainMotionEvent(downTime, downTime, ACTION_MOVE, windowHalfWidth - offset, 100));
+
+ mTouchListener.onTouch(mSpyImageView, obtainMotionEvent(
+ downTime, downTime, ACTION_UP, windowHalfWidth - offset, 100));
+
+ assertLayoutPosition(/* toLeftScreenEdge= */false);
+ }
+
+ @Test
public void performSingleTap_fullscreenMode_removeViewAndChangeSettingsValue() {
mMagnificationModeSwitch.showButton(ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN);
resetAndStubMockImageViewAndAnimator();
@@ -344,12 +410,12 @@
public void showButton_hasAccessibilityWindowTitle() {
mMagnificationModeSwitch.showButton(ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW);
- ArgumentCaptor<WindowManager.LayoutParams> paramsArgumentCaptor = ArgumentCaptor.forClass(
- WindowManager.LayoutParams.class);
- verify(mWindowManager).addView(eq(mSpyImageView), paramsArgumentCaptor.capture());
+ final WindowManager.LayoutParams layoutPrams =
+ mWindowManager.getLayoutParamsFromAttachedView();
+ assertNotNull(layoutPrams);
assertEquals(getContext().getResources().getString(
com.android.internal.R.string.android_system_label),
- paramsArgumentCaptor.getValue().accessibilityTitle);
+ layoutPrams.accessibilityTitle);
}
@Test
@@ -361,10 +427,10 @@
com.android.internal.R.string.android_system_label, newA11yWindowTitle);
mMagnificationModeSwitch.onConfigurationChanged(ActivityInfo.CONFIG_LOCALE);
- ArgumentCaptor<WindowManager.LayoutParams> paramsArgumentCaptor = ArgumentCaptor.forClass(
- WindowManager.LayoutParams.class);
- verify(mWindowManager).updateViewLayout(eq(mSpyImageView), paramsArgumentCaptor.capture());
- assertEquals(newA11yWindowTitle, paramsArgumentCaptor.getValue().accessibilityTitle);
+ final WindowManager.LayoutParams layoutParams =
+ mWindowManager.getLayoutParamsFromAttachedView();
+ assertNotNull(layoutParams);
+ assertEquals(newA11yWindowTitle, layoutParams.accessibilityTitle);
}
private void assertModeUnchanged(int expectedMode) {
@@ -374,7 +440,7 @@
}
private void assertShowFadingAnimation(float alpha) {
- ArgumentCaptor<Runnable> runnableCaptor = ArgumentCaptor.forClass(Runnable.class);
+ final ArgumentCaptor<Runnable> runnableCaptor = ArgumentCaptor.forClass(Runnable.class);
if (alpha == FADE_IN_ALPHA) { // Fade-in
verify(mSpyImageView).postOnAnimation(runnableCaptor.capture());
} else { // Fade-out
@@ -392,6 +458,13 @@
private void resetAndStubMockImageViewAndAnimator() {
resetAndStubMockAnimator();
Mockito.reset(mSpyImageView);
+ final Handler handler = mock(Handler.class);
+ when(mSpyImageView.getHandler()).thenReturn(handler);
+ doAnswer(invocation -> {
+ final Runnable runnable = invocation.getArgument(0);
+ runnable.run();
+ return null;
+ }).when(handler).post(any(Runnable.class));
doAnswer(invocation -> {
final Runnable runnable = invocation.getArgument(0);
runnable.run();
@@ -440,4 +513,16 @@
mFadeOutAnimation.run();
mFadeOutAnimation = null;
}
+
+ private void assertLayoutPosition(boolean toLeftScreenEdge) {
+ final int expectedX =
+ toLeftScreenEdge ? mMagnificationModeSwitch.mDraggableWindowBounds.left
+ : mMagnificationModeSwitch.mDraggableWindowBounds.right;
+ final int expectedY = mMagnificationModeSwitch.mDraggableWindowBounds.bottom;
+ final WindowManager.LayoutParams layoutParams =
+ mWindowManager.getLayoutParamsFromAttachedView();
+ assertNotNull(layoutParams);
+ assertEquals(expectedX, layoutParams.x);
+ assertEquals(expectedY, layoutParams.y);
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/TestableWindowManager.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/TestableWindowManager.java
new file mode 100644
index 0000000..4f095ac
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/TestableWindowManager.java
@@ -0,0 +1,109 @@
+/*
+ * 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.accessibility;
+
+import static android.view.WindowInsets.Type.systemGestures;
+
+import android.graphics.Insets;
+import android.graphics.Region;
+import android.view.Display;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowInsets;
+import android.view.WindowManager;
+import android.view.WindowMetrics;
+
+public class TestableWindowManager implements WindowManager {
+
+ private final WindowManager mWindowManager;
+ private View mView;
+ private WindowInsets mWindowInsets = null;
+
+ TestableWindowManager(WindowManager windowManager) {
+ mWindowManager = windowManager;
+ }
+
+ @Override
+ public Display getDefaultDisplay() {
+ return mWindowManager.getDefaultDisplay();
+ }
+
+ @Override
+ public void removeViewImmediate(View view) {
+ mWindowManager.removeViewImmediate(view);
+ }
+
+ @Override
+ public void requestAppKeyboardShortcuts(WindowManager.KeyboardShortcutsReceiver receiver,
+ int deviceId) {
+ mWindowManager.requestAppKeyboardShortcuts(receiver, deviceId);
+ }
+
+ @Override
+ public Region getCurrentImeTouchRegion() {
+ return mWindowManager.getCurrentImeTouchRegion();
+ }
+
+ @Override
+ public void addView(View view, ViewGroup.LayoutParams params) {
+ mView = view;
+ mWindowManager.addView(view, params);
+ }
+
+ @Override
+ public void updateViewLayout(View view, ViewGroup.LayoutParams params) {
+ mWindowManager.updateViewLayout(view, params);
+ }
+
+ @Override
+ public void removeView(View view) {
+ mView = null;
+ mWindowManager.removeView(view);
+ }
+
+ @Override
+ public WindowMetrics getCurrentWindowMetrics() {
+ final Insets systemGesturesInsets = Insets.of(0, 0, 0, 10);
+ final WindowInsets insets = new WindowInsets.Builder()
+ .setInsets(systemGestures(), systemGesturesInsets)
+ .build();
+ final WindowMetrics windowMetrics = new WindowMetrics(
+ mWindowManager.getCurrentWindowMetrics().getBounds(),
+ mWindowInsets == null ? insets : mWindowInsets);
+ return windowMetrics;
+ }
+
+ @Override
+ public WindowMetrics getMaximumWindowMetrics() {
+ return mWindowManager.getMaximumWindowMetrics();
+ }
+
+ public View getAttachedView() {
+ return mView;
+ }
+
+ public WindowManager.LayoutParams getLayoutParamsFromAttachedView() {
+ if (mView == null) {
+ return null;
+ }
+ return (WindowManager.LayoutParams) mView.getLayoutParams();
+ }
+
+ public void setWindowInsets(WindowInsets insets) {
+ mWindowInsets = insets;
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationControllerTest.java
index b8734df..5fa63bc 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationControllerTest.java
@@ -17,7 +17,6 @@
package com.android.systemui.accessibility;
import static android.view.Choreographer.FrameCallback;
-import static android.view.WindowInsets.Type.systemGestures;
import static android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_MAGNIFICATION_OVERLAP;
@@ -46,9 +45,7 @@
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.res.Resources;
-import android.graphics.Insets;
import android.graphics.Rect;
-import android.graphics.Region;
import android.os.Handler;
import android.os.SystemClock;
import android.testing.AndroidTestingRunner;
@@ -58,10 +55,7 @@
import android.view.Surface;
import android.view.SurfaceControl;
import android.view.View;
-import android.view.ViewGroup;
-import android.view.WindowInsets;
import android.view.WindowManager;
-import android.view.WindowMetrics;
import android.view.accessibility.AccessibilityNodeInfo;
import androidx.test.InstrumentationRegistry;
@@ -96,14 +90,13 @@
private MirrorWindowControl mMirrorWindowControl;
@Mock
private WindowMagnifierCallback mWindowMagnifierCallback;
- @Mock (answer = Answers.RETURNS_DEEP_STUBS)
+ @Mock(answer = Answers.RETURNS_DEEP_STUBS)
private SurfaceControl.Transaction mTransaction;
- private WindowManager mWindowManager;
+ private TestableWindowManager mWindowManager;
private SysUiState mSysUiState = new SysUiState();
private Resources mResources;
private WindowMagnificationController mWindowMagnificationController;
private Instrumentation mInstrumentation;
- private View mMirrorView;
@Before
public void setUp() {
@@ -157,7 +150,9 @@
timeout(LAYOUT_CHANGE_TIMEOUT_MS)).onWindowMagnifierBoundsChanged(
eq(mContext.getDisplayId()), boundsCaptor.capture());
final Rect actualBounds = new Rect();
- mMirrorView.getBoundsOnScreen(actualBounds);
+ final View mirrorView = mWindowManager.getAttachedView();
+ assertNotNull(mirrorView);
+ mirrorView.getBoundsOnScreen(actualBounds);
assertEquals(actualBounds, boundsCaptor.getValue());
}
@@ -218,7 +213,9 @@
ArgumentCaptor<Runnable> runnableArgumentCaptor = ArgumentCaptor.forClass(Runnable.class);
verify(mHandler).postDelayed(runnableArgumentCaptor.capture(), anyLong());
runnableArgumentCaptor.getValue().run();
- assertThat(mMirrorView.getStateDescription().toString(), containsString("300"));
+ final View mirrorView = mWindowManager.getAttachedView();
+ assertNotNull(mirrorView);
+ assertThat(mirrorView.getStateDescription().toString(), containsString("300"));
}
@Test
@@ -300,10 +297,11 @@
mWindowMagnificationController.enableWindowMagnification(2.5f, Float.NaN,
Float.NaN);
});
- assertNotNull(mMirrorView);
+ final View mirrorView = mWindowManager.getAttachedView();
+ assertNotNull(mirrorView);
final AccessibilityNodeInfo nodeInfo = new AccessibilityNodeInfo();
- mMirrorView.onInitializeAccessibilityNodeInfo(nodeInfo);
+ mirrorView.onInitializeAccessibilityNodeInfo(nodeInfo);
assertNotNull(nodeInfo.getContentDescription());
assertThat(nodeInfo.getStateDescription().toString(), containsString("250"));
@@ -323,24 +321,24 @@
mWindowMagnificationController.enableWindowMagnification(2.5f, Float.NaN,
Float.NaN);
});
- assertNotNull(mMirrorView);
+ final View mirrorView = mWindowManager.getAttachedView();
assertTrue(
- mMirrorView.performAccessibilityAction(R.id.accessibility_action_zoom_out, null));
+ mirrorView.performAccessibilityAction(R.id.accessibility_action_zoom_out, null));
// Minimum scale is 2.0.
verify(mWindowMagnifierCallback).onPerformScaleAction(eq(displayId), eq(2.0f));
- assertTrue(mMirrorView.performAccessibilityAction(R.id.accessibility_action_zoom_in, null));
+ assertTrue(mirrorView.performAccessibilityAction(R.id.accessibility_action_zoom_in, null));
verify(mWindowMagnifierCallback).onPerformScaleAction(eq(displayId), eq(3.5f));
// TODO: Verify the final state when the mirror surface is visible.
- assertTrue(mMirrorView.performAccessibilityAction(R.id.accessibility_action_move_up, null));
+ assertTrue(mirrorView.performAccessibilityAction(R.id.accessibility_action_move_up, null));
assertTrue(
- mMirrorView.performAccessibilityAction(R.id.accessibility_action_move_down, null));
+ mirrorView.performAccessibilityAction(R.id.accessibility_action_move_down, null));
assertTrue(
- mMirrorView.performAccessibilityAction(R.id.accessibility_action_move_right, null));
+ mirrorView.performAccessibilityAction(R.id.accessibility_action_move_right, null));
assertTrue(
- mMirrorView.performAccessibilityAction(R.id.accessibility_action_move_left, null));
+ mirrorView.performAccessibilityAction(R.id.accessibility_action_move_left, null));
}
@Test
@@ -351,7 +349,8 @@
Float.NaN);
});
- mMirrorView.performAccessibilityAction(R.id.accessibility_action_move_up, null);
+ final View mirrorView = mWindowManager.getAttachedView();
+ mirrorView.performAccessibilityAction(R.id.accessibility_action_move_up, null);
verify(mWindowMagnifierCallback).onAccessibilityActionPerformed(eq(displayId));
}
@@ -363,12 +362,8 @@
Float.NaN);
});
- ArgumentCaptor<WindowManager.LayoutParams> paramsArgumentCaptor = ArgumentCaptor.forClass(
- WindowManager.LayoutParams.class);
- verify(mWindowManager).addView(eq(mMirrorView), paramsArgumentCaptor.capture());
assertEquals(getContext().getResources().getString(
- com.android.internal.R.string.android_system_label),
- paramsArgumentCaptor.getValue().accessibilityTitle);
+ com.android.internal.R.string.android_system_label), getAccessibilityWindowTitle());
}
@Test
@@ -400,15 +395,15 @@
mWindowMagnificationController.onSingleTap();
});
+ final View mirrorView = mWindowManager.getAttachedView();
final long timeout = SystemClock.uptimeMillis() + 1000;
while (SystemClock.uptimeMillis() < timeout) {
SystemClock.sleep(10);
-
- if (Float.compare(1.0f, mMirrorView.getScaleX()) < 0) {
+ if (Float.compare(1.0f, mirrorView.getScaleX()) < 0) {
return;
}
}
- fail("mMirrorView scale is not changed");
+ fail("MirrorView scale is not changed");
}
@Test
@@ -428,77 +423,16 @@
}
private CharSequence getAccessibilityWindowTitle() {
- if (mMirrorView == null) {
- return null;
+ final View mirrorView = mWindowManager.getAttachedView();
+ if (mirrorView == null) {
+ return null;
}
WindowManager.LayoutParams layoutParams =
- (WindowManager.LayoutParams) mMirrorView.getLayoutParams();
+ (WindowManager.LayoutParams) mirrorView.getLayoutParams();
return layoutParams.accessibilityTitle;
}
private boolean hasMagnificationOverlapFlag() {
return (mSysUiState.getFlags() & SYSUI_STATE_MAGNIFICATION_OVERLAP) != 0;
}
-
- private class TestableWindowManager implements WindowManager {
-
- private final WindowManager mWindowManager;
-
- TestableWindowManager(WindowManager windowManager) {
- mWindowManager = windowManager;
- }
-
- @Override
- public Display getDefaultDisplay() {
- return mWindowManager.getDefaultDisplay();
- }
-
- @Override
- public void removeViewImmediate(View view) {
- mWindowManager.removeViewImmediate(view);
- }
-
- @Override
- public void requestAppKeyboardShortcuts(KeyboardShortcutsReceiver receiver, int deviceId) {
- mWindowManager.requestAppKeyboardShortcuts(receiver, deviceId);
- }
-
- @Override
- public Region getCurrentImeTouchRegion() {
- return mWindowManager.getCurrentImeTouchRegion();
- }
-
- @Override
- public void addView(View view, ViewGroup.LayoutParams params) {
- mMirrorView = view;
- mWindowManager.addView(view, params);
- }
-
- @Override
- public void updateViewLayout(View view, ViewGroup.LayoutParams params) {
- mWindowManager.updateViewLayout(view, params);
- }
-
- @Override
- public void removeView(View view) {
- mMirrorView = null;
- mWindowManager.removeView(view);
- }
-
- @Override
- public WindowMetrics getCurrentWindowMetrics() {
- final Insets systemGesturesInsets = Insets.of(0, 0, 0, 10);
- final WindowInsets insets = new WindowInsets.Builder()
- .setInsets(systemGestures(), systemGesturesInsets)
- .build();
- final WindowMetrics windowMetrics = new WindowMetrics(
- mWindowManager.getCurrentWindowMetrics().getBounds(), insets);
- return windowMetrics;
- }
-
- @Override
- public WindowMetrics getMaximumWindowMetrics() {
- return mWindowManager.getMaximumWindowMetrics();
- }
- }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/FalsingCollectorImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/FalsingCollectorImplTest.java
index bc24445..3c41216 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/FalsingCollectorImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/FalsingCollectorImplTest.java
@@ -21,6 +21,7 @@
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -185,7 +186,7 @@
}
@Test
- public void testAvoidDozing() {
+ public void testAvoidDozingNotPulsing() {
MotionEvent down = MotionEvent.obtain(0, 0, MotionEvent.ACTION_DOWN, 0, 0, 0);
MotionEvent up = MotionEvent.obtain(0, 0, MotionEvent.ACTION_UP, 0, 0, 0);
@@ -199,4 +200,21 @@
mFalsingCollector.onTouchEvent(up);
verify(mFalsingDataProvider, never()).onMotionEvent(any(MotionEvent.class));
}
+
+ @Test
+ public void testAvoidDozingButPulsing() {
+ MotionEvent down = MotionEvent.obtain(0, 0, MotionEvent.ACTION_DOWN, 0, 0, 0);
+ MotionEvent up = MotionEvent.obtain(0, 0, MotionEvent.ACTION_UP, 0, 0, 0);
+
+ when(mStatusBarStateController.isDozing()).thenReturn(true);
+ when(mStatusBarStateController.isPulsing()).thenReturn(true);
+
+ // Nothing passed initially
+ mFalsingCollector.onTouchEvent(down);
+ verify(mFalsingDataProvider, never()).onMotionEvent(any(MotionEvent.class));
+
+ // Up event would flushes
+ mFalsingCollector.onTouchEvent(up);
+ verify(mFalsingDataProvider, times(2)).onMotionEvent(any(MotionEvent.class));
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/controls/dagger/ControlsComponentTest.kt b/packages/SystemUI/tests/src/com/android/systemui/controls/dagger/ControlsComponentTest.kt
index c678f46..ecefb55 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/controls/dagger/ControlsComponentTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/controls/dagger/ControlsComponentTest.kt
@@ -115,7 +115,7 @@
`when`(lockPatternUtils.getStrongAuthForUser(anyInt()))
.thenReturn(STRONG_AUTH_NOT_REQUIRED)
`when`(keyguardStateController.isUnlocked()).thenReturn(false)
- `when`(secureSettings.getInt(eq(Settings.Secure.POWER_MENU_LOCKED_SHOW_CONTENT), anyInt()))
+ `when`(secureSettings.getInt(eq(Settings.Secure.LOCKSCREEN_SHOW_CONTROLS), anyInt()))
.thenReturn(0)
val component = setupComponent(true)
@@ -127,7 +127,7 @@
`when`(lockPatternUtils.getStrongAuthForUser(anyInt()))
.thenReturn(STRONG_AUTH_NOT_REQUIRED)
`when`(keyguardStateController.isUnlocked()).thenReturn(false)
- `when`(secureSettings.getInt(eq(Settings.Secure.POWER_MENU_LOCKED_SHOW_CONTENT), anyInt()))
+ `when`(secureSettings.getInt(eq(Settings.Secure.LOCKSCREEN_SHOW_CONTROLS), anyInt()))
.thenReturn(1)
val component = setupComponent(true)
@@ -136,7 +136,7 @@
@Test
fun testFeatureEnabledAndCanShowWhileUnlockedVisibility() {
- `when`(secureSettings.getInt(eq(Settings.Secure.POWER_MENU_LOCKED_SHOW_CONTENT), anyInt()))
+ `when`(secureSettings.getInt(eq(Settings.Secure.LOCKSCREEN_SHOW_CONTROLS), anyInt()))
.thenReturn(0)
`when`(lockPatternUtils.getStrongAuthForUser(anyInt()))
.thenReturn(STRONG_AUTH_NOT_REQUIRED)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/controls/ui/ControlViewHolderTest.kt b/packages/SystemUI/tests/src/com/android/systemui/controls/ui/ControlViewHolderTest.kt
new file mode 100644
index 0000000..47ab17d
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/controls/ui/ControlViewHolderTest.kt
@@ -0,0 +1,118 @@
+/*
+ * 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.controls.ui
+
+import android.app.PendingIntent
+import android.content.ComponentName
+import android.content.res.ColorStateList
+import android.graphics.drawable.GradientDrawable
+import android.graphics.drawable.Icon
+import android.service.controls.Control
+import android.service.controls.DeviceTypes
+import android.testing.AndroidTestingRunner
+import android.testing.TestableLooper
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.test.filters.SmallTest
+import com.android.systemui.R
+import com.android.systemui.controls.controller.ControlsController
+import com.android.systemui.util.time.FakeSystemClock
+import org.junit.runner.RunWith
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.controls.ControlsMetricsLogger
+import com.android.systemui.controls.controller.ControlInfo
+import com.android.systemui.util.concurrency.FakeExecutor
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Test
+import org.mockito.Mockito.mock
+
+@SmallTest
+@RunWith(AndroidTestingRunner::class)
+@TestableLooper.RunWithLooper
+class ControlViewHolderTest : SysuiTestCase() {
+
+ private val clock = FakeSystemClock()
+
+ private lateinit var cvh: ControlViewHolder
+
+ @Before
+ fun setUp() {
+ TestableLooper.get(this).runWithLooper {
+ val baseLayout = LayoutInflater.from(mContext).inflate(
+ R.layout.controls_base_item, null, false) as ViewGroup
+
+ cvh = ControlViewHolder(
+ baseLayout,
+ mock(ControlsController::class.java),
+ FakeExecutor(clock),
+ FakeExecutor(clock),
+ mock(ControlActionCoordinator::class.java),
+ mock(ControlsMetricsLogger::class.java),
+ uid = 100
+ )
+
+ val cws = ControlWithState(
+ ComponentName.createRelative("pkg", "cls"),
+ ControlInfo(
+ CONTROL_ID, CONTROL_TITLE, "subtitle", DeviceTypes.TYPE_AIR_FRESHENER
+ ),
+ Control.StatelessBuilder(CONTROL_ID, mock(PendingIntent::class.java)).build()
+ )
+
+ cvh.bindData(cws, isLocked = false)
+ }
+ }
+
+ @Test
+ fun updateStatusRow_customIconWithTint_iconTintRemains() {
+ val control = Control.StatelessBuilder(DEFAULT_CONTROL)
+ .setCustomIcon(
+ Icon.createWithResource(mContext.resources, R.drawable.ic_emergency_star)
+ .setTint(TINT_COLOR)
+ )
+ .build()
+
+ cvh.updateStatusRow(enabled = true, CONTROL_TITLE, DRAWABLE, COLOR, control)
+
+ assertThat(cvh.icon.imageTintList).isEqualTo(ColorStateList.valueOf(TINT_COLOR))
+ }
+
+ @Test
+ fun updateStatusRow_customIconWithTintList_iconTintListRemains() {
+ val customIconTintList = ColorStateList.valueOf(TINT_COLOR)
+ val control = Control.StatelessBuilder(CONTROL_ID, mock(PendingIntent::class.java))
+ .setCustomIcon(
+ Icon.createWithResource(mContext.resources, R.drawable.ic_emergency_star)
+ .setTintList(customIconTintList)
+ )
+ .build()
+
+ cvh.updateStatusRow(enabled = true, CONTROL_TITLE, DRAWABLE, COLOR, control)
+
+ assertThat(cvh.icon.imageTintList).isEqualTo(customIconTintList)
+ }
+}
+
+private const val CONTROL_ID = "CONTROL_ID"
+private const val CONTROL_TITLE = "CONTROL_TITLE"
+private const val TINT_COLOR = 0x00ff00 // Should be different from [COLOR]
+
+private val DRAWABLE = GradientDrawable()
+private val COLOR = ColorStateList.valueOf(0xffff00)
+private val DEFAULT_CONTROL = Control.StatelessBuilder(
+ CONTROL_ID, mock(PendingIntent::class.java)).build()
\ No newline at end of file
diff --git a/packages/SystemUI/tests/src/com/android/systemui/people/PeopleSpaceUtilsTest.java b/packages/SystemUI/tests/src/com/android/systemui/people/PeopleSpaceUtilsTest.java
index 8983ff8..fd28c2c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/people/PeopleSpaceUtilsTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/people/PeopleSpaceUtilsTest.java
@@ -220,8 +220,8 @@
when(mMockContext.getString(R.string.basic_status)).thenReturn(
mContext.getString(R.string.basic_status));
when(mMockContext.getPackageManager()).thenReturn(mPackageManager);
- when(mMockContext.getString(R.string.over_timestamp)).thenReturn(
- mContext.getString(R.string.over_timestamp));
+ when(mMockContext.getString(R.string.over_two_weeks_timestamp)).thenReturn(
+ mContext.getString(R.string.over_two_weeks_timestamp));
when(mPackageManager.getApplicationIcon(anyString())).thenReturn(null);
when(mNotificationEntryManager.getVisibleNotifications())
.thenReturn(List.of(mNotificationEntry1, mNotificationEntry2, mNotificationEntry3));
diff --git a/packages/SystemUI/tests/src/com/android/systemui/people/PeopleTileViewHelperTest.java b/packages/SystemUI/tests/src/com/android/systemui/people/PeopleTileViewHelperTest.java
index 7172307..3b56f22 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/people/PeopleTileViewHelperTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/people/PeopleTileViewHelperTest.java
@@ -148,8 +148,8 @@
when(mMockContext.getString(R.string.birthday_status)).thenReturn(
mContext.getString(R.string.birthday_status));
when(mMockContext.getPackageManager()).thenReturn(mPackageManager);
- when(mMockContext.getString(R.string.over_timestamp)).thenReturn(
- mContext.getString(R.string.over_timestamp));
+ when(mMockContext.getString(R.string.over_two_weeks_timestamp)).thenReturn(
+ mContext.getString(R.string.over_two_weeks_timestamp));
Configuration configuration = mock(Configuration.class);
DisplayMetrics displayMetrics = mock(DisplayMetrics.class);
Resources resources = mock(Resources.class);
@@ -325,7 +325,7 @@
TextView statusContent = (TextView) result.findViewById(R.id.text_content);
assertEquals(View.VISIBLE, statusContent.getVisibility());
assertEquals(statusContent.getText(), mContext.getString(R.string.birthday_status));
- assertThat(statusContent.getMaxLines()).isEqualTo(3);
+ assertThat(statusContent.getMaxLines()).isEqualTo(2);
mOptions.putInt(OPTION_APPWIDGET_MIN_WIDTH,
getSizeInDp(R.dimen.required_width_for_medium) - 1);
@@ -364,7 +364,7 @@
statusContent = (TextView) largeResult.findViewById(R.id.text_content);
assertEquals(View.VISIBLE, statusContent.getVisibility());
assertEquals(statusContent.getText(), mContext.getString(R.string.birthday_status));
- assertThat(statusContent.getMaxLines()).isEqualTo(3);
+ assertThat(statusContent.getMaxLines()).isEqualTo(2);
}
@Test
@@ -390,7 +390,7 @@
// Has status.
TextView statusContent = (TextView) result.findViewById(R.id.text_content);
assertEquals(statusContent.getText(), GAME_DESCRIPTION);
- assertThat(statusContent.getMaxLines()).isEqualTo(3);
+ assertThat(statusContent.getMaxLines()).isEqualTo(2);
mOptions.putInt(OPTION_APPWIDGET_MIN_WIDTH,
getSizeInDp(R.dimen.required_width_for_medium) - 1);
@@ -431,7 +431,7 @@
statusContent = (TextView) largeResult.findViewById(R.id.text_content);
assertEquals(View.VISIBLE, statusContent.getVisibility());
assertEquals(statusContent.getText(), GAME_DESCRIPTION);
- assertThat(statusContent.getMaxLines()).isEqualTo(3);
+ assertThat(statusContent.getMaxLines()).isEqualTo(2);
}
@Test
@@ -620,7 +620,7 @@
TextView statusContent = (TextView) result.findViewById(R.id.text_content);
assertEquals(View.VISIBLE, statusContent.getVisibility());
assertEquals(statusContent.getText(), MISSED_CALL);
- assertThat(statusContent.getMaxLines()).isEqualTo(3);
+ assertThat(statusContent.getMaxLines()).isEqualTo(2);
mOptions.putInt(OPTION_APPWIDGET_MIN_WIDTH,
getSizeInDp(R.dimen.required_width_for_medium) - 1);
@@ -658,7 +658,7 @@
statusContent = (TextView) largeResult.findViewById(R.id.text_content);
assertEquals(View.VISIBLE, statusContent.getVisibility());
assertEquals(statusContent.getText(), MISSED_CALL);
- assertThat(statusContent.getMaxLines()).isEqualTo(3);
+ assertThat(statusContent.getMaxLines()).isEqualTo(2);
}
@Test
@@ -684,7 +684,7 @@
TextView statusContent = (TextView) result.findViewById(R.id.text_content);
assertEquals(View.VISIBLE, statusContent.getVisibility());
assertEquals(statusContent.getText(), NOTIFICATION_CONTENT);
- assertThat(statusContent.getMaxLines()).isEqualTo(3);
+ assertThat(statusContent.getMaxLines()).isEqualTo(2);
// Has a single message, no count shown.
assertEquals(View.GONE, result.findViewById(R.id.messages_count).getVisibility());
@@ -718,7 +718,7 @@
assertEquals(name.getText(), NAME);
assertEquals(View.GONE, largeResult.findViewById(R.id.subtext).getVisibility());
assertEquals(View.GONE, largeResult.findViewById(R.id.predefined_icon).getVisibility());
- assertEquals(View.GONE, largeResult.findViewById(R.id.scrim_layout).getVisibility());
+ assertEquals(largeResult.findViewById(R.id.scrim_layout), null);
// Has availability.
assertEquals(View.VISIBLE, largeResult.findViewById(R.id.availability).getVisibility());
// Has person icon.
@@ -728,7 +728,7 @@
statusContent = (TextView) largeResult.findViewById(R.id.text_content);
assertEquals(View.VISIBLE, statusContent.getVisibility());
assertEquals(statusContent.getText(), NOTIFICATION_CONTENT);
- assertThat(statusContent.getMaxLines()).isEqualTo(3);
+ assertThat(statusContent.getMaxLines()).isEqualTo(2);
// Has a single message, no count shown.
assertEquals(View.GONE, largeResult.findViewById(R.id.messages_count).getVisibility());
@@ -761,7 +761,7 @@
assertEquals(statusContent.getText(), NOTIFICATION_CONTENT);
// Subtract one from lines because sender is included.
- assertThat(statusContent.getMaxLines()).isEqualTo(2);
+ assertThat(statusContent.getMaxLines()).isEqualTo(1);
// Has a single message, no count shown.
assertEquals(View.GONE, result.findViewById(R.id.messages_count).getVisibility());
@@ -808,7 +808,7 @@
assertEquals(statusContent.getText(), NOTIFICATION_CONTENT);
// Subtract one from lines because sender is included.
- assertThat(statusContent.getMaxLines()).isEqualTo(2);
+ assertThat(statusContent.getMaxLines()).isEqualTo(1);
// Has a single message, no count shown.
assertEquals(View.GONE, largeResult.findViewById(R.id.messages_count).getVisibility());
@@ -838,7 +838,7 @@
TextView statusContent = (TextView) result.findViewById(R.id.text_content);
assertEquals(View.VISIBLE, statusContent.getVisibility());
assertEquals(statusContent.getText(), NOTIFICATION_CONTENT);
- assertThat(statusContent.getMaxLines()).isEqualTo(3);
+ assertThat(statusContent.getMaxLines()).isEqualTo(2);
// Has two messages, show count.
assertEquals(View.VISIBLE, result.findViewById(R.id.messages_count).getVisibility());
@@ -881,7 +881,7 @@
statusContent = (TextView) largeResult.findViewById(R.id.text_content);
assertEquals(View.VISIBLE, statusContent.getVisibility());
assertEquals(statusContent.getText(), NOTIFICATION_CONTENT);
- assertThat(statusContent.getMaxLines()).isEqualTo(3);
+ assertThat(statusContent.getMaxLines()).isEqualTo(2);
// Has two messages, show count.
assertEquals(View.VISIBLE, largeResult.findViewById(R.id.messages_count).getVisibility());
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/DeviceControlsTileTest.kt b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/DeviceControlsTileTest.kt
index 6cf3434..f17fe9a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/DeviceControlsTileTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/DeviceControlsTileTest.kt
@@ -39,6 +39,7 @@
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.qs.QSHost
import com.android.systemui.qs.logging.QSLogger
+import com.android.systemui.statusbar.policy.KeyguardStateController
import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.capture
import com.android.systemui.util.mockito.eq
@@ -87,6 +88,8 @@
private lateinit var serviceInfo: ControlsServiceInfo
@Mock
private lateinit var uiEventLogger: UiEventLogger
+ @Mock
+ private lateinit var keyguardStateController: KeyguardStateController
@Captor
private lateinit var listingCallbackCaptor:
ArgumentCaptor<ControlsListingController.ControlsListingCallback>
@@ -109,7 +112,8 @@
`when`(qsHost.context).thenReturn(spiedContext)
`when`(qsHost.uiEventLogger).thenReturn(uiEventLogger)
`when`(controlsComponent.isEnabled()).thenReturn(true)
- secureSettings.putInt(Settings.Secure.POWER_MENU_LOCKED_SHOW_CONTENT, 1)
+ `when`(keyguardStateController.isUnlocked()).thenReturn(true)
+ secureSettings.putInt(Settings.Secure.LOCKSCREEN_SHOW_CONTROLS, 1)
setupControlsComponent()
@@ -306,7 +310,8 @@
statusBarStateController,
activityStarter,
qsLogger,
- controlsComponent
+ controlsComponent,
+ keyguardStateController
)
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shared/system/RemoteTransitionTest.java b/packages/SystemUI/tests/src/com/android/systemui/shared/system/RemoteTransitionTest.java
index d1259d3..360eef9 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shared/system/RemoteTransitionTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/shared/system/RemoteTransitionTest.java
@@ -68,8 +68,8 @@
.addChange(TRANSIT_CLOSE, 0 /* flags */)
.addChange(TRANSIT_OPEN, FLAG_IS_WALLPAPER).build();
// Check non-wallpaper extraction
- RemoteAnimationTargetCompat[] wrapped =
- RemoteAnimationTargetCompat.wrap(combined, false /* wallpapers */);
+ RemoteAnimationTargetCompat[] wrapped = RemoteAnimationTargetCompat.wrap(combined,
+ false /* wallpapers */, mock(SurfaceControl.Transaction.class), null /* leashes */);
assertEquals(2, wrapped.length);
int changeLayer = -1;
int closeLayer = -1;
@@ -86,8 +86,8 @@
assertTrue(closeLayer < changeLayer);
// Check wallpaper extraction
- RemoteAnimationTargetCompat[] wallps =
- RemoteAnimationTargetCompat.wrap(combined, true /* wallpapers */);
+ RemoteAnimationTargetCompat[] wallps = RemoteAnimationTargetCompat.wrap(combined,
+ true /* wallpapers */, mock(SurfaceControl.Transaction.class), null /* leashes */);
assertEquals(1, wallps.length);
assertTrue(wallps[0].prefixOrderIndex < closeLayer);
assertEquals(MODE_OPENING, wallps[0].mode);
@@ -95,16 +95,15 @@
@Test
public void testLegacyTargetWrapper() {
+ TransitionInfo tinfo = new TransitionInfoBuilder(TRANSIT_CLOSE)
+ .addChange(TRANSIT_CHANGE, FLAG_TRANSLUCENT).build();
+ final TransitionInfo.Change change = tinfo.getChanges().get(0);
final Rect endBounds = new Rect(40, 60, 140, 200);
- final TransitionInfo.Change change =
- new TransitionInfo.Change(null /* token */, null /* leash */);
change.setTaskInfo(createTaskInfo(1 /* taskId */, ACTIVITY_TYPE_HOME));
- change.setMode(TRANSIT_CHANGE);
change.setEndAbsBounds(endBounds);
change.setEndRelOffset(0, 0);
- change.setFlags(FLAG_TRANSLUCENT);
- final RemoteAnimationTargetCompat wrapped =
- new RemoteAnimationTargetCompat(change, 0 /* order */);
+ final RemoteAnimationTargetCompat wrapped = new RemoteAnimationTargetCompat(change,
+ 0 /* order */, tinfo, mock(SurfaceControl.Transaction.class));
assertEquals(ACTIVITY_TYPE_HOME, wrapped.activityType);
assertEquals(new Rect(0, 0, 100, 140), wrapped.localBounds);
assertEquals(endBounds, wrapped.screenSpaceBounds);
@@ -122,7 +121,7 @@
TransitionInfoBuilder addChange(@WindowManager.TransitionType int mode,
@TransitionInfo.ChangeFlags int flags) {
final TransitionInfo.Change change =
- new TransitionInfo.Change(null /* token */, null /* leash */);
+ new TransitionInfo.Change(null /* token */, createMockSurface(true));
change.setMode(mode);
change.setFlags(flags);
mInfo.addChange(change);
@@ -138,6 +137,7 @@
SurfaceControl sc = mock(SurfaceControl.class);
if (valid) {
doReturn(true).when(sc).isValid();
+ doReturn("TestSurface").when(sc).toString();
}
return sc;
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerWifiTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerWifiTest.java
index 687ca60..521b958 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerWifiTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerWifiTest.java
@@ -43,6 +43,7 @@
public void setUp() throws Exception {
super.setUp();
when(mWifiInfo.makeCopy(anyLong())).thenReturn(mWifiInfo);
+ when(mWifiInfo.isPrimary()).thenReturn(true);
}
@Test
@@ -277,6 +278,20 @@
}
}
+ @Test
+ public void testNonPrimaryWiFi() {
+ String testSsid = "Test SSID";
+ setWifiEnabled(true);
+ setWifiState(true, testSsid);
+ // Set the ImsType to be IMS_TYPE_WLAN
+ setImsType(2);
+ setWifiLevel(1);
+ verifyLastCallStrength(TelephonyIcons.WIFI_CALL_STRENGTH_ICONS[1]);
+ when(mWifiInfo.isPrimary()).thenReturn(false);
+ setWifiLevel(3);
+ verifyLastCallStrength(TelephonyIcons.WIFI_CALL_STRENGTH_ICONS[1]);
+ }
+
protected void setWifiActivity(int activity) {
// TODO: Not this, because this variable probably isn't sticking around.
mNetworkController.mWifiSignalController.setActivity(activity);
diff --git a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
index 85084f4..13340ba 100644
--- a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
+++ b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
@@ -554,7 +554,7 @@
}
if (onClickIntent != null) {
- views.setOnClickPendingIntent(R.id.work_widget_mask_frame,
+ views.setOnClickPendingIntent(android.R.id.background,
PendingIntent.getActivity(mContext, 0, onClickIntent,
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE));
}
diff --git a/services/autofill/java/com/android/server/autofill/ClientSuggestionsSession.java b/services/autofill/java/com/android/server/autofill/ClientSuggestionsSession.java
deleted file mode 100644
index 715697d..0000000
--- a/services/autofill/java/com/android/server/autofill/ClientSuggestionsSession.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.server.autofill;
-
-import static android.service.autofill.FillRequest.INVALID_REQUEST_ID;
-
-import static com.android.server.autofill.Helper.sVerbose;
-
-import android.annotation.Nullable;
-import android.annotation.UserIdInt;
-import android.app.AppGlobals;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.graphics.drawable.Drawable;
-import android.os.Handler;
-import android.os.ICancellationSignal;
-import android.os.RemoteException;
-import android.service.autofill.Dataset;
-import android.service.autofill.FillResponse;
-import android.service.autofill.IFillCallback;
-import android.service.autofill.SaveInfo;
-import android.text.TextUtils;
-import android.text.format.DateUtils;
-import android.util.Slog;
-import android.view.autofill.AutofillId;
-import android.view.autofill.IAutoFillManagerClient;
-import android.view.inputmethod.InlineSuggestionsRequest;
-
-import com.android.internal.annotations.GuardedBy;
-import com.android.internal.infra.AndroidFuture;
-
-import java.util.List;
-import java.util.concurrent.CancellationException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.atomic.AtomicReference;
-
-/**
- * Maintains a client suggestions session with the
- * {@link android.view.autofill.AutofillRequestCallback} through the {@link IAutoFillManagerClient}.
- *
- */
-final class ClientSuggestionsSession {
-
- private static final String TAG = "ClientSuggestionsSession";
- private static final long TIMEOUT_REMOTE_REQUEST_MILLIS = 15 * DateUtils.SECOND_IN_MILLIS;
-
- private final int mSessionId;
- private final IAutoFillManagerClient mClient;
- private final Handler mHandler;
- private final ComponentName mComponentName;
-
- private final RemoteFillService.FillServiceCallbacks mCallbacks;
-
- private final Object mLock = new Object();
- @GuardedBy("mLock")
- private AndroidFuture<FillResponse> mPendingFillRequest;
- @GuardedBy("mLock")
- private int mPendingFillRequestId = INVALID_REQUEST_ID;
-
- ClientSuggestionsSession(int sessionId, IAutoFillManagerClient client, Handler handler,
- ComponentName componentName, RemoteFillService.FillServiceCallbacks callbacks) {
- mSessionId = sessionId;
- mClient = client;
- mHandler = handler;
- mComponentName = componentName;
- mCallbacks = callbacks;
- }
-
- void onFillRequest(int requestId, InlineSuggestionsRequest inlineRequest, int flags) {
- final AtomicReference<ICancellationSignal> cancellationSink = new AtomicReference<>();
- final AtomicReference<AndroidFuture<FillResponse>> futureRef = new AtomicReference<>();
- final AndroidFuture<FillResponse> fillRequest = new AndroidFuture<>();
-
- mHandler.post(() -> {
- if (sVerbose) {
- Slog.v(TAG, "calling onFillRequest() for id=" + requestId);
- }
-
- try {
- mClient.requestFillFromClient(requestId, inlineRequest,
- new FillCallbackImpl(fillRequest, futureRef, cancellationSink));
- } catch (RemoteException e) {
- fillRequest.completeExceptionally(e);
- }
- });
-
- fillRequest.orTimeout(TIMEOUT_REMOTE_REQUEST_MILLIS, TimeUnit.MILLISECONDS);
- futureRef.set(fillRequest);
-
- synchronized (mLock) {
- mPendingFillRequest = fillRequest;
- mPendingFillRequestId = requestId;
- }
-
- fillRequest.whenComplete((res, err) -> mHandler.post(() -> {
- synchronized (mLock) {
- mPendingFillRequest = null;
- mPendingFillRequestId = INVALID_REQUEST_ID;
- }
- if (err == null) {
- processAutofillId(res);
- mCallbacks.onFillRequestSuccess(requestId, res,
- mComponentName.getPackageName(), flags);
- } else {
- Slog.e(TAG, "Error calling on client fill request", err);
- if (err instanceof TimeoutException) {
- dispatchCancellationSignal(cancellationSink.get());
- mCallbacks.onFillRequestTimeout(requestId);
- } else if (err instanceof CancellationException) {
- dispatchCancellationSignal(cancellationSink.get());
- } else {
- mCallbacks.onFillRequestFailure(requestId, err.getMessage());
- }
- }
- }));
- }
-
- /**
- * Gets the application info for the component.
- */
- @Nullable
- static ApplicationInfo getAppInfo(ComponentName comp, @UserIdInt int userId) {
- try {
- ApplicationInfo si = AppGlobals.getPackageManager().getApplicationInfo(
- comp.getPackageName(),
- PackageManager.GET_META_DATA,
- userId);
- if (si != null) {
- return si;
- }
- } catch (RemoteException e) {
- }
- return null;
- }
-
- /**
- * Gets the user-visible name of the application.
- */
- @Nullable
- @GuardedBy("mLock")
- static CharSequence getAppLabelLocked(Context context, ApplicationInfo appInfo) {
- return appInfo == null ? null : appInfo.loadSafeLabel(
- context.getPackageManager(), 0 /* do not ellipsize */,
- TextUtils.SAFE_STRING_FLAG_FIRST_LINE | TextUtils.SAFE_STRING_FLAG_TRIM);
- }
-
- /**
- * Gets the user-visible icon of the application.
- */
- @Nullable
- @GuardedBy("mLock")
- static Drawable getAppIconLocked(Context context, ApplicationInfo appInfo) {
- return appInfo == null ? null : appInfo.loadIcon(context.getPackageManager());
- }
-
- int cancelCurrentRequest() {
- synchronized (mLock) {
- return mPendingFillRequest != null && mPendingFillRequest.cancel(false)
- ? mPendingFillRequestId
- : INVALID_REQUEST_ID;
- }
- }
-
- /**
- * The {@link AutofillId} which the client gets from its view is not contain the session id,
- * but Autofill framework is using the {@link AutofillId} with a session id. So before using
- * those ids in the Autofill framework, applies the current session id.
- *
- * @param res which response need to apply for a session id
- */
- private void processAutofillId(FillResponse res) {
- if (res == null) {
- return;
- }
-
- final List<Dataset> datasets = res.getDatasets();
- if (datasets != null && !datasets.isEmpty()) {
- for (int i = 0; i < datasets.size(); i++) {
- final Dataset dataset = datasets.get(i);
- if (dataset != null) {
- applySessionId(dataset.getFieldIds());
- }
- }
- }
-
- final SaveInfo saveInfo = res.getSaveInfo();
- if (saveInfo != null) {
- applySessionId(saveInfo.getOptionalIds());
- applySessionId(saveInfo.getRequiredIds());
- applySessionId(saveInfo.getSanitizerValues());
- applySessionId(saveInfo.getTriggerId());
- }
- }
-
- private void applySessionId(List<AutofillId> ids) {
- if (ids == null || ids.isEmpty()) {
- return;
- }
-
- for (int i = 0; i < ids.size(); i++) {
- applySessionId(ids.get(i));
- }
- }
-
- private void applySessionId(AutofillId[][] ids) {
- if (ids == null) {
- return;
- }
- for (int i = 0; i < ids.length; i++) {
- applySessionId(ids[i]);
- }
- }
-
- private void applySessionId(AutofillId[] ids) {
- if (ids == null) {
- return;
- }
- for (int i = 0; i < ids.length; i++) {
- applySessionId(ids[i]);
- }
- }
-
- private void applySessionId(AutofillId id) {
- if (id == null) {
- return;
- }
- id.setSessionId(mSessionId);
- }
-
- private void dispatchCancellationSignal(@Nullable ICancellationSignal signal) {
- if (signal == null) {
- return;
- }
- try {
- signal.cancel();
- } catch (RemoteException e) {
- Slog.e(TAG, "Error requesting a cancellation", e);
- }
- }
-
- private class FillCallbackImpl extends IFillCallback.Stub {
- final AndroidFuture<FillResponse> mFillRequest;
- final AtomicReference<AndroidFuture<FillResponse>> mFutureRef;
- final AtomicReference<ICancellationSignal> mCancellationSink;
-
- FillCallbackImpl(AndroidFuture<FillResponse> fillRequest,
- AtomicReference<AndroidFuture<FillResponse>> futureRef,
- AtomicReference<ICancellationSignal> cancellationSink) {
- mFillRequest = fillRequest;
- mFutureRef = futureRef;
- mCancellationSink = cancellationSink;
- }
-
- @Override
- public void onCancellable(ICancellationSignal cancellation) {
- AndroidFuture<FillResponse> future = mFutureRef.get();
- if (future != null && future.isCancelled()) {
- dispatchCancellationSignal(cancellation);
- } else {
- mCancellationSink.set(cancellation);
- }
- }
-
- @Override
- public void onSuccess(FillResponse response) {
- mFillRequest.complete(response);
- }
-
- @Override
- public void onFailure(int requestId, CharSequence message) {
- String errorMessage = message == null ? "" : String.valueOf(message);
- mFillRequest.completeExceptionally(
- new RuntimeException(errorMessage));
- }
- }
-}
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java
index 042631d..320047f 100644
--- a/services/autofill/java/com/android/server/autofill/Session.java
+++ b/services/autofill/java/com/android/server/autofill/Session.java
@@ -26,7 +26,6 @@
import static android.view.autofill.AutofillManager.ACTION_VALUE_CHANGED;
import static android.view.autofill.AutofillManager.ACTION_VIEW_ENTERED;
import static android.view.autofill.AutofillManager.ACTION_VIEW_EXITED;
-import static android.view.autofill.AutofillManager.FLAG_ENABLED_CLIENT_SUGGESTIONS;
import static android.view.autofill.AutofillManager.FLAG_SMART_SUGGESTION_SYSTEM;
import static android.view.autofill.AutofillManager.getSmartSuggestionModeToString;
@@ -54,7 +53,6 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
-import android.content.pm.ApplicationInfo;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
@@ -348,9 +346,6 @@
*/
private final AssistDataReceiverImpl mAssistReceiver = new AssistDataReceiverImpl();
- @Nullable
- private ClientSuggestionsSession mClientSuggestionsSession;
-
void onSwitchInputMethodLocked() {
// One caveat is that for the case where the focus is on a field for which regular autofill
// returns null, and augmented autofill is triggered, and then the user switches the input
@@ -421,10 +416,6 @@
/** Whether the current {@link FillResponse} is expired. */
@GuardedBy("mLock")
private boolean mExpiredResponse;
-
- /** Whether the client is using {@link android.view.autofill.AutofillRequestCallback}. */
- @GuardedBy("mLock")
- private boolean mClientSuggestionsEnabled;
}
/**
@@ -450,19 +441,13 @@
return;
}
mPendingInlineSuggestionsRequest = inlineSuggestionsRequest;
- maybeRequestFillFromServiceLocked();
+ maybeRequestFillLocked();
viewState.resetState(ViewState.STATE_PENDING_CREATE_INLINE_REQUEST);
}
} : null;
}
- void newAutofillRequestLocked(@Nullable InlineSuggestionsRequest inlineRequest) {
- mPendingFillRequest = null;
- mWaitForInlineRequest = inlineRequest != null;
- mPendingInlineSuggestionsRequest = inlineRequest;
- }
-
- void maybeRequestFillFromServiceLocked() {
+ void maybeRequestFillLocked() {
if (mPendingFillRequest == null) {
return;
}
@@ -472,12 +457,9 @@
return;
}
- if (mPendingInlineSuggestionsRequest.isServiceSupported()) {
- mPendingFillRequest = new FillRequest(mPendingFillRequest.getId(),
- mPendingFillRequest.getFillContexts(),
- mPendingFillRequest.getClientState(),
- mPendingFillRequest.getFlags(), mPendingInlineSuggestionsRequest);
- }
+ mPendingFillRequest = new FillRequest(mPendingFillRequest.getId(),
+ mPendingFillRequest.getFillContexts(), mPendingFillRequest.getClientState(),
+ mPendingFillRequest.getFlags(), mPendingInlineSuggestionsRequest);
}
mRemoteFillService.onFillRequest(mPendingFillRequest);
@@ -584,7 +566,7 @@
/*inlineSuggestionsRequest=*/null);
mPendingFillRequest = request;
- maybeRequestFillFromServiceLocked();
+ maybeRequestFillLocked();
}
if (mActivityToken != null) {
@@ -746,39 +728,30 @@
}
/**
- * Cancels the last request sent to the {@link #mRemoteFillService} or the
- * {@link #mClientSuggestionsSession}.
+ * Cancels the last request sent to the {@link #mRemoteFillService}.
*/
@GuardedBy("mLock")
private void cancelCurrentRequestLocked() {
- if (mRemoteFillService == null && mClientSuggestionsSession == null) {
- wtf(null, "cancelCurrentRequestLocked() called without a remote service or a "
- + "client suggestions session. mForAugmentedAutofillOnly: %s",
- mSessionFlags.mAugmentedAutofillOnly);
+ if (mRemoteFillService == null) {
+ wtf(null, "cancelCurrentRequestLocked() called without a remote service. "
+ + "mForAugmentedAutofillOnly: %s", mSessionFlags.mAugmentedAutofillOnly);
return;
}
+ final int canceledRequest = mRemoteFillService.cancelCurrentRequest();
- if (mRemoteFillService != null) {
- final int canceledRequest = mRemoteFillService.cancelCurrentRequest();
+ // Remove the FillContext as there will never be a response for the service
+ if (canceledRequest != INVALID_REQUEST_ID && mContexts != null) {
+ final int numContexts = mContexts.size();
- // Remove the FillContext as there will never be a response for the service
- if (canceledRequest != INVALID_REQUEST_ID && mContexts != null) {
- final int numContexts = mContexts.size();
-
- // It is most likely the last context, hence search backwards
- for (int i = numContexts - 1; i >= 0; i--) {
- if (mContexts.get(i).getRequestId() == canceledRequest) {
- if (sDebug) Slog.d(TAG, "cancelCurrentRequest(): id = " + canceledRequest);
- mContexts.remove(i);
- break;
- }
+ // It is most likely the last context, hence search backwards
+ for (int i = numContexts - 1; i >= 0; i--) {
+ if (mContexts.get(i).getRequestId() == canceledRequest) {
+ if (sDebug) Slog.d(TAG, "cancelCurrentRequest(): id = " + canceledRequest);
+ mContexts.remove(i);
+ break;
}
}
}
-
- if (mClientSuggestionsSession != null) {
- mClientSuggestionsSession.cancelCurrentRequest();
- }
}
private boolean isViewFocusedLocked(int flags) {
@@ -843,30 +816,17 @@
// structure is taken. This causes only one fill request per burst of focus changes.
cancelCurrentRequestLocked();
- // Only ask IME to create inline suggestions request when
- // 1. Autofill provider supports it or client enabled client suggestions.
- // 2. The render service is available.
- // 3. The view is focused. (The view may not be focused if the autofill is triggered
- // manually.)
+ // Only ask IME to create inline suggestions request if Autofill provider supports it and
+ // the render service is available except the autofill is triggered manually and the view
+ // is also not focused.
final RemoteInlineSuggestionRenderService remoteRenderService =
mService.getRemoteInlineSuggestionRenderServiceLocked();
- if ((mSessionFlags.mInlineSupportedByService || mSessionFlags.mClientSuggestionsEnabled)
+ if (mSessionFlags.mInlineSupportedByService
&& remoteRenderService != null
&& isViewFocusedLocked(flags)) {
- Consumer<InlineSuggestionsRequest> inlineSuggestionsRequestConsumer;
- if (mSessionFlags.mClientSuggestionsEnabled) {
- final int finalRequestId = requestId;
- inlineSuggestionsRequestConsumer = (inlineSuggestionsRequest) -> {
- // Using client suggestions
- synchronized (mLock) {
- onClientFillRequestLocked(finalRequestId, inlineSuggestionsRequest);
- }
- viewState.resetState(ViewState.STATE_PENDING_CREATE_INLINE_REQUEST);
- };
- } else {
- inlineSuggestionsRequestConsumer = mAssistReceiver.newAutofillRequestLocked(
- viewState, /* isInlineRequest= */ true);
- }
+ Consumer<InlineSuggestionsRequest> inlineSuggestionsRequestConsumer =
+ mAssistReceiver.newAutofillRequestLocked(viewState,
+ /* isInlineRequest= */ true);
if (inlineSuggestionsRequestConsumer != null) {
final AutofillId focusedId = mCurrentViewId;
final int requestIdCopy = requestId;
@@ -882,24 +842,11 @@
);
viewState.setState(ViewState.STATE_PENDING_CREATE_INLINE_REQUEST);
}
- } else if (mSessionFlags.mClientSuggestionsEnabled) {
- // Request client suggestions for the dropdown mode
- onClientFillRequestLocked(requestId, null);
} else {
mAssistReceiver.newAutofillRequestLocked(viewState, /* isInlineRequest= */ false);
}
- if (mSessionFlags.mClientSuggestionsEnabled) {
- // Using client suggestions, unnecessary request AssistStructure
- return;
- }
-
// Now request the assist structure data.
- requestAssistStructureLocked(requestId, flags);
- }
-
- @GuardedBy("mLock")
- private void requestAssistStructureLocked(int requestId, int flags) {
try {
final Bundle receiverExtras = new Bundle();
receiverExtras.putInt(EXTRA_REQUEST_ID, requestId);
@@ -948,13 +895,10 @@
mComponentName = componentName;
mCompatMode = compatMode;
mSessionState = STATE_ACTIVE;
-
synchronized (mLock) {
mSessionFlags = new SessionFlags();
mSessionFlags.mAugmentedAutofillOnly = forAugmentedAutofillOnly;
mSessionFlags.mInlineSupportedByService = mService.isInlineSuggestionsEnabledLocked();
- mSessionFlags.mClientSuggestionsEnabled =
- (mFlags & FLAG_ENABLED_CLIENT_SUGGESTIONS) != 0;
setClientLocked(client);
}
@@ -1066,13 +1010,12 @@
if (requestLog != null) {
requestLog.addTaggedData(MetricsEvent.FIELD_AUTOFILL_NUM_DATASETS, -1);
}
- processNullResponseOrFallbackLocked(requestId, requestFlags);
+ processNullResponseLocked(requestId, requestFlags);
return;
}
fieldClassificationIds = response.getFieldClassificationIds();
- if (!mSessionFlags.mClientSuggestionsEnabled && fieldClassificationIds != null
- && !mService.isFieldClassificationEnabledLocked()) {
+ if (fieldClassificationIds != null && !mService.isFieldClassificationEnabledLocked()) {
Slog.w(TAG, "Ignoring " + response + " because field detection is disabled");
processNullResponseLocked(requestId, requestFlags);
return;
@@ -1151,26 +1094,6 @@
}
}
- @GuardedBy("mLock")
- private void processNullResponseOrFallbackLocked(int requestId, int flags) {
- if (!mSessionFlags.mClientSuggestionsEnabled) {
- processNullResponseLocked(requestId, flags);
- return;
- }
-
- // fallback to the default platform password manager
- mSessionFlags.mClientSuggestionsEnabled = false;
-
- final InlineSuggestionsRequest inlineRequest =
- (mLastInlineSuggestionsRequest != null
- && mLastInlineSuggestionsRequest.first == requestId)
- ? mLastInlineSuggestionsRequest.second : null;
- mAssistReceiver.newAutofillRequestLocked(inlineRequest);
- requestAssistStructureLocked(requestId,
- flags & ~FLAG_ENABLED_CLIENT_SUGGESTIONS);
- return;
- }
-
// FillServiceCallbacks
@Override
public void onFillRequestFailure(int requestId, @Nullable CharSequence message) {
@@ -3109,22 +3032,13 @@
filterText = value.getTextValue().toString();
}
- final CharSequence targetLabel;
- final Drawable targetIcon;
+ final CharSequence serviceLabel;
+ final Drawable serviceIcon;
synchronized (mLock) {
- if (mSessionFlags.mClientSuggestionsEnabled) {
- final ApplicationInfo appInfo = ClientSuggestionsSession.getAppInfo(mComponentName,
- mService.getUserId());
- targetLabel = ClientSuggestionsSession.getAppLabelLocked(
- mService.getMaster().getContext(), appInfo);
- targetIcon = ClientSuggestionsSession.getAppIconLocked(
- mService.getMaster().getContext(), appInfo);
- } else {
- targetLabel = mService.getServiceLabelLocked();
- targetIcon = mService.getServiceIconLocked();
- }
+ serviceLabel = mService.getServiceLabelLocked();
+ serviceIcon = mService.getServiceIconLocked();
}
- if (targetLabel == null || targetIcon == null) {
+ if (serviceLabel == null || serviceIcon == null) {
wtf(null, "onFillReady(): no service label or icon");
return;
}
@@ -3144,7 +3058,7 @@
getUiForShowing().showFillUi(filledId, response, filterText,
mService.getServicePackageName(), mComponentName,
- targetLabel, targetIcon, this, id, mCompatMode);
+ serviceLabel, serviceIcon, this, id, mCompatMode);
mService.logDatasetShown(id, mClientState);
@@ -3191,17 +3105,6 @@
return false;
}
- final InlineSuggestionsRequest request = inlineSuggestionsRequest.get();
- if (mSessionFlags.mClientSuggestionsEnabled && !request.isClientSupported()
- || !mSessionFlags.mClientSuggestionsEnabled && !request.isServiceSupported()) {
- if (sDebug) {
- Slog.d(TAG, "Inline suggestions not supported for "
- + (mSessionFlags.mClientSuggestionsEnabled ? "client" : "service")
- + ". Falling back to dropdown.");
- }
- return false;
- }
-
final RemoteInlineSuggestionRenderService remoteRenderService =
mService.getRemoteInlineSuggestionRenderServiceLocked();
if (remoteRenderService == null) {
@@ -3210,7 +3113,7 @@
}
final InlineFillUi.InlineFillUiInfo inlineFillUiInfo =
- new InlineFillUi.InlineFillUiInfo(request, focusedId,
+ new InlineFillUi.InlineFillUiInfo(inlineSuggestionsRequest.get(), focusedId,
filterText, remoteRenderService, userId, id);
InlineFillUi inlineFillUi = InlineFillUi.forAutofill(inlineFillUiInfo, response,
new InlineFillUi.InlineSuggestionUiCallback() {
@@ -3812,25 +3715,6 @@
}
}
- @GuardedBy("mLock")
- private void onClientFillRequestLocked(int requestId,
- InlineSuggestionsRequest inlineSuggestionsRequest) {
- if (mClientSuggestionsSession == null) {
- mClientSuggestionsSession = new ClientSuggestionsSession(id, mClient, mHandler,
- mComponentName, this);
- }
-
- if (mContexts == null) {
- mContexts = new ArrayList<>(1);
- }
-
- if (inlineSuggestionsRequest != null && !inlineSuggestionsRequest.isClientSupported()) {
- inlineSuggestionsRequest = null;
- }
-
- mClientSuggestionsSession.onFillRequest(requestId, inlineSuggestionsRequest, mFlags);
- }
-
/**
* The result of checking whether to show the save dialog, when session can be saved.
*
diff --git a/services/core/Android.bp b/services/core/Android.bp
index 44307ef7..55b982b 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
@@ -21,7 +21,7 @@
name: "services.core-sources",
srcs: ["java/**/*.java"],
exclude_srcs: [
- ":services.core-sources-am-wm"
+ ":services.core-sources-am-wm",
],
path: "java",
visibility: [
@@ -38,13 +38,13 @@
],
tools: ["protologtool"],
cmd: "$(location protologtool) transform-protolog-calls " +
- "--protolog-class com.android.internal.protolog.common.ProtoLog " +
- "--protolog-impl-class com.android.internal.protolog.ProtoLogImpl " +
- "--protolog-cache-class 'com.android.server.wm.ProtoLogCache' " +
- "--loggroups-class com.android.internal.protolog.ProtoLogGroup " +
- "--loggroups-jar $(location :protolog-groups) " +
- "--output-srcjar $(out) " +
- "$(locations :services.core-sources-am-wm)",
+ "--protolog-class com.android.internal.protolog.common.ProtoLog " +
+ "--protolog-impl-class com.android.internal.protolog.ProtoLogImpl " +
+ "--protolog-cache-class 'com.android.server.wm.ProtoLogCache' " +
+ "--loggroups-class com.android.internal.protolog.ProtoLogGroup " +
+ "--loggroups-jar $(location :protolog-groups) " +
+ "--output-srcjar $(out) " +
+ "$(locations :services.core-sources-am-wm)",
out: ["services.core.protolog.srcjar"],
}
@@ -56,11 +56,11 @@
],
tools: ["protologtool"],
cmd: "$(location protologtool) generate-viewer-config " +
- "--protolog-class com.android.internal.protolog.common.ProtoLog " +
- "--loggroups-class com.android.internal.protolog.ProtoLogGroup " +
- "--loggroups-jar $(location :protolog-groups) " +
- "--viewer-conf $(out) " +
- "$(locations :services.core-sources-am-wm)",
+ "--protolog-class com.android.internal.protolog.common.ProtoLog " +
+ "--loggroups-class com.android.internal.protolog.ProtoLogGroup " +
+ "--loggroups-jar $(location :protolog-groups) " +
+ "--viewer-conf $(out) " +
+ "$(locations :services.core-sources-am-wm)",
out: ["services.core.protolog.json"],
}
@@ -71,12 +71,12 @@
":services.core.protolog.json",
],
cmd: "cp $(location :generate-protolog.json) $(out) && " +
- "{ ! (diff $(out) $(location :services.core.protolog.json) | grep -q '^<') || " +
- "{ echo -e '\\n\\n################################################################\\n#\\n" +
- "# ERROR: ProtoLog viewer config is stale. To update it, run:\\n#\\n" +
- "# cp $(location :generate-protolog.json) " +
- "$(location :services.core.protolog.json)\\n#\\n" +
- "################################################################\\n\\n' >&2 && false; } }",
+ "{ ! (diff $(out) $(location :services.core.protolog.json) | grep -q '^<') || " +
+ "{ echo -e '\\n\\n################################################################\\n#\\n" +
+ "# ERROR: ProtoLog viewer config is stale. To update it, run:\\n#\\n" +
+ "# cp $(location :generate-protolog.json) " +
+ "$(location :services.core.protolog.json)\\n#\\n" +
+ "################################################################\\n\\n' >&2 && false; } }",
out: ["services.core.protolog.json"],
}
@@ -84,7 +84,7 @@
name: "statslog-art-java-gen",
tools: ["stats-log-api-gen"],
cmd: "$(location stats-log-api-gen) --java $(out) --module art" +
- " --javaPackage com.android.internal.art --javaClass ArtStatsLog --worksource",
+ " --javaPackage com.android.internal.art --javaClass ArtStatsLog --worksource",
out: ["com/android/internal/art/ArtStatsLog.java"],
}
@@ -185,7 +185,7 @@
java_library_host {
name: "core_cts_test_resources",
- srcs: ["java/com/android/server/notification/SmallHash.java"]
+ srcs: ["java/com/android/server/notification/SmallHash.java"],
}
prebuilt_etc {
@@ -209,7 +209,6 @@
filegroup {
name: "services.core-sources-deviceconfig-interface",
srcs: [
- "java/com/android/server/utils/DeviceConfigInterface.java"
+ "java/com/android/server/utils/DeviceConfigInterface.java",
],
}
-
diff --git a/services/core/java/android/content/pm/PackageManagerInternal.java b/services/core/java/android/content/pm/PackageManagerInternal.java
index 76a6c0e..9299624 100644
--- a/services/core/java/android/content/pm/PackageManagerInternal.java
+++ b/services/core/java/android/content/pm/PackageManagerInternal.java
@@ -382,10 +382,10 @@
int deviceOwnerUserId, String deviceOwner, SparseArray<String> profileOwners);
/**
- * Called by DevicePolicyManagerService to set the package names protected by the device
- * owner.
+ * Called by Owners to set the package names protected by the device owner.
*/
- public abstract void setDeviceOwnerProtectedPackages(List<String> packageNames);
+ public abstract void setDeviceOwnerProtectedPackages(
+ String deviceOwnerPackageName, List<String> packageNames);
/**
* Returns {@code true} if a given package can't be wiped. Otherwise, returns {@code false}.
diff --git a/services/core/java/com/android/server/SensorPrivacyService.java b/services/core/java/com/android/server/SensorPrivacyService.java
index baec544..2bf4edc 100644
--- a/services/core/java/com/android/server/SensorPrivacyService.java
+++ b/services/core/java/com/android/server/SensorPrivacyService.java
@@ -26,7 +26,6 @@
import static android.app.AppOpsManager.OP_PHONE_CALL_CAMERA;
import static android.app.AppOpsManager.OP_PHONE_CALL_MICROPHONE;
import static android.app.AppOpsManager.OP_RECORD_AUDIO;
-import static android.app.AppOpsManager.OP_RECORD_AUDIO_HOTWORD;
import static android.content.Intent.EXTRA_PACKAGE_NAME;
import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
@@ -55,12 +54,14 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
+import android.content.pm.UserInfo;
import android.graphics.drawable.Icon;
import android.hardware.ISensorPrivacyListener;
import android.hardware.ISensorPrivacyManager;
import android.hardware.SensorPrivacyManager;
import android.hardware.SensorPrivacyManagerInternal;
import android.os.Binder;
+import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.IBinder;
@@ -72,10 +73,12 @@
import android.os.ShellCallback;
import android.os.ShellCommand;
import android.os.UserHandle;
+import android.os.UserManager;
import android.provider.Settings;
import android.service.SensorPrivacyIndividualEnabledSensorProto;
import android.service.SensorPrivacyServiceDumpProto;
import android.service.SensorPrivacyUserProto;
+import android.service.voice.VoiceInteractionManagerInternal;
import android.telephony.TelephonyCallback;
import android.telephony.TelephonyManager;
import android.telephony.emergency.EmergencyNumber;
@@ -164,6 +167,8 @@
private EmergencyCallHelper mEmergencyCallHelper;
private KeyguardManager mKeyguardManager;
+ private int mCurrentUser = -1;
+
public SensorPrivacyService(Context context) {
super(context);
mContext = context;
@@ -172,7 +177,21 @@
mActivityManager = context.getSystemService(ActivityManager.class);
mActivityTaskManager = context.getSystemService(ActivityTaskManager.class);
mTelephonyManager = context.getSystemService(TelephonyManager.class);
+
mSensorPrivacyServiceImpl = new SensorPrivacyServiceImpl();
+
+ mUserManagerInternal.addUserLifecycleListener(
+ new UserManagerInternal.UserLifecycleListener() {
+ @Override
+ public void onUserCreated(UserInfo user, Object token) {
+ setCurrentUserRestriction();
+ }
+
+ @Override
+ public void onUserRemoved(UserInfo user) {
+ removeUserRestrictions(user.id);
+ }
+ });
}
@Override
@@ -191,9 +210,23 @@
}
}
+ @Override
+ public void onUserStarting(TargetUser user) {
+ if (mCurrentUser == -1) {
+ mCurrentUser = user.getUserIdentifier();
+ setCurrentUserRestriction();
+ }
+ }
+
+ @Override
+ public void onUserSwitching(TargetUser from, TargetUser to) {
+ mCurrentUser = to.getUserIdentifier();
+ setCurrentUserRestriction();
+ }
+
class SensorPrivacyServiceImpl extends ISensorPrivacyManager.Stub implements
AppOpsManager.OnOpNotedListener, AppOpsManager.OnOpStartedListener,
- IBinder.DeathRecipient {
+ IBinder.DeathRecipient, UserManagerInternal.UserRestrictionsListener {
private final SensorPrivacyHandler mHandler;
private final Object mLock = new Object();
@@ -280,6 +313,21 @@
}
}, new IntentFilter(ACTION_DISABLE_INDIVIDUAL_SENSOR_PRIVACY),
MANAGE_SENSOR_PRIVACY, null);
+ mUserManagerInternal.addUserRestrictionsListener(this);
+ }
+
+ @Override
+ public void onUserRestrictionsChanged(int userId, Bundle newRestrictions,
+ Bundle prevRestrictions) {
+ // Reset sensor privacy when restriction is added
+ if (!prevRestrictions.getBoolean(UserManager.DISALLOW_CAMERA_TOGGLE)
+ && newRestrictions.getBoolean(UserManager.DISALLOW_CAMERA_TOGGLE)) {
+ setIndividualSensorPrivacyUnchecked(userId, CAMERA, false);
+ }
+ if (!prevRestrictions.getBoolean(UserManager.DISALLOW_MICROPHONE_TOGGLE)
+ && newRestrictions.getBoolean(UserManager.DISALLOW_MICROPHONE_TOGGLE)) {
+ setIndividualSensorPrivacyUnchecked(userId, MICROPHONE, false);
+ }
}
@Override
@@ -402,6 +450,15 @@
}
}
+ VoiceInteractionManagerInternal voiceInteractionManagerInternal =
+ LocalServices.getService(VoiceInteractionManagerInternal.class);
+
+ if (sensor == MICROPHONE && voiceInteractionManagerInternal != null
+ && voiceInteractionManagerInternal.hasActiveSession(packageName)) {
+ enqueueSensorUseReminderDialogAsync(-1, user, packageName, sensor);
+ return;
+ }
+
Log.i(TAG, packageName + "/" + uid + " started using sensor " + sensor
+ " but no activity or foreground service was running. The user will not be"
+ " informed. System components should check if sensor privacy is enabled for"
@@ -608,6 +665,17 @@
return false;
}
+ if (sensor == MICROPHONE && mUserManagerInternal.getUserRestriction(userId,
+ UserManager.DISALLOW_MICROPHONE_TOGGLE)) {
+ Log.i(TAG, "Can't change mic toggle due to admin restriction");
+ return false;
+ }
+
+ if (sensor == CAMERA && mUserManagerInternal.getUserRestriction(userId,
+ UserManager.DISALLOW_CAMERA_TOGGLE)) {
+ Log.i(TAG, "Can't change camera toggle due to admin restriction");
+ return false;
+ }
return true;
}
@@ -1318,17 +1386,45 @@
}
private void setUserRestriction(int userId, int sensor, boolean enabled) {
- if (sensor == CAMERA) {
- mAppOpsManager.setUserRestrictionForUser(OP_CAMERA, enabled,
- mAppOpsRestrictionToken, null, userId);
- } else if (sensor == MICROPHONE) {
- mAppOpsManager.setUserRestrictionForUser(OP_RECORD_AUDIO, enabled,
- mAppOpsRestrictionToken, null, userId);
- mAppOpsManager.setUserRestrictionForUser(OP_RECORD_AUDIO_HOTWORD, enabled,
- mAppOpsRestrictionToken, null, userId);
+ if (userId == mCurrentUser) {
+ setCurrentUserRestriction(sensor, enabled);
}
}
+ private void setCurrentUserRestriction() {
+ boolean micState = mSensorPrivacyServiceImpl
+ .isIndividualSensorPrivacyEnabled(mCurrentUser, MICROPHONE);
+ boolean camState = mSensorPrivacyServiceImpl
+ .isIndividualSensorPrivacyEnabled(mCurrentUser, CAMERA);
+
+ setCurrentUserRestriction(MICROPHONE, micState);
+ setCurrentUserRestriction(CAMERA, camState);
+ }
+
+ private void setCurrentUserRestriction(int sensor, boolean enabled) {
+ int[] userIds = mUserManagerInternal.getUserIds();
+ int code;
+ if (sensor == MICROPHONE) {
+ code = OP_RECORD_AUDIO;
+ } else if (sensor == CAMERA) {
+ code = OP_CAMERA;
+ } else {
+ Log.w(TAG, "Invalid sensor id: " + sensor, new RuntimeException());
+ return;
+ }
+ for (int i = 0; i < userIds.length; i++) {
+ mAppOpsManager.setUserRestrictionForUser(code, enabled,
+ mAppOpsRestrictionToken, null, userIds[i], true);
+ }
+ }
+
+ private void removeUserRestrictions(int userId) {
+ mAppOpsManager.setUserRestrictionForUser(OP_RECORD_AUDIO, false,
+ mAppOpsRestrictionToken, null, userId, true);
+ mAppOpsManager.setUserRestrictionForUser(OP_CAMERA, false,
+ mAppOpsRestrictionToken, null, userId, true);
+ }
+
private final class DeathRecipient implements IBinder.DeathRecipient {
private ISensorPrivacyListener mListener;
diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java
index 0c785da..69c2926 100644
--- a/services/core/java/com/android/server/StorageManagerService.java
+++ b/services/core/java/com/android/server/StorageManagerService.java
@@ -248,9 +248,18 @@
@Override
public void onUserSwitching(@Nullable TargetUser from, @NonNull TargetUser to) {
- mStorageManagerService.mCurrentUserId = to.getUserIdentifier();
- // To reset public volume mounts
- mStorageManagerService.onUserSwitching(mStorageManagerService.mCurrentUserId);
+ int currentUserId = to.getUserIdentifier();
+ mStorageManagerService.mCurrentUserId = currentUserId;
+
+ UserManagerInternal umInternal = LocalServices.getService(UserManagerInternal.class);
+ if (umInternal.isUserUnlocked(currentUserId)) {
+ Slog.d(TAG, "Attempt remount volumes for user: " + currentUserId);
+ mStorageManagerService.maybeRemountVolumes(currentUserId);
+ mStorageManagerService.mRemountCurrentUserVolumesOnUnlock = false;
+ } else {
+ Slog.d(TAG, "Attempt remount volumes for user: " + currentUserId + " on unlock");
+ mStorageManagerService.mRemountCurrentUserVolumesOnUnlock = true;
+ }
}
@Override
@@ -425,6 +434,8 @@
private volatile int mCurrentUserId = UserHandle.USER_SYSTEM;
+ private volatile boolean mRemountCurrentUserVolumesOnUnlock = false;
+
private final Installer mInstaller;
/** Holding lock for AppFuse business */
@@ -1196,6 +1207,10 @@
}
mHandler.obtainMessage(H_COMPLETE_UNLOCK_USER, userId).sendToTarget();
+ if (mRemountCurrentUserVolumesOnUnlock && userId == mCurrentUserId) {
+ maybeRemountVolumes(userId);
+ mRemountCurrentUserVolumesOnUnlock = false;
+ }
}
private void completeUnlockUser(int userId) {
@@ -1255,7 +1270,7 @@
}
}
- private void onUserSwitching(int userId) {
+ private void maybeRemountVolumes(int userId) {
boolean reset = false;
List<VolumeInfo> volumesToRemount = new ArrayList<>();
synchronized (mLock) {
@@ -1272,6 +1287,7 @@
}
for (VolumeInfo vol : volumesToRemount) {
+ Slog.i(TAG, "Remounting volume for user: " + userId + ". Volume: " + vol);
mHandler.obtainMessage(H_VOLUME_UNMOUNT, vol).sendToTarget();
mHandler.obtainMessage(H_VOLUME_MOUNT, vol).sendToTarget();
}
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index aadb25c..0f3aa65 100644
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -16,6 +16,8 @@
package com.android.server.am;
+import static android.Manifest.permission.REQUEST_COMPANION_RUN_IN_BACKGROUND;
+import static android.Manifest.permission.REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND;
import static android.Manifest.permission.START_ACTIVITIES_FROM_BACKGROUND;
import static android.Manifest.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND;
import static android.app.ActivityManager.PROCESS_STATE_HEAVY_WEIGHT;
@@ -5831,6 +5833,26 @@
}
}
+ // Check for CDM apps with either REQUEST_COMPANION_RUN_IN_BACKGROUND or
+ // REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND.
+ // Note: When a CDM app has REQUEST_COMPANION_RUN_IN_BACKGROUND, the app is also put
+ // in the user-allowlist. However, in this case, we want to use the reason code
+ // REASON_COMPANION_DEVICE_MANAGER, so this check needs to be before the
+ // isAllowlistedForFgsStartLOSP check.
+ if (ret == REASON_DENIED) {
+ final boolean isCompanionApp = mAm.mInternal.isAssociatedCompanionApp(
+ UserHandle.getUserId(callingUid), callingUid);
+ if (isCompanionApp) {
+ if (isPermissionGranted(
+ REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND,
+ callingPid, callingUid)
+ || isPermissionGranted(REQUEST_COMPANION_RUN_IN_BACKGROUND,
+ callingPid, callingUid)) {
+ ret = REASON_COMPANION_DEVICE_MANAGER;
+ }
+ }
+ }
+
if (ret == REASON_DENIED) {
ActivityManagerService.FgsTempAllowListItem item =
mAm.isAllowlistedForFgsStartLOSP(callingUid);
@@ -5858,14 +5880,6 @@
}
if (ret == REASON_DENIED) {
- final boolean isCompanionApp = mAm.mInternal.isAssociatedCompanionApp(
- UserHandle.getUserId(callingUid), callingUid);
- if (isCompanionApp) {
- ret = REASON_COMPANION_DEVICE_MANAGER;
- }
- }
-
- if (ret == REASON_DENIED) {
final AppOpsManager appOpsManager = mAm.getAppOpsManager();
if (appOpsManager.checkOpNoThrow(AppOpsManager.OP_ACTIVATE_VPN, callingUid,
callingPackage) == AppOpsManager.MODE_ALLOWED) {
@@ -5884,6 +5898,10 @@
return ret;
}
+ private boolean isPermissionGranted(String permission, int callingPid, int callingUid) {
+ return mAm.checkPermission(permission, callingPid, callingUid) == PERMISSION_GRANTED;
+ }
+
private static boolean isFgsBgStart(@ReasonCode int code) {
return code != REASON_PROC_STATE_PERSISTENT
&& code != REASON_PROC_STATE_PERSISTENT_UI
diff --git a/services/core/java/com/android/server/am/ProcessStateRecord.java b/services/core/java/com/android/server/am/ProcessStateRecord.java
index 6429b79..801e382 100644
--- a/services/core/java/com/android/server/am/ProcessStateRecord.java
+++ b/services/core/java/com/android/server/am/ProcessStateRecord.java
@@ -25,7 +25,6 @@
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.os.PowerWhitelistManager.REASON_BACKGROUND_ACTIVITY_PERMISSION;
import static android.os.PowerWhitelistManager.REASON_BACKGROUND_FGS_PERMISSION;
-import static android.os.PowerWhitelistManager.REASON_COMPANION_DEVICE_MANAGER;
import static android.os.PowerWhitelistManager.REASON_DENIED;
import static android.os.PowerWhitelistManager.REASON_DEVICE_OWNER;
import static android.os.PowerWhitelistManager.REASON_PROFILE_OWNER;
@@ -1217,6 +1216,7 @@
mAllowStartFgs = mAllowStartFgsByPermission = ret;
}
+ // TODO(b/188063200) Clean up this method. Why do we need to duplicate only some of the checks?
@GuardedBy("mService")
void setAllowStartFgs() {
if (mAllowStartFgs != REASON_DENIED) {
@@ -1238,16 +1238,6 @@
}
if (mAllowStartFgs == REASON_DENIED) {
- if (mService.mInternal != null) {
- final boolean isCompanionApp = mService.mInternal.isAssociatedCompanionApp(
- UserHandle.getUserId(mApp.info.uid), mApp.info.uid);
- if (isCompanionApp) {
- mAllowStartFgs = REASON_COMPANION_DEVICE_MANAGER;
- }
- }
- }
-
- if (mAllowStartFgs == REASON_DENIED) {
// Is the calling UID a profile owner app?
if (mService.mInternal != null) {
if (mService.mInternal.isProfileOwner(mApp.info.uid)) {
diff --git a/services/core/java/com/android/server/app/GameManagerService.java b/services/core/java/com/android/server/app/GameManagerService.java
index d2c6c6c..1aeeda0 100644
--- a/services/core/java/com/android/server/app/GameManagerService.java
+++ b/services/core/java/com/android/server/app/GameManagerService.java
@@ -56,7 +56,6 @@
import android.provider.DeviceConfig;
import android.provider.DeviceConfig.Properties;
import android.util.ArrayMap;
-import android.util.ArraySet;
import android.util.KeyValueListParser;
import android.util.Slog;
@@ -363,19 +362,42 @@
|| (mPerfModeOptedIn && gameMode == GameManager.GAME_MODE_PERFORMANCE);
}
- public @GameMode int[] getAvailableGameModes() {
- ArraySet<Integer> modeSet = new ArraySet<>(mModeConfigs.keySet());
+ private int getAvailableGameModesBitfield() {
+ int field = 0;
+ for (final int mode : mModeConfigs.keySet()) {
+ field |= modeToBitmask(mode);
+ }
if (mBatteryModeOptedIn) {
- modeSet.add(GameManager.GAME_MODE_BATTERY);
+ field |= modeToBitmask(GameManager.GAME_MODE_BATTERY);
}
if (mPerfModeOptedIn) {
- modeSet.add(GameManager.GAME_MODE_PERFORMANCE);
+ field |= modeToBitmask(GameManager.GAME_MODE_PERFORMANCE);
}
- if (modeSet.size() > 0) {
- modeSet.add(GameManager.GAME_MODE_STANDARD);
- return modeSet.stream().mapToInt(Integer::intValue).toArray();
+ // The lowest bit is reserved for UNSUPPORTED, STANDARD is supported if we support any
+ // other mode.
+ if (field > 1) {
+ field |= modeToBitmask(GameManager.GAME_MODE_STANDARD);
+ } else {
+ field |= modeToBitmask(GameManager.GAME_MODE_UNSUPPORTED);
}
- return new int[]{GameManager.GAME_MODE_UNSUPPORTED};
+ return field;
+ }
+
+ /**
+ * Get an array of a package's available game modes.
+ */
+ public @GameMode int[] getAvailableGameModes() {
+
+ int modesBitfield = getAvailableGameModesBitfield();
+ int sigBits = Integer.bitCount(modesBitfield);
+ int[] modes = new int[sigBits];
+ int i = 0;
+ for (int mode = 0; mode < sigBits; ++mode) {
+ if (((modesBitfield >> mode) & 1) != 0) {
+ modes[i++] = mode;
+ }
+ }
+ return modes;
}
/**
@@ -696,6 +718,14 @@
}
}
+ private int modeToBitmask(@GameMode int gameMode) {
+ return (1 << gameMode);
+ }
+
+ private boolean bitFieldContainsModeBitmask(int bitField, @GameMode int gameMode) {
+ return (bitField & modeToBitmask(gameMode)) != 0;
+ }
+
/**
* @hide
*/
@@ -703,8 +733,8 @@
public void updateConfigsForUser(int userId, String ...packageNames) {
try {
synchronized (mDeviceConfigLock) {
- for (String packageName : packageNames) {
- GamePackageConfiguration config =
+ for (final String packageName : packageNames) {
+ final GamePackageConfiguration config =
new GamePackageConfiguration(packageName, userId);
if (config.isValid()) {
if (DEBUG) {
@@ -718,13 +748,42 @@
}
}
}
- for (String packageName : packageNames) {
- synchronized (mLock) {
- if (mSettings.containsKey(userId)) {
- GameManagerSettings userSettings = mSettings.get(userId);
- updateCompatModeDownscale(packageName,
- userSettings.getGameModeLocked(packageName));
+ for (final String packageName : packageNames) {
+ if (mSettings.containsKey(userId)) {
+ int gameMode = getGameMode(packageName, userId);
+ int newGameMode = gameMode;
+ // Make sure the user settings and package configs don't conflict. I.e. the
+ // user setting is set to a mode that no longer available due to config/manifest
+ // changes. Most of the time we won't have to change anything.
+ GamePackageConfiguration config;
+ synchronized (mDeviceConfigLock) {
+ config = mConfigs.get(packageName);
}
+ if (config != null) {
+ int modesBitfield = config.getAvailableGameModesBitfield();
+ // Remove UNSUPPORTED to simplify the logic here, since we really just
+ // want to check if we support selectable game modes
+ modesBitfield &= ~modeToBitmask(GameManager.GAME_MODE_UNSUPPORTED);
+ if (!bitFieldContainsModeBitmask(modesBitfield, gameMode)) {
+ if (bitFieldContainsModeBitmask(modesBitfield,
+ GameManager.GAME_MODE_STANDARD)) {
+ // If the current set mode isn't supported, but we support STANDARD,
+ // then set the mode to STANDARD.
+ newGameMode = GameManager.GAME_MODE_STANDARD;
+ } else {
+ // If we don't support any game modes, then set to UNSUPPORTED
+ newGameMode = GameManager.GAME_MODE_UNSUPPORTED;
+ }
+ }
+ } else if (gameMode != GameManager.GAME_MODE_UNSUPPORTED) {
+ // If we have no config for the package, but the configured mode is not
+ // UNSUPPORTED, then set to UNSUPPORTED
+ newGameMode = GameManager.GAME_MODE_UNSUPPORTED;
+ }
+ if (newGameMode != gameMode) {
+ setGameMode(packageName, newGameMode, userId);
+ }
+ updateCompatModeDownscale(packageName, gameMode);
}
}
} catch (Exception e) {
diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java
index b6aec836..3182913 100644
--- a/services/core/java/com/android/server/appop/AppOpsService.java
+++ b/services/core/java/com/android/server/appop/AppOpsService.java
@@ -4568,6 +4568,9 @@
// package is exempt from the restriction.
ClientRestrictionState restrictionState = mOpUserRestrictions.valueAt(i);
if (restrictionState.hasRestriction(code, packageName, attributionTag, userHandle)) {
+ if (restrictionState.rejectBypass(code, userHandle)) {
+ return true;
+ }
RestrictionBypass opBypass = opAllowSystemBypassRestriction(code);
if (opBypass != null) {
// If we are the system, bypass user restrictions for certain codes
@@ -6149,6 +6152,8 @@
for (int j = 0; j < restrictionCount; j++) {
int userId = restrictionState.perUserRestrictions.keyAt(j);
boolean[] restrictedOps = restrictionState.perUserRestrictions.valueAt(j);
+ boolean[] rejectBypassOps =
+ restrictionState.perUserRejectBypasses.valueAt(j);
if (restrictedOps == null) {
continue;
}
@@ -6173,6 +6178,9 @@
restrictedOpsValue.append(", ");
}
restrictedOpsValue.append(AppOpsManager.opToName(k));
+ if (rejectBypassOps != null && rejectBypassOps[k]) {
+ restrictedOpsValue.append(" rejectBypass=true");
+ }
}
}
restrictedOpsValue.append("]");
@@ -6253,14 +6261,14 @@
String restriction = AppOpsManager.opToRestriction(i);
if (restriction != null) {
setUserRestrictionNoCheck(i, restrictions.getBoolean(restriction, false), token,
- userHandle, null);
+ userHandle, null, false);
}
}
}
@Override
public void setUserRestriction(int code, boolean restricted, IBinder token, int userHandle,
- Map<String, String[]> excludedPackageTags) {
+ Map<String, String[]> excludedPackageTags, boolean rejectBypass) {
if (Binder.getCallingPid() != Process.myPid()) {
mContext.enforcePermission(Manifest.permission.MANAGE_APP_OPS_RESTRICTIONS,
Binder.getCallingPid(), Binder.getCallingUid(), null);
@@ -6276,11 +6284,12 @@
}
verifyIncomingOp(code);
Objects.requireNonNull(token);
- setUserRestrictionNoCheck(code, restricted, token, userHandle, excludedPackageTags);
+ setUserRestrictionNoCheck(code, restricted, token, userHandle, excludedPackageTags,
+ rejectBypass);
}
private void setUserRestrictionNoCheck(int code, boolean restricted, IBinder token,
- int userHandle, Map<String, String[]> excludedPackageTags) {
+ int userHandle, Map<String, String[]> excludedPackageTags, boolean rejectBypass) {
synchronized (AppOpsService.this) {
ClientRestrictionState restrictionState = mOpUserRestrictions.get(token);
@@ -6294,7 +6303,7 @@
}
if (restrictionState.setRestriction(code, restricted, excludedPackageTags,
- userHandle)) {
+ userHandle, rejectBypass)) {
mHandler.sendMessage(PooledLambda.obtainMessage(
AppOpsService::notifyWatchersOfChange, this, code, UID_ANY));
mHandler.sendMessage(PooledLambda.obtainMessage(
@@ -6825,8 +6834,10 @@
private final class ClientRestrictionState implements DeathRecipient {
private final IBinder token;
SparseArray<boolean[]> perUserRestrictions;
+ SparseArray<boolean[]> perUserRejectBypasses;
SparseArray<Map<String, String[]>> perUserExcludedPackageTags;
+
public ClientRestrictionState(IBinder token)
throws RemoteException {
token.linkToDeath(this, 0);
@@ -6834,13 +6845,17 @@
}
public boolean setRestriction(int code, boolean restricted,
- Map<String, String[]> excludedPackageTags, int userId) {
+ Map<String, String[]> excludedPackageTags, int userId, boolean rejectBypass) {
boolean changed = false;
if (perUserRestrictions == null && restricted) {
perUserRestrictions = new SparseArray<>();
}
+ if (perUserRejectBypasses == null && rejectBypass) {
+ perUserRejectBypasses = new SparseArray<>();
+ }
+
int[] users;
if (userId == UserHandle.USER_ALL) {
// TODO(b/162888972): this call is returning all users, not just live ones - we
@@ -6900,6 +6915,20 @@
}
changed = true;
}
+
+ boolean[] userRejectBypasses = perUserRejectBypasses.get(thisUserId);
+ if (userRejectBypasses == null && rejectBypass) {
+ userRejectBypasses = new boolean[AppOpsManager._NUM_OP];
+ perUserRejectBypasses.put(thisUserId, userRejectBypasses);
+ }
+ if (userRejectBypasses != null
+ && userRejectBypasses[code] != rejectBypass) {
+ userRejectBypasses[code] = rejectBypass;
+ if (!rejectBypass && isDefault(userRejectBypasses)) {
+ perUserRejectBypasses.remove(thisUserId);
+ }
+ changed = true;
+ }
}
}
}
@@ -6937,6 +6966,17 @@
return !ArrayUtils.contains(excludedTags, attributionTag);
}
+ public boolean rejectBypass(int restriction, int userId) {
+ if (perUserRejectBypasses == null) {
+ return false;
+ }
+ boolean[] rejectBypasses = perUserRejectBypasses.get(userId);
+ if (rejectBypasses == null) {
+ return false;
+ }
+ return rejectBypasses[restriction];
+ }
+
public void removeUser(int userId) {
if (perUserExcludedPackageTags != null) {
perUserExcludedPackageTags.remove(userId);
diff --git a/services/core/java/com/android/server/appop/DiscreteRegistry.java b/services/core/java/com/android/server/appop/DiscreteRegistry.java
index fc48b3f..99daa24 100644
--- a/services/core/java/com/android/server/appop/DiscreteRegistry.java
+++ b/services/core/java/com/android/server/appop/DiscreteRegistry.java
@@ -27,6 +27,8 @@
import static android.app.AppOpsManager.OP_FLAG_SELF;
import static android.app.AppOpsManager.OP_FLAG_TRUSTED_PROXIED;
import static android.app.AppOpsManager.OP_NONE;
+import static android.app.AppOpsManager.OP_PHONE_CALL_CAMERA;
+import static android.app.AppOpsManager.OP_PHONE_CALL_MICROPHONE;
import static android.app.AppOpsManager.OP_RECORD_AUDIO;
import static android.app.AppOpsManager.flagsToString;
import static android.app.AppOpsManager.getUidStateName;
@@ -122,7 +124,8 @@
private static final String PROPERTY_DISCRETE_FLAGS = "discrete_history_op_flags";
private static final String PROPERTY_DISCRETE_OPS_LIST = "discrete_history_ops_cslist";
private static final String DEFAULT_DISCRETE_OPS = OP_FINE_LOCATION + "," + OP_COARSE_LOCATION
- + "," + OP_CAMERA + "," + OP_RECORD_AUDIO;
+ + "," + OP_CAMERA + "," + OP_RECORD_AUDIO + "," + OP_PHONE_CALL_MICROPHONE + ","
+ + OP_PHONE_CALL_CAMERA;
private static final long DEFAULT_DISCRETE_HISTORY_CUTOFF = Duration.ofHours(24).toMillis();
private static final long MAXIMUM_DISCRETE_HISTORY_CUTOFF = Duration.ofDays(30).toMillis();
private static final long DEFAULT_DISCRETE_HISTORY_QUANTIZATION =
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 d04c17c..2ab1285 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
@@ -68,7 +68,7 @@
private final int[] mKeyguardIgnoreList;
private final int[] mKeyguardIgnoreListVendor;
- private int mLastAcquire;
+ @FaceManager.FaceAcquired private int mLastAcquire = FaceManager.FACE_ACQUIRED_UNKNOWN;
FaceAuthenticationClient(@NonNull Context context,
@NonNull LazyDaemon<ISession> lazyDaemon, @NonNull IBinder token,
@@ -127,7 +127,8 @@
// Do not provide haptic feedback if the user was not detected, and an error (usually
// ERROR_TIMEOUT) is received.
return mLastAcquire != FaceManager.FACE_ACQUIRED_NOT_DETECTED
- && mLastAcquire != FaceManager.FACE_ACQUIRED_SENSOR_DIRTY;
+ && mLastAcquire != FaceManager.FACE_ACQUIRED_SENSOR_DIRTY
+ && mLastAcquire != FaceManager.FACE_ACQUIRED_UNKNOWN;
}
@Override
diff --git a/services/core/java/com/android/server/net/NetworkStatsService.java b/services/core/java/com/android/server/net/NetworkStatsService.java
index 3c14440..4ee867b 100644
--- a/services/core/java/com/android/server/net/NetworkStatsService.java
+++ b/services/core/java/com/android/server/net/NetworkStatsService.java
@@ -181,7 +181,7 @@
private static final int MSG_PERFORM_POLL = 1;
// Perform polling, persist network, and register the global alert again.
private static final int MSG_PERFORM_POLL_REGISTER_ALERT = 2;
- private static final int MSG_UPDATE_IFACES = 3;
+ private static final int MSG_NOTIFY_NETWORK_STATUS = 3;
// A message for broadcasting ACTION_NETWORK_STATS_UPDATED in handler thread to prevent
// deadlock.
private static final int MSG_BROADCAST_NETWORK_STATS_UPDATED = 4;
@@ -379,11 +379,12 @@
performPoll(FLAG_PERSIST_ALL);
break;
}
- case MSG_UPDATE_IFACES: {
+ case MSG_NOTIFY_NETWORK_STATUS: {
// If no cached states, ignore.
if (mLastNetworkStateSnapshots == null) break;
// TODO (b/181642673): Protect mDefaultNetworks from concurrent accessing.
- updateIfaces(mDefaultNetworks, mLastNetworkStateSnapshots, mActiveIface);
+ handleNotifyNetworkStatus(
+ mDefaultNetworks, mLastNetworkStateSnapshots, mActiveIface);
break;
}
case MSG_PERFORM_POLL_REGISTER_ALERT: {
@@ -474,7 +475,7 @@
@NonNull Looper looper, @NonNull Executor executor,
@NonNull NetworkStatsService service) {
// TODO: Update RatType passively in NSS, instead of querying into the monitor
- // when forceUpdateIface.
+ // when notifyNetworkStatus.
return new NetworkStatsSubscriptionsMonitor(context, looper, executor,
(subscriberId, type) -> service.handleOnCollapsedRatTypeChanged());
}
@@ -971,16 +972,19 @@
}
}
- public void forceUpdateIfaces(
- Network[] defaultNetworks,
- NetworkStateSnapshot[] networkStates,
- String activeIface,
- UnderlyingNetworkInfo[] underlyingNetworkInfos) {
+ /**
+ * Notify {@code NetworkStatsService} about network status changed.
+ */
+ public void notifyNetworkStatus(
+ @NonNull Network[] defaultNetworks,
+ @NonNull NetworkStateSnapshot[] networkStates,
+ @Nullable String activeIface,
+ @NonNull UnderlyingNetworkInfo[] underlyingNetworkInfos) {
checkNetworkStackPermission(mContext);
final long token = Binder.clearCallingIdentity();
try {
- updateIfaces(defaultNetworks, networkStates, activeIface);
+ handleNotifyNetworkStatus(defaultNetworks, networkStates, activeIface);
} finally {
Binder.restoreCallingIdentity(token);
}
@@ -1244,12 +1248,12 @@
@VisibleForTesting
public void handleOnCollapsedRatTypeChanged() {
// Protect service from frequently updating. Remove pending messages if any.
- mHandler.removeMessages(MSG_UPDATE_IFACES);
+ mHandler.removeMessages(MSG_NOTIFY_NETWORK_STATUS);
mHandler.sendMessageDelayed(
- mHandler.obtainMessage(MSG_UPDATE_IFACES), mSettings.getPollDelay());
+ mHandler.obtainMessage(MSG_NOTIFY_NETWORK_STATUS), mSettings.getPollDelay());
}
- private void updateIfaces(
+ private void handleNotifyNetworkStatus(
Network[] defaultNetworks,
NetworkStateSnapshot[] snapshots,
String activeIface) {
@@ -1257,7 +1261,7 @@
mWakeLock.acquire();
try {
mActiveIface = activeIface;
- updateIfacesLocked(defaultNetworks, snapshots);
+ handleNotifyNetworkStatusLocked(defaultNetworks, snapshots);
} finally {
mWakeLock.release();
}
@@ -1270,10 +1274,10 @@
* they are combined under a single {@link NetworkIdentitySet}.
*/
@GuardedBy("mStatsLock")
- private void updateIfacesLocked(@NonNull Network[] defaultNetworks,
+ private void handleNotifyNetworkStatusLocked(@NonNull Network[] defaultNetworks,
@NonNull NetworkStateSnapshot[] snapshots) {
if (!mSystemReady) return;
- if (LOGV) Slog.v(TAG, "updateIfacesLocked()");
+ if (LOGV) Slog.v(TAG, "handleNotifyNetworkStatusLocked()");
// take one last stats snapshot before updating iface mapping. this
// isn't perfect, since the kernel may already be counting traffic from
diff --git a/services/core/java/com/android/server/pm/AppsFilter.java b/services/core/java/com/android/server/pm/AppsFilter.java
index cd352b5..7b1fa14 100644
--- a/services/core/java/com/android/server/pm/AppsFilter.java
+++ b/services/core/java/com/android/server/pm/AppsFilter.java
@@ -84,6 +84,7 @@
// Logs all filtering instead of enforcing
private static final boolean DEBUG_ALLOW_ALL = false;
private static final boolean DEBUG_LOGGING = false;
+ private static final boolean DEBUG_TRACING = false;
/**
* This contains a list of app UIDs that are implicitly queryable because another app explicitly
@@ -363,21 +364,29 @@
@Override
public boolean isGloballyEnabled() {
- Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "isGloballyEnabled");
+ if (DEBUG_TRACING) {
+ Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "isGloballyEnabled");
+ }
try {
return mFeatureEnabled;
} finally {
- Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ if (DEBUG_TRACING) {
+ Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ }
}
}
@Override
public boolean packageIsEnabled(AndroidPackage pkg) {
- Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "packageIsEnabled");
+ if (DEBUG_TRACING) {
+ Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "packageIsEnabled");
+ }
try {
return !mDisabledPackages.contains(pkg.getPackageName());
} finally {
- Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ if (DEBUG_TRACING) {
+ Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ }
}
}
@@ -656,7 +665,9 @@
* @param isReplace if the package is being replaced and may need extra cleanup.
*/
public void addPackage(PackageSetting newPkgSetting, boolean isReplace) {
- Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "filter.addPackage");
+ if (DEBUG_TRACING) {
+ Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "filter.addPackage");
+ }
try {
if (isReplace) {
// let's first remove any prior rules for this package
@@ -689,7 +700,9 @@
});
} finally {
onChanged();
- Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ if (DEBUG_TRACING) {
+ Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ }
}
}
@@ -1173,7 +1186,9 @@
*/
public boolean shouldFilterApplication(int callingUid, @Nullable SettingBase callingSetting,
PackageSetting targetPkgSetting, int userId) {
- Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "shouldFilterApplication");
+ if (DEBUG_TRACING) {
+ Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "shouldFilterApplication");
+ }
try {
int callingAppId = UserHandle.getAppId(callingUid);
if (callingAppId < Process.FIRST_APPLICATION_UID
@@ -1211,13 +1226,17 @@
}
return !DEBUG_ALLOW_ALL;
} finally {
- Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ if (DEBUG_TRACING) {
+ Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ }
}
}
private boolean shouldFilterApplicationInternal(int callingUid, SettingBase callingSetting,
PackageSetting targetPkgSetting, int targetUserId) {
- Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "shouldFilterApplicationInternal");
+ if (DEBUG_TRACING) {
+ Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "shouldFilterApplicationInternal");
+ }
try {
final boolean featureEnabled = mFeatureConfig.isGloballyEnabled();
if (!featureEnabled) {
@@ -1232,7 +1251,9 @@
}
final PackageSetting callingPkgSetting;
final ArraySet<PackageSetting> callingSharedPkgSettings;
- Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "callingSetting instanceof");
+ if (DEBUG_TRACING) {
+ Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "callingSetting instanceof");
+ }
if (callingSetting instanceof PackageSetting) {
if (((PackageSetting) callingSetting).sharedUser == null) {
callingPkgSetting = (PackageSetting) callingSetting;
@@ -1246,7 +1267,9 @@
callingPkgSetting = null;
callingSharedPkgSettings = ((SharedUserSetting) callingSetting).packages;
}
- Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ if (DEBUG_TRACING) {
+ Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ }
if (callingPkgSetting != null) {
if (callingPkgSetting.pkg != null
@@ -1282,7 +1305,9 @@
return false;
}
final String targetName = targetPkg.getPackageName();
- Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "getAppId");
+ if (DEBUG_TRACING) {
+ Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "getAppId");
+ }
final int callingAppId;
if (callingPkgSetting != null) {
callingAppId = callingPkgSetting.appId;
@@ -1290,7 +1315,9 @@
callingAppId = callingSharedPkgSettings.valueAt(0).appId; // all should be the same
}
final int targetAppId = targetPkgSetting.appId;
- Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ if (DEBUG_TRACING) {
+ Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ }
if (callingAppId == targetAppId) {
if (DEBUG_LOGGING) {
log(callingSetting, targetPkgSetting, "same app id");
@@ -1299,7 +1326,9 @@
}
try {
- Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "requestsQueryAllPackages");
+ if (DEBUG_TRACING) {
+ Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "requestsQueryAllPackages");
+ }
if (callingPkgSetting != null) {
if (callingPkgSetting.pkg != null
&& requestsQueryAllPackages(callingPkgSetting.pkg)) {
@@ -1314,10 +1343,14 @@
}
}
} finally {
- Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ if (DEBUG_TRACING) {
+ Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ }
}
try {
- Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "mForceQueryable");
+ if (DEBUG_TRACING) {
+ Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "mForceQueryable");
+ }
if (mForceQueryable.contains(targetAppId)) {
if (DEBUG_LOGGING) {
log(callingSetting, targetPkgSetting, "force queryable");
@@ -1325,10 +1358,14 @@
return false;
}
} finally {
- Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ if (DEBUG_TRACING) {
+ Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ }
}
try {
- Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "mQueriesViaPackage");
+ if (DEBUG_TRACING) {
+ Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "mQueriesViaPackage");
+ }
if (mQueriesViaPackage.contains(callingAppId, targetAppId)) {
if (DEBUG_LOGGING) {
log(callingSetting, targetPkgSetting, "queries package");
@@ -1336,10 +1373,14 @@
return false;
}
} finally {
- Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ if (DEBUG_TRACING) {
+ Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ }
}
try {
- Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "mQueriesViaComponent");
+ if (DEBUG_TRACING) {
+ Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "mQueriesViaComponent");
+ }
if (mQueriesViaComponentRequireRecompute) {
mStateProvider.runWithState((settings, users) -> {
recomputeComponentVisibility(settings);
@@ -1352,11 +1393,15 @@
return false;
}
} finally {
- Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ if (DEBUG_TRACING) {
+ Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ }
}
try {
- Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "mImplicitlyQueryable");
+ if (DEBUG_TRACING) {
+ Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "mImplicitlyQueryable");
+ }
final int targetUid = UserHandle.getUid(targetUserId, targetAppId);
if (mImplicitlyQueryable.contains(callingUid, targetUid)) {
if (DEBUG_LOGGING) {
@@ -1365,11 +1410,15 @@
return false;
}
} finally {
- Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ if (DEBUG_TRACING) {
+ Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ }
}
try {
- Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "mOverlayReferenceMapper");
+ if (DEBUG_TRACING) {
+ Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "mOverlayReferenceMapper");
+ }
if (callingSharedPkgSettings != null) {
int size = callingSharedPkgSettings.size();
for (int index = 0; index < size; index++) {
@@ -1392,11 +1441,15 @@
}
}
} finally {
- Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ if (DEBUG_TRACING) {
+ Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ }
}
try {
- Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "mQueryableViaUsesLibrary");
+ if (DEBUG_TRACING) {
+ Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "mQueryableViaUsesLibrary");
+ }
if (mQueryableViaUsesLibrary.contains(callingAppId, targetAppId)) {
if (DEBUG_LOGGING) {
log(callingSetting, targetPkgSetting, "queryable for library users");
@@ -1404,12 +1457,16 @@
return false;
}
} finally {
- Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ if (DEBUG_TRACING) {
+ Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ }
}
return true;
} finally {
- Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ if (DEBUG_TRACING) {
+ Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ }
}
}
@@ -1425,7 +1482,9 @@
private static boolean pkgInstruments(
@NonNull AndroidPackage source, @NonNull AndroidPackage target) {
try {
- Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "pkgInstruments");
+ if (DEBUG_TRACING) {
+ Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "pkgInstruments");
+ }
final String packageName = target.getPackageName();
final List<ParsedInstrumentation> inst = source.getInstrumentations();
for (int i = ArrayUtils.size(inst) - 1; i >= 0; i--) {
@@ -1435,7 +1494,9 @@
}
return false;
} finally {
- Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ if (DEBUG_TRACING) {
+ Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
+ }
}
}
diff --git a/services/core/java/com/android/server/pm/LauncherAppsService.java b/services/core/java/com/android/server/pm/LauncherAppsService.java
index 47d1629..de9add0 100644
--- a/services/core/java/com/android/server/pm/LauncherAppsService.java
+++ b/services/core/java/com/android/server/pm/LauncherAppsService.java
@@ -25,6 +25,7 @@
import static android.content.pm.LauncherApps.FLAG_CACHE_NOTIFICATION_SHORTCUTS;
import static android.content.pm.LauncherApps.FLAG_CACHE_PEOPLE_TILE_SHORTCUTS;
+import android.annotation.AppIdInt;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.UserIdInt;
@@ -1232,12 +1233,12 @@
cookie.user.getIdentifier());
}
- /** Returns whether or not the given UID is in allow list */
- private static boolean isCallingUidAllowed(int[] allowList, int callingUid) {
- if (allowList == null) {
+ /** Returns whether or not the given appId is in allow list */
+ private static boolean isCallingAppIdAllowed(int[] appIdAllowList, @AppIdInt int appId) {
+ if (appIdAllowList == null) {
return true;
}
- return Arrays.binarySearch(allowList, callingUid) > -1;
+ return Arrays.binarySearch(appIdAllowList, appId) > -1;
}
private String[] getFilteredPackageNames(String[] packageNames, BroadcastCookie cookie) {
@@ -1432,7 +1433,7 @@
// Handle onPackageRemoved.
if (Intent.ACTION_PACKAGE_REMOVED_INTERNAL.equals(action)) {
final String packageName = getPackageName(intent);
- final int[] allowList =
+ final int[] appIdAllowList =
intent.getIntArrayExtra(Intent.EXTRA_VISIBILITY_ALLOW_LIST);
// If {@link #EXTRA_REPLACING} is true, that will be onPackageChanged case.
if (packageName != null && !intent.getBooleanExtra(
@@ -1448,7 +1449,8 @@
if (!isEnabledProfileOf(cookie.user, user, "onPackageRemoved")) {
continue;
}
- if (!isCallingUidAllowed(allowList, cookie.callingUid)) {
+ if (!isCallingAppIdAllowed(appIdAllowList, UserHandle.getAppId(
+ cookie.callingUid))) {
continue;
}
try {
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 01c89b5..4faa18e 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -26514,8 +26514,10 @@
}
@Override
- public void setDeviceOwnerProtectedPackages(List<String> packageNames) {
- mProtectedPackages.setDeviceOwnerProtectedPackages(packageNames);
+ public void setDeviceOwnerProtectedPackages(
+ String deviceOwnerPackageName, List<String> packageNames) {
+ mProtectedPackages.setDeviceOwnerProtectedPackages(
+ deviceOwnerPackageName, packageNames);
}
@Override
diff --git a/services/core/java/com/android/server/pm/ProtectedPackages.java b/services/core/java/com/android/server/pm/ProtectedPackages.java
index 4da3cc3..bf46129 100644
--- a/services/core/java/com/android/server/pm/ProtectedPackages.java
+++ b/services/core/java/com/android/server/pm/ProtectedPackages.java
@@ -20,14 +20,15 @@
import android.annotation.UserIdInt;
import android.content.Context;
import android.os.UserHandle;
+import android.util.ArrayMap;
+import android.util.ArraySet;
import android.util.SparseArray;
import com.android.internal.R;
import com.android.internal.annotations.GuardedBy;
-import com.android.internal.util.ArrayUtils;
-import java.util.ArrayList;
import java.util.List;
+import java.util.Set;
/**
* Manages package names that need special protection.
@@ -55,7 +56,7 @@
@Nullable
@GuardedBy("this")
- private List<String> mDeviceOwnerProtectedPackages;
+ private final ArrayMap<String, Set<String>> mDeviceOwnerProtectedPackages = new ArrayMap<>();
private final Context mContext;
@@ -78,8 +79,14 @@
: profileOwnerPackages.clone();
}
- public synchronized void setDeviceOwnerProtectedPackages(List<String> packageNames) {
- mDeviceOwnerProtectedPackages = new ArrayList<String>(packageNames);
+ /** Sets the protected packages for the device owner. */
+ public synchronized void setDeviceOwnerProtectedPackages(
+ String deviceOwnerPackageName, List<String> packageNames) {
+ if (packageNames.isEmpty()) {
+ mDeviceOwnerProtectedPackages.remove(deviceOwnerPackageName);
+ } else {
+ mDeviceOwnerProtectedPackages.put(deviceOwnerPackageName, new ArraySet<>(packageNames));
+ }
}
private synchronized boolean hasDeviceOwnerOrProfileOwner(int userId, String packageName) {
@@ -118,7 +125,17 @@
*/
private synchronized boolean isProtectedPackage(String packageName) {
return packageName != null && (packageName.equals(mDeviceProvisioningPackage)
- || ArrayUtils.contains(mDeviceOwnerProtectedPackages, packageName));
+ || isDeviceOwnerProtectedPackage(packageName));
+ }
+
+ /** Returns {@code true} if the given package is a protected package set by any device owner. */
+ private synchronized boolean isDeviceOwnerProtectedPackage(String packageName) {
+ for (Set<String> protectedPackages : mDeviceOwnerProtectedPackages.values()) {
+ if (protectedPackages.contains(packageName)) {
+ return true;
+ }
+ }
+ return false;
}
/**
diff --git a/services/core/java/com/android/server/pm/SnapshotStatistics.java b/services/core/java/com/android/server/pm/SnapshotStatistics.java
index 7bf00603..95f80de 100644
--- a/services/core/java/com/android/server/pm/SnapshotStatistics.java
+++ b/services/core/java/com/android/server/pm/SnapshotStatistics.java
@@ -625,7 +625,7 @@
* output.
*/
public void dump(PrintWriter pw, String indent, long now, int unrecorded,
- int corkLevel, boolean full) {
+ int corkLevel, boolean brief) {
// Grab the raw statistics under lock, but print them outside of the lock.
Stats[] l;
Stats[] s;
@@ -639,7 +639,7 @@
unrecorded, corkLevel);
pw.println();
dump(pw, indent, now, l, s, "stats");
- if (!full) {
+ if (brief) {
return;
}
pw.println();
diff --git a/services/core/java/com/android/server/pm/UserRestrictionsUtils.java b/services/core/java/com/android/server/pm/UserRestrictionsUtils.java
index ff90043..3a1ffe1 100644
--- a/services/core/java/com/android/server/pm/UserRestrictionsUtils.java
+++ b/services/core/java/com/android/server/pm/UserRestrictionsUtils.java
@@ -138,7 +138,9 @@
UserManager.DISALLOW_AMBIENT_DISPLAY,
UserManager.DISALLOW_CONFIG_SCREEN_TIMEOUT,
UserManager.DISALLOW_PRINTING,
- UserManager.DISALLOW_CONFIG_PRIVATE_DNS
+ UserManager.DISALLOW_CONFIG_PRIVATE_DNS,
+ UserManager.DISALLOW_MICROPHONE_TOGGLE,
+ UserManager.DISALLOW_CAMERA_TOGGLE
});
public static final Set<String> DEPRECATED_USER_RESTRICTIONS = Sets.newArraySet(
@@ -180,7 +182,9 @@
*/
private static final Set<String> DEVICE_OWNER_ONLY_RESTRICTIONS = Sets.newArraySet(
UserManager.DISALLOW_USER_SWITCH,
- UserManager.DISALLOW_CONFIG_PRIVATE_DNS
+ UserManager.DISALLOW_CONFIG_PRIVATE_DNS,
+ UserManager.DISALLOW_MICROPHONE_TOGGLE,
+ UserManager.DISALLOW_CAMERA_TOGGLE
);
/**
diff --git a/services/core/java/com/android/server/rotationresolver/RotationResolverManagerPerUserService.java b/services/core/java/com/android/server/rotationresolver/RotationResolverManagerPerUserService.java
index 81bf29b..ccf096e 100644
--- a/services/core/java/com/android/server/rotationresolver/RotationResolverManagerPerUserService.java
+++ b/services/core/java/com/android/server/rotationresolver/RotationResolverManagerPerUserService.java
@@ -18,6 +18,7 @@
import static android.service.rotationresolver.RotationResolverService.ROTATION_RESULT_FAILURE_CANCELLED;
+import static com.android.internal.util.LatencyTracker.ACTION_ROTATE_SCREEN_CAMERA_CHECK;
import static com.android.server.rotationresolver.RotationResolverManagerService.RESOLUTION_UNAVAILABLE;
import static com.android.server.rotationresolver.RotationResolverManagerService.logRotationStats;
@@ -38,6 +39,7 @@
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.util.LatencyTracker;
import com.android.server.infra.AbstractPerUserSystemService;
/**
@@ -62,10 +64,13 @@
RemoteRotationResolverService mRemoteService;
private ComponentName mComponentName;
+ @GuardedBy("mLock")
+ private LatencyTracker mLatencyTracker;
RotationResolverManagerPerUserService(@NonNull RotationResolverManagerService main,
@NonNull Object lock, @UserIdInt int userId) {
super(main, lock, userId);
+ mLatencyTracker = LatencyTracker.getInstance(getContext());
}
@GuardedBy("mLock")
@@ -108,7 +113,33 @@
cancelLocked();
}
- mCurrentRequest = new RemoteRotationResolverService.RotationRequest(callbackInternal,
+ synchronized (mLock) {
+ mLatencyTracker.onActionStart(ACTION_ROTATE_SCREEN_CAMERA_CHECK);
+ }
+ /** Need to wrap RotationResolverCallbackInternal since there was no other way to hook
+ into the success/failure callback **/
+ final RotationResolverInternal.RotationResolverCallbackInternal wrapper =
+ new RotationResolverInternal.RotationResolverCallbackInternal() {
+
+ @Override
+ public void onSuccess(int result) {
+ synchronized (mLock) {
+ mLatencyTracker
+ .onActionEnd(ACTION_ROTATE_SCREEN_CAMERA_CHECK);
+ }
+ callbackInternal.onSuccess(result);
+ }
+
+ @Override
+ public void onFailure(int error) {
+ synchronized (mLock) {
+ mLatencyTracker
+ .onActionEnd(ACTION_ROTATE_SCREEN_CAMERA_CHECK);
+ }
+ callbackInternal.onFailure(error);
+ }
+ };
+ mCurrentRequest = new RemoteRotationResolverService.RotationRequest(wrapper,
request, cancellationSignalInternal);
cancellationSignalInternal.setOnCancelListener(() -> {
diff --git a/services/core/java/com/android/server/tv/TvInputManagerService.java b/services/core/java/com/android/server/tv/TvInputManagerService.java
index 49170f3..aa63c52 100755
--- a/services/core/java/com/android/server/tv/TvInputManagerService.java
+++ b/services/core/java/com/android/server/tv/TvInputManagerService.java
@@ -143,9 +143,9 @@
// ID of the current user.
@GuardedBy("mLock")
private int mCurrentUserId = UserHandle.USER_SYSTEM;
- // IDs of the running managed profiles. Their parent user ID should be mCurrentUserId.
+ // IDs of the running profiles. Their parent user ID should be mCurrentUserId.
@GuardedBy("mLock")
- private final Set<Integer> mRunningManagedProfile = new HashSet<>();
+ private final Set<Integer> mRunningProfiles = new HashSet<>();
// A map from user id to UserState.
@GuardedBy("mLock")
@@ -440,13 +440,13 @@
private void startUser(int userId) {
synchronized (mLock) {
- if (userId == mCurrentUserId || mRunningManagedProfile.contains(userId)) {
+ if (userId == mCurrentUserId || mRunningProfiles.contains(userId)) {
// user already started
return;
}
UserInfo userInfo = mUserManager.getUserInfo(userId);
UserInfo parentInfo = mUserManager.getProfileParent(userId);
- if (userInfo.isManagedProfile()
+ if (userInfo.isProfile()
&& parentInfo != null
&& parentInfo.id == mCurrentUserId) {
// only the children of the current user can be started in background
@@ -463,13 +463,13 @@
releaseSessionOfUserLocked(userId);
unbindServiceOfUserLocked(userId);
- mRunningManagedProfile.remove(userId);
+ mRunningProfiles.remove(userId);
}
private void startProfileLocked(int userId) {
buildTvInputListLocked(userId, null);
buildTvContentRatingSystemListLocked(userId);
- mRunningManagedProfile.add(userId);
+ mRunningProfiles.add(userId);
}
private void switchUser(int userId) {
@@ -478,16 +478,16 @@
return;
}
UserInfo userInfo = mUserManager.getUserInfo(userId);
- if (userInfo.isManagedProfile()) {
- Slog.w(TAG, "cannot switch to a managed profile!");
+ if (userInfo.isProfile()) {
+ Slog.w(TAG, "cannot switch to a profile!");
return;
}
- for (int runningId : mRunningManagedProfile) {
+ for (int runningId : mRunningProfiles) {
releaseSessionOfUserLocked(runningId);
unbindServiceOfUserLocked(runningId);
}
- mRunningManagedProfile.clear();
+ mRunningProfiles.clear();
releaseSessionOfUserLocked(mCurrentUserId);
unbindServiceOfUserLocked(mCurrentUserId);
@@ -630,7 +630,7 @@
userState.mCallbacks.kill();
userState.mainSessionToken = null;
- mRunningManagedProfile.remove(userId);
+ mRunningProfiles.remove(userId);
mUserStates.remove(userId);
if (userId == mCurrentUserId) {
@@ -729,7 +729,7 @@
}
boolean shouldBind;
- if (userId == mCurrentUserId || mRunningManagedProfile.contains(userId)) {
+ if (userId == mCurrentUserId || mRunningProfiles.contains(userId)) {
shouldBind = !serviceState.sessionTokens.isEmpty() || serviceState.isHardware;
} else {
// For a non-current user,
@@ -1400,9 +1400,9 @@
String uniqueSessionId = UUID.randomUUID().toString();
try {
synchronized (mLock) {
- if (userId != mCurrentUserId && !mRunningManagedProfile.contains(userId)
+ if (userId != mCurrentUserId && !mRunningProfiles.contains(userId)
&& !isRecordingSession) {
- // Only current user and its running managed profiles can create
+ // Only current user and its running profiles can create
// non-recording sessions.
// Let the client get onConnectionFailed callback for this case.
sendSessionTokenToClientLocked(client, inputId, null, null, seq);
diff --git a/services/core/java/com/android/server/wm/ActivityMetricsLogger.java b/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
index 1ab402d..e1b7dd3 100644
--- a/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
+++ b/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
@@ -76,6 +76,7 @@
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
+import android.content.pm.IncrementalStatesInfo;
import android.content.pm.dex.ArtManagerInternal;
import android.content.pm.dex.PackageOptimizationInfo;
import android.metrics.LogMaker;
@@ -84,6 +85,7 @@
import android.os.Looper;
import android.os.SystemClock;
import android.os.Trace;
+import android.os.incremental.IncrementalManager;
import android.util.ArrayMap;
import android.util.EventLog;
import android.util.Log;
@@ -948,6 +950,14 @@
builder.addTaggedData(PACKAGE_OPTIMIZATION_COMPILATION_FILTER,
packageOptimizationInfo.getCompilationFilter());
mMetricsLogger.write(builder);
+
+ // Incremental info
+ boolean isIncremental = false, isLoading = false;
+ final String codePath = info.applicationInfo.getCodePath();
+ if (codePath != null && IncrementalManager.isIncrementalPath(codePath)) {
+ isIncremental = true;
+ isLoading = isIncrementalLoading(info.packageName, info.userId);
+ }
FrameworkStatsLog.write(
FrameworkStatsLog.APP_START_OCCURRED,
info.applicationInfo.uid,
@@ -967,7 +977,10 @@
packageOptimizationInfo.getCompilationFilter(),
info.sourceType,
info.sourceEventDelayMs,
- isHibernating);
+ isHibernating,
+ isIncremental,
+ isLoading,
+ info.launchedActivityName.hashCode());
if (DEBUG_METRICS) {
Slog.i(TAG, String.format("APP_START_OCCURRED(%s, %s, %s, %s, %s)",
@@ -982,6 +995,12 @@
logAppStartMemoryStateCapture(info);
}
+ private boolean isIncrementalLoading(String packageName, int userId) {
+ final IncrementalStatesInfo info = mSupervisor.mService.getPackageManagerInternalLocked()
+ .getIncrementalStatesInfo(packageName, 0 /* filterCallingUid */, userId);
+ return info != null && info.isLoading();
+ }
+
private void logAppDisplayed(TransitionInfoSnapshot info) {
if (info.type != TYPE_TRANSITION_WARM_LAUNCH && info.type != TYPE_TRANSITION_COLD_LAUNCH) {
return;
@@ -1063,6 +1082,14 @@
mMetricsLogger.write(builder);
final PackageOptimizationInfo packageOptimizationInfo =
infoSnapshot.getPackageOptimizationInfo(getArtManagerInternal());
+ // Incremental info
+ boolean isIncremental = false, isLoading = false;
+ final String codePath = info.mLastLaunchedActivity.info.applicationInfo.getCodePath();
+ if (codePath != null && IncrementalManager.isIncrementalPath(codePath)) {
+ isIncremental = true;
+ isLoading = isIncrementalLoading(info.mLastLaunchedActivity.packageName,
+ info.mLastLaunchedActivity.mUserId);
+ }
FrameworkStatsLog.write(
FrameworkStatsLog.APP_START_FULLY_DRAWN,
info.mLastLaunchedActivity.info.applicationInfo.uid,
@@ -1076,7 +1103,10 @@
packageOptimizationInfo.getCompilationReason(),
packageOptimizationInfo.getCompilationFilter(),
info.mSourceType,
- info.mSourceEventDelayMs);
+ info.mSourceEventDelayMs,
+ isIncremental,
+ isLoading,
+ info.mLastLaunchedActivity.info.name.hashCode());
// Ends the trace started at the beginning of this function. This is located here to allow
// the trace slice to have a noticable duration.
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index b55e653..65595a8 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -4213,6 +4213,7 @@
void clearAllDrawn() {
allDrawn = false;
+ mLastAllDrawn = false;
}
/**
@@ -8243,6 +8244,11 @@
}
@Override
+ public boolean isAlwaysOnTop() {
+ return mTaskOverlay || super.isAlwaysOnTop();
+ }
+
+ @Override
boolean showToCurrentUser() {
return mShowForAllUsers || mWmService.isCurrentProfile(mUserId);
}
diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java
index 0d3c74e..7bc29f2 100644
--- a/services/core/java/com/android/server/wm/ActivityStarter.java
+++ b/services/core/java/com/android/server/wm/ActivityStarter.java
@@ -192,6 +192,7 @@
private boolean mKeepCurTransition;
private boolean mAvoidMoveToFront;
private boolean mFrozeTaskList;
+ private boolean mTransientLaunch;
// We must track when we deliver the new intent since multiple code paths invoke
// {@link #deliverNewIntent}. This is due to early returns in the code path. This flag is used
@@ -1792,7 +1793,7 @@
mTargetRootTask.moveToFront("startActivityInner");
}
mRootWindowContainer.resumeFocusedTasksTopActivities(
- mTargetRootTask, mStartActivity, mOptions);
+ mTargetRootTask, mStartActivity, mOptions, mTransientLaunch);
}
}
mRootWindowContainer.updateUserRootTask(mStartActivity.mUserId, mTargetRootTask);
@@ -2209,6 +2210,7 @@
mKeepCurTransition = false;
mAvoidMoveToFront = false;
mFrozeTaskList = false;
+ mTransientLaunch = false;
mVoiceSession = null;
mVoiceInteractor = null;
@@ -2311,6 +2313,7 @@
mDoResume = false;
mAvoidMoveToFront = true;
}
+ mTransientLaunch = mOptions.getTransientLaunch();
mTargetRootTask = Task.fromWindowContainerToken(mOptions.getLaunchRootTask());
}
@@ -2642,7 +2645,7 @@
}
if (mTargetRootTask.isFocusable()) {
mRootWindowContainer.resumeFocusedTasksTopActivities(mTargetRootTask, null,
- mOptions);
+ mOptions, mTransientLaunch);
} else {
mRootWindowContainer.ensureActivitiesVisible(null, 0, !PRESERVE_WINDOWS);
}
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 26f0706..735fae3 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -2411,6 +2411,8 @@
mDisplayPolicy.onConfigurationChanged();
mPinnedTaskController.onPostDisplayConfigurationChanged();
}
+ // Update IME parent if needed.
+ updateImeParent();
if (lastOrientation != getConfiguration().orientation) {
getMetricsLogger().write(
@@ -3965,7 +3967,8 @@
}
// Otherwise, we just attach it to where the display area policy put it.
- return mImeWindowsContainer.getParent().getSurfaceControl();
+ return mImeWindowsContainer.getParent() != null
+ ? mImeWindowsContainer.getParent().getSurfaceControl() : null;
}
void setLayoutNeeded() {
@@ -4600,13 +4603,14 @@
return super.forAllWindows(callback, traverseTopToBottom);
}
- private boolean skipImeWindowsDuringTraversal(DisplayContent dc) {
+ private static boolean skipImeWindowsDuringTraversal(DisplayContent dc) {
// We skip IME windows so they're processed just above their target, except
// in split-screen mode where we process the IME containers above the docked divider.
// Note that this method check should align with {@link
// WindowState#applyImeWindowsIfNeeded} in case of any state mismatch.
- return dc.getImeTarget(IME_TARGET_LAYERING) != null
- && !dc.getDefaultTaskDisplayArea().isSplitScreenModeActivated();
+ return dc.mImeLayeringTarget != null
+ && (!dc.getDefaultTaskDisplayArea().isSplitScreenModeActivated()
+ || dc.mImeLayeringTarget.getTask() == null);
}
/** Like {@link #forAllWindows}, but ignores {@link #skipImeWindowsDuringTraversal} */
diff --git a/services/core/java/com/android/server/wm/DisplayRotation.java b/services/core/java/com/android/server/wm/DisplayRotation.java
index 0e73d79..2c969ab 100644
--- a/services/core/java/com/android/server/wm/DisplayRotation.java
+++ b/services/core/java/com/android/server/wm/DisplayRotation.java
@@ -186,6 +186,10 @@
@Surface.Rotation
private int mUserRotation = Surface.ROTATION_0;
+ private static final int CAMERA_ROTATION_DISABLED = 0;
+ private static final int CAMERA_ROTATION_ENABLED = 1;
+ private int mCameraRotationMode = CAMERA_ROTATION_DISABLED;
+
/**
* Flag that indicates this is a display that may run better when fixed to user rotation.
*/
@@ -1462,6 +1466,14 @@
if (shouldUpdateOrientationListener) {
updateOrientationListenerLw(); // Enable or disable the orientation listener.
}
+
+ final int cameraRotationMode = Settings.Secure.getIntForUser(resolver,
+ Settings.Secure.CAMERA_AUTOROTATE, 0,
+ UserHandle.USER_CURRENT);
+ if (mCameraRotationMode != cameraRotationMode) {
+ mCameraRotationMode = cameraRotationMode;
+ shouldUpdateRotation = true;
+ }
}
return shouldUpdateRotation;
@@ -1491,6 +1503,7 @@
pw.print(prefix + " mUserRotationMode="
+ WindowManagerPolicy.userRotationModeToString(mUserRotationMode));
pw.print(" mUserRotation=" + Surface.rotationToString(mUserRotation));
+ pw.print(" mCameraRotationMode=" + mCameraRotationMode);
pw.println(" mAllowAllRotations=" + allowAllRotationsToString(mAllowAllRotations));
pw.print(prefix + " mDemoHdmiRotation=" + Surface.rotationToString(mDemoHdmiRotation));
@@ -1539,6 +1552,13 @@
}
}
+ @Override
+ public boolean isRotationResolverEnabled() {
+ return mUserRotationMode == WindowManagerPolicy.USER_ROTATION_FREE
+ && mCameraRotationMode == CAMERA_ROTATION_ENABLED
+ && !mService.mPowerManager.isPowerSaveMode();
+ }
+
@Override
public void onProposedRotationChanged(int rotation) {
@@ -1582,6 +1602,10 @@
resolver.registerContentObserver(Settings.System.getUriFor(
Settings.System.USER_ROTATION), false, this,
UserHandle.USER_ALL);
+ resolver.registerContentObserver(
+ Settings.Secure.getUriFor(Settings.Secure.CAMERA_AUTOROTATE), false, this,
+ UserHandle.USER_ALL);
+
updateSettings();
}
diff --git a/services/core/java/com/android/server/wm/DragState.java b/services/core/java/com/android/server/wm/DragState.java
index 6340036..c674cb85 100644
--- a/services/core/java/com/android/server/wm/DragState.java
+++ b/services/core/java/com/android/server/wm/DragState.java
@@ -497,9 +497,10 @@
if (targetWin == null) {
return false;
}
- if (!interceptsGlobalDrag && containsAppExtras) {
- // App-drags can only go to windows that can intercept global drag, and not to normal
- // app windows
+ final boolean isLocalWindow = mLocalWin == targetWin.mClient.asBinder();
+ if (!isLocalWindow && !interceptsGlobalDrag && containsAppExtras) {
+ // App-drags can only go to local windows or windows that can intercept global drag, and
+ // not to other app windows
return false;
}
if (!targetWin.isPotentialDragTarget(interceptsGlobalDrag)) {
@@ -507,7 +508,7 @@
}
if ((mFlags & View.DRAG_FLAG_GLOBAL) == 0 || !targetWindowSupportsGlobalDrag(targetWin)) {
// Drag is limited to the current window.
- if (mLocalWin != targetWin.mClient.asBinder()) {
+ if (!isLocalWindow) {
return false;
}
}
diff --git a/services/core/java/com/android/server/wm/InsetsPolicy.java b/services/core/java/com/android/server/wm/InsetsPolicy.java
index cda3fda..c387d33 100644
--- a/services/core/java/com/android/server/wm/InsetsPolicy.java
+++ b/services/core/java/com/android/server/wm/InsetsPolicy.java
@@ -22,6 +22,7 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
import static android.view.InsetsController.ANIMATION_TYPE_HIDE;
import static android.view.InsetsController.ANIMATION_TYPE_SHOW;
+import static android.view.InsetsState.ITYPE_IME;
import static android.view.InsetsState.ITYPE_NAVIGATION_BAR;
import static android.view.InsetsState.ITYPE_STATUS_BAR;
import static android.view.SyncRtSurfaceTransactionApplier.applyParams;
@@ -207,7 +208,8 @@
*/
InsetsState getInsetsForWindow(WindowState target) {
final InsetsState originalState = mStateController.getInsetsForWindow(target);
- return adjustVisibilityForTransientTypes(originalState);
+ final InsetsState state = adjustVisibilityForTransientTypes(originalState);
+ return target.mIsImWindow ? adjustVisibilityForIme(state, state == originalState) : state;
}
/**
@@ -237,6 +239,20 @@
return state;
}
+ // Navigation bar insets is always visible to IME.
+ private static InsetsState adjustVisibilityForIme(InsetsState originalState,
+ boolean copyState) {
+ final InsetsSource originalNavSource = originalState.peekSource(ITYPE_NAVIGATION_BAR);
+ if (originalNavSource != null && !originalNavSource.isVisible()) {
+ final InsetsState state = copyState ? new InsetsState(originalState) : originalState;
+ final InsetsSource navSource = new InsetsSource(originalNavSource);
+ navSource.setVisible(true);
+ state.addSource(navSource);
+ return state;
+ }
+ return originalState;
+ }
+
void onInsetsModified(InsetsControlTarget caller) {
mStateController.onInsetsModified(caller);
checkAbortTransient(caller);
@@ -245,17 +261,21 @@
/**
* Called when a control target modified the insets state. If the target set a insets source to
- * visible while it is shown transiently, we need to abort the transient state.
+ * visible while it is shown transiently, we need to abort the transient state. While IME is
+ * requested visible, we also need to abort the transient state of navigation bar if it is shown
+ * transiently.
*
* @param caller who changed the insets state.
*/
private void checkAbortTransient(InsetsControlTarget caller) {
if (mShowingTransientTypes.size() != 0) {
- IntArray abortTypes = new IntArray();
+ final IntArray abortTypes = new IntArray();
+ final boolean imeRequestedVisible = caller.getRequestedVisibility(ITYPE_IME);
for (int i = mShowingTransientTypes.size() - 1; i >= 0; i--) {
final @InternalInsetsType int type = mShowingTransientTypes.get(i);
- if (mStateController.isFakeTarget(type, caller)
- && caller.getRequestedVisibility(type)) {
+ if ((mStateController.isFakeTarget(type, caller)
+ && caller.getRequestedVisibility(type))
+ || (type == ITYPE_NAVIGATION_BAR && imeRequestedVisible)) {
mShowingTransientTypes.remove(i);
abortTypes.add(type);
}
@@ -330,6 +350,11 @@
private @Nullable InsetsControlTarget getNavControlTarget(@Nullable WindowState focusedWin,
boolean forceShowsSystemBarsForWindowingMode) {
+ final WindowState imeWin = mDisplayContent.mInputMethodWindow;
+ if (imeWin != null && imeWin.isVisible()) {
+ // Force showing navigation bar while IME is visible.
+ return null;
+ }
if (mShowingTransientTypes.indexOf(ITYPE_NAVIGATION_BAR) != -1) {
return mDummyControlTarget;
}
diff --git a/services/core/java/com/android/server/wm/RecentTasks.java b/services/core/java/com/android/server/wm/RecentTasks.java
index 9f9ac3e..455f568 100644
--- a/services/core/java/com/android/server/wm/RecentTasks.java
+++ b/services/core/java/com/android/server/wm/RecentTasks.java
@@ -1888,7 +1888,12 @@
*/
ActivityManager.RecentTaskInfo createRecentTaskInfo(Task tr, boolean stripExtras) {
final ActivityManager.RecentTaskInfo rti = new ActivityManager.RecentTaskInfo();
- tr.fillTaskInfo(rti, stripExtras);
+ // If the recent Task is detached, we consider it will be re-attached to the default
+ // TaskDisplayArea because we currently only support recent overview in the default TDA.
+ final TaskDisplayArea tda = tr.isAttached()
+ ? tr.getDisplayArea()
+ : mService.mRootWindowContainer.getDefaultTaskDisplayArea();
+ tr.fillTaskInfo(rti, stripExtras, tda);
// Fill in some deprecated values.
rti.id = rti.isRunning ? rti.taskId : INVALID_TASK_ID;
rti.persistentId = rti.taskId;
@@ -1900,7 +1905,7 @@
final Task childTask = tr.getChildAt(i).asTask();
if (childTask != null && childTask.isOrganized()) {
final ActivityManager.RecentTaskInfo cti = new ActivityManager.RecentTaskInfo();
- childTask.fillTaskInfo(cti);
+ childTask.fillTaskInfo(cti, true /* stripExtras */, tda);
rti.childrenTaskInfos.add(cti);
}
}
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index 26dcf00..ea80b8b 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -2293,7 +2293,13 @@
boolean resumeFocusedTasksTopActivities(
Task targetRootTask, ActivityRecord target, ActivityOptions targetOptions) {
+ return resumeFocusedTasksTopActivities(targetRootTask, target, targetOptions,
+ false /* deferPause */);
+ }
+ boolean resumeFocusedTasksTopActivities(
+ Task targetRootTask, ActivityRecord target, ActivityOptions targetOptions,
+ boolean deferPause) {
if (!mTaskSupervisor.readyToResume()) {
return false;
}
@@ -2301,7 +2307,8 @@
boolean result = false;
if (targetRootTask != null && (targetRootTask.isTopRootTaskInDisplayArea()
|| getTopDisplayFocusedRootTask() == targetRootTask)) {
- result = targetRootTask.resumeTopActivityUncheckedLocked(target, targetOptions);
+ result = targetRootTask.resumeTopActivityUncheckedLocked(target, targetOptions,
+ deferPause);
}
for (int displayNdx = getChildCount() - 1; displayNdx >= 0; --displayNdx) {
diff --git a/services/core/java/com/android/server/wm/ScreenRotationAnimation.java b/services/core/java/com/android/server/wm/ScreenRotationAnimation.java
index d67a0d3..50749a9 100644
--- a/services/core/java/com/android/server/wm/ScreenRotationAnimation.java
+++ b/services/core/java/com/android/server/wm/ScreenRotationAnimation.java
@@ -253,7 +253,16 @@
ProtoLog.i(WM_SHOW_SURFACE_ALLOC,
" FREEZE %s: CREATE", mScreenshotLayer);
- setRotation(t, realOriginalRotation);
+ if (originalRotation == realOriginalRotation) {
+ setRotation(t, realOriginalRotation);
+ } else {
+ // If the given original rotation is different from real original display rotation,
+ // this is playing non-zero degree rotation animation without display rotation change,
+ // so the snapshot doesn't need to be transformed.
+ mCurRotation = realOriginalRotation;
+ mSnapshotInitialMatrix.reset();
+ setRotationTransform(t, mSnapshotInitialMatrix);
+ }
t.apply();
}
diff --git a/services/core/java/com/android/server/wm/SurfaceAnimator.java b/services/core/java/com/android/server/wm/SurfaceAnimator.java
index ba18893..3c6c23b 100644
--- a/services/core/java/com/android/server/wm/SurfaceAnimator.java
+++ b/services/core/java/com/android/server/wm/SurfaceAnimator.java
@@ -520,7 +520,7 @@
/**
* Converts {@link AnimationType} to String.
*/
- private static String animationTypeToString(@AnimationType int type) {
+ static String animationTypeToString(@AnimationType int type) {
switch (type) {
case ANIMATION_TYPE_NONE: return "none";
case ANIMATION_TYPE_APP_TRANSITION: return "app_transition";
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index e120754..796e267 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -2003,6 +2003,8 @@
return false;
}
if (tda == null) {
+ Slog.w(TAG_TASKS, "Can't find TaskDisplayArea to determine support for multi"
+ + " window. Task id=" + mTaskId + " attached=" + isAttached());
return false;
}
@@ -3150,11 +3152,14 @@
// Figure-out min/max possible position depending on if child can show for current user.
int minPosition = (canShowChild) ? computeMinUserPosition(0, size) : 0;
- int maxPosition = (canShowChild) ? size : computeMaxUserPosition(size - 1);
+ int maxPosition = (canShowChild) ? size - 1 : computeMaxUserPosition(size - 1);
+ if (!hasChild(wc)) {
+ // Increase the maxPosition because children size will grow once wc is added.
+ ++maxPosition;
+ }
// Factor in always-on-top children in max possible position.
if (!wc.isAlwaysOnTop()) {
-
// We want to place all non-always-on-top containers below always-on-top ones.
while (maxPosition > minPosition) {
if (!mChildren.get(maxPosition - 1).isAlwaysOnTop()) break;
@@ -4046,10 +4051,17 @@
fillTaskInfo(info, true /* stripExtras */);
}
+ void fillTaskInfo(TaskInfo info, boolean stripExtras) {
+ fillTaskInfo(info, stripExtras, getDisplayArea());
+ }
+
/**
* Fills in a {@link TaskInfo} with information from this task.
+ *
+ * @param tda consider whether this Task can be put in multi window as it will be attached to
+ * the give {@link TaskDisplayArea}.
*/
- void fillTaskInfo(TaskInfo info, boolean stripExtras) {
+ void fillTaskInfo(TaskInfo info, boolean stripExtras, @Nullable TaskDisplayArea tda) {
getNumRunningActivities(mReuseActivitiesReport);
info.userId = isLeafTask() ? mUserId : mCurrentUser;
info.taskId = mTaskId;
@@ -4074,8 +4086,8 @@
info.numActivities = mReuseActivitiesReport.numActivities;
info.lastActiveTime = lastActiveTime;
info.taskDescription = new ActivityManager.TaskDescription(getTaskDescription());
- info.supportsSplitScreenMultiWindow = supportsSplitScreenWindowingMode();
- info.supportsMultiWindow = supportsMultiWindow();
+ info.supportsSplitScreenMultiWindow = supportsSplitScreenWindowingModeInDisplayArea(tda);
+ info.supportsMultiWindow = supportsMultiWindowInDisplayArea(tda);
info.configuration.setTo(getConfiguration());
// Update to the task's current activity type and windowing mode which may differ from the
// window configuration
@@ -6066,6 +6078,7 @@
* @param prev The previously resumed activity, for when in the process
* of pausing; can be null to call from elsewhere.
* @param options Activity options.
+ * @param deferPause When {@code true}, this will not pause back tasks.
*
* @return Returns true if something is being resumed, or false if
* nothing happened.
@@ -6076,7 +6089,8 @@
* right activity for the current system state.
*/
@GuardedBy("mService")
- boolean resumeTopActivityUncheckedLocked(ActivityRecord prev, ActivityOptions options) {
+ boolean resumeTopActivityUncheckedLocked(ActivityRecord prev, ActivityOptions options,
+ boolean deferPause) {
if (mInResumeTopActivity) {
// Don't even start recursing.
return false;
@@ -6089,7 +6103,7 @@
if (isLeafTask()) {
if (isFocusableAndVisible()) {
- someActivityResumed = resumeTopActivityInnerLocked(prev, options);
+ someActivityResumed = resumeTopActivityInnerLocked(prev, options, deferPause);
}
} else {
int idx = mChildren.size() - 1;
@@ -6102,7 +6116,8 @@
break;
}
- someActivityResumed |= child.resumeTopActivityUncheckedLocked(prev, options);
+ someActivityResumed |= child.resumeTopActivityUncheckedLocked(prev, options,
+ deferPause);
// Doing so in order to prevent IndexOOB since hierarchy might changes while
// resuming activities, for example dismissing split-screen while starting
// non-resizeable activity.
@@ -6130,8 +6145,15 @@
return someActivityResumed;
}
+ /** @see #resumeTopActivityUncheckedLocked(ActivityRecord, ActivityOptions, boolean) */
@GuardedBy("mService")
- private boolean resumeTopActivityInnerLocked(ActivityRecord prev, ActivityOptions options) {
+ boolean resumeTopActivityUncheckedLocked(ActivityRecord prev, ActivityOptions options) {
+ return resumeTopActivityUncheckedLocked(prev, options, false /* skipPause */);
+ }
+
+ @GuardedBy("mService")
+ private boolean resumeTopActivityInnerLocked(ActivityRecord prev, ActivityOptions options,
+ boolean deferPause) {
if (!mAtmService.isBooting() && !mAtmService.isBooted()) {
// Not ready yet!
return false;
@@ -6227,7 +6249,7 @@
lastResumed = lastFocusedRootTask.getResumedActivity();
}
- boolean pausing = taskDisplayArea.pauseBackTasks(next);
+ boolean pausing = !deferPause && taskDisplayArea.pauseBackTasks(next);
if (mResumedActivity != null) {
ProtoLog.d(WM_DEBUG_STATES, "resumeTopActivityLocked: Pausing %s", mResumedActivity);
pausing |= startPausingLocked(false /* uiSleeping */, next,
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 55224cc..8bee862 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -106,6 +106,7 @@
import static com.android.server.wm.DisplayContent.IME_TARGET_CONTROL;
import static com.android.server.wm.DisplayContent.IME_TARGET_INPUT;
import static com.android.server.wm.DisplayContent.IME_TARGET_LAYERING;
+import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_ALL;
import static com.android.server.wm.WindowContainer.AnimationFlags.CHILDREN;
import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS;
import static com.android.server.wm.WindowContainer.AnimationFlags.TRANSITION;
@@ -8090,8 +8091,13 @@
// This could prevent if there is no container animation, we still have to apply the
// pending transaction and exit waiting.
mAnimator.mNotifyWhenNoAnimation = true;
- while ((mAnimator.isAnimationScheduled()
- || mRoot.isAnimating(TRANSITION | CHILDREN)) && timeoutRemaining > 0) {
+ WindowContainer animatingContainer = null;
+ while (mAnimator.isAnimationScheduled() || timeoutRemaining > 0) {
+ animatingContainer = mRoot.getAnimatingContainer(TRANSITION | CHILDREN,
+ ANIMATION_TYPE_ALL);
+ if (animatingContainer == null) {
+ break;
+ }
long startTime = System.currentTimeMillis();
try {
mGlobalLock.wait(timeoutRemaining);
@@ -8101,9 +8107,13 @@
}
mAnimator.mNotifyWhenNoAnimation = false;
- if (mAnimator.isAnimationScheduled()
- || mRoot.isAnimating(TRANSITION | CHILDREN)) {
- Slog.w(TAG, "Timed out waiting for animations to complete.");
+ if (mAnimator.isAnimationScheduled() || animatingContainer != null) {
+ Slog.w(TAG, "Timed out waiting for animations to complete,"
+ + " animatingContainer=" + animatingContainer
+ + " animationType=" + SurfaceAnimator.animationTypeToString(
+ animatingContainer != null
+ ? animatingContainer.mSurfaceAnimator.getAnimationType()
+ : SurfaceAnimator.ANIMATION_TYPE_NONE));
}
}
}
diff --git a/services/core/java/com/android/server/wm/WindowOrganizerController.java b/services/core/java/com/android/server/wm/WindowOrganizerController.java
index b7ad820..a82a478 100644
--- a/services/core/java/com/android/server/wm/WindowOrganizerController.java
+++ b/services/core/java/com/android/server/wm/WindowOrganizerController.java
@@ -16,7 +16,6 @@
package com.android.server.wm;
-import static android.Manifest.permission.READ_FRAME_BUFFER;
import static android.window.WindowContainerTransaction.HierarchyOp.HIERARCHY_OP_TYPE_CHILDREN_TASKS_REPARENT;
import static android.window.WindowContainerTransaction.HierarchyOp.HIERARCHY_OP_TYPE_LAUNCH_TASK;
import static android.window.WindowContainerTransaction.HierarchyOp.HIERARCHY_OP_TYPE_REORDER;
@@ -37,8 +36,6 @@
import android.app.WindowConfiguration;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
-import android.graphics.GraphicBuffer;
-import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.os.Binder;
import android.os.Bundle;
@@ -53,7 +50,6 @@
import android.window.ITransitionPlayer;
import android.window.IWindowContainerTransactionCallback;
import android.window.IWindowOrganizerController;
-import android.window.WindowContainerToken;
import android.window.WindowContainerTransaction;
import com.android.internal.annotations.VisibleForTesting;
@@ -787,44 +783,6 @@
}
@Override
- public boolean takeScreenshot(WindowContainerToken token, SurfaceControl outSurfaceControl) {
- mService.mAmInternal.enforceCallingPermission(READ_FRAME_BUFFER, "takeScreenshot()");
- final WindowContainer wc = WindowContainer.fromBinder(token.asBinder());
- if (wc == null) {
- throw new RuntimeException("Invalid token in screenshot transaction");
- }
-
- final Rect bounds = new Rect();
- wc.getBounds(bounds);
- bounds.offsetTo(0, 0);
- SurfaceControl.ScreenshotHardwareBuffer buffer = SurfaceControl.captureLayers(
- wc.getSurfaceControl(), bounds, 1);
-
- if (buffer == null || buffer.getHardwareBuffer() == null) {
- return false;
- }
-
- GraphicBuffer graphicBuffer = GraphicBuffer.createFromHardwareBuffer(
- buffer.getHardwareBuffer());
- SurfaceControl screenshot = mService.mWindowManager.mSurfaceControlFactory.apply(null)
- .setName(wc.getName() + " - Organizer Screenshot")
- .setFormat(PixelFormat.TRANSLUCENT)
- .setParent(wc.getParentSurfaceControl())
- .setSecure(buffer.containsSecureLayers())
- .setCallsite("WindowOrganizerController.takeScreenshot")
- .setBLASTLayer()
- .build();
-
- SurfaceControl.Transaction transaction = mService.mWindowManager.mTransactionFactory.get();
- transaction.setBuffer(screenshot, graphicBuffer);
- transaction.setColorSpace(screenshot, buffer.getColorSpace());
- transaction.apply();
-
- outSurfaceControl.copyFrom(screenshot, "WindowOrganizerController.takeScreenshot");
- return true;
- }
-
- @Override
public void registerTransitionPlayer(ITransitionPlayer player) {
enforceTaskPermission("registerTransitionPlayer()");
final long ident = Binder.clearCallingIdentity();
diff --git a/services/core/java/com/android/server/wm/WindowOrientationListener.java b/services/core/java/com/android/server/wm/WindowOrientationListener.java
index 3847cb1..249880e 100644
--- a/services/core/java/com/android/server/wm/WindowOrientationListener.java
+++ b/services/core/java/com/android/server/wm/WindowOrientationListener.java
@@ -31,9 +31,7 @@
import android.os.Handler;
import android.os.SystemClock;
import android.os.SystemProperties;
-import android.os.UserHandle;
import android.provider.DeviceConfig;
-import android.provider.Settings;
import android.rotationresolver.RotationResolverInternal;
import android.util.Slog;
import android.util.proto.ProtoOutputStream;
@@ -66,7 +64,6 @@
private static final boolean USE_GRAVITY_SENSOR = false;
private static final int DEFAULT_BATCH_LATENCY = 100000;
- private static final int DEFAULT_ROTATION_RESOLVER_ENABLED = 0; // disabled
private static final String KEY_ROTATION_RESOLVER_TIMEOUT = "rotation_resolver_timeout_millis";
private static final long DEFAULT_ROTATION_RESOLVER_TIMEOUT_MILLIS = 700L;
@@ -278,11 +275,7 @@
* screen rotation.
*/
@VisibleForTesting
- boolean isRotationResolverEnabled() {
- return Settings.Secure.getIntForUser(mContext.getContentResolver(),
- Settings.Secure.CAMERA_AUTOROTATE, DEFAULT_ROTATION_RESOLVER_ENABLED,
- UserHandle.USER_CURRENT) == 1;
- }
+ abstract boolean isRotationResolverEnabled();
/**
* Called when the rotation view of the device has changed.
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index b93312a..d09cc46 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -4855,8 +4855,9 @@
// (i.e. Like {@link DisplayContent.ImeContainer#skipImeWindowsDuringTraversal}, the IME
// window will be ignored to traverse when the IME target is still in split-screen mode).
if (isImeLayeringTarget()
- && !getDisplayContent().getDefaultTaskDisplayArea().isSplitScreenModeActivated()) {
- if (getDisplayContent().forAllImeWindows(callback, traverseTopToBottom)) {
+ && (!mDisplayContent.getDefaultTaskDisplayArea().isSplitScreenModeActivated()
+ || getTask() == null)) {
+ if (mDisplayContent.forAllImeWindows(callback, traverseTopToBottom)) {
return true;
}
}
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 23a67b7..8089fb1 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -1754,12 +1754,39 @@
if (userHandle == UserHandle.USER_SYSTEM) {
mStateCache.setDeviceProvisioned(policy.mUserSetupComplete);
}
+
+ migrateDeviceOwnerProtectedPackagesToOwners(userHandle, policy);
}
return policy;
}
}
/**
+ * Only used by {@link #getUserData(int)} to migrate <b>existing</b> device owner protected
+ * packages that were stored in {@link DevicePolicyData#mUserControlDisabledPackages} to
+ * {@link Owners} because the device owner protected packages are now stored on a per device
+ * owner basis instead of on a per user basis.
+ *
+ * Any calls to {@link #setUserControlDisabledPackages(ComponentName, List)} would now store
+ * the device owner protected packages in {@link Owners} instead of {@link DevicePolicyData}.
+ * @param userHandle The device owner user
+ * @param policy The policy data of the device owner user
+ */
+ private void migrateDeviceOwnerProtectedPackagesToOwners(
+ int userHandle, DevicePolicyData policy) {
+ ComponentName deviceOwnerComponent = getOwnerComponent(userHandle);
+ if (isDeviceOwner(deviceOwnerComponent, userHandle)
+ && !policy.mUserControlDisabledPackages.isEmpty()) {
+ mOwners.setDeviceOwnerProtectedPackages(
+ deviceOwnerComponent.getPackageName(),
+ policy.mUserControlDisabledPackages);
+
+ policy.mUserControlDisabledPackages = new ArrayList<>();
+ saveSettingsLocked(userHandle);
+ }
+ }
+
+ /**
* Creates and loads the policy data from xml for data that is shared between
* various profiles of a user. In contrast to {@link #getUserData(int)}
* it allows access to data of users other than the calling user.
@@ -2863,7 +2890,6 @@
updateMaximumTimeToLockLocked(userHandle);
updateLockTaskPackagesLocked(policy.mLockTaskPackages, userHandle);
updateLockTaskFeaturesLocked(policy.mLockTaskFeatures, userHandle);
- updateUserControlDisabledPackagesLocked(policy.mUserControlDisabledPackages);
if (policy.mStatusBarDisabled) {
setStatusBarDisabledInternal(policy.mStatusBarDisabled, userHandle);
}
@@ -2907,10 +2933,6 @@
}
}
- private void updateUserControlDisabledPackagesLocked(List<String> packages) {
- mInjector.getPackageManagerInternal().setDeviceOwnerProtectedPackages(packages);
- }
-
private void updateLockTaskFeaturesLocked(int flags, int userId) {
long ident = mInjector.binderClearCallingIdentity();
try {
@@ -7848,56 +7870,52 @@
void sendDeviceOwnerCommand(String action, Bundle extras) {
final int deviceOwnerUserId;
+ final ComponentName receiverComponent;
synchronized (getLockObject()) {
deviceOwnerUserId = mOwners.getDeviceOwnerUserId();
+ receiverComponent = mOwners.getDeviceOwnerComponent();
}
-
- ComponentName receiverComponent = null;
- if (action.equals(DeviceAdminReceiver.ACTION_NETWORK_LOGS_AVAILABLE)) {
- receiverComponent = resolveDelegateReceiver(DELEGATION_NETWORK_LOGGING, action,
- deviceOwnerUserId);
- }
- if (action.equals(DeviceAdminReceiver.ACTION_SECURITY_LOGS_AVAILABLE)) {
- receiverComponent = resolveDelegateReceiver(DELEGATION_SECURITY_LOGGING, action,
- deviceOwnerUserId);
- }
- if (receiverComponent == null) {
- synchronized (getLockObject()) {
- receiverComponent = mOwners.getDeviceOwnerComponent();
- }
- }
- sendActiveAdminCommand(action, extras, deviceOwnerUserId, receiverComponent);
+ sendActiveAdminCommand(action, extras, deviceOwnerUserId, receiverComponent,
+ /* inForeground */ false);
}
void sendDeviceOwnerOrProfileOwnerCommand(String action, Bundle extras, int userId) {
if (userId == UserHandle.USER_ALL) {
userId = UserHandle.USER_SYSTEM;
}
+ boolean inForeground = false;
ComponentName receiverComponent = null;
if (action.equals(DeviceAdminReceiver.ACTION_NETWORK_LOGS_AVAILABLE)) {
+ inForeground = true;
receiverComponent = resolveDelegateReceiver(DELEGATION_NETWORK_LOGGING, action, userId);
}
if (action.equals(DeviceAdminReceiver.ACTION_SECURITY_LOGS_AVAILABLE)) {
+ inForeground = true;
receiverComponent = resolveDelegateReceiver(
DELEGATION_SECURITY_LOGGING, action, userId);
}
if (receiverComponent == null) {
receiverComponent = getOwnerComponent(userId);
}
- sendActiveAdminCommand(action, extras, userId, receiverComponent);
+ sendActiveAdminCommand(action, extras, userId, receiverComponent, inForeground);
}
private void sendProfileOwnerCommand(String action, Bundle extras, @UserIdInt int userId) {
- sendActiveAdminCommand(action, extras, userId, mOwners.getProfileOwnerComponent(userId));
+ sendActiveAdminCommand(action, extras, userId, mOwners.getProfileOwnerComponent(userId),
+ /* inForeground */ false);
}
private void sendActiveAdminCommand(String action, Bundle extras,
- @UserIdInt int userId, ComponentName receiverComponent) {
+ @UserIdInt int userId, ComponentName receiverComponent, boolean inForeground) {
final Intent intent = new Intent(action);
intent.setComponent(receiverComponent);
if (extras != null) {
intent.putExtras(extras);
}
+ if (inForeground) {
+ intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
+ }
+
if (VERBOSE_LOG) {
Slogf.v(LOG_TAG, "sendActiveAdminCommand(): broadcasting " + action + " to "
+ receiverComponent.flattenToShortString() + " on user " + userId);
@@ -8759,7 +8777,6 @@
updateLockTaskPackagesLocked(policy.mLockTaskPackages, userId);
policy.mLockTaskFeatures = DevicePolicyManager.LOCK_TASK_FEATURE_NONE;
policy.mUserControlDisabledPackages.clear();
- updateUserControlDisabledPackagesLocked(policy.mUserControlDisabledPackages);
saveSettingsLocked(userId);
try {
@@ -11987,8 +12004,8 @@
Preconditions.checkCallAuthorization(isDeviceOwner(caller));
UserHandle userHandle = caller.getUserHandle();
- if (mIsAutomotive) {
- Slogf.v(LOG_TAG, "setLocationEnabled(%s, %b): ignoring for user %s on automotive build",
+ if (mIsAutomotive && !locationEnabled) {
+ Slogf.i(LOG_TAG, "setLocationEnabled(%s, %b): ignoring for user %s on automotive build",
who.flattenToShortString(), locationEnabled, userHandle);
return;
}
@@ -11996,8 +12013,8 @@
mInjector.binderWithCleanCallingIdentity(() -> {
boolean wasLocationEnabled = mInjector.getLocationManager().isLocationEnabledForUser(
userHandle);
- Slogf.v(LOG_TAG, "calling locationManager.setLocationEnabledForUser(%b, %s)",
- locationEnabled, userHandle);
+ Slogf.v(LOG_TAG, "calling locationMgr.setLocationEnabledForUser(%b, %s) when it was %b",
+ locationEnabled, userHandle, wasLocationEnabled);
mInjector.getLocationManager().setLocationEnabledForUser(locationEnabled, userHandle);
// make a best effort to only show the notification if the admin is actually enabling
@@ -16199,14 +16216,14 @@
@Override
public void setUserControlDisabledPackages(ComponentName who, List<String> packages) {
Objects.requireNonNull(who, "ComponentName is null");
- Preconditions.checkNotNull(packages, "packages is null");
+ Objects.requireNonNull(packages, "packages is null");
final CallerIdentity caller = getCallerIdentity(who);
Preconditions.checkCallAuthorization(isDeviceOwner(caller));
checkCanExecuteOrThrowUnsafe(
DevicePolicyManager.OPERATION_SET_USER_CONTROL_DISABLED_PACKAGES);
synchronized (getLockObject()) {
- setUserControlDisabledPackagesLocked(caller.getUserId(), packages);
+ mOwners.setDeviceOwnerProtectedPackages(who.getPackageName(), packages);
DevicePolicyEventLogger
.createEvent(DevicePolicyEnums.SET_USER_CONTROL_DISABLED_PACKAGES)
.setAdmin(who)
@@ -16215,15 +16232,6 @@
}
}
- private void setUserControlDisabledPackagesLocked(int userHandle, List<String> packages) {
- final DevicePolicyData policy = getUserData(userHandle);
- policy.mUserControlDisabledPackages = packages;
-
- // Store the settings persistently.
- saveSettingsLocked(userHandle);
- updateUserControlDisabledPackagesLocked(packages);
- }
-
@Override
public List<String> getUserControlDisabledPackages(ComponentName who) {
Objects.requireNonNull(who, "ComponentName is null");
@@ -16232,9 +16240,7 @@
Preconditions.checkCallAuthorization(isDeviceOwner(caller));
synchronized (getLockObject()) {
- final List<String> packages =
- getUserData(caller.getUserId()).mUserControlDisabledPackages;
- return packages == null ? Collections.EMPTY_LIST : packages;
+ return mOwners.getDeviceOwnerProtectedPackages(who.getPackageName());
}
}
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/Owners.java b/services/devicepolicy/java/com/android/server/devicepolicy/Owners.java
index 7fdd6ee..fd09e3f 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/Owners.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/Owners.java
@@ -62,6 +62,7 @@
import java.io.InputStream;
import java.time.LocalDate;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -97,10 +98,13 @@
// Holds "context" for device-owner, this must not be show up before device-owner.
private static final String TAG_DEVICE_OWNER_CONTEXT = "device-owner-context";
private static final String TAG_DEVICE_OWNER_TYPE = "device-owner-type";
+ private static final String TAG_DEVICE_OWNER_PROTECTED_PACKAGES =
+ "device-owner-protected-packages";
private static final String ATTR_NAME = "name";
private static final String ATTR_PACKAGE = "package";
private static final String ATTR_COMPONENT_NAME = "component";
+ private static final String ATTR_SIZE = "size";
private static final String ATTR_REMOTE_BUGREPORT_URI = "remoteBugreportUri";
private static final String ATTR_REMOTE_BUGREPORT_HASH = "remoteBugreportHash";
private static final String ATTR_USERID = "userId";
@@ -129,6 +133,8 @@
// Device owner type for a managed device.
private final ArrayMap<String, Integer> mDeviceOwnerTypes = new ArrayMap<>();
+ private final ArrayMap<String, List<String>> mDeviceOwnerProtectedPackages = new ArrayMap<>();
+
private int mDeviceOwnerUserId = UserHandle.USER_NULL;
// Internal state for the profile owner packages.
@@ -216,6 +222,12 @@
pushToActivityTaskManagerLocked();
pushToActivityManagerLocked();
pushToAppOpsLocked();
+
+ for (ArrayMap.Entry<String, List<String>> entry :
+ mDeviceOwnerProtectedPackages.entrySet()) {
+ mPackageManagerInternal.setDeviceOwnerProtectedPackages(
+ entry.getKey(), entry.getValue());
+ }
}
}
@@ -343,6 +355,12 @@
void clearDeviceOwner() {
synchronized (mLock) {
mDeviceOwnerTypes.remove(mDeviceOwner.packageName);
+ List<String> protectedPackages =
+ mDeviceOwnerProtectedPackages.remove(mDeviceOwner.packageName);
+ if (protectedPackages != null) {
+ mPackageManagerInternal.setDeviceOwnerProtectedPackages(
+ mDeviceOwner.packageName, new ArrayList<>());
+ }
mDeviceOwner = null;
mDeviceOwnerUserId = UserHandle.USER_NULL;
@@ -394,6 +412,12 @@
void transferDeviceOwnership(ComponentName target) {
synchronized (mLock) {
Integer previousDeviceOwnerType = mDeviceOwnerTypes.remove(mDeviceOwner.packageName);
+ List<String> previousProtectedPackages =
+ mDeviceOwnerProtectedPackages.remove(mDeviceOwner.packageName);
+ if (previousProtectedPackages != null) {
+ mPackageManagerInternal.setDeviceOwnerProtectedPackages(
+ mDeviceOwner.packageName, new ArrayList<>());
+ }
// We don't set a name because it's not used anyway.
// See DevicePolicyManagerService#getDeviceOwnerName
mDeviceOwner = new OwnerInfo(null, target,
@@ -403,6 +427,10 @@
if (previousDeviceOwnerType != null) {
mDeviceOwnerTypes.put(mDeviceOwner.packageName, previousDeviceOwnerType);
}
+ if (previousProtectedPackages != null) {
+ mDeviceOwnerProtectedPackages.put(
+ mDeviceOwner.packageName, previousProtectedPackages);
+ }
pushToPackageManagerLocked();
pushToActivityTaskManagerLocked();
pushToActivityManagerLocked();
@@ -583,7 +611,7 @@
}
}
- /** Sets the user restrictions migrated flag, and also writes to the file. */
+ /** Sets the user restrictions migrated flag, and also writes to the file. */
void setProfileOwnerUserRestrictionsMigrated(int userId) {
synchronized (mLock) {
OwnerInfo profileOwner = mProfileOwners.get(userId);
@@ -594,8 +622,10 @@
}
}
- /** Sets the indicator that the profile owner manages an organization-owned device,
- * then write to file. */
+ /**
+ * Sets the indicator that the profile owner manages an organization-owned device,
+ * then write to file.
+ */
void markProfileOwnerOfOrganizationOwnedDevice(int userId) {
synchronized (mLock) {
OwnerInfo profileOwner = mProfileOwners.get(userId);
@@ -640,6 +670,33 @@
}
}
+ void setDeviceOwnerProtectedPackages(String packageName, List<String> protectedPackages) {
+ synchronized (mLock) {
+ if (!hasDeviceOwner()) {
+ Slog.e(TAG,
+ "Attempting to set device owner protected packages when there is no "
+ + "device owner");
+ return;
+ } else if (!mDeviceOwner.packageName.equals(packageName)) {
+ Slog.e(TAG, "Attempting to set device owner protected packages when the provided "
+ + "package name " + packageName
+ + " does not match the device owner package name");
+ return;
+ }
+
+ mDeviceOwnerProtectedPackages.put(packageName, protectedPackages);
+ mPackageManagerInternal.setDeviceOwnerProtectedPackages(packageName, protectedPackages);
+ writeDeviceOwner();
+ }
+ }
+
+ List<String> getDeviceOwnerProtectedPackages(String packageName) {
+ synchronized (mLock) {
+ return mDeviceOwnerProtectedPackages.containsKey(packageName)
+ ? mDeviceOwnerProtectedPackages.get(packageName) : Collections.emptyList();
+ }
+ }
+
private boolean readLegacyOwnerFileLocked(File file) {
if (!file.exists()) {
// Already migrated or the device has no owners.
@@ -649,8 +706,8 @@
InputStream input = new AtomicFile(file).openRead();
TypedXmlPullParser parser = Xml.resolvePullParser(input);
int type;
- while ((type=parser.next()) != TypedXmlPullParser.END_DOCUMENT) {
- if (type!=TypedXmlPullParser.START_TAG) {
+ while ((type = parser.next()) != TypedXmlPullParser.END_DOCUMENT) {
+ if (type != TypedXmlPullParser.START_TAG) {
continue;
}
@@ -700,7 +757,7 @@
}
}
input.close();
- } catch (XmlPullParserException|IOException e) {
+ } catch (XmlPullParserException | IOException e) {
Slog.e(TAG, "Error parsing device-owner file", e);
}
return true;
@@ -936,6 +993,21 @@
}
}
+ if (!mDeviceOwnerProtectedPackages.isEmpty()) {
+ for (ArrayMap.Entry<String, List<String>> entry :
+ mDeviceOwnerProtectedPackages.entrySet()) {
+ List<String> protectedPackages = entry.getValue();
+
+ out.startTag(null, TAG_DEVICE_OWNER_PROTECTED_PACKAGES);
+ out.attribute(null, ATTR_PACKAGE, entry.getKey());
+ out.attributeInt(null, ATTR_SIZE, protectedPackages.size());
+ for (int i = 0, size = protectedPackages.size(); i < size; i++) {
+ out.attribute(null, ATTR_NAME + i, protectedPackages.get(i));
+ }
+ out.endTag(null, TAG_DEVICE_OWNER_PROTECTED_PACKAGES);
+ }
+ }
+
if (mSystemUpdatePolicy != null) {
out.startTag(null, TAG_SYSTEM_UPDATE_POLICY);
mSystemUpdatePolicy.saveToXml(out);
@@ -1002,6 +1074,15 @@
DEVICE_OWNER_TYPE_DEFAULT);
mDeviceOwnerTypes.put(packageName, deviceOwnerType);
break;
+ case TAG_DEVICE_OWNER_PROTECTED_PACKAGES:
+ packageName = parser.getAttributeValue(null, ATTR_PACKAGE);
+ int protectedPackagesSize = parser.getAttributeInt(null, ATTR_SIZE, 0);
+ List<String> protectedPackages = new ArrayList<>();
+ for (int i = 0; i < protectedPackagesSize; i++) {
+ protectedPackages.add(parser.getAttributeValue(null, ATTR_NAME + i));
+ }
+ mDeviceOwnerProtectedPackages.put(packageName, protectedPackages);
+ break;
default:
Slog.e(TAG, "Unexpected tag: " + tag);
return false;
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/SecurityLogMonitor.java b/services/devicepolicy/java/com/android/server/devicepolicy/SecurityLogMonitor.java
index 3c445ca..c29de90 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/SecurityLogMonitor.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/SecurityLogMonitor.java
@@ -226,7 +226,7 @@
Slog.i(TAG, "Resumed.");
try {
- notifyDeviceOwnerIfNeeded(false /* force */);
+ notifyDeviceOwnerOrProfileOwnerIfNeeded(false /* force */);
} catch (InterruptedException e) {
Log.w(TAG, "Thread interrupted.", e);
}
@@ -439,7 +439,7 @@
saveLastEvents(newLogs);
newLogs.clear();
- notifyDeviceOwnerIfNeeded(force);
+ notifyDeviceOwnerOrProfileOwnerIfNeeded(force);
} catch (IOException e) {
Log.e(TAG, "Failed to read security log", e);
} catch (InterruptedException e) {
@@ -460,8 +460,9 @@
Slog.i(TAG, "MonitorThread exit.");
}
- private void notifyDeviceOwnerIfNeeded(boolean force) throws InterruptedException {
- boolean allowRetrievalAndNotifyDO = false;
+ private void notifyDeviceOwnerOrProfileOwnerIfNeeded(boolean force)
+ throws InterruptedException {
+ boolean allowRetrievalAndNotifyDOOrPO = false;
mLock.lockInterruptibly();
try {
if (mPaused) {
@@ -471,16 +472,16 @@
if (logSize >= BUFFER_ENTRIES_NOTIFICATION_LEVEL || (force && logSize > 0)) {
// Allow DO to retrieve logs if too many pending logs or if forced.
if (!mAllowedToRetrieve) {
- allowRetrievalAndNotifyDO = true;
+ allowRetrievalAndNotifyDOOrPO = true;
}
if (DEBUG) Slog.d(TAG, "Number of log entries over threshold: " + logSize);
}
if (logSize > 0 && SystemClock.elapsedRealtime() >= mNextAllowedRetrievalTimeMillis) {
// Rate limit reset
- allowRetrievalAndNotifyDO = true;
+ allowRetrievalAndNotifyDOOrPO = true;
if (DEBUG) Slog.d(TAG, "Timeout reached");
}
- if (allowRetrievalAndNotifyDO) {
+ if (allowRetrievalAndNotifyDOOrPO) {
mAllowedToRetrieve = true;
// Set the timeout to retry the notification if the DO misses it.
mNextAllowedRetrievalTimeMillis = SystemClock.elapsedRealtime()
@@ -489,10 +490,10 @@
} finally {
mLock.unlock();
}
- if (allowRetrievalAndNotifyDO) {
- Slog.i(TAG, "notify DO");
- mService.sendDeviceOwnerCommand(DeviceAdminReceiver.ACTION_SECURITY_LOGS_AVAILABLE,
- null);
+ if (allowRetrievalAndNotifyDOOrPO) {
+ Slog.i(TAG, "notify DO or PO");
+ mService.sendDeviceOwnerOrProfileOwnerCommand(
+ DeviceAdminReceiver.ACTION_SECURITY_LOGS_AVAILABLE, null, mEnabledUser);
}
}
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 9649570..e7a4c92 100644
--- a/services/tests/mockingservicestests/src/com/android/server/app/GameManagerServiceTests.java
+++ b/services/tests/mockingservicestests/src/com/android/server/app/GameManagerServiceTests.java
@@ -299,11 +299,13 @@
public void testGameMode() {
GameManagerService gameManagerService = new GameManagerService(mMockContext);
gameManagerService.onUserStarting(USER_ID_1);
-
+ gameManagerService.updateConfigsForUser(USER_ID_1, mPackageName);
mockModifyGameModeGranted();
-
assertEquals(GameManager.GAME_MODE_UNSUPPORTED,
gameManagerService.getGameMode(mPackageName, USER_ID_1));
+ // We need to make sure the mode is supported before setting it.
+ mockDeviceConfigAll();
+ gameManagerService.updateConfigsForUser(USER_ID_1, mPackageName);
gameManagerService.setGameMode(mPackageName, GameManager.GAME_MODE_STANDARD, USER_ID_1);
assertEquals(GameManager.GAME_MODE_STANDARD,
gameManagerService.getGameMode(mPackageName, USER_ID_1));
@@ -370,11 +372,13 @@
*/
@Test
public void testGameModeMultipleUsers() {
+ mockModifyGameModeGranted();
+ mockDeviceConfigAll();
GameManagerService gameManagerService = new GameManagerService(mMockContext);
gameManagerService.onUserStarting(USER_ID_1);
gameManagerService.onUserStarting(USER_ID_2);
-
- mockModifyGameModeGranted();
+ gameManagerService.updateConfigsForUser(USER_ID_1, mPackageName);
+ gameManagerService.updateConfigsForUser(USER_ID_2, mPackageName);
// Set User 1 to Standard
gameManagerService.setGameMode(mPackageName, GameManager.GAME_MODE_STANDARD, USER_ID_1);
@@ -603,4 +607,52 @@
gameManagerService.getConfig(mPackageName);
assertNull(config.getGameModeConfiguration(GameManager.GAME_MODE_PERFORMANCE));
}
+
+ /**
+ * Ensure that, if a game no longer supports any game modes, we set the game mode to
+ * UNSUPPORTED
+ */
+ @Test
+ public void testUnsetInvalidGameMode() throws Exception {
+ mockDeviceConfigNone();
+ mockModifyGameModeGranted();
+ GameManagerService gameManagerService = new GameManagerService(mMockContext);
+ gameManagerService.onUserStarting(USER_ID_1);
+ gameManagerService.setGameMode(mPackageName, GameManager.GAME_MODE_PERFORMANCE, USER_ID_1);
+ gameManagerService.updateConfigsForUser(USER_ID_1, mPackageName);
+ assertEquals(GameManager.GAME_MODE_UNSUPPORTED,
+ gameManagerService.getGameMode(mPackageName, USER_ID_1));
+ }
+
+ /**
+ * Ensure that, if a game no longer supports a specific game mode, but supports STANDARD, we set
+ * the game mode to STANDARD.
+ */
+ @Test
+ public void testResetInvalidGameMode() throws Exception {
+ mockDeviceConfigPerformance();
+ mockModifyGameModeGranted();
+ GameManagerService gameManagerService = new GameManagerService(mMockContext);
+ gameManagerService.onUserStarting(USER_ID_1);
+ gameManagerService.setGameMode(mPackageName, GameManager.GAME_MODE_BATTERY, USER_ID_1);
+ gameManagerService.updateConfigsForUser(USER_ID_1, mPackageName);
+ assertEquals(GameManager.GAME_MODE_STANDARD,
+ gameManagerService.getGameMode(mPackageName, USER_ID_1));
+ }
+
+ /**
+ * Ensure that if a game supports STANDARD, but is currently set to UNSUPPORTED, we set the game
+ * mode to STANDARD
+ */
+ @Test
+ public void testSetValidGameMode() throws Exception {
+ mockDeviceConfigPerformance();
+ mockModifyGameModeGranted();
+ GameManagerService gameManagerService = new GameManagerService(mMockContext);
+ gameManagerService.onUserStarting(USER_ID_1);
+ gameManagerService.setGameMode(mPackageName, GameManager.GAME_MODE_UNSUPPORTED, USER_ID_1);
+ gameManagerService.updateConfigsForUser(USER_ID_1, mPackageName);
+ assertEquals(GameManager.GAME_MODE_STANDARD,
+ gameManagerService.getGameMode(mPackageName, USER_ID_1));
+ }
}
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
index 2270943..bfdf5af 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
@@ -6542,29 +6542,26 @@
final List<String> testPackages = new ArrayList<>();
testPackages.add("package_1");
testPackages.add("package_2");
-
- mContext.callerPermissions.add(android.Manifest.permission.MANAGE_DEVICE_ADMINS);
+ mServiceContext.permissions.add(permission.MANAGE_DEVICE_ADMINS);
setDeviceOwner();
dpm.setUserControlDisabledPackages(admin1, testPackages);
- verify(getServices().packageManagerInternal).setDeviceOwnerProtectedPackages(testPackages);
-
+ verify(getServices().packageManagerInternal)
+ .setDeviceOwnerProtectedPackages(admin1.getPackageName(), testPackages);
assertThat(dpm.getUserControlDisabledPackages(admin1)).isEqualTo(testPackages);
}
@Test
- public void testSetUserControlDisabledPackages_failingAsPO() throws Exception {
+ public void testSetUserControlDisabledPackages_failingAsPO() {
final List<String> testPackages = new ArrayList<>();
testPackages.add("package_1");
testPackages.add("package_2");
-
- mContext.callerPermissions.add(android.Manifest.permission.MANAGE_DEVICE_ADMINS);
+ mServiceContext.permissions.add(permission.MANAGE_DEVICE_ADMINS);
setAsProfileOwner(admin1);
assertExpectException(SecurityException.class, /* messageRegex= */ null,
() -> dpm.setUserControlDisabledPackages(admin1, testPackages));
-
assertExpectException(SecurityException.class, /* messageRegex= */ null,
() -> dpm.getUserControlDisabledPackages(admin1));
}
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/OwnersTest.java b/services/tests/servicestests/src/com/android/server/devicepolicy/OwnersTest.java
index 39ca925d..02a8ae8 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/OwnersTest.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/OwnersTest.java
@@ -21,6 +21,8 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.verify;
+
import android.content.ComponentName;
import android.os.UserHandle;
import android.test.suitebuilder.annotation.SmallTest;
@@ -29,9 +31,14 @@
import com.android.server.devicepolicy.DevicePolicyManagerServiceTestable.OwnersTestable;
+import com.google.android.collect.Lists;
+
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* Tests for the DeviceOwner object that saves & loads device and policy owner information.
*
@@ -43,6 +50,9 @@
@RunWith(AndroidJUnit4.class)
public class OwnersTest extends DpmTestBase {
+ private static final List<String> DEVICE_OWNER_PROTECTED_PACKAGES =
+ Lists.newArrayList("package_1", "package_2");
+
@Test
public void testUpgrade01() throws Exception {
getServices().addUsers(10, 11, 20, 21);
@@ -71,6 +81,8 @@
assertThat(owners.getDeviceOwnerUserId()).isEqualTo(UserHandle.USER_NULL);
assertThat(owners.getDeviceOwnerType(owners.getDeviceOwnerPackageName())).isEqualTo(
DEVICE_OWNER_TYPE_DEFAULT);
+ assertThat(owners.getDeviceOwnerProtectedPackages(owners.getDeviceOwnerPackageName()))
+ .isEmpty();
assertThat(owners.getSystemUpdatePolicy()).isNull();
assertThat(owners.getProfileOwnerKeys()).isEmpty();
@@ -96,6 +108,8 @@
assertThat(owners.getDeviceOwnerUserId()).isEqualTo(UserHandle.USER_NULL);
assertThat(owners.getDeviceOwnerType(owners.getDeviceOwnerPackageName())).isEqualTo(
DEVICE_OWNER_TYPE_DEFAULT);
+ assertThat(owners.getDeviceOwnerProtectedPackages(owners.getDeviceOwnerPackageName()))
+ .isEmpty();
assertThat(owners.getSystemUpdatePolicy()).isNull();
assertThat(owners.getProfileOwnerKeys()).isEmpty();
@@ -136,6 +150,8 @@
assertThat(owners.getDeviceOwnerUserId()).isEqualTo(UserHandle.USER_SYSTEM);
assertThat(owners.getDeviceOwnerType(owners.getDeviceOwnerPackageName())).isEqualTo(
DEVICE_OWNER_TYPE_DEFAULT);
+ assertThat(owners.getDeviceOwnerProtectedPackages(owners.getDeviceOwnerPackageName()))
+ .isEmpty();
assertThat(owners.getSystemUpdatePolicy()).isNull();
assertThat(owners.getProfileOwnerKeys()).isEmpty();
@@ -158,6 +174,8 @@
assertThat(owners.getDeviceOwnerUserId()).isEqualTo(UserHandle.USER_SYSTEM);
assertThat(owners.getDeviceOwnerType(owners.getDeviceOwnerPackageName())).isEqualTo(
DEVICE_OWNER_TYPE_DEFAULT);
+ assertThat(owners.getDeviceOwnerProtectedPackages(owners.getDeviceOwnerPackageName()))
+ .isEmpty();
assertThat(owners.getSystemUpdatePolicy()).isNull();
assertThat(owners.getProfileOwnerKeys()).isEmpty();
@@ -198,6 +216,8 @@
assertThat(owners.getSystemUpdatePolicy()).isNull();
assertThat(owners.getDeviceOwnerType(owners.getDeviceOwnerPackageName())).isEqualTo(
DEVICE_OWNER_TYPE_DEFAULT);
+ assertThat(owners.getDeviceOwnerProtectedPackages(owners.getDeviceOwnerPackageName()))
+ .isEmpty();
assertThat(owners.getProfileOwnerKeys()).hasSize(2);
assertThat(owners.getProfileOwnerComponent(10))
@@ -228,6 +248,8 @@
assertThat(owners.getSystemUpdatePolicy()).isNull();
assertThat(owners.getDeviceOwnerType(owners.getDeviceOwnerPackageName())).isEqualTo(
DEVICE_OWNER_TYPE_DEFAULT);
+ assertThat(owners.getDeviceOwnerProtectedPackages(owners.getDeviceOwnerPackageName()))
+ .isEmpty();
assertThat(owners.getProfileOwnerKeys()).hasSize(2);
assertThat(owners.getProfileOwnerComponent(10))
@@ -282,6 +304,8 @@
assertThat(owners.getDeviceOwnerUserId()).isEqualTo(UserHandle.USER_SYSTEM);
assertThat(owners.getDeviceOwnerType(owners.getDeviceOwnerPackageName())).isEqualTo(
DEVICE_OWNER_TYPE_DEFAULT);
+ assertThat(owners.getDeviceOwnerProtectedPackages(owners.getDeviceOwnerPackageName()))
+ .isEmpty();
assertThat(owners.getSystemUpdatePolicy()).isNotNull();
assertThat(owners.getSystemUpdatePolicy().getPolicyType()).isEqualTo(5);
@@ -316,6 +340,8 @@
assertThat(owners.getDeviceOwnerUserId()).isEqualTo(UserHandle.USER_SYSTEM);
assertThat(owners.getDeviceOwnerType(owners.getDeviceOwnerPackageName())).isEqualTo(
DEVICE_OWNER_TYPE_DEFAULT);
+ assertThat(owners.getDeviceOwnerProtectedPackages(owners.getDeviceOwnerPackageName()))
+ .isEmpty();
assertThat(owners.getSystemUpdatePolicy()).isNotNull();
assertThat(owners.getSystemUpdatePolicy().getPolicyType()).isEqualTo(5);
@@ -344,6 +370,14 @@
DEVICE_OWNER_TYPE_FINANCED);
assertThat(owners.getDeviceOwnerType(owners.getDeviceOwnerPackageName())).isEqualTo(
DEVICE_OWNER_TYPE_FINANCED);
+
+ owners.setDeviceOwnerProtectedPackages(
+ owners.getDeviceOwnerPackageName(), DEVICE_OWNER_PROTECTED_PACKAGES);
+ assertThat(owners.getDeviceOwnerProtectedPackages(owners.getDeviceOwnerPackageName()))
+ .isEqualTo(DEVICE_OWNER_PROTECTED_PACKAGES);
+ verify(getServices().packageManagerInternal)
+ .setDeviceOwnerProtectedPackages(
+ owners.getDeviceOwnerPackageName(), DEVICE_OWNER_PROTECTED_PACKAGES);
}
{
@@ -353,6 +387,8 @@
assertThat(owners.hasDeviceOwner()).isTrue();
assertThat(owners.getDeviceOwnerType(owners.getDeviceOwnerPackageName())).isEqualTo(
DEVICE_OWNER_TYPE_FINANCED);
+ assertThat(owners.getDeviceOwnerProtectedPackages(owners.getDeviceOwnerPackageName()))
+ .isEqualTo(DEVICE_OWNER_PROTECTED_PACKAGES);
assertThat(owners.getDeviceOwnerUserRestrictionsNeedsMigration()).isFalse();
assertThat(owners.getProfileOwnerUserRestrictionsNeedsMigration(10)).isTrue();
@@ -367,6 +403,14 @@
// The previous device owner type should persist.
assertThat(owners.getDeviceOwnerType(owners.getDeviceOwnerPackageName())).isEqualTo(
DEVICE_OWNER_TYPE_FINANCED);
+
+ owners.setDeviceOwnerProtectedPackages(
+ owners.getDeviceOwnerPackageName(), new ArrayList<>());
+ assertThat(owners.getDeviceOwnerProtectedPackages(owners.getDeviceOwnerPackageName()))
+ .isEmpty();
+ verify(getServices().packageManagerInternal)
+ .setDeviceOwnerProtectedPackages(
+ owners.getDeviceOwnerPackageName(), new ArrayList<>());
}
{
@@ -376,6 +420,8 @@
assertThat(owners.hasDeviceOwner()).isTrue();
assertThat(owners.getDeviceOwnerType(owners.getDeviceOwnerPackageName())).isEqualTo(
DEVICE_OWNER_TYPE_FINANCED);
+ assertThat(owners.getDeviceOwnerProtectedPackages(owners.getDeviceOwnerPackageName()))
+ .isEmpty();
assertThat(owners.getDeviceOwnerUserRestrictionsNeedsMigration()).isFalse();
assertThat(owners.getProfileOwnerUserRestrictionsNeedsMigration(10)).isTrue();
@@ -414,6 +460,8 @@
assertThat(owners.getDeviceOwnerUserId()).isEqualTo(UserHandle.USER_NULL);
assertThat(owners.getDeviceOwnerType(owners.getDeviceOwnerPackageName())).isEqualTo(
DEVICE_OWNER_TYPE_DEFAULT);
+ assertThat(owners.getDeviceOwnerProtectedPackages(owners.getDeviceOwnerPackageName()))
+ .isEmpty();
assertThat(owners.getSystemUpdatePolicy()).isNull();
@@ -435,6 +483,8 @@
assertThat(owners.getDeviceOwnerUserId()).isEqualTo(UserHandle.USER_NULL);
assertThat(owners.getDeviceOwnerType(owners.getDeviceOwnerPackageName())).isEqualTo(
DEVICE_OWNER_TYPE_DEFAULT);
+ assertThat(owners.getDeviceOwnerProtectedPackages(owners.getDeviceOwnerPackageName()))
+ .isEmpty();
assertThat(owners.getSystemUpdatePolicy()).isNull();
@@ -474,6 +524,8 @@
assertThat(owners.getDeviceOwnerUserId()).isEqualTo(UserHandle.USER_NULL);
assertThat(owners.getDeviceOwnerType(owners.getDeviceOwnerPackageName())).isEqualTo(
DEVICE_OWNER_TYPE_DEFAULT);
+ assertThat(owners.getDeviceOwnerProtectedPackages(owners.getDeviceOwnerPackageName()))
+ .isEmpty();
assertThat(owners.getProfileOwnerKeys()).isEmpty();
assertThat(owners.getSystemUpdatePolicy()).isNotNull();
@@ -495,6 +547,8 @@
assertThat(owners.getDeviceOwnerUserId()).isEqualTo(UserHandle.USER_NULL);
assertThat(owners.getDeviceOwnerType(owners.getDeviceOwnerPackageName())).isEqualTo(
DEVICE_OWNER_TYPE_DEFAULT);
+ assertThat(owners.getDeviceOwnerProtectedPackages(owners.getDeviceOwnerPackageName()))
+ .isEmpty();
assertThat(owners.getProfileOwnerKeys()).isEmpty();
assertThat(owners.getSystemUpdatePolicy()).isNotNull();
@@ -525,6 +579,8 @@
assertThat(owners.getDeviceOwnerFile().exists()).isTrue();
assertThat(owners.getDeviceOwnerType(owners.getDeviceOwnerPackageName())).isEqualTo(
DEVICE_OWNER_TYPE_DEFAULT);
+ assertThat(owners.getDeviceOwnerProtectedPackages(owners.getDeviceOwnerPackageName()))
+ .isEmpty();
assertThat(owners.getProfileOwnerFile(10).exists()).isTrue();
assertThat(owners.getProfileOwnerFile(11).exists()).isTrue();
@@ -532,6 +588,13 @@
owners.setDeviceOwnerType(previousDeviceOwnerPackageName, DEVICE_OWNER_TYPE_FINANCED);
assertThat(owners.getDeviceOwnerType(previousDeviceOwnerPackageName)).isEqualTo(
DEVICE_OWNER_TYPE_FINANCED);
+ owners.setDeviceOwnerProtectedPackages(
+ previousDeviceOwnerPackageName, DEVICE_OWNER_PROTECTED_PACKAGES);
+ assertThat(owners.getDeviceOwnerProtectedPackages(previousDeviceOwnerPackageName))
+ .isEqualTo(DEVICE_OWNER_PROTECTED_PACKAGES);
+ verify(getServices().packageManagerInternal)
+ .setDeviceOwnerProtectedPackages(
+ owners.getDeviceOwnerPackageName(), DEVICE_OWNER_PROTECTED_PACKAGES);
// Then clear all information and save.
owners.clearDeviceOwner();
@@ -552,5 +615,10 @@
assertThat(owners.getDeviceOwnerType(previousDeviceOwnerPackageName)).isEqualTo(
DEVICE_OWNER_TYPE_DEFAULT);
+ assertThat(owners.getDeviceOwnerProtectedPackages(previousDeviceOwnerPackageName))
+ .isEmpty();
+ verify(getServices().packageManagerInternal)
+ .setDeviceOwnerProtectedPackages(
+ previousDeviceOwnerPackageName, new ArrayList<>());
}
}
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowOrientationListenerTest.java b/services/tests/servicestests/src/com/android/server/wm/WindowOrientationListenerTest.java
index 0e615a6..9ce3bf4 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowOrientationListenerTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowOrientationListenerTest.java
@@ -31,6 +31,7 @@
import android.os.CancellationSignal;
import android.os.Handler;
import android.rotationresolver.RotationResolverInternal;
+import android.service.rotationresolver.RotationResolverService;
import android.view.Surface;
import org.junit.Before;
@@ -42,37 +43,37 @@
* Tests for {@link com.android.server.wm.WindowOrientationListener}
*/
public class WindowOrientationListenerTest {
+ private static final int DEFAULT_SENSOR_ROTATION = Surface.ROTATION_90;
@Mock
private Context mMockContext;
@Mock
- private Handler mMockHandler;
- @Mock
private InputSensorInfo mMockInputSensorInfo;
@Mock
private SensorManager mMockSensorManager;
-
private TestableRotationResolver mFakeRotationResolverInternal;
- private com.android.server.wm.WindowOrientationListener mWindowOrientationListener;
+ private TestableWindowOrientationListener mWindowOrientationListener;
private int mFinalizedRotation;
private boolean mRotationResolverEnabled;
private SensorEvent mFakeSensorEvent;
private Sensor mFakeSensor;
+ private Handler mHandler;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mRotationResolverEnabled = true;
+ mHandler = Handler.getMain();
mFakeRotationResolverInternal = new TestableRotationResolver();
doReturn(mMockSensorManager).when(mMockContext).getSystemService(Context.SENSOR_SERVICE);
mWindowOrientationListener = new TestableWindowOrientationListener(mMockContext,
- mMockHandler);
+ mHandler);
mWindowOrientationListener.mRotationResolverService = mFakeRotationResolverInternal;
mFakeSensor = new Sensor(mMockInputSensorInfo);
mFakeSensorEvent = new SensorEvent(mFakeSensor, /* accuracy */ 1, /* timestamp */ 1L,
- new float[]{(float) Surface.ROTATION_90});
+ new float[]{(float) DEFAULT_SENSOR_ROTATION});
}
@Test
@@ -81,21 +82,49 @@
mWindowOrientationListener.mOrientationJudge.onSensorChanged(mFakeSensorEvent);
- assertThat(mFinalizedRotation).isEqualTo(Surface.ROTATION_90);
+ assertThat(mFinalizedRotation).isEqualTo(DEFAULT_SENSOR_ROTATION);
}
@Test
- public void testOnSensorChanged_normalCase() {
- mFakeRotationResolverInternal.mResult = Surface.ROTATION_180;
+ public void testOnSensorChanged_callbackNotTheLatest_IgnoreResult() {
+ mWindowOrientationListener.mOrientationJudge.onSensorChanged(mFakeSensorEvent);
+ final RotationResolverInternal.RotationResolverCallbackInternal callback1 =
+ mFakeRotationResolverInternal.getCallback();
mWindowOrientationListener.mOrientationJudge.onSensorChanged(mFakeSensorEvent);
+ final RotationResolverInternal.RotationResolverCallbackInternal callback2 =
+ mFakeRotationResolverInternal.getCallback();
+
+ callback1.onSuccess(Surface.ROTATION_180);
+ assertThat(mWindowOrientationListener.mIsOnProposedRotationChangedCalled).isFalse();
+
+ callback2.onSuccess(Surface.ROTATION_270);
+ assertThat(mWindowOrientationListener.mIsOnProposedRotationChangedCalled).isTrue();
+ assertThat(mFinalizedRotation).isEqualTo(Surface.ROTATION_270);
+ }
+
+ @Test
+ public void testOnSensorChanged_normalCase1() {
+ mWindowOrientationListener.mOrientationJudge.onSensorChanged(mFakeSensorEvent);
+
+ mFakeRotationResolverInternal.callbackWithSuccessResult(Surface.ROTATION_180);
assertThat(mFinalizedRotation).isEqualTo(Surface.ROTATION_180);
}
- final class TestableRotationResolver extends RotationResolverInternal {
+ @Test
+ public void testSensorChanged_normalCase2() {
+ mWindowOrientationListener.mOrientationJudge.onSensorChanged(mFakeSensorEvent);
+
+ mFakeRotationResolverInternal.callbackWithFailureResult(
+ RotationResolverService.ROTATION_RESULT_FAILURE_CANCELLED);
+
+ assertThat(mFinalizedRotation).isEqualTo(DEFAULT_SENSOR_ROTATION);
+ }
+
+ static final class TestableRotationResolver extends RotationResolverInternal {
@Surface.Rotation
- int mResult;
+ RotationResolverCallbackInternal mCallback;
@Override
public boolean isRotationResolverSupported() {
@@ -107,11 +136,28 @@
String packageName, @Surface.Rotation int proposedRotation,
@Surface.Rotation int currentRotation, @DurationMillisLong long timeoutMillis,
@NonNull CancellationSignal cancellationSignal) {
- callback.onSuccess(mResult);
+ mCallback = callback;
+ }
+
+ public RotationResolverCallbackInternal getCallback() {
+ return mCallback;
+ }
+
+ public void callbackWithSuccessResult(int result) {
+ if (mCallback != null) {
+ mCallback.onSuccess(result);
+ }
+ }
+
+ public void callbackWithFailureResult(int error) {
+ if (mCallback != null) {
+ mCallback.onFailure(error);
+ }
}
}
final class TestableWindowOrientationListener extends WindowOrientationListener {
+ boolean mIsOnProposedRotationChangedCalled = false;
TestableWindowOrientationListener(Context context, Handler handler) {
super(context, handler);
@@ -121,6 +167,7 @@
@Override
public void onProposedRotationChanged(int rotation) {
mFinalizedRotation = rotation;
+ mIsOnProposedRotationChangedCalled = true;
}
@Override
diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java b/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java
index 4859569..6d4454b 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java
@@ -349,7 +349,9 @@
doReturn(imeSurfaceParent).when(mDisplayContent).computeImeParent();
spyOn(imeContainer);
- mDisplayContent.updateImeParent();
+ mDisplayContent.setImeInputTarget(startingWin);
+ mDisplayContent.onConfigurationChanged(new Configuration());
+ verify(mDisplayContent).updateImeParent();
// Force reassign the relative layer when the IME surface parent is changed.
verify(imeContainer).assignRelativeLayer(any(), eq(imeSurfaceParent), anyInt(), eq(true));
diff --git a/services/tests/wmtests/src/com/android/server/wm/DragDropControllerTests.java b/services/tests/wmtests/src/com/android/server/wm/DragDropControllerTests.java
index c47ffcf..8981ab1 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DragDropControllerTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/DragDropControllerTests.java
@@ -239,25 +239,31 @@
}
@Test
- public void testInterceptGlobalDragDropIgnoresOtherWindows() {
+ public void testPrivateInterceptGlobalDragDropIgnoresNonLocalWindows() {
+ WindowState nonLocalWindow = createDropTargetWindow("App drag test window", 0);
WindowState globalInterceptWindow = createDropTargetWindow("Global drag test window", 0);
globalInterceptWindow.mAttrs.privateFlags |= PRIVATE_FLAG_INTERCEPT_GLOBAL_DRAG_AND_DROP;
// Necessary for now since DragState.sendDragStartedLocked() will recycle drag events
// immediately after dispatching, which is a problem when using mockito arguments captor
// because it returns and modifies the same drag event
- TestIWindow iwindow = (TestIWindow) mWindow.mClient;
- final ArrayList<DragEvent> dragEvents = new ArrayList<>();
- iwindow.setDragEventJournal(dragEvents);
+ TestIWindow localIWindow = (TestIWindow) mWindow.mClient;
+ final ArrayList<DragEvent> localWindowDragEvents = new ArrayList<>();
+ localIWindow.setDragEventJournal(localWindowDragEvents);
+ TestIWindow nonLocalIWindow = (TestIWindow) nonLocalWindow.mClient;
+ final ArrayList<DragEvent> nonLocalWindowDragEvents = new ArrayList<>();
+ nonLocalIWindow.setDragEventJournal(nonLocalWindowDragEvents);
TestIWindow globalInterceptIWindow = (TestIWindow) globalInterceptWindow.mClient;
final ArrayList<DragEvent> globalInterceptWindowDragEvents = new ArrayList<>();
globalInterceptIWindow.setDragEventJournal(globalInterceptWindowDragEvents);
startDrag(View.DRAG_FLAG_GLOBAL | View.DRAG_FLAG_GLOBAL_URI_READ,
createClipDataForActivity(null, mock(UserHandle.class)), () -> {
- // Verify the start-drag event is sent for the intercept window but not the
- // other window
- assertTrue(dragEvents.isEmpty());
+ // Verify the start-drag event is sent for the local and global intercept window
+ // but not the other window
+ assertTrue(nonLocalWindowDragEvents.isEmpty());
+ assertTrue(localWindowDragEvents.get(0).getAction()
+ == ACTION_DRAG_STARTED);
assertTrue(globalInterceptWindowDragEvents.get(0).getAction()
== ACTION_DRAG_STARTED);
diff --git a/services/tests/wmtests/src/com/android/server/wm/RecentTasksTest.java b/services/tests/wmtests/src/com/android/server/wm/RecentTasksTest.java
index 95b5afc..5af68021 100644
--- a/services/tests/wmtests/src/com/android/server/wm/RecentTasksTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/RecentTasksTest.java
@@ -1143,6 +1143,48 @@
assertNull(lastSnapshotData.bufferSize);
}
+ @Test
+ public void testCreateRecentTaskInfo_detachedTask() {
+ final Task task = createTaskBuilder(".Task").setCreateActivity(true).build();
+ final TaskDisplayArea tda = task.getDisplayArea();
+
+ assertTrue(task.isAttached());
+ assertTrue(task.supportsMultiWindow());
+
+ RecentTaskInfo info = mRecentTasks.createRecentTaskInfo(task, true);
+
+ assertTrue(info.supportsMultiWindow);
+ assertTrue(info.supportsSplitScreenMultiWindow);
+
+ // The task can be put in split screen even if it is not attached now.
+ task.removeImmediately();
+
+ info = mRecentTasks.createRecentTaskInfo(task, true);
+
+ assertTrue(info.supportsMultiWindow);
+ assertTrue(info.supportsSplitScreenMultiWindow);
+
+ // Test non-resizable.
+ // The non-resizable task cannot be put in split screen because of the config.
+ doReturn(false).when(tda).supportsNonResizableMultiWindow();
+ doReturn(false).when(task).isResizeable();
+
+ info = mRecentTasks.createRecentTaskInfo(task, true);
+
+ assertFalse(info.supportsMultiWindow);
+ assertFalse(info.supportsSplitScreenMultiWindow);
+
+ // Even if it is not attached, the non-resizable task can be put in split screen as long as
+ // the device supports it.
+ doReturn(true).when(tda).supportsNonResizableMultiWindow();
+
+ info = mRecentTasks.createRecentTaskInfo(task, true);
+
+ assertTrue(info.supportsMultiWindow);
+ assertTrue(info.supportsSplitScreenMultiWindow);
+
+ }
+
private TaskSnapshot createSnapshot(Point taskSize, Point bufferSize) {
HardwareBuffer buffer = null;
if (bufferSize != null) {
diff --git a/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java b/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java
index 7614579..9267285 100644
--- a/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java
@@ -560,7 +560,7 @@
// Verify the target task should resume its activity.
verify(rootTask, times(1)).resumeTopActivityUncheckedLocked(
- eq(activity), eq(null /* targetOptions */));
+ eq(activity), eq(null /* targetOptions */), eq(false));
}
/**
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskTests.java b/services/tests/wmtests/src/com/android/server/wm/TaskTests.java
index 9226c0b..d93ebb3 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskTests.java
@@ -289,6 +289,9 @@
@Test
public void testResolveNonResizableTaskWindowingMode() {
+ // Test with no support non-resizable in multi window regardless the screen size.
+ mAtm.mSupportsNonResizableMultiWindow = -1;
+
final Task task = createTask(mDisplayContent);
Configuration parentConfig = task.getParent().getConfiguration();
parentConfig.windowConfiguration.setWindowingMode(WINDOWING_MODE_FREEFORM);
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java
index 8d067be..152a575 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java
@@ -20,6 +20,8 @@
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
+import static android.view.InsetsState.ITYPE_IME;
+import static android.view.InsetsState.ITYPE_NAVIGATION_BAR;
import static android.view.InsetsState.ITYPE_STATUS_BAR;
import static android.view.Surface.ROTATION_0;
import static android.view.Surface.ROTATION_270;
@@ -49,6 +51,7 @@
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify;
import static com.android.server.wm.DisplayContent.IME_TARGET_CONTROL;
+import static com.android.server.wm.DisplayContent.IME_TARGET_LAYERING;
import static com.android.server.wm.WindowContainer.SYNC_STATE_WAITING_FOR_DRAW;
import static com.google.common.truth.Truth.assertThat;
@@ -57,6 +60,7 @@
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
@@ -78,6 +82,7 @@
import android.platform.test.annotations.Presubmit;
import android.view.Gravity;
import android.view.InputWindowHandle;
+import android.view.InsetsSource;
import android.view.InsetsState;
import android.view.SurfaceControl;
import android.view.WindowManager;
@@ -880,6 +885,22 @@
verify(app).notifyInsetsChanged();
}
+ @UseTestDisplay(addWindows = { W_INPUT_METHOD, W_ACTIVITY })
+ @Test
+ public void testImeAlwaysReceivesVisibleNavigationBarInsets() {
+ final InsetsSource navSource = new InsetsSource(ITYPE_NAVIGATION_BAR);
+ mImeWindow.mAboveInsetsState.addSource(navSource);
+ mAppWindow.mAboveInsetsState.addSource(navSource);
+
+ navSource.setVisible(false);
+ assertTrue(mImeWindow.getInsetsState().getSourceOrDefaultVisibility(ITYPE_NAVIGATION_BAR));
+ assertFalse(mAppWindow.getInsetsState().getSourceOrDefaultVisibility(ITYPE_NAVIGATION_BAR));
+
+ navSource.setVisible(true);
+ assertTrue(mImeWindow.getInsetsState().getSourceOrDefaultVisibility(ITYPE_NAVIGATION_BAR));
+ assertTrue(mAppWindow.getInsetsState().getSourceOrDefaultVisibility(ITYPE_NAVIGATION_BAR));
+ }
+
@UseTestDisplay(addWindows = { W_ACTIVITY })
@Test
public void testUpdateImeControlTargetWhenLeavingMultiWindow() {
@@ -905,4 +926,34 @@
verify(app.getDisplayContent()).updateImeControlTarget();
assertEquals(mAppWindow, mDisplayContent.getImeTarget(IME_TARGET_CONTROL).getWindow());
}
+
+ @UseTestDisplay(addWindows = { W_ACTIVITY, W_INPUT_METHOD, W_NOTIFICATION_SHADE })
+ @Test
+ public void testNotificationShadeHasImeInsetsWhenSplitscreenActivated() {
+ WindowState app = createWindow(null, TYPE_BASE_APPLICATION,
+ mAppWindow.mToken, "app");
+
+ // Simulate entering multi-window mode and verify if the split-screen is activated.
+ app.mActivityRecord.getRootTask().setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
+ assertEquals(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY, app.getWindowingMode());
+ assertTrue(mDisplayContent.getDefaultTaskDisplayArea().isSplitScreenModeActivated());
+
+ // Simulate notificationShade is shown and being IME layering target.
+ mNotificationShadeWindow.setHasSurface(true);
+ mNotificationShadeWindow.mAttrs.flags &= ~FLAG_NOT_FOCUSABLE;
+ assertTrue(mNotificationShadeWindow.canBeImeTarget());
+ mDisplayContent.getInsetsStateController().getSourceProvider(ITYPE_IME).setWindow(
+ mImeWindow, null, null);
+
+ mDisplayContent.computeImeTarget(true);
+ assertEquals(mNotificationShadeWindow, mDisplayContent.getImeTarget(IME_TARGET_LAYERING));
+ mDisplayContent.getInsetsStateController().getRawInsetsState()
+ .setSourceVisible(ITYPE_IME, true);
+
+ // Verify notificationShade can still get IME insets even the split-screen is activated.
+ InsetsState state = mDisplayContent.getInsetsStateController().getInsetsForWindow(
+ mNotificationShadeWindow);
+ assertNotNull(state.peekSource(ITYPE_IME));
+ assertTrue(state.getSource(ITYPE_IME).isVisible());
+ }
}
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
index 92cfe49..f3d80b1 100644
--- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
+++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java
@@ -234,6 +234,23 @@
VoiceInteractionManagerService.this.mServiceStub.stopLocalVoiceInteraction(
callingActivity);
}
+
+ @Override
+ public boolean hasActiveSession(String packageName) {
+ VoiceInteractionManagerServiceImpl impl =
+ VoiceInteractionManagerService.this.mServiceStub.mImpl;
+ if (impl == null) {
+ return false;
+ }
+
+ VoiceInteractionSessionConnection session =
+ impl.mActiveSession;
+ if (session == null) {
+ return false;
+ }
+
+ return TextUtils.equals(packageName, session.mSessionComponentName.getPackageName());
+ }
}
// implementation entry point and binder service
diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java
index 579b33e..e332d3f 100644
--- a/telecomm/java/android/telecom/PhoneAccount.java
+++ b/telecomm/java/android/telecom/PhoneAccount.java
@@ -27,6 +27,7 @@
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
+import android.telephony.CarrierConfigManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
@@ -283,10 +284,13 @@
* number relies on presence. Should only be set if the {@code PhoneAccount} also has
* {@link #CAPABILITY_VIDEO_CALLING}.
* <p>
- * When set, the {@link ConnectionService} is responsible for toggling the
+ * Note: As of Android 12, using the
* {@link android.provider.ContactsContract.Data#CARRIER_PRESENCE_VT_CAPABLE} bit on the
* {@link android.provider.ContactsContract.Data#CARRIER_PRESENCE} column to indicate whether
- * a contact's phone number supports video calling.
+ * a contact's phone number supports video calling has been deprecated and should only be used
+ * on devices where {@link CarrierConfigManager#KEY_USE_RCS_PRESENCE_BOOL} is set. On newer
+ * devices, applications must use {@link android.telephony.ims.RcsUceAdapter} instead to
+ * determine whether or not a contact's phone number supports carrier video calling.
* <p>
* See {@link #getCapabilities}
*/
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index 1e9e0bd..c527e66 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -38,6 +38,7 @@
import android.telephony.ims.ImsReasonInfo;
import android.telephony.ims.ImsRegistrationAttributes;
import android.telephony.ims.ImsSsData;
+import android.telephony.ims.RcsUceAdapter;
import android.telephony.ims.feature.MmTelFeature;
import android.telephony.ims.feature.RcsFeature;
@@ -4259,6 +4260,9 @@
* If this flag is disabled, the capabilities cache will not be refreshed internally at all
* and will only be updated if the cached capabilities are stale when an application
* requests them.
+ *
+ * @see RcsUceAdapter#isUceSettingEnabled() more information about this feature and how
+ * it is enabled by the user.
*/
public static final String KEY_RCS_BULK_CAPABILITY_EXCHANGE_BOOL =
KEY_PREFIX + "rcs_bulk_capability_exchange_bool";
diff --git a/telephony/java/android/telephony/CellBroadcastService.java b/telephony/java/android/telephony/CellBroadcastService.java
index ac775b3..14de2f2 100644
--- a/telephony/java/android/telephony/CellBroadcastService.java
+++ b/telephony/java/android/telephony/CellBroadcastService.java
@@ -28,6 +28,11 @@
import android.os.RemoteCallback;
import android.telephony.cdma.CdmaSmsCbProgramData;
+import com.android.internal.util.FastPrintWriter;
+
+import java.io.FileDescriptor;
+import java.io.FileOutputStream;
+import java.io.PrintWriter;
import java.util.List;
import java.util.function.Consumer;
@@ -186,5 +191,16 @@
public @NonNull CharSequence getCellBroadcastAreaInfo(int slotIndex) {
return CellBroadcastService.this.getCellBroadcastAreaInfo(slotIndex);
}
+
+ @Override
+ protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) {
+ CellBroadcastService.this.dump(fd, fout, args);
+ }
+
+ @Override
+ public void dump(FileDescriptor fd, String[] args) {
+ PrintWriter pw = new FastPrintWriter(new FileOutputStream(fd));
+ CellBroadcastService.this.dump(fd, pw, args);
+ }
}
}
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 78da86c..64aa2994 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -8571,7 +8571,7 @@
* app has carrier privileges (see {@link #hasCarrierPrivileges}).
* <p>
* If {@link android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported}
- * ({@link TelephonyManager#CAPABILITY_ALLOWED_NETWORK_TYPES_USED}) returns true, then
+ * ({@link TelephonyManager#CAPABILITY_USES_ALLOWED_NETWORK_TYPES_BITMASK}) returns true, then
* setAllowedNetworkTypesBitmap is used on the radio interface. Otherwise,
* setPreferredNetworkTypesBitmap is used instead.
*
@@ -8609,7 +8609,7 @@
* app has carrier privileges (see {@link #hasCarrierPrivileges}).
* <p>
* If {@link android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported}
- * ({@link TelephonyManager#CAPABILITY_ALLOWED_NETWORK_TYPES_USED}) returns true, then
+ * ({@link TelephonyManager#CAPABILITY_USES_ALLOWED_NETWORK_TYPES_BITMASK}) returns true, then
* setAllowedNetworkTypesBitmap is used on the radio interface. Otherwise,
* setPreferredNetworkTypesBitmap is used instead.
*
@@ -8640,7 +8640,7 @@
* be set through {@link #setPreferredNetworkTypeBitmask}.
* <p>
* If {@link android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported}
- * ({@link TelephonyManager#CAPABILITY_ALLOWED_NETWORK_TYPES_USED}) returns true, then
+ * ({@link TelephonyManager#CAPABILITY_USES_ALLOWED_NETWORK_TYPES_BITMASK}) returns true, then
* setAllowedNetworkTypesBitmap is used on the radio interface. Otherwise,
* setPreferredNetworkTypesBitmap is used instead.
*
@@ -8653,7 +8653,7 @@
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
@RequiresFeature(
enforcement = "android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported",
- value = TelephonyManager.CAPABILITY_ALLOWED_NETWORK_TYPES_USED)
+ value = TelephonyManager.CAPABILITY_USES_ALLOWED_NETWORK_TYPES_BITMASK)
@SystemApi
public boolean setAllowedNetworkTypes(@NetworkTypeBitMask long allowedNetworkTypes) {
try {
@@ -8738,7 +8738,7 @@
* {@link TelephonyManager#setAllowedNetworkTypes}.
* <p>
* If {@link android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported}
- * ({@link TelephonyManager#CAPABILITY_ALLOWED_NETWORK_TYPES_USED}) returns true, then
+ * ({@link TelephonyManager#CAPABILITY_USES_ALLOWED_NETWORK_TYPES_BITMASK}) returns true, then
* setAllowedNetworkTypesBitmap is used on the radio interface. Otherwise,
* setPreferredNetworkTypesBitmap is used instead.
*
@@ -8752,7 +8752,7 @@
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
@RequiresFeature(
enforcement = "android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported",
- value = TelephonyManager.CAPABILITY_ALLOWED_NETWORK_TYPES_USED)
+ value = TelephonyManager.CAPABILITY_USES_ALLOWED_NETWORK_TYPES_BITMASK)
public void setAllowedNetworkTypesForReason(@AllowedNetworkTypesReason int reason,
@NetworkTypeBitMask long allowedNetworkTypes) {
if (!isValidAllowedNetworkTypesReason(reason)) {
@@ -8788,7 +8788,7 @@
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
@RequiresFeature(
enforcement = "android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported",
- value = TelephonyManager.CAPABILITY_ALLOWED_NETWORK_TYPES_USED)
+ value = TelephonyManager.CAPABILITY_USES_ALLOWED_NETWORK_TYPES_BITMASK)
@SystemApi
public @NetworkTypeBitMask long getAllowedNetworkTypesForReason(
@AllowedNetworkTypesReason int reason) {
@@ -14984,8 +14984,8 @@
* @hide
*/
@SystemApi
- public static final String CAPABILITY_ALLOWED_NETWORK_TYPES_USED =
- "CAPABILITY_ALLOWED_NETWORK_TYPES_USED";
+ public static final String CAPABILITY_USES_ALLOWED_NETWORK_TYPES_BITMASK =
+ "CAPABILITY_USES_ALLOWED_NETWORK_TYPES_BITMASK";
/**
* Indicates whether {@link #setNrDualConnectivityState()} and
@@ -15025,11 +15025,20 @@
"CAPABILITY_PHYSICAL_CHANNEL_CONFIG_1_6_SUPPORTED";
/**
+ * Indicates whether modem supports handling parsed SIM phonebook records through the RIL,
+ * both batched reads and individual writes.
+ *
+ * @hide
+ */
+ public static final String CAPABILITY_SIM_PHONEBOOK_IN_MODEM =
+ "CAPABILITY_SIM_PHONEBOOK_IN_MODEM";
+
+ /**
* A list of the radio interface capability values with public valid constants.
*
* Here is a related list for the systemapi-only valid constants:
* CAPABILITY_SECONDARY_LINK_BANDWIDTH_VISIBLE
- * CAPABILITY_ALLOWED_NETWORK_TYPES_USED
+ * CAPABILITY_USES_ALLOWED_NETWORK_TYPES_BITMASK
* CAPABILITY_NR_DUAL_CONNECTIVITY_CONFIGURATION_AVAILABLE
* CAPABILITY_THERMAL_MITIGATION_DATA_THROTTLING
*
@@ -15039,6 +15048,7 @@
@Retention(RetentionPolicy.SOURCE)
@StringDef(prefix = "CAPABILITY_", value = {
CAPABILITY_SLICING_CONFIG_SUPPORTED,
+ CAPABILITY_SIM_PHONEBOOK_IN_MODEM,
})
public @interface RadioInterfaceCapability {}
diff --git a/telephony/java/android/telephony/ims/ImsRcsManager.java b/telephony/java/android/telephony/ims/ImsRcsManager.java
index 814ce18..3700026 100644
--- a/telephony/java/android/telephony/ims/ImsRcsManager.java
+++ b/telephony/java/android/telephony/ims/ImsRcsManager.java
@@ -56,7 +56,9 @@
/**
* Activity Action: Show the opt-in dialog for enabling or disabling RCS contact discovery
- * using User Capability Exchange (UCE).
+ * using User Capability Exchange (UCE), which enables a service that periodically shares the
+ * phone numbers of all of the contacts in the user's address book with the carrier to refresh
+ * the RCS capabilities associated with those contacts as the local cache becomes stale.
* <p>
* An application that depends on RCS contact discovery being enabled must send this intent
* using {@link Context#startActivity(Intent)} to ask the user to opt-in for contacts upload for
diff --git a/telephony/java/android/telephony/ims/RcsUceAdapter.java b/telephony/java/android/telephony/ims/RcsUceAdapter.java
index dd91026..7a1c092 100644
--- a/telephony/java/android/telephony/ims/RcsUceAdapter.java
+++ b/telephony/java/android/telephony/ims/RcsUceAdapter.java
@@ -28,10 +28,13 @@
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceSpecificException;
+import android.telephony.CarrierConfigManager;
+import android.telephony.SubscriptionManager;
import android.telephony.TelephonyFrameworkInitializer;
import android.telephony.ims.aidl.IImsRcsController;
import android.telephony.ims.aidl.IRcsUceControllerCallback;
import android.telephony.ims.aidl.IRcsUcePublishStateCallback;
+import android.telephony.ims.feature.RcsFeature;
import android.util.Log;
import java.lang.annotation.Retention;
@@ -417,7 +420,7 @@
* <p>
* After {@link CapabilitiesCallback#onComplete} or {@link CapabilitiesCallback#onError} has
* been called, the reference to this callback will be discarded on the service side.
- * @see #requestCapabilities(Executor, List, CapabilitiesCallback)
+ * @see #requestCapabilities(Collection, Executor, CapabilitiesCallback)
* @hide
*/
@SystemApi
@@ -464,10 +467,16 @@
}
/**
- * Request the User Capability Exchange capabilities for one or more contacts.
+ * Request the RCS capabilities for one or more contacts using RCS User Capability Exchange.
* <p>
- * This will return the cached capabilities of the contact and will not perform a capability
- * poll on the network unless there are contacts being queried with stale information.
+ * This API will first check a local cache for the requested numbers and return the cached
+ * RCS capabilities of each number if the cache exists and is not stale. If the cache for a
+ * number is stale or there is no cached information about the requested number, the device will
+ * then perform a query to the carrier's network to request the RCS capabilities of the
+ * requested numbers.
+ * <p>
+ * Depending on the number of requests being sent, this API may throttled internally as the
+ * operations are queued to be executed by the carrier's network.
* <p>
* Be sure to check the availability of this feature using
* {@link ImsRcsManager#isAvailable(int, int)} and ensuring
@@ -552,13 +561,15 @@
}
/**
- * Ignore the device cache and perform a capability discovery for one contact, also called
- * "availability fetch."
+ * Request the RCS capabilities for a phone number using User Capability Exchange.
* <p>
- * This will always perform a query to the network as long as requests are over the carrier
- * availability fetch throttling threshold. If too many network requests are sent too quickly,
- * #ERROR_TOO_MANY_REQUESTS will be returned.
- *
+ * Unlike {@link #requestCapabilities(Collection, Executor, CapabilitiesCallback)}, which caches
+ * the result received from the network for a certain amount of time and uses that cached result
+ * for subsequent requests for RCS capabilities of the same phone number, this API will always
+ * request the RCS capabilities of a contact from the carrier's network.
+ * <p>
+ * Depending on the number of requests, this API may throttled internally as the operations are
+ * queued to be executed by the carrier's network.
* <p>
* Be sure to check the availability of this feature using
* {@link ImsRcsManager#isAvailable(int, int)} and ensuring
@@ -680,7 +691,8 @@
* state updates for the subscription specified in {@link ImsManager@getRcsManager(subid)}.
* <p>
* Use {@link SubscriptionManager.OnSubscriptionsChangedListener} to listen to subscription
- * changed events and call {@link #unregisterPublishStateCallback} to clean up.
+ * changed events and call
+ * {@link #removeOnPublishStateChangedListener(OnPublishStateChangedListener)} to clean up.
* <p>
* The registered {@link OnPublishStateChangedListener} will also receive a callback when it is
* registered with the current publish state.
@@ -770,13 +782,23 @@
}
/**
- * The user’s setting for whether or not User Capability Exchange (UCE) is enabled for the
- * associated subscription.
+ * The setting for whether or not the user has opted in to the automatic refresh of the RCS
+ * capabilities associated with the contacts in the user's contact address book. By default,
+ * this setting is disabled and must be enabled after the user has seen the opt-in dialog shown
+ * by {@link ImsRcsManager#ACTION_SHOW_CAPABILITY_DISCOVERY_OPT_IN}.
+ * <p>
+ * If this feature is enabled, the device will periodically share the phone numbers of all of
+ * the contacts in the user's address book with the carrier to refresh the RCS capabilities
+ * cache associated with those contacts as the local cache becomes stale.
+ * <p>
+ * This setting will only enable this feature if
+ * {@link CarrierConfigManager.Ims#KEY_RCS_BULK_CAPABILITY_EXCHANGE_BOOL} is also enabled.
* <p>
* Note: This setting does not affect whether or not the device publishes its service
* capabilities if the subscription supports presence publication.
*
- * @return true if the user’s setting for UCE is enabled, false otherwise.
+ * @return true if the user has opted in for automatic refresh of the RCS capabilities of their
+ * contacts, false otherwise.
* @throws ImsException if the subscription associated with this instance of
* {@link RcsUceAdapter} is valid, but the ImsService associated with the subscription is not
* available. This can happen if the ImsService has crashed, for example, or if the subscription
@@ -802,18 +824,33 @@
}
/**
- * Change the user’s setting for whether or not UCE is enabled for the associated subscription.
+ * Change the user’s setting for whether or not the user has opted in to the automatic
+ * refresh of the RCS capabilities associated with the contacts in the user's contact address
+ * book. By default, this setting is disabled and must be enabled using this method after the
+ * user has seen the opt-in dialog shown by
+ * {@link ImsRcsManager#ACTION_SHOW_CAPABILITY_DISCOVERY_OPT_IN}.
* <p>
- * If an application Requires UCE, they will launch an Activity using the Intent
- * {@link ImsRcsManager#ACTION_SHOW_CAPABILITY_DISCOVERY_OPT_IN}, which will ask the user if
- * they wish to enable this feature. This setting should only be enabled after the user has
- * opted-in to capability exchange.
+ * If an application wishes to request that the user enable this feature, they must launch an
+ * Activity using the Intent {@link ImsRcsManager#ACTION_SHOW_CAPABILITY_DISCOVERY_OPT_IN},
+ * which will ask the user if they wish to enable this feature. This setting must only be
+ * enabled after the user has opted-in to this feature.
+ * <p>
+ * This must not affect the
+ * {@link #requestCapabilities(Collection, Executor, CapabilitiesCallback)} or
+ * {@link #requestAvailability(Uri, Executor, CapabilitiesCallback)} API,
+ * as those APIs are still required for per-contact RCS capability queries of phone numbers
+ * required for operations such as placing a Video Telephony call or starting an RCS chat
+ * session.
+ * <p>
+ * This setting will only enable this feature if
+ * {@link CarrierConfigManager.Ims#KEY_RCS_BULK_CAPABILITY_EXCHANGE_BOOL} is also enabled.
* <p>
* Note: This setting does not affect whether or not the device publishes its service
* capabilities if the subscription supports presence publication.
*
- * @param isEnabled the user's setting for whether or not they wish for User
- * Capability Exchange to be enabled.
+ * @param isEnabled true if the user has opted in for automatic refresh of the RCS capabilities
+ * of their contacts, or false if they have chosen to opt-out. By default this
+ * setting is disabled.
* @throws ImsException if the subscription associated with this instance of
* {@link RcsUceAdapter} is valid, but the ImsService associated with the subscription is not
* available. This can happen if the ImsService has crashed, for example, or if the subscription
diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java
index 1d1eddf..fe8e671 100644
--- a/telephony/java/com/android/internal/telephony/RILConstants.java
+++ b/telephony/java/com/android/internal/telephony/RILConstants.java
@@ -497,6 +497,9 @@
int RIL_REQUEST_ENABLE_MODEM = 146;
int RIL_REQUEST_GET_MODEM_STATUS = 147;
int RIL_REQUEST_CDMA_SEND_SMS_EXPECT_MORE = 148;
+ int RIL_REQUEST_GET_SIM_PHONEBOOK_CAPACITY = 149;
+ int RIL_REQUEST_GET_SIM_PHONEBOOK_RECORDS = 150;
+ int RIL_REQUEST_UPDATE_SIM_PHONEBOOK_RECORD = 151;
/* The following requests are not defined in RIL.h */
int RIL_REQUEST_HAL_NON_RIL_BASE = 200;
@@ -583,6 +586,8 @@
int RIL_UNSOL_NETWORK_SCAN_RESULT = 1049;
int RIL_UNSOL_KEEPALIVE_STATUS = 1050;
int RIL_UNSOL_UNTHROTTLE_APN = 1052;
+ int RIL_UNSOL_RESPONSE_SIM_PHONEBOOK_CHANGED = 1053;
+ int RIL_UNSOL_RESPONSE_SIM_PHONEBOOK_RECORDS_RECEIVED = 1054;
/* The following unsols are not defined in RIL.h */
int RIL_UNSOL_HAL_NON_RIL_BASE = 1100;