Merge "Light alarm activity tracing" into oc-mr1-dev
diff --git a/Android.mk b/Android.mk
index 960f868..19bbc5f 100644
--- a/Android.mk
+++ b/Android.mk
@@ -172,6 +172,7 @@
core/java/android/content/pm/IPackageInstallerCallback.aidl \
core/java/android/content/pm/IPackageInstallerSession.aidl \
core/java/android/content/pm/IPackageManager.aidl \
+ ../native/libs/binder/aidl/android/content/pm/IPackageManagerNative.aidl \
core/java/android/content/pm/IPackageMoveObserver.aidl \
core/java/android/content/pm/IPackageStatsObserver.aidl \
core/java/android/content/pm/IPinItemRequest.aidl \
@@ -269,6 +270,8 @@
core/java/android/os/IRecoverySystemProgressListener.aidl \
core/java/android/os/IRemoteCallback.aidl \
core/java/android/os/ISchedulingPolicyService.aidl \
+ core/java/android/os/IThermalEventListener.aidl \
+ core/java/android/os/IThermalService.aidl \
core/java/android/os/IUpdateLock.aidl \
core/java/android/os/IUserManager.aidl \
core/java/android/os/IVibratorService.aidl \
diff --git a/api/current.txt b/api/current.txt
index 8d2e9c8..a083e57 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -9370,6 +9370,7 @@
field public static final java.lang.String ACTION_INPUT_METHOD_CHANGED = "android.intent.action.INPUT_METHOD_CHANGED";
field public static final java.lang.String ACTION_INSERT = "android.intent.action.INSERT";
field public static final java.lang.String ACTION_INSERT_OR_EDIT = "android.intent.action.INSERT_OR_EDIT";
+ field public static final java.lang.String ACTION_INSTALL_FAILURE = "android.intent.action.INSTALL_FAILURE";
field public static final java.lang.String ACTION_INSTALL_PACKAGE = "android.intent.action.INSTALL_PACKAGE";
field public static final java.lang.String ACTION_LOCALE_CHANGED = "android.intent.action.LOCALE_CHANGED";
field public static final java.lang.String ACTION_LOCKED_BOOT_COMPLETED = "android.intent.action.LOCKED_BOOT_COMPLETED";
@@ -9552,6 +9553,7 @@
field public static final deprecated java.lang.String EXTRA_SHORTCUT_INTENT = "android.intent.extra.shortcut.INTENT";
field public static final deprecated java.lang.String EXTRA_SHORTCUT_NAME = "android.intent.extra.shortcut.NAME";
field public static final java.lang.String EXTRA_SHUTDOWN_USERSPACE_ONLY = "android.intent.extra.SHUTDOWN_USERSPACE_ONLY";
+ field public static final java.lang.String EXTRA_SPLIT_NAME = "android.intent.extra.SPLIT_NAME";
field public static final java.lang.String EXTRA_STREAM = "android.intent.extra.STREAM";
field public static final java.lang.String EXTRA_SUBJECT = "android.intent.extra.SUBJECT";
field public static final java.lang.String EXTRA_TEMPLATE = "android.intent.extra.TEMPLATE";
@@ -10172,6 +10174,7 @@
method public int describeContents();
method public void dump(android.util.Printer, java.lang.String);
method public static java.lang.CharSequence getCategoryTitle(android.content.Context, int);
+ method public boolean isVirtualPreload();
method public java.lang.CharSequence loadDescription(android.content.pm.PackageManager);
field public static final int CATEGORY_AUDIO = 1; // 0x1
field public static final int CATEGORY_GAME = 0; // 0x0
@@ -10506,6 +10509,7 @@
method public java.io.OutputStream openWrite(java.lang.String, long, long) throws java.io.IOException;
method public void removeSplit(java.lang.String) throws java.io.IOException;
method public void setStagingProgress(float);
+ method public void transfer(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
}
public static abstract class PackageInstaller.SessionCallback {
@@ -10523,10 +10527,16 @@
method public android.graphics.Bitmap getAppIcon();
method public java.lang.CharSequence getAppLabel();
method public java.lang.String getAppPackageName();
+ method public int getInstallLocation();
method public int getInstallReason();
method public java.lang.String getInstallerPackageName();
+ method public int getMode();
+ method public int getOriginatingUid();
+ method public android.net.Uri getOriginatingUri();
method public float getProgress();
+ method public android.net.Uri getReferrerUri();
method public int getSessionId();
+ method public long getSize();
method public boolean isActive();
method public boolean isSealed();
method public void writeToParcel(android.os.Parcel, int);
@@ -11902,7 +11912,7 @@
method public boolean needUpgrade(int);
method protected void onAllReferencesReleased();
method public static android.database.sqlite.SQLiteDatabase openDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory, int);
- method public static android.database.sqlite.SQLiteDatabase openDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.OpenParams);
+ method public static android.database.sqlite.SQLiteDatabase openDatabase(java.io.File, android.database.sqlite.SQLiteDatabase.OpenParams);
method public static android.database.sqlite.SQLiteDatabase openDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory, int, android.database.DatabaseErrorHandler);
method public static android.database.sqlite.SQLiteDatabase openOrCreateDatabase(java.io.File, android.database.sqlite.SQLiteDatabase.CursorFactory);
method public static android.database.sqlite.SQLiteDatabase openOrCreateDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory);
@@ -37082,6 +37092,13 @@
field public static final android.os.Parcelable.Creator<android.service.autofill.LuhnChecksumValidator> CREATOR;
}
+ public final class RegexValidator implements android.os.Parcelable android.service.autofill.Validator {
+ ctor public RegexValidator(android.view.autofill.AutofillId, java.util.regex.Pattern);
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.service.autofill.RegexValidator> CREATOR;
+ }
+
public final class SaveCallback {
method public void onFailure(java.lang.CharSequence);
method public void onSuccess();
@@ -37122,13 +37139,6 @@
field public static final android.os.Parcelable.Creator<android.service.autofill.SaveRequest> CREATOR;
}
- public final class SimpleRegexValidator implements android.os.Parcelable android.service.autofill.Validator {
- ctor public SimpleRegexValidator(android.view.autofill.AutofillId, java.util.regex.Pattern);
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.service.autofill.SimpleRegexValidator> CREATOR;
- }
-
public abstract interface Transformation {
}
diff --git a/api/system-current.txt b/api/system-current.txt
index e2754fd..73b4ab0 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -9908,6 +9908,7 @@
field public static final java.lang.String ACTION_INSERT = "android.intent.action.INSERT";
field public static final java.lang.String ACTION_INSERT_OR_EDIT = "android.intent.action.INSERT_OR_EDIT";
field public static final deprecated java.lang.String ACTION_INSTALL_EPHEMERAL_PACKAGE = "android.intent.action.INSTALL_EPHEMERAL_PACKAGE";
+ field public static final java.lang.String ACTION_INSTALL_FAILURE = "android.intent.action.INSTALL_FAILURE";
field public static final java.lang.String ACTION_INSTALL_INSTANT_APP_PACKAGE = "android.intent.action.INSTALL_INSTANT_APP_PACKAGE";
field public static final java.lang.String ACTION_INSTALL_PACKAGE = "android.intent.action.INSTALL_PACKAGE";
field public static final java.lang.String ACTION_INSTANT_APP_RESOLVER_SETTINGS = "android.intent.action.INSTANT_APP_RESOLVER_SETTINGS";
@@ -10760,6 +10761,7 @@
method public int describeContents();
method public void dump(android.util.Printer, java.lang.String);
method public static java.lang.CharSequence getCategoryTitle(android.content.Context, int);
+ method public boolean isVirtualPreload();
method public java.lang.CharSequence loadDescription(android.content.pm.PackageManager);
field public static final int CATEGORY_AUDIO = 1; // 0x1
field public static final int CATEGORY_GAME = 0; // 0x0
@@ -11180,12 +11182,14 @@
method public void abandon();
method public void close();
method public void commit(android.content.IntentSender);
+ method public void commitTransferred(android.content.IntentSender);
method public void fsync(java.io.OutputStream) throws java.io.IOException;
method public java.lang.String[] getNames() throws java.io.IOException;
method public java.io.InputStream openRead(java.lang.String) throws java.io.IOException;
method public java.io.OutputStream openWrite(java.lang.String, long, long) throws java.io.IOException;
method public void removeSplit(java.lang.String) throws java.io.IOException;
method public void setStagingProgress(float);
+ method public void transfer(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
}
public static abstract class PackageInstaller.SessionCallback {
@@ -11200,13 +11204,26 @@
public static class PackageInstaller.SessionInfo implements android.os.Parcelable {
method public android.content.Intent createDetailsIntent();
method public int describeContents();
+ method public boolean getAllocateAggressive();
+ method public boolean getAllowDowngrade();
method public android.graphics.Bitmap getAppIcon();
method public java.lang.CharSequence getAppLabel();
method public java.lang.String getAppPackageName();
+ method public boolean getDontKillApp();
+ method public java.lang.String[] getGrantedRuntimePermissions();
+ method public boolean getInstallAsFullApp(boolean);
+ method public boolean getInstallAsInstantApp(boolean);
+ method public boolean getInstallAsVirtualPreload();
+ method public int getInstallLocation();
method public int getInstallReason();
method public java.lang.String getInstallerPackageName();
+ method public int getMode();
+ method public int getOriginatingUid();
+ method public android.net.Uri getOriginatingUri();
method public float getProgress();
+ method public android.net.Uri getReferrerUri();
method public int getSessionId();
+ method public long getSize();
method public boolean isActive();
method public boolean isSealed();
method public void writeToParcel(android.os.Parcel, int);
@@ -12698,7 +12715,7 @@
method public boolean needUpgrade(int);
method protected void onAllReferencesReleased();
method public static android.database.sqlite.SQLiteDatabase openDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory, int);
- method public static android.database.sqlite.SQLiteDatabase openDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.OpenParams);
+ method public static android.database.sqlite.SQLiteDatabase openDatabase(java.io.File, android.database.sqlite.SQLiteDatabase.OpenParams);
method public static android.database.sqlite.SQLiteDatabase openDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory, int, android.database.DatabaseErrorHandler);
method public static android.database.sqlite.SQLiteDatabase openOrCreateDatabase(java.io.File, android.database.sqlite.SQLiteDatabase.CursorFactory);
method public static android.database.sqlite.SQLiteDatabase openOrCreateDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory);
@@ -17249,10 +17266,8 @@
field public static final int IDENTIFIER_TYPE_RDS_PI = 2; // 0x2
field public static final int IDENTIFIER_TYPE_SXM_CHANNEL = 13; // 0xd
field public static final int IDENTIFIER_TYPE_SXM_SERVICE_ID = 12; // 0xc
- field public static final int IDENTIFIER_TYPE_VENDOR1_PRIMARY = 14; // 0xe
- field public static final int IDENTIFIER_TYPE_VENDOR2_PRIMARY = 15; // 0xf
- field public static final int IDENTIFIER_TYPE_VENDOR3_PRIMARY = 16; // 0x10
- field public static final int IDENTIFIER_TYPE_VENDOR4_PRIMARY = 17; // 0x11
+ field public static final int IDENTIFIER_TYPE_VENDOR_PRIMARY_END = 1999; // 0x7cf
+ field public static final int IDENTIFIER_TYPE_VENDOR_PRIMARY_START = 1000; // 0x3e8
field public static final int PROGRAM_TYPE_AM = 1; // 0x1
field public static final int PROGRAM_TYPE_AM_HD = 3; // 0x3
field public static final int PROGRAM_TYPE_DAB = 5; // 0x5
@@ -17260,10 +17275,8 @@
field public static final int PROGRAM_TYPE_FM = 2; // 0x2
field public static final int PROGRAM_TYPE_FM_HD = 4; // 0x4
field public static final int PROGRAM_TYPE_SXM = 7; // 0x7
- field public static final int PROGRAM_TYPE_VENDOR1 = 8; // 0x8
- field public static final int PROGRAM_TYPE_VENDOR2 = 9; // 0x9
- field public static final int PROGRAM_TYPE_VENDOR3 = 10; // 0xa
- field public static final int PROGRAM_TYPE_VENDOR4 = 11; // 0xb
+ field public static final int PROGRAM_TYPE_VENDOR_END = 1999; // 0x7cf
+ field public static final int PROGRAM_TYPE_VENDOR_START = 1000; // 0x3e8
}
public static final class ProgramSelector.Identifier implements android.os.Parcelable {
@@ -40272,6 +40285,13 @@
field public static final android.os.Parcelable.Creator<android.service.autofill.LuhnChecksumValidator> CREATOR;
}
+ public final class RegexValidator implements android.os.Parcelable android.service.autofill.Validator {
+ ctor public RegexValidator(android.view.autofill.AutofillId, java.util.regex.Pattern);
+ method public int describeContents();
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.service.autofill.RegexValidator> CREATOR;
+ }
+
public final class SaveCallback {
method public void onFailure(java.lang.CharSequence);
method public void onSuccess();
@@ -40312,13 +40332,6 @@
field public static final android.os.Parcelable.Creator<android.service.autofill.SaveRequest> CREATOR;
}
- public final class SimpleRegexValidator implements android.os.Parcelable android.service.autofill.Validator {
- ctor public SimpleRegexValidator(android.view.autofill.AutofillId, java.util.regex.Pattern);
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.service.autofill.SimpleRegexValidator> CREATOR;
- }
-
public abstract interface Transformation {
}
diff --git a/api/test-current.txt b/api/test-current.txt
index fcb404e..b57b82d 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -9405,6 +9405,7 @@
field public static final java.lang.String ACTION_INPUT_METHOD_CHANGED = "android.intent.action.INPUT_METHOD_CHANGED";
field public static final java.lang.String ACTION_INSERT = "android.intent.action.INSERT";
field public static final java.lang.String ACTION_INSERT_OR_EDIT = "android.intent.action.INSERT_OR_EDIT";
+ field public static final java.lang.String ACTION_INSTALL_FAILURE = "android.intent.action.INSTALL_FAILURE";
field public static final java.lang.String ACTION_INSTALL_PACKAGE = "android.intent.action.INSTALL_PACKAGE";
field public static final java.lang.String ACTION_LOCALE_CHANGED = "android.intent.action.LOCALE_CHANGED";
field public static final java.lang.String ACTION_LOCKED_BOOT_COMPLETED = "android.intent.action.LOCKED_BOOT_COMPLETED";
@@ -9587,6 +9588,7 @@
field public static final deprecated java.lang.String EXTRA_SHORTCUT_INTENT = "android.intent.extra.shortcut.INTENT";
field public static final deprecated java.lang.String EXTRA_SHORTCUT_NAME = "android.intent.extra.shortcut.NAME";
field public static final java.lang.String EXTRA_SHUTDOWN_USERSPACE_ONLY = "android.intent.extra.SHUTDOWN_USERSPACE_ONLY";
+ field public static final java.lang.String EXTRA_SPLIT_NAME = "android.intent.extra.SPLIT_NAME";
field public static final java.lang.String EXTRA_STREAM = "android.intent.extra.STREAM";
field public static final java.lang.String EXTRA_SUBJECT = "android.intent.extra.SUBJECT";
field public static final java.lang.String EXTRA_TEMPLATE = "android.intent.extra.TEMPLATE";
@@ -10209,6 +10211,7 @@
method public static java.lang.CharSequence getCategoryTitle(android.content.Context, int);
method public boolean isPrivilegedApp();
method public boolean isSystemApp();
+ method public boolean isVirtualPreload();
method public java.lang.CharSequence loadDescription(android.content.pm.PackageManager);
field public static final int CATEGORY_AUDIO = 1; // 0x1
field public static final int CATEGORY_GAME = 0; // 0x0
@@ -10544,6 +10547,7 @@
method public java.io.OutputStream openWrite(java.lang.String, long, long) throws java.io.IOException;
method public void removeSplit(java.lang.String) throws java.io.IOException;
method public void setStagingProgress(float);
+ method public void transfer(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
}
public static abstract class PackageInstaller.SessionCallback {
@@ -10561,10 +10565,16 @@
method public android.graphics.Bitmap getAppIcon();
method public java.lang.CharSequence getAppLabel();
method public java.lang.String getAppPackageName();
+ method public int getInstallLocation();
method public int getInstallReason();
method public java.lang.String getInstallerPackageName();
+ method public int getMode();
+ method public int getOriginatingUid();
+ method public android.net.Uri getOriginatingUri();
method public float getProgress();
+ method public android.net.Uri getReferrerUri();
method public int getSessionId();
+ method public long getSize();
method public boolean isActive();
method public boolean isSealed();
method public void writeToParcel(android.os.Parcel, int);
@@ -11946,7 +11956,7 @@
method public boolean needUpgrade(int);
method protected void onAllReferencesReleased();
method public static android.database.sqlite.SQLiteDatabase openDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory, int);
- method public static android.database.sqlite.SQLiteDatabase openDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.OpenParams);
+ method public static android.database.sqlite.SQLiteDatabase openDatabase(java.io.File, android.database.sqlite.SQLiteDatabase.OpenParams);
method public static android.database.sqlite.SQLiteDatabase openDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory, int, android.database.DatabaseErrorHandler);
method public static android.database.sqlite.SQLiteDatabase openOrCreateDatabase(java.io.File, android.database.sqlite.SQLiteDatabase.CursorFactory);
method public static android.database.sqlite.SQLiteDatabase openOrCreateDatabase(java.lang.String, android.database.sqlite.SQLiteDatabase.CursorFactory);
@@ -37274,6 +37284,14 @@
field public static final android.os.Parcelable.Creator<android.service.autofill.LuhnChecksumValidator> CREATOR;
}
+ public final class RegexValidator implements android.os.Parcelable android.service.autofill.Validator {
+ ctor public RegexValidator(android.view.autofill.AutofillId, java.util.regex.Pattern);
+ method public int describeContents();
+ method public boolean isValid(android.service.autofill.ValueFinder);
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.service.autofill.RegexValidator> CREATOR;
+ }
+
public final class SaveCallback {
method public void onFailure(java.lang.CharSequence);
method public void onSuccess();
@@ -37314,14 +37332,6 @@
field public static final android.os.Parcelable.Creator<android.service.autofill.SaveRequest> CREATOR;
}
- public final class SimpleRegexValidator implements android.os.Parcelable android.service.autofill.Validator {
- ctor public SimpleRegexValidator(android.view.autofill.AutofillId, java.util.regex.Pattern);
- method public int describeContents();
- method public boolean isValid(android.service.autofill.ValueFinder);
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.service.autofill.SimpleRegexValidator> CREATOR;
- }
-
public abstract interface Transformation {
}
diff --git a/cmds/svc/src/com/android/commands/svc/WifiCommand.java b/cmds/svc/src/com/android/commands/svc/WifiCommand.java
index 633dd97..e31cb53 100644
--- a/cmds/svc/src/com/android/commands/svc/WifiCommand.java
+++ b/cmds/svc/src/com/android/commands/svc/WifiCommand.java
@@ -51,6 +51,10 @@
if (validCommand) {
IWifiManager wifiMgr
= IWifiManager.Stub.asInterface(ServiceManager.getService(Context.WIFI_SERVICE));
+ if (wifiMgr == null) {
+ System.err.println("Wi-Fi service is not ready");
+ return;
+ }
try {
wifiMgr.setWifiEnabled("com.android.shell", flag);
}
diff --git a/core/java/android/app/DexLoadReporter.java b/core/java/android/app/DexLoadReporter.java
index 371cd12..f99d1a8 100644
--- a/core/java/android/app/DexLoadReporter.java
+++ b/core/java/android/app/DexLoadReporter.java
@@ -19,6 +19,7 @@
import android.os.FileUtils;
import android.os.RemoteException;
import android.os.SystemProperties;
+import android.system.ErrnoException;
import android.util.Slog;
import com.android.internal.annotations.GuardedBy;
@@ -26,6 +27,8 @@
import dalvik.system.BaseDexClassLoader;
import dalvik.system.VMRuntime;
+import libcore.io.Libcore;
+
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
@@ -151,22 +154,50 @@
// The dex path is not a secondary dex file. Nothing to do.
return;
}
- File secondaryProfile = getSecondaryProfileFile(dexPath);
+
+ File realDexPath;
try {
- // Create the profile if not already there.
- // Returns true if the file was created, false if the file already exists.
- // or throws exceptions in case of errors.
+ // Secondary dex profiles are stored in the oat directory, next to the real dex file
+ // and have the same name with 'cur.prof' appended. We use the realpath because that
+ // is what installd is using when processing the dex file.
+ // NOTE: Keep in sync with installd.
+ realDexPath = new File(Libcore.os.realpath(dexPath));
+ } catch (ErrnoException ex) {
+ Slog.e(TAG, "Failed to get the real path of secondary dex " + dexPath
+ + ":" + ex.getMessage());
+ // Do not continue with registration if we could not retrieve the real path.
+ return;
+ }
+
+ // NOTE: Keep this in sync with installd expectations.
+ File secondaryProfileDir = new File(realDexPath.getParent(), "oat");
+ File secondaryProfile = new File(secondaryProfileDir, realDexPath.getName() + ".cur.prof");
+
+ // Create the profile if not already there.
+ // Returns true if the file was created, false if the file already exists.
+ // or throws exceptions in case of errors.
+ if (!secondaryProfileDir.exists()) {
+ if (!secondaryProfileDir.mkdir()) {
+ Slog.e(TAG, "Could not create the profile directory: " + secondaryProfile);
+ // Do not continue with registration if we could not create the oat dir.
+ return;
+ }
+ }
+
+ try {
boolean created = secondaryProfile.createNewFile();
if (DEBUG && created) {
Slog.i(TAG, "Created profile for secondary dex: " + secondaryProfile);
}
} catch (IOException ex) {
- Slog.e(TAG, "Failed to create profile for secondary dex " + secondaryProfile +
- ":" + ex.getMessage());
- // Don't move forward with the registration if we failed to create the profile.
+ Slog.e(TAG, "Failed to create profile for secondary dex " + dexPath
+ + ":" + ex.getMessage());
+ // Do not continue with registration if we could not create the profile files.
return;
}
+ // If we got here, the dex paths is a secondary dex and we were able to create the profile.
+ // Register the path to the runtime.
VMRuntime.registerAppInfo(secondaryProfile.getPath(), new String[] { dexPath });
}
@@ -180,11 +211,4 @@
}
return false;
}
-
- // Secondary dex profiles are stored next to the dex file and have the same
- // name with '.prof' appended.
- // NOTE: Keep in sync with installd.
- private File getSecondaryProfileFile(String dexPath) {
- return new File(dexPath + ".prof");
- }
}
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index daeb987..9623da3 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -1535,6 +1535,22 @@
public static final String ACTION_INSTALL_PACKAGE = "android.intent.action.INSTALL_PACKAGE";
/**
+ * Activity Action: Activity to handle split installation failures.
+ * <p>Splits may be installed dynamically. This happens when an Activity is launched,
+ * but the split that contains the application isn't installed. When a split is
+ * installed in this manner, the containing package usually doesn't know this is
+ * happening. However, if an error occurs during installation, the containing
+ * package can define a single activity handling this action to deal with such
+ * failures.
+ * <p>The activity handling this action must be in the base package.
+ * <p>
+ * Input: {@link #EXTRA_INTENT} the original intent that started split installation.
+ * {@link #EXTRA_SPLIT_NAME} the name of the split that failed to be installed.
+ */
+ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
+ public static final String ACTION_INSTALL_FAILURE = "android.intent.action.INSTALL_FAILURE";
+
+ /**
* @hide
* @deprecated Do not use. This will go away.
* Replace with {@link #ACTION_INSTALL_INSTANT_APP_PACKAGE}.
@@ -1823,9 +1839,7 @@
* <p>
* Type: String
* </p>
- * @hide
*/
- @SystemApi
public static final String EXTRA_SPLIT_NAME = "android.intent.extra.SPLIT_NAME";
/**
diff --git a/core/java/android/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index 0bfe567..72075a5 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -572,7 +572,7 @@
public static final int PRIVATE_FLAG_STATIC_SHARED_LIBRARY = 1 << 14;
/**
- * Value for {@linl #privateFlags}: When set, the application will only have its splits loaded
+ * Value for {@link #privateFlags}: When set, the application will only have its splits loaded
* if they are required to load a component. Splits can be loaded on demand using the
* {@link Context#createContextForSplit(String)} API.
* @hide
@@ -580,10 +580,40 @@
public static final int PRIVATE_FLAG_ISOLATED_SPLIT_LOADING = 1 << 15;
/**
- * Private/hidden flags. See {@code PRIVATE_FLAG_...} constants.
- * {@hide}
+ * Value for {@link #privateFlags}: When set, the application was installed as
+ * a virtual preload.
+ * @hide
*/
- public int privateFlags;
+ public static final int PRIVATE_FLAG_VIRTUAL_PRELOAD = 1 << 16;
+
+ /** @hide */
+ @IntDef(flag = true, prefix = { "PRIVATE_FLAG_" }, value = {
+ PRIVATE_FLAG_HIDDEN,
+ PRIVATE_FLAG_CANT_SAVE_STATE,
+ PRIVATE_FLAG_FORWARD_LOCK,
+ PRIVATE_FLAG_PRIVILEGED,
+ PRIVATE_FLAG_HAS_DOMAIN_URLS,
+ PRIVATE_FLAG_DEFAULT_TO_DEVICE_PROTECTED_STORAGE,
+ PRIVATE_FLAG_DIRECT_BOOT_AWARE,
+ PRIVATE_FLAG_INSTANT,
+ PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE,
+ PRIVATE_FLAG_REQUIRED_FOR_SYSTEM_USER,
+ PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE,
+ PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_UNRESIZEABLE,
+ PRIVATE_FLAG_ACTIVITIES_RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION,
+ PRIVATE_FLAG_BACKUP_IN_FOREGROUND,
+ PRIVATE_FLAG_STATIC_SHARED_LIBRARY,
+ PRIVATE_FLAG_ISOLATED_SPLIT_LOADING,
+ PRIVATE_FLAG_VIRTUAL_PRELOAD,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface ApplicationInfoPrivateFlags {}
+
+ /**
+ * Private/hidden flags. See {@code PRIVATE_FLAG_...} constants.
+ * @hide
+ */
+ public @ApplicationInfoPrivateFlags int privateFlags;
/**
* @hide
@@ -1509,6 +1539,13 @@
}
/**
+ * Returns whether or not this application was installed as a virtual preload.
+ */
+ public boolean isVirtualPreload() {
+ return (privateFlags & PRIVATE_FLAG_VIRTUAL_PRELOAD) != 0;
+ }
+
+ /**
* @hide
*/
@Override protected ApplicationInfo getApplicationInfo() {
diff --git a/core/java/android/content/pm/AuxiliaryResolveInfo.java b/core/java/android/content/pm/AuxiliaryResolveInfo.java
index 323733c..067363d 100644
--- a/core/java/android/content/pm/AuxiliaryResolveInfo.java
+++ b/core/java/android/content/pm/AuxiliaryResolveInfo.java
@@ -18,6 +18,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.content.ComponentName;
import android.content.Intent;
import android.content.IntentFilter;
@@ -35,6 +36,8 @@
public final InstantAppResolveInfo resolveInfo;
/** The resolved package. Copied from {@link #resolveInfo}. */
public final String packageName;
+ /** The activity to launch if there's an installation failure. */
+ public final ComponentName installFailureActivity;
/** The resolve split. Copied from the matched filter in {@link #resolveInfo}. */
public final String splitName;
/** Whether or not instant resolution needs the second phase */
@@ -61,15 +64,18 @@
this.needsPhaseTwo = needsPhase2;
this.versionCode = resolveInfo.getVersionCode();
this.failureIntent = failureIntent;
+ this.installFailureActivity = null;
}
/** Create a response for installing a split on demand. */
public AuxiliaryResolveInfo(@NonNull String packageName,
@Nullable String splitName,
+ @Nullable ComponentName failureActivity,
int versionCode,
@Nullable Intent failureIntent) {
super();
this.packageName = packageName;
+ this.installFailureActivity = failureActivity;
this.splitName = splitName;
this.versionCode = versionCode;
this.resolveInfo = null;
diff --git a/core/java/android/content/pm/IPackageInstallerSession.aidl b/core/java/android/content/pm/IPackageInstallerSession.aidl
index 2a3fac3..0b16852 100644
--- a/core/java/android/content/pm/IPackageInstallerSession.aidl
+++ b/core/java/android/content/pm/IPackageInstallerSession.aidl
@@ -32,6 +32,7 @@
void removeSplit(String splitName);
void close();
- void commit(in IntentSender statusReceiver);
+ void commit(in IntentSender statusReceiver, boolean forTransferred);
+ void transfer(in String packageName);
void abandon();
}
diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl
index 1921b2a..0e70645 100644
--- a/core/java/android/content/pm/IPackageManager.aidl
+++ b/core/java/android/content/pm/IPackageManager.aidl
@@ -61,12 +61,6 @@
* {@hide}
*/
interface IPackageManager {
- // Since these transactions are also called from native code, these must be kept in sync with
- // the ones in frameworks/native/include/binder/IPackageManager.h
- // =============== Beginning of transactions used on native side as well ======================
- String[] getNamesForUids(in int[] uids);
- // =============== End of transactions used on native side as well ============================
-
void checkPackageStartable(String packageName, int userId);
boolean isPackageAvailable(String packageName, int userId);
PackageInfo getPackageInfo(String packageName, int flags, int userId);
@@ -134,6 +128,7 @@
String[] getPackagesForUid(int uid);
String getNameForUid(int uid);
+ String[] getNamesForUids(in int[] uids);
int getUidForSharedUser(String sharedUserName);
diff --git a/core/java/android/content/pm/PackageInstaller.java b/core/java/android/content/pm/PackageInstaller.java
index c3ebf55..f4fdcaa 100644
--- a/core/java/android/content/pm/PackageInstaller.java
+++ b/core/java/android/content/pm/PackageInstaller.java
@@ -38,6 +38,7 @@
import android.os.Parcel;
import android.os.ParcelFileDescriptor;
import android.os.Parcelable;
+import android.os.ParcelableException;
import android.os.RemoteException;
import android.os.SystemProperties;
import android.system.ErrnoException;
@@ -793,7 +794,7 @@
* @throws IOException if trouble opening the file for writing, such as
* lack of disk space or unavailable media.
* @throws SecurityException if called after the session has been
- * committed or abandoned.
+ * sealed or abandoned
*/
public @NonNull OutputStream openWrite(@NonNull String name, long offsetBytes,
long lengthBytes) throws IOException {
@@ -918,7 +919,68 @@
*/
public void commit(@NonNull IntentSender statusReceiver) {
try {
- mSession.commit(statusReceiver);
+ mSession.commit(statusReceiver, false);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Attempt to commit a session that has been {@link #transfer(String) transferred}.
+ *
+ * <p>If the device reboots before the session has been finalized, you may commit the
+ * session again.
+ *
+ * <p>The caller of this method is responsible to ensure the safety of the session. As the
+ * session was created by another - usually less trusted - app, it is paramount that before
+ * committing <u>all</u> public and system {@link SessionInfo properties of the session}
+ * and <u>all</u> {@link #openRead(String) APKs} are verified by the caller. It might happen
+ * that new properties are added to the session with a new API revision. In this case the
+ * callers need to be updated.
+ *
+ * @param statusReceiver Callbacks called when the state of the session changes.
+ *
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES)
+ public void commitTransferred(@NonNull IntentSender statusReceiver) {
+ try {
+ mSession.commit(statusReceiver, true);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Transfer the session to a new owner.
+ * <p>
+ * Only sessions that update the installing app can be transferred.
+ * <p>
+ * After the transfer to a package with a different uid all method calls on the session
+ * will cause {@link SecurityException}s.
+ * <p>
+ * Once this method is called, the session is sealed and no additional mutations beside
+ * committing it may be performed on the session.
+ *
+ * @param packageName The package of the new owner. Needs to hold the INSTALL_PACKAGES
+ * permission.
+ *
+ * @throws PackageManager.NameNotFoundException if the new owner could not be found.
+ * @throws SecurityException if called after the session has been committed or abandoned.
+ * @throws SecurityException if the session does not update the original installer
+ * @throws SecurityException if streams opened through
+ * {@link #openWrite(String, long, long) are still open.
+ */
+ public void transfer(@NonNull String packageName)
+ throws PackageManager.NameNotFoundException {
+ Preconditions.checkNotNull(packageName);
+
+ try {
+ mSession.transfer(packageName);
+ } catch (ParcelableException e) {
+ e.maybeRethrow(PackageManager.NameNotFoundException.class);
+ throw new RuntimeException(e);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -1041,6 +1103,26 @@
}
/**
+ * Check if there are hidden options set.
+ *
+ * <p>Hidden options are those options that cannot be verified via public or system-api
+ * methods on {@link SessionInfo}.
+ *
+ * @return {@code true} if any hidden option is set.
+ *
+ * @hide
+ */
+ public boolean areHiddenOptionsSet() {
+ return (installFlags & (PackageManager.INSTALL_ALLOW_DOWNGRADE
+ | PackageManager.INSTALL_DONT_KILL_APP
+ | PackageManager.INSTALL_INSTANT_APP
+ | PackageManager.INSTALL_FULL_APP
+ | PackageManager.INSTALL_VIRTUAL_PRELOAD
+ | PackageManager.INSTALL_ALLOCATE_AGGRESSIVE)) != installFlags
+ || abiOverride != null || volumeUuid != null;
+ }
+
+ /**
* Provide value of {@link PackageInfo#installLocation}, which may be used
* to determine where the app will be staged. Defaults to
* {@link PackageInfo#INSTALL_LOCATION_INTERNAL_ONLY}.
@@ -1300,6 +1382,19 @@
public CharSequence appLabel;
/** {@hide} */
+ public int installLocation;
+ /** {@hide} */
+ public Uri originatingUri;
+ /** {@hide} */
+ public int originatingUid;
+ /** {@hide} */
+ public Uri referrerUri;
+ /** {@hide} */
+ public String[] grantedRuntimePermissions;
+ /** {@hide} */
+ public int installFlags;
+
+ /** {@hide} */
public SessionInfo() {
}
@@ -1318,6 +1413,13 @@
appPackageName = source.readString();
appIcon = source.readParcelable(null);
appLabel = source.readString();
+
+ installLocation = source.readInt();
+ originatingUri = source.readParcelable(null);
+ originatingUid = source.readInt();
+ referrerUri = source.readParcelable(null);
+ grantedRuntimePermissions = source.readStringArray();
+ installFlags = source.readInt();
}
/**
@@ -1441,6 +1543,130 @@
return intent;
}
+ /**
+ * Get the mode of the session as set in the constructor of the {@link SessionParams}.
+ *
+ * @return One of {@link SessionParams#MODE_FULL_INSTALL}
+ * or {@link SessionParams#MODE_INHERIT_EXISTING}
+ */
+ public int getMode() {
+ return mode;
+ }
+
+ /**
+ * Get the value set in {@link SessionParams#setInstallLocation(int)}.
+ */
+ public int getInstallLocation() {
+ return installLocation;
+ }
+
+ /**
+ * Get the value as set in {@link SessionParams#setSize(long)}.
+ *
+ * <p>The value is a hint and does not have to match the actual size.
+ */
+ public long getSize() {
+ return sizeBytes;
+ }
+
+ /**
+ * Get the value set in {@link SessionParams#setOriginatingUri(Uri)}.
+ */
+ public @Nullable Uri getOriginatingUri() {
+ return originatingUri;
+ }
+
+ /**
+ * Get the value set in {@link SessionParams#setOriginatingUid(int)}.
+ */
+ public int getOriginatingUid() {
+ return originatingUid;
+ }
+
+ /**
+ * Get the value set in {@link SessionParams#setReferrerUri(Uri)}
+ */
+ public @Nullable Uri getReferrerUri() {
+ return referrerUri;
+ }
+
+ /**
+ * Get the value set in {@link SessionParams#setGrantedRuntimePermissions(String[])}.
+ *
+ * @hide
+ */
+ @SystemApi
+ public @Nullable String[] getGrantedRuntimePermissions() {
+ return grantedRuntimePermissions;
+ }
+
+ /**
+ * Get the value set in {@link SessionParams#setAllowDowngrade(boolean)}.
+ *
+ * @hide
+ */
+ @SystemApi
+ public boolean getAllowDowngrade() {
+ return (installFlags & PackageManager.INSTALL_ALLOW_DOWNGRADE) != 0;
+ }
+
+ /**
+ * Get the value set in {@link SessionParams#setDontKillApp(boolean)}.
+ *
+ * @hide
+ */
+ @SystemApi
+ public boolean getDontKillApp() {
+ return (installFlags & PackageManager.INSTALL_DONT_KILL_APP) != 0;
+ }
+
+ /**
+ * If {@link SessionParams#setInstallAsInstantApp(boolean)} was called with {@code true},
+ * return true. If it was called with {@code false} or if it was not called return false.
+ *
+ * @hide
+ *
+ * @see #getInstallAsFullApp
+ */
+ @SystemApi
+ public boolean getInstallAsInstantApp(boolean isInstantApp) {
+ return (installFlags & PackageManager.INSTALL_INSTANT_APP) != 0;
+ }
+
+ /**
+ * If {@link SessionParams#setInstallAsInstantApp(boolean)} was called with {@code false},
+ * return true. If it was called with {@code true} or if it was not called return false.
+ *
+ * @hide
+ *
+ * @see #getInstallAsInstantApp
+ */
+ @SystemApi
+ public boolean getInstallAsFullApp(boolean isInstantApp) {
+ return (installFlags & PackageManager.INSTALL_FULL_APP) != 0;
+ }
+
+ /**
+ * Get if {@link SessionParams#setInstallAsVirtualPreload()} was called.
+ *
+ * @hide
+ */
+ @SystemApi
+ public boolean getInstallAsVirtualPreload() {
+ return (installFlags & PackageManager.INSTALL_VIRTUAL_PRELOAD) != 0;
+ }
+
+ /**
+ * Get the value set in {@link SessionParams#setAllocateAggressive(boolean)}.
+ *
+ * @hide
+ */
+ @SystemApi
+ public boolean getAllocateAggressive() {
+ return (installFlags & PackageManager.INSTALL_ALLOCATE_AGGRESSIVE) != 0;
+ }
+
+
/** {@hide} */
@Deprecated
public @Nullable Intent getDetailsIntent() {
@@ -1467,6 +1693,13 @@
dest.writeString(appPackageName);
dest.writeParcelable(appIcon, flags);
dest.writeString(appLabel != null ? appLabel.toString() : null);
+
+ dest.writeInt(installLocation);
+ dest.writeParcelable(originatingUri, flags);
+ dest.writeInt(originatingUid);
+ dest.writeParcelable(referrerUri, flags);
+ dest.writeStringArray(grantedRuntimePermissions);
+ dest.writeInt(installFlags);
}
public static final Parcelable.Creator<SessionInfo>
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 4ae1aaf..b6ed95a 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -3002,7 +3002,7 @@
if (procSeq == null || procSeq.length() <= 0) {
return defProc;
}
- return buildCompoundName(pkg, procSeq, "process", outError);
+ return TextUtils.safeIntern(buildCompoundName(pkg, procSeq, "process", outError));
}
private static String buildTaskAffinityName(String pkg, String defProc,
@@ -6930,6 +6930,11 @@
} else {
ai.privateFlags &= ~ApplicationInfo.PRIVATE_FLAG_INSTANT;
}
+ if (state.virtualPreload) {
+ ai.privateFlags |= ApplicationInfo.PRIVATE_FLAG_VIRTUAL_PRELOAD;
+ } else {
+ ai.privateFlags &= ~ApplicationInfo.PRIVATE_FLAG_VIRTUAL_PRELOAD;
+ }
if (state.hidden) {
ai.privateFlags |= ApplicationInfo.PRIVATE_FLAG_HIDDEN;
} else {
diff --git a/core/java/android/content/pm/PackageUserState.java b/core/java/android/content/pm/PackageUserState.java
index 470336c..069b2d4 100644
--- a/core/java/android/content/pm/PackageUserState.java
+++ b/core/java/android/content/pm/PackageUserState.java
@@ -21,10 +21,10 @@
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER;
import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
-import static android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS;
-import static android.content.pm.PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS;
import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_AWARE;
import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_UNAWARE;
+import static android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS;
+import static android.content.pm.PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS;
import static android.content.pm.PackageManager.MATCH_SYSTEM_ONLY;
import android.util.ArraySet;
@@ -45,6 +45,7 @@
public boolean hidden; // Is the app restricted by owner / admin
public boolean suspended;
public boolean instantApp;
+ public boolean virtualPreload;
public int enabled;
public String lastDisableAppCaller;
public int domainVerificationStatus;
@@ -75,6 +76,7 @@
hidden = o.hidden;
suspended = o.suspended;
instantApp = o.instantApp;
+ virtualPreload = o.virtualPreload;
enabled = o.enabled;
lastDisableAppCaller = o.lastDisableAppCaller;
domainVerificationStatus = o.domainVerificationStatus;
@@ -194,6 +196,9 @@
if (instantApp != oldState.instantApp) {
return false;
}
+ if (virtualPreload != oldState.virtualPreload) {
+ return false;
+ }
if (enabled != oldState.enabled) {
return false;
}
diff --git a/core/java/android/database/sqlite/SQLiteDatabase.java b/core/java/android/database/sqlite/SQLiteDatabase.java
index 5b6efd4..de02ee5 100644
--- a/core/java/android/database/sqlite/SQLiteDatabase.java
+++ b/core/java/android/database/sqlite/SQLiteDatabase.java
@@ -703,12 +703,19 @@
/**
* Open the database according to the specified {@link OpenParams parameters}
*
- * @param path to database file to open and/or create
+ * @param path path to database file to open and/or create.
+ * <p><strong>Important:</strong> The file should be constructed either from an absolute path or
+ * by using {@link android.content.Context#getDatabasePath(String)}.
* @param openParams configuration parameters that are used for opening {@link SQLiteDatabase}
* @return the newly opened database
* @throws SQLiteException if the database cannot be opened
*/
- public static SQLiteDatabase openDatabase(@NonNull String path,
+ public static SQLiteDatabase openDatabase(@NonNull File path,
+ @NonNull OpenParams openParams) {
+ return openDatabase(path.getPath(), openParams);
+ }
+
+ private static SQLiteDatabase openDatabase(@NonNull String path,
@NonNull OpenParams openParams) {
Preconditions.checkArgument(openParams != null, "OpenParams cannot be null");
SQLiteDatabase db = new SQLiteDatabase(path, openParams.mOpenFlags,
@@ -873,7 +880,8 @@
*
* @param factory an optional factory class that is called to instantiate a
* cursor when query is called
- * @return a SQLiteDatabase object, or null if the database can't be created
+ * @return a SQLiteDatabase instance
+ * @throws SQLiteException if the database cannot be created
*/
@NonNull
public static SQLiteDatabase create(@Nullable CursorFactory factory) {
@@ -889,7 +897,8 @@
* <p>Sets the locale of the database to the the system's current locale.
* Call {@link #setLocale} if you would like something else.</p>
* @param openParams configuration parameters that are used for opening SQLiteDatabase
- * @return a SQLiteDatabase object, or null if the database can't be created
+ * @return a SQLiteDatabase instance
+ * @throws SQLException if the database cannot be created
*/
@NonNull
public static SQLiteDatabase createInMemory(@NonNull OpenParams openParams) {
@@ -2322,7 +2331,7 @@
}
/**
- * Returns flags to control database access mode
+ * Returns flags to control database access mode. Default value is 0.
*
* @see Builder#setOpenFlags(int)
*/
diff --git a/core/java/android/database/sqlite/SQLiteOpenHelper.java b/core/java/android/database/sqlite/SQLiteOpenHelper.java
index dfaf714..cc9e0f4 100644
--- a/core/java/android/database/sqlite/SQLiteOpenHelper.java
+++ b/core/java/android/database/sqlite/SQLiteOpenHelper.java
@@ -289,12 +289,12 @@
} else if (mName == null) {
db = SQLiteDatabase.createInMemory(mOpenParamsBuilder.build());
} else {
- final String path = mContext.getDatabasePath(mName).getPath();
+ final File filePath = mContext.getDatabasePath(mName);
SQLiteDatabase.OpenParams params = mOpenParamsBuilder.build();
try {
- db = SQLiteDatabase.openDatabase(path, params);
+ db = SQLiteDatabase.openDatabase(filePath, params);
// Keep pre-O-MR1 behavior by resetting file permissions to 660
- setFilePermissionsForDb(path);
+ setFilePermissionsForDb(filePath.getPath());
} catch (SQLException ex) {
if (writable) {
throw ex;
@@ -302,7 +302,7 @@
Log.e(TAG, "Couldn't open " + mName
+ " for writing (will try read-only):", ex);
params = params.toBuilder().addOpenFlags(SQLiteDatabase.OPEN_READONLY).build();
- db = SQLiteDatabase.openDatabase(path, params);
+ db = SQLiteDatabase.openDatabase(filePath, params);
}
}
diff --git a/core/java/android/hardware/fingerprint/FingerprintManager.java b/core/java/android/hardware/fingerprint/FingerprintManager.java
index 233c4d4..8b6f9c1 100644
--- a/core/java/android/hardware/fingerprint/FingerprintManager.java
+++ b/core/java/android/hardware/fingerprint/FingerprintManager.java
@@ -106,6 +106,7 @@
/**
* The operation was canceled because the API is locked out due to too many attempts.
+ * This occurs after 5 failed attempts, and lasts for 30 seconds.
*/
public static final int FINGERPRINT_ERROR_LOCKOUT = 7;
diff --git a/core/java/android/hardware/radio/ProgramSelector.java b/core/java/android/hardware/radio/ProgramSelector.java
index 94c25b3..2211cee 100644
--- a/core/java/android/hardware/radio/ProgramSelector.java
+++ b/core/java/android/hardware/radio/ProgramSelector.java
@@ -17,6 +17,7 @@
package android.hardware.radio;
import android.annotation.IntDef;
+import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
@@ -73,10 +74,8 @@
/** SiriusXM Satellite Radio. */
public static final int PROGRAM_TYPE_SXM = 7;
/** Vendor-specific, not synced across devices. */
- public static final int PROGRAM_TYPE_VENDOR1 = 8;
- public static final int PROGRAM_TYPE_VENDOR2 = 9;
- public static final int PROGRAM_TYPE_VENDOR3 = 10;
- public static final int PROGRAM_TYPE_VENDOR4 = 11;
+ public static final int PROGRAM_TYPE_VENDOR_START = 1000;
+ public static final int PROGRAM_TYPE_VENDOR_END = 1999;
@IntDef(prefix = { "PROGRAM_TYPE_" }, value = {
PROGRAM_TYPE_AM,
PROGRAM_TYPE_FM,
@@ -85,11 +84,8 @@
PROGRAM_TYPE_DAB,
PROGRAM_TYPE_DRMO,
PROGRAM_TYPE_SXM,
- PROGRAM_TYPE_VENDOR1,
- PROGRAM_TYPE_VENDOR2,
- PROGRAM_TYPE_VENDOR3,
- PROGRAM_TYPE_VENDOR4,
})
+ @IntRange(from = PROGRAM_TYPE_VENDOR_START, to = PROGRAM_TYPE_VENDOR_END)
@Retention(RetentionPolicy.SOURCE)
public @interface ProgramType {}
@@ -145,12 +141,12 @@
* Primary identifier for vendor-specific radio technology.
* The value format is determined by a vendor.
*
- * It must not be used in any other programType than VENDORx.
+ * It must not be used in any other programType than corresponding VENDOR
+ * type between VENDOR_START and VENDOR_END (eg. identifier type 1015 must
+ * not be used in any program type other than 1015).
*/
- public static final int IDENTIFIER_TYPE_VENDOR1_PRIMARY = 14;
- public static final int IDENTIFIER_TYPE_VENDOR2_PRIMARY = 15;
- public static final int IDENTIFIER_TYPE_VENDOR3_PRIMARY = 16;
- public static final int IDENTIFIER_TYPE_VENDOR4_PRIMARY = 17;
+ public static final int IDENTIFIER_TYPE_VENDOR_PRIMARY_START = PROGRAM_TYPE_VENDOR_START;
+ public static final int IDENTIFIER_TYPE_VENDOR_PRIMARY_END = PROGRAM_TYPE_VENDOR_END;
@IntDef(prefix = { "IDENTIFIER_TYPE_" }, value = {
IDENTIFIER_TYPE_AMFM_FREQUENCY,
IDENTIFIER_TYPE_RDS_PI,
@@ -165,11 +161,8 @@
IDENTIFIER_TYPE_DRMO_MODULATION,
IDENTIFIER_TYPE_SXM_SERVICE_ID,
IDENTIFIER_TYPE_SXM_CHANNEL,
- IDENTIFIER_TYPE_VENDOR1_PRIMARY,
- IDENTIFIER_TYPE_VENDOR2_PRIMARY,
- IDENTIFIER_TYPE_VENDOR3_PRIMARY,
- IDENTIFIER_TYPE_VENDOR4_PRIMARY,
})
+ @IntRange(from = IDENTIFIER_TYPE_VENDOR_PRIMARY_START, to = IDENTIFIER_TYPE_VENDOR_PRIMARY_END)
@Retention(RetentionPolicy.SOURCE)
public @interface IdentifierType {}
diff --git a/core/java/android/net/NetworkStats.java b/core/java/android/net/NetworkStats.java
index 77ce65b..be9e809 100644
--- a/core/java/android/net/NetworkStats.java
+++ b/core/java/android/net/NetworkStats.java
@@ -672,36 +672,33 @@
entry.tag = left.tag[i];
entry.metered = left.metered[i];
entry.roaming = left.roaming[i];
+ entry.rxBytes = left.rxBytes[i];
+ entry.rxPackets = left.rxPackets[i];
+ entry.txBytes = left.txBytes[i];
+ entry.txPackets = left.txPackets[i];
+ entry.operations = left.operations[i];
// find remote row that matches, and subtract
final int j = right.findIndexHinted(entry.iface, entry.uid, entry.set, entry.tag,
entry.metered, entry.roaming, i);
- if (j == -1) {
- // newly appearing row, return entire value
- entry.rxBytes = left.rxBytes[i];
- entry.rxPackets = left.rxPackets[i];
- entry.txBytes = left.txBytes[i];
- entry.txPackets = left.txPackets[i];
- entry.operations = left.operations[i];
- } else {
- // existing row, subtract remote value
- entry.rxBytes = left.rxBytes[i] - right.rxBytes[j];
- entry.rxPackets = left.rxPackets[i] - right.rxPackets[j];
- entry.txBytes = left.txBytes[i] - right.txBytes[j];
- entry.txPackets = left.txPackets[i] - right.txPackets[j];
- entry.operations = left.operations[i] - right.operations[j];
+ if (j != -1) {
+ // Found matching row, subtract remote value.
+ entry.rxBytes -= right.rxBytes[j];
+ entry.rxPackets -= right.rxPackets[j];
+ entry.txBytes -= right.txBytes[j];
+ entry.txPackets -= right.txPackets[j];
+ entry.operations -= right.operations[j];
+ }
- if (entry.rxBytes < 0 || entry.rxPackets < 0 || entry.txBytes < 0
- || entry.txPackets < 0 || entry.operations < 0) {
- if (observer != null) {
- observer.foundNonMonotonic(left, i, right, j, cookie);
- }
- entry.rxBytes = Math.max(entry.rxBytes, 0);
- entry.rxPackets = Math.max(entry.rxPackets, 0);
- entry.txBytes = Math.max(entry.txBytes, 0);
- entry.txPackets = Math.max(entry.txPackets, 0);
- entry.operations = Math.max(entry.operations, 0);
+ if (entry.isNegative()) {
+ if (observer != null) {
+ observer.foundNonMonotonic(left, i, right, j, cookie);
}
+ entry.rxBytes = Math.max(entry.rxBytes, 0);
+ entry.rxPackets = Math.max(entry.rxPackets, 0);
+ entry.txBytes = Math.max(entry.txBytes, 0);
+ entry.txPackets = Math.max(entry.txPackets, 0);
+ entry.operations = Math.max(entry.operations, 0);
}
result.addValues(entry);
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java
index 1d9ef2c..6d44330 100644
--- a/core/java/android/os/BatteryStats.java
+++ b/core/java/android/os/BatteryStats.java
@@ -206,8 +206,15 @@
* - CPU frequency time per uid
* New in version 22:
* - BLE scan result background count, BLE unoptimized scan time
+ * - Background partial wakelock time & count
+ * New in version 23:
+ * - Logging smeared power model values
+ * New in version 24:
+ * - Fixed bugs in background timers and BLE scan time
+ * New in version 25:
+ * - Package wakeup alarms are now on screen-off timebase
*/
- static final String CHECKIN_VERSION = "24";
+ static final String CHECKIN_VERSION = "25";
/**
* Old version, we hit 9 and ran out of room, need to remove.
@@ -686,7 +693,7 @@
public abstract long getSystemCpuTimeUs(int which);
/**
- * Returns the approximate cpu time (in milliseconds) spent at a certain CPU speed for a
+ * Returns the approximate cpu time (in microseconds) spent at a certain CPU speed for a
* given CPU cluster.
* @param cluster the index of the CPU cluster.
* @param step the index of the CPU speed. This is not the actual speed of the CPU.
diff --git a/core/java/android/os/IThermalEventListener.aidl b/core/java/android/os/IThermalEventListener.aidl
new file mode 100644
index 0000000..9a6de60
--- /dev/null
+++ b/core/java/android/os/IThermalEventListener.aidl
@@ -0,0 +1,32 @@
+/*
+** Copyright 2017, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+
+package android.os;
+
+import android.os.Temperature;
+
+/**
+ * Listener for thermal events.
+ * {@hide}
+ */
+oneway interface IThermalEventListener {
+ /**
+ * Called when a thermal throttling start/stop event is received.
+ * @param temperature the temperature at which the event was generated.
+ */
+ void notifyThrottling(
+ in boolean isThrottling, in Temperature temperature);
+}
diff --git a/core/java/android/os/IThermalService.aidl b/core/java/android/os/IThermalService.aidl
new file mode 100644
index 0000000..e388eda
--- /dev/null
+++ b/core/java/android/os/IThermalService.aidl
@@ -0,0 +1,51 @@
+/*
+** Copyright 2017, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+
+package android.os;
+
+import android.os.IThermalEventListener;
+import android.os.Temperature;
+
+/**
+ * {@hide}
+ */
+interface IThermalService {
+ /**
+ * Register a listener for thermal events.
+ * @param listener the IThermalEventListener to be notified.
+ * {@hide}
+ */
+ void registerThermalEventListener(in IThermalEventListener listener);
+ /**
+ * Unregister a previously-registered listener for thermal events.
+ * @param listener the IThermalEventListener to no longer be notified.
+ * {@hide}
+ */
+ void unregisterThermalEventListener(in IThermalEventListener listener);
+ /**
+ * Send a thermal throttling start/stop notification to all listeners.
+ * @param temperature the temperature at which the event was generated.
+ * {@hide}
+ */
+ oneway void notifyThrottling(
+ in boolean isThrottling, in Temperature temperature);
+ /**
+ * Return whether system performance is currently thermal throttling.
+ * @return true if thermal throttling is currently in effect
+ * {@hide}
+ */
+ boolean isThrottling();
+}
diff --git a/core/java/android/os/Temperature.aidl b/core/java/android/os/Temperature.aidl
new file mode 100644
index 0000000..708c08f
--- /dev/null
+++ b/core/java/android/os/Temperature.aidl
@@ -0,0 +1,19 @@
+/*
+** Copyright 2017, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+
+package android.os;
+
+parcelable Temperature;
diff --git a/core/java/android/os/Temperature.java b/core/java/android/os/Temperature.java
new file mode 100644
index 0000000..3e48493
--- /dev/null
+++ b/core/java/android/os/Temperature.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.os;
+
+/**
+ * Temperature values used by IThermalService.
+ */
+
+/**
+ * @hide
+ */
+public class Temperature implements Parcelable {
+ /* Temperature value */
+ private float mValue;
+ /* A temperature type from HardwarePropertiesManager */
+ private int mType;
+
+ public Temperature() {
+ mType = Integer.MIN_VALUE;
+ mValue = HardwarePropertiesManager.UNDEFINED_TEMPERATURE;
+ }
+
+ public Temperature(float value, int type) {
+ mValue = value;
+ mType = type;
+ }
+
+ /**
+ * Return the temperature value.
+ * @return a temperature value in floating point.
+ */
+ public float getValue() {
+ return mValue;
+ }
+
+ /**
+ * Return the temperature type.
+ * @return a temperature type:
+ * HardwarePropertiesManager.DEVICE_TEMPERATURE_CPU, etc.
+ */
+ public int getType() {
+ return mType;
+ }
+
+ /*
+ * Parcel read/write code must be kept in sync with
+ * frameworks/native/services/thermalservice/aidl/android/os/
+ * Temperature.cpp
+ */
+
+ private Temperature(Parcel p) {
+ readFromParcel(p);
+ }
+
+ /**
+ * Fill in Temperature members from a Parcel.
+ * @param p the parceled Temperature object.
+ */
+ public void readFromParcel(Parcel p) {
+ mValue = p.readFloat();
+ mType = p.readInt();
+ }
+
+ @Override
+ public void writeToParcel(Parcel p, int flags) {
+ p.writeFloat(mValue);
+ p.writeInt(mType);
+ }
+
+ public static final Parcelable.Creator<Temperature> CREATOR =
+ new Parcelable.Creator<Temperature>() {
+ @Override
+ public Temperature createFromParcel(Parcel p) {
+ return new Temperature(p);
+ }
+
+ @Override
+ public Temperature[] newArray(int size) {
+ return new Temperature[size];
+ }
+ };
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+}
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index 6ec755b..794b3ba 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -1460,7 +1460,7 @@
user = mService.createUser(name, flags);
// TODO: Keep this in sync with
// UserManagerService.LocalService.createUserEvenWhenDisallowed
- if (user != null && !user.isAdmin()) {
+ if (user != null && !user.isAdmin() && !user.isDemo()) {
mService.setUserRestriction(DISALLOW_SMS, true, user.id);
mService.setUserRestriction(DISALLOW_OUTGOING_CALLS, true, user.id);
}
diff --git a/core/java/android/service/autofill/CustomDescription.java b/core/java/android/service/autofill/CustomDescription.java
index 0edb154..3da0b5e 100644
--- a/core/java/android/service/autofill/CustomDescription.java
+++ b/core/java/android/service/autofill/CustomDescription.java
@@ -32,7 +32,7 @@
*
* <p>This is useful when the autofill service needs to show a detailed view of what would be saved;
* for example, when the screen contains a credit card, it could display a logo of the credit card
- * bank, the last for digits of the credit card number, and its expiration number.
+ * bank, the last four digits of the credit card number, and its expiration number.
*
* <p>A custom description is made of 2 parts:
* <ul>
@@ -63,16 +63,16 @@
* // Image child - different logo for each bank, based on credit card prefix
* builder.addChild(R.id.templateccLogo,
* new ImageTransformation.Builder(ccNumberId)
- * .addOption("^4815.*$", R.drawable.ic_credit_card_logo1)
- * .addOption("^1623.*$", R.drawable.ic_credit_card_logo2)
- * .addOption("^42.*$", R.drawable.ic_credit_card_logo3);
+ * .addOption(Pattern.compile(""^4815.*$"), R.drawable.ic_credit_card_logo1)
+ * .addOption(Pattern.compile(""^1623.*$"), R.drawable.ic_credit_card_logo2)
+ * .addOption(Pattern.compile(""^42.*$"), R.drawable.ic_credit_card_logo3);
* // Masked credit card number (as .....LAST_4_DIGITS)
* builder.addChild(R.id.templateCcNumber, new CharSequenceTransformation.Builder()
- * .addField(ccNumberId, "^.*(\\d\\d\\d\\d)$", "...$1")
+ * .addField(ccNumberId, Pattern.compile(""^.*(\\d\\d\\d\\d)$"), "...$1")
* // Expiration date as MM / YYYY:
* builder.addChild(R.id.templateExpDate, new CharSequenceTransformation.Builder()
- * .addField(ccExpMonthId, "^(\\d\\d)$", "Exp: $1")
- * .addField(ccExpYearId, "^(\\d\\d)$", "/$1");
+ * .addField(ccExpMonthId, Pattern.compile(""^(\\d\\d)$"), "Exp: $1")
+ * .addField(ccExpYearId, Pattern.compile(""^(\\d\\d)$"), "/$1");
* </pre>
*
* <p>See {@link ImageTransformation}, {@link CharSequenceTransformation} for more info about these
diff --git a/core/java/android/service/autofill/SimpleRegexValidator.java b/core/java/android/service/autofill/RegexValidator.java
similarity index 79%
rename from core/java/android/service/autofill/SimpleRegexValidator.java
rename to core/java/android/service/autofill/RegexValidator.java
index ef8c52c9..9dfe78d 100644
--- a/core/java/android/service/autofill/SimpleRegexValidator.java
+++ b/core/java/android/service/autofill/RegexValidator.java
@@ -34,9 +34,9 @@
*
* <p>See {@link SaveInfo.Builder#setValidator(Validator)} for examples.
*/
-public final class SimpleRegexValidator extends InternalValidator implements Validator, Parcelable {
+public final class RegexValidator extends InternalValidator implements Validator, Parcelable {
- private static final String TAG = "SimpleRegexValidator";
+ private static final String TAG = "RegexValidator";
private final AutofillId mId;
private final Pattern mRegex;
@@ -49,7 +49,7 @@
* matches the contents of the field identified by {@code id}, it returns {@code true};
* otherwise, it returns {@code false}.
*/
- public SimpleRegexValidator(@NonNull AutofillId id, @NonNull Pattern regex) {
+ public RegexValidator(@NonNull AutofillId id, @NonNull Pattern regex) {
mId = Preconditions.checkNotNull(id);
mRegex = Preconditions.checkNotNull(regex);
}
@@ -76,7 +76,7 @@
public String toString() {
if (!sDebug) return super.toString();
- return "SimpleRegexValidator: [id=" + mId + ", regex=" + mRegex + "]";
+ return "RegexValidator: [id=" + mId + ", regex=" + mRegex + "]";
}
/////////////////////////////////////
@@ -93,17 +93,17 @@
parcel.writeSerializable(mRegex);
}
- public static final Parcelable.Creator<SimpleRegexValidator> CREATOR =
- new Parcelable.Creator<SimpleRegexValidator>() {
+ public static final Parcelable.Creator<RegexValidator> CREATOR =
+ new Parcelable.Creator<RegexValidator>() {
@Override
- public SimpleRegexValidator createFromParcel(Parcel parcel) {
- return new SimpleRegexValidator(parcel.readParcelable(null),
+ public RegexValidator createFromParcel(Parcel parcel) {
+ return new RegexValidator(parcel.readParcelable(null),
(Pattern) parcel.readSerializable());
}
@Override
- public SimpleRegexValidator[] newArray(int size) {
- return new SimpleRegexValidator[size];
+ public RegexValidator[] newArray(int size) {
+ return new RegexValidator[size];
}
};
}
diff --git a/core/java/android/service/autofill/SaveInfo.java b/core/java/android/service/autofill/SaveInfo.java
index f8a94d6..e0a0730 100644
--- a/core/java/android/service/autofill/SaveInfo.java
+++ b/core/java/android/service/autofill/SaveInfo.java
@@ -470,7 +470,7 @@
* <p>Validator for a credit number that must have exactly 16 digits:
*
* <pre class="prettyprint">
- * Validator validator = new SimpleRegexValidator(ccNumberId, "^\\d{16}$")
+ * Validator validator = new RegexValidator(ccNumberId, Pattern.compile(""^\\d{16}$"))
* </pre>
*
* <p>Validator for a credit number that must pass a Luhn checksum and either have
@@ -483,8 +483,8 @@
* and(
* new LuhnChecksumValidator(ccNumberId),
* or(
- * new SimpleRegexValidator(ccNumberId, "^\\d{16}$"),
- * new SimpleRegexValidator(ccNumberId, "^108\\d{12}$")
+ * new RegexValidator(ccNumberId, Pattern.compile(""^\\d{16}$")),
+ * new RegexValidator(ccNumberId, Pattern.compile(""^108\\d{12}$"))
* )
* );
* </pre>
@@ -496,7 +496,7 @@
* Validator validator =
* and(
* new LuhnChecksumValidator(ccNumberId),
- * new SimpleRegexValidator(ccNumberId, "^(\\d{16}|108\\d{12})$")
+ * new RegexValidator(ccNumberId, Pattern.compile(""^(\\d{16}|108\\d{12})$"))
* );
* </pre>
*
@@ -508,10 +508,10 @@
*
* Validator validator =
* and(
- * new SimpleRegexValidator(ccNumberId1, "^\\d{4}$"),
- * new SimpleRegexValidator(ccNumberId2, "^\\d{4}$"),
- * new SimpleRegexValidator(ccNumberId3, "^\\d{4}$"),
- * new SimpleRegexValidator(ccNumberId4, "^\\d{4}$")
+ * new RegexValidator(ccNumberId1, Pattern.compile(""^\\d{4}$")),
+ * new RegexValidator(ccNumberId2, Pattern.compile(""^\\d{4}$")),
+ * new RegexValidator(ccNumberId3, Pattern.compile(""^\\d{4}$")),
+ * new RegexValidator(ccNumberId4, Pattern.compile(""^\\d{4}$"))
* );
* </pre>
*
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java
index 65d66dc..f548d3b 100644
--- a/core/java/android/service/wallpaper/WallpaperService.java
+++ b/core/java/android/service/wallpaper/WallpaperService.java
@@ -33,10 +33,12 @@
import android.hardware.display.DisplayManager;
import android.hardware.display.DisplayManager.DisplayListener;
import android.os.Bundle;
+import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
+import android.os.SystemClock;
import android.util.Log;
import android.util.MergedConfiguration;
import android.view.Display;
@@ -54,6 +56,7 @@
import android.view.WindowManager;
import android.view.WindowManagerGlobal;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.os.HandlerCaller;
import com.android.internal.view.BaseIWindow;
import com.android.internal.view.BaseSurfaceHolder;
@@ -61,6 +64,7 @@
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
+import java.util.function.Supplier;
/**
* A wallpaper service is responsible for showing a live wallpaper behind
@@ -106,7 +110,9 @@
private static final int MSG_WINDOW_MOVED = 10035;
private static final int MSG_TOUCH_EVENT = 10040;
private static final int MSG_REQUEST_WALLPAPER_COLORS = 10050;
-
+
+ private static final int NOTIFY_COLORS_RATE_LIMIT_MS = 1000;
+
private final ArrayList<Engine> mActiveEngines
= new ArrayList<Engine>();
@@ -186,6 +192,11 @@
boolean mPendingSync;
MotionEvent mPendingMove;
+ // Needed for throttling onComputeColors.
+ private long mLastColorInvalidation;
+ private final Runnable mNotifyColorsChanged = this::notifyColorsChanged;
+ private Supplier<Long> mClockFunction = SystemClock::elapsedRealtime;
+
DisplayManager mDisplayManager;
Display mDisplay;
private int mDisplayState;
@@ -551,18 +562,38 @@
* This will trigger a {@link #onComputeColors()} call.
*/
public void notifyColorsChanged() {
+ final long now = mClockFunction.get();
+ final Handler mainHandler = Handler.getMain();
+ if (now - mLastColorInvalidation < NOTIFY_COLORS_RATE_LIMIT_MS) {
+ Log.w(TAG, "This call has been deferred. You should only call "
+ + "notifyColorsChanged() once every "
+ + (NOTIFY_COLORS_RATE_LIMIT_MS / 1000f) + " seconds.");
+ if (!mainHandler.hasCallbacks(mNotifyColorsChanged)) {
+ mainHandler.postDelayed(mNotifyColorsChanged, NOTIFY_COLORS_RATE_LIMIT_MS);
+ }
+ return;
+ }
+ mLastColorInvalidation = now;
+ mainHandler.removeCallbacks(mNotifyColorsChanged);
+
try {
- mConnection.onWallpaperColorsChanged(onComputeColors());
+ final WallpaperColors newColors = onComputeColors();
+ if (mConnection != null) {
+ mConnection.onWallpaperColorsChanged(newColors);
+ } else {
+ Log.w(TAG, "Can't notify system because wallpaper connection "
+ + "was not established.");
+ }
} catch (RemoteException e) {
- Log.w(TAG, "Can't invalidate wallpaper colors because " +
- "wallpaper connection was lost", e);
+ Log.w(TAG, "Can't notify system because wallpaper connection was lost.", e);
}
}
/**
* Called by the system when it needs to know what colors the wallpaper is using.
- * You might return null if no color information is available at the moment. In that case
- * you might want to call {@link #notifyColorsChanged()} in a near future.
+ * You might return null if no color information is available at the moment.
+ * In that case you might want to call {@link #notifyColorsChanged()} when
+ * color information becomes available.
* <p>
* The simplest way of creating a {@link android.app.WallpaperColors} object is by using
* {@link android.app.WallpaperColors#fromBitmap(Bitmap)} or
@@ -631,6 +662,14 @@
}
}
+ /**
+ * @hide
+ */
+ @VisibleForTesting
+ public void setClockFunction(Supplier<Long> clockFunction) {
+ mClockFunction = clockFunction;
+ }
+
void updateSurface(boolean forceRelayout, boolean forceReport, boolean redrawNeeded) {
if (mDestroyed) {
Log.w(TAG, "Ignoring updateSurface: destroyed");
@@ -893,7 +932,7 @@
" w=" + mLayout.width + " h=" + mLayout.height);
}
}
-
+
void attach(IWallpaperEngineWrapper wrapper) {
if (DEBUG) Log.v(TAG, "attach: " + this + " wrapper=" + wrapper);
if (mDestroyed) {
diff --git a/core/java/android/text/TextUtils.java b/core/java/android/text/TextUtils.java
index 440c88e..3e64af4 100644
--- a/core/java/android/text/TextUtils.java
+++ b/core/java/android/text/TextUtils.java
@@ -484,6 +484,14 @@
}
/**
+ * @return interned string if it's null.
+ * @hide
+ */
+ public static String safeIntern(String s) {
+ return (s != null) ? s.intern() : null;
+ }
+
+ /**
* Returns the length that the specified CharSequence would have if
* spaces and ASCII control characters were trimmed from the start and end,
* as by {@link String#trim}.
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java
index 44c88e1..1a2968f 100644
--- a/core/java/android/view/SurfaceControl.java
+++ b/core/java/android/view/SurfaceControl.java
@@ -65,7 +65,8 @@
private static native void nativeSetSize(long nativeObject, int w, int h);
private static native void nativeSetTransparentRegionHint(long nativeObject, Region region);
private static native void nativeSetAlpha(long nativeObject, float alpha);
- private static native void nativeSetMatrix(long nativeObject, float dsdx, float dtdx, float dsdy, float dtdy);
+ private static native void nativeSetMatrix(long nativeObject, float dsdx, float dtdx,
+ float dtdy, float dsdy);
private static native void nativeSetFlags(long nativeObject, int flags, int mask);
private static native void nativeSetWindowCrop(long nativeObject, int l, int t, int r, int b);
private static native void nativeSetFinalCrop(long nativeObject, int l, int t, int r, int b);
diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java
index e2ad1e0..29e5523 100644
--- a/core/java/android/view/autofill/AutofillManager.java
+++ b/core/java/android/view/autofill/AutofillManager.java
@@ -52,9 +52,64 @@
import java.util.Objects;
/**
- * App entry point to the Autofill Framework.
+ * The {@link AutofillManager} provides ways for apps and custom views to integrate with the
+ * Autofill Framework lifecycle.
*
- * <p>It is safe to call into this from any thread.
+ * <p>The autofill lifecycle starts with the creation of an autofill context associated with an
+ * activity context; the autofill context is created when one of the following methods is called for
+ * the first time in an activity context, and the current user has an enabled autofill service:
+ *
+ * <ul>
+ * <li>{@link #notifyViewEntered(View)}
+ * <li>{@link #notifyViewEntered(View, int, Rect)}
+ * <li>{@link #requestAutofill(View)}
+ * </ul>
+ *
+ * <p>Tipically, the context is automatically created when the first view of the activity is
+ * focused because {@code View.onFocusChanged()} indirectly calls
+ * {@link #notifyViewEntered(View)}. App developers can call {@link #requestAutofill(View)} to
+ * explicitly create it (for example, a custom view developer could offer a contextual menu action
+ * in a text-field view to let users manually request autofill).
+ *
+ * <p>After the context is created, the Android System creates a {@link android.view.ViewStructure}
+ * that represents the view hierarchy by calling
+ * {@link View#dispatchProvideAutofillStructure(android.view.ViewStructure, int)} in the root views
+ * of all application windows. By default, {@code dispatchProvideAutofillStructure()} results in
+ * subsequent calls to {@link View#onProvideAutofillStructure(android.view.ViewStructure, int)} and
+ * {@link View#onProvideAutofillVirtualStructure(android.view.ViewStructure, int)} for each view in
+ * the hierarchy.
+ *
+ * <p>The resulting {@link android.view.ViewStructure} is then passed to the autofill service, which
+ * parses it looking for views that can be autofilled. If the service finds such views, it returns
+ * a data structure to the Android System containing the following optional info:
+ *
+ * <ul>
+ * <li>Datasets used to autofill subsets of views in the activity.
+ * <li>Id of views that the service can save their values for future autofilling.
+ * </ul>
+ *
+ * <p>When the service returns datasets, the Android System displays an autofill dataset picker
+ * UI affordance associated with the view, when the view is focused on and is part of a dataset.
+ * The application can be notified when the affordance is shown by registering an
+ * {@link AutofillCallback} through {@link #registerCallback(AutofillCallback)}. When the user
+ * selects a dataset from the affordance, all views present in the dataset are autofilled, through
+ * calls to {@link View#autofill(AutofillValue)} or {@link View#autofill(SparseArray)}.
+ *
+ * <p>When the service returns ids of savable views, the Android System keeps track of changes
+ * made to these views, so they can be used to determine if the autofill save UI is shown later.
+ *
+ * <p>The context is then finished when one of the following occurs:
+ *
+ * <ul>
+ * <li>{@link #commit()} is called or all savable views are gone.
+ * <li>{@link #cancel()} is called.
+ * </ul>
+ *
+ * <p>Finally, after the autofill context is commited (i.e., not cancelled), the Android System
+ * shows a save UI affordance 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>It is safe to call into its methods from any thread.
*/
@SystemService(Context.AUTOFILL_MANAGER_SERVICE)
public final class AutofillManager {
@@ -1494,10 +1549,10 @@
}
/**
- * Callback for auto-fill related events.
+ * Callback for autofill related events.
*
* <p>Typically used for applications that display their own "auto-complete" views, so they can
- * enable / disable such views when the auto-fill UI affordance is shown / hidden.
+ * enable / disable such views when the autofill UI affordance is shown / hidden.
*/
public abstract static class AutofillCallback {
@@ -1507,7 +1562,7 @@
public @interface AutofillEventType {}
/**
- * The auto-fill input UI affordance associated with the view was shown.
+ * The autofill input UI affordance associated with the view was shown.
*
* <p>If the view provides its own auto-complete UI affordance and its currently shown, it
* should be hidden upon receiving this event.
@@ -1515,7 +1570,7 @@
public static final int EVENT_INPUT_SHOWN = 1;
/**
- * The auto-fill input UI affordance associated with the view was hidden.
+ * The autofill input UI affordance associated with the view was hidden.
*
* <p>If the view provides its own auto-complete UI affordance that was hidden upon a
* {@link #EVENT_INPUT_SHOWN} event, it could be shown again now.
@@ -1523,7 +1578,7 @@
public static final int EVENT_INPUT_HIDDEN = 2;
/**
- * The auto-fill input UI affordance associated with the view won't be shown because
+ * The autofill input UI affordance associated with the view isn't shown because
* autofill is not available.
*
* <p>If the view provides its own auto-complete UI affordance but was not displaying it
diff --git a/core/java/android/view/inputmethod/InputMethodSubtype.java b/core/java/android/view/inputmethod/InputMethodSubtype.java
index 28c2d01..a7d7a8d 100644
--- a/core/java/android/view/inputmethod/InputMethodSubtype.java
+++ b/core/java/android/view/inputmethod/InputMethodSubtype.java
@@ -84,6 +84,8 @@
private final String mSubtypeLanguageTag;
private final String mSubtypeMode;
private final String mSubtypeExtraValue;
+ private final Object mLock = new Object();
+ private volatile Locale mCachedLocaleObj;
private volatile HashMap<String, String> mExtraValueHashMapCache;
/**
@@ -372,10 +374,20 @@
*/
@Nullable
public Locale getLocaleObject() {
- if (!TextUtils.isEmpty(mSubtypeLanguageTag)) {
- return Locale.forLanguageTag(mSubtypeLanguageTag);
+ if (mCachedLocaleObj != null) {
+ return mCachedLocaleObj;
}
- return InputMethodUtils.constructLocaleFromString(mSubtypeLocale);
+ synchronized (mLock) {
+ if (mCachedLocaleObj != null) {
+ return mCachedLocaleObj;
+ }
+ if (!TextUtils.isEmpty(mSubtypeLanguageTag)) {
+ mCachedLocaleObj = Locale.forLanguageTag(mSubtypeLanguageTag);
+ } else {
+ mCachedLocaleObj = InputMethodUtils.constructLocaleFromString(mSubtypeLocale);
+ }
+ return mCachedLocaleObj;
+ }
}
/**
@@ -681,4 +693,4 @@
}
return sortedList;
}
-}
+}
\ No newline at end of file
diff --git a/core/java/android/webkit/SafeBrowsingResponse.java b/core/java/android/webkit/SafeBrowsingResponse.java
index 024a70b..2ccd2ba 100644
--- a/core/java/android/webkit/SafeBrowsingResponse.java
+++ b/core/java/android/webkit/SafeBrowsingResponse.java
@@ -18,9 +18,9 @@
/**
* Used to indicate an action to take when hitting a malicious URL. Instances of this class are
- * created by the WebView and passed to {@link WebViewClient#onSafeBrowsingHit}. The host
- * application must call {@link #showInterstitial}, {@link #proceed}, or {@link #backToSafety} to
- * set the WebView's response to the Safe Browsing hit.
+ * created by the WebView and passed to {@link android.webkit.WebViewClient#onSafeBrowsingHit}. The
+ * host application must call {@link #showInterstitial(boolean)}, {@link #proceed(boolean)}, or
+ * {@link #backToSafety(boolean)} to set the WebView's response to the Safe Browsing hit.
*/
public abstract class SafeBrowsingResponse {
diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java
index 3a6de96..82cff7c 100644
--- a/core/java/android/webkit/WebSettings.java
+++ b/core/java/android/webkit/WebSettings.java
@@ -1390,17 +1390,15 @@
* Sets whether Safe Browsing is enabled. Safe browsing allows WebView to
* protect against malware and phishing attacks by verifying the links.
*
- * Safe browsing is disabled by default. The recommended way to enable
- * Safe browsing is using a manifest tag to change the default value to
- * enabled for all WebViews.
* <p>
- * <pre>
- * <meta-data android:name="android.webkit.WebView.EnableSafeBrowsing"
- * android:value="true" />
- * </pre>
+ * Safe browsing is disabled by default. The recommended way to enable Safe browsing is using a
+ * manifest tag to change the default value to enabled for all WebViews (read <a
+ * href="{@docRoot}reference/android/webkit/WebView.html">general Safe Browsing info</a>).
* </p>
*
+ * <p>
* This API overrides the manifest tag value for this WebView.
+ * </p>
*
* @param enabled Whether Safe browsing is enabled.
*/
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index da77640..dd716eb 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -319,6 +319,22 @@
* out.
* </p>
*
+ * <h3>Safe Browsing</h3>
+ *
+ * <p>
+ * If Safe Browsing is enabled, WebView will block malicious URLs and present a warning UI to the
+ * user to allow them to navigate back safely or proceed to the malicious page.
+ * </p>
+ * <p>
+ * The recommended way for apps to enable the feature is putting the following tag in the manifest:
+ * </p>
+ * <p>
+ * <pre>
+ * <meta-data android:name="android.webkit.WebView.EnableSafeBrowsing"
+ * android:value="true" />
+ * </pre>
+ * </p>
+ *
*/
// Implementation notes.
// The WebView is a thin API class that delegates its public API to a backend WebViewProvider
@@ -1622,8 +1638,24 @@
}
/**
- * Starts Safe Browsing initialization. This should only be called once. This does not require
- * an Activity Context, and will always use the application Context to do its work.
+ * Starts Safe Browsing initialization. This should only be called once.
+ *
+ * <p>
+ * Because the Safe Browsing feature takes time to initialize, WebView may temporarily whitelist
+ * URLs until the feature is ready. The callback will be invoked with true once initialization
+ * is complete.
+ * </p>
+ *
+ * <p>
+ * This does not enable the Safe Browsing feature itself, and should only be used if the feature
+ * is otherwise enabled.
+ * </p>
+ *
+ * <p>
+ * This does not require an Activity Context, and will always use the application Context to do
+ * its work.
+ * </p>
+ *
* @param context Application Context.
* @param callback will be called with the value true if initialization is
* successful. The callback will be run on the UI thread.
@@ -1633,7 +1665,9 @@
}
/**
- * Shuts down Safe Browsing. This should only be called once.
+ * Shuts down Safe Browsing. This should only be called once. This does not disable the feature,
+ * it only frees resources used by Safe Browsing code. To disable Safe Browsing on an individual
+ * WebView, see {@link WebSettings#setSafeBrowsingEnabled}
*/
public static void shutdownSafeBrowsing() {
getFactory().getStatics().shutdownSafeBrowsing();
diff --git a/core/java/com/android/internal/app/MediaRouteChooserDialog.java b/core/java/com/android/internal/app/MediaRouteChooserDialog.java
index 47d2a9c..7108d14 100644
--- a/core/java/com/android/internal/app/MediaRouteChooserDialog.java
+++ b/core/java/com/android/internal/app/MediaRouteChooserDialog.java
@@ -24,6 +24,7 @@
import android.media.MediaRouter.RouteInfo;
import android.os.Bundle;
import android.text.TextUtils;
+import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -130,7 +131,8 @@
// Must be called after setContentView.
getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,
- R.drawable.ic_media_route_off_holo_dark);
+ isLightTheme(getContext()) ? R.drawable.ic_media_route_off_holo_light
+ : R.drawable.ic_media_route_off_holo_dark);
mAdapter = new RouteAdapter(getContext());
mListView = (ListView)findViewById(R.id.media_route_list);
@@ -176,6 +178,12 @@
}
}
+ static boolean isLightTheme(Context context) {
+ TypedValue value = new TypedValue();
+ return context.getTheme().resolveAttribute(R.attr.isLightTheme, value, true)
+ && value.data != 0;
+ }
+
private final class RouteAdapter extends ArrayAdapter<MediaRouter.RouteInfo>
implements ListView.OnItemClickListener {
private final LayoutInflater mInflater;
diff --git a/core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java b/core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java
index 237feed..3cbc9ea 100644
--- a/core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java
+++ b/core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java
@@ -43,8 +43,12 @@
* </p>
*/
public MediaRouteChooserDialogFragment() {
+ int theme = MediaRouteChooserDialog.isLightTheme(getContext())
+ ? android.R.style.Theme_DeviceDefault_Light_Dialog
+ : android.R.style.Theme_DeviceDefault_Dialog;
+
setCancelable(true);
- setStyle(STYLE_NORMAL, android.R.style.Theme_DeviceDefault_Dialog);
+ setStyle(STYLE_NORMAL, theme);
}
public int getRouteTypes() {
diff --git a/core/java/com/android/internal/app/MediaRouteDialogPresenter.java b/core/java/com/android/internal/app/MediaRouteDialogPresenter.java
index fad7fd4..bb2d7fa 100644
--- a/core/java/com/android/internal/app/MediaRouteDialogPresenter.java
+++ b/core/java/com/android/internal/app/MediaRouteDialogPresenter.java
@@ -71,16 +71,18 @@
final MediaRouter router = (MediaRouter)context.getSystemService(
Context.MEDIA_ROUTER_SERVICE);
+ int theme = MediaRouteChooserDialog.isLightTheme(context)
+ ? android.R.style.Theme_DeviceDefault_Light_Dialog
+ : android.R.style.Theme_DeviceDefault_Dialog;
+
MediaRouter.RouteInfo route = router.getSelectedRoute();
if (route.isDefault() || !route.matchesTypes(routeTypes)) {
- final MediaRouteChooserDialog d = new MediaRouteChooserDialog(
- context, android.R.style.Theme_DeviceDefault_Dialog);
+ final MediaRouteChooserDialog d = new MediaRouteChooserDialog(context, theme);
d.setRouteTypes(routeTypes);
d.setExtendedSettingsClickListener(extendedSettingsClickListener);
return d;
} else {
- MediaRouteControllerDialog d = new MediaRouteControllerDialog(
- context, android.R.style.Theme_DeviceDefault_Dialog);
+ MediaRouteControllerDialog d = new MediaRouteControllerDialog(context, theme);
return d;
}
}
diff --git a/core/java/com/android/internal/hardware/AmbientDisplayConfiguration.java b/core/java/com/android/internal/hardware/AmbientDisplayConfiguration.java
index 1168eec..1811800c 100644
--- a/core/java/com/android/internal/hardware/AmbientDisplayConfiguration.java
+++ b/core/java/com/android/internal/hardware/AmbientDisplayConfiguration.java
@@ -111,7 +111,7 @@
return mContext.getResources().getString(R.string.config_dozeComponent);
}
- private boolean accessibilityInversionEnabled(int user) {
+ public boolean accessibilityInversionEnabled(int user) {
return boolSettingDefaultOff(Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, user);
}
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index e59cf84..611c4b8 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -119,7 +119,7 @@
private static final int MAGIC = 0xBA757475; // 'BATSTATS'
// Current on-disk Parcel version
- private static final int VERSION = 162 + (USE_OLD_HISTORY ? 1000 : 0);
+ private static final int VERSION = 164 + (USE_OLD_HISTORY ? 1000 : 0);
// Maximum number of items we will record in the history.
private static final int MAX_HISTORY_ITEMS;
@@ -5707,7 +5707,7 @@
LongSamplingCounter mUserCpuTime;
LongSamplingCounter mSystemCpuTime;
- LongSamplingCounter[][] mCpuClusterSpeed;
+ LongSamplingCounter[][] mCpuClusterSpeedTimesUs;
LongSamplingCounterArray mCpuFreqTimeMs;
LongSamplingCounterArray mScreenOffCpuFreqTimeMs;
@@ -6556,12 +6556,12 @@
@Override
public long getTimeAtCpuSpeed(int cluster, int step, int which) {
- if (mCpuClusterSpeed != null) {
- if (cluster >= 0 && cluster < mCpuClusterSpeed.length) {
- final LongSamplingCounter[] cpuSpeeds = mCpuClusterSpeed[cluster];
- if (cpuSpeeds != null) {
- if (step >= 0 && step < cpuSpeeds.length) {
- final LongSamplingCounter c = cpuSpeeds[step];
+ if (mCpuClusterSpeedTimesUs != null) {
+ if (cluster >= 0 && cluster < mCpuClusterSpeedTimesUs.length) {
+ final LongSamplingCounter[] cpuSpeedTimesUs = mCpuClusterSpeedTimesUs[cluster];
+ if (cpuSpeedTimesUs != null) {
+ if (step >= 0 && step < cpuSpeedTimesUs.length) {
+ final LongSamplingCounter c = cpuSpeedTimesUs[step];
if (c != null) {
return c.getCountLocked(which);
}
@@ -6712,8 +6712,8 @@
mUserCpuTime.reset(false);
mSystemCpuTime.reset(false);
- if (mCpuClusterSpeed != null) {
- for (LongSamplingCounter[] speeds : mCpuClusterSpeed) {
+ if (mCpuClusterSpeedTimesUs != null) {
+ for (LongSamplingCounter[] speeds : mCpuClusterSpeedTimesUs) {
if (speeds != null) {
for (LongSamplingCounter speed : speeds) {
if (speed != null) {
@@ -6902,8 +6902,8 @@
mUserCpuTime.detach();
mSystemCpuTime.detach();
- if (mCpuClusterSpeed != null) {
- for (LongSamplingCounter[] cpuSpeeds : mCpuClusterSpeed) {
+ if (mCpuClusterSpeedTimesUs != null) {
+ for (LongSamplingCounter[] cpuSpeeds : mCpuClusterSpeedTimesUs) {
if (cpuSpeeds != null) {
for (LongSamplingCounter c : cpuSpeeds) {
if (c != null) {
@@ -7156,10 +7156,10 @@
mUserCpuTime.writeToParcel(out);
mSystemCpuTime.writeToParcel(out);
- if (mCpuClusterSpeed != null) {
+ if (mCpuClusterSpeedTimesUs != null) {
out.writeInt(1);
- out.writeInt(mCpuClusterSpeed.length);
- for (LongSamplingCounter[] cpuSpeeds : mCpuClusterSpeed) {
+ out.writeInt(mCpuClusterSpeedTimesUs.length);
+ for (LongSamplingCounter[] cpuSpeeds : mCpuClusterSpeedTimesUs) {
if (cpuSpeeds != null) {
out.writeInt(1);
out.writeInt(cpuSpeeds.length);
@@ -7453,7 +7453,7 @@
throw new ParcelFormatException("Incompatible number of cpu clusters");
}
- mCpuClusterSpeed = new LongSamplingCounter[numCpuClusters][];
+ mCpuClusterSpeedTimesUs = new LongSamplingCounter[numCpuClusters][];
for (int cluster = 0; cluster < numCpuClusters; cluster++) {
if (in.readInt() != 0) {
int numSpeeds = in.readInt();
@@ -7463,18 +7463,19 @@
}
final LongSamplingCounter[] cpuSpeeds = new LongSamplingCounter[numSpeeds];
- mCpuClusterSpeed[cluster] = cpuSpeeds;
+ mCpuClusterSpeedTimesUs[cluster] = cpuSpeeds;
for (int speed = 0; speed < numSpeeds; speed++) {
if (in.readInt() != 0) {
- cpuSpeeds[speed] = new LongSamplingCounter(mBsi.mOnBatteryTimeBase, in);
+ cpuSpeeds[speed] = new LongSamplingCounter(
+ mBsi.mOnBatteryTimeBase, in);
}
}
} else {
- mCpuClusterSpeed[cluster] = null;
+ mCpuClusterSpeedTimesUs[cluster] = null;
}
}
} else {
- mCpuClusterSpeed = null;
+ mCpuClusterSpeedTimesUs = null;
}
mCpuFreqTimeMs = LongSamplingCounterArray.readFromParcel(in, mBsi.mOnBatteryTimeBase);
@@ -8043,6 +8044,7 @@
/**
* Number of times wakeup alarms have occurred for this app.
+ * On screen-off timebase starting in report v25.
*/
ArrayMap<String, Counter> mWakeupAlarms = new ArrayMap<>();
@@ -8071,7 +8073,7 @@
mWakeupAlarms.clear();
for (int i=0; i<numWA; i++) {
String tag = in.readString();
- mWakeupAlarms.put(tag, new Counter(mBsi.mOnBatteryTimeBase, in));
+ mWakeupAlarms.put(tag, new Counter(mBsi.mOnBatteryScreenOffTimeBase, in));
}
int numServs = in.readInt();
@@ -8110,7 +8112,7 @@
public void noteWakeupAlarmLocked(String tag) {
Counter c = mWakeupAlarms.get(tag);
if (c == null) {
- c = new Counter(mBsi.mOnBatteryTimeBase);
+ c = new Counter(mBsi.mOnBatteryScreenOffTimeBase);
mWakeupAlarms.put(tag, c);
}
c.stepAtomic();
@@ -10429,46 +10431,48 @@
}
}
- long totalCpuClustersTime = 0;
+ long totalCpuClustersTimeMs = 0;
// Read the time spent for each cluster at various cpu frequencies.
- final long[][] clusterSpeeds = new long[mKernelCpuSpeedReaders.length][];
+ final long[][] clusterSpeedTimesMs = new long[mKernelCpuSpeedReaders.length][];
for (int cluster = 0; cluster < mKernelCpuSpeedReaders.length; cluster++) {
- clusterSpeeds[cluster] = mKernelCpuSpeedReaders[cluster].readDelta();
- if (clusterSpeeds[cluster] != null) {
- for (int speed = clusterSpeeds[cluster].length - 1; speed >= 0; --speed) {
- totalCpuClustersTime += clusterSpeeds[cluster][speed];
+ clusterSpeedTimesMs[cluster] = mKernelCpuSpeedReaders[cluster].readDelta();
+ if (clusterSpeedTimesMs[cluster] != null) {
+ for (int speed = clusterSpeedTimesMs[cluster].length - 1; speed >= 0; --speed) {
+ totalCpuClustersTimeMs += clusterSpeedTimesMs[cluster][speed];
}
}
}
- if (totalCpuClustersTime != 0) {
+ if (totalCpuClustersTimeMs != 0) {
// We have cpu times per freq aggregated over all uids but we need the times per uid.
// So, we distribute total time spent by an uid to different cpu freqs based on the
// amount of time cpu was running at that freq.
final int updatedUidsCount = updatedUids.size();
for (int i = 0; i < updatedUidsCount; ++i) {
final Uid u = getUidStatsLocked(updatedUids.keyAt(i));
- final long appCpuTimeMs = updatedUids.valueAt(i) / 1000;
+ final long appCpuTimeUs = updatedUids.valueAt(i);
// Add the cpu speeds to this UID.
final int numClusters = mPowerProfile.getNumCpuClusters();
- if (u.mCpuClusterSpeed == null || u.mCpuClusterSpeed.length !=
+ if (u.mCpuClusterSpeedTimesUs == null || u.mCpuClusterSpeedTimesUs.length !=
numClusters) {
- u.mCpuClusterSpeed = new LongSamplingCounter[numClusters][];
+ u.mCpuClusterSpeedTimesUs = new LongSamplingCounter[numClusters][];
}
- for (int cluster = 0; cluster < clusterSpeeds.length; cluster++) {
- final int speedsInCluster = clusterSpeeds[cluster].length;
- if (u.mCpuClusterSpeed[cluster] == null || speedsInCluster !=
- u.mCpuClusterSpeed[cluster].length) {
- u.mCpuClusterSpeed[cluster] = new LongSamplingCounter[speedsInCluster];
+ for (int cluster = 0; cluster < clusterSpeedTimesMs.length; cluster++) {
+ final int speedsInCluster = clusterSpeedTimesMs[cluster].length;
+ if (u.mCpuClusterSpeedTimesUs[cluster] == null || speedsInCluster !=
+ u.mCpuClusterSpeedTimesUs[cluster].length) {
+ u.mCpuClusterSpeedTimesUs[cluster]
+ = new LongSamplingCounter[speedsInCluster];
}
- final LongSamplingCounter[] cpuSpeeds = u.mCpuClusterSpeed[cluster];
+ final LongSamplingCounter[] cpuSpeeds = u.mCpuClusterSpeedTimesUs[cluster];
for (int speed = 0; speed < speedsInCluster; speed++) {
if (cpuSpeeds[speed] == null) {
cpuSpeeds[speed] = new LongSamplingCounter(mOnBatteryTimeBase);
}
- cpuSpeeds[speed].addCountLocked(appCpuTimeMs * clusterSpeeds[cluster][speed]
- / totalCpuClustersTime);
+ cpuSpeeds[speed].addCountLocked(appCpuTimeUs
+ * clusterSpeedTimesMs[cluster][speed]
+ / totalCpuClustersTimeMs);
}
}
}
@@ -11752,7 +11756,7 @@
throw new ParcelFormatException("Incompatible cpu cluster arrangement");
}
- u.mCpuClusterSpeed = new LongSamplingCounter[numClusters][];
+ u.mCpuClusterSpeedTimesUs = new LongSamplingCounter[numClusters][];
for (int cluster = 0; cluster < numClusters; cluster++) {
if (in.readInt() != 0) {
final int NSB = in.readInt();
@@ -11762,20 +11766,20 @@
NSB);
}
- u.mCpuClusterSpeed[cluster] = new LongSamplingCounter[NSB];
+ u.mCpuClusterSpeedTimesUs[cluster] = new LongSamplingCounter[NSB];
for (int speed = 0; speed < NSB; speed++) {
if (in.readInt() != 0) {
- u.mCpuClusterSpeed[cluster][speed] = new LongSamplingCounter(
+ u.mCpuClusterSpeedTimesUs[cluster][speed] = new LongSamplingCounter(
mOnBatteryTimeBase);
- u.mCpuClusterSpeed[cluster][speed].readSummaryFromParcelLocked(in);
+ u.mCpuClusterSpeedTimesUs[cluster][speed].readSummaryFromParcelLocked(in);
}
}
} else {
- u.mCpuClusterSpeed[cluster] = null;
+ u.mCpuClusterSpeedTimesUs[cluster] = null;
}
}
} else {
- u.mCpuClusterSpeed = null;
+ u.mCpuClusterSpeedTimesUs = null;
}
u.mCpuFreqTimeMs = LongSamplingCounterArray.readSummaryFromParcelLocked(
@@ -11867,7 +11871,7 @@
p.mWakeupAlarms.clear();
for (int iwa=0; iwa<NWA; iwa++) {
String tag = in.readString();
- Counter c = new Counter(mOnBatteryTimeBase);
+ Counter c = new Counter(mOnBatteryScreenOffTimeBase);
c.readSummaryFromParcelLocked(in);
p.mWakeupAlarms.put(tag, c);
}
@@ -12183,10 +12187,10 @@
u.mUserCpuTime.writeSummaryFromParcelLocked(out);
u.mSystemCpuTime.writeSummaryFromParcelLocked(out);
- if (u.mCpuClusterSpeed != null) {
+ if (u.mCpuClusterSpeedTimesUs != null) {
out.writeInt(1);
- out.writeInt(u.mCpuClusterSpeed.length);
- for (LongSamplingCounter[] cpuSpeeds : u.mCpuClusterSpeed) {
+ out.writeInt(u.mCpuClusterSpeedTimesUs.length);
+ for (LongSamplingCounter[] cpuSpeeds : u.mCpuClusterSpeedTimesUs) {
if (cpuSpeeds != null) {
out.writeInt(1);
out.writeInt(cpuSpeeds.length);
diff --git a/core/java/com/android/internal/os/CpuPowerCalculator.java b/core/java/com/android/internal/os/CpuPowerCalculator.java
index 9d52e19..bb743c1 100644
--- a/core/java/com/android/internal/os/CpuPowerCalculator.java
+++ b/core/java/com/android/internal/os/CpuPowerCalculator.java
@@ -22,6 +22,7 @@
public class CpuPowerCalculator extends PowerCalculator {
private static final String TAG = "CpuPowerCalculator";
private static final boolean DEBUG = BatteryStatsHelper.DEBUG;
+ private static final long MICROSEC_IN_HR = (long) 60 * 60 * 1000 * 1000;
private final PowerProfile mProfile;
public CpuPowerCalculator(PowerProfile profile) {
@@ -35,21 +36,22 @@
app.cpuTimeMs = (u.getUserCpuTimeUs(statsType) + u.getSystemCpuTimeUs(statsType)) / 1000;
final int numClusters = mProfile.getNumCpuClusters();
- double cpuPowerMaMs = 0;
+ double cpuPowerMaUs = 0;
for (int cluster = 0; cluster < numClusters; cluster++) {
final int speedsForCluster = mProfile.getNumSpeedStepsInCpuCluster(cluster);
for (int speed = 0; speed < speedsForCluster; speed++) {
- final double cpuSpeedStepPower = u.getTimeAtCpuSpeed(cluster, speed, statsType) *
+ final long timeUs = u.getTimeAtCpuSpeed(cluster, speed, statsType);
+ final double cpuSpeedStepPower = timeUs *
mProfile.getAveragePowerForCpu(cluster, speed);
if (DEBUG) {
Log.d(TAG, "UID " + u.getUid() + ": CPU cluster #" + cluster + " step #"
- + speed + " power="
- + BatteryStatsHelper.makemAh(cpuSpeedStepPower / (60 * 60 * 1000)));
+ + speed + " timeUs=" + timeUs + " power="
+ + BatteryStatsHelper.makemAh(cpuSpeedStepPower / MICROSEC_IN_HR));
}
- cpuPowerMaMs += cpuSpeedStepPower;
+ cpuPowerMaUs += cpuSpeedStepPower;
}
}
- app.cpuPowerMah = cpuPowerMaMs / (60 * 60 * 1000);
+ app.cpuPowerMah = cpuPowerMaUs / MICROSEC_IN_HR;
if (DEBUG && (app.cpuTimeMs != 0 || app.cpuPowerMah != 0)) {
Log.d(TAG, "UID " + u.getUid() + ": CPU time=" + app.cpuTimeMs + " ms power="
diff --git a/core/java/com/android/internal/os/KernelCpuSpeedReader.java b/core/java/com/android/internal/os/KernelCpuSpeedReader.java
index 9c7debb..757a112 100644
--- a/core/java/com/android/internal/os/KernelCpuSpeedReader.java
+++ b/core/java/com/android/internal/os/KernelCpuSpeedReader.java
@@ -39,8 +39,8 @@
private static final String TAG = "KernelCpuSpeedReader";
private final String mProcFile;
- private final long[] mLastSpeedTimes;
- private final long[] mDeltaSpeedTimes;
+ private final long[] mLastSpeedTimesMs;
+ private final long[] mDeltaSpeedTimesMs;
// How long a CPU jiffy is in milliseconds.
private final long mJiffyMillis;
@@ -51,8 +51,8 @@
public KernelCpuSpeedReader(int cpuNumber, int numSpeedSteps) {
mProcFile = String.format("/sys/devices/system/cpu/cpu%d/cpufreq/stats/time_in_state",
cpuNumber);
- mLastSpeedTimes = new long[numSpeedSteps];
- mDeltaSpeedTimes = new long[numSpeedSteps];
+ mLastSpeedTimesMs = new long[numSpeedSteps];
+ mDeltaSpeedTimesMs = new long[numSpeedSteps];
long jiffyHz = Libcore.os.sysconf(OsConstants._SC_CLK_TCK);
mJiffyMillis = 1000/jiffyHz;
}
@@ -68,27 +68,27 @@
TextUtils.SimpleStringSplitter splitter = new TextUtils.SimpleStringSplitter(' ');
String line;
int speedIndex = 0;
- while (speedIndex < mLastSpeedTimes.length && (line = reader.readLine()) != null) {
+ while (speedIndex < mLastSpeedTimesMs.length && (line = reader.readLine()) != null) {
splitter.setString(line);
- Long.parseLong(splitter.next());
+ splitter.next();
long time = Long.parseLong(splitter.next()) * mJiffyMillis;
- if (time < mLastSpeedTimes[speedIndex]) {
+ if (time < mLastSpeedTimesMs[speedIndex]) {
// The stats reset when the cpu hotplugged. That means that the time
// we read is offset from 0, so the time is the delta.
- mDeltaSpeedTimes[speedIndex] = time;
+ mDeltaSpeedTimesMs[speedIndex] = time;
} else {
- mDeltaSpeedTimes[speedIndex] = time - mLastSpeedTimes[speedIndex];
+ mDeltaSpeedTimesMs[speedIndex] = time - mLastSpeedTimesMs[speedIndex];
}
- mLastSpeedTimes[speedIndex] = time;
+ mLastSpeedTimesMs[speedIndex] = time;
speedIndex++;
}
} catch (IOException e) {
Slog.e(TAG, "Failed to read cpu-freq: " + e.getMessage());
- Arrays.fill(mDeltaSpeedTimes, 0);
+ Arrays.fill(mDeltaSpeedTimesMs, 0);
} finally {
StrictMode.setThreadPolicy(policy);
}
- return mDeltaSpeedTimes;
+ return mDeltaSpeedTimesMs;
}
}
diff --git a/core/java/com/android/internal/os/KernelUidCpuFreqTimeReader.java b/core/java/com/android/internal/os/KernelUidCpuFreqTimeReader.java
index 7295380..c89f546 100644
--- a/core/java/com/android/internal/os/KernelUidCpuFreqTimeReader.java
+++ b/core/java/com/android/internal/os/KernelUidCpuFreqTimeReader.java
@@ -134,9 +134,9 @@
.append(uid).append("\n");
sb.append("data=").append("(").append(uidTimeMs[i]).append(",")
.append(totalTimeMs).append(")").append("\n");
- sb.append("times=").append("(")
- .append(TimeUtils.formatForLogging(mLastTimeReadMs)).append(",")
- .append(TimeUtils.formatForLogging(mNowTimeMs)).append(")");
+ sb.append("times=").append("(");
+ TimeUtils.formatDuration(mLastTimeReadMs, sb); sb.append(",");
+ TimeUtils.formatDuration(mNowTimeMs, sb); sb.append(")");
Slog.wtf(TAG, sb.toString());
return;
}
diff --git a/core/java/com/android/internal/statusbar/IStatusBar.aidl b/core/java/com/android/internal/statusbar/IStatusBar.aidl
index 45a8654..f978b57 100644
--- a/core/java/com/android/internal/statusbar/IStatusBar.aidl
+++ b/core/java/com/android/internal/statusbar/IStatusBar.aidl
@@ -116,4 +116,6 @@
void remQsTile(in ComponentName tile);
void clickQsTile(in ComponentName tile);
void handleSystemKey(in int key);
+
+ void showShutdownUi(boolean isReboot, String reason);
}
diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java
index 9462a06..0d15758 100644
--- a/core/java/com/android/internal/widget/LockPatternUtils.java
+++ b/core/java/com/android/internal/widget/LockPatternUtils.java
@@ -67,8 +67,7 @@
private static final String TAG = "LockPatternUtils";
private static final boolean DEBUG = false;
- private static final boolean FRP_CREDENTIAL_ENABLED =
- Build.IS_DEBUGGABLE && SystemProperties.getBoolean("debug.frpcredential.enable", false);
+ private static final boolean FRP_CREDENTIAL_ENABLED = true;
/**
* The key to identify when the lock pattern enabled flag is being accessed for legacy reasons.
@@ -1212,6 +1211,11 @@
*/
public long setLockoutAttemptDeadline(int userId, int timeoutMs) {
final long deadline = SystemClock.elapsedRealtime() + timeoutMs;
+ if (userId == USER_FRP) {
+ // For secure password storage (that is required for FRP), the underlying storage also
+ // enforces the deadline. Since we cannot store settings for the FRP user, don't.
+ return deadline;
+ }
setLong(LOCKOUT_ATTEMPT_DEADLINE, deadline, userId);
setLong(LOCKOUT_ATTEMPT_TIMEOUT_MS, timeoutMs, userId);
return deadline;
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 0289a8a..208c776 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -305,7 +305,7 @@
<protected-broadcast android:name="com.android.server.WifiManager.action.DEVICE_IDLE" />
<protected-broadcast android:name="com.android.server.action.REMOTE_BUGREPORT_SHARING_ACCEPTED" />
<protected-broadcast android:name="com.android.server.action.REMOTE_BUGREPORT_SHARING_DECLINED" />
- <protected-broadcast android:name="com.android.server.action.WIPE_EUICC_DATA" />
+ <protected-broadcast android:name="com.android.internal.action.EUICC_FACTORY_RESET" />
<protected-broadcast android:name="com.android.server.usb.ACTION_OPEN_IN_APPS" />
<protected-broadcast android:name="com.android.server.am.DELETE_DUMPHEAP" />
<protected-broadcast android:name="com.android.server.net.action.SNOOZE_WARNING" />
diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml
index ed6bb59..c008194 100644
--- a/core/res/res/values-af/strings.xml
+++ b/core/res/res/values-af/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Word tydelik nie deur die selnetwerk by jou ligging aangebied nie"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Kan netwerk nie bereik nie"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Om opvangs te verbeter, probeer die soort verander wat by Instellings > Netwerk en internet > Mobiele netwerke > Voorkeurnetwerksoort gekies is."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Wi‑Fi-oproepe is aktief"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Noodoproepe vereis \'n mobiele netwerk."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Opletberigte"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Oproepaanstuur"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Noodterugbel-modus"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Status van mobiele data"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"SMS-boodskappe"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Stemboodskappe"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi-oproepe"</string>
diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml
index cc1af72..c7073f0 100644
--- a/core/res/res/values-am/strings.xml
+++ b/core/res/res/values-am/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"ለጊዜው በአካባቢዎ ባለው የተንቀሳቃሽ ስልክ አውታረ መረብ አይቀርብም"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"አውታረ መረብ ላይ መድረስ አይቻልም"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"ቅበላን ለማሻሻል የተመረጠውን ዓይነት በቅንብሮች > አውታረ መረብ እና በይነመረብ > የተንቀሳቃሽ ስልክ አውታረ መረቦች > ተመራጭ የአውታረ መረብ ዓይነት ላይ ለመለወጥ ይሞክሩ።"</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"የWi‑Fi ጥሪ ገቢር ነው"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"የአደጋ ጥሪዎች የተንቀሳቃሽ ስልክ አውታረ መረብ ያስፈልጋቸዋል።"</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"ማንቂያዎች"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"ጥሪ ማስተላለፍ"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"የአደጋ ጊዜ ጥሪ ሁነታ"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"የተንቀሳቃሽ ስልክ ውሂብ ሁኔታ"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"የኤስኤምኤስ መልዕክቶች"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"የድምጽ መልዕክቶች"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"የWi-Fi ጥሪ"</string>
diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml
index b1436c9d..01ba0f1 100644
--- a/core/res/res/values-ar/strings.xml
+++ b/core/res/res/values-ar/strings.xml
@@ -84,11 +84,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"مؤقتا لا تقدمها شبكة الجوال في موقعك"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"يتعذر الوصول إلى الشبكة"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"لتحسين الاستقبال، يمكنك محاولة تغيير النوع المحدّد من خلال الإعدادات > الشبكة والإنترنت > شبكات الجوّال > نوع الشبكة المفضّل."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"الاتصال عبر Wi-Fi نشط"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"تتطلب مكالمات الطوارئ شبكة جوّال."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"التنبيهات"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"إعادة توجيه المكالمة"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"وضع معاودة الاتصال بالطوارئ"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"حالة بيانات الجوّال"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"الرسائل القصيرة SMS"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"رسائل البريد الصوتي"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"الاتصال عبر Wi-Fi"</string>
diff --git a/core/res/res/values-az/strings.xml b/core/res/res/values-az/strings.xml
index f15f810..500201b 100644
--- a/core/res/res/values-az/strings.xml
+++ b/core/res/res/values-az/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Müvəqqəti olaraq məkanda mobil şəbəkə tərəfindən təklif edilmir"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Şəbəkəyə daxil olmaq mümkün deyil"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Qəbulu inkişaf etdirmək üçün seçilmiş növü Ayarlar > Şəbəkə və İnternet > Mobil şəbəkə > Tərcih edilən şəbəkə növü bölməsində dəyişə bilərsiniz."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Wi‑Fi zəngi aktivdir"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Təcili zənglər üçün mobil şəbəkə tələb olunur."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Siqnallar"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Zəng yönləndirmə"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Təcili geriyə zəng rejimi"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Mobil data statusu"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"SMS mesajları"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Səsli e-poçt mesajları"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi zəngi"</string>
diff --git a/core/res/res/values-b+sr+Latn/strings.xml b/core/res/res/values-b+sr+Latn/strings.xml
index 590f3cf..2226a23 100644
--- a/core/res/res/values-b+sr+Latn/strings.xml
+++ b/core/res/res/values-b+sr+Latn/strings.xml
@@ -81,6 +81,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Privremeno je onemogućeno na mobilnoj mreži na vašoj lokaciji"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Povezivanje sa mrežom nije uspelo"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Da biste poboljšali prijem, probajte da promenite izabrani tip u odeljku Podešavanja > Mreža i internet > Mobilne mreže > Željeni tip mreže."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Obaveštenja"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Preusmeravanje poziva"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Režim za hitan povratni poziv"</string>
diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml
index 44f78a4..50607c8 100644
--- a/core/res/res/values-be/strings.xml
+++ b/core/res/res/values-be/strings.xml
@@ -82,6 +82,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Часова не прапаноўваецца сеткай мабільнай сувязі ў вашым месцазанходжанні"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Немагчыма падключыцца да сеткі"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Каб палепшыць якасць прыёму, паспрабуйце змяніць тып, выбраны ў меню \"Налады > Сетка і інтэрнэт > Мабільныя сеткі > Прыярытэтны тып сеткі\"."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Абвесткі"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Пераадрасацыя выкліку"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Рэжым экстраннага зваротнага выкліку"</string>
diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml
index 74c2c8a..00ae087 100644
--- a/core/res/res/values-bg/strings.xml
+++ b/core/res/res/values-bg/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Временно не се предлага от мобилната мрежа в местоположението ви"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Не може да се установи връзка с мрежата"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"За да подобрите сигнала, променете избрания тип мрежа от „Настройки“ > „Мрежа и интернет“ > „Мобилни мрежи“ > „Предпочитан тип мрежа“."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Сигнали"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Пренасочване на обаждания"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Режим на обратно обаждане при спешност"</string>
diff --git a/core/res/res/values-bn/strings.xml b/core/res/res/values-bn/strings.xml
index 5240397..c019c6a 100644
--- a/core/res/res/values-bn/strings.xml
+++ b/core/res/res/values-bn/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"সাময়িকভাবে মোবাইল নেটওয়ার্ক আপনার অবস্থানে এই পরিষেবা দিচ্ছে না"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"নেটওয়ার্কের সিগন্যাল নেই"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"রিসেপশন উন্নত করতে সেটিংস > নেটওয়ার্ক এবং ইন্টারনেট > মোবাইল নেটওয়ার্ক > পছন্দের নেটওয়ার্কের ধরণ এ গিয়ে নির্বাচিত নেটওয়ার্কের ধরণ পরিবর্তন করে দেখুন।"</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"সতর্কবার্তা"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"কল ফরওয়ার্ড করা"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"জরুরি কলব্যাক মোড"</string>
diff --git a/core/res/res/values-bs/strings.xml b/core/res/res/values-bs/strings.xml
index a1fd7fa..cee6c34 100644
--- a/core/res/res/values-bs/strings.xml
+++ b/core/res/res/values-bs/strings.xml
@@ -81,6 +81,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Trenutno nije u ponudi mobilne mreže na vašoj lokaciji"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Nije moguće dosegnuti mrežu"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Da poboljšate prijem, pokušajte promijeniti odabranu vrstu u meniju Postavke < Mreža i internet < Mobilne mreže < Preferirana vrsta mreže."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Upozorenja"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Preusmjeravanje poziva"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Način rada za hitni povratni poziv"</string>
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index 53d7c18..b6aea53 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"La xarxa mòbil de la teva ubicació temporalment no ofereix aquest servei"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"No es pot accedir a la xarxa"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Per millorar la recepció, prova de canviar el tipus de xarxa a Configuració > Xarxa i Internet > Xarxes mòbils > Tipus de xarxa preferit."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Alertes"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Desviació de trucades"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Mode de devolució de trucada d\'emergència"</string>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index e249c0f..6f4b6ad 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -82,6 +82,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Mobilní síť ve vaší oblasti tuto službu dočasně nenabízí"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"K síti se nelze připojit"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Chcete-li zlepšit příjem, zkuste změnit vybraný typ sítě v Nastavení > Síť a internet > Mobilní sítě > Preferovaný typ sítě."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Upozornění"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Přesměrování hovorů"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Režim tísňového zpětného volání"</string>
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index 70d366c..96dc1e7 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Tilbydes i øjeblikket ikke af mobilnetværket på din placering"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Der er ingen forbindelse til netværket"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Hvis du vil forbedre signalet, kan du prøve at ændre den valgte netværkstype i Indstillinger > Netværk og internet > Mobilnetværk > Foretrukken netværkstype."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Underretninger"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Viderestilling af opkald"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Nødtilbagekaldstilstand"</string>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index c2296f6..2997eda 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Derzeit nicht im Mobilfunknetz in deiner Region verfügbar"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Netzwerk nicht erreichbar"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Der Empfang lässt sich möglicherweise verbessern, indem du unter \"Einstellungen\" > \"Netzwerk\" & \"Internet\" > \"Mobilfunknetze\" > \"Bevorzugter Netzwerktyp\" einen anderen Typ auswählst."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Warnmeldungen"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Anrufweiterleitung"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Notfallrückrufmodus"</string>
diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml
index ecdf5c7..3d372cc 100644
--- a/core/res/res/values-el/strings.xml
+++ b/core/res/res/values-el/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Δεν προσφέρεται προσωρινά από το δίκτυο κινητής τηλεφωνίας στην τοποθεσία σας"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Δεν είναι δυνατή η σύνδεση στο δίκτυο"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Για να βελτιώσετε τη λήψη, δοκιμάστε να αλλάξετε τον επιλεγμένο τύπο από τις Ρυθμίσεις > Δίκτυο και διαδίκτυο > Δίκτυα κινητής τηλεφωνίας > Προτιμώμενος τύπος δικτύου."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Ειδοποιήσεις"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Προώθηση κλήσης"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Λειτουργία επιστροφής κλήσης έκτακτης ανάγκης"</string>
diff --git a/core/res/res/values-en-rAU/strings.xml b/core/res/res/values-en-rAU/strings.xml
index abbf912..2a3b058 100644
--- a/core/res/res/values-en-rAU/strings.xml
+++ b/core/res/res/values-en-rAU/strings.xml
@@ -80,6 +80,8 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Temporarily not offered by the mobile network at your location"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Can’t find network"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"To improve reception, try changing the type selected at Settings > Network & Internet > Mobile networks > Preferred network type."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Wi‑Fi calling is active"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Emergency calls require a mobile network."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Alerts"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Call forwarding"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Emergency callback mode"</string>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index abbf912..2a3b058 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -80,6 +80,8 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Temporarily not offered by the mobile network at your location"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Can’t find network"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"To improve reception, try changing the type selected at Settings > Network & Internet > Mobile networks > Preferred network type."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Wi‑Fi calling is active"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Emergency calls require a mobile network."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Alerts"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Call forwarding"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Emergency callback mode"</string>
diff --git a/core/res/res/values-en-rIN/strings.xml b/core/res/res/values-en-rIN/strings.xml
index abbf912..2a3b058 100644
--- a/core/res/res/values-en-rIN/strings.xml
+++ b/core/res/res/values-en-rIN/strings.xml
@@ -80,6 +80,8 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Temporarily not offered by the mobile network at your location"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Can’t find network"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"To improve reception, try changing the type selected at Settings > Network & Internet > Mobile networks > Preferred network type."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Wi‑Fi calling is active"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Emergency calls require a mobile network."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Alerts"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Call forwarding"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Emergency callback mode"</string>
diff --git a/core/res/res/values-en-rXC/strings.xml b/core/res/res/values-en-rXC/strings.xml
index 2f1d7da..914e539 100644
--- a/core/res/res/values-en-rXC/strings.xml
+++ b/core/res/res/values-en-rXC/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Temporarily not offered by the mobile network at your location"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Can’t reach network"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"To improve reception, try changing the type selected at Settings > Network & Internet > Mobile networks > Preferred network type."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Wi‑Fi calling is active"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Emergency calls require a mobile network."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Alerts"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Call forwarding"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Emergency callback mode"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Mobile data status"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"SMS messages"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Voicemail messages"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi calling"</string>
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index 3b00144..468b01e 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"La red móvil de tu ubicación no ofrece este servicio de forma temporal"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"No se puede establecer conexión con la red"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Para mejorar la recepción, cambia el tipo de red. Selecciona Configuración > Internet y red > Redes móviles > Tipo de red preferido."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Las llamadas con Wi-Fi están activadas"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Las llamadas de emergencia requieren una red móvil."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Alertas"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Desvío de llamada"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Modo de devolución de llamada de emergencia"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Estado de datos móviles"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"Mensajes SMS"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Mensajes del buzón de voz"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Llamada con Wi-Fi"</string>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index 7a7d81d..2bad008 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"La red móvil disponible en tu ubicación no ofrece esta opción de forma temporal"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"No se puede establecer conexión con la red"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Para mejorar la recepción, prueba a cambiar el tipo seleccionado en Ajustes > Red e Internet > Redes móviles > Tipo de red preferido."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"La llamada por Wi-Fi está activada"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Necesitas conectarte a una red móvil para hacer llamadas de emergencia."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Alertas"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Desvío de llamada"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Modo de devolución de llamada de emergencia"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Estado de los datos móviles"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"Mensajes SMS"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Mensajes de voz"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Llamada por Wi-Fi"</string>
diff --git a/core/res/res/values-et/strings.xml b/core/res/res/values-et/strings.xml
index 78eb80b..4441834 100644
--- a/core/res/res/values-et/strings.xml
+++ b/core/res/res/values-et/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Teie asukoha mobiilsidevõrk seda teenust ajutiselt ei paku"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Võrguga ei saa ühendust"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Vastuvõtu parandamiseks muutke valitud tüüpi jaotises Seaded > Võrk ja Internet > Mobiilsidevõrgud > Eelistatud võrgutüüp."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Teatised"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Kõnede suunamine"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Hädaolukorra tagasihelistusrežiim"</string>
diff --git a/core/res/res/values-eu/strings.xml b/core/res/res/values-eu/strings.xml
index 408ccda..c072af8 100644
--- a/core/res/res/values-eu/strings.xml
+++ b/core/res/res/values-eu/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Zauden tokiko sare mugikorrak ez du eskaintzen aukera hori une honetan"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Ezin da konektatu sarera"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Seinalea hobea izan dadin, aldatu sare mota Ezarpenak > Sareak eta Internet > Sare mugikorrak > Sare mota hobetsia atalean."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Abisuak"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Dei-desbideratzea"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Larrialdi-deiak soilik jasotzeko modua"</string>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index eef22a8..4212814 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"موقتاً توسط شبکه داده دستگاه همراه در مکان شما ارائه نمیشود"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"شبکه دردسترس نیست"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"برای بهبود دریافت، نوع شبکه انتخابشده را در «تنظیمات > شبکه و اینترنت > شبکههای تلفن همراه > نوع شبکه ترجیحی» تغییر دهید."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"تماس ازطریق Wi-Fi فعال است"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"برای انجام تماسهای اضطراری به شبکه تلفن همراه نیاز دارید."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"هشدارها"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"بازارسال تماس"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"حالت پاسخ تماس اضطراری"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"وضعیت داده تلفن همراه"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"پیامکها"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"پیامهای پست صوتی"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"تماس ازطریق Wi-Fi"</string>
diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml
index b37029d..4173ae7 100644
--- a/core/res/res/values-fi/strings.xml
+++ b/core/res/res/values-fi/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Sijaintisi mobiiliverkko ei tarjoa tätä tilapäisesti."</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Ei yhteyttä verkkoon"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Voit yrittää parantaa kuuluvuutta vaihtamalla tyypin asetusta. Valitse Asetukset > Verkko > Internet > Mobiiliverkot > Ensisijainen verkko."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Wi‑Fi-puhelut käytössä"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Hätäpuheluihin vaaditaan mobiiliverkko."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Ilmoitukset"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Soitonsiirto"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Hätäpuhelujen takaisinsoittotila"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Mobiilidatan tila"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"Tekstiviestit"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Vastaajaviestit"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi-puhelut"</string>
diff --git a/core/res/res/values-fr-rCA/strings.xml b/core/res/res/values-fr-rCA/strings.xml
index dafaca4..9da0be4 100644
--- a/core/res/res/values-fr-rCA/strings.xml
+++ b/core/res/res/values-fr-rCA/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Ce service est temporairement non offert par le réseau cellulaire à l\'endroit où vous êtes"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Impossible de joindre le réseau"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Pour améliorer la réception, essayez de changer le type de réseau sélectionné, sous Paramètres > Réseaux et Internet > Réseaux cellulaires > Type de réseau préféré."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Les appels Wi-Fi sont actifs"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Les appels d\'urgence nécessitent un réseau cellulaire."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Alertes"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Transfert d\'appel"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Mode de rappel d\'urgence"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"État des données cellulaires"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"Messages texte"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Messages vocaux"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Appels Wi-Fi"</string>
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index e0aa973..63de4a4 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Momentanément non proposé par le réseau mobile à votre position"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Impossible d\'accéder au réseau"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Pour améliorer la réception, essayez de modifier le type sélectionné sous Paramètres > Réseau et Internet > Réseaux mobiles > Type de réseau préféré."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Alertes"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Transfert d\'appel"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Mode de rappel d\'urgence"</string>
diff --git a/core/res/res/values-gl/strings.xml b/core/res/res/values-gl/strings.xml
index 78d6043..fbea639 100644
--- a/core/res/res/values-gl/strings.xml
+++ b/core/res/res/values-gl/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"A rede de telefonía móbil non ofrece o servizo na túa localización temporalmente"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Non se pode conectar coa rede"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Para mellorar a recepción, proba a cambiar o tipo seleccionado en Configuración > Rede e Internet > Redes de telefonía móbil > Tipo de rede preferido."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Alertas"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Desvío de chamadas"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Modo de devolución de chamadas de emerxencia"</string>
diff --git a/core/res/res/values-gu/strings.xml b/core/res/res/values-gu/strings.xml
index 6f6d7d9..f03cc9d 100644
--- a/core/res/res/values-gu/strings.xml
+++ b/core/res/res/values-gu/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"તમારા સ્થળે મોબાઇલ નેટવર્ક દ્વારા અસ્થાયીરૂપે ઑફર કરવામાં આવતી નથી"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"નેટવર્ક પર પહોંચી શકાતું નથી"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"રિસેપ્શનને બહેતર બનાવવા માટે, સેટિંગ્સ > નેટવર્ક અને ઇન્ટરનેટ > મોબાઇલ નેટવર્ક > પસંદગીના નેટવર્ક પ્રકાર પર પસંદ કરેલ પ્રકાર બદલવાનો પ્રયાસ કરો."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"ચેતવણીઓ"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"કૉલ ફૉર્વર્ડિંગ"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"કટોકટી કૉલબૅક મોડ"</string>
diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml
index 63e08fe..2ee48bf 100644
--- a/core/res/res/values-hi/strings.xml
+++ b/core/res/res/values-hi/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"आपके स्थान के मोबाइल नेटवर्क की ओर से इस समय ऑफ़र नहीं किया जा रहा है"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"नेटवर्क तक नहीं पहुंच पा रहे हैं"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"रिसेप्शन बेहतर करने के लिए, सेटिंग > नेटवर्क और इंटरनेट > मोबाइल नेटवर्क > पसंदीदा नेटवर्क प्रकार पर जाकर, चुना गया प्रकार बदलकर देखें."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"सूचनाएं"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"कॉल अग्रेषण"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"आपातकालीन कॉलबैक मोड"</string>
diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml
index 5655812..2f2d5933 100644
--- a/core/res/res/values-hr/strings.xml
+++ b/core/res/res/values-hr/strings.xml
@@ -81,6 +81,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Trenutačno nije u ponudi mobilne mreže na vašoj lokaciji"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Pristup mreži nije moguć"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Za bolji prijem pokušajte promijeniti vrstu odabranu u odjeljku Postavke > Mreža i internet > Mobilne mreže > Preferirana vrsta mreže."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Upozorenja"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Preusmjeravanje poziva"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Način hitnog povratnog poziva"</string>
diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml
index 0492c9f..25c859c 100644
--- a/core/res/res/values-hu/strings.xml
+++ b/core/res/res/values-hu/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Az Ön tartózkodási helyén ideiglenesen nem áll rendelkezésre a mobilhálózaton"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"A hálózat nem érhető el"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"A vétel javítása érdekében próbálja módosítani a kiválasztott hálózattípust a Beállítások > Hálózat és internet > Mobilhálózatok > Preferált hálózattípus menüpontban."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Értesítések"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Hívásátirányítás"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Sürgősségi visszahívás mód"</string>
diff --git a/core/res/res/values-hy/strings.xml b/core/res/res/values-hy/strings.xml
index 55d6160..0d333b1 100644
--- a/core/res/res/values-hy/strings.xml
+++ b/core/res/res/values-hy/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Ձեր գտնվելու վայրում ծառայությունը ժամանակավորապես չի տրամադրվում բջջային ցանցի կողմից"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Ցանցն անհասանելի է"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Ազդանշանի ընդունման որակը բարելավելու համար փոխեք ցանցի տեսակը՝ անցնելով Համակարգ > Ցանց և ինտերնետ > Բջջային ցանցեր > Ցանկալի ցանցի տեսակը։"</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Ծանուցումներ"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Զանգի վերահասցեավորում"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Շտապ հետկանչի ռեժիմ"</string>
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index 98a4501..edf1147 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Untuk sementara tidak ditawarkan oleh jaringan seluler di lokasi Anda"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Tidak dapat menjangkau jaringan"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Untuk menyempurnakan penerimaan sinyal, coba ubah jenis yang dipilih di Setelan > Jaringan & Internet > Jaringan seluler > Jenis jaringan pilihan."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Panggilan Wi‑Fi aktif"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Panggilan darurat memerlukan jaringan seluler."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Notifikasi"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Penerusan panggilan"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Mode panggilan balik darurat"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Status data seluler"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"Pesan SMS"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Notifikasi pesan suara"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Panggilan Wi-Fi"</string>
diff --git a/core/res/res/values-is/strings.xml b/core/res/res/values-is/strings.xml
index 0a61d45..45cdc57 100644
--- a/core/res/res/values-is/strings.xml
+++ b/core/res/res/values-is/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Ekki í boði á farsímakerfinu á þínum stað eins og er"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Ekki næst samband við símkerfi"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Reyndu að breyta valinni gerð í Stillingar > Netkerfi og internet > Farsímakerfi > Valin símkerfistegund til að bæta móttökuskilyrðin."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Tilkynningar"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Símtalsflutningur"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Stilling fyrir svarhringingu neyðarsímtala"</string>
diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml
index 8e27e3a..2d71456 100644
--- a/core/res/res/values-it/strings.xml
+++ b/core/res/res/values-it/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Servizio temporaneamente non offerto dalla rete mobile nella tua località"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Impossibile raggiungere la rete"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Per migliorare la ricezione, prova a modificare il tipo selezionato in Impostazioni > Rete e Internet > Reti mobili > Tipo di rete preferito."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Avvisi"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Deviazione chiamate"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Modalità di richiamata di emergenza"</string>
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index 2a82871..2f62390 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -82,6 +82,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"הרשת הסלולרית במיקום הזה חסמה את השירות באופן זמני"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"לא ניתן להתחבר לרשת"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"כדי לשפר את הקליטה, כדאי לנסות לשנות את סוג הרשת ב\'הגדרות\' > \'רשת ואינטרנט\' > \'רשתות סלולריות\' > \'סוג רשת מועדף\'."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"התראות"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"העברת שיחות"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"מצב \'התקשרות חזרה בחירום\'"</string>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index fadcb25..bf6b50e 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"現在地のモバイル ネットワークでは一時的に提供されていません"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"ネットワークにアクセスできません"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"受信状態を改善するには、[設定] > [ネットワークとインターネット] > [モバイル ネットワーク] > [優先ネットワーク タイプ] で選択したタイプを変更してみてください。"</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Wi‑Fi 通話が有効な状態です"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"緊急通報にはモバイル ネットワークが必要です。"</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"通知"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"電話の転送"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"緊急通報待機モード"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"モバイルデータのステータス"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"SMS メッセージ"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"ボイスメール メッセージ"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi 通話"</string>
diff --git a/core/res/res/values-ka/strings.xml b/core/res/res/values-ka/strings.xml
index 80d408a..f03d503 100644
--- a/core/res/res/values-ka/strings.xml
+++ b/core/res/res/values-ka/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"დროებით არ არის შემოთავაზებული მობილური ქსელის მიერ თქვენს მდებარეობაზე"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"ქსელთან დაკავშირება ვერ ხერხდება"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"მიღების გასაუმჯობესებლად ცადეთ არჩეული ტიპის შეცვლა აქ: პარამეტრები > ქსელი და ინტერნეტი > მობილური ქსელები > ქსელის სასურველი ტიპი."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"აქტიურია Wi‑Fi დარეკვა"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"გადაუდებელი ზარები საჭიროებს მობილურ ქსელს."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"გაფრთხილებები"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"ზარის გადამისამართება"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"გადაუდებელი გადმორეკვის რეჟიმი"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"მობილური ინტერნეტის სტატუსი"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"SMS შეტყობინებები"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"ხმოვანი ფოსტის შეტყობინებები"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"დარეკვა Wi-Fi-ს მეშვეობით"</string>
diff --git a/core/res/res/values-kk/strings.xml b/core/res/res/values-kk/strings.xml
index e1eda27..9b53f18 100644
--- a/core/res/res/values-kk/strings.xml
+++ b/core/res/res/values-kk/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Орналасқан аймағыңызда мобильдік желі уақытша ұсынбады"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Желіге қосылу мүмкін емес"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Қабылдауды жақсарту үшін \"Параметрлер > Желі және интернет > Мобильді желілер және қалаулы желі түрі\" тармағынан түрді өзгертіп көріңіз."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Дабылдар"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Қоңырауды басқа нөмірге бағыттау"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Шұғыл кері қоңырау шалу режимі"</string>
diff --git a/core/res/res/values-km/strings.xml b/core/res/res/values-km/strings.xml
index cc68d19..bf58d05 100644
--- a/core/res/res/values-km/strings.xml
+++ b/core/res/res/values-km/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"មិនបានផ្តល់ជូនដោយបណ្តាញចល័តនៅទីកន្លែងរបស់អ្នកជាបណ្តោះអាសន្ន"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"មិនអាចភ្ជាប់ទៅបណ្តាញបានទេ"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"ដើម្បីធ្វើឲ្យការទទួលរលកសញ្ញាប្រសើរជាងមុន សូមសាកល្បងប្តូរប្រភេទដែលបានជ្រើសរើសនៅ ការកំណត់ > បណ្តាញ និងអ៊ីនធឺណិត > បណ្តាញទូរសព្ទចល័ត > ប្រភេទបណ្តាញដែលចង់ប្រើ។"</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"ការជូនដំណឹង"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"ការបញ្ជូនការហៅទូរសព្ទបន្ត"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"មុខងារហៅត្រឡប់វិញបន្ទាន់"</string>
diff --git a/core/res/res/values-kn/strings.xml b/core/res/res/values-kn/strings.xml
index ef3e63e..9e20a58 100644
--- a/core/res/res/values-kn/strings.xml
+++ b/core/res/res/values-kn/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"ತಾತ್ಕಾಲಿಕವಾಗಿ ಮೊಬೈಲ್ ನೆಟ್ವರ್ಕ್ನಿಂದ ನಿಮ್ಮ ಸ್ಥಳದಲ್ಲಿ ಒದಗಿಸುತ್ತಿಲ್ಲ"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"ನೆಟ್ವರ್ಕ್ ತಲುಪಲು ಸಾಧ್ಯವಿಲ್ಲ"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"ನೆಟ್ವರ್ಕ್ ಸಂಪರ್ಕ ಪಡೆಯುವುದನ್ನು ಸುಧಾರಿಸಲು, ಆಯ್ಕೆ ಮಾಡಿರುವ ವಿಧವನ್ನು ಸೆಟ್ಟಿಂಗ್ಗಳು > ನೆಟ್ವರ್ಕ್ ಮತ್ತು ಇಂಟರ್ನೆಟ್ > ಮೊಬೈಲ್ ನೆಟ್ವರ್ಕ್ಗಳು > ಆದ್ಯತೆಯ ನೆಟ್ವರ್ಕ್ ವಿಧದಲ್ಲಿ ಬದಲಿಸಿ ನೋಡಿ."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"ಎಚ್ಚರಿಕೆಗಳು"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"ಕರೆ ಫಾರ್ವರ್ಡ್ ಮಾಡುವಿಕೆ"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"ತುರ್ತು ಕಾಲ್ಬ್ಯಾಕ್ ಮೋಡ್"</string>
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index c68f99a..1a0aef2 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"현재 위치에서 모바일 네트워크가 서비스 제공을 일시적으로 중단했습니다."</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"네트워크에 연결할 수 없습니다."</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"수신 상태를 개선하려면 설정 > 네트워크 및 인터넷 > 모바일 네트워크 > 기본 네트워크 유형에서 선택된 유형을 변경해 보세요."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"알림"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"착신전환"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"긴급 콜백 모드"</string>
diff --git a/core/res/res/values-ky/strings.xml b/core/res/res/values-ky/strings.xml
index 2f38d22..a48b6bc 100644
--- a/core/res/res/values-ky/strings.xml
+++ b/core/res/res/values-ky/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Өзгөчө кырдаалдагы кызматтар сиз жайгашкан жердеги мобилдик тармак тарабынан убактылуу бөгөттөлгөн"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Тармакка туташпай жатат"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Кабыл алуу мүмкүнчүлүгүн жакшыртуу үчүн Жөндөөлөр > Тармак жана Интернет > Мобилдик тармактар > Тандалган тармак бөлүмүнөн тармактын түрүн өзгөртүп көрүңүз."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Wi‑Fi аркылуу чалуу жүрүп жатат"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Шашылыш чалуу үчүн мобилдик тармак талап кылынат."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Эскертүүлөр"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Чалууну башка номерге багыттоо"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Шашылыш кайра чалуу режими"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Мобилдик Интернеттин абалы"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"SMS билдирүүлөрү"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Үн почтасынын билдирүүлөрү"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi аркылуу чалуу"</string>
diff --git a/core/res/res/values-lo/strings.xml b/core/res/res/values-lo/strings.xml
index 72007c1..6f8ddac 100644
--- a/core/res/res/values-lo/strings.xml
+++ b/core/res/res/values-lo/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"ເຄືອຂ່າຍຂອງທ່ານບໍ່ໄດ້ໃຫ້ບໍລິການຢູ່ສະຖານທີ່ນີ້ເປັນການຊົ່ວຄາວ"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Can’t reach network"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"ເພື່ອປັບປຸງການຮັບສັນຍານ, ໃຫ້ລອງປ່ຽນປະເພດທີ່ເລືອກໄວ້ຢູ່ທີ່ ການຕັ້ງຄ່າ > ເຄືອຂ່າຍ ແລະ ອິນເຕີເນັດ > ເຄືອຂ່າຍມືຖື > ປະເພດເຄືອຂ່າຍທີ່ຕ້ອງການ."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"ການໂທ Wi‑Fi ເຮັດວຽກຢູ່"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"ການໂທສຸກເສີນຕ້ອງໃຊ້ການເຊື່ອມຕໍ່ເຄືອຂ່າຍ."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"ການເຕືອນ"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"ການໂອນສາຍ"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"ໂໝດໂທກັບສຸກເສີນ"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"ສະຖານະອິນເຕີເນັດມືຖື"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"ຂໍ້ຄວາມ SMS"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"ຂໍ້ຄວາມສຽງ"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"ການໂທ Wi-Fi"</string>
diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml
index 509a305..d2a8227 100644
--- a/core/res/res/values-lt/strings.xml
+++ b/core/res/res/values-lt/strings.xml
@@ -82,6 +82,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Laikinai nesiūloma mobiliojo ryšio tinkle jūsų vietovėje"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Nepavyko pasiekti tinklo"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Kad pagerintumėte ryšį, pabandykite pakeisti tipą, pasirinktą skiltyje „Nustatymai“ > „Tinklas ir internetas“ > „Mobiliojo ryšio tinklai“ > „Pageidaujamas tinklo tipas“."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Įspėjimai"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Skambučio peradresavimas"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Atskambinimo pagalbos numeriu režimas"</string>
diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml
index 0b0db25..2d4a808 100644
--- a/core/res/res/values-lv/strings.xml
+++ b/core/res/res/values-lv/strings.xml
@@ -81,6 +81,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Pagaidām netiek piedāvāts mobilajā tīklā jūsu atrašanās vietā"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Nevar sasniegt tīklu"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Lai uzlabotu uztveršanu, mainiet atlasīto veidu sadaļā Iestatījumi > Tīkls un internets > Mobilie tīkli > Ieteicamais tīkla veids."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Brīdinājumi"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Zvanu pāradresācija"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Ārkārtas atzvana režīms"</string>
diff --git a/core/res/res/values-mk/strings.xml b/core/res/res/values-mk/strings.xml
index d47aed0..cd92c46 100644
--- a/core/res/res/values-mk/strings.xml
+++ b/core/res/res/values-mk/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Привремено не се нуди од мобилната мрежа на вашата локација"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Не може да се дојде до мрежата"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"За подобрување на приемот, обидете се да го промените избраниот тип во „Поставки > Мрежа и интернет > Мобилни мрежи > Претпочитан тип мрежа“."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Предупредувања"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Проследување повик"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Режим на итен повратен повик"</string>
diff --git a/core/res/res/values-ml/strings.xml b/core/res/res/values-ml/strings.xml
index 908d8ea..1284e64 100644
--- a/core/res/res/values-ml/strings.xml
+++ b/core/res/res/values-ml/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"നിങ്ങളുടെ ലൊക്കേഷനിൽ മൊബൈൽ നെറ്റ്വര്ക്ക് താൽക്കാലികമായി ലഭ്യമല്ല"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"നെറ്റ്വർക്കിലേക്ക് കണക്റ്റുചെയ്യാനാവുന്നില്ല"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"സ്വീകരണം മെച്ചപ്പെടുത്തുന്നതിന് സിസ്റ്റം > നെറ്റ്വർക്കും ഇന്റെർനെറ്റും > മൊബൈൽ നെറ്റ്വർക്കുകൾ > തിരഞ്ഞെടുത്ത നെറ്റ്വർക്ക് തരം എന്നതിൽ തിരഞ്ഞെടുത്തിരിക്കുന്ന തരം മാറ്റിക്കൊണ്ട് ശ്രമിച്ചുനോക്കുക."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"അലേർട്ടുകൾ"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"കോൾ ഫോർവേഡിംഗ്"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"അടിയന്തര കോൾബാക്ക് മോഡ്"</string>
diff --git a/core/res/res/values-mn/strings.xml b/core/res/res/values-mn/strings.xml
index b11f4744..c00346c 100644
--- a/core/res/res/values-mn/strings.xml
+++ b/core/res/res/values-mn/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Таны байршилд таны мобайл сүлжээнээс түр хугацаанд блоклосон"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Сүлжээнд холбогдох боломжгүй байна"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Хүлээн авалтыг сайжруулахын тулд Тохиргоо > Сүлжээ & Интернэт > Мобайл сүлжээ > Сонгосон сүлжээний төрөл хэсгийг сонгон төрлөө өөрчилнө үү."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Сануулга"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Дуудлага шилжүүлэх"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Яаралтай дуудлага хийх горим"</string>
diff --git a/core/res/res/values-mr/strings.xml b/core/res/res/values-mr/strings.xml
index 8a392da..e99cb67 100644
--- a/core/res/res/values-mr/strings.xml
+++ b/core/res/res/values-mr/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"तुम्ही असलेल्या स्थानी मोबाइल नेटवर्क तात्पुरते उपलब्ध नाही"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"नेटवर्कवर पोहोचूू शकत नाही"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"रिसेप्शन सुधारण्यासाठी, सोटिंग्ज > नेटवर्क आणि इंटरनेट > मोबाइल नेटवर्क > प्राधान्य दिलेला नेटवर्क प्रकार बदलून पहा."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"अलर्ट"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"कॉल फॉरवर्डिंग"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"इमर्जन्सी कॉलबॅक मोड"</string>
diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml
index fda35fa..fb1b63b 100644
--- a/core/res/res/values-ms/strings.xml
+++ b/core/res/res/values-ms/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Tidak ditawarkan oleh rangkaian mudah alih di lokasi anda untuk sementara waktu"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Tidak dapat mencapai rangkaian"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Untuk memperbaik penerimaan, cuba tukar jenis rangkaian yang dipilih di Tetapan > Rangkaian & Internet > Rangkaian mudah alih > Jenis rangkaian pilihan."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Panggilan Wi-Fi aktif"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Rangkaian mudah alih diperlukan untuk membuat panggilan kecemasan."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Makluman"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Pemajuan panggilan"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Mod paggil balik kecemasan"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Status data mudah alih"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"Mesej SMS"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Mesej mel suara"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Panggilan Wi-Fi"</string>
diff --git a/core/res/res/values-my/strings.xml b/core/res/res/values-my/strings.xml
index 60c3d7b..22a3d4f 100644
--- a/core/res/res/values-my/strings.xml
+++ b/core/res/res/values-my/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"သင်၏ ဒေသတွင် မိုဘိုင်းကွန်ရက် ယာယီမရရှိနိုင်ပါ"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"ကွန်ရက်ကို ချိတ်ဆက်၍မရပါ"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"လိုင်းဖမ်းယူမှု ကောင်းမွန်စေရန် ဆက်တင်များ > ကွန်ရက်နှင့် အင်တာနက် > မိုဘိုင်းကွန်ရက်များ > အသုံးပြုလိုသည့် ကွန်ရက်အမျိုးအစားတွင် ရွေးချယ်ထားသည့် အမျိုးအစားကို ပြောင်းကြည့်ပါ။"</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Wi‑Fi ခေါ်ဆိုမှုကို အသုံးပြုနေပါသည်"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"အရေးပေါ်ဖုန်းခေါ်ဆိုရန် မိုဘိုင်းကွန်ရက်ကို လိုအပ်သည်။"</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"သတိပေးချက်များ"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"အဝင်ခေါ်ဆိုမှုအား ထပ်ဆင့်ပို့ခြင်း"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"အရေးပေါ် ပြန်လည်ခေါ်ဆိုနိုင်သောမုဒ်"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"မိုဘိုင်းဒေတာ အခြေအနေ"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"SMS မက်ဆေ့ဂျ်များ"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"အသံမေးလ် မက်ဆေ့ဂျ်များ"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi ခေါ်ဆိုမှု"</string>
diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml
index 66a8b46..3910fae 100644
--- a/core/res/res/values-nb/strings.xml
+++ b/core/res/res/values-nb/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Tilbys midlertidig ikke gjennom mobilnettverket der du er"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Får ikke kontakt med nettverket"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"For å forbedre signalet, prøv å endre valgt nettverkstype i Innstillinger > Nettverk og Internett > Mobilnettverk > Foretrukket nettverkstype."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Varsler"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Viderekobling"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Modusen nødsamtale-tilbakeringing"</string>
diff --git a/core/res/res/values-ne/strings.xml b/core/res/res/values-ne/strings.xml
index f512d09..5ff2ad0 100644
--- a/core/res/res/values-ne/strings.xml
+++ b/core/res/res/values-ne/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"तपाईंको स्थानमा सञ्चालन भइरहेको मोबाइल नेटवर्कले अस्थायी रूपमा यो सुविधा प्रदान गर्दैन"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"नेटवर्कमाथि पहुँच राख्न सकिँदैन"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"रिसेप्सनमा सुधार गर्न प्रणालीहरू > नेटवर्क तथा इन्टरनेट > मोबाइल नेटवर्कहरू > रुचाइएको नेटवर्कको प्रकारमा गई चयन गरिएको प्रकार परिवर्तन गरी हेर्नुहोस्।"</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"अलर्टहरू"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"कल फर्वार्ड गर्ने सेवा"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"आपतकालीन कलब्याक मोड"</string>
diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml
index f592e65..515aad6 100644
--- a/core/res/res/values-nl/strings.xml
+++ b/core/res/res/values-nl/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Tijdelijk niet aangeboden door het mobiele netwerk op je locatie"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Kan netwerk niet bereiken"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Als je de ontvangst wilt verbeteren, kun je het netwerktype wijzigen dat is geselecteerd bij Instellingen > Netwerk en internet > Mobiele netwerken > Voorkeursnetwerktype."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Bellen via wifi is actief"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Voor noodoproepen is een mobiel netwerk vereist."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Meldingen"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Oproep doorschakelen"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Modus voor noodoproepen"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Status van mobiele data"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"Sms\'jes"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Voicemailberichten"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Bellen via wifi"</string>
diff --git a/core/res/res/values-pa/strings.xml b/core/res/res/values-pa/strings.xml
index 58a9d08..553ef62 100644
--- a/core/res/res/values-pa/strings.xml
+++ b/core/res/res/values-pa/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"ਤੁਹਾਡੇ ਟਿਕਾਣੇ \'ਤੇ ਅਸਥਾਈ ਤੌਰ \'ਤੇ ਮੋਬਾਈਲ ਨੈੱਟਵਰਕ ਵੱਲੋਂ ਉਪਲਬਧ ਨਹੀਂ ਕਰਵਾਈ ਗਈ"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"ਨੈੱਟਵਰਕ ਤੱਕ ਪਹੁੰਚ ਨਹੀਂ ਕੀਤੀ ਜਾ ਸਕਦੀ"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"ਸਿਗਨਲ ਪ੍ਰਾਪਤੀ ਨੂੰ ਬਿਹਤਰ ਬਣਾਉਣ ਲਈ, ਸੈਟਿੰਗਾਂ > ਨੈੱਟਵਰਕ ਅਤੇ ਇੰਟਰਨੈੱਟ > ਮੋਬਾਈਲ ਨੈੱਟਵਰਕ > ਤਰਜੀਹੀ ਨੈੱਟਵਰਕ ਦੀ ਕਿਸਮ \'ਤੇ ਜਾਓ ਅਤੇ ਚੁਣੀ ਗਈ ਕਿਸਮ ਨੂੰ ਬਦਲਣ ਦੀ ਕੋਸ਼ਿਸ਼ ਕਰੋ।"</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"ਸੁਚੇਤਨਾਵਾਂ"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"ਕਾਲ ਫਾਰਵਾਰਡਿੰਗ"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"ਸੰਕਟਕਾਲੀਨ ਕਾਲਬੈਕ ਮੋਡ"</string>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index 0df5f06..0395dcb 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -82,6 +82,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Usługa tymczasowo nieoferowana przez sieć komórkową w Twojej lokalizacji"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Brak zasięgu sieci"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Aby poprawić odbiór, zmień typ sieci: wybierz Ustawienia > Sieć i internet > Sieci komórkowe > Preferowany typ sieci."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Alerty"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Przekierowanie połączeń"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Tryb alarmowego połączenia zwrotnego"</string>
diff --git a/core/res/res/values-pt-rBR/strings.xml b/core/res/res/values-pt-rBR/strings.xml
index 047cbbd..d25fa52 100644
--- a/core/res/res/values-pt-rBR/strings.xml
+++ b/core/res/res/values-pt-rBR/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Serviço temporariamente bloqueado pela rede móvel no seu local"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Não foi possível acessar a rede"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Para melhorar a recepção, tente alterar o tipo selecionado em Configurações > Rede & Internet > Redes móveis > Tipo de rede preferencial."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"A chamada no Wi‑Fi está ativa"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"As chamadas de emergência exigem uma rede móvel."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Alertas"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Encaminhamento de chamada"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Modo de retorno de chamada de emergência"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Status dos dados móveis"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"Mensagens SMS"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Mensagens do correio de voz"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Chamadas por Wi-Fi"</string>
diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml
index 90d3654..3a4ae28 100644
--- a/core/res/res/values-pt-rPT/strings.xml
+++ b/core/res/res/values-pt-rPT/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Serviço temporariamente não disponibilizado pela rede móvel na sua localização"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Não é possível ligar à rede"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Para melhorar a receção, experimente alterar o tipo selecionado em Definições > Rede e Internet > Redes móveis > Tipo de rede preferido."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Alertas"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Reencaminhamento de chamadas"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Modo de chamada de retorno de emergência"</string>
diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml
index 047cbbd..d25fa52 100644
--- a/core/res/res/values-pt/strings.xml
+++ b/core/res/res/values-pt/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Serviço temporariamente bloqueado pela rede móvel no seu local"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Não foi possível acessar a rede"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Para melhorar a recepção, tente alterar o tipo selecionado em Configurações > Rede & Internet > Redes móveis > Tipo de rede preferencial."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"A chamada no Wi‑Fi está ativa"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"As chamadas de emergência exigem uma rede móvel."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Alertas"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Encaminhamento de chamada"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Modo de retorno de chamada de emergência"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Status dos dados móveis"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"Mensagens SMS"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Mensagens do correio de voz"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Chamadas por Wi-Fi"</string>
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index dbf8348..fef67cc 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -81,11 +81,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Momentan nu este oferit de rețeaua mobilă în locația dvs."</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Nu se poate stabili conexiunea la rețea"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Pentru o recepție mai bună, încercați să schimbați tipul selectat în Setări > Rețea și internet > Rețele mobile > Tip preferat de rețea."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Apelarea prin Wi-Fi este activă"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Apelurile de urgență necesită o rețea mobilă."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Alerte"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Redirecționarea apelurilor"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Mod de apelare inversă de urgență"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Starea datelor mobile"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"Mesaje SMS"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Mesaje din mesageria vocală"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Apelare prin Wi-Fi"</string>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index a092fc9..c79127a 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -82,6 +82,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Местная мобильная сеть временно не поддерживает эту функцию."</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Сеть недоступна"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Чтобы улучшить сигнал, попробуйте выбрать другой тип сети в настройках (раздел \"Мобильные сети\")."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Оповещения"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Переадресация вызовов"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Режим экстренных обратных вызовов"</string>
diff --git a/core/res/res/values-si/strings.xml b/core/res/res/values-si/strings.xml
index d0a404e..c8efd00 100644
--- a/core/res/res/values-si/strings.xml
+++ b/core/res/res/values-si/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"ඔබේ ස්ථානයේ ජංගම ජාලය මගින් තාවකාලිකව පිරිනොනමයි"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"ජාලය වෙත ළඟා විය නොහැකිය"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"ප්රතිග්රහණය වැඩි දියුණු කිරීමට, සැකසීම් > ජාලය සහ අන්තර්ජාලය > ජංගම ජාල > වඩා කැමති ජාල වර්ගය තුළ තෝරන ලද වර්ගය වෙනස් කිරීම උත්සාහ කරන්න."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"ඇඟවීම්"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"ඇමතුම ප්රතියොමු කිරීම"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"හදිසි අවස්ථා පසු ඇමතුම් ප්රකාරය"</string>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index a11f494..d4632e9 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -82,6 +82,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Momentálne nie sú v ponuke mobilnej siete na vašom mieste"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Nepodarilo sa pripojiť k sieti"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Ak chcete vylepšiť príjem, skúste zmeniť vybraný typ v časti Nastavenia > Sieť a internet > Mobilné siete > Preferovaný typ siete."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Upozornenia"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Presmerovanie hovorov"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Režim tiesňového spätného volania"</string>
diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml
index 6689713..6ba8721 100644
--- a/core/res/res/values-sl/strings.xml
+++ b/core/res/res/values-sl/strings.xml
@@ -82,6 +82,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Ta storitev trenutno ni na voljo v mobilnem omrežju na vaši lokaciji"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Povezave z omrežjem ni mogoče vzpostaviti"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Če želite izboljšati sprejem, poskusite zamenjati vrsto omrežja v »Nastavitve« > »Omrežje in internet« > »Mobilna omrežja« > »Prednostna vrsta omrežja«."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Opozorila"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Preusmerjanje klicev"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Način za povratni klic v sili"</string>
diff --git a/core/res/res/values-sq/strings.xml b/core/res/res/values-sq/strings.xml
index d271c5c..ca27780 100644
--- a/core/res/res/values-sq/strings.xml
+++ b/core/res/res/values-sq/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Përkohësisht nuk ofrohet nga rrjeti celular në vendndodhjen tënde"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Rrjeti i paarritshëm"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Për të përmirësuar marrjen e sinjalit, provo të ndryshosh llojin e zgjedhur te Cilësimet > Rrjeti dhe interneti > Lloji i preferuar i rrjetit."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Sinjalizimet"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Transferimi i telefonatave"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Modaliteti i \"Kthimit të telefonatës së urgjencës\""</string>
diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml
index a89719a..bbd9dba 100644
--- a/core/res/res/values-sr/strings.xml
+++ b/core/res/res/values-sr/strings.xml
@@ -81,6 +81,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Привремено је онемогућено на мобилној мрежи на вашој локацији"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Повезивање са мрежом није успело"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Да бисте побољшали пријем, пробајте да промените изабрани тип у одељку Подешавања > Мрежа и интернет > Мобилне мреже > Жељени тип мреже."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Обавештења"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Преусмеравање позива"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Режим за хитан повратни позив"</string>
diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml
index e5615df..5880152 100644
--- a/core/res/res/values-sv/strings.xml
+++ b/core/res/res/values-sv/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Detta erbjuds för tillfället inte på mobilnätverket där du befinner dig"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Det går inte att nå nätverket"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Testa om du får bättre mottagning genom att ändra till en annan typ under Inställningar > Nätverk och internet > Mobila nätverk > Önskad nätverkstyp."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Wi-Fi-samtal är aktiverat"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Mobilnätverk krävs för att ringa nödsamtal."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Aviseringar"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Vidarekoppla samtal"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Läget Återuppringning vid nödsamtal"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Status för mobildata"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"Sms"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Röstmeddelanden"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi-samtal"</string>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index 8216343..b71c794 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Kwa sasa, huduma hii haipatikani katika mtandao wa simu mahali ulipo"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Haiwezi kufikia mtandao"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Ili kupata mtandao thabiti, jaribu kubadilisha aina uliyochagua katika Mipangilio > Mtandao na Intaneti > Mitandao ya simu > Aina ya mtandao unaopendelea."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Umewasha kipengele cha kupiga simu kupitia Wi‑Fi"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Huduma ya kupiga simu za dharura inahitaji mtandao wa simu."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Arifa"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Kupeleka simu kwenye nambari nyingine"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Hali ya kupiga simu za dharura"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Hali ya data ya mtandao wa simu"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"Ujumbe wa SMS"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Ujumbe wa sauti"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Kupiga simu kupitia Wi-Fi"</string>
diff --git a/core/res/res/values-ta/strings.xml b/core/res/res/values-ta/strings.xml
index 7b81bf9..a33ffb5 100644
--- a/core/res/res/values-ta/strings.xml
+++ b/core/res/res/values-ta/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"தற்காலிகமாக உங்கள் இருப்பிடத்தில் மொபைல் நெட்வொர்க் வழங்கவில்லை"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"நெட்வொர்க்குடன் இணைக்க முடியவில்லை"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"பெறுதலை மேம்படுத்த, அமைப்புகள் > நெட்வொர்க் & இணையம் > மொபைல் நெட்வொர்க்குகள் > விரும்பும் நெட்வொர்க் வகை என்பதற்குச் சென்று, தேர்ந்தெடுத்த வகையை மாற்றவும்."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"விழிப்பூட்டல்கள்"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"அழைப்புப் பகிர்வு"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"அவசரகாலத் திரும்ப அழைக்கும் பயன்முறை"</string>
diff --git a/core/res/res/values-te/strings.xml b/core/res/res/values-te/strings.xml
index 452fb84..e930079 100644
--- a/core/res/res/values-te/strings.xml
+++ b/core/res/res/values-te/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"మీ స్థానంలో మొబైల్ నెట్వర్క్ ద్వారా తాత్కాలికంగా అందించబడదు"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"నెట్వర్క్ను చేరుకోలేరు"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"స్వీకరణను మెరుగుపరచాలంటే, సెట్టింగ్లు > నెట్వర్క్ & ఇంటర్నెట్ > మొబైల్ నెట్వర్క్లు > ప్రాధాన్య నెట్వర్క్ రకంలో మీరు ఎంచుకున్న రకాన్ని మార్చి ప్రయత్నించండి."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"హెచ్చరికలు"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"కాల్ ఫార్వార్డింగ్"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"అత్యవసర కాల్బ్యాక్ మోడ్"</string>
diff --git a/core/res/res/values-television/config.xml b/core/res/res/values-television/config.xml
index d62b93e..cf67abf 100644
--- a/core/res/res/values-television/config.xml
+++ b/core/res/res/values-television/config.xml
@@ -39,4 +39,7 @@
<!-- Whether the device uses the default focus highlight when focus state isn't specified. -->
<bool name="config_useDefaultFocusHighlight">false</bool>
+
+ <!-- Allow SystemUI to show the shutdown dialog -->
+ <bool name="config_showSysuiShutdown">false</bool>
</resources>
diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml
index 2086322..377ddb0 100644
--- a/core/res/res/values-th/strings.xml
+++ b/core/res/res/values-th/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"งดให้บริการชั่วคราวโดยเครือข่ายมือถือในตำแหน่งของคุณ"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"เข้าถึงเครือข่ายไม่ได้"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"ลองเปลี่ยนประเภทที่เลือกใน \"การตั้งค่า\" > \"เครือข่ายและอินเทอร์เน็ต\" > \"เครือข่ายมือถือ\" > \"ประเภทเครือข่ายที่ต้องการ\" เพื่อให้การรับสัญญาณดีขึ้น"</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"การแจ้งเตือน"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"การโอนสาย"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"โหมดติดต่อกลับฉุกเฉิน"</string>
diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml
index 8e16cd0..977b855 100644
--- a/core/res/res/values-tl/strings.xml
+++ b/core/res/res/values-tl/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Pansamantalang hindi inaalok ng mobile network sa iyong lokasyon"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Hindi maabot ang network"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Upang mapahusay ang reception, subukang baguhin ang uring napili sa Mga Setting > Network at Internet > Mga mobile network > Gustong uri ng network."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Mga Alerto"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Pagpasa ng tawag"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Emergency callback mode"</string>
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index 0ff59db..f7a11eb 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Bulunduğunuz yerdeki mobil ağ tarafından geçici olarak sunulmuyor"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Ağa erişilemiyor"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Sinyal gücünü iyileştirmek için Ayarlar > Ağ ve İnternet > Mobil ağlar > Tercih edilen ağ türü bölümünde seçili türü değiştirmeyi deneyin."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Kablosuz çağrı etkin"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Acil durum çağrıları için mobil ağ gereklidir."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Uyarılar"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Çağrı yönlendirme"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Acil geri arama modu"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Mobil veri durumu"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"SMS mesajları"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Sesli mesajlar"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Kablosuz çağrı"</string>
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index f43b4b5..6481948 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -82,11 +82,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Тимчасово не пропонується мобільною мережею у вашому місцезнаходженні"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Не вдається під’єднатися до мережі"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Щоб покращити прийняття сигналу, змініть тип у меню \"Налаштування\" > \"Мережа й Інтернет\" > \"Мобільні мережі\" > \"Тип мережі\"."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Виклики через Wi-Fi активовано"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Щоб здійснювати екстрені виклики, потрібне з’єднання з мобільною мережею."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Сповіщення"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Переадресація виклику"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Режим екстреного зворотного виклику"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Статус мобільного передавання даних"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"SMS-повідомлення"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Повідомлення голосової пошти"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Дзвінки через Wi-Fi"</string>
diff --git a/core/res/res/values-ur/strings.xml b/core/res/res/values-ur/strings.xml
index 41ba781..3247478 100644
--- a/core/res/res/values-ur/strings.xml
+++ b/core/res/res/values-ur/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"عارضی طور پر آپ کے مقام پر موبائل نیٹ ورک کی طرف سے پیش نہیں ہے"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"نیٹ ورک تک نہیں پہنچا جا سکتا"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"ریسپشن کو بہتر بنانے کیلئے، ترتیبات > نیٹ ورک اور انٹرنیٹ > موبائل نیٹ ورکس > ترجیحی نیٹ ورک کی قسم تبدیل کرنے کی کوشش کریں۔"</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"الرٹس"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"کال آگے منتقل کرنا"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"ہنگامی کال بیک وضع"</string>
diff --git a/core/res/res/values-uz/strings.xml b/core/res/res/values-uz/strings.xml
index 012d0e9..70b2e16 100644
--- a/core/res/res/values-uz/strings.xml
+++ b/core/res/res/values-uz/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Hududingizda mobil tarmoq tomonidan vaqtinchalik taklif etilmayapti"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Tarmoq bilan bog‘lanib bo‘lmadi"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Qabul qilish sifatini yaxshilash uchun Sozlamalar > Tarmoq va Internet > Mobil tarmoqlar > Asosiy tarmoq turi orqali o‘zgartirib ko‘ring."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Wi‑Fi chaqiruv faol"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Favqulodda chaqiruvlar uchun mobil internet zarur."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Ogohlantirishlar"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Chaqiruvlarni uzatish"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Favqulodda qaytarib chaqirish rejimi"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Mobil internet holati"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"SMS xabarlar"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Ovozli xabarlar"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Wi-Fi chaqiruv"</string>
diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml
index 07a5c8c..2a92793 100644
--- a/core/res/res/values-vi/strings.xml
+++ b/core/res/res/values-vi/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Tạm thời không được cung cấp bởi mạng di động tại vị trí của bạn"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Không thể kết nối mạng"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Để cải thiện khả năng thu tín hiệu, hãy thử thay đổi loại mạng được chọn trong Cài đặt > Mạng và Internet > Mạng di động > Loại mạng ưa thích."</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Thông báo"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Chuyển tiếp cuộc gọi"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Chế độ gọi lại khẩn cấp"</string>
diff --git a/core/res/res/values-watch/colors_device_defaults.xml b/core/res/res/values-watch/colors_device_defaults.xml
index 15786b4..654e92c 100644
--- a/core/res/res/values-watch/colors_device_defaults.xml
+++ b/core/res/res/values-watch/colors_device_defaults.xml
@@ -17,8 +17,87 @@
<!-- Colors specific to DeviceDefault themes. These are mostly pass-throughs to enable
overlaying new theme colors. -->
<resources>
+
+ <!--
+ primary_device_default_dark
+ > from values/colors_material/primary_material_dark
+ > from values/colors_material/material_grey_900
+ = #ff212121
+ ! replaced with custom color #33ffffff
+ -->
+ <color name="primary_device_default_dark">#33ffffff</color>
+ <!--
+ primary_dark_device_default_dark
+ > from values/colors_material/primary_dark_material_dark
+ = @color/black
+ -->
+ <color name="primary_dark_device_default_dark">@color/black</color>
+ <!--
+ accent_device_default_dark
+ > from values/colors_material/accent_material_dark
+ > from values/colors_material/material_deep_teal_200
+ = #ff80cbc4
+ ! replaced with custom color #5E97F6
+ -->
+ <color name="accent_device_default_dark">#5E97F6</color>
+ <!--
+ background_device_default_dark
+ > from values/colors_material/background_material_dark
+ > from values/colors_material/material_grey_850
+ = #ff303030
+ ! replaced with custom color #232E33
+ -->
+ <color name="background_device_default_dark">#232E33</color>
+ <!--
+ background_floating_device_default_dark
+ > from values/colors_material/background_floating_material_dark
+ > from values/colors_material/material_grey_800
+ = #ff424242
+ ! replaced with custom color #3E5059
+ -->
+ <color name="background_floating_device_default_dark">#3E5059</color>
+
+ <!--
+ background_cache_hint_selector_device_default
+ - note that this is based off of colors/background_cache_hint_selector_device_default
+ xml drawable
+ - uses ?attr/colorBackground and transparency to draw
+ - no color customization required here
+ -->
+
+ <!--
+ button_normal_device_default_dark
+ - uses ?attr/disabledAlpha and button_material_dark to draw
+ - cloned to watch_btn_default.xml drawable
+ (btn_default_material_dark & button_material_dark - see
+ values-watch/colors_material.xml)
+ -->
<color name="button_normal_device_default_dark">@color/btn_default_material_dark</color>
+
<!-- Use the same value as for accent_device_default_dark but start with #99,
i.e. 60% opacity -->
<color name="accent_device_default_dark_60_percent_opacity">#995E97f6</color>
+
+ <!--
+ foreground_device_default_dark
+ - introduced to avoid coupling to foreground_material_dark
+ - colorForeground typically falls through Theme.DeviceDefault to Theme.Material
+ -->
+ <color name="foreground_device_default_dark">@color/white</color>
+
+ <!--
+ error_color_device_default_dark
+ - introduced to avoid coupling to error_color_material (also #F4511E)
+ - colorError typically falls through Theme.DeviceDefault to Theme.Material
+ -->
+ <color name="error_color_device_default_dark">#F4511E</color>
+
+ <!-- deprecated for Wear
+ these overrides exist only for compatibility with existing
+ WTS theme test heuristics, based on the previous modifications
+ to the material theme, they should not be used for customization
+ as they are not exposed via publicly accessible attributes -->
+ <color name="accent_device_default_700">#5385DB</color>
+ <color name="accent_device_default_light">#75A4F5</color>
+ <color name="accent_device_default_50">#93B7F5</color>
</resources>
diff --git a/core/res/res/values-watch/colors_material.xml b/core/res/res/values-watch/colors_material.xml
index 72f589b..b19820c 100644
--- a/core/res/res/values-watch/colors_material.xml
+++ b/core/res/res/values-watch/colors_material.xml
@@ -14,15 +14,8 @@
limitations under the License.
-->
<resources>
- <color name="background_material_dark">#232E33</color>
- <color name="background_floating_material_dark">#3E5059</color>
- <color name="accent_material_700">#5385DB</color>
- <color name="accent_material_light">#75A4F5</color>
- <color name="accent_material_dark">#5E97F6</color>
- <color name="accent_material_50">#93B7F5</color>
+ <!-- referenced in colors/watch_btn_default.xml selector -->
+ <color name="button_material_dark">#ff919699</color>
- <color name="primary_material_dark">#33ffffff</color>
-
- <color name="button_material_dark">#ff919699</color>
</resources>
diff --git a/core/res/res/values-watch/dimens_device_defaults.xml b/core/res/res/values-watch/dimens_device_defaults.xml
new file mode 100644
index 0000000..ac0fcb8
--- /dev/null
+++ b/core/res/res/values-watch/dimens_device_defaults.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+ <!-- Alpha transparency for wigets that set enablement/disablement programmatically
+ transparency is applied in the disabled state -->
+ <dimen name="disabled_alpha_device_default">0.5</dimen>
+ <!-- Alpha transparency applied to elements which are considered primary (e.g. primary text) -->
+ <dimen name="primary_content_alpha_device_default">1.0</dimen>
+ <!-- Alpha transparency applied to elements which are considered secondary (e.g. secondary text) -->
+ <dimen name="secondary_content_alpha_device_default">0.8</dimen>
+</resources>
diff --git a/core/res/res/values-watch/themes_device_defaults.xml b/core/res/res/values-watch/themes_device_defaults.xml
index 4d210f6..f6752c2 100644
--- a/core/res/res/values-watch/themes_device_defaults.xml
+++ b/core/res/res/values-watch/themes_device_defaults.xml
@@ -37,11 +37,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<!-- Variant of {@link #Theme_DeviceDefault} with no action bar -->
@@ -49,11 +54,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<!-- Variant of {@link #Theme_DeviceDefault} with no action bar and no status bar. This theme
@@ -62,11 +72,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<!-- Variant of {@link #Theme_DeviceDefault} with no action bar and no status bar and
@@ -77,11 +92,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<!-- Variant of {@link #Theme_DeviceDefault} that has no title bar and translucent
@@ -91,11 +111,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<!-- Theme used for the intent picker activity. -->
@@ -134,11 +159,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<!-- DeviceDefault theme for a window that should look like the Settings app. -->
@@ -156,11 +186,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<style name="Theme.DeviceDefault.Settings.CompactMenu" parent="Theme.Material.CompactMenu">
@@ -168,11 +203,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<!-- Variant of {@link #Theme_DeviceDefault_Dialog} that has a nice minimum width for a
@@ -182,11 +222,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<!-- Variant of {@link #Theme_DeviceDefault_Dialog} without an action bar -->
@@ -195,11 +240,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<!-- Variant of {@link #Theme_DeviceDefault_Dialog_NoActionBar} that has a nice minimum width
@@ -209,11 +259,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<!-- DeviceDefault theme for a window that will be displayed either full-screen on smaller
@@ -222,11 +277,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<!-- DeviceDefault theme for a window without an action bar that will be displayed either
@@ -236,11 +296,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<!-- DeviceDefault theme for a presentation window on a secondary display. -->
@@ -248,11 +313,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<!-- DeviceDefault theme for panel windows. This removes all extraneous window
@@ -262,11 +332,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<!-- DeviceDefault theme for windows that want to have the user's selected wallpaper appear
@@ -275,11 +350,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<!-- DeviceDefault theme for windows that want to have the user's selected wallpaper appear
@@ -288,11 +368,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<!-- DeviceDefault style for input methods, which is used by the
@@ -301,11 +386,16 @@
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<style name="Theme.DeviceDefault.Dialog.Alert" parent="Theme.Material.Dialog.Alert">
@@ -314,22 +404,32 @@
<!-- Color palette Dialog -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<style name="Theme.DeviceDefault.SearchBar" parent="Theme.Material.SearchBar">
<!-- Color palette Dark -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">@color/background_device_default_dark</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
<style name="Theme.DeviceDefault.Dialog.NoFrame" parent="Theme.Material.Dialog.NoFrame">
@@ -337,10 +437,15 @@
<!-- Color palette Dialog -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
<item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
+ <item name="colorForeground">@color/foreground_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
<item name="colorBackground">?attr/colorBackgroundFloating</item>
<item name="colorBackgroundFloating">@color/background_floating_device_default_dark</item>
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_device_default</item>
<item name="colorButtonNormal">@color/button_normal_device_default_dark</item>
+ <item name="colorError">@color/error_color_device_default_dark</item>
+ <item name="disabledAlpha">@dimen/disabled_alpha_device_default</item>
+ <item name="primaryContentAlpha">@dimen/primary_content_alpha_device_default</item>
+ <item name="secondaryContentAlpha">@dimen/secondary_content_alpha_device_default</item>
</style>
</resources>
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index 74f446c..6e951d3 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"您所在位置的移动网络暂时不提供这项服务"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"无法连接网络"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"要改善信号情况,请尝试更改在“设置”>“网络和互联网”>“移动网络”>“首选网络类型”中选择的类型。"</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"提醒"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"来电转接"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"紧急回拨模式"</string>
diff --git a/core/res/res/values-zh-rHK/strings.xml b/core/res/res/values-zh-rHK/strings.xml
index e636dbd..9e76764 100644
--- a/core/res/res/values-zh-rHK/strings.xml
+++ b/core/res/res/values-zh-rHK/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"您所在位置的流動網絡暫不提供這項服務"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"無法連接網絡"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"如要接收更強訊號,請前往 [設定] > [網絡與互聯網] > [流動網絡] > [偏好的網絡類型] 更改網絡類型。"</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"通知"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"來電轉駁"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"緊急回撥模式"</string>
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index 38be88c..2118e43 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -80,6 +80,10 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"你所在位置的行動網路暫時不提供這項服務"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"無法連上網路"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"如要改善收訊狀況,請依序開啟 [設定] > [網路與網際網路] > [行動網路] > [偏好的網路類型],然後選取其他網路類型。"</string>
+ <!-- no translation found for EmergencyCallWarningTitle (4790413876281901612) -->
+ <skip />
+ <!-- no translation found for EmergencyCallWarningSummary (8973232888021643293) -->
+ <skip />
<string name="notification_channel_network_alert" msgid="4427736684338074967">"快訊"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"來電轉接"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"緊急回撥模式"</string>
diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml
index 4dd496e..ba8a53b 100644
--- a/core/res/res/values-zu/strings.xml
+++ b/core/res/res/values-zu/strings.xml
@@ -80,11 +80,12 @@
<string name="RestrictedStateContent" msgid="4278821484643362350">"Okwesikhashana akunikezwa inethiwekhi yeselula endaweni yakho"</string>
<string name="NetworkPreferenceSwitchTitle" msgid="4008877505368566980">"Ayikwazi ukufinyelela inethiwekhi"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="1203771446683319957">"Ukuze uthuthukise ukwamukelwa, zama ukushintsha uhlobo olukhethiwe kuzilungiselelo > Inethiwekhi ne-inthanethi > amanethiwekhi eselula > Uhlobo oluncanyelwayo lwenethiwekhi."</string>
+ <string name="EmergencyCallWarningTitle" msgid="4790413876281901612">"Ukushaya kwe-Wi-Fi kuyasebenza"</string>
+ <string name="EmergencyCallWarningSummary" msgid="8973232888021643293">"Amakholi aphuthumayo adinga inethiwekhi yeselula."</string>
<string name="notification_channel_network_alert" msgid="4427736684338074967">"Izexwayiso"</string>
<string name="notification_channel_call_forward" msgid="2419697808481833249">"Ukudlulisa ikholi"</string>
<string name="notification_channel_emergency_callback" msgid="6686166232265733921">"Imodi yokushayela yesimo esiphuthumayo"</string>
- <!-- no translation found for notification_channel_mobile_data_status (4575131690860945836) -->
- <skip />
+ <string name="notification_channel_mobile_data_status" msgid="4575131690860945836">"Isimo sedatha yeselula"</string>
<string name="notification_channel_sms" msgid="3441746047346135073">"Imilayezo ye-SMS"</string>
<string name="notification_channel_voice_mail" msgid="3954099424160511919">"Imilayezo yevoyisimeyili"</string>
<string name="notification_channel_wfc" msgid="2130802501654254801">"Ukushaya kwe-Wi-Fi"</string>
diff --git a/core/res/res/values/arrays.xml b/core/res/res/values/arrays.xml
index 733878b..7b26cf2 100644
--- a/core/res/res/values/arrays.xml
+++ b/core/res/res/values/arrays.xml
@@ -47,6 +47,10 @@
<item>@drawable/ic_clear_material</item>
<item>@drawable/ic_dialog_alert_material</item>
<item>@drawable/ic_go_search_api_material</item>
+ <item>@drawable/ic_media_route_connecting_dark_material</item>
+ <item>@drawable/ic_media_route_connecting_light_material</item>
+ <item>@drawable/ic_media_route_dark_material</item>
+ <item>@drawable/ic_media_route_light_material</item>
<item>@drawable/ic_menu_copy_material</item>
<item>@drawable/ic_menu_cut_material</item>
<item>@drawable/ic_menu_moreoverflow_material</item>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 4b64e3f..961d639 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -3039,4 +3039,7 @@
<!-- Enable the RingtonePickerActivity in 'com.android.providers.media'. -->
<bool name="config_defaultRingtonePickerEnabled">true</bool>
+
+ <!-- Allow SystemUI to show the shutdown dialog -->
+ <bool name="config_showSysuiShutdown">true</bool>
</resources>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index e5b450c..6042234 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1306,10 +1306,8 @@
<java-symbol type="drawable" name="unlock_wave" />
<java-symbol type="drawable" name="notification_template_icon_bg" />
<java-symbol type="drawable" name="notification_template_icon_low_bg" />
- <java-symbol type="drawable" name="ic_media_route_on_holo_dark" />
<java-symbol type="drawable" name="ic_media_route_off_holo_dark" />
- <java-symbol type="drawable" name="ic_media_route_connecting_holo_dark" />
- <java-symbol type="drawable" name="ic_media_route_disabled_holo_dark" />
+ <java-symbol type="drawable" name="ic_media_route_off_holo_light" />
<java-symbol type="drawable" name="cling_button" />
<java-symbol type="drawable" name="cling_arrow_up" />
<java-symbol type="drawable" name="cling_bg" />
@@ -3061,4 +3059,5 @@
<java-symbol type="bool" name="config_showAreaUpdateInfoSettings" />
<java-symbol type="layout" name="shutdown_dialog" />
<java-symbol type="dimen" name="chooser_service_spacing" />
+ <java-symbol type="bool" name="config_showSysuiShutdown" />
</resources>
diff --git a/core/tests/coretests/src/android/database/DatabaseGeneralTest.java b/core/tests/coretests/src/android/database/DatabaseGeneralTest.java
index f97d51d..335cea7 100644
--- a/core/tests/coretests/src/android/database/DatabaseGeneralTest.java
+++ b/core/tests/coretests/src/android/database/DatabaseGeneralTest.java
@@ -1058,7 +1058,7 @@
mDatabase.close();
SQLiteDatabase.OpenParams params = new SQLiteDatabase.OpenParams.Builder()
.setLookasideConfig(0, 0).build();
- mDatabase = SQLiteDatabase.openDatabase(mDatabaseFile.getPath(), params);
+ mDatabase = SQLiteDatabase.openDatabase(mDatabaseFile, params);
verifyLookasideStats(true);
}
@@ -1193,7 +1193,7 @@
mDatabase.close();
SQLiteDatabase.OpenParams params = new SQLiteDatabase.OpenParams.Builder()
.setIdleConnectionTimeout(1000).build();
- mDatabase = SQLiteDatabase.openDatabase(mDatabaseFile.getPath(), params);
+ mDatabase = SQLiteDatabase.openDatabase(mDatabaseFile, params);
// Wait a bit and check that connection is still open
Thread.sleep(100);
String output = executeShellCommand("dumpsys dbinfo " + getContext().getPackageName());
diff --git a/core/tests/coretests/src/android/view/inputmethod/InputMethodSubtypeTest.java b/core/tests/coretests/src/android/view/inputmethod/InputMethodSubtypeTest.java
index 0adac4c..d203465 100644
--- a/core/tests/coretests/src/android/view/inputmethod/InputMethodSubtypeTest.java
+++ b/core/tests/coretests/src/android/view/inputmethod/InputMethodSubtypeTest.java
@@ -21,6 +21,7 @@
import android.test.suitebuilder.annotation.SmallTest;
import android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder;
+import java.util.Locale;
import java.util.Objects;
public class InputMethodSubtypeTest extends InstrumentationTestCase {
@@ -48,6 +49,38 @@
}
@SmallTest
+ public void testLocaleObj_locale() {
+ final InputMethodSubtype usSubtype = createDummySubtype("en_US");
+ Locale localeObject = usSubtype.getLocaleObject();
+ assertEquals("en", localeObject.getLanguage());
+ assertEquals("US", localeObject.getCountry());
+
+ // The locale object should be cached.
+ assertTrue(localeObject == usSubtype.getLocaleObject());
+ }
+
+ @SmallTest
+ public void testLocaleObj_languageTag() {
+ final InputMethodSubtype usSubtype = createDummySubtypeUsingLanguageTag("en-US");
+ Locale localeObject = usSubtype.getLocaleObject();
+ assertNotNull(localeObject);
+ assertEquals("en", localeObject.getLanguage());
+ assertEquals("US", localeObject.getCountry());
+
+ // The locale object should be cached.
+ assertTrue(localeObject == usSubtype.getLocaleObject());
+ }
+
+ @SmallTest
+ public void testLocaleObj_emptyLocale() {
+ final InputMethodSubtype emptyLocaleSubtype = createDummySubtype("");
+ assertNull(emptyLocaleSubtype.getLocaleObject());
+ // It should continue returning null when called multiple times.
+ assertNull(emptyLocaleSubtype.getLocaleObject());
+ assertNull(emptyLocaleSubtype.getLocaleObject());
+ }
+
+ @SmallTest
public void testLocaleString() throws Exception {
// The locale string in InputMethodSubtype has accepted an arbitrary text actually,
// regardless of the validity of the text as a locale string.
@@ -94,7 +127,7 @@
}
}
- private static final InputMethodSubtype createDummySubtype(final String locale) {
+ private static InputMethodSubtype createDummySubtype(final String locale) {
final InputMethodSubtypeBuilder builder = new InputMethodSubtypeBuilder();
return builder.setSubtypeNameResId(0)
.setSubtypeIconResId(0)
@@ -102,4 +135,14 @@
.setIsAsciiCapable(true)
.build();
}
-}
+
+ private static InputMethodSubtype createDummySubtypeUsingLanguageTag(
+ final String languageTag) {
+ final InputMethodSubtypeBuilder builder = new InputMethodSubtypeBuilder();
+ return builder.setSubtypeNameResId(0)
+ .setSubtypeIconResId(0)
+ .setLanguageTag(languageTag)
+ .setIsAsciiCapable(true)
+ .build();
+ }
+}
\ No newline at end of file
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsSensorTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsSensorTest.java
index 8fd4e31..0294095 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsSensorTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsSensorTest.java
@@ -488,7 +488,7 @@
bi.noteStartSensorLocked(UID, SENSOR_ID);
clocks.realtime += 111;
- clocks.uptime += 1111;
+ clocks.uptime += 111;
// Timebase and timer was on so times have increased.
assertEquals(111_000, timer.getTotalTimeLocked(1000*clocks.realtime, which));
diff --git a/data/etc/framework-sysconfig.xml b/data/etc/framework-sysconfig.xml
index 7fafef7..3a81c13 100644
--- a/data/etc/framework-sysconfig.xml
+++ b/data/etc/framework-sysconfig.xml
@@ -28,4 +28,6 @@
<backup-transport-whitelisted-service
service="android/com.android.internal.backup.LocalTransportService" />
+ <!-- Whitelist of bundled applications which all handle URLs to their websites by default -->
+ <app-link package="com.android.carrierdefaultapp" />
</config>
diff --git a/media/java/android/media/MediaMetadataRetriever.java b/media/java/android/media/MediaMetadataRetriever.java
index 6664456..4ea4e38 100644
--- a/media/java/android/media/MediaMetadataRetriever.java
+++ b/media/java/android/media/MediaMetadataRetriever.java
@@ -16,6 +16,7 @@
package android.media;
+import android.annotation.IntDef;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.AssetFileDescriptor;
@@ -27,6 +28,8 @@
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.util.Map;
@@ -249,7 +252,7 @@
* @return A Bitmap containing a representative video frame, which
* can be null, if such a frame cannot be retrieved.
*/
- public Bitmap getFrameAtTime(long timeUs, int option) {
+ public Bitmap getFrameAtTime(long timeUs, @Option int option) {
if (option < OPTION_PREVIOUS_SYNC ||
option > OPTION_CLOSEST) {
throw new IllegalArgumentException("Unsupported option: " + option);
@@ -286,27 +289,27 @@
* {@link #OPTION_CLOSEST} often has larger performance overhead compared
* to the other options if there is no sync frame located at timeUs.
*
- * @param dst_width expected output bitmap width
- * @param dst_height expected output bitmap height
- * @return A Bitmap of size not larger than dst_width by dst_height containing a
+ * @param dstWidth expected output bitmap width
+ * @param dstHeight expected output bitmap height
+ * @return A Bitmap of size not larger than dstWidth by dstHeight containing a
* scaled video frame, which can be null, if such a frame cannot be retrieved.
* @throws IllegalArgumentException if passed in invalid option or width by height
* is less than or equal to 0.
*/
public Bitmap getScaledFrameAtTime(
- long timeUs, int option, int dst_width, int dst_height) {
+ long timeUs, @Option int option, int dstWidth, int dstHeight) {
if (option < OPTION_PREVIOUS_SYNC ||
option > OPTION_CLOSEST) {
throw new IllegalArgumentException("Unsupported option: " + option);
}
- if (dst_width <= 0) {
- throw new IllegalArgumentException("Invalid width: " + dst_width);
+ if (dstWidth <= 0) {
+ throw new IllegalArgumentException("Invalid width: " + dstWidth);
}
- if (dst_height <= 0) {
- throw new IllegalArgumentException("Invalid height: " + dst_height);
+ if (dstHeight <= 0) {
+ throw new IllegalArgumentException("Invalid height: " + dstHeight);
}
- return _getFrameAtTime(timeUs, option, dst_width, dst_height);
+ return _getFrameAtTime(timeUs, option, dstWidth, dstHeight);
}
/**
@@ -427,6 +430,16 @@
*/
public static final int OPTION_CLOSEST = 0x03;
+ /** @hide */
+ @IntDef(flag = true, prefix = { "OPTION_" }, value = {
+ OPTION_PREVIOUS_SYNC,
+ OPTION_NEXT_SYNC,
+ OPTION_CLOSEST_SYNC,
+ OPTION_CLOSEST,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface Option {}
+
/*
* Do not change these metadata key values without updating their
* counterparts in include/media/mediametadataretriever.h!
diff --git a/packages/CarrierDefaultApp/AndroidManifest.xml b/packages/CarrierDefaultApp/AndroidManifest.xml
index c309133..1cd7b61 100644
--- a/packages/CarrierDefaultApp/AndroidManifest.xml
+++ b/packages/CarrierDefaultApp/AndroidManifest.xml
@@ -34,6 +34,7 @@
<intent-filter>
<action android:name="com.android.internal.telephony.CARRIER_SIGNAL_REDIRECTED" />
<action android:name="com.android.internal.telephony.CARRIER_SIGNAL_RESET" />
+ <action android:name="com.android.internal.telephony.CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE" />
<action android:name="android.intent.action.LOCALE_CHANGED" />
</intent-filter>
</receiver>
@@ -43,10 +44,24 @@
android:name="com.android.carrierdefaultapp.CaptivePortalLoginActivity"
android:label="@string/action_bar_label"
android:theme="@style/AppTheme"
- android:configChanges="keyboardHidden|orientation|screenSize" >
+ android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
+
+ <activity-alias
+ android:name="com.android.carrierdefaultapp.URLHandlerActivity"
+ android:targetActivity="com.android.carrierdefaultapp.CaptivePortalLoginActivity"
+ android:enabled="false" >
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW" />
+ <category android:name="android.intent.category.DEFAULT"/>
+ <category android:name="android.intent.category.BROWSABLE" />
+ <data android:scheme="http" />
+ <data android:scheme="https" />
+ <data android:host="*" />
+ </intent-filter>
+ </activity-alias>
</application>
</manifest>
diff --git a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java
index 6194b87..b0052cc 100644
--- a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java
+++ b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java
@@ -20,6 +20,9 @@
import android.app.LoadedApk;
import android.content.Context;
import android.content.Intent;
+import android.content.pm.ActivityInfo;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.net.ConnectivityManager;
import android.net.ConnectivityManager.NetworkCallback;
@@ -34,6 +37,7 @@
import android.telephony.CarrierConfigManager;
import android.telephony.Rlog;
import android.telephony.SubscriptionManager;
+import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.Log;
import android.util.TypedValue;
@@ -68,7 +72,7 @@
private static final boolean DBG = true;
private static final int SOCKET_TIMEOUT_MS = 10 * 1000;
- public static final int NETWORK_REQUEST_TIMEOUT_MS = 5 * 1000;
+ private static final int NETWORK_REQUEST_TIMEOUT_MS = 5 * 1000;
private URL mUrl;
private Network mNetwork;
@@ -188,16 +192,19 @@
CarrierActionUtils.applyCarrierAction(
CarrierActionUtils.CARRIER_ACTION_CANCEL_ALL_NOTIFICATIONS, getIntent(),
getApplicationContext());
-
+ CarrierActionUtils.applyCarrierAction(
+ CarrierActionUtils.CARRIER_ACTION_DISABLE_DEFAULT_URL_HANDLER, getIntent(),
+ getApplicationContext());
+ CarrierActionUtils.applyCarrierAction(
+ CarrierActionUtils.CARRIER_ACTION_DEREGISTER_DEFAULT_NETWORK_AVAIL, getIntent(),
+ getApplicationContext());
}
finishAndRemoveTask();
}
private URL getUrlForCaptivePortal() {
String url = getIntent().getStringExtra(TelephonyIntents.EXTRA_REDIRECTION_URL_KEY);
- if (url.isEmpty()) {
- url = mCm.getCaptivePortalServerUrl();
- }
+ if (TextUtils.isEmpty(url)) url = mCm.getCaptivePortalServerUrl();
final CarrierConfigManager configManager = getApplicationContext()
.getSystemService(CarrierConfigManager.class);
final int subId = getIntent().getIntExtra(PhoneConstants.SUBSCRIPTION_KEY,
@@ -437,6 +444,27 @@
}
}
+ /**
+ * This alias presents the target activity, CaptivePortalLoginActivity, as a independent
+ * entity with its own intent filter to handle URL links. This alias will be enabled/disabled
+ * dynamically to handle url links based on the network conditions.
+ */
+ public static String getAlias(Context context) {
+ try {
+ PackageInfo p = context.getPackageManager().getPackageInfo(context.getPackageName(),
+ PackageManager.GET_ACTIVITIES | PackageManager.MATCH_DISABLED_COMPONENTS);
+ for (ActivityInfo activityInfo : p.activities) {
+ String targetActivity = activityInfo.targetActivity;
+ if (CaptivePortalLoginActivity.class.getName().equals(targetActivity)) {
+ return activityInfo.name;
+ }
+ }
+ } catch (PackageManager.NameNotFoundException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
private static void logd(String s) {
Rlog.d(TAG, s);
}
diff --git a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CarrierActionUtils.java b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CarrierActionUtils.java
index 0213306..a2bf964 100644
--- a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CarrierActionUtils.java
+++ b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CarrierActionUtils.java
@@ -19,8 +19,10 @@
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
+import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
+import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.os.Bundle;
import android.telephony.SubscriptionManager;
@@ -49,6 +51,10 @@
public static final int CARRIER_ACTION_SHOW_PORTAL_NOTIFICATION = 4;
public static final int CARRIER_ACTION_SHOW_NO_DATA_SERVICE_NOTIFICATION = 5;
public static final int CARRIER_ACTION_CANCEL_ALL_NOTIFICATIONS = 6;
+ public static final int CARRIER_ACTION_ENABLE_DEFAULT_URL_HANDLER = 7;
+ public static final int CARRIER_ACTION_DISABLE_DEFAULT_URL_HANDLER = 8;
+ public static final int CARRIER_ACTION_REGISTER_DEFAULT_NETWORK_AVAIL = 9;
+ public static final int CARRIER_ACTION_DEREGISTER_DEFAULT_NETWORK_AVAIL = 10;
public static void applyCarrierAction(int actionIdx, Intent intent, Context context) {
switch (actionIdx) {
@@ -73,6 +79,18 @@
case CARRIER_ACTION_CANCEL_ALL_NOTIFICATIONS:
onCancelAllNotifications(context);
break;
+ case CARRIER_ACTION_ENABLE_DEFAULT_URL_HANDLER:
+ onEnableDefaultURLHandler(context);
+ break;
+ case CARRIER_ACTION_DISABLE_DEFAULT_URL_HANDLER:
+ onDisableDefaultURLHandler(context);
+ break;
+ case CARRIER_ACTION_REGISTER_DEFAULT_NETWORK_AVAIL:
+ onRegisterDefaultNetworkAvail(intent, context);
+ break;
+ case CARRIER_ACTION_DEREGISTER_DEFAULT_NETWORK_AVAIL:
+ onDeregisterDefaultNetworkAvail(intent, context);
+ break;
default:
loge("unsupported carrier action index: " + actionIdx);
}
@@ -94,6 +112,38 @@
telephonyMgr.carrierActionSetMeteredApnsEnabled(subId, ENABLE);
}
+ private static void onEnableDefaultURLHandler(Context context) {
+ logd("onEnableDefaultURLHandler");
+ final PackageManager pm = context.getPackageManager();
+ pm.setComponentEnabledSetting(
+ new ComponentName(context, CaptivePortalLoginActivity.getAlias(context)),
+ PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
+ }
+
+ private static void onDisableDefaultURLHandler(Context context) {
+ logd("onDisableDefaultURLHandler");
+ final PackageManager pm = context.getPackageManager();
+ pm.setComponentEnabledSetting(
+ new ComponentName(context, CaptivePortalLoginActivity.getAlias(context)),
+ PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
+ }
+
+ private static void onRegisterDefaultNetworkAvail(Intent intent, Context context) {
+ int subId = intent.getIntExtra(PhoneConstants.SUBSCRIPTION_KEY,
+ SubscriptionManager.getDefaultVoiceSubscriptionId());
+ logd("onRegisterDefaultNetworkAvail subId: " + subId);
+ final TelephonyManager telephonyMgr = context.getSystemService(TelephonyManager.class);
+ telephonyMgr.carrierActionReportDefaultNetworkStatus(subId, true);
+ }
+
+ private static void onDeregisterDefaultNetworkAvail(Intent intent, Context context) {
+ int subId = intent.getIntExtra(PhoneConstants.SUBSCRIPTION_KEY,
+ SubscriptionManager.getDefaultVoiceSubscriptionId());
+ logd("onDeregisterDefaultNetworkAvail subId: " + subId);
+ final TelephonyManager telephonyMgr = context.getSystemService(TelephonyManager.class);
+ telephonyMgr.carrierActionReportDefaultNetworkStatus(subId, false);
+ }
+
private static void onDisableRadio(Intent intent, Context context) {
int subId = intent.getIntExtra(PhoneConstants.SUBSCRIPTION_KEY,
SubscriptionManager.getDefaultVoiceSubscriptionId());
diff --git a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CustomConfigLoader.java b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CustomConfigLoader.java
index d5d0b79..02c61d7 100644
--- a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CustomConfigLoader.java
+++ b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CustomConfigLoader.java
@@ -22,7 +22,6 @@
import android.telephony.Rlog;
import android.text.TextUtils;
import android.util.Log;
-import android.util.Pair;
import com.android.internal.telephony.TelephonyIntents;
import com.android.internal.util.ArrayUtils;
@@ -95,6 +94,12 @@
configs = b.getStringArray(CarrierConfigManager
.KEY_CARRIER_DEFAULT_ACTIONS_ON_RESET);
break;
+ case TelephonyIntents.ACTION_CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE:
+ configs = b.getStringArray(CarrierConfigManager
+ .KEY_CARRIER_DEFAULT_ACTIONS_ON_DEFAULT_NETWORK_AVAILABLE);
+ arg1 = String.valueOf(intent.getBooleanExtra(TelephonyIntents
+ .EXTRA_DEFAULT_NETWORK_AVAILABLE_KEY, false));
+ break;
default:
Rlog.e(TAG, "load carrier config failure with un-configured key: " +
intent.getAction());
diff --git a/packages/SettingsLib/res/values-af/strings.xml b/packages/SettingsLib/res/values-af/strings.xml
index 336d7d6..866aa0f 100644
--- a/packages/SettingsLib/res/values-af/strings.xml
+++ b/packages/SettingsLib/res/values-af/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Laai"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"laai tans"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Laai nie"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Laai nie"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Vol"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Beheer deur administrateur"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Geaktiveer deur administrateur"</string>
diff --git a/packages/SettingsLib/res/values-am/strings.xml b/packages/SettingsLib/res/values-am/strings.xml
index b7d4053..100a5b2 100644
--- a/packages/SettingsLib/res/values-am/strings.xml
+++ b/packages/SettingsLib/res/values-am/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"ኃይል በመሙላት ላይ"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"ኃይል በመሙላት ላይ"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"ባትሪ እየሞላ አይደለም"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"ኃይል እየሞላ አይደለም"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"ሙሉነው"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"በአስተዳዳሪ ቁጥጥር የተደረገበት"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"በአስተዳዳሪ ነቅቷል"</string>
diff --git a/packages/SettingsLib/res/values-ar/strings.xml b/packages/SettingsLib/res/values-ar/strings.xml
index 5ee4d0f..67d0a91 100644
--- a/packages/SettingsLib/res/values-ar/strings.xml
+++ b/packages/SettingsLib/res/values-ar/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"جارٍ الشحن"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"جارٍ الشحن"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"لا يتم الشحن"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"لا يتم الشحن"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"ممتلئة"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"إعدادات يتحكم فيها المشرف"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"تم تمكين الإعداد بواسطة المشرف"</string>
diff --git a/packages/SettingsLib/res/values-az/strings.xml b/packages/SettingsLib/res/values-az/strings.xml
index 4fff640..1732c87 100644
--- a/packages/SettingsLib/res/values-az/strings.xml
+++ b/packages/SettingsLib/res/values-az/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Enerji doldurma"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"enerji yığır"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Doldurulmur"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Enerji doldurulmur"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Tam"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Admin tərəfindən nəzarət olunur"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Admin tərəfindən aktiv edildi"</string>
diff --git a/packages/SettingsLib/res/values-b+sr+Latn/strings.xml b/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
index cae7fb0..3336164 100644
--- a/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
+++ b/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Punjenje"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"puni se"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Ne puni se"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Ne puni se"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Puno"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Kontroliše administrator"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Omogućio je administrator"</string>
diff --git a/packages/SettingsLib/res/values-be/strings.xml b/packages/SettingsLib/res/values-be/strings.xml
index 4ab35af..b50285f 100644
--- a/packages/SettingsLib/res/values-be/strings.xml
+++ b/packages/SettingsLib/res/values-be/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Зарадка"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"ідзе зарадка"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Не зараджаецца"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Не зараджаецца"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Поўная"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Кантралюецца адміністратарам"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Уключана адміністратарам"</string>
diff --git a/packages/SettingsLib/res/values-bg/strings.xml b/packages/SettingsLib/res/values-bg/strings.xml
index c75c99b..ef3f1f6 100644
--- a/packages/SettingsLib/res/values-bg/strings.xml
+++ b/packages/SettingsLib/res/values-bg/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Зарежда се"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"зарежда се"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Не се зарежда"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Не се зарежда"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Пълна"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Контролира се от администратор"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Активирано от администратора"</string>
diff --git a/packages/SettingsLib/res/values-bn/strings.xml b/packages/SettingsLib/res/values-bn/strings.xml
index 4f7d086..2cf2730 100644
--- a/packages/SettingsLib/res/values-bn/strings.xml
+++ b/packages/SettingsLib/res/values-bn/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"চার্জ হচ্ছে"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"চার্জ হচ্ছে"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"চার্জ হচ্ছে না"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"চার্জ হচ্ছে না"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"পূর্ণ"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"প্রশাসকের দ্বারা নিয়ন্ত্রিত"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"প্রশাসক দ্বারা সক্ষম করা হয়েছে"</string>
diff --git a/packages/SettingsLib/res/values-bs/strings.xml b/packages/SettingsLib/res/values-bs/strings.xml
index 49b060f..614bdb1 100644
--- a/packages/SettingsLib/res/values-bs/strings.xml
+++ b/packages/SettingsLib/res/values-bs/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Punjenje"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"punjenje"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Ne puni se"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Ne puni se"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Puna"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Pod kontrolom administratora"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Omogućio administrator"</string>
diff --git a/packages/SettingsLib/res/values-ca/strings.xml b/packages/SettingsLib/res/values-ca/strings.xml
index 90e0225..b2b2b1c 100644
--- a/packages/SettingsLib/res/values-ca/strings.xml
+++ b/packages/SettingsLib/res/values-ca/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"S\'està carregant"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"s\'està carregant"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"No s\'està carregant"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"No s\'està carregant"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Plena"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Controlat per l\'administrador"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Activada per l\'administrador"</string>
diff --git a/packages/SettingsLib/res/values-cs/strings.xml b/packages/SettingsLib/res/values-cs/strings.xml
index 275e332..fcb0b02 100644
--- a/packages/SettingsLib/res/values-cs/strings.xml
+++ b/packages/SettingsLib/res/values-cs/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Nabíjí se"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"nabíjení"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Nenabíjí se"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Nenabíjí se"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Nabitá"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Spravováno administrátorem"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Zapnuto administrátorem"</string>
diff --git a/packages/SettingsLib/res/values-da/strings.xml b/packages/SettingsLib/res/values-da/strings.xml
index ca684f4..1c40c52 100644
--- a/packages/SettingsLib/res/values-da/strings.xml
+++ b/packages/SettingsLib/res/values-da/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Oplader"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"oplader"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Oplader ikke"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Oplader ikke"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Fuld"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Kontrolleret af administratoren"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Aktiveret af administratoren"</string>
diff --git a/packages/SettingsLib/res/values-de/strings.xml b/packages/SettingsLib/res/values-de/strings.xml
index 1368049..8c0e727 100644
--- a/packages/SettingsLib/res/values-de/strings.xml
+++ b/packages/SettingsLib/res/values-de/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Wird aufgeladen"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"wird aufgeladen..."</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Wird nicht geladen"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Wird nicht geladen"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Voll"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Durch den Administrator verwaltet"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Vom Administrator aktiviert"</string>
diff --git a/packages/SettingsLib/res/values-el/strings.xml b/packages/SettingsLib/res/values-el/strings.xml
index dc8a208..46aa2c5 100644
--- a/packages/SettingsLib/res/values-el/strings.xml
+++ b/packages/SettingsLib/res/values-el/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Φόρτιση"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"φόρτιση"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Δεν φορτίζει"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Δεν φορτίζει"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Πλήρης"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Ελέγχονται από το διαχειριστή"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Ενεργοποιήθηκε από τον διαχειριστή"</string>
diff --git a/packages/SettingsLib/res/values-en-rAU/strings.xml b/packages/SettingsLib/res/values-en-rAU/strings.xml
index 7c78fa3..bbc1144 100644
--- a/packages/SettingsLib/res/values-en-rAU/strings.xml
+++ b/packages/SettingsLib/res/values-en-rAU/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Charging"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"charging"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Not charging"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Not charging"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Full"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Controlled by admin"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Enabled by admin"</string>
diff --git a/packages/SettingsLib/res/values-en-rGB/strings.xml b/packages/SettingsLib/res/values-en-rGB/strings.xml
index 7c78fa3..bbc1144 100644
--- a/packages/SettingsLib/res/values-en-rGB/strings.xml
+++ b/packages/SettingsLib/res/values-en-rGB/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Charging"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"charging"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Not charging"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Not charging"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Full"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Controlled by admin"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Enabled by admin"</string>
diff --git a/packages/SettingsLib/res/values-en-rIN/strings.xml b/packages/SettingsLib/res/values-en-rIN/strings.xml
index 7c78fa3..bbc1144 100644
--- a/packages/SettingsLib/res/values-en-rIN/strings.xml
+++ b/packages/SettingsLib/res/values-en-rIN/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Charging"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"charging"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Not charging"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Not charging"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Full"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Controlled by admin"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Enabled by admin"</string>
diff --git a/packages/SettingsLib/res/values-en-rXC/strings.xml b/packages/SettingsLib/res/values-en-rXC/strings.xml
index 0bc1cc4..6af9692 100644
--- a/packages/SettingsLib/res/values-en-rXC/strings.xml
+++ b/packages/SettingsLib/res/values-en-rXC/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Charging"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"charging"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Not charging"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Not charging"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Full"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Controlled by admin"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Enabled by admin"</string>
diff --git a/packages/SettingsLib/res/values-es-rUS/strings.xml b/packages/SettingsLib/res/values-es-rUS/strings.xml
index af8a469..8eff989 100644
--- a/packages/SettingsLib/res/values-es-rUS/strings.xml
+++ b/packages/SettingsLib/res/values-es-rUS/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Cargando"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"cargando"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"No se está cargando."</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"No se realiza la carga"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Cargado"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Controlada por el administrador"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"El administrador habilitó esta opción"</string>
diff --git a/packages/SettingsLib/res/values-es/strings.xml b/packages/SettingsLib/res/values-es/strings.xml
index 8fcca69..4ac4b27 100644
--- a/packages/SettingsLib/res/values-es/strings.xml
+++ b/packages/SettingsLib/res/values-es/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Cargando"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"cargando"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"No se está cargando"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"No se está cargando"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Completa"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Controlada por el administrador"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Habilitada por el administrador"</string>
diff --git a/packages/SettingsLib/res/values-et/strings.xml b/packages/SettingsLib/res/values-et/strings.xml
index 091175b..28a2a59 100644
--- a/packages/SettingsLib/res/values-et/strings.xml
+++ b/packages/SettingsLib/res/values-et/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Laadimine"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"laadimine"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Ei lae"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Ei lae"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Täis"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Juhib administraator"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Administraatori lubatud"</string>
diff --git a/packages/SettingsLib/res/values-eu/strings.xml b/packages/SettingsLib/res/values-eu/strings.xml
index d0bfc5a..4e19b99 100644
--- a/packages/SettingsLib/res/values-eu/strings.xml
+++ b/packages/SettingsLib/res/values-eu/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Kargatzen"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"kargatzen"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Ez da kargatzen ari"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Ez da kargatzen ari"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Beteta"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Administratzaileak kontrolatzen du"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Administratzaileak gaitu du"</string>
diff --git a/packages/SettingsLib/res/values-fa/strings.xml b/packages/SettingsLib/res/values-fa/strings.xml
index 44fb124..15facd8 100644
--- a/packages/SettingsLib/res/values-fa/strings.xml
+++ b/packages/SettingsLib/res/values-fa/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"در حال شارژ شدن"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"درحال شارژ شدن"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"شارژ نمیشود"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"شارژ نمیشود"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"پر"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"توسط سرپرست سیستم کنترل میشود"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"فعالشده توسط سرپرست"</string>
diff --git a/packages/SettingsLib/res/values-fi/strings.xml b/packages/SettingsLib/res/values-fi/strings.xml
index 12a6e92..59ba137 100644
--- a/packages/SettingsLib/res/values-fi/strings.xml
+++ b/packages/SettingsLib/res/values-fi/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Ladataan"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"ladataan"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Ei laturissa"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Ei laturissa"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Täynnä"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Järjestelmänvalvoja hallinnoi tätä asetusta."</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Järjestelmänvalvojan käyttöön ottama"</string>
diff --git a/packages/SettingsLib/res/values-fr-rCA/strings.xml b/packages/SettingsLib/res/values-fr-rCA/strings.xml
index 555716c..201984c 100644
--- a/packages/SettingsLib/res/values-fr-rCA/strings.xml
+++ b/packages/SettingsLib/res/values-fr-rCA/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Charge en cours…"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"en cours de charge"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"N\'est pas en charge"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"N\'est pas en charge"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Pleine"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Contrôlé par l\'administrateur"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Activé par l\'administrateur"</string>
diff --git a/packages/SettingsLib/res/values-fr/strings.xml b/packages/SettingsLib/res/values-fr/strings.xml
index b185071..281e957 100644
--- a/packages/SettingsLib/res/values-fr/strings.xml
+++ b/packages/SettingsLib/res/values-fr/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Batterie en charge"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"chargement…"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Pas en charge"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Débranchée"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"pleine"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Contrôlé par l\'administrateur"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Activé par l\'administrateur"</string>
diff --git a/packages/SettingsLib/res/values-gl/strings.xml b/packages/SettingsLib/res/values-gl/strings.xml
index 0db96f0..3311a5f 100644
--- a/packages/SettingsLib/res/values-gl/strings.xml
+++ b/packages/SettingsLib/res/values-gl/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Cargando"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"cargando"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Non se está cargando"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Non está cargando"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Completa"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Opción controlada polo administrador"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Activado polo administrador"</string>
diff --git a/packages/SettingsLib/res/values-gu/strings.xml b/packages/SettingsLib/res/values-gu/strings.xml
index a0dbcd7..b931fd1 100644
--- a/packages/SettingsLib/res/values-gu/strings.xml
+++ b/packages/SettingsLib/res/values-gu/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"ચાર્જ થઈ રહ્યું છે"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"ચાર્જ થઈ રહ્યું છે"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"ચાર્જ થઈ રહ્યું નથી"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"ચાર્જ થઈ રહ્યું નથી"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"પૂર્ણ"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"વ્યવસ્થાપક દ્વારા નિયંત્રિત"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"વ્યવસ્થાપકે સક્ષમ કરેલ"</string>
diff --git a/packages/SettingsLib/res/values-hi/strings.xml b/packages/SettingsLib/res/values-hi/strings.xml
index 12e8efe..b383b2e 100644
--- a/packages/SettingsLib/res/values-hi/strings.xml
+++ b/packages/SettingsLib/res/values-hi/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"चार्ज हो रही है"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"चार्ज किया जा रहा है"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"चार्ज नहीं हो रही है"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"चार्ज नहीं हो रही है"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"पूरी"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"व्यवस्थापक द्वारा नियंत्रित"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"व्यवस्थापक ने सक्षम किया है"</string>
diff --git a/packages/SettingsLib/res/values-hr/strings.xml b/packages/SettingsLib/res/values-hr/strings.xml
index 7f34dc9..0b86615 100644
--- a/packages/SettingsLib/res/values-hr/strings.xml
+++ b/packages/SettingsLib/res/values-hr/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Punjenje"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"punjenje"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Ne puni se"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Ne puni se"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Puna"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Kontrolira administrator"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Omogućio administrator"</string>
diff --git a/packages/SettingsLib/res/values-hu/strings.xml b/packages/SettingsLib/res/values-hu/strings.xml
index e46a50d..b6e55ec 100644
--- a/packages/SettingsLib/res/values-hu/strings.xml
+++ b/packages/SettingsLib/res/values-hu/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Töltés"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"töltés"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Nem tölt"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Nem töltődik"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Feltöltve"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Rendszergazda által irányítva"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"A rendszergazda bekapcsolta"</string>
diff --git a/packages/SettingsLib/res/values-hy/strings.xml b/packages/SettingsLib/res/values-hy/strings.xml
index cfe65f9..e44e387 100644
--- a/packages/SettingsLib/res/values-hy/strings.xml
+++ b/packages/SettingsLib/res/values-hy/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Լիցքավորում"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"լիցքավորում"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Չի լիցքավորվում"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Չի լիցքավորվում"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Լիցքավորված"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Վերահսկվում է ադմինիստրատորի կողմից"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Միացված է ադմինիստրատորի կողմից"</string>
diff --git a/packages/SettingsLib/res/values-in/strings.xml b/packages/SettingsLib/res/values-in/strings.xml
index ebc5f18..89da94b 100644
--- a/packages/SettingsLib/res/values-in/strings.xml
+++ b/packages/SettingsLib/res/values-in/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Mengisi daya"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"mengisi daya baterai"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Tidak mengisi daya"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Tidak mengisi daya"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Penuh"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Dikontrol oleh admin"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Diaktifkan oleh admin"</string>
diff --git a/packages/SettingsLib/res/values-is/strings.xml b/packages/SettingsLib/res/values-is/strings.xml
index 63fe041..c5bca1c 100644
--- a/packages/SettingsLib/res/values-is/strings.xml
+++ b/packages/SettingsLib/res/values-is/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Í hleðslu"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"í hleðslu"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Ekki í hleðslu"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Ekki í hleðslu"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Fullhlaðin"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Stjórnað af kerfisstjóra"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Gert virkt af kerfisstjóra"</string>
diff --git a/packages/SettingsLib/res/values-it/strings.xml b/packages/SettingsLib/res/values-it/strings.xml
index f70eec1..cd6b785 100644
--- a/packages/SettingsLib/res/values-it/strings.xml
+++ b/packages/SettingsLib/res/values-it/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"In carica"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"in carica"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Non in carica"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Non in carica"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Carica"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Gestita dall\'amministratore"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Attivata dall\'amministratore"</string>
diff --git a/packages/SettingsLib/res/values-iw/strings.xml b/packages/SettingsLib/res/values-iw/strings.xml
index 02fd3d5..3c0bf6b 100644
--- a/packages/SettingsLib/res/values-iw/strings.xml
+++ b/packages/SettingsLib/res/values-iw/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"טוען"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"בטעינה"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"לא בטעינה"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"לא טוען"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"מלא"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"נמצא בשליטת מנהל מערכת"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"מופעל על ידי מנהל המכשיר"</string>
diff --git a/packages/SettingsLib/res/values-ja/strings.xml b/packages/SettingsLib/res/values-ja/strings.xml
index d67a180..713f796 100644
--- a/packages/SettingsLib/res/values-ja/strings.xml
+++ b/packages/SettingsLib/res/values-ja/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"充電中"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"充電しています"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"充電していません"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"充電していません"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<!-- String.format failed for translation -->
<!-- no translation found for battery_info_status_full (2824614753861462808) -->
<skip />
diff --git a/packages/SettingsLib/res/values-ka/strings.xml b/packages/SettingsLib/res/values-ka/strings.xml
index 3bc1ac6..ff27523 100644
--- a/packages/SettingsLib/res/values-ka/strings.xml
+++ b/packages/SettingsLib/res/values-ka/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"იტენება"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"იტენება"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"არ იტენება"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"არ იტენება"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"ბატარეა დატენილია"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"იმართება ადმინისტრატორის მიერ"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"ჩართულია ადმინისტრატორის მიერ"</string>
diff --git a/packages/SettingsLib/res/values-kk/strings.xml b/packages/SettingsLib/res/values-kk/strings.xml
index 49fbc50..5c07139 100644
--- a/packages/SettingsLib/res/values-kk/strings.xml
+++ b/packages/SettingsLib/res/values-kk/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Зарядталуда"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"зарядталуда"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Зарядталу орындалып жатқан жоқ"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Зарядталып тұрған жоқ"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Толық"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Әкімші басқарады"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Әкімші қосқан"</string>
diff --git a/packages/SettingsLib/res/values-km/strings.xml b/packages/SettingsLib/res/values-km/strings.xml
index 99748de..45687bf 100644
--- a/packages/SettingsLib/res/values-km/strings.xml
+++ b/packages/SettingsLib/res/values-km/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"កំពុងបញ្ចូលថ្ម"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"កំពុងសាកថ្ម"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"មិនកំពុងបញ្ចូលថ្ម"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"មិនបញ្ចូលថ្ម"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"ពេញ"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"គ្រប់គ្រងដោយអ្នកគ្រប់គ្រង"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"បើកដោយអ្នកគ្រប់គ្រង"</string>
diff --git a/packages/SettingsLib/res/values-kn/strings.xml b/packages/SettingsLib/res/values-kn/strings.xml
index 5527130..0b39e26 100644
--- a/packages/SettingsLib/res/values-kn/strings.xml
+++ b/packages/SettingsLib/res/values-kn/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"ಚಾರ್ಜ್ ಆಗುತ್ತಿದೆ"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"ಚಾರ್ಜ್ ಆಗುತ್ತಿದೆ"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"ಚಾರ್ಜ್ ಆಗುತ್ತಿಲ್ಲ"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"ಚಾರ್ಜ್ ಆಗುತ್ತಿಲ್ಲ"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"ಭರ್ತಿ"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"ನಿರ್ವಾಹಕರ ಮೂಲಕ ನಿಯಂತ್ರಿಸಲಾಗಿದೆ"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"ನಿರ್ವಾಹಕರು ಸಕ್ರಿಯಗೊಳಿಸಿದ್ದಾರೆ"</string>
diff --git a/packages/SettingsLib/res/values-ko/strings.xml b/packages/SettingsLib/res/values-ko/strings.xml
index 74fb113..9bd7111 100644
--- a/packages/SettingsLib/res/values-ko/strings.xml
+++ b/packages/SettingsLib/res/values-ko/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"충전 중"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"충전 중"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"충전 안함"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"충전 안함"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"충전 완료"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"관리자가 제어"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"관리자가 사용 설정함"</string>
diff --git a/packages/SettingsLib/res/values-ky/strings.xml b/packages/SettingsLib/res/values-ky/strings.xml
index c96a7c0..f26ed8c 100644
--- a/packages/SettingsLib/res/values-ky/strings.xml
+++ b/packages/SettingsLib/res/values-ky/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Кубатталууда"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"кубатталууда"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Кубат алган жок"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Кубатталган жок"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Толук"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Администратор тарабынан көзөмөлдөнөт"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Администратор иштетип койгон"</string>
diff --git a/packages/SettingsLib/res/values-lo/strings.xml b/packages/SettingsLib/res/values-lo/strings.xml
index fe7228e..3500664 100644
--- a/packages/SettingsLib/res/values-lo/strings.xml
+++ b/packages/SettingsLib/res/values-lo/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"ກຳລັງສາກໄຟ"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"ກຳລັງສາກໄຟ"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"ບໍ່ໄດ້ສາກໄຟ"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"ບໍ່ໄດ້ສາກໄຟ"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"ເຕັມ"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"ຄວບຄຸມໂດຍຜູ້ເບິ່ງແຍງ"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"ຜູ້ເບິ່ງແຍງລະບົບເປີດໃຫ້ໃຊ້ແລ້ວ"</string>
diff --git a/packages/SettingsLib/res/values-lt/strings.xml b/packages/SettingsLib/res/values-lt/strings.xml
index 6ecbb01..889f312 100644
--- a/packages/SettingsLib/res/values-lt/strings.xml
+++ b/packages/SettingsLib/res/values-lt/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Kraunasi..."</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"įkraunama"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Nekraunama"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Nekraunama"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Visiškai įkrautas"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Valdo administratorius"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Įgalino administratorius"</string>
diff --git a/packages/SettingsLib/res/values-lv/strings.xml b/packages/SettingsLib/res/values-lv/strings.xml
index 7df40e9..512ebaa 100644
--- a/packages/SettingsLib/res/values-lv/strings.xml
+++ b/packages/SettingsLib/res/values-lv/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Uzlāde"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"notiek uzlāde"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Nenotiek uzlāde"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Nenotiek uzlāde"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Pilns"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Kontrolē administrators"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Iespējoja administrators"</string>
diff --git a/packages/SettingsLib/res/values-mk/strings.xml b/packages/SettingsLib/res/values-mk/strings.xml
index 0ced440..0dbaae2 100644
--- a/packages/SettingsLib/res/values-mk/strings.xml
+++ b/packages/SettingsLib/res/values-mk/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Се полни"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"се полни"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Не се полни"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Не се полни"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Полна"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Контролирано од администраторот"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Овозможено од администраторот"</string>
diff --git a/packages/SettingsLib/res/values-ml/strings.xml b/packages/SettingsLib/res/values-ml/strings.xml
index 68f812e..84c1279 100644
--- a/packages/SettingsLib/res/values-ml/strings.xml
+++ b/packages/SettingsLib/res/values-ml/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"ചാർജ്ജുചെയ്യുന്നു"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"ചാർജ് ചെയ്യുന്നു"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"ചാർജ്ജുചെയ്യുന്നില്ല"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"ചാർജ്ജുചെയ്യുന്നില്ല"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"നിറഞ്ഞു"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"അഡ്മിൻ നിയന്ത്രിക്കുന്നത്"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"അഡ്മിൻ പ്രവർത്തനക്ഷമമാക്കി"</string>
diff --git a/packages/SettingsLib/res/values-mn/strings.xml b/packages/SettingsLib/res/values-mn/strings.xml
index d5c52c9..8f4b695 100644
--- a/packages/SettingsLib/res/values-mn/strings.xml
+++ b/packages/SettingsLib/res/values-mn/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Цэнэглэж байна"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"цэнэглэж байна"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Цэнэглэхгүй байна"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Цэнэглэхгүй байна"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Дүүрэн"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Админ удирдсан"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Админ идэвхжүүлсэн"</string>
diff --git a/packages/SettingsLib/res/values-mr/strings.xml b/packages/SettingsLib/res/values-mr/strings.xml
index 146f899..4f7cff7 100644
--- a/packages/SettingsLib/res/values-mr/strings.xml
+++ b/packages/SettingsLib/res/values-mr/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"चार्ज होत आहे"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"चार्ज होत आहे"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"चार्ज होत नाही"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"चार्ज होत नाही"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"पूर्ण"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"प्रशासकाने नियंत्रित केलेले"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"प्रशासकाने सक्षम केलेले"</string>
diff --git a/packages/SettingsLib/res/values-ms/strings.xml b/packages/SettingsLib/res/values-ms/strings.xml
index 9835178..eef4dd5 100644
--- a/packages/SettingsLib/res/values-ms/strings.xml
+++ b/packages/SettingsLib/res/values-ms/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Mengecas"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"mengecas"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Tidak mengecas"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Tidak mengecas"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Penuh"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Dikawal oleh pentadbir"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Didayakan oleh pentadbir"</string>
diff --git a/packages/SettingsLib/res/values-my/strings.xml b/packages/SettingsLib/res/values-my/strings.xml
index 46f97f2..6aad3aa 100644
--- a/packages/SettingsLib/res/values-my/strings.xml
+++ b/packages/SettingsLib/res/values-my/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"အားသွင်းနေပါသည်"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"အားသွင်းနေပါသည်"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"အားသွင်းမနေပါ"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"အားသွင်းမနေပါ"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"အပြည့်"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"စီမံခန့်ခွဲသူမှ ထိန်းချုပ်ပါသည်"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"စီမံခန့်ခွဲသူက ဖွင့်ထားသည်"</string>
diff --git a/packages/SettingsLib/res/values-nb/strings.xml b/packages/SettingsLib/res/values-nb/strings.xml
index 3ea8ddc..756c2fc 100644
--- a/packages/SettingsLib/res/values-nb/strings.xml
+++ b/packages/SettingsLib/res/values-nb/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Lader"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"lader"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Lader ikke"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Lader ikke"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Fullt"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Kontrollert av administratoren"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Slått på av administratoren"</string>
diff --git a/packages/SettingsLib/res/values-ne/strings.xml b/packages/SettingsLib/res/values-ne/strings.xml
index cac6907..03d39af 100644
--- a/packages/SettingsLib/res/values-ne/strings.xml
+++ b/packages/SettingsLib/res/values-ne/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"चार्ज हुँदै"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"चार्ज हुँदै"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"चार्ज भइरहेको छैन"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"चार्ज हुँदै छैन"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"पूर्ण"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"प्रशासकद्वारा नियन्त्रित"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"प्रशासकद्वारा सक्षम पारिएको छ"</string>
diff --git a/packages/SettingsLib/res/values-nl/strings.xml b/packages/SettingsLib/res/values-nl/strings.xml
index 776787c..6ca23af 100644
--- a/packages/SettingsLib/res/values-nl/strings.xml
+++ b/packages/SettingsLib/res/values-nl/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Opladen"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"opladen"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Wordt niet opgeladen"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Wordt niet opgeladen"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Volledig"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Ingesteld door beheerder"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Ingeschakeld door beheerder"</string>
diff --git a/packages/SettingsLib/res/values-pa/strings.xml b/packages/SettingsLib/res/values-pa/strings.xml
index 94badb8..3a43495 100644
--- a/packages/SettingsLib/res/values-pa/strings.xml
+++ b/packages/SettingsLib/res/values-pa/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"ਚਾਰਜਿੰਗ"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"ਚਾਰਜ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"ਚਾਰਜ ਨਹੀਂ ਹੋ ਰਿਹਾ"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"ਚਾਰਜ ਨਹੀਂ ਹੋ ਰਿਹਾ"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"ਪੂਰੀ"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"ਪ੍ਰਸ਼ਾਸਕ ਵੱਲੋਂ ਕੰਟਰੋਲ ਕੀਤੀ ਗਈ"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"ਪ੍ਰਸ਼ਾਸਕ ਦੁਆਰਾ ਯੋਗ ਬਣਾਇਆ ਗਿਆ"</string>
diff --git a/packages/SettingsLib/res/values-pl/strings.xml b/packages/SettingsLib/res/values-pl/strings.xml
index 5b8f613..a635a85 100644
--- a/packages/SettingsLib/res/values-pl/strings.xml
+++ b/packages/SettingsLib/res/values-pl/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Ładowanie"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"ładowanie"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Nie podłączony"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Nie podłączony"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Naładowana"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Kontrolowane przez administratora"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Włączone przez administratora"</string>
diff --git a/packages/SettingsLib/res/values-pt-rBR/strings.xml b/packages/SettingsLib/res/values-pt-rBR/strings.xml
index 690eaf4..2e1855b 100644
--- a/packages/SettingsLib/res/values-pt-rBR/strings.xml
+++ b/packages/SettingsLib/res/values-pt-rBR/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Carregando"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"carregando"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Não está carregando"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Não está carregando"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Cheio"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Controlada pelo admin"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Ativado pelo administrador"</string>
diff --git a/packages/SettingsLib/res/values-pt-rPT/strings.xml b/packages/SettingsLib/res/values-pt-rPT/strings.xml
index eb2a58d..02af40f 100644
--- a/packages/SettingsLib/res/values-pt-rPT/strings.xml
+++ b/packages/SettingsLib/res/values-pt-rPT/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"A carregar"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"a carregar…"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Não está a carregar"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Não está a carregar"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Completo"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Controlado pelo administrador"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Ativada pelo administrador"</string>
diff --git a/packages/SettingsLib/res/values-pt/strings.xml b/packages/SettingsLib/res/values-pt/strings.xml
index 690eaf4..2e1855b 100644
--- a/packages/SettingsLib/res/values-pt/strings.xml
+++ b/packages/SettingsLib/res/values-pt/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Carregando"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"carregando"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Não está carregando"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Não está carregando"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Cheio"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Controlada pelo admin"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Ativado pelo administrador"</string>
diff --git a/packages/SettingsLib/res/values-ro/strings.xml b/packages/SettingsLib/res/values-ro/strings.xml
index 82b77b9..3ecec0e 100644
--- a/packages/SettingsLib/res/values-ro/strings.xml
+++ b/packages/SettingsLib/res/values-ro/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Încarcă"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"se încarcă"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Nu se încarcă"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Nu încarcă"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Complet"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Controlată de administrator"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Activat de administrator"</string>
diff --git a/packages/SettingsLib/res/values-ru/strings.xml b/packages/SettingsLib/res/values-ru/strings.xml
index d79c240..c35a1e1 100644
--- a/packages/SettingsLib/res/values-ru/strings.xml
+++ b/packages/SettingsLib/res/values-ru/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Идет зарядка"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"заряжается"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Не заряжается"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Не заряжается"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Батарея заряжена"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Контролируется администратором"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Включено администратором"</string>
diff --git a/packages/SettingsLib/res/values-si/strings.xml b/packages/SettingsLib/res/values-si/strings.xml
index 3eb2ef8..5e8011a 100644
--- a/packages/SettingsLib/res/values-si/strings.xml
+++ b/packages/SettingsLib/res/values-si/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"ආරෝපණය වෙමින්"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"ආරෝපණය වේ"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"ආරෝපණය නොවේ"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"ආරෝපණය නොවෙමින්"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"පූර්ණ"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"පරිපාලක විසින් පාලනය කරන ලදී"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"පරිපාලක විසින් සබල කර ඇත"</string>
diff --git a/packages/SettingsLib/res/values-sk/strings.xml b/packages/SettingsLib/res/values-sk/strings.xml
index 9e379bc..b81fee1 100644
--- a/packages/SettingsLib/res/values-sk/strings.xml
+++ b/packages/SettingsLib/res/values-sk/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Nabíjanie"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"nabíjanie"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Nenabíja sa"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Nenabíja sa"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Nabitá"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Ovládané správcom"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Povolené správcom"</string>
diff --git a/packages/SettingsLib/res/values-sl/strings.xml b/packages/SettingsLib/res/values-sl/strings.xml
index d6a324f..4f3bce1 100644
--- a/packages/SettingsLib/res/values-sl/strings.xml
+++ b/packages/SettingsLib/res/values-sl/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Polnjenje"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"polnjenje"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Se ne polni"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Se ne polni"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Poln"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Nadzira skrbnik"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Omogočil skrbnik"</string>
diff --git a/packages/SettingsLib/res/values-sq/strings.xml b/packages/SettingsLib/res/values-sq/strings.xml
index d1e2990..0558c36 100644
--- a/packages/SettingsLib/res/values-sq/strings.xml
+++ b/packages/SettingsLib/res/values-sq/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Po ngarkohet"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"po ngarkohet"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Nuk po ngarkohet"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Nuk po ngarkohet"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"E mbushur"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Kontrolluar nga administratori"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Aktivizuar nga administratori"</string>
diff --git a/packages/SettingsLib/res/values-sr/strings.xml b/packages/SettingsLib/res/values-sr/strings.xml
index e9f126a..f1506d2 100644
--- a/packages/SettingsLib/res/values-sr/strings.xml
+++ b/packages/SettingsLib/res/values-sr/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Пуњење"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"пуни се"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Не пуни се"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Не пуни се"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Пуно"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Контролише администратор"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Омогућио је администратор"</string>
diff --git a/packages/SettingsLib/res/values-sv/strings.xml b/packages/SettingsLib/res/values-sv/strings.xml
index c1c2bc3..97511cf 100644
--- a/packages/SettingsLib/res/values-sv/strings.xml
+++ b/packages/SettingsLib/res/values-sv/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Laddar"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"laddas"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Laddar inte"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Laddar inte"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Fullt"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Strys av administratören"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Aktiverad av administratör"</string>
diff --git a/packages/SettingsLib/res/values-sw/strings.xml b/packages/SettingsLib/res/values-sw/strings.xml
index dffd0f7..6e4e85e 100644
--- a/packages/SettingsLib/res/values-sw/strings.xml
+++ b/packages/SettingsLib/res/values-sw/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Inachaji"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"inachaji"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Haichaji"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Haichaji"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Imejaa"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Imedhibitiwa na msimamizi"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Imewashwa na msimamizi"</string>
diff --git a/packages/SettingsLib/res/values-ta/strings.xml b/packages/SettingsLib/res/values-ta/strings.xml
index f876315..e707596 100644
--- a/packages/SettingsLib/res/values-ta/strings.xml
+++ b/packages/SettingsLib/res/values-ta/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"சார்ஜ் ஏற்றப்படுகிறது"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"சார்ஜாகிறது"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"சார்ஜ் செய்யப்படவில்லை"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"சார்ஜ் ஏறவில்லை"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"முழுமை"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"நிர்வாகி கட்டுப்படுத்துகிறார்"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"நிர்வாகி இயக்கியுள்ளார்"</string>
diff --git a/packages/SettingsLib/res/values-te/strings.xml b/packages/SettingsLib/res/values-te/strings.xml
index 3b86a0a..20e8931 100644
--- a/packages/SettingsLib/res/values-te/strings.xml
+++ b/packages/SettingsLib/res/values-te/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"ఛార్జ్ అవుతోంది"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"ఛార్జ్ అవుతోంది"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"ఛార్జ్ కావడం లేదు"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"ఛార్జ్ కావడం లేదు"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"నిండింది"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"నిర్వాహకుని ద్వారా నియంత్రించబడింది"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"నిర్వాహకులు ప్రారంభించారు"</string>
diff --git a/packages/SettingsLib/res/values-th/strings.xml b/packages/SettingsLib/res/values-th/strings.xml
index 382d93e..ef21584 100644
--- a/packages/SettingsLib/res/values-th/strings.xml
+++ b/packages/SettingsLib/res/values-th/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"กำลังชาร์จ"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"กำลังชาร์จ"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"ไม่ได้ชาร์จ"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"ไม่ได้ชาร์จ"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"เต็ม"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"ผู้ดูแลระบบเป็นผู้ควบคุม"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"เปิดใช้โดยผู้ดูแลระบบ"</string>
diff --git a/packages/SettingsLib/res/values-tl/strings.xml b/packages/SettingsLib/res/values-tl/strings.xml
index e1380ea..51630dac 100644
--- a/packages/SettingsLib/res/values-tl/strings.xml
+++ b/packages/SettingsLib/res/values-tl/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Nagcha-charge"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"nagcha-charge"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Hindi nagcha-charge"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Hindi nagkakarga"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Puno"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Pinapamahalaan ng admin"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Na-enable ng admin"</string>
diff --git a/packages/SettingsLib/res/values-tr/strings.xml b/packages/SettingsLib/res/values-tr/strings.xml
index ea6e41b..f2f94a2 100644
--- a/packages/SettingsLib/res/values-tr/strings.xml
+++ b/packages/SettingsLib/res/values-tr/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Şarj oluyor"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"şarj oluyor"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Şarj olmuyor"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Şarj etmiyor"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Dolu"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Yönetici tarafından denetleniyor"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Yönetici tarafından etkinleştirildi"</string>
diff --git a/packages/SettingsLib/res/values-uk/strings.xml b/packages/SettingsLib/res/values-uk/strings.xml
index 7b0d1d5..7f329ce 100644
--- a/packages/SettingsLib/res/values-uk/strings.xml
+++ b/packages/SettingsLib/res/values-uk/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Заряджається"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"заряджається"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Не заряджається"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Не заряджається"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Акумулятор заряджено"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Керується адміністратором"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Увімкнено адміністратором"</string>
diff --git a/packages/SettingsLib/res/values-ur/strings.xml b/packages/SettingsLib/res/values-ur/strings.xml
index 95c54f0..9d37602 100644
--- a/packages/SettingsLib/res/values-ur/strings.xml
+++ b/packages/SettingsLib/res/values-ur/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"چارج ہو رہا ہے"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"چارج ہو رہا ہے"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"چارج نہیں ہو رہا ہے"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"چارج نہیں ہو رہا ہے"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"مکمل"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"کنٹرول کردہ بذریعہ منتظم"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"منتظم کی طرف سے فعال کردہ"</string>
diff --git a/packages/SettingsLib/res/values-uz/strings.xml b/packages/SettingsLib/res/values-uz/strings.xml
index 7fc7aec..872d121 100644
--- a/packages/SettingsLib/res/values-uz/strings.xml
+++ b/packages/SettingsLib/res/values-uz/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Quvvat olmoqda"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"quvvat olmoqda"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Quvvat olmayapti"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Quvvatlanmayapti"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"To‘la"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Administrator tomonidan boshqariladi"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Administrator tomonidan yoqilgan"</string>
diff --git a/packages/SettingsLib/res/values-vi/strings.xml b/packages/SettingsLib/res/values-vi/strings.xml
index e27739d..1c9f917 100644
--- a/packages/SettingsLib/res/values-vi/strings.xml
+++ b/packages/SettingsLib/res/values-vi/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Đang sạc"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"đang sạc"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Hiện không sạc"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Hiện không sạc"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Đầy"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Do quản trị viên kiểm soát"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Kích hoạt bởi quản trị viên"</string>
diff --git a/packages/SettingsLib/res/values-zh-rCN/strings.xml b/packages/SettingsLib/res/values-zh-rCN/strings.xml
index 008078e..c164347 100644
--- a/packages/SettingsLib/res/values-zh-rCN/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rCN/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"正在充电"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"正在充电"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"未在充电"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"未在充电"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"电量充足"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"由管理员控制"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"已被管理员启用"</string>
diff --git a/packages/SettingsLib/res/values-zh-rHK/strings.xml b/packages/SettingsLib/res/values-zh-rHK/strings.xml
index 62f5992..4fadad1 100644
--- a/packages/SettingsLib/res/values-zh-rHK/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rHK/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"充電中"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"正在充電"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"非充電中"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"未開始充電"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"電量已滿"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"已由管理員停用"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"已由管理員啟用"</string>
diff --git a/packages/SettingsLib/res/values-zh-rTW/strings.xml b/packages/SettingsLib/res/values-zh-rTW/strings.xml
index 2e5f711..ed21c9a 100644
--- a/packages/SettingsLib/res/values-zh-rTW/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rTW/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"充電中"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"充電中"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"非充電中"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"非充電中"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"電力充足"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"已由管理員停用"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"已由管理員啟用"</string>
diff --git a/packages/SettingsLib/res/values-zu/strings.xml b/packages/SettingsLib/res/values-zu/strings.xml
index 1308a4e..b598297 100644
--- a/packages/SettingsLib/res/values-zu/strings.xml
+++ b/packages/SettingsLib/res/values-zu/strings.xml
@@ -356,7 +356,8 @@
<string name="battery_info_status_charging" msgid="1705179948350365604">"Iyashaja"</string>
<string name="battery_info_status_charging_lower" msgid="8689770213898117994">"iyashaja"</string>
<string name="battery_info_status_discharging" msgid="310932812698268588">"Ayishaji"</string>
- <string name="battery_info_status_not_charging" msgid="2820070506621483576">"Ayishaji"</string>
+ <!-- no translation found for battery_info_status_not_charging (8523453668342598579) -->
+ <skip />
<string name="battery_info_status_full" msgid="2824614753861462808">"Kugcwele"</string>
<string name="disabled_by_admin_summary_text" msgid="6750513964908334617">"Kulawulwa umqondisi"</string>
<string name="enabled_by_admin" msgid="5302986023578399263">"Kunikwe amandla umlawuli"</string>
diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml
index ebaf10a..fd5b70e 100644
--- a/packages/SettingsLib/res/values/strings.xml
+++ b/packages/SettingsLib/res/values/strings.xml
@@ -879,7 +879,7 @@
<!-- Battery Info screen. Value for a status item. Used for diagnostic info screens, precise translation isn't needed -->
<string name="battery_info_status_discharging">Not charging</string>
<!-- Battery Info screen. Value for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="battery_info_status_not_charging">Not charging</string>
+ <string name="battery_info_status_not_charging">Plugged in, can\'t charge right now</string>
<!-- Battery Info screen. Value for a status item. Used for diagnostic info screens, precise translation isn't needed -->
<string name="battery_info_status_full">Full</string>
diff --git a/packages/SettingsLib/src/com/android/settingslib/suggestions/SuggestionParser.java b/packages/SettingsLib/src/com/android/settingslib/suggestions/SuggestionParser.java
index f9dc0e4..00f32b2 100644
--- a/packages/SettingsLib/src/com/android/settingslib/suggestions/SuggestionParser.java
+++ b/packages/SettingsLib/src/com/android/settingslib/suggestions/SuggestionParser.java
@@ -91,28 +91,25 @@
// Shared prefs keys for storing dismissed state.
// Index into current dismissed state.
- @VisibleForTesting
- static final String DISMISS_INDEX = "_dismiss_index";
public static final String SETUP_TIME = "_setup_time";
private static final String IS_DISMISSED = "_is_dismissed";
// Default dismiss control for smart suggestions.
- private static final String DEFAULT_SMART_DISMISS_CONTROL = "0,10";
+ private static final String DEFAULT_SMART_DISMISS_CONTROL = "0";
private final Context mContext;
private final List<SuggestionCategory> mSuggestionList;
private final ArrayMap<Pair<String, String>, Tile> mAddCache = new ArrayMap<>();
private final SharedPreferences mSharedPrefs;
- private final String mSmartDismissControl;
-
+ private final String mDefaultDismissControl;
public SuggestionParser(Context context, SharedPreferences sharedPrefs, int orderXml,
- String smartDismissControl) {
+ String defaultDismissControl) {
this(
context,
sharedPrefs,
(List<SuggestionCategory>) new SuggestionOrderInflater(context).parse(orderXml),
- smartDismissControl);
+ defaultDismissControl);
}
public SuggestionParser(Context context, SharedPreferences sharedPrefs, int orderXml) {
@@ -124,11 +121,11 @@
Context context,
SharedPreferences sharedPrefs,
List<SuggestionCategory> suggestionList,
- String smartDismissControl) {
+ String defaultDismissControl) {
mContext = context;
mSuggestionList = suggestionList;
mSharedPrefs = sharedPrefs;
- mSmartDismissControl = smartDismissControl;
+ mDefaultDismissControl = defaultDismissControl;
}
public SuggestionList getSuggestions(boolean isSmartSuggestionEnabled) {
@@ -161,25 +158,16 @@
return suggestionList;
}
- public boolean dismissSuggestion(Tile suggestion) {
- return dismissSuggestion(suggestion, false);
- }
-
/**
* Dismisses a suggestion, returns true if the suggestion has no more dismisses left and should
* be disabled.
*/
- public boolean dismissSuggestion(Tile suggestion, boolean isSmartSuggestionEnabled) {
- String keyBase = suggestion.intent.getComponent().flattenToShortString();
- int index = mSharedPrefs.getInt(keyBase + DISMISS_INDEX, 0);
- String dismissControl = getDismissControl(suggestion, isSmartSuggestionEnabled);
- if (dismissControl == null || parseDismissString(dismissControl).length == index) {
- return true;
- }
+ public boolean dismissSuggestion(Tile suggestion) {
+ final String keyBase = suggestion.intent.getComponent().flattenToShortString();
mSharedPrefs.edit()
.putBoolean(keyBase + IS_DISMISSED, true)
.commit();
- return false;
+ return true;
}
@VisibleForTesting
@@ -357,32 +345,29 @@
@VisibleForTesting
boolean isDismissed(Tile suggestion, boolean isSmartSuggestionEnabled) {
String dismissControl = getDismissControl(suggestion, isSmartSuggestionEnabled);
- if (dismissControl == null) {
- return false;
- }
String keyBase = suggestion.intent.getComponent().flattenToShortString();
if (!mSharedPrefs.contains(keyBase + SETUP_TIME)) {
mSharedPrefs.edit()
.putLong(keyBase + SETUP_TIME, System.currentTimeMillis())
.commit();
}
- // Default to dismissed, so that we can have suggestions that only first appear after
- // some number of days.
- if (!mSharedPrefs.getBoolean(keyBase + IS_DISMISSED, true)) {
- return false;
- }
- int index = mSharedPrefs.getInt(keyBase + DISMISS_INDEX, 0);
- int[] dismissRules = parseDismissString(dismissControl);
- if (dismissRules.length <= index) {
+ // Check if it's already manually dismissed
+ final boolean isDismissed = mSharedPrefs.getBoolean(keyBase + IS_DISMISSED, false);
+ if (isDismissed) {
return true;
}
- int currentDismiss = dismissRules[index];
- long time = getEndTime(mSharedPrefs.getLong(keyBase + SETUP_TIME, 0), currentDismiss);
- if (System.currentTimeMillis() >= time) {
+ if (dismissControl == null) {
+ return false;
+ }
+ // Parse when suggestion should first appear. return true to artificially hide suggestion
+ // before then.
+ int firstAppearDay = parseDismissString(dismissControl);
+ long firstAppearDayInMs = getEndTime(mSharedPrefs.getLong(keyBase + SETUP_TIME, 0),
+ firstAppearDay);
+ if (System.currentTimeMillis() >= firstAppearDayInMs) {
// Dismiss timeout has passed, undismiss it.
mSharedPrefs.edit()
.putBoolean(keyBase + IS_DISMISSED, false)
- .putInt(keyBase + DISMISS_INDEX, index + 1)
.commit();
return false;
}
@@ -394,18 +379,18 @@
return startTime + days;
}
- private int[] parseDismissString(String dismissControl) {
- String[] dismissStrs = dismissControl.split(",");
- int[] dismisses = new int[dismissStrs.length];
- for (int i = 0; i < dismissStrs.length; i++) {
- dismisses[i] = Integer.parseInt(dismissStrs[i]);
- }
- return dismisses;
+ /**
+ * Parse the first int from a string formatted as "0,1,2..."
+ * The value means suggestion should first appear on Day X.
+ */
+ private int parseDismissString(String dismissControl) {
+ final String[] dismissStrs = dismissControl.split(",");
+ return Integer.parseInt(dismissStrs[0]);
}
private String getDismissControl(Tile suggestion, boolean isSmartSuggestionEnabled) {
if (isSmartSuggestionEnabled) {
- return mSmartDismissControl;
+ return mDefaultDismissControl;
} else {
return suggestion.metaData.getString(META_DATA_DISMISS_CONTROL);
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java
index 33af4039..b8c5aca 100644
--- a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java
+++ b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java
@@ -254,6 +254,8 @@
mCarrierName = savedState.getString(KEY_CARRIER_NAME);
}
update(mConfig, mInfo, mNetworkInfo);
+
+ // Do not evict old scan results on initial creation
updateRssi();
updateSeen();
mId = sLastId.incrementAndGet();
@@ -495,10 +497,6 @@
}
private void evictOldScanResults() {
- if (WifiTracker.sStaleScanResults) {
- // Do not evict old scan results unless we are scanning and have fresh results.
- return;
- }
long nowMs = SystemClock.elapsedRealtime();
for (Iterator<ScanResult> iter = mScanResultCache.values().iterator(); iter.hasNext(); ) {
ScanResult result = iter.next();
@@ -562,12 +560,8 @@
* results, returning the best RSSI for all matching AccessPoints averaged with the previous
* value. If the access point is not connected and there are no scan results, the rssi will be
* set to {@link #UNREACHABLE_RSSI}.
- *
- * <p>Old scan results will be evicted from the cache when this method is invoked.
*/
private void updateRssi() {
- evictOldScanResults();
-
if (this.isActive()) {
return;
}
@@ -586,14 +580,8 @@
}
}
- /**
- * Updates {@link #mSeen} based on the scan result cache.
- *
- * <p>Old scan results will be evicted from the cache when this method is invoked.
- */
+ /** Updates {@link #mSeen} based on the scan result cache. */
private void updateSeen() {
- evictOldScanResults();
-
// TODO(sghuman): Set to now if connected
long seen = 0;
@@ -1097,12 +1085,22 @@
mAccessPointListener = listener;
}
- boolean update(ScanResult result) {
+ /**
+ * Update the AP with the given scan result.
+ *
+ * @param result the ScanResult to add to the AccessPoint scan cache
+ * @param evictOldScanResults whether stale scan results should be removed
+ * from the cache during this update process
+ * @return true if the scan result update caused a change in state which would impact ranking
+ * or AccessPoint rendering (e.g. wifi level, security)
+ */
+ boolean update(ScanResult result, boolean evictOldScanResults) {
if (matches(result)) {
int oldLevel = getLevel();
/* Add or update the scan result for the BSSID */
mScanResultCache.put(result.BSSID, result);
+ if (evictOldScanResults) evictOldScanResults();
updateSeen();
updateRssi();
int newLevel = getLevel();
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java
index 45032ce..a242570 100644
--- a/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java
+++ b/packages/SettingsLib/src/com/android/settingslib/wifi/WifiTracker.java
@@ -147,7 +147,7 @@
Scanner mScanner;
@GuardedBy("mLock")
- static boolean sStaleScanResults = true;
+ private boolean mStaleScanResults = true;
public WifiTracker(Context context, WifiListener wifiListener,
boolean includeSaved, boolean includeScans) {
@@ -356,7 +356,7 @@
* <p>This should always be called when done with a WifiTracker (if startTracking was called) to
* ensure proper cleanup and prevent any further callbacks from occurring.
*
- * <p>Calling this method will set the {@link #sStaleScanResults} bit, which prevents
+ * <p>Calling this method will set the {@link #mStaleScanResults} bit, which prevents
* {@link WifiListener#onAccessPointsChanged()} callbacks from being invoked (until the bit
* is unset on the next SCAN_RESULTS_AVAILABLE_ACTION).
*/
@@ -374,7 +374,7 @@
mWorkHandler.removePendingMessages();
mMainHandler.removePendingMessages();
- sStaleScanResults = true;
+ mStaleScanResults = true;
}
}
@@ -480,7 +480,7 @@
/**
* Safely modify {@link #mInternalAccessPoints} by acquiring {@link #mLock} first.
*
- * <p>Will not perform the update if {@link #sStaleScanResults} is true
+ * <p>Will not perform the update if {@link #mStaleScanResults} is true
*/
private void updateAccessPoints() {
List<WifiConfiguration> configs = mWifiManager.getConfiguredNetworks();
@@ -490,7 +490,7 @@
}
synchronized (mLock) {
- if(!sStaleScanResults) {
+ if(!mStaleScanResults) {
updateAccessPointsLocked(newScanResults, configs);
}
}
@@ -500,7 +500,7 @@
* Update the internal list of access points.
*
* <p>Do not called directly (except for forceUpdate), use {@link #updateAccessPoints()} which
- * respects {@link #sStaleScanResults}.
+ * respects {@link #mStaleScanResults}.
*/
@GuardedBy("mLock")
private void updateAccessPointsLocked(final List<ScanResult> newScanResults,
@@ -574,7 +574,8 @@
boolean found = false;
for (AccessPoint accessPoint : apMap.getAll(result.SSID)) {
- if (accessPoint.update(result)) {
+ // We want to evict old scan results if are current results are not stale
+ if (accessPoint.update(result, !mStaleScanResults)) {
found = true;
break;
}
@@ -647,7 +648,8 @@
for (int i = 0; i < N; i++) {
if (cache.get(i).matches(result)) {
AccessPoint ret = cache.remove(i);
- ret.update(result);
+ // evict old scan results only if we have fresh results
+ ret.update(result, !mStaleScanResults);
return ret;
}
}
@@ -847,7 +849,7 @@
// Only notify listeners of changes if we have fresh scan results, otherwise the
// UI will be updated with stale results. We want to copy the APs regardless,
// for instances where forceUpdate was invoked by the caller.
- if (sStaleScanResults) {
+ if (mStaleScanResults) {
copyAndNotifyListeners(false /*notifyListeners*/);
} else {
copyAndNotifyListeners(true /*notifyListeners*/);
@@ -902,7 +904,7 @@
switch (msg.what) {
case MSG_UPDATE_ACCESS_POINTS:
if (msg.arg1 == CLEAR_STALE_SCAN_RESULTS) {
- sStaleScanResults = false;
+ mStaleScanResults = false;
}
updateAccessPoints();
break;
diff --git a/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/AccessPointTest.java b/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/AccessPointTest.java
index 24f0c7a..ae59d37 100644
--- a/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/AccessPointTest.java
+++ b/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/AccessPointTest.java
@@ -258,7 +258,7 @@
scanResult.BSSID = "bssid";
scanResult.timestamp = SystemClock.elapsedRealtime() * 1000;
scanResult.capabilities = "";
- assertThat(ap.update(scanResult)).isTrue();
+ assertThat(ap.update(scanResult, true /* evict old scan results */)).isTrue();
assertThat(ap.getRssi()).isEqualTo(expectedRssi);
}
@@ -554,7 +554,7 @@
scanResult.isCarrierAp = true;
scanResult.carrierApEapType = carrierApEapType;
scanResult.carrierName = carrierName;
- assertThat(ap.update(scanResult)).isTrue();
+ assertThat(ap.update(scanResult, true /* evictOldScanresults */)).isTrue();
assertThat(ap.isCarrierAp()).isEqualTo(true);
assertThat(ap.getCarrierApEapType()).isEqualTo(carrierApEapType);
diff --git a/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java b/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java
index 76d9823..df6587e 100644
--- a/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java
+++ b/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java
@@ -137,7 +137,6 @@
private Looper mMainLooper;
private int mOriginalScoringUiSettingValue;
- private boolean mOriginalStaleScanResultsValue;
@Before
public void setUp() {
@@ -213,7 +212,6 @@
Settings.Global.NETWORK_SCORING_UI_ENABLED,
1 /* enabled */);
- mOriginalStaleScanResultsValue = WifiTracker.sStaleScanResults;
}
@After
@@ -222,8 +220,6 @@
InstrumentationRegistry.getTargetContext().getContentResolver(),
Settings.Global.NETWORK_SCORING_UI_ENABLED,
mOriginalScoringUiSettingValue);
-
- WifiTracker.sStaleScanResults = mOriginalStaleScanResultsValue;
}
private static ScanResult buildScanResult1() {
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/suggestions/SuggestionParserTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/suggestions/SuggestionParserTest.java
index 8391136..f6404a2 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/suggestions/SuggestionParserTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/suggestions/SuggestionParserTest.java
@@ -83,7 +83,7 @@
mSuggestionParser = new SuggestionParser(mContext, mPrefs,
Arrays.asList(mMultipleCategory, mExclusiveCategory, mExpiredExclusiveCategory),
- "0,0");
+ "0");
ResolveInfo info1 = TileUtilsTest.newInfo(true, null);
info1.activityInfo.packageName = "pkg";
@@ -109,17 +109,12 @@
}
@Test
- public void testDismissSuggestion_withoutSmartSuggestion() {
- assertThat(mSuggestionParser.dismissSuggestion(mSuggestion, false)).isTrue();
+ public void dismissSuggestion_shouldDismiss() {
+ assertThat(mSuggestionParser.dismissSuggestion(mSuggestion)).isTrue();
}
@Test
- public void testDismissSuggestion_withSmartSuggestion() {
- assertThat(mSuggestionParser.dismissSuggestion(mSuggestion, true)).isFalse();
- }
-
- @Test
- public void testGetSuggestions_withoutSmartSuggestions() {
+ public void testGetSuggestions_withoutSmartSuggestions_shouldDismiss() {
readAndDismissSuggestion(false);
mSuggestionParser.readSuggestions(mMultipleCategory, mSuggestionsAfterDismiss, false);
assertThat(mSuggestionsBeforeDismiss).hasSize(2);
@@ -128,11 +123,10 @@
}
@Test
- public void testGetSuggestions_withSmartSuggestions() {
+ public void testGetSuggestions_withSmartSuggestions_shouldDismiss() {
readAndDismissSuggestion(true);
assertThat(mSuggestionsBeforeDismiss).hasSize(2);
- assertThat(mSuggestionsAfterDismiss).hasSize(2);
- assertThat(mSuggestionsBeforeDismiss).isEqualTo(mSuggestionsAfterDismiss);
+ assertThat(mSuggestionsAfterDismiss).hasSize(1);
}
@Test
@@ -191,19 +185,15 @@
}
@Test
- public void isSuggestionDismissed_mismatchRule_shouldDismiss() {
+ public void isSuggestionDismissed_dismissedSuggestion_shouldReturnTrue() {
final Tile suggestion = new Tile();
suggestion.metaData = new Bundle();
suggestion.metaData.putString(SuggestionParser.META_DATA_DISMISS_CONTROL, "1,2,3");
suggestion.intent = new Intent().setComponent(new ComponentName("pkg", "cls"));
// Dismiss suggestion when smart suggestion is not enabled.
- mSuggestionParser.dismissSuggestion(suggestion, false /* isSmartSuggestionEnabled */);
- final String suggestionKey = suggestion.intent.getComponent().flattenToShortString();
- // And point to last rule in dismiss control
- mPrefs.edit().putInt(suggestionKey + SuggestionParser.DISMISS_INDEX, 2).apply();
+ mSuggestionParser.dismissSuggestion(suggestion);
- // Turn on smart suggestion, and check if suggestion is enabled.
assertThat(mSuggestionParser.isDismissed(suggestion, true /* isSmartSuggestionEnabled */))
.isTrue();
}
@@ -215,7 +205,7 @@
mMultipleCategory, mSuggestionsBeforeDismiss, isSmartSuggestionEnabled);
final Tile suggestion = mSuggestionsBeforeDismiss.get(0);
- if (mSuggestionParser.dismissSuggestion(suggestion, isSmartSuggestionEnabled)) {
+ if (mSuggestionParser.dismissSuggestion(suggestion)) {
RuntimeEnvironment.getRobolectricPackageManager().removeResolveInfosForIntent(
new Intent(Intent.ACTION_MAIN).addCategory(mMultipleCategory.category),
suggestion.intent.getComponent().getPackageName());
diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/GlobalActions.java b/packages/SystemUI/plugin/src/com/android/systemui/plugins/GlobalActions.java
index bb21fb3..1f633da 100644
--- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/GlobalActions.java
+++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/GlobalActions.java
@@ -26,6 +26,8 @@
int VERSION = 1;
void showGlobalActions(GlobalActionsManager manager);
+ default void showShutdownUi(boolean isReboot, String reason) {
+ }
@ProvidesInterface(version = GlobalActionsManager.VERSION)
public interface GlobalActionsManager {
diff --git a/packages/SystemUI/res/drawable/ic_close_white_rounded.xml b/packages/SystemUI/res/drawable/ic_close_white_rounded.xml
new file mode 100644
index 0000000..ca37698
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_close_white_rounded.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2017 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FFFFFFFF"
+ android:pathData="M18.3,5.71a0.996,0.996 0,0 0,-1.41 0L12,10.59 7.11,5.7A0.996,0.996 0,1 0,5.7 7.11L10.59,12 5.7,16.89a0.996,0.996 0,1 0,1.41 1.41L12,13.41l4.89,4.89a0.996,0.996 0,1 0,1.41 -1.41L13.41,12l4.89,-4.89c0.38,-0.38 0.38,-1.02 0,-1.4z"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_minus.xml b/packages/SystemUI/res/drawable/ic_qs_minus.xml
index 6a3410a..ead6b03 100644
--- a/packages/SystemUI/res/drawable/ic_qs_minus.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_minus.xml
@@ -1,5 +1,5 @@
<!--
- Copyright (C) 2015 The Android Open Source Project
+ Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -15,12 +15,10 @@
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24.0dp"
- android:viewportHeight="48.0"
- android:viewportWidth="48.0"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0"
android:width="24.0dp" >
-
<path
android:fillColor="#FFFFFFFF"
- android:pathData="M38.0,26.0L10.0,26.0l0.0,-4.0l28.0,0.0l0.0,4.0z" />
-
-</vector>
\ No newline at end of file
+ android:pathData="M18,13H6c-0.55,0 -1,-0.45 -1,-1v0c0,-0.55 0.45,-1 1,-1h12c0.55,0 1,0.45 1,1v0C19,12.55 18.55,13 18,13z"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_plus.xml b/packages/SystemUI/res/drawable/ic_qs_plus.xml
index 393f51c..f1b19e1e 100644
--- a/packages/SystemUI/res/drawable/ic_qs_plus.xml
+++ b/packages/SystemUI/res/drawable/ic_qs_plus.xml
@@ -1,5 +1,5 @@
<!--
- Copyright (C) 2015 The Android Open Source Project
+ Copyright (C) 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -15,12 +15,10 @@
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24.0dp"
- android:viewportHeight="48.0"
- android:viewportWidth="48.0"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0"
android:width="24.0dp" >
-
<path
android:fillColor="#FFFFFFFF"
- android:pathData="M38.0,26.0L26.0,26.0l0.0,12.0l-4.0,0.0L22.0,26.0L10.0,26.0l0.0,-4.0l12.0,0.0L22.0,10.0l4.0,0.0l0.0,12.0l12.0,0.0l0.0,4.0z" />
-
-</vector>
\ No newline at end of file
+ android:pathData="M18,13h-5v5c0,0.55 -0.45,1 -1,1h0c-0.55,0 -1,-0.45 -1,-1v-5H6c-0.55,0 -1,-0.45 -1,-1v0c0,-0.55 0.45,-1 1,-1h5V6c0,-0.55 0.45,-1 1,-1h0c0.55,0 1,0.45 1,1v5h5c0.55,0 1,0.45 1,1v0C19,12.55 18.55,13 18,13z"/>
+</vector>
diff --git a/packages/SystemUI/res/layout/volume_zen_footer.xml b/packages/SystemUI/res/layout/volume_zen_footer.xml
index 38627b6..7ffcb1e 100644
--- a/packages/SystemUI/res/layout/volume_zen_footer.xml
+++ b/packages/SystemUI/res/layout/volume_zen_footer.xml
@@ -51,7 +51,7 @@
android:clickable="true"
android:contentDescription="@string/accessibility_desc_close"
android:scaleType="center"
- android:src="@drawable/ic_close_white" />
+ android:src="@drawable/ic_close_white_rounded" />
<TextView
android:id="@+id/zen_introduction_message"
diff --git a/packages/SystemUI/res/layout/zen_mode_panel.xml b/packages/SystemUI/res/layout/zen_mode_panel.xml
index 5516983..3826bdd 100644
--- a/packages/SystemUI/res/layout/zen_mode_panel.xml
+++ b/packages/SystemUI/res/layout/zen_mode_panel.xml
@@ -59,7 +59,7 @@
android:clickable="true"
android:contentDescription="@string/accessibility_desc_close"
android:scaleType="center"
- android:src="@drawable/ic_close_white" />
+ android:src="@drawable/ic_close_white_rounded" />
<TextView
android:id="@+id/zen_introduction_message"
diff --git a/packages/SystemUI/res/values-ca/strings.xml b/packages/SystemUI/res/values-ca/strings.xml
index aa28474..cb929d9 100644
--- a/packages/SystemUI/res/values-ca/strings.xml
+++ b/packages/SystemUI/res/values-ca/strings.xml
@@ -726,8 +726,8 @@
<string name="pip_phone_minimize" msgid="1079119422589131792">"Minimitza"</string>
<string name="pip_phone_close" msgid="8416647892889710330">"Tanca"</string>
<string name="pip_phone_dismiss_hint" msgid="6351678169095923899">"Arrossega cap avall per ignorar-ho"</string>
- <string name="pip_menu_title" msgid="3328510504196964712">"Menú per a Imatge en imatge"</string>
- <string name="pip_notification_title" msgid="3204024940158161322">"<xliff:g id="NAME">%s</xliff:g> està en imatge en imatge"</string>
+ <string name="pip_menu_title" msgid="3328510504196964712">"Menú per a Pantalla en pantalla"</string>
+ <string name="pip_notification_title" msgid="3204024940158161322">"<xliff:g id="NAME">%s</xliff:g> està en pantalla en pantalla"</string>
<string name="pip_notification_message" msgid="5619512781514343311">"Si no vols que <xliff:g id="NAME">%s</xliff:g> utilitzi aquesta funció, toca per obrir la configuració i desactiva-la."</string>
<string name="pip_play" msgid="1417176722760265888">"Reprodueix"</string>
<string name="pip_pause" msgid="8881063404466476571">"Posa en pausa"</string>
diff --git a/packages/SystemUI/res/values-hy/strings.xml b/packages/SystemUI/res/values-hy/strings.xml
index 7619ce2..4935350 100644
--- a/packages/SystemUI/res/values-hy/strings.xml
+++ b/packages/SystemUI/res/values-hy/strings.xml
@@ -67,12 +67,12 @@
<string name="usb_debugging_secondary_user_message" msgid="8572228137833020196">"Սարքի վրա այս պահին մուտք գործած օգտատերը չի կարող միացնել USB վրիպազերծումը: Այս գործառույթից օգտվելու համար մուտք գործեք ադմինիստրատորի հաշվով:"</string>
<string name="compat_mode_on" msgid="6623839244840638213">"Խոշորացնել` էկրանը լցնելու համար"</string>
<string name="compat_mode_off" msgid="4434467572461327898">"Ձգել` էկրանը լցնելու համար"</string>
- <string name="screenshot_saving_ticker" msgid="7403652894056693515">"Պահում է էկրանի հանույթը…"</string>
- <string name="screenshot_saving_title" msgid="8242282144535555697">"Պահում է էկրանի հանույթը..."</string>
- <string name="screenshot_saving_text" msgid="2419718443411738818">"Էկրանի հանույթը պահվում է:"</string>
- <string name="screenshot_saved_title" msgid="6461865960961414961">"Էկրանի հանույթը լուսանկարվել է:"</string>
+ <string name="screenshot_saving_ticker" msgid="7403652894056693515">"Պահում է էկրանի պատկերը…"</string>
+ <string name="screenshot_saving_title" msgid="8242282144535555697">"Պահում է էկրանի պատկերը..."</string>
+ <string name="screenshot_saving_text" msgid="2419718443411738818">"Էկրանի պատկերը պահվում է:"</string>
+ <string name="screenshot_saved_title" msgid="6461865960961414961">"Էկրանի պատկերը լուսանկարվել է:"</string>
<string name="screenshot_saved_text" msgid="2685605830386712477">"Հպեք՝ էկրանի պատկերը տեսնելու համար:"</string>
- <string name="screenshot_failed_title" msgid="705781116746922771">"Չհաջողվեց լուսանկարել էկրանի հանույթը:"</string>
+ <string name="screenshot_failed_title" msgid="705781116746922771">"Չհաջողվեց լուսանկարել էկրանի պատկերը:"</string>
<string name="screenshot_failed_to_save_unknown_text" msgid="7887826345701753830">"Էկրանի պատկերը պահելիս խնդիր առաջացավ:"</string>
<string name="screenshot_failed_to_save_text" msgid="2592658083866306296">"Չհաջողվեց պահել էկրանի պատկերը սահմանափակ հիշողության պատճառով:"</string>
<string name="screenshot_failed_to_capture_text" msgid="173674476457581486">"Հավելվածը կամ ձեր կազմակերպությունը չի թույլատրում էկրանի պատկերի ստացումը"</string>
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index dca021e..2199fff 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -307,6 +307,9 @@
<item name="android:colorControlHighlight">@*android:color/primary_text_material_dark</item>
<item name="*android:lockPatternStyle">@style/LockPatternStyle</item>
<item name="passwordStyle">@style/PasswordTheme</item>
+
+ <!-- Needed for MediaRoute chooser dialog -->
+ <item name="*android:isLightTheme">false</item>
</style>
<style name="Theme.SystemUI.Light" parent="@*android:style/Theme.DeviceDefault.QuickSettings">
diff --git a/packages/SystemUI/src/com/android/systemui/RoundedCorners.java b/packages/SystemUI/src/com/android/systemui/RoundedCorners.java
index 37e2402..b15b79f 100644
--- a/packages/SystemUI/src/com/android/systemui/RoundedCorners.java
+++ b/packages/SystemUI/src/com/android/systemui/RoundedCorners.java
@@ -18,20 +18,26 @@
import static com.android.systemui.tuner.TunablePadding.FLAG_END;
import android.app.Fragment;
+import android.content.res.ColorStateList;
+import android.graphics.Color;
import android.graphics.PixelFormat;
+import android.provider.Settings.Secure;
import android.support.annotation.VisibleForTesting;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
+import android.view.View.OnLayoutChangeListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
+import android.widget.ImageView;
import com.android.systemui.R.id;
import com.android.systemui.fragments.FragmentHostManager;
import com.android.systemui.fragments.FragmentHostManager.FragmentListener;
import com.android.systemui.plugins.qs.QS;
+import com.android.systemui.qs.SecureSetting;
import com.android.systemui.statusbar.phone.CollapsedStatusBarFragment;
import com.android.systemui.statusbar.phone.NavigationBarFragment;
import com.android.systemui.statusbar.phone.StatusBar;
@@ -69,12 +75,14 @@
mOverlay = LayoutInflater.from(mContext)
.inflate(R.layout.rounded_corners, null);
mOverlay.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
+ mOverlay.setAlpha(0);
mOverlay.findViewById(R.id.right).setRotation(90);
mContext.getSystemService(WindowManager.class)
.addView(mOverlay, getWindowLayoutParams());
mBottomOverlay = LayoutInflater.from(mContext)
.inflate(R.layout.rounded_corners, null);
+ mBottomOverlay.setAlpha(0);
mBottomOverlay.findViewById(R.id.right).setRotation(180);
mBottomOverlay.findViewById(R.id.left).setRotation(270);
WindowManager.LayoutParams layoutParams = getWindowLayoutParams();
@@ -88,6 +96,39 @@
mDensity = metrics.density;
Dependency.get(TunerService.class).addTunable(this, SIZE);
+
+ // Watch color inversion and invert the overlay as needed.
+ SecureSetting setting = new SecureSetting(mContext, Dependency.get(Dependency.MAIN_HANDLER),
+ Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED) {
+ @Override
+ protected void handleValueChanged(int value, boolean observedChange) {
+ int tint = value != 0 ? Color.WHITE : Color.BLACK;
+ ColorStateList tintList = ColorStateList.valueOf(tint);
+ ((ImageView) mOverlay.findViewById(id.left)).setImageTintList(tintList);
+ ((ImageView) mOverlay.findViewById(id.right)).setImageTintList(tintList);
+ ((ImageView) mBottomOverlay.findViewById(id.left)).setImageTintList(tintList);
+ ((ImageView) mBottomOverlay.findViewById(id.right)).setImageTintList(tintList);
+ }
+ };
+ setting.setListening(true);
+ setting.onChange(false);
+
+ mOverlay.addOnLayoutChangeListener(new OnLayoutChangeListener() {
+ @Override
+ public void onLayoutChange(View v, int left, int top, int right, int bottom,
+ int oldLeft,
+ int oldTop, int oldRight, int oldBottom) {
+ mOverlay.removeOnLayoutChangeListener(this);
+ mOverlay.animate()
+ .alpha(1)
+ .setDuration(1000)
+ .start();
+ mBottomOverlay.animate()
+ .alpha(1)
+ .setDuration(1000)
+ .start();
+ }
+ });
}
private void setupPadding(int padding) {
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsComponent.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsComponent.java
index f07027e..09a08f0 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsComponent.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsComponent.java
@@ -46,6 +46,11 @@
}
@Override
+ public void handleShowShutdownUi(boolean isReboot, String reason) {
+ mExtension.get().showShutdownUi(isReboot, reason);
+ }
+
+ @Override
public void handleShowGlobalActionsMenu() {
mExtension.get().showGlobalActions(this);
}
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
index 7799c01..33d5617 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
@@ -116,8 +116,6 @@
private static final String GLOBAL_ACTION_KEY_ASSIST = "assist";
private static final String GLOBAL_ACTION_KEY_RESTART = "restart";
- private static final float SHUTDOWN_SCRIM_ALPHA = 0.95f;
-
private final Context mContext;
private final GlobalActionsManager mWindowManagerFuncs;
private final AudioManager mAudioManager;
@@ -682,10 +680,7 @@
/** {@inheritDoc} */
public void onClick(DialogInterface dialog, int which) {
Action item = mAdapter.getItem(which);
- if ((item instanceof PowerAction)
- || (item instanceof RestartAction)) {
- if (mDialog != null) mDialog.fadeOut();
- } else if (!(item instanceof SilentModeTriStateAction)) {
+ if (!(item instanceof SilentModeTriStateAction)) {
dialog.dismiss();
}
item.onPress();
@@ -1325,23 +1320,6 @@
.start();
}
- public void fadeOut() {
- mHardwareLayout.setTranslationX(0);
- mHardwareLayout.setAlpha(1);
- mListView.animate()
- .alpha(0)
- .translationX(getAnimTranslation())
- .setDuration(300)
- .setInterpolator(new LogAccelerateInterpolator())
- .setUpdateListener(animation -> {
- float frac = animation.getAnimatedFraction();
- float alpha = NotificationUtils.interpolate(
- ScrimController.GRADIENT_SCRIM_ALPHA, SHUTDOWN_SCRIM_ALPHA, frac);
- mGradientDrawable.setAlpha((int) (alpha * 255));
- })
- .start();
- }
-
private float getAnimTranslation() {
return getContext().getResources().getDimension(
com.android.systemui.R.dimen.global_actions_panel_width) / 2;
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java
index 08b7b71..2cf230c 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java
@@ -14,17 +14,33 @@
package com.android.systemui.globalactions;
+import android.app.Dialog;
+import android.app.KeyguardManager;
+import android.app.WallpaperColors;
+import android.app.WallpaperManager;
+import android.content.Context;
+import android.graphics.Color;
+import android.graphics.Point;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+
+import com.android.internal.R;
+import com.android.internal.colorextraction.ColorExtractor.GradientColors;
+import com.android.internal.colorextraction.drawable.GradientDrawable;
+import com.android.settingslib.Utils;
import com.android.systemui.Dependency;
-import com.android.systemui.R;
+import com.android.systemui.colorextraction.SysuiColorExtractor;
import com.android.systemui.plugins.GlobalActions;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.statusbar.policy.KeyguardMonitor;
-import android.content.Context;
-import android.support.v7.view.ContextThemeWrapper;
-
public class GlobalActionsImpl implements GlobalActions {
+ private static final float SHUTDOWN_SCRIM_ALPHA = 0.95f;
+
private final Context mContext;
private final KeyguardMonitor mKeyguardMonitor;
private final DeviceProvisionedController mDeviceProvisionedController;
@@ -44,4 +60,51 @@
mGlobalActions.showDialog(mKeyguardMonitor.isShowing(),
mDeviceProvisionedController.isDeviceProvisioned());
}
+
+ @Override
+ public void showShutdownUi(boolean isReboot, String reason) {
+ GradientDrawable background = new GradientDrawable(mContext);
+ background.setAlpha((int) (SHUTDOWN_SCRIM_ALPHA * 255));
+
+ Dialog d = new Dialog(mContext,
+ com.android.systemui.R.style.Theme_SystemUI_Dialog_GlobalActions);
+ // Window initialization
+ Window window = d.getWindow();
+ window.getAttributes().width = ViewGroup.LayoutParams.MATCH_PARENT;
+ window.getAttributes().height = ViewGroup.LayoutParams.MATCH_PARENT;
+ window.setType(WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY);
+ window.requestFeature(Window.FEATURE_NO_TITLE);
+ window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND
+ | WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR);
+ window.addFlags(
+ WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
+ | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
+ | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
+ | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH
+ | WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
+ window.setBackgroundDrawable(background);
+ window.setWindowAnimations(R.style.Animation_Toast);
+
+ d.setContentView(R.layout.shutdown_dialog);
+ d.setCancelable(false);
+
+ int color = Utils.getColorAttr(mContext, com.android.systemui.R.attr.wallpaperTextColor);
+ boolean onKeyguard = mContext.getSystemService(
+ KeyguardManager.class).isKeyguardLocked();
+
+ ProgressBar bar = d.findViewById(R.id.progress);
+ bar.getIndeterminateDrawable().setTint(color);
+ TextView message = d.findViewById(R.id.text1);
+ message.setTextColor(color);
+ if (isReboot) message.setText(R.string.reboot_to_reset_message);
+
+ Point displaySize = new Point();
+ mContext.getDisplay().getRealSize(displaySize);
+ GradientColors colors = Dependency.get(SysuiColorExtractor.class).getColors(
+ onKeyguard ? WallpaperManager.FLAG_LOCK : WallpaperManager.FLAG_SYSTEM);
+ background.setColors(colors, false);
+ background.setScreenSize(displaySize.x, displaySize.y);
+
+ d.show();
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
index 6c6054c..b3f992d 100644
--- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
+++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java
@@ -71,10 +71,6 @@
TaskStackListener mTaskStackListener = new TaskStackListener() {
@Override
public void onActivityPinned(String packageName, int taskId) {
- if (!checkCurrentUserId(mContext, false /* debug */)) {
- return;
- }
-
mTouchHandler.onActivityPinned();
mMediaController.onActivityPinned();
mMenuController.onActivityPinned();
@@ -86,10 +82,6 @@
@Override
public void onActivityUnpinned() {
- if (!checkCurrentUserId(mContext, false /* debug */)) {
- return;
- }
-
ComponentName topPipActivity = PipUtils.getTopPinnedActivity(mContext,
mActivityManager);
mMenuController.onActivityUnpinned(topPipActivity);
@@ -116,10 +108,6 @@
@Override
public void onPinnedActivityRestartAttempt(boolean clearedTask) {
- if (!checkCurrentUserId(mContext, false /* debug */)) {
- return;
- }
-
mTouchHandler.getMotionHelper().expandPip(clearedTask /* skipAnimation */);
}
};
diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMediaController.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMediaController.java
index 62ec09b..b3a0794 100644
--- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMediaController.java
+++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMediaController.java
@@ -26,14 +26,18 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.media.session.MediaController;
import android.media.session.MediaSession;
import android.media.session.MediaSessionManager;
+import android.media.session.MediaSessionManager.OnActiveSessionsChangedListener;
import android.media.session.PlaybackState;
import android.os.UserHandle;
+import com.android.systemui.Dependency;
import com.android.systemui.R;
+import com.android.systemui.statusbar.policy.UserInfoController;
import java.util.ArrayList;
import java.util.Collections;
@@ -88,13 +92,21 @@
}
};
- private MediaController.Callback mPlaybackChangedListener = new MediaController.Callback() {
+ private final MediaController.Callback mPlaybackChangedListener = new MediaController.Callback() {
@Override
public void onPlaybackStateChanged(PlaybackState state) {
notifyActionsChanged();
}
};
+ private final MediaSessionManager.OnActiveSessionsChangedListener mSessionsChangedListener =
+ new OnActiveSessionsChangedListener() {
+ @Override
+ public void onActiveSessionsChanged(List<MediaController> controllers) {
+ resolveActiveMediaController(controllers);
+ }
+ };
+
private ArrayList<ActionListener> mListeners = new ArrayList<>();
public PipMediaController(Context context, IActivityManager activityManager) {
@@ -110,9 +122,11 @@
createMediaActions();
mMediaSessionManager =
(MediaSessionManager) context.getSystemService(Context.MEDIA_SESSION_SERVICE);
- mMediaSessionManager.addOnActiveSessionsChangedListener(controllers -> {
- resolveActiveMediaController(controllers);
- }, null);
+
+ // The media session listener needs to be re-registered when switching users
+ UserInfoController userInfoController = Dependency.get(UserInfoController.class);
+ userInfoController.addCallback((String name, Drawable picture, String userAccount) ->
+ registerSessionListenerForCurrentUser());
}
/**
@@ -120,7 +134,8 @@
*/
public void onActivityPinned() {
// Once we enter PiP, try to find the active media controller for the top most activity
- resolveActiveMediaController(mMediaSessionManager.getActiveSessions(null));
+ resolveActiveMediaController(mMediaSessionManager.getActiveSessionsForUser(null,
+ UserHandle.USER_CURRENT));
}
/**
@@ -201,6 +216,15 @@
}
/**
+ * Re-registers the session listener for the current user.
+ */
+ private void registerSessionListenerForCurrentUser() {
+ mMediaSessionManager.removeOnActiveSessionsChangedListener(mSessionsChangedListener);
+ mMediaSessionManager.addOnActiveSessionsChangedListener(mSessionsChangedListener, null,
+ UserHandle.USER_CURRENT, null);
+ }
+
+ /**
* Tries to find and set the active media controller for the top PiP activity.
*/
private void resolveActiveMediaController(List<MediaController> controllers) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index c4d88ae..8f41084 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -46,6 +46,7 @@
import com.android.systemui.settings.BrightnessController;
import com.android.systemui.settings.ToggleSliderView;
import com.android.systemui.statusbar.policy.BrightnessMirrorController;
+import com.android.systemui.statusbar.policy.BrightnessMirrorController.BrightnessMirrorListener;
import com.android.systemui.tuner.TunerService;
import com.android.systemui.tuner.TunerService.Tunable;
@@ -53,7 +54,7 @@
import java.util.Collection;
/** View that represents the quick settings tile panel. **/
-public class QSPanel extends LinearLayout implements Tunable, Callback {
+public class QSPanel extends LinearLayout implements Tunable, Callback, BrightnessMirrorListener {
public static final String QS_SHOW_BRIGHTNESS = "qs_show_brightness";
@@ -152,6 +153,9 @@
if (mHost != null) {
setTiles(mHost.getTiles());
}
+ if (mBrightnessMirrorController != null) {
+ mBrightnessMirrorController.addCallback(this);
+ }
}
@Override
@@ -163,6 +167,9 @@
for (TileRecord record : mRecords) {
record.tile.removeCallbacks();
}
+ if (mBrightnessMirrorController != null) {
+ mBrightnessMirrorController.removeCallback(this);
+ }
super.onDetachedFromWindow();
}
@@ -194,12 +201,19 @@
}
public void setBrightnessMirror(BrightnessMirrorController c) {
+ if (mBrightnessMirrorController != null) {
+ mBrightnessMirrorController.removeCallback(this);
+ }
mBrightnessMirrorController = c;
- ToggleSliderView brightnessSlider = findViewById(R.id.brightness_slider);
- ToggleSliderView mirror = c.getMirror().findViewById(
- R.id.brightness_slider);
- brightnessSlider.setMirror(mirror);
- brightnessSlider.setMirrorController(c);
+ if (mBrightnessMirrorController != null) {
+ mBrightnessMirrorController.addCallback(this);
+ }
+ updateBrightnessMirror();
+ }
+
+ @Override
+ public void onBrightnessMirrorReinflated(View brightnessMirror) {
+ updateBrightnessMirror();
}
View getBrightnessView() {
@@ -246,9 +260,16 @@
super.onConfigurationChanged(newConfig);
mFooter.onConfigurationChanged();
+ updateBrightnessMirror();
+ }
+
+ public void updateBrightnessMirror() {
if (mBrightnessMirrorController != null) {
- // Reload the mirror in case it got reinflated but we didn't.
- setBrightnessMirror(mBrightnessMirrorController);
+ ToggleSliderView brightnessSlider = findViewById(R.id.brightness_slider);
+ ToggleSliderView mirrorSlider = mBrightnessMirrorController.getMirror()
+ .findViewById(R.id.brightness_slider);
+ brightnessSlider.setMirror(mirrorSlider);
+ brightnessSlider.setMirrorController(mBrightnessMirrorController);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/IRecentsSystemUserCallbacks.aidl b/packages/SystemUI/src/com/android/systemui/recents/IRecentsSystemUserCallbacks.aidl
index 1240e05..cc7798e 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/IRecentsSystemUserCallbacks.aidl
+++ b/packages/SystemUI/src/com/android/systemui/recents/IRecentsSystemUserCallbacks.aidl
@@ -31,4 +31,5 @@
void sendRecentsDrawnEvent();
void sendDockingTopTaskEvent(int dragMode, in Rect initialRect);
void sendLaunchRecentsEvent();
+ void setWaitingForTransitionStartEvent(boolean waitingForTransitionStart);
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/Recents.java b/packages/SystemUI/src/com/android/systemui/recents/Recents.java
index a5c994e..d10e080 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/Recents.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/Recents.java
@@ -54,9 +54,11 @@
import com.android.systemui.recents.events.EventBus;
import com.android.systemui.recents.events.activity.ConfigurationChangedEvent;
import com.android.systemui.recents.events.activity.DockedTopTaskEvent;
+import com.android.systemui.recents.events.activity.LaunchTaskFailedEvent;
import com.android.systemui.recents.events.activity.RecentsActivityStartingEvent;
import com.android.systemui.recents.events.component.RecentsVisibilityChangedEvent;
import com.android.systemui.recents.events.component.ScreenPinningRequestEvent;
+import com.android.systemui.recents.events.component.SetWaitingForTransitionStartEvent;
import com.android.systemui.recents.events.component.ShowUserToastEvent;
import com.android.systemui.recents.events.ui.RecentsDrawnEvent;
import com.android.systemui.recents.misc.SystemServicesProxy;
@@ -612,6 +614,14 @@
}
});
}
+
+ // This will catch the cases when a user launches from recents to another app
+ // (and vice versa) that is not in the recents stack (such as home or bugreport) and it
+ // would not reset the wait for transition flag. This will catch it and make sure that the
+ // flag is reset.
+ if (!event.visible) {
+ mImpl.setWaitingForTransitionStart(false);
+ }
}
/**
@@ -684,6 +694,11 @@
}
}
+ public final void onBusEvent(LaunchTaskFailedEvent event) {
+ // Reset the transition when tasks fail to launch
+ mImpl.setWaitingForTransitionStart(false);
+ }
+
public final void onBusEvent(ConfigurationChangedEvent event) {
// Update the configuration for the Recents component when the activity configuration
// changes as well
@@ -711,6 +726,25 @@
}
}
+ public final void onBusEvent(SetWaitingForTransitionStartEvent event) {
+ int processUser = sSystemServicesProxy.getProcessUser();
+ if (sSystemServicesProxy.isSystemUser(processUser)) {
+ mImpl.setWaitingForTransitionStart(event.waitingForTransitionStart);
+ } else {
+ postToSystemUser(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ mUserToSystemCallbacks.setWaitingForTransitionStartEvent(
+ event.waitingForTransitionStart);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Callback failed", e);
+ }
+ }
+ });
+ }
+ }
+
/**
* Attempts to register with the system user.
*/
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
index c0550b5..585b151 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
@@ -182,6 +182,9 @@
if (action.equals(Intent.ACTION_SCREEN_OFF)) {
// When the screen turns off, dismiss Recents to Home
dismissRecentsToHomeIfVisible(false);
+ } else if (action.equals(Intent.ACTION_USER_SWITCHED)) {
+ // When switching users, dismiss Recents to Home similar to screen off
+ finish();
} else if (action.equals(Intent.ACTION_TIME_CHANGED)) {
// If the time shifts but the currentTime >= lastStackActiveTime, then that boundary
// is still valid. Otherwise, we need to reset the lastStackactiveTime to the
@@ -375,6 +378,7 @@
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_SCREEN_OFF);
filter.addAction(Intent.ACTION_TIME_CHANGED);
+ filter.addAction(Intent.ACTION_USER_SWITCHED);
registerReceiver(mSystemBroadcastReceiver, filter);
getWindow().addPrivateFlags(LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION);
@@ -400,6 +404,17 @@
// Notify of the next draw
mRecentsView.getViewTreeObserver().addOnPreDrawListener(mRecentsDrawnEventListener);
+
+ // If Recents was restarted, then it should complete the enter animation with partially
+ // reset launch state with dock, app and home set to false
+ Object isRelaunching = getLastNonConfigurationInstance();
+ if (isRelaunching != null && isRelaunching instanceof Boolean && (boolean) isRelaunching) {
+ RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState();
+ launchState.launchedViaDockGesture = false;
+ launchState.launchedFromApp = false;
+ launchState.launchedFromHome = false;
+ onEnterAnimationComplete();
+ }
}
@Override
@@ -505,6 +520,11 @@
}
@Override
+ public Object onRetainNonConfigurationInstance() {
+ return true;
+ }
+
+ @Override
protected void onPause() {
super.onPause();
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
index 7cd93bb..86e93fd 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java
@@ -24,12 +24,11 @@
import android.app.ActivityManager;
import android.app.ActivityManager.TaskSnapshot;
import android.app.ActivityOptions;
+import android.app.ActivityOptions.OnAnimationStartedListener;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
import android.graphics.GraphicBuffer;
import android.graphics.Rect;
import android.graphics.RectF;
@@ -208,6 +207,20 @@
protected static RecentsTaskLoadPlan sInstanceLoadPlan;
// Stores the last pinned task time
protected static long sLastPipTime = -1;
+ // Stores whether we are waiting for a transition to/from recents to start. During this time,
+ // we disallow the user from manually toggling recents until the transition has started.
+ private static boolean mWaitingForTransitionStart = false;
+ // Stores whether or not the user toggled while we were waiting for a transition to/from
+ // recents. In this case, we defer the toggle state until then and apply it immediately after.
+ private static boolean mToggleFollowingTransitionStart = true;
+
+ private ActivityOptions.OnAnimationStartedListener mResetToggleFlagListener =
+ new OnAnimationStartedListener() {
+ @Override
+ public void onAnimationStarted() {
+ setWaitingForTransitionStart(false);
+ }
+ };
protected Context mContext;
protected Handler mHandler;
@@ -365,6 +378,11 @@
return;
}
+ if (mWaitingForTransitionStart) {
+ mToggleFollowingTransitionStart = true;
+ return;
+ }
+
mDraggingInRecents = false;
mLaunchedWhileDocking = false;
mTriggeredFromAltTab = false;
@@ -638,6 +656,18 @@
}
}
+ public void setWaitingForTransitionStart(boolean waitingForTransitionStart) {
+ if (mWaitingForTransitionStart == waitingForTransitionStart) {
+ return;
+ }
+
+ mWaitingForTransitionStart = waitingForTransitionStart;
+ if (!waitingForTransitionStart && mToggleFollowingTransitionStart) {
+ toggleRecents(DividerView.INVALID_RECENTS_GROW_TARGET);
+ }
+ mToggleFollowingTransitionStart = false;
+ }
+
/**
* Returns the preloaded load plan and invalidates it.
*/
@@ -865,8 +895,9 @@
}
AppTransitionAnimationSpec[] specsArray = new AppTransitionAnimationSpec[specs.size()];
specs.toArray(specsArray);
+
return new Pair<>(ActivityOptions.makeThumbnailAspectScaleDownAnimation(mDummyStackView,
- specsArray, mHandler, null, this), null);
+ specsArray, mHandler, mResetToggleFlagListener, this), null);
} else {
// Update the destination rect
Task toTask = new Task();
@@ -884,8 +915,10 @@
return Lists.newArrayList(new AppTransitionAnimationSpec(
toTask.key.id, thumbnail, rect));
});
+
return new Pair<>(ActivityOptions.makeMultiThumbFutureAspectScaleAnimation(mContext,
- mHandler, future.getFuture(), null, false /* scaleUp */), future);
+ mHandler, future.getFuture(), mResetToggleFlagListener, false /* scaleUp */),
+ future);
}
}
@@ -991,6 +1024,10 @@
launchState.launchedToTaskId = runningTaskId;
launchState.launchedWithAltTab = mTriggeredFromAltTab;
+ // Disable toggling of recents between starting the activity and it is visible and the app
+ // has started its transition into recents.
+ setWaitingForTransitionStart(useThumbnailTransition);
+
// Preload the icon (this will be a null-op if we have preloaded the icon already in
// preloadRecents())
preloadIcon(runningTaskId);
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsSystemUser.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsSystemUser.java
index 3921a20..1285626 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsSystemUser.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsSystemUser.java
@@ -29,6 +29,7 @@
import com.android.systemui.recents.events.EventBus;
import com.android.systemui.recents.events.activity.DockedTopTaskEvent;
import com.android.systemui.recents.events.activity.RecentsActivityStartingEvent;
+import com.android.systemui.recents.events.component.SetWaitingForTransitionStartEvent;
import com.android.systemui.recents.events.ui.RecentsDrawnEvent;
import com.android.systemui.recents.misc.ForegroundThread;
@@ -105,4 +106,10 @@
public void sendLaunchRecentsEvent() throws RemoteException {
EventBus.getDefault().post(new RecentsActivityStartingEvent());
}
+
+ @Override
+ public void setWaitingForTransitionStartEvent(boolean waitingForTransitionStart) {
+ EventBus.getDefault().post(new SetWaitingForTransitionStartEvent(
+ waitingForTransitionStart));
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/events/component/SetWaitingForTransitionStartEvent.java b/packages/SystemUI/src/com/android/systemui/recents/events/component/SetWaitingForTransitionStartEvent.java
new file mode 100644
index 0000000..d9cf5fb
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/recents/events/component/SetWaitingForTransitionStartEvent.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.recents.events.component;
+
+import com.android.systemui.recents.events.EventBus;
+
+/**
+ * This is sent when we are setting/resetting the flag to wait for the transition to start.
+ */
+public class SetWaitingForTransitionStartEvent extends EventBus.Event {
+
+ public final boolean waitingForTransitionStart;
+
+ public SetWaitingForTransitionStartEvent(boolean waitingForTransitionStart) {
+ this.waitingForTransitionStart = waitingForTransitionStart;
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsTransitionHelper.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsTransitionHelper.java
index ce40f20..127822a 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsTransitionHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsTransitionHelper.java
@@ -54,6 +54,7 @@
import com.android.systemui.recents.events.activity.LaunchTaskStartedEvent;
import com.android.systemui.recents.events.activity.LaunchTaskSucceededEvent;
import com.android.systemui.recents.events.component.ScreenPinningRequestEvent;
+import com.android.systemui.recents.events.component.SetWaitingForTransitionStartEvent;
import com.android.systemui.recents.misc.SystemServicesProxy;
import com.android.systemui.recents.model.Task;
import com.android.systemui.recents.model.TaskStack;
@@ -117,31 +118,58 @@
final Rect windowRect = Recents.getSystemServices().getWindowRect();
transitionFuture = getAppTransitionFuture(
() -> composeAnimationSpecs(task, stackView, destinationStack, windowRect));
- animStartedListener = () -> {
- // If we are launching into another task, cancel the previous task's
- // window transition
- EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(task));
- EventBus.getDefault().send(new ExitRecentsWindowFirstAnimationFrameEvent());
- stackView.cancelAllTaskViewAnimations();
+ animStartedListener = new OnAnimationStartedListener() {
+ private boolean mHandled;
- if (screenPinningRequested) {
- // Request screen pinning after the animation runs
- mStartScreenPinningRunnable.taskId = task.key.id;
- mHandler.postDelayed(mStartScreenPinningRunnable, 350);
+ @Override
+ public void onAnimationStarted() {
+ if (mHandled) {
+ return;
+ }
+ mHandled = true;
+
+ // If we are launching into another task, cancel the previous task's
+ // window transition
+ EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(task));
+ EventBus.getDefault().send(new ExitRecentsWindowFirstAnimationFrameEvent());
+ stackView.cancelAllTaskViewAnimations();
+
+ if (screenPinningRequested) {
+ // Request screen pinning after the animation runs
+ mStartScreenPinningRunnable.taskId = task.key.id;
+ mHandler.postDelayed(mStartScreenPinningRunnable, 350);
+ }
+
+ // Reset the state where we are waiting for the transition to start
+ EventBus.getDefault().send(new SetWaitingForTransitionStartEvent(false));
}
};
} else {
// This is only the case if the task is not on screen (scrolled offscreen for example)
transitionFuture = null;
- animStartedListener = () -> {
- // If we are launching into another task, cancel the previous task's
- // window transition
- EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(task));
- EventBus.getDefault().send(new ExitRecentsWindowFirstAnimationFrameEvent());
- stackView.cancelAllTaskViewAnimations();
+ animStartedListener = new OnAnimationStartedListener() {
+ private boolean mHandled;
+
+ @Override
+ public void onAnimationStarted() {
+ if (mHandled) {
+ return;
+ }
+ mHandled = true;
+
+ // If we are launching into another task, cancel the previous task's
+ // window transition
+ EventBus.getDefault().send(new CancelEnterRecentsWindowAnimationEvent(task));
+ EventBus.getDefault().send(new ExitRecentsWindowFirstAnimationFrameEvent());
+ stackView.cancelAllTaskViewAnimations();
+
+ // Reset the state where we are waiting for the transition to start
+ EventBus.getDefault().send(new SetWaitingForTransitionStartEvent(false));
+ }
};
}
+ EventBus.getDefault().send(new SetWaitingForTransitionStartEvent(true));
final ActivityOptions opts = ActivityOptions.makeMultiThumbFutureAspectScaleAnimation(mContext,
mHandler, transitionFuture != null ? transitionFuture.future : null,
animStartedListener, true /* scaleUp */);
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
index 15b682e..a633a3e 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
@@ -219,6 +219,7 @@
private boolean mResetToInitialStateWhenResized;
private int mLastWidth;
private int mLastHeight;
+ private boolean mStackActionButtonVisible;
// We keep track of the task view focused by user interaction and draw a frame around it in the
// grid layout.
@@ -287,6 +288,7 @@
mDividerSize = ssp.getDockedDividerSize(context);
mDisplayOrientation = Utilities.getAppConfiguration(mContext).orientation;
mDisplayRect = ssp.getDisplayRect();
+ mStackActionButtonVisible = false;
// Create a frame to draw around the focused task view
if (Recents.getConfiguration().isGridEnabled) {
@@ -975,6 +977,9 @@
mLayoutAlgorithm.clearUnfocusedTaskOverrides();
willScroll = mAnimationHelper.startScrollToFocusedTaskAnimation(newFocusedTask,
requestViewFocus);
+ if (willScroll) {
+ sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SCROLLED);
+ }
} else {
// Focus the task view
TaskView newFocusedTaskView = getChildViewForTask(newFocusedTask);
@@ -1159,7 +1164,7 @@
Task focusedTask = getAccessibilityFocusedTask();
info.setScrollable(true);
int focusedTaskIndex = mStack.indexOfStackTask(focusedTask);
- if (focusedTaskIndex > 0) {
+ if (focusedTaskIndex > 0 || !mStackActionButtonVisible) {
info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
}
if (0 <= focusedTaskIndex && focusedTaskIndex < mStack.getTaskCount() - 1) {
@@ -1812,6 +1817,18 @@
}
}
+ public final void onBusEvent(ShowStackActionButtonEvent event) {
+ if (RecentsDebugFlags.Static.EnableStackActionButton) {
+ mStackActionButtonVisible = true;
+ }
+ }
+
+ public final void onBusEvent(HideStackActionButtonEvent event) {
+ if (RecentsDebugFlags.Static.EnableStackActionButton) {
+ mStackActionButtonVisible = false;
+ }
+ }
+
public final void onBusEvent(LaunchNextTaskRequestEvent event) {
if (!mFinishedLayoutAfterStackReload) {
mLaunchNextAfterFirstMeasure = true;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
index 2e10831..bbf9eb1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -80,6 +80,7 @@
private static final int MSG_HANDLE_SYSTEM_KEY = 33 << MSG_SHIFT;
private static final int MSG_SHOW_GLOBAL_ACTIONS = 34 << MSG_SHIFT;
private static final int MSG_TOGGLE_PANEL = 35 << MSG_SHIFT;
+ private static final int MSG_SHOW_SHUTDOWN_UI = 36 << MSG_SHIFT;
public static final int FLAG_EXCLUDE_NONE = 0;
public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0;
@@ -138,6 +139,7 @@
default void handleSystemKey(int arg1) { }
default void handleShowGlobalActionsMenu() { }
+ default void handleShowShutdownUi(boolean isReboot, String reason) { }
}
@VisibleForTesting
@@ -438,6 +440,15 @@
}
}
+ @Override
+ public void showShutdownUi(boolean isReboot, String reason) {
+ synchronized (mLock) {
+ mHandler.removeMessages(MSG_SHOW_SHUTDOWN_UI);
+ mHandler.obtainMessage(MSG_SHOW_SHUTDOWN_UI, isReboot ? 1 : 0, 0, reason)
+ .sendToTarget();
+ }
+ }
+
private final class H extends Handler {
private H(Looper l) {
super(l);
@@ -624,6 +635,11 @@
mCallbacks.get(i).handleShowGlobalActionsMenu();
}
break;
+ case MSG_SHOW_SHUTDOWN_UI:
+ for (int i = 0; i < mCallbacks.size(); i++) {
+ mCallbacks.get(i).handleShowShutdownUi(msg.arg1 != 0, (String) msg.obj);
+ }
+ break;
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeScrimController.java
index 3794ac6..c45c05e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeScrimController.java
@@ -23,14 +23,11 @@
import android.content.Context;
import android.os.Handler;
import android.util.Log;
-import android.view.View;
import android.view.animation.Interpolator;
-import com.android.keyguard.KeyguardStatusView;
import com.android.systemui.Interpolators;
import com.android.systemui.doze.DozeHost;
import com.android.systemui.doze.DozeLog;
-import com.android.systemui.doze.DozeTriggers;
/**
* Controller which handles all the doze animations of the scrims.
@@ -341,18 +338,31 @@
if (!mDozing) return;
startScrimAnimation(true /* inFront */, 1,
mDozeParameters.getPulseOutDuration(),
- Interpolators.ALPHA_IN, mPulseOutFinished);
+ Interpolators.ALPHA_IN, mPulseOutFinishing);
+ }
+ };
+
+ private final Runnable mPulseOutFinishing = new Runnable() {
+ @Override
+ public void run() {
+ if (DEBUG) Log.d(TAG, "Pulse out finished");
+ DozeLog.tracePulseFinish();
+ if (mDozeParameters.getAlwaysOn() && mDozing) {
+ // Setting power states can block rendering. For AOD, delay finishing the pulse and
+ // setting the power state until the fully black scrim had time to hit the
+ // framebuffer.
+ mHandler.postDelayed(mPulseOutFinished, 30);
+ } else {
+ mPulseOutFinished.run();
+ }
}
};
private final Runnable mPulseOutFinished = new Runnable() {
@Override
public void run() {
- if (DEBUG) Log.d(TAG, "Pulse out finished");
- DozeLog.tracePulseFinish();
-
// Signal that the pulse is all finished so we can turn the screen off now.
- pulseFinished();
+ DozeScrimController.this.pulseFinished();
if (mDozeParameters.getAlwaysOn()) {
mScrimController.setDozeInFrontAlpha(mAodFrontScrimOpacity);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
index cdba24c..6cfa838 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java
@@ -332,6 +332,7 @@
lp.width = getResources().getDimensionPixelSize(R.dimen.keyguard_affordance_width);
lp.height = getResources().getDimensionPixelSize(R.dimen.keyguard_affordance_height);
mLockIcon.setLayoutParams(lp);
+ mLockIcon.setContentDescription(getContext().getText(R.string.accessibility_unlock_button));
mLockIcon.update(true /* force */);
lp = mLeftAffordanceView.getLayoutParams();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
index 881de67..a6691b1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java
@@ -50,6 +50,7 @@
import com.android.systemui.statusbar.policy.KeyguardUserSwitcher;
import com.android.systemui.statusbar.policy.UserInfoController;
import com.android.systemui.statusbar.policy.UserInfoController.OnUserInfoChangedListener;
+import com.android.systemui.statusbar.policy.UserInfoControllerImpl;
import com.android.systemui.statusbar.policy.UserSwitcherController;
/**
@@ -346,6 +347,9 @@
applyDarkness(R.id.signal_cluster, tintArea, intensity, iconColor);
applyDarkness(R.id.battery, tintArea, intensity, iconColor);
applyDarkness(R.id.clock, tintArea, intensity, iconColor);
+ // Reload user avatar
+ ((UserInfoControllerImpl) Dependency.get(UserInfoController.class))
+ .onDensityOrFontScaleChanged();
}
private void applyDarkness(int id, Rect tintArea, float intensity, int color) {
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 479b945..1d64480 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -543,7 +543,7 @@
mKeyguardFadingOutInProgress = false;
mAnimatingDozeUnlock = false;
}
- if (mWakingUpFromAodAnimationRunning) {
+ if (mWakingUpFromAodAnimationRunning && !mDeferFinishedListener) {
mWakingUpFromAodAnimationRunning = false;
mWakingUpFromAodInProgress = false;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
index 6f710da..b4b859c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -103,7 +103,7 @@
private boolean mDeferScrimFadeOut;
// Dismiss action to be launched when we stop dozing or the keyguard is gone.
- private PendingDismissActionRequest mPendingDismissAction;
+ private DismissWithActionRequest mPendingWakeupAction;
private final KeyguardUpdateMonitorCallback mUpdateMonitorCallback =
new KeyguardUpdateMonitorCallback() {
@@ -113,7 +113,7 @@
// Since we won't get a setOccluded call we have to reset the view manually such that
// the bouncer goes away.
if (mOccluded) {
- reset(false /* hideBouncerWhenShowing */);
+ reset(true /* hideBouncerWhenShowing */);
}
}
};
@@ -174,7 +174,7 @@
private void hideBouncer(boolean destroyView) {
mBouncer.hide(destroyView);
- cancelPendingDismissAction();
+ cancelPendingWakeupAction();
}
private void showBouncer() {
@@ -187,11 +187,11 @@
public void dismissWithAction(OnDismissAction r, Runnable cancelAction,
boolean afterKeyguardGone) {
if (mShowing) {
- cancelPendingDismissAction();
+ cancelPendingWakeupAction();
// If we're dozing, this needs to be delayed until after we wake up - unless we're
// wake-and-unlocking, because there dozing will last until the end of the transition.
if (mDozing && !isWakeAndUnlocking()) {
- mPendingDismissAction = new PendingDismissActionRequest(
+ mPendingWakeupAction = new DismissWithActionRequest(
r, cancelAction, afterKeyguardGone);
return;
}
@@ -280,7 +280,7 @@
updateStates();
if (!dozing) {
- launchPendingDismissAction();
+ launchPendingWakeupAction();
}
}
}
@@ -316,6 +316,7 @@
return;
}
}
+ boolean isOccluding = !mOccluded && occluded;
mOccluded = occluded;
if (mShowing) {
mStatusBar.updateMediaMetaData(false, animate && !occluded);
@@ -326,7 +327,7 @@
if (!mDozing) {
// If Keyguard is reshown, don't hide the bouncer as it might just have been requested
// by a FLAG_DISMISS_KEYGUARD_ACTIVITY.
- reset(false /* hideBouncerWhenShowing*/);
+ reset(isOccluding /* hideBouncerWhenShowing*/);
}
if (animate && !occluded && mShowing) {
mStatusBar.animateKeyguardUnoccluding();
@@ -357,7 +358,7 @@
*/
public void hide(long startTime, long fadeoutDuration) {
mShowing = false;
- launchPendingDismissAction();
+ launchPendingWakeupAction();
if (KeyguardUpdateMonitor.getInstance(mContext).needsSlowUnlockTransition()) {
fadeoutDuration = KEYGUARD_DISMISS_DURATION_LOCKED;
@@ -685,9 +686,9 @@
return mStatusBar.getStatusBarView().getViewRootImpl();
}
- public void launchPendingDismissAction() {
- PendingDismissActionRequest request = mPendingDismissAction;
- mPendingDismissAction = null;
+ public void launchPendingWakeupAction() {
+ DismissWithActionRequest request = mPendingWakeupAction;
+ mPendingWakeupAction = null;
if (request != null) {
if (mShowing) {
dismissWithAction(request.dismissAction, request.cancelAction,
@@ -698,20 +699,20 @@
}
}
- public void cancelPendingDismissAction() {
- PendingDismissActionRequest request = mPendingDismissAction;
- mPendingDismissAction = null;
+ public void cancelPendingWakeupAction() {
+ DismissWithActionRequest request = mPendingWakeupAction;
+ mPendingWakeupAction = null;
if (request != null && request.cancelAction != null) {
request.cancelAction.run();
}
}
- private static class PendingDismissActionRequest {
+ private static class DismissWithActionRequest {
final OnDismissAction dismissAction;
final Runnable cancelAction;
final boolean afterKeyguardGone;
- PendingDismissActionRequest(OnDismissAction dismissAction, Runnable cancelAction,
+ DismissWithActionRequest(OnDismissAction dismissAction, Runnable cancelAction,
boolean afterKeyguardGone) {
this.dismissAction = dismissAction;
this.cancelAction = cancelAction;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java
index 718c348..42ce4c5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BrightnessMirrorController.java
@@ -16,14 +16,15 @@
package com.android.systemui.statusbar.policy;
+import android.util.ArraySet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewPropertyAnimator;
import android.widget.FrameLayout;
+import com.android.internal.util.Preconditions;
import com.android.systemui.Interpolators;
import com.android.systemui.R;
-import com.android.systemui.statusbar.ScrimView;
import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.phone.StatusBarWindowView;
import com.android.systemui.statusbar.stack.NotificationStackScrollLayout;
@@ -31,7 +32,8 @@
/**
* Controls showing and hiding of the brightness mirror.
*/
-public class BrightnessMirrorController {
+public class BrightnessMirrorController
+ implements CallbackController<BrightnessMirrorController.BrightnessMirrorListener> {
private final NotificationStackScrollLayout mStackScroller;
public long TRANSITION_DURATION_OUT = 150;
@@ -40,6 +42,7 @@
private final StatusBarWindowView mStatusBarWindow;
private final ScrimController mScrimController;
private final View mNotificationPanel;
+ private final ArraySet<BrightnessMirrorListener> mBrightnessMirrorListeners = new ArraySet<>();
private final int[] mInt2Cache = new int[2];
private View mBrightnessMirror;
@@ -130,5 +133,24 @@
mBrightnessMirror = LayoutInflater.from(mBrightnessMirror.getContext()).inflate(
R.layout.brightness_mirror, mStatusBarWindow, false);
mStatusBarWindow.addView(mBrightnessMirror, index);
+
+ for (int i = 0; i < mBrightnessMirrorListeners.size(); i++) {
+ mBrightnessMirrorListeners.valueAt(i).onBrightnessMirrorReinflated(mBrightnessMirror);
+ }
+ }
+
+ @Override
+ public void addCallback(BrightnessMirrorListener listener) {
+ Preconditions.checkNotNull(listener);
+ mBrightnessMirrorListeners.add(listener);
+ }
+
+ @Override
+ public void removeCallback(BrightnessMirrorListener listener) {
+ mBrightnessMirrorListeners.remove(listener);
+ }
+
+ public interface BrightnessMirrorListener {
+ void onBrightnessMirrorReinflated(View brightnessMirror);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserInfoControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserInfoControllerImpl.java
index b1e4b03..527addf 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserInfoControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserInfoControllerImpl.java
@@ -131,6 +131,7 @@
final int userId = userInfo.id;
final boolean isGuest = userInfo.isGuest();
final String userName = userInfo.name;
+ final boolean lightIcon = mContext.getThemeResId() != R.style.Theme_SystemUI_Light;
final Resources res = mContext.getResources();
final int avatarSize = Math.max(
@@ -154,7 +155,7 @@
.setIcon(rawAvatar).setBadgeIfManagedUser(mContext, userId).bake();
} else {
avatar = UserIcons.getDefaultUserIcon(isGuest? UserHandle.USER_NULL : userId,
- /* light= */ true);
+ lightIcon);
}
// If it's a single-user device, get the profile name, since the nickname is not
diff --git a/packages/SystemUI/src/com/android/systemui/volume/Events.java b/packages/SystemUI/src/com/android/systemui/volume/Events.java
index 8ed4fca..49a12f4 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/Events.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/Events.java
@@ -79,14 +79,16 @@
public static final int DISMISS_REASON_SCREEN_OFF = 4;
public static final int DISMISS_REASON_SETTINGS_CLICKED = 5;
public static final int DISMISS_REASON_DONE_CLICKED = 6;
+ public static final int DISMISS_STREAM_GONE = 7;
public static final String[] DISMISS_REASONS = {
- "unknown",
- "touch_outside",
- "volume_controller",
- "timeout",
- "screen_off",
- "settings_clicked",
- "done_clicked",
+ "unknown",
+ "touch_outside",
+ "volume_controller",
+ "timeout",
+ "screen_off",
+ "settings_clicked",
+ "done_clicked",
+ "a11y_stream_changed"
};
public static final int SHOW_REASON_UNKNOWN = 0;
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
index bc8c566..7f5c595 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
@@ -1059,7 +1059,12 @@
public void onAccessibilityModeChanged(Boolean showA11yStream) {
boolean show = showA11yStream == null ? false : showA11yStream;
mShowA11yStream = show;
- updateRowsH(getActiveRow());
+ VolumeRow activeRow = getActiveRow();
+ if (!mShowA11yStream && AudioManager.STREAM_ACCESSIBILITY == activeRow.stream) {
+ dismissH(Events.DISMISS_STREAM_GONE);
+ } else {
+ updateRowsH(activeRow);
+ }
}
};
diff --git a/proto/src/wifi.proto b/proto/src/wifi.proto
index 28e3427..c4dc506 100644
--- a/proto/src/wifi.proto
+++ b/proto/src/wifi.proto
@@ -276,6 +276,42 @@
// Count of saved Passpoint providers device has ever connected to.
optional int32 num_passpoint_providers_successfully_connected = 63;
+
+ // Histogram counting instances of scans with N many ScanResults with unique ssids
+ repeated NumConnectableNetworksBucket total_ssids_in_scan_histogram = 64;
+
+ // Histogram counting instances of scans with N many ScanResults/bssids
+ repeated NumConnectableNetworksBucket total_bssids_in_scan_histogram = 65;
+
+ // Histogram counting instances of scans with N many unique open ssids
+ repeated NumConnectableNetworksBucket available_open_ssids_in_scan_histogram = 66;
+
+ // Histogram counting instances of scans with N many bssids for open networks
+ repeated NumConnectableNetworksBucket available_open_bssids_in_scan_histogram = 67;
+
+ // Histogram counting instances of scans with N many unique ssids for saved networks
+ repeated NumConnectableNetworksBucket available_saved_ssids_in_scan_histogram = 68;
+
+ // Histogram counting instances of scans with N many bssids for saved networks
+ repeated NumConnectableNetworksBucket available_saved_bssids_in_scan_histogram = 69;
+
+ // Histogram counting instances of scans with N many unique SSIDs for open or saved networks
+ repeated NumConnectableNetworksBucket available_open_or_saved_ssids_in_scan_histogram = 70;
+
+ // Histogram counting instances of scans with N many BSSIDs for open or saved networks
+ repeated NumConnectableNetworksBucket available_open_or_saved_bssids_in_scan_histogram = 71;
+
+ // Histogram counting instances of scans with N many ScanResults matching unique saved passpoint providers
+ repeated NumConnectableNetworksBucket available_saved_passpoint_provider_profiles_in_scan_histogram = 72;
+
+ // Histogram counting instances of scans with N many ScanResults BSSIDs matching a saved passpoint provider
+ repeated NumConnectableNetworksBucket available_saved_passpoint_provider_bssids_in_scan_histogram = 73;
+
+ // Counts the number of AllSingleScanLister.onResult calls with a full band scan result
+ optional int32 full_band_all_single_scan_listener_results = 74;
+
+ // Counts the number of AllSingleScanLister.onResult calls with a partial (channels) scan result
+ optional int32 partial_all_single_scan_listener_results = 75;
}
// Information that gets logged for every WiFi connection.
@@ -883,3 +919,11 @@
}
}
+// Data point used to build 'Number of Connectable Network' histograms
+message NumConnectableNetworksBucket {
+ // Number of connectable networks seen in a scan result
+ optional int32 num_connectable_networks = 1 [default = 0];
+
+ // Number of scan results with num_connectable_networks
+ optional int32 count = 2 [default = 0];
+}
diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java
index d47ca1c..cb4becc 100644
--- a/services/backup/java/com/android/server/backup/BackupManagerService.java
+++ b/services/backup/java/com/android/server/backup/BackupManagerService.java
@@ -1448,52 +1448,23 @@
// rebooted in the middle of an operation that was removing something from
// this log, we sanity-check its contents here and reconstruct it.
mEverStored = new File(mBaseStateDir, "processed");
- File tempProcessedFile = new File(mBaseStateDir, "processed.new");
-
- // If we were in the middle of removing something from the ever-backed-up
- // file, there might be a transient "processed.new" file still present.
- // Ignore it -- we'll validate "processed" against the current package set.
- if (tempProcessedFile.exists()) {
- tempProcessedFile.delete();
- }
// If there are previous contents, parse them out then start a new
// file to continue the recordkeeping.
if (mEverStored.exists()) {
- DataOutputStream temp = null;
- DataInputStream in = null;
-
- try {
- temp = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(
- tempProcessedFile)));
- in = new DataInputStream(new BufferedInputStream(new FileInputStream(mEverStored)));
+ try (DataInputStream in = new DataInputStream(
+ new BufferedInputStream(new FileInputStream(mEverStored)))) {
// Loop until we hit EOF
while (true) {
String pkg = in.readUTF();
- try {
- // is this package still present?
- mPackageManager.getPackageInfo(pkg, 0);
- // if we get here then yes it is; remember it
- mEverStoredApps.add(pkg);
- temp.writeUTF(pkg);
- if (MORE_DEBUG) Slog.v(TAG, " + " + pkg);
- } catch (NameNotFoundException e) {
- // nope, this package was uninstalled; don't include it
- if (MORE_DEBUG) Slog.v(TAG, " - " + pkg);
- }
+ mEverStoredApps.add(pkg);
+ if (MORE_DEBUG) Slog.v(TAG, " + " + pkg);
}
} catch (EOFException e) {
- // Once we've rewritten the backup history log, atomically replace the
- // old one with the new one then reopen the file for continuing use.
- if (!tempProcessedFile.renameTo(mEverStored)) {
- Slog.e(TAG, "Error renaming " + tempProcessedFile + " to " + mEverStored);
- }
+ // Done
} catch (IOException e) {
Slog.e(TAG, "Error in processed file", e);
- } finally {
- try { if (temp != null) temp.close(); } catch (IOException e) {}
- try { if (in != null) in.close(); } catch (IOException e) {}
}
}
@@ -2240,44 +2211,6 @@
}
}
- // Remove our awareness of having ever backed up the given package
- void removeEverBackedUp(String packageName) {
- if (DEBUG) Slog.v(TAG, "Removing backed-up knowledge of " + packageName);
- if (MORE_DEBUG) Slog.v(TAG, "New set:");
-
- synchronized (mEverStoredApps) {
- // Rewrite the file and rename to overwrite. If we reboot in the middle,
- // we'll recognize on initialization time that the package no longer
- // exists and fix it up then.
- File tempKnownFile = new File(mBaseStateDir, "processed.new");
- RandomAccessFile known = null;
- try {
- known = new RandomAccessFile(tempKnownFile, "rws");
- mEverStoredApps.remove(packageName);
- for (String s : mEverStoredApps) {
- known.writeUTF(s);
- if (MORE_DEBUG) Slog.v(TAG, " " + s);
- }
- known.close();
- known = null;
- if (!tempKnownFile.renameTo(mEverStored)) {
- throw new IOException("Can't rename " + tempKnownFile + " to " + mEverStored);
- }
- } catch (IOException e) {
- // Bad: we couldn't create the new copy. For safety's sake we
- // abandon the whole process and remove all what's-backed-up
- // state entirely, meaning we'll force a backup pass for every
- // participant on the next boot or [re]install.
- Slog.w(TAG, "Error rewriting " + mEverStored, e);
- mEverStoredApps.clear();
- tempKnownFile.delete();
- mEverStored.delete();
- } finally {
- try { if (known != null) known.close(); } catch (IOException e) {}
- }
- }
- }
-
// Persistently record the current and ancestral backup tokens as well
// as the set of packages with data [supposedly] available in the
// ancestral dataset.
diff --git a/services/core/java/com/android/server/EventLogTags.logtags b/services/core/java/com/android/server/EventLogTags.logtags
index b516a91..d3ce306 100644
--- a/services/core/java/com/android/server/EventLogTags.logtags
+++ b/services/core/java/com/android/server/EventLogTags.logtags
@@ -71,7 +71,7 @@
# when a notification action button has been clicked
27521 notification_action_clicked (key|3),(action_index|1),(lifespan|1),(freshness|1),(exposure|1)
# when a notification has been canceled
-27530 notification_canceled (key|3),(reason|1),(lifespan|1),(freshness|1),(exposure|1)
+27530 notification_canceled (key|3),(reason|1),(lifespan|1),(freshness|1),(exposure|1),(listener|3)
# replaces 27510 with a row per notification
27531 notification_visibility (key|3),(visibile|1),(lifespan|1),(freshness|1),(exposure|1),(rank|1)
# a notification emited noise, vibration, or light
diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java
index 814e4be..c23757f 100644
--- a/services/core/java/com/android/server/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/InputMethodManagerService.java
@@ -214,8 +214,7 @@
Context.BIND_AUTO_CREATE
| Context.BIND_NOT_VISIBLE
| Context.BIND_NOT_FOREGROUND
- | Context.BIND_IMPORTANT_BACKGROUND
- | Context.BIND_SHOWING_UI;
+ | Context.BIND_IMPORTANT_BACKGROUND;
/**
* Binding flags used only while the {@link InputMethodService} is showing window.
@@ -223,7 +222,8 @@
private static final int IME_VISIBLE_BIND_FLAGS =
Context.BIND_AUTO_CREATE
| Context.BIND_TREAT_LIKE_ACTIVITY
- | Context.BIND_FOREGROUND_SERVICE;
+ | Context.BIND_FOREGROUND_SERVICE
+ | Context.BIND_SHOWING_UI;
@Retention(SOURCE)
@IntDef({HardKeyboardBehavior.WIRELESS_AFFORDANCE, HardKeyboardBehavior.WIRED_AFFORDANCE})
diff --git a/services/core/java/com/android/server/TextServicesManagerService.java b/services/core/java/com/android/server/TextServicesManagerService.java
index 80d39f5..c297010 100644
--- a/services/core/java/com/android/server/TextServicesManagerService.java
+++ b/services/core/java/com/android/server/TextServicesManagerService.java
@@ -370,7 +370,7 @@
private void unbindServiceLocked() {
for (SpellCheckerBindGroup scbg : mSpellCheckerBindGroups.values()) {
- scbg.removeAll();
+ scbg.removeAllLocked();
}
mSpellCheckerBindGroups.clear();
}
@@ -598,7 +598,7 @@
Slog.w(TAG, "bind service: " + info.getId());
}
if (!bindCurrentSpellCheckerService(serviceIntent, connection,
- Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE_WHILE_AWAKE)) {
+ Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT_BACKGROUND)) {
Slog.e(TAG, "Failed to get a spell checker service.");
return null;
}
@@ -788,29 +788,41 @@
mListeners = new InternalDeathRecipients(this);
}
- public void onServiceConnected(ISpellCheckerService spellChecker) {
+ public void onServiceConnectedLocked(ISpellCheckerService spellChecker) {
if (DBG) {
- Slog.d(TAG, "onServiceConnected");
+ Slog.d(TAG, "onServiceConnectedLocked");
}
- synchronized (mLock) {
- mSpellChecker = spellChecker;
- mConnected = true;
- // Dispatch pending getISpellCheckerSession requests.
- mPendingSessionRequests.forEach(this::getISpellCheckerSessionLocked);
- mPendingSessionRequests.clear();
+ if (mUnbindCalled) {
+ return;
}
+ mSpellChecker = spellChecker;
+ mConnected = true;
+ // Dispatch pending getISpellCheckerSession requests.
+ try {
+ final int size = mPendingSessionRequests.size();
+ for (int i = 0; i < size; ++i) {
+ final SessionRequest request = mPendingSessionRequests.get(i);
+ mSpellChecker.getISpellCheckerSession(
+ request.mLocale, request.mScListener, request.mBundle,
+ new ISpellCheckerServiceCallbackBinder(this, request));
+ mOnGoingSessionRequests.add(request);
+ }
+ mPendingSessionRequests.clear();
+ } catch(RemoteException e) {
+ // The target spell checker service is not available. Better to reset the state.
+ removeAllLocked();
+ }
+ cleanLocked();
}
- public void onServiceDisconnected() {
+ public void onServiceDisconnectedLocked() {
if (DBG) {
- Slog.d(TAG, "onServiceDisconnected");
+ Slog.d(TAG, "onServiceDisconnectedLocked");
}
- synchronized (mLock) {
- mSpellChecker = null;
- mConnected = false;
- }
+ mSpellChecker = null;
+ mConnected = false;
}
public void removeListener(ISpellCheckerSessionListener listener) {
@@ -853,17 +865,15 @@
mUnbindCalled = true;
}
- public void removeAll() {
+ public void removeAllLocked() {
Slog.e(TAG, "Remove the spell checker bind unexpectedly.");
- synchronized (mLock) {
- final int size = mListeners.getRegisteredCallbackCount();
- for (int i = size - 1; i >= 0; --i) {
- mListeners.unregister(mListeners.getRegisteredCallbackItem(i));
- }
- mPendingSessionRequests.clear();
- mOnGoingSessionRequests.clear();
- cleanLocked();
+ final int size = mListeners.getRegisteredCallbackCount();
+ for (int i = size - 1; i >= 0; --i) {
+ mListeners.unregister(mListeners.getRegisteredCallbackItem(i));
}
+ mPendingSessionRequests.clear();
+ mOnGoingSessionRequests.clear();
+ cleanLocked();
}
public void getISpellCheckerSessionOrQueueLocked(@NonNull SessionRequest request) {
@@ -874,13 +884,6 @@
mPendingSessionRequests.add(request);
return;
}
- getISpellCheckerSessionLocked(request);
- }
-
- private void getISpellCheckerSessionLocked(@NonNull SessionRequest request) {
- if (mUnbindCalled) {
- return;
- }
try {
mSpellChecker.getISpellCheckerSession(
request.mLocale, request.mScListener, request.mBundle,
@@ -888,7 +891,7 @@
mOnGoingSessionRequests.add(request);
} catch(RemoteException e) {
// The target spell checker service is not available. Better to reset the state.
- removeAll();
+ removeAllLocked();
}
cleanLocked();
}
@@ -930,13 +933,13 @@
private void onServiceConnectedInnerLocked(ComponentName name, IBinder service) {
if (DBG) {
- Slog.w(TAG, "onServiceConnected: " + name);
+ Slog.w(TAG, "onServiceConnectedInnerLocked: " + name);
}
final ISpellCheckerService spellChecker =
ISpellCheckerService.Stub.asInterface(service);
final SpellCheckerBindGroup group = mSpellCheckerBindGroups.get(mSciId);
if (group != null && this == group.mInternalConnection) {
- group.onServiceConnected(spellChecker);
+ group.onServiceConnectedLocked(spellChecker);
}
}
@@ -949,11 +952,11 @@
private void onServiceDisconnectedInnerLocked(ComponentName name) {
if (DBG) {
- Slog.w(TAG, "onServiceDisconnected: " + name);
+ Slog.w(TAG, "onServiceDisconnectedInnerLocked: " + name);
}
final SpellCheckerBindGroup group = mSpellCheckerBindGroups.get(mSciId);
if (group != null && this == group.mInternalConnection) {
- group.onServiceDisconnected();
+ group.onServiceDisconnectedLocked();
}
}
}
diff --git a/services/core/java/com/android/server/Watchdog.java b/services/core/java/com/android/server/Watchdog.java
index 6a81d32..8d46d1e 100644
--- a/services/core/java/com/android/server/Watchdog.java
+++ b/services/core/java/com/android/server/Watchdog.java
@@ -18,7 +18,11 @@
import android.app.IActivityController;
import android.os.Binder;
+import android.os.Build;
import android.os.RemoteException;
+import android.system.ErrnoException;
+import android.system.OsConstants;
+import android.system.StructRlimit;
import com.android.internal.os.ZygoteConnectionConstants;
import com.android.server.am.ActivityManagerService;
@@ -45,6 +49,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.HashSet;
import java.util.List;
@@ -107,6 +112,7 @@
int mPhonePid;
IActivityController mController;
boolean mAllowRestart = true;
+ final OpenFdMonitor mOpenFdMonitor;
/**
* Used for checking status of handle threads and scheduling monitor callbacks.
@@ -269,6 +275,8 @@
// Initialize monitor for Binder threads.
addMonitor(new BinderThreadMonitor());
+ mOpenFdMonitor = OpenFdMonitor.create();
+
// See the notes on DEFAULT_TIMEOUT.
assert DB ||
DEFAULT_TIMEOUT > ZygoteConnectionConstants.WRAPPED_PID_TIMEOUT_MILLIS;
@@ -358,7 +366,7 @@
return checkers;
}
- private String describeCheckersLocked(ArrayList<HandlerChecker> checkers) {
+ private String describeCheckersLocked(List<HandlerChecker> checkers) {
StringBuilder builder = new StringBuilder(128);
for (int i=0; i<checkers.size(); i++) {
if (builder.length() > 0) {
@@ -410,7 +418,7 @@
public void run() {
boolean waitedHalf = false;
while (true) {
- final ArrayList<HandlerChecker> blockedCheckers;
+ final List<HandlerChecker> blockedCheckers;
final String subject;
final boolean allowRestart;
int debuggerWasConnected = 0;
@@ -447,30 +455,40 @@
timeout = CHECK_INTERVAL - (SystemClock.uptimeMillis() - start);
}
- final int waitState = evaluateCheckerCompletionLocked();
- if (waitState == COMPLETED) {
- // The monitors have returned; reset
- waitedHalf = false;
- continue;
- } else if (waitState == WAITING) {
- // still waiting but within their configured intervals; back off and recheck
- continue;
- } else if (waitState == WAITED_HALF) {
- if (!waitedHalf) {
- // We've waited half the deadlock-detection interval. Pull a stack
- // trace and wait another half.
- ArrayList<Integer> pids = new ArrayList<Integer>();
- pids.add(Process.myPid());
- ActivityManagerService.dumpStackTraces(true, pids, null, null,
- getInterestingNativePids());
- waitedHalf = true;
- }
- continue;
+ boolean fdLimitTriggered = false;
+ if (mOpenFdMonitor != null) {
+ fdLimitTriggered = mOpenFdMonitor.monitor();
}
- // something is overdue!
- blockedCheckers = getBlockedCheckersLocked();
- subject = describeCheckersLocked(blockedCheckers);
+ if (!fdLimitTriggered) {
+ final int waitState = evaluateCheckerCompletionLocked();
+ if (waitState == COMPLETED) {
+ // The monitors have returned; reset
+ waitedHalf = false;
+ continue;
+ } else if (waitState == WAITING) {
+ // still waiting but within their configured intervals; back off and recheck
+ continue;
+ } else if (waitState == WAITED_HALF) {
+ if (!waitedHalf) {
+ // We've waited half the deadlock-detection interval. Pull a stack
+ // trace and wait another half.
+ ArrayList<Integer> pids = new ArrayList<Integer>();
+ pids.add(Process.myPid());
+ ActivityManagerService.dumpStackTraces(true, pids, null, null,
+ getInterestingNativePids());
+ waitedHalf = true;
+ }
+ continue;
+ }
+
+ // something is overdue!
+ blockedCheckers = getBlockedCheckersLocked();
+ subject = describeCheckersLocked(blockedCheckers);
+ } else {
+ blockedCheckers = Collections.emptyList();
+ subject = "Open FD high water mark reached";
+ }
allowRestart = mAllowRestart;
}
@@ -584,4 +602,87 @@
}
private native void native_dumpKernelStacks(String tracesPath);
+
+ public static final class OpenFdMonitor {
+ /**
+ * Number of FDs below the soft limit that we trigger a runtime restart at. This was
+ * chosen arbitrarily, but will need to be at least 6 in order to have a sufficient number
+ * of FDs in reserve to complete a dump.
+ */
+ private static final int FD_HIGH_WATER_MARK = 12;
+
+ private final File mDumpDir;
+ private final File mFdHighWaterMark;
+
+ public static OpenFdMonitor create() {
+ // Only run the FD monitor on debuggable builds (such as userdebug and eng builds).
+ if (!Build.IS_DEBUGGABLE) {
+ return null;
+ }
+
+ // Don't run the FD monitor on builds that have a global ANR trace file. We're using
+ // the ANR trace directory as a quick hack in order to get these traces in bugreports
+ // and we wouldn't want to overwrite something important.
+ final String dumpDirStr = SystemProperties.get("dalvik.vm.stack-trace-dir", "");
+ if (dumpDirStr.isEmpty()) {
+ return null;
+ }
+
+ final StructRlimit rlimit;
+ try {
+ rlimit = android.system.Os.getrlimit(OsConstants.RLIMIT_NOFILE);
+ } catch (ErrnoException errno) {
+ Slog.w(TAG, "Error thrown from getrlimit(RLIMIT_NOFILE)", errno);
+ return null;
+ }
+
+ // The assumption we're making here is that FD numbers are allocated (more or less)
+ // sequentially, which is currently (and historically) true since open is currently
+ // specified to always return the lowest-numbered non-open file descriptor for the
+ // current process.
+ //
+ // We do this to avoid having to enumerate the contents of /proc/self/fd in order to
+ // count the number of descriptors open in the process.
+ final File fdThreshold = new File("/proc/self/fd/" + (rlimit.rlim_cur - FD_HIGH_WATER_MARK));
+ return new OpenFdMonitor(new File(dumpDirStr), fdThreshold);
+ }
+
+ OpenFdMonitor(File dumpDir, File fdThreshold) {
+ mDumpDir = dumpDir;
+ mFdHighWaterMark = fdThreshold;
+ }
+
+ private void dumpOpenDescriptors() {
+ try {
+ File dumpFile = File.createTempFile("anr_fd_", "", mDumpDir);
+ java.lang.Process proc = new ProcessBuilder()
+ .command("/system/bin/lsof", "-p", String.valueOf(Process.myPid()))
+ .redirectErrorStream(true)
+ .redirectOutput(dumpFile)
+ .start();
+
+ int returnCode = proc.waitFor();
+ if (returnCode != 0) {
+ Slog.w(TAG, "Unable to dump open descriptors, lsof return code: "
+ + returnCode);
+ dumpFile.delete();
+ }
+ } catch (IOException | InterruptedException ex) {
+ Slog.w(TAG, "Unable to dump open descriptors: " + ex);
+ }
+ }
+
+ /**
+ * @return {@code true} if the high water mark was breached and a dump was written,
+ * {@code false} otherwise.
+ */
+ public boolean monitor() {
+ if (mFdHighWaterMark.exists()) {
+ dumpOpenDescriptors();
+ return true;
+ }
+
+ return false;
+ }
+ }
}
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index bcad2fc..161bf9a 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -13323,7 +13323,6 @@
final ActivityRecord r = ActivityRecord.isInStackLocked(token);
if (r != null) {
final ActivityOptions activityOptions = r.pendingOptions;
- r.pendingOptions = null;
return activityOptions == null ? null : activityOptions.toBundle();
}
return null;
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 79448ca..896f846 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -3382,6 +3382,15 @@
return mStackSupervisor.moveHomeStackTaskToTop(reason);
}
+ if (stack.isAssistantStack() && top != null
+ && top.getTask().getTaskToReturnTo() == HOME_ACTIVITY_TYPE) {
+ // It is possible for the home stack to not be directly underneath the assistant stack.
+ // For example, the assistant may start an activity in the fullscreen stack. Upon
+ // returning to the assistant stack, we must ensure that the home stack is underneath
+ // when appropriate.
+ mStackSupervisor.moveHomeStackTaskToTop("adjustAssistantReturnToHome");
+ }
+
stack.moveToFront(myReason);
return true;
}
diff --git a/services/core/java/com/android/server/am/ActivityStarter.java b/services/core/java/com/android/server/am/ActivityStarter.java
index 0684f68..6544593 100644
--- a/services/core/java/com/android/server/am/ActivityStarter.java
+++ b/services/core/java/com/android/server/am/ActivityStarter.java
@@ -581,8 +581,8 @@
Intent.ACTION_INSTALL_INSTANT_APP_PACKAGE, originalIntent,
auxiliaryResponse.failureIntent, callingPackage, verificationBundle,
resolvedType, userId, auxiliaryResponse.packageName, auxiliaryResponse.splitName,
- auxiliaryResponse.versionCode, auxiliaryResponse.token,
- auxiliaryResponse.needsPhaseTwo);
+ auxiliaryResponse.installFailureActivity, auxiliaryResponse.versionCode,
+ auxiliaryResponse.token, auxiliaryResponse.needsPhaseTwo);
}
void postStartActivityProcessing(
diff --git a/services/core/java/com/android/server/am/TaskPersister.java b/services/core/java/com/android/server/am/TaskPersister.java
index e56b09d..74c4826 100644
--- a/services/core/java/com/android/server/am/TaskPersister.java
+++ b/services/core/java/com/android/server/am/TaskPersister.java
@@ -679,102 +679,111 @@
}
writeTaskIdsFiles();
- // If mNextWriteTime, then don't delay between each call to saveToXml().
- final WriteQueueItem item;
- synchronized (TaskPersister.this) {
- if (mNextWriteTime != FLUSH_QUEUE) {
- // The next write we don't have to wait so long.
- mNextWriteTime = SystemClock.uptimeMillis() + INTER_WRITE_DELAY_MS;
- if (DEBUG) Slog.d(TAG, "Next write time may be in " +
- INTER_WRITE_DELAY_MS + " msec. (" + mNextWriteTime + ")");
- }
+ processNextItem();
+ }
+ }
- while (mWriteQueue.isEmpty()) {
- if (mNextWriteTime != 0) {
- mNextWriteTime = 0; // idle.
- TaskPersister.this.notifyAll(); // wake up flush() if needed.
- }
- try {
- if (DEBUG) Slog.d(TAG, "LazyTaskWriter: waiting indefinitely.");
- TaskPersister.this.wait();
- } catch (InterruptedException e) {
- }
- // Invariant: mNextWriteTime is either FLUSH_QUEUE or PRE_WRITE_DELAY_MS
- // from now.
- }
- item = mWriteQueue.remove(0);
+ private void processNextItem() {
+ // This part is extracted into a method so that the GC can clearly see the end of the
+ // scope of the variable 'item'. If this part was in the loop above, the last item
+ // it processed would always "leak".
+ // See https://b.corp.google.com/issues/64438652#comment7
- long now = SystemClock.uptimeMillis();
- if (DEBUG) Slog.d(TAG, "LazyTaskWriter: now=" + now + " mNextWriteTime=" +
- mNextWriteTime + " mWriteQueue.size=" + mWriteQueue.size());
- while (now < mNextWriteTime) {
- try {
- if (DEBUG) Slog.d(TAG, "LazyTaskWriter: waiting " +
- (mNextWriteTime - now));
- TaskPersister.this.wait(mNextWriteTime - now);
- } catch (InterruptedException e) {
- }
- now = SystemClock.uptimeMillis();
- }
-
- // Got something to do.
+ // If mNextWriteTime, then don't delay between each call to saveToXml().
+ final WriteQueueItem item;
+ synchronized (TaskPersister.this) {
+ if (mNextWriteTime != FLUSH_QUEUE) {
+ // The next write we don't have to wait so long.
+ mNextWriteTime = SystemClock.uptimeMillis() + INTER_WRITE_DELAY_MS;
+ if (DEBUG) Slog.d(TAG, "Next write time may be in " +
+ INTER_WRITE_DELAY_MS + " msec. (" + mNextWriteTime + ")");
}
- if (item instanceof ImageWriteQueueItem) {
- ImageWriteQueueItem imageWriteQueueItem = (ImageWriteQueueItem) item;
- final String filePath = imageWriteQueueItem.mFilePath;
- if (!createParentDirectory(filePath)) {
- Slog.e(TAG, "Error while creating images directory for file: " + filePath);
- continue;
+ while (mWriteQueue.isEmpty()) {
+ if (mNextWriteTime != 0) {
+ mNextWriteTime = 0; // idle.
+ TaskPersister.this.notifyAll(); // wake up flush() if needed.
}
- final Bitmap bitmap = imageWriteQueueItem.mImage;
- if (DEBUG) Slog.d(TAG, "writing bitmap: filename=" + filePath);
- FileOutputStream imageFile = null;
try {
- imageFile = new FileOutputStream(new File(filePath));
- bitmap.compress(Bitmap.CompressFormat.PNG, 100, imageFile);
- } catch (Exception e) {
- Slog.e(TAG, "saveImage: unable to save " + filePath, e);
- } finally {
- IoUtils.closeQuietly(imageFile);
+ if (DEBUG) Slog.d(TAG, "LazyTaskWriter: waiting indefinitely.");
+ TaskPersister.this.wait();
+ } catch (InterruptedException e) {
}
- } else if (item instanceof TaskWriteQueueItem) {
- // Write out one task.
- StringWriter stringWriter = null;
- TaskRecord task = ((TaskWriteQueueItem) item).mTask;
- if (DEBUG) Slog.d(TAG, "Writing task=" + task);
- synchronized (mService) {
- if (task.inRecents) {
- // Still there.
- try {
- if (DEBUG) Slog.d(TAG, "Saving task=" + task);
- stringWriter = saveToXml(task);
- } catch (IOException e) {
- } catch (XmlPullParserException e) {
- }
- }
+ // Invariant: mNextWriteTime is either FLUSH_QUEUE or PRE_WRITE_DELAY_MS
+ // from now.
+ }
+ item = mWriteQueue.remove(0);
+
+ long now = SystemClock.uptimeMillis();
+ if (DEBUG) Slog.d(TAG, "LazyTaskWriter: now=" + now + " mNextWriteTime=" +
+ mNextWriteTime + " mWriteQueue.size=" + mWriteQueue.size());
+ while (now < mNextWriteTime) {
+ try {
+ if (DEBUG) Slog.d(TAG, "LazyTaskWriter: waiting " +
+ (mNextWriteTime - now));
+ TaskPersister.this.wait(mNextWriteTime - now);
+ } catch (InterruptedException e) {
}
- if (stringWriter != null) {
- // Write out xml file while not holding mService lock.
- FileOutputStream file = null;
- AtomicFile atomicFile = null;
+ now = SystemClock.uptimeMillis();
+ }
+
+ // Got something to do.
+ }
+
+ if (item instanceof ImageWriteQueueItem) {
+ ImageWriteQueueItem imageWriteQueueItem = (ImageWriteQueueItem) item;
+ final String filePath = imageWriteQueueItem.mFilePath;
+ if (!createParentDirectory(filePath)) {
+ Slog.e(TAG, "Error while creating images directory for file: " + filePath);
+ return;
+ }
+ final Bitmap bitmap = imageWriteQueueItem.mImage;
+ if (DEBUG) Slog.d(TAG, "writing bitmap: filename=" + filePath);
+ FileOutputStream imageFile = null;
+ try {
+ imageFile = new FileOutputStream(new File(filePath));
+ bitmap.compress(Bitmap.CompressFormat.PNG, 100, imageFile);
+ } catch (Exception e) {
+ Slog.e(TAG, "saveImage: unable to save " + filePath, e);
+ } finally {
+ IoUtils.closeQuietly(imageFile);
+ }
+ } else if (item instanceof TaskWriteQueueItem) {
+ // Write out one task.
+ StringWriter stringWriter = null;
+ TaskRecord task = ((TaskWriteQueueItem) item).mTask;
+ if (DEBUG) Slog.d(TAG, "Writing task=" + task);
+ synchronized (mService) {
+ if (task.inRecents) {
+ // Still there.
try {
- atomicFile = new AtomicFile(new File(
- getUserTasksDir(task.userId),
- String.valueOf(task.taskId) + TASK_FILENAME_SUFFIX));
- file = atomicFile.startWrite();
- file.write(stringWriter.toString().getBytes());
- file.write('\n');
- atomicFile.finishWrite(file);
+ if (DEBUG) Slog.d(TAG, "Saving task=" + task);
+ stringWriter = saveToXml(task);
} catch (IOException e) {
- if (file != null) {
- atomicFile.failWrite(file);
- }
- Slog.e(TAG,
- "Unable to open " + atomicFile + " for persisting. " + e);
+ } catch (XmlPullParserException e) {
}
}
}
+ if (stringWriter != null) {
+ // Write out xml file while not holding mService lock.
+ FileOutputStream file = null;
+ AtomicFile atomicFile = null;
+ try {
+ atomicFile = new AtomicFile(new File(
+ getUserTasksDir(task.userId),
+ String.valueOf(task.taskId) + TASK_FILENAME_SUFFIX));
+ file = atomicFile.startWrite();
+ file.write(stringWriter.toString().getBytes());
+ file.write('\n');
+ atomicFile.finishWrite(file);
+ } catch (IOException e) {
+ if (file != null) {
+ atomicFile.failWrite(file);
+ }
+ Slog.e(TAG,
+ "Unable to open " + atomicFile + " for persisting. " + e);
+ }
+ }
}
}
}
diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java
index b0be8f7..2b4f4e6 100644
--- a/services/core/java/com/android/server/connectivity/Tethering.java
+++ b/services/core/java/com/android/server/connectivity/Tethering.java
@@ -832,20 +832,33 @@
// functions are ready to use.
//
// For more explanation, see b/62552150 .
- if (usbConnected && !usbConfigured) {
- // Nothing for us to do here.
- // TODO: consider ignoring DISCONNECTED broadcasts as well.
- return;
- }
-
synchronized (Tethering.this.mPublicSync) {
+ // Always record the state of RNDIS.
+ // TODO: consider:
+ // final boolean disconnected = !usbConnected;
+ // if (disconnected) {
+ // mRndisEnabled = false;
+ // mUsbTetherRequested = false;
+ // return;
+ // }
+ // final boolean configured = usbConnected && usbConfigured;
+ // mRndisEnabled = configured ? rndisEnabled : false;
+ // if (!configured) return;
mRndisEnabled = rndisEnabled;
+
+ if (usbConnected && !usbConfigured) {
+ // Nothing to do here (only CONNECTED, not yet CONFIGURED).
+ return;
+ }
+
// start tethering if we have a request pending
if (usbConfigured && mRndisEnabled && mUsbTetherRequested) {
tetherMatchingInterfaces(
IControlsTethering.STATE_TETHERED,
ConnectivityManager.TETHERING_USB);
}
+
+ // TODO: Figure out how to remove the need for this variable.
mUsbTetherRequested = false;
}
}
diff --git a/services/core/java/com/android/server/fingerprint/EnumerateClient.java b/services/core/java/com/android/server/fingerprint/EnumerateClient.java
index 12827d0..b6bbd1b 100644
--- a/services/core/java/com/android/server/fingerprint/EnumerateClient.java
+++ b/services/core/java/com/android/server/fingerprint/EnumerateClient.java
@@ -95,7 +95,7 @@
} catch (RemoteException e) {
Slog.w(TAG, "Failed to notify enumerated:", e);
}
- return fingerId == 0; // done when id hits 0
+ return remaining == 0;
}
@Override
diff --git a/services/core/java/com/android/server/fingerprint/InternalEnumerateClient.java b/services/core/java/com/android/server/fingerprint/InternalEnumerateClient.java
index f4d2596..88d9ef4 100644
--- a/services/core/java/com/android/server/fingerprint/InternalEnumerateClient.java
+++ b/services/core/java/com/android/server/fingerprint/InternalEnumerateClient.java
@@ -88,7 +88,7 @@
doFingerprintCleanup();
}
- return fingerId == 0; // done when id hits 0
+ return remaining == 0;
}
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
index a50ec49f..81bccdc 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java
@@ -851,6 +851,7 @@
mSystemAudioActivated = on;
mService.announceSystemAudioModeChange(on);
}
+ startArcAction(on);
}
}
diff --git a/services/core/java/com/android/server/location/GnssLocationProvider.java b/services/core/java/com/android/server/location/GnssLocationProvider.java
index 11a4eb4..436ea3c 100644
--- a/services/core/java/com/android/server/location/GnssLocationProvider.java
+++ b/services/core/java/com/android/server/location/GnssLocationProvider.java
@@ -1054,8 +1054,15 @@
// download tasks overrun.
synchronized (mLock) {
if (mDownloadXtraWakeLock.isHeld()) {
- mDownloadXtraWakeLock.release();
- if (DEBUG) Log.d(TAG, "WakeLock released by handleDownloadXtraData()");
+ // This wakelock may have time-out, if a timeout was specified.
+ // Catch (and ignore) any timeout exceptions.
+ try {
+ mDownloadXtraWakeLock.release();
+ if (DEBUG) Log.d(TAG, "WakeLock released by handleDownloadXtraData()");
+ } catch (Exception e) {
+ Log.i(TAG, "Wakelock timeout & release race exception in "
+ + "handleDownloadXtraData()", e);
+ }
} else {
Log.e(TAG, "WakeLock expired before release in "
+ "handleDownloadXtraData()");
diff --git a/services/core/java/com/android/server/locksettings/LockSettingsService.java b/services/core/java/com/android/server/locksettings/LockSettingsService.java
index a105c84..2f166e9 100644
--- a/services/core/java/com/android/server/locksettings/LockSettingsService.java
+++ b/services/core/java/com/android/server/locksettings/LockSettingsService.java
@@ -1223,6 +1223,7 @@
.setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE)
.setUserAuthenticationRequired(true)
.setUserAuthenticationValidityDurationSeconds(30)
+ .setCriticalToDeviceEncryption(true)
.build());
// Key imported, obtain a reference to it.
SecretKey keyStoreEncryptionKey = (SecretKey) keyStore.getKey(
diff --git a/services/core/java/com/android/server/locksettings/SyntheticPasswordManager.java b/services/core/java/com/android/server/locksettings/SyntheticPasswordManager.java
index 603e46a..0e4b08f 100644
--- a/services/core/java/com/android/server/locksettings/SyntheticPasswordManager.java
+++ b/services/core/java/com/android/server/locksettings/SyntheticPasswordManager.java
@@ -625,8 +625,8 @@
PasswordData pwd = PasswordData.fromBytes(persistentData.payload);
byte[] pwdToken = computePasswordToken(userCredential, pwd);
- GateKeeperResponse response = gatekeeper.verify(fakeUid(persistentData.userId),
- pwd.passwordHandle, passwordTokenToGkInput(pwdToken));
+ GateKeeperResponse response = gatekeeper.verifyChallenge(fakeUid(persistentData.userId),
+ 0 /* challenge */, pwd.passwordHandle, passwordTokenToGkInput(pwdToken));
return VerifyCredentialResponse.fromGateKeeperResponse(response);
} else if (persistentData.type == PersistentData.TYPE_SP_WEAVER) {
PasswordData pwd = PasswordData.fromBytes(persistentData.payload);
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index d9c259e..abf391e 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -3044,7 +3044,7 @@
final NotificationRecord removed = findNotificationByKeyLocked(summaries.remove(pkg));
if (removed != null) {
boolean wasPosted = removeFromNotificationListsLocked(removed);
- cancelNotificationLocked(removed, false, REASON_UNAUTOBUNDLED, wasPosted);
+ cancelNotificationLocked(removed, false, REASON_UNAUTOBUNDLED, wasPosted, null);
}
}
}
@@ -3686,7 +3686,7 @@
.addTaggedData(MetricsEvent.NOTIFICATION_SNOOZED_CRITERIA,
mSnoozeCriterionId == null ? 0 : 1));
boolean wasPosted = removeFromNotificationListsLocked(r);
- cancelNotificationLocked(r, false, REASON_SNOOZED, wasPosted);
+ cancelNotificationLocked(r, false, REASON_SNOOZED, wasPosted, null);
updateLightsLocked();
if (mSnoozeCriterionId != null) {
mAssistants.notifyAssistantSnoozedLocked(r.sbn, mSnoozeCriterionId);
@@ -4517,7 +4517,7 @@
@GuardedBy("mNotificationLock")
private void cancelNotificationLocked(NotificationRecord r, boolean sendDelete, int reason,
- boolean wasPosted) {
+ boolean wasPosted, String listenerName) {
final String canceledKey = r.getKey();
// Record caller.
@@ -4617,7 +4617,7 @@
.setType(MetricsEvent.TYPE_DISMISS)
.setSubtype(reason));
EventLogTags.writeNotificationCanceled(canceledKey, reason,
- r.getLifespanMs(now), r.getFreshnessMs(now), r.getExposureMs(now));
+ r.getLifespanMs(now), r.getFreshnessMs(now), r.getExposureMs(now), listenerName);
}
/**
@@ -4660,7 +4660,7 @@
// Cancel the notification.
boolean wasPosted = removeFromNotificationListsLocked(r);
- cancelNotificationLocked(r, sendDelete, reason, wasPosted);
+ cancelNotificationLocked(r, sendDelete, reason, wasPosted, listenerName);
cancelGroupChildrenLocked(r, callingUid, callingPid, listenerName,
sendDelete, null);
updateLightsLocked();
@@ -4786,7 +4786,7 @@
notificationList.remove(i);
mNotificationsByKey.remove(r.getKey());
canceledNotifications.add(r);
- cancelNotificationLocked(r, sendDelete, reason, wasPosted);
+ cancelNotificationLocked(r, sendDelete, reason, wasPosted, listenerName);
}
if (canceledNotifications != null) {
final int M = canceledNotifications.size();
@@ -4896,7 +4896,7 @@
childSbn.getTag(), userId, 0, 0, reason, listenerName);
notificationList.remove(i);
mNotificationsByKey.remove(childR.getKey());
- cancelNotificationLocked(childR, sendDelete, reason, wasPosted);
+ cancelNotificationLocked(childR, sendDelete, reason, wasPosted, listenerName);
}
}
}
diff --git a/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
index d1aecb1..b217677 100644
--- a/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
+++ b/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
@@ -30,6 +30,7 @@
import android.content.pm.PackageParser;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
+import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
@@ -701,6 +702,16 @@
LOCATION_PERMISSIONS, true, userId);
}
+ // Ringtone Picker
+ Intent ringtonePickerIntent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER);
+ PackageParser.Package ringtonePickerPackage =
+ getDefaultSystemHandlerActivityPackageLPr(ringtonePickerIntent, userId);
+ if (ringtonePickerPackage != null
+ && doesPackageSupportRuntimePermissions(ringtonePickerPackage)) {
+ grantRuntimePermissionsLPw(ringtonePickerPackage,
+ STORAGE_PERMISSIONS, true, userId);
+ }
+
mService.mSettings.onDefaultRuntimePermissionsGrantedLPr(userId);
}
}
diff --git a/services/core/java/com/android/server/pm/InstantAppResolver.java b/services/core/java/com/android/server/pm/InstantAppResolver.java
index d0d306c..f50d0d7 100644
--- a/services/core/java/com/android/server/pm/InstantAppResolver.java
+++ b/services/core/java/com/android/server/pm/InstantAppResolver.java
@@ -194,6 +194,7 @@
requestObj.userId,
packageName,
splitName,
+ requestObj.responseObj.installFailureActivity,
versionCode,
token,
false /*needsPhaseTwo*/);
@@ -239,6 +240,7 @@
int userId,
@NonNull String instantAppPackageName,
@Nullable String instantAppSplitName,
+ @Nullable ComponentName installFailureActivity,
int versionCode,
@Nullable String token,
boolean needsPhaseTwo) {
@@ -260,15 +262,25 @@
// We have all of the data we need; just start the installer without a second phase
if (!needsPhaseTwo) {
// Intent that is launched if the package couldn't be installed for any reason.
- if (failureIntent != null) {
+ if (failureIntent != null || installFailureActivity != null) {
try {
+ final Intent onFailureIntent;
+ if (installFailureActivity != null) {
+ onFailureIntent = new Intent();
+ onFailureIntent.setComponent(installFailureActivity);
+ onFailureIntent.putExtra(Intent.EXTRA_SPLIT_NAME, instantAppSplitName);
+ onFailureIntent.putExtra(Intent.EXTRA_INTENT, origIntent);
+ } else {
+ onFailureIntent = failureIntent;
+ }
final IIntentSender failureIntentTarget = ActivityManager.getService()
.getIntentSender(
ActivityManager.INTENT_SENDER_ACTIVITY, callingPackage,
null /*token*/, null /*resultWho*/, 1 /*requestCode*/,
- new Intent[] { failureIntent },
+ new Intent[] { onFailureIntent },
new String[] { resolvedType },
- PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT
+ PendingIntent.FLAG_CANCEL_CURRENT
+ | PendingIntent.FLAG_ONE_SHOT
| PendingIntent.FLAG_IMMUTABLE,
null /*bOptions*/, userId);
intent.putExtra(Intent.EXTRA_EPHEMERAL_FAILURE,
diff --git a/services/core/java/com/android/server/pm/OtaDexoptService.java b/services/core/java/com/android/server/pm/OtaDexoptService.java
index 241d76f..da6e26e 100644
--- a/services/core/java/com/android/server/pm/OtaDexoptService.java
+++ b/services/core/java/com/android/server/pm/OtaDexoptService.java
@@ -318,7 +318,7 @@
optimizer.performDexOpt(pkg, libraryDependencies,
null /* ISAs */,
null /* CompilerStats.PackageStats */,
- mPackageManagerService.getDexManager().isUsedByOtherApps(pkg.packageName),
+ mPackageManagerService.getDexManager().getPackageUseInfoOrDefault(pkg.packageName),
new DexoptOptions(pkg.packageName, compilationReason,
DexoptOptions.DEXOPT_BOOT_COMPLETE));
diff --git a/services/core/java/com/android/server/pm/PackageDexOptimizer.java b/services/core/java/com/android/server/pm/PackageDexOptimizer.java
index dabd35c..2f4f5ab 100644
--- a/services/core/java/com/android/server/pm/PackageDexOptimizer.java
+++ b/services/core/java/com/android/server/pm/PackageDexOptimizer.java
@@ -31,6 +31,7 @@
import com.android.internal.annotations.GuardedBy;
import com.android.internal.util.IndentingPrintWriter;
import com.android.server.pm.Installer.InstallerException;
+import com.android.server.pm.dex.DexManager;
import com.android.server.pm.dex.DexoptOptions;
import com.android.server.pm.dex.DexoptUtils;
import com.android.server.pm.dex.PackageDexUsage;
@@ -39,6 +40,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import dalvik.system.DexFile;
@@ -112,7 +114,7 @@
*/
int performDexOpt(PackageParser.Package pkg, String[] sharedLibraries,
String[] instructionSets, CompilerStats.PackageStats packageStats,
- boolean isUsedByOtherApps, DexoptOptions options) {
+ PackageDexUsage.PackageUseInfo packageUseInfo, DexoptOptions options) {
if (!canOptimizePackage(pkg)) {
return DEX_OPT_SKIPPED;
}
@@ -120,7 +122,7 @@
final long acquireTime = acquireWakeLockLI(pkg.applicationInfo.uid);
try {
return performDexOptLI(pkg, sharedLibraries, instructionSets,
- packageStats, isUsedByOtherApps, options);
+ packageStats, packageUseInfo, options);
} finally {
releaseWakeLockLI(acquireTime);
}
@@ -134,21 +136,13 @@
@GuardedBy("mInstallLock")
private int performDexOptLI(PackageParser.Package pkg, String[] sharedLibraries,
String[] targetInstructionSets, CompilerStats.PackageStats packageStats,
- boolean isUsedByOtherApps, DexoptOptions options) {
+ PackageDexUsage.PackageUseInfo packageUseInfo, DexoptOptions options) {
final String[] instructionSets = targetInstructionSets != null ?
targetInstructionSets : getAppDexInstructionSets(pkg.applicationInfo);
final String[] dexCodeInstructionSets = getDexCodeInstructionSets(instructionSets);
final List<String> paths = pkg.getAllCodePaths();
final int sharedGid = UserHandle.getSharedAppGid(pkg.applicationInfo.uid);
- final String compilerFilter = getRealCompilerFilter(pkg.applicationInfo,
- options.getCompilerFilter(), isUsedByOtherApps);
- final boolean profileUpdated = options.isCheckForProfileUpdates() &&
- isProfileUpdated(pkg, sharedGid, compilerFilter);
-
- // Get the dexopt flags after getRealCompilerFilter to make sure we get the correct flags.
- final int dexoptFlags = getDexFlags(pkg, compilerFilter, options.isBootComplete());
-
// Get the class loader context dependencies.
// For each code path in the package, this array contains the class loader context that
// needs to be passed to dexopt in order to ensure correct optimizations.
@@ -172,6 +166,17 @@
}
}
+ final boolean isUsedByOtherApps = options.isDexoptAsSharedLibrary()
+ || packageUseInfo.isUsedByOtherApps(path);
+ final String compilerFilter = getRealCompilerFilter(pkg.applicationInfo,
+ options.getCompilerFilter(), isUsedByOtherApps);
+ final boolean profileUpdated = options.isCheckForProfileUpdates() &&
+ isProfileUpdated(pkg, sharedGid, compilerFilter);
+
+ // Get the dexopt flags after getRealCompilerFilter to make sure we get the correct
+ // flags.
+ final int dexoptFlags = getDexFlags(pkg, compilerFilter, options.isBootComplete());
+
for (String dexCodeIsa : dexCodeInstructionSets) {
int newResult = dexOptPath(pkg, path, dexCodeIsa, compilerFilter,
profileUpdated, classLoaderContexts[i], dexoptFlags, sharedGid,
@@ -376,26 +381,60 @@
/**
* Dumps the dexopt state of the given package {@code pkg} to the given {@code PrintWriter}.
*/
- void dumpDexoptState(IndentingPrintWriter pw, PackageParser.Package pkg) {
+ void dumpDexoptState(IndentingPrintWriter pw, PackageParser.Package pkg,
+ PackageDexUsage.PackageUseInfo useInfo) {
final String[] instructionSets = getAppDexInstructionSets(pkg.applicationInfo);
final String[] dexCodeInstructionSets = getDexCodeInstructionSets(instructionSets);
final List<String> paths = pkg.getAllCodePathsExcludingResourceOnly();
- for (String instructionSet : dexCodeInstructionSets) {
- pw.println("Instruction Set: " + instructionSet);
- pw.increaseIndent();
- for (String path : paths) {
- String status = null;
- try {
- status = DexFile.getDexFileStatus(path, instructionSet);
- } catch (IOException ioe) {
- status = "[Exception]: " + ioe.getMessage();
- }
- pw.println("path: " + path);
- pw.println("status: " + status);
- }
- pw.decreaseIndent();
+ for (String path : paths) {
+ pw.println("path: " + path);
+ pw.increaseIndent();
+
+ for (String isa : dexCodeInstructionSets) {
+ String status = null;
+ try {
+ status = DexFile.getDexFileStatus(path, isa);
+ } catch (IOException ioe) {
+ status = "[Exception]: " + ioe.getMessage();
+ }
+ pw.println(isa + ": " + status);
+ }
+
+ if (useInfo.isUsedByOtherApps(path)) {
+ pw.println("used be other apps: " + useInfo.getLoadingPackages(path));
+ }
+
+ Map<String, PackageDexUsage.DexUseInfo> dexUseInfoMap = useInfo.getDexUseInfoMap();
+
+ if (!dexUseInfoMap.isEmpty()) {
+ pw.println("known secondary dex files:");
+ pw.increaseIndent();
+ for (Map.Entry<String, PackageDexUsage.DexUseInfo> e : dexUseInfoMap.entrySet()) {
+ String dex = e.getKey();
+ PackageDexUsage.DexUseInfo dexUseInfo = e.getValue();
+ pw.println(dex);
+ pw.increaseIndent();
+ for (String isa : dexUseInfo.getLoaderIsas()) {
+ String status = null;
+ try {
+ status = DexFile.getDexFileStatus(path, isa);
+ } catch (IOException ioe) {
+ status = "[Exception]: " + ioe.getMessage();
+ }
+ pw.println(isa + ": " + status);
+ }
+
+ pw.println("class loader context: " + dexUseInfo.getClassLoaderContext());
+ if (dexUseInfo.isUsedByOtherApps()) {
+ pw.println("used be other apps: " + dexUseInfo.getLoadingPackages());
+ }
+ pw.decreaseIndent();
+ }
+ pw.decreaseIndent();
+ }
+ pw.decreaseIndent();
}
}
diff --git a/services/core/java/com/android/server/pm/PackageInstallerService.java b/services/core/java/com/android/server/pm/PackageInstallerService.java
index bab7011..c3b93b4 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerService.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerService.java
@@ -16,17 +16,6 @@
package com.android.server.pm;
-import static com.android.internal.util.XmlUtils.readBitmapAttribute;
-import static com.android.internal.util.XmlUtils.readBooleanAttribute;
-import static com.android.internal.util.XmlUtils.readIntAttribute;
-import static com.android.internal.util.XmlUtils.readLongAttribute;
-import static com.android.internal.util.XmlUtils.readStringAttribute;
-import static com.android.internal.util.XmlUtils.readUriAttribute;
-import static com.android.internal.util.XmlUtils.writeBooleanAttribute;
-import static com.android.internal.util.XmlUtils.writeIntAttribute;
-import static com.android.internal.util.XmlUtils.writeLongAttribute;
-import static com.android.internal.util.XmlUtils.writeStringAttribute;
-import static com.android.internal.util.XmlUtils.writeUriAttribute;
import static org.xmlpull.v1.XmlPullParser.END_DOCUMENT;
import static org.xmlpull.v1.XmlPullParser.START_TAG;
@@ -54,8 +43,6 @@
import android.content.pm.ParceledListSlice;
import android.content.pm.VersionedPackage;
import android.graphics.Bitmap;
-import android.graphics.Bitmap.CompressFormat;
-import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Binder;
import android.os.Bundle;
@@ -84,9 +71,6 @@
import android.util.SparseIntArray;
import android.util.Xml;
-import java.io.CharArrayWriter;
-import libcore.io.IoUtils;
-
import com.android.internal.R;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.content.PackageHelper;
@@ -97,10 +81,13 @@
import com.android.internal.util.IndentingPrintWriter;
import com.android.server.IoThread;
+import libcore.io.IoUtils;
+
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlSerializer;
+import java.io.CharArrayWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -125,32 +112,6 @@
/** XML constants used in {@link #mSessionsFile} */
private static final String TAG_SESSIONS = "sessions";
- private static final String TAG_SESSION = "session";
- private static final String TAG_GRANTED_RUNTIME_PERMISSION = "granted-runtime-permission";
- private static final String ATTR_SESSION_ID = "sessionId";
- private static final String ATTR_USER_ID = "userId";
- private static final String ATTR_INSTALLER_PACKAGE_NAME = "installerPackageName";
- private static final String ATTR_INSTALLER_UID = "installerUid";
- private static final String ATTR_CREATED_MILLIS = "createdMillis";
- private static final String ATTR_SESSION_STAGE_DIR = "sessionStageDir";
- private static final String ATTR_SESSION_STAGE_CID = "sessionStageCid";
- private static final String ATTR_PREPARED = "prepared";
- private static final String ATTR_SEALED = "sealed";
- private static final String ATTR_MODE = "mode";
- private static final String ATTR_INSTALL_FLAGS = "installFlags";
- private static final String ATTR_INSTALL_LOCATION = "installLocation";
- private static final String ATTR_SIZE_BYTES = "sizeBytes";
- private static final String ATTR_APP_PACKAGE_NAME = "appPackageName";
- @Deprecated
- private static final String ATTR_APP_ICON = "appIcon";
- private static final String ATTR_APP_LABEL = "appLabel";
- private static final String ATTR_ORIGINATING_URI = "originatingUri";
- private static final String ATTR_ORIGINATING_UID = "originatingUid";
- private static final String ATTR_REFERRER_URI = "referrerUri";
- private static final String ATTR_ABI_OVERRIDE = "abiOverride";
- private static final String ATTR_VOLUME_UUID = "volumeUuid";
- private static final String ATTR_NAME = "name";
- private static final String ATTR_INSTALL_REASON = "installRason";
/** Automatically destroy sessions older than this */
private static final long MAX_AGE_MILLIS = 3 * DateUtils.DAY_IN_MILLIS;
@@ -357,8 +318,10 @@
while ((type = in.next()) != END_DOCUMENT) {
if (type == START_TAG) {
final String tag = in.getName();
- if (TAG_SESSION.equals(tag)) {
- final PackageInstallerSession session = readSessionLocked(in);
+ if (PackageInstallerSession.TAG_SESSION.equals(tag)) {
+ final PackageInstallerSession session = PackageInstallerSession.
+ readFromXml(in, mInternalCallback, mContext, mPm,
+ mInstallThread.getLooper(), mSessionsDir);
final long age = System.currentTimeMillis() - session.createdMillis;
final boolean valid;
@@ -397,53 +360,10 @@
session.dump(pw);
mHistoricalSessions.add(writer.toString());
+ int installerUid = session.getInstallerUid();
// Increment the number of sessions by this installerUid.
- mHistoricalSessionsByInstaller.put(
- session.installerUid,
- mHistoricalSessionsByInstaller.get(session.installerUid) + 1);
- }
-
- private PackageInstallerSession readSessionLocked(XmlPullParser in) throws IOException,
- XmlPullParserException {
- final int sessionId = readIntAttribute(in, ATTR_SESSION_ID);
- final int userId = readIntAttribute(in, ATTR_USER_ID);
- final String installerPackageName = readStringAttribute(in, ATTR_INSTALLER_PACKAGE_NAME);
- final int installerUid = readIntAttribute(in, ATTR_INSTALLER_UID, mPm.getPackageUid(
- installerPackageName, PackageManager.MATCH_UNINSTALLED_PACKAGES, userId));
- final long createdMillis = readLongAttribute(in, ATTR_CREATED_MILLIS);
- final String stageDirRaw = readStringAttribute(in, ATTR_SESSION_STAGE_DIR);
- final File stageDir = (stageDirRaw != null) ? new File(stageDirRaw) : null;
- final String stageCid = readStringAttribute(in, ATTR_SESSION_STAGE_CID);
- final boolean prepared = readBooleanAttribute(in, ATTR_PREPARED, true);
- final boolean sealed = readBooleanAttribute(in, ATTR_SEALED);
-
- final SessionParams params = new SessionParams(
- SessionParams.MODE_INVALID);
- params.mode = readIntAttribute(in, ATTR_MODE);
- params.installFlags = readIntAttribute(in, ATTR_INSTALL_FLAGS);
- params.installLocation = readIntAttribute(in, ATTR_INSTALL_LOCATION);
- params.sizeBytes = readLongAttribute(in, ATTR_SIZE_BYTES);
- params.appPackageName = readStringAttribute(in, ATTR_APP_PACKAGE_NAME);
- params.appIcon = readBitmapAttribute(in, ATTR_APP_ICON);
- params.appLabel = readStringAttribute(in, ATTR_APP_LABEL);
- params.originatingUri = readUriAttribute(in, ATTR_ORIGINATING_URI);
- params.originatingUid =
- readIntAttribute(in, ATTR_ORIGINATING_UID, SessionParams.UID_UNKNOWN);
- params.referrerUri = readUriAttribute(in, ATTR_REFERRER_URI);
- params.abiOverride = readStringAttribute(in, ATTR_ABI_OVERRIDE);
- params.volumeUuid = readStringAttribute(in, ATTR_VOLUME_UUID);
- params.grantedRuntimePermissions = readGrantedRuntimePermissions(in);
- params.installReason = readIntAttribute(in, ATTR_INSTALL_REASON);
-
- final File appIconFile = buildAppIconFile(sessionId);
- if (appIconFile.exists()) {
- params.appIcon = BitmapFactory.decodeFile(appIconFile.getAbsolutePath());
- params.appIconLastModified = appIconFile.lastModified();
- }
-
- return new PackageInstallerSession(mInternalCallback, mContext, mPm,
- mInstallThread.getLooper(), sessionId, userId, installerPackageName, installerUid,
- params, createdMillis, stageDir, stageCid, prepared, sealed);
+ mHistoricalSessionsByInstaller.put(installerUid,
+ mHistoricalSessionsByInstaller.get(installerUid) + 1);
}
private void writeSessionsLocked() {
@@ -460,7 +380,7 @@
final int size = mSessions.size();
for (int i = 0; i < size; i++) {
final PackageInstallerSession session = mSessions.valueAt(i);
- writeSessionLocked(out, session);
+ session.write(out, mSessionsDir);
}
out.endTag(null, TAG_SESSIONS);
out.endDocument();
@@ -473,106 +393,6 @@
}
}
- private void writeSessionLocked(XmlSerializer out, PackageInstallerSession session)
- throws IOException {
- final SessionParams params = session.params;
-
- out.startTag(null, TAG_SESSION);
-
- writeIntAttribute(out, ATTR_SESSION_ID, session.sessionId);
- writeIntAttribute(out, ATTR_USER_ID, session.userId);
- writeStringAttribute(out, ATTR_INSTALLER_PACKAGE_NAME,
- session.installerPackageName);
- writeIntAttribute(out, ATTR_INSTALLER_UID, session.installerUid);
- writeLongAttribute(out, ATTR_CREATED_MILLIS, session.createdMillis);
- if (session.stageDir != null) {
- writeStringAttribute(out, ATTR_SESSION_STAGE_DIR,
- session.stageDir.getAbsolutePath());
- }
- if (session.stageCid != null) {
- writeStringAttribute(out, ATTR_SESSION_STAGE_CID, session.stageCid);
- }
- writeBooleanAttribute(out, ATTR_PREPARED, session.isPrepared());
- writeBooleanAttribute(out, ATTR_SEALED, session.isSealed());
-
- writeIntAttribute(out, ATTR_MODE, params.mode);
- writeIntAttribute(out, ATTR_INSTALL_FLAGS, params.installFlags);
- writeIntAttribute(out, ATTR_INSTALL_LOCATION, params.installLocation);
- writeLongAttribute(out, ATTR_SIZE_BYTES, params.sizeBytes);
- writeStringAttribute(out, ATTR_APP_PACKAGE_NAME, params.appPackageName);
- writeStringAttribute(out, ATTR_APP_LABEL, params.appLabel);
- writeUriAttribute(out, ATTR_ORIGINATING_URI, params.originatingUri);
- writeIntAttribute(out, ATTR_ORIGINATING_UID, params.originatingUid);
- writeUriAttribute(out, ATTR_REFERRER_URI, params.referrerUri);
- writeStringAttribute(out, ATTR_ABI_OVERRIDE, params.abiOverride);
- writeStringAttribute(out, ATTR_VOLUME_UUID, params.volumeUuid);
- writeIntAttribute(out, ATTR_INSTALL_REASON, params.installReason);
-
- // Persist app icon if changed since last written
- final File appIconFile = buildAppIconFile(session.sessionId);
- if (params.appIcon == null && appIconFile.exists()) {
- appIconFile.delete();
- } else if (params.appIcon != null
- && appIconFile.lastModified() != params.appIconLastModified) {
- if (LOGD) Slog.w(TAG, "Writing changed icon " + appIconFile);
- FileOutputStream os = null;
- try {
- os = new FileOutputStream(appIconFile);
- params.appIcon.compress(CompressFormat.PNG, 90, os);
- } catch (IOException e) {
- Slog.w(TAG, "Failed to write icon " + appIconFile + ": " + e.getMessage());
- } finally {
- IoUtils.closeQuietly(os);
- }
-
- params.appIconLastModified = appIconFile.lastModified();
- }
-
- writeGrantedRuntimePermissions(out, params.grantedRuntimePermissions);
-
- out.endTag(null, TAG_SESSION);
- }
-
- private static void writeGrantedRuntimePermissions(XmlSerializer out,
- String[] grantedRuntimePermissions) throws IOException {
- if (grantedRuntimePermissions != null) {
- for (String permission : grantedRuntimePermissions) {
- out.startTag(null, TAG_GRANTED_RUNTIME_PERMISSION);
- writeStringAttribute(out, ATTR_NAME, permission);
- out.endTag(null, TAG_GRANTED_RUNTIME_PERMISSION);
- }
- }
- }
-
- private static String[] readGrantedRuntimePermissions(XmlPullParser in)
- throws IOException, XmlPullParserException {
- List<String> permissions = null;
-
- final int outerDepth = in.getDepth();
- int type;
- while ((type = in.next()) != XmlPullParser.END_DOCUMENT
- && (type != XmlPullParser.END_TAG || in.getDepth() > outerDepth)) {
- if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) {
- continue;
- }
- if (TAG_GRANTED_RUNTIME_PERMISSION.equals(in.getName())) {
- String permission = readStringAttribute(in, ATTR_NAME);
- if (permissions == null) {
- permissions = new ArrayList<>();
- }
- permissions.add(permission);
- }
- }
-
- if (permissions == null) {
- return null;
- }
-
- String[] permissionsArray = new String[permissions.size()];
- permissions.toArray(permissionsArray);
- return permissionsArray;
- }
-
private File buildAppIconFile(int sessionId) {
return new File(mSessionsDir, "app_icon." + sessionId + ".png");
}
@@ -885,9 +705,11 @@
synchronized (mSessions) {
for (int i = 0; i < mSessions.size(); i++) {
final PackageInstallerSession session = mSessions.valueAt(i);
- if (Objects.equals(session.installerPackageName, installerPackageName)
+
+ SessionInfo info = session.generateInfo(false);
+ if (Objects.equals(info.getInstallerPackageName(), installerPackageName)
&& session.userId == userId) {
- result.add(session.generateInfo(false));
+ result.add(info);
}
}
}
@@ -962,7 +784,7 @@
final int size = sessions.size();
for (int i = 0; i < size; i++) {
final PackageInstallerSession session = sessions.valueAt(i);
- if (session.installerUid == installerUid) {
+ if (session.getInstallerUid() == installerUid) {
count++;
}
}
@@ -974,7 +796,7 @@
if (callingUid == Process.ROOT_UID) {
return true;
} else {
- return (session != null) && (callingUid == session.installerUid);
+ return (session != null) && (callingUid == session.getInstallerUid());
}
}
diff --git a/services/core/java/com/android/server/pm/PackageInstallerSession.java b/services/core/java/com/android/server/pm/PackageInstallerSession.java
index 5823771..d492590 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerSession.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerSession.java
@@ -25,9 +25,22 @@
import static android.system.OsConstants.O_RDONLY;
import static android.system.OsConstants.O_WRONLY;
+import static com.android.internal.util.XmlUtils.readBitmapAttribute;
+import static com.android.internal.util.XmlUtils.readBooleanAttribute;
+import static com.android.internal.util.XmlUtils.readIntAttribute;
+import static com.android.internal.util.XmlUtils.readLongAttribute;
+import static com.android.internal.util.XmlUtils.readStringAttribute;
+import static com.android.internal.util.XmlUtils.readUriAttribute;
+import static com.android.internal.util.XmlUtils.writeBooleanAttribute;
+import static com.android.internal.util.XmlUtils.writeIntAttribute;
+import static com.android.internal.util.XmlUtils.writeLongAttribute;
+import static com.android.internal.util.XmlUtils.writeStringAttribute;
+import static com.android.internal.util.XmlUtils.writeUriAttribute;
import static com.android.server.pm.PackageInstallerService.prepareExternalStageCid;
import static com.android.server.pm.PackageInstallerService.prepareStageDir;
+import android.Manifest;
+import android.annotation.NonNull;
import android.app.admin.DevicePolicyManager;
import android.content.Context;
import android.content.Intent;
@@ -45,6 +58,8 @@
import android.content.pm.PackageParser.PackageLite;
import android.content.pm.PackageParser.PackageParserException;
import android.content.pm.Signature;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
import android.os.Binder;
import android.os.Bundle;
import android.os.FileBridge;
@@ -53,6 +68,7 @@
import android.os.Looper;
import android.os.Message;
import android.os.ParcelFileDescriptor;
+import android.os.ParcelableException;
import android.os.Process;
import android.os.RemoteException;
import android.os.RevocableFileDescriptor;
@@ -80,9 +96,14 @@
import libcore.io.IoUtils;
import libcore.io.Libcore;
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlSerializer;
+
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileFilter;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.security.cert.Certificate;
import java.util.ArrayList;
@@ -97,6 +118,34 @@
private static final int MSG_COMMIT = 0;
+ /** XML constants used for persisting a session */
+ static final String TAG_SESSION = "session";
+ private static final String TAG_GRANTED_RUNTIME_PERMISSION = "granted-runtime-permission";
+ private static final String ATTR_SESSION_ID = "sessionId";
+ private static final String ATTR_USER_ID = "userId";
+ private static final String ATTR_INSTALLER_PACKAGE_NAME = "installerPackageName";
+ private static final String ATTR_INSTALLER_UID = "installerUid";
+ private static final String ATTR_CREATED_MILLIS = "createdMillis";
+ private static final String ATTR_SESSION_STAGE_DIR = "sessionStageDir";
+ private static final String ATTR_SESSION_STAGE_CID = "sessionStageCid";
+ private static final String ATTR_PREPARED = "prepared";
+ private static final String ATTR_SEALED = "sealed";
+ private static final String ATTR_MODE = "mode";
+ private static final String ATTR_INSTALL_FLAGS = "installFlags";
+ private static final String ATTR_INSTALL_LOCATION = "installLocation";
+ private static final String ATTR_SIZE_BYTES = "sizeBytes";
+ private static final String ATTR_APP_PACKAGE_NAME = "appPackageName";
+ @Deprecated
+ private static final String ATTR_APP_ICON = "appIcon";
+ private static final String ATTR_APP_LABEL = "appLabel";
+ private static final String ATTR_ORIGINATING_URI = "originatingUri";
+ private static final String ATTR_ORIGINATING_UID = "originatingUid";
+ private static final String ATTR_REFERRER_URI = "referrerUri";
+ private static final String ATTR_ABI_OVERRIDE = "abiOverride";
+ private static final String ATTR_VOLUME_UUID = "volumeUuid";
+ private static final String ATTR_NAME = "name";
+ private static final String ATTR_INSTALL_REASON = "installRason";
+
// TODO: enforce INSTALL_ALLOW_TEST
// TODO: enforce INSTALL_ALLOW_DOWNGRADE
@@ -104,12 +153,9 @@
private final Context mContext;
private final PackageManagerService mPm;
private final Handler mHandler;
- private final boolean mIsInstallerDeviceOwner;
final int sessionId;
final int userId;
- final String installerPackageName;
- final int installerUid;
final SessionParams params;
final long createdMillis;
final int defaultContainerGid;
@@ -122,6 +168,17 @@
private final Object mLock = new Object();
+ /** Uid of the creator of this session. */
+ private final int mOriginalInstallerUid;
+
+ /** Package of the owner of the installer session */
+ @GuardedBy("mLock")
+ private String mInstallerPackageName;
+
+ /** Uid of the owner of the installer session */
+ @GuardedBy("mLock")
+ private int mInstallerUid;
+
@GuardedBy("mLock")
private float mClientProgress = 0;
@GuardedBy("mLock")
@@ -132,18 +189,25 @@
@GuardedBy("mLock")
private float mReportedProgress = -1;
+ /** State of the session. */
@GuardedBy("mLock")
private boolean mPrepared = false;
@GuardedBy("mLock")
private boolean mSealed = false;
@GuardedBy("mLock")
- private boolean mPermissionsAccepted = false;
+ private boolean mCommitted = false;
@GuardedBy("mLock")
private boolean mRelinquished = false;
@GuardedBy("mLock")
private boolean mDestroyed = false;
+ /** Permissions have been accepted by the user (see {@link #setPermissionsResult}) */
+ @GuardedBy("mLock")
+ private boolean mPermissionsManuallyAccepted = false;
+
+ @GuardedBy("mLock")
private int mFinalStatus;
+ @GuardedBy("mLock")
private String mFinalMessage;
@GuardedBy("mLock")
@@ -155,9 +219,13 @@
private IPackageInstallObserver2 mRemoteObserver;
/** Fields derived from commit parsing */
+ @GuardedBy("mLock")
private String mPackageName;
+ @GuardedBy("mLock")
private int mVersionCode;
+ @GuardedBy("mLock")
private Signature[] mSignatures;
+ @GuardedBy("mLock")
private Certificate[][] mCertificates;
/**
@@ -205,32 +273,61 @@
private final Handler.Callback mHandlerCallback = new Handler.Callback() {
@Override
public boolean handleMessage(Message msg) {
- // Cache package manager data without the lock held
- final PackageInfo pkgInfo = mPm.getPackageInfo(
- params.appPackageName, PackageManager.GET_SIGNATURES
- | PackageManager.MATCH_STATIC_SHARED_LIBRARIES /*flags*/, userId);
- final ApplicationInfo appInfo = mPm.getApplicationInfo(
- params.appPackageName, 0, userId);
-
synchronized (mLock) {
if (msg.obj != null) {
mRemoteObserver = (IPackageInstallObserver2) msg.obj;
}
-
try {
- commitLocked(pkgInfo, appInfo);
+ commitLocked();
} catch (PackageManagerException e) {
final String completeMsg = ExceptionUtils.getCompleteMessage(e);
Slog.e(TAG, "Commit of session " + sessionId + " failed: " + completeMsg);
destroyInternal();
dispatchSessionFinished(e.error, completeMsg, null);
}
-
- return true;
}
+
+ return true;
}
};
+ /**
+ * @return {@code true} iff the installing is app an device owner?
+ */
+ private boolean isInstallerDeviceOwnerLocked() {
+ DevicePolicyManager dpm = (DevicePolicyManager) mContext.getSystemService(
+ Context.DEVICE_POLICY_SERVICE);
+
+ return (dpm != null) && dpm.isDeviceOwnerAppOnCallingUser(
+ mInstallerPackageName);
+ }
+
+ /**
+ * Checks if the permissions still need to be confirmed.
+ *
+ * <p>This is dependant on the identity of the installer, hence this cannot be cached if the
+ * installer might still {@link #transfer(String) change}.
+ *
+ * @return {@code true} iff we need to ask to confirm the permissions?
+ */
+ private boolean needToAskForPermissionsLocked() {
+ if (mPermissionsManuallyAccepted) {
+ return false;
+ }
+
+ final boolean isPermissionGranted =
+ (mPm.checkUidPermission(android.Manifest.permission.INSTALL_PACKAGES,
+ mInstallerUid) == PackageManager.PERMISSION_GRANTED);
+ final boolean isInstallerRoot = (mInstallerUid == Process.ROOT_UID);
+ final boolean forcePermissionPrompt =
+ (params.installFlags & PackageManager.INSTALL_FORCE_PERMISSION_PROMPT) != 0;
+
+ // Device owners are allowed to silently install packages, so the permission check is
+ // waived if the installer is the device owner.
+ return forcePermissionPrompt || !(isPermissionGranted || isInstallerRoot
+ || isInstallerDeviceOwnerLocked());
+ }
+
public PackageInstallerSession(PackageInstallerService.InternalCallback callback,
Context context, PackageManagerService pm, Looper looper, int sessionId, int userId,
String installerPackageName, int installerUid, SessionParams params, long createdMillis,
@@ -242,8 +339,9 @@
this.sessionId = sessionId;
this.userId = userId;
- this.installerPackageName = installerPackageName;
- this.installerUid = installerUid;
+ mOriginalInstallerUid = installerUid;
+ mInstallerPackageName = installerPackageName;
+ mInstallerUid = installerUid;
this.params = params;
this.createdMillis = createdMillis;
this.stageDir = stageDir;
@@ -257,26 +355,6 @@
mPrepared = prepared;
mSealed = sealed;
- // Device owners are allowed to silently install packages, so the permission check is
- // waived if the installer is the device owner.
- DevicePolicyManager dpm = (DevicePolicyManager) mContext.getSystemService(
- Context.DEVICE_POLICY_SERVICE);
- final boolean isPermissionGranted =
- (mPm.checkUidPermission(android.Manifest.permission.INSTALL_PACKAGES, installerUid)
- == PackageManager.PERMISSION_GRANTED);
- final boolean isInstallerRoot = (installerUid == Process.ROOT_UID);
- final boolean forcePermissionPrompt =
- (params.installFlags & PackageManager.INSTALL_FORCE_PERMISSION_PROMPT) != 0;
- mIsInstallerDeviceOwner = (dpm != null) && dpm.isDeviceOwnerAppOnCallingUser(
- installerPackageName);
- if ((isPermissionGranted
- || isInstallerRoot
- || mIsInstallerDeviceOwner)
- && !forcePermissionPrompt) {
- mPermissionsAccepted = true;
- } else {
- mPermissionsAccepted = false;
- }
final long identity = Binder.clearCallingIdentity();
try {
final int uid = mPm.getPackageUid(PackageManagerService.DEFAULT_CONTAINER_PACKAGE,
@@ -295,7 +373,7 @@
final SessionInfo info = new SessionInfo();
synchronized (mLock) {
info.sessionId = sessionId;
- info.installerPackageName = installerPackageName;
+ info.installerPackageName = mInstallerPackageName;
info.resolvedBaseCodePath = (mResolvedBaseFile != null) ?
mResolvedBaseFile.getAbsolutePath() : null;
info.progress = mProgress;
@@ -310,6 +388,13 @@
info.appIcon = params.appIcon;
}
info.appLabel = params.appLabel;
+
+ info.installLocation = params.installLocation;
+ info.originatingUri = params.originatingUri;
+ info.originatingUid = params.originatingUid;
+ info.referrerUri = params.referrerUri;
+ info.grantedRuntimePermissions = params.grantedRuntimePermissions;
+ info.installFlags = params.installFlags;
}
return info;
}
@@ -326,14 +411,26 @@
}
}
- private void assertPreparedAndNotSealed(String cookie) {
- synchronized (mLock) {
- if (!mPrepared) {
- throw new IllegalStateException(cookie + " before prepared");
- }
- if (mSealed) {
- throw new SecurityException(cookie + " not allowed after commit");
- }
+ private void assertPreparedAndNotSealedLocked(String cookie) {
+ assertPreparedAndNotCommittedOrDestroyedLocked(cookie);
+ if (mSealed) {
+ throw new SecurityException(cookie + " not allowed after sealing");
+ }
+ }
+
+ private void assertPreparedAndNotCommittedOrDestroyedLocked(String cookie) {
+ assertPreparedAndNotDestroyedLocked(cookie);
+ if (mCommitted) {
+ throw new SecurityException(cookie + " not allowed after commit");
+ }
+ }
+
+ private void assertPreparedAndNotDestroyedLocked(String cookie) {
+ if (!mPrepared) {
+ throw new IllegalStateException(cookie + " before prepared");
+ }
+ if (mDestroyed) {
+ throw new SecurityException(cookie + " not allowed after destruction");
}
}
@@ -342,27 +439,27 @@
* might point at an ASEC mount point, which is why we delay path resolution
* until someone actively works with the session.
*/
- private File resolveStageDir() throws IOException {
- synchronized (mLock) {
- if (mResolvedStageDir == null) {
- if (stageDir != null) {
- mResolvedStageDir = stageDir;
+ private File resolveStageDirLocked() throws IOException {
+ if (mResolvedStageDir == null) {
+ if (stageDir != null) {
+ mResolvedStageDir = stageDir;
+ } else {
+ final String path = PackageHelper.getSdDir(stageCid);
+ if (path != null) {
+ mResolvedStageDir = new File(path);
} else {
- final String path = PackageHelper.getSdDir(stageCid);
- if (path != null) {
- mResolvedStageDir = new File(path);
- } else {
- throw new IOException("Failed to resolve path to container " + stageCid);
- }
+ throw new IOException("Failed to resolve path to container " + stageCid);
}
}
- return mResolvedStageDir;
}
+ return mResolvedStageDir;
}
@Override
public void setClientProgress(float progress) {
synchronized (mLock) {
+ assertCallerIsOwnerOrRootLocked();
+
// Always publish first staging movement
final boolean forcePublish = (mClientProgress == 0);
mClientProgress = progress;
@@ -373,6 +470,8 @@
@Override
public void addClientProgress(float progress) {
synchronized (mLock) {
+ assertCallerIsOwnerOrRootLocked();
+
setClientProgress(mClientProgress + progress);
}
}
@@ -390,11 +489,15 @@
@Override
public String[] getNames() {
- assertPreparedAndNotSealed("getNames");
- try {
- return resolveStageDir().list();
- } catch (IOException e) {
- throw ExceptionUtils.wrap(e);
+ synchronized (mLock) {
+ assertCallerIsOwnerOrRootLocked();
+ assertPreparedAndNotCommittedOrDestroyedLocked("getNames");
+
+ try {
+ return resolveStageDirLocked().list();
+ } catch (IOException e) {
+ throw ExceptionUtils.wrap(e);
+ }
}
}
@@ -403,20 +506,26 @@
if (TextUtils.isEmpty(params.appPackageName)) {
throw new IllegalStateException("Must specify package name to remove a split");
}
- try {
- createRemoveSplitMarker(splitName);
- } catch (IOException e) {
- throw ExceptionUtils.wrap(e);
+
+ synchronized (mLock) {
+ assertCallerIsOwnerOrRootLocked();
+ assertPreparedAndNotCommittedOrDestroyedLocked("removeSplit");
+
+ try {
+ createRemoveSplitMarkerLocked(splitName);
+ } catch (IOException e) {
+ throw ExceptionUtils.wrap(e);
+ }
}
}
- private void createRemoveSplitMarker(String splitName) throws IOException {
+ private void createRemoveSplitMarkerLocked(String splitName) throws IOException {
try {
final String markerName = splitName + REMOVE_SPLIT_MARKER_EXTENSION;
if (!FileUtils.isValidExtFilename(markerName)) {
throw new IllegalArgumentException("Invalid marker: " + markerName);
}
- final File target = new File(resolveStageDir(), markerName);
+ final File target = new File(resolveStageDirLocked(), markerName);
target.createNewFile();
Os.chmod(target.getAbsolutePath(), 0 /*mode*/);
} catch (ErrnoException e) {
@@ -440,8 +549,10 @@
// will block any attempted install transitions.
final RevocableFileDescriptor fd;
final FileBridge bridge;
+ final File stageDir;
synchronized (mLock) {
- assertPreparedAndNotSealed("openWrite");
+ assertCallerIsOwnerOrRootLocked();
+ assertPreparedAndNotSealedLocked("openWrite");
if (PackageInstaller.ENABLE_REVOCABLE_FD) {
fd = new RevocableFileDescriptor();
@@ -452,6 +563,8 @@
bridge = new FileBridge();
mBridges.add(bridge);
}
+
+ stageDir = resolveStageDirLocked();
}
try {
@@ -462,7 +575,7 @@
final File target;
final long identity = Binder.clearCallingIdentity();
try {
- target = new File(resolveStageDir(), name);
+ target = new File(stageDir, name);
} finally {
Binder.restoreCallingIdentity(identity);
}
@@ -500,55 +613,108 @@
@Override
public ParcelFileDescriptor openRead(String name) {
- try {
- return openReadInternal(name);
- } catch (IOException e) {
- throw ExceptionUtils.wrap(e);
+ synchronized (mLock) {
+ assertCallerIsOwnerOrRootLocked();
+ assertPreparedAndNotCommittedOrDestroyedLocked("openRead");
+ try {
+ return openReadInternalLocked(name);
+ } catch (IOException e) {
+ throw ExceptionUtils.wrap(e);
+ }
}
}
- private ParcelFileDescriptor openReadInternal(String name) throws IOException {
- assertPreparedAndNotSealed("openRead");
-
+ private ParcelFileDescriptor openReadInternalLocked(String name) throws IOException {
try {
if (!FileUtils.isValidExtFilename(name)) {
throw new IllegalArgumentException("Invalid name: " + name);
}
- final File target = new File(resolveStageDir(), name);
-
+ final File target = new File(resolveStageDirLocked(), name);
final FileDescriptor targetFd = Libcore.os.open(target.getAbsolutePath(), O_RDONLY, 0);
return new ParcelFileDescriptor(targetFd);
-
} catch (ErrnoException e) {
throw e.rethrowAsIOException();
}
}
+ /**
+ * Check if the caller is the owner of this session. Otherwise throw a
+ * {@link SecurityException}.
+ */
+ private void assertCallerIsOwnerOrRootLocked() {
+ final int callingUid = Binder.getCallingUid();
+ if (callingUid != Process.ROOT_UID && callingUid != mInstallerUid) {
+ throw new SecurityException("Session does not belong to uid " + callingUid);
+ }
+ }
+
+ /**
+ * If anybody is reading or writing data of the session, throw an {@link SecurityException}.
+ */
+ private void assertNoWriteFileTransfersOpenLocked() {
+ // Verify that all writers are hands-off
+ for (RevocableFileDescriptor fd : mFds) {
+ if (!fd.isRevoked()) {
+ throw new SecurityException("Files still open");
+ }
+ }
+ for (FileBridge bridge : mBridges) {
+ if (!bridge.isClosed()) {
+ throw new SecurityException("Files still open");
+ }
+ }
+ }
+
@Override
- public void commit(IntentSender statusReceiver) {
+ public void commit(IntentSender statusReceiver, boolean forTransfer) {
Preconditions.checkNotNull(statusReceiver);
+ // Cache package manager data without the lock held
+ final PackageInfo installedPkgInfo = mPm.getPackageInfo(
+ params.appPackageName, PackageManager.GET_SIGNATURES
+ | PackageManager.MATCH_STATIC_SHARED_LIBRARIES /*flags*/, userId);
+
final boolean wasSealed;
synchronized (mLock) {
+ assertCallerIsOwnerOrRootLocked();
+ assertPreparedAndNotDestroyedLocked("commit");
+
+ if (forTransfer) {
+ mContext.enforceCallingOrSelfPermission(Manifest.permission.INSTALL_PACKAGES, null);
+
+ if (mInstallerUid == mOriginalInstallerUid) {
+ throw new IllegalArgumentException("Session has not been transferred");
+ }
+ } else {
+ if (mInstallerUid != mOriginalInstallerUid) {
+ throw new IllegalArgumentException("Session has been transferred");
+ }
+ }
+
wasSealed = mSealed;
if (!mSealed) {
- // Verify that all writers are hands-off
- for (RevocableFileDescriptor fd : mFds) {
- if (!fd.isRevoked()) {
- throw new SecurityException("Files still open");
- }
+ try {
+ sealAndValidateLocked(installedPkgInfo);
+ } catch (PackageManagerException e) {
+ // Do now throw an exception here to stay compatible with O and older
+ destroyInternal();
+ dispatchSessionFinished(e.error, ExceptionUtils.getCompleteMessage(e), null);
+ return;
}
- for (FileBridge bridge : mBridges) {
- if (!bridge.isClosed()) {
- throw new SecurityException("Files still open");
- }
- }
- mSealed = true;
}
// Client staging is fully done at this point
mClientProgress = 1f;
computeProgressLocked(true);
+
+ // This ongoing commit should keep session active, even though client
+ // will probably close their end.
+ mActiveCount.incrementAndGet();
+
+ mCommitted = true;
+ final PackageInstallObserverAdapter adapter = new PackageInstallObserverAdapter(
+ mContext, statusReceiver, sessionId, isInstallerDeviceOwnerLocked(), userId);
+ mHandler.obtainMessage(MSG_COMMIT, adapter.getBinder()).sendToTarget();
}
if (!wasSealed) {
@@ -557,17 +723,82 @@
// the session lock, since otherwise it's a lock inversion.
mCallback.onSessionSealedBlocking(this);
}
-
- // This ongoing commit should keep session active, even though client
- // will probably close their end.
- mActiveCount.incrementAndGet();
-
- final PackageInstallObserverAdapter adapter = new PackageInstallObserverAdapter(mContext,
- statusReceiver, sessionId, mIsInstallerDeviceOwner, userId);
- mHandler.obtainMessage(MSG_COMMIT, adapter.getBinder()).sendToTarget();
}
- private void commitLocked(PackageInfo pkgInfo, ApplicationInfo appInfo)
+ /**
+ * Seal the session to prevent further modification and validate the contents of it.
+ *
+ * <p>The session will be sealed after calling this method even if it failed.
+ *
+ * @param pkgInfo The package info for {@link #params}.packagename
+ */
+ private void sealAndValidateLocked(PackageInfo pkgInfo)
+ throws PackageManagerException {
+ assertNoWriteFileTransfersOpenLocked();
+
+ mSealed = true;
+
+ // Verify that stage looks sane with respect to existing application.
+ // This currently only ensures packageName, versionCode, and certificate
+ // consistency.
+ validateInstallLocked(pkgInfo);
+
+ // Read transfers from the original owner stay open, but as the session's data
+ // cannot be modified anymore, there is no leak of information.
+ }
+
+ @Override
+ public void transfer(String packageName) {
+ Preconditions.checkNotNull(packageName);
+
+ ApplicationInfo newOwnerAppInfo = mPm.getApplicationInfo(packageName, 0, userId);
+ if (newOwnerAppInfo == null) {
+ throw new ParcelableException(new PackageManager.NameNotFoundException(packageName));
+ }
+
+ if (PackageManager.PERMISSION_GRANTED != mPm.checkUidPermission(
+ Manifest.permission.INSTALL_PACKAGES, newOwnerAppInfo.uid)) {
+ throw new SecurityException("Destination package " + packageName + " does not have "
+ + "the " + Manifest.permission.INSTALL_PACKAGES + " permission");
+ }
+
+ // Cache package manager data without the lock held
+ final PackageInfo installedPkgInfo = mPm.getPackageInfo(
+ params.appPackageName, PackageManager.GET_SIGNATURES
+ | PackageManager.MATCH_STATIC_SHARED_LIBRARIES /*flags*/, userId);
+
+ // Only install flags that can be verified by the app the session is transferred to are
+ // allowed. The parameters can be read via PackageInstaller.SessionInfo.
+ if (!params.areHiddenOptionsSet()) {
+ throw new SecurityException("Can only transfer sessions that use public options");
+ }
+
+ synchronized (mLock) {
+ assertCallerIsOwnerOrRootLocked();
+ assertPreparedAndNotSealedLocked("transfer");
+
+ try {
+ sealAndValidateLocked(installedPkgInfo);
+ } catch (PackageManagerException e) {
+ throw new IllegalArgumentException("Package is not valid", e);
+ }
+
+ if (!mPackageName.equals(mInstallerPackageName)) {
+ throw new SecurityException("Can only transfer sessions that update the original "
+ + "installer");
+ }
+
+ mInstallerPackageName = packageName;
+ mInstallerUid = newOwnerAppInfo.uid;
+ }
+
+ // Persist the fact that we've sealed ourselves to prevent
+ // mutations of any hard links we create. We do this without holding
+ // the session lock, since otherwise it's a lock inversion.
+ mCallback.onSessionSealedBlocking(this);
+ }
+
+ private void commitLocked()
throws PackageManagerException {
if (mDestroyed) {
throw new PackageManagerException(INSTALL_FAILED_INTERNAL_ERROR, "Session destroyed");
@@ -577,22 +808,17 @@
}
try {
- resolveStageDir();
+ resolveStageDirLocked();
} catch (IOException e) {
throw new PackageManagerException(INSTALL_FAILED_CONTAINER_ERROR,
"Failed to resolve stage location", e);
}
- // Verify that stage looks sane with respect to existing application.
- // This currently only ensures packageName, versionCode, and certificate
- // consistency.
- validateInstallLocked(pkgInfo, appInfo);
-
Preconditions.checkNotNull(mPackageName);
Preconditions.checkNotNull(mSignatures);
Preconditions.checkNotNull(mResolvedBaseFile);
- if (!mPermissionsAccepted) {
+ if (needToAskForPermissionsLocked()) {
// User needs to accept permissions; give installer an intent they
// can use to involve user.
final Intent intent = new Intent(PackageInstaller.ACTION_CONFIRM_PERMISSIONS);
@@ -605,7 +831,7 @@
// Commit was keeping session marked as active until now; release
// that extra refcount so session appears idle.
- close();
+ closeInternal(false);
return;
}
@@ -622,7 +848,7 @@
if (params.mode == SessionParams.MODE_INHERIT_EXISTING) {
try {
final List<File> fromFiles = mResolvedInheritedFiles;
- final File toDir = resolveStageDir();
+ final File toDir = resolveStageDirLocked();
if (LOGD) Slog.d(TAG, "Inherited files: " + mResolvedInheritedFiles);
if (!mResolvedInheritedFiles.isEmpty() && mInheritedFilesBase == null) {
@@ -683,7 +909,7 @@
mRelinquished = true;
mPm.installStage(mPackageName, stageDir, stageCid, localObserver, params,
- installerPackageName, installerUid, user, mCertificates);
+ mInstallerPackageName, mInstallerUid, user, mCertificates);
}
/**
@@ -698,8 +924,7 @@
* Note that upgrade compatibility is still performed by
* {@link PackageManagerService}.
*/
- private void validateInstallLocked(PackageInfo pkgInfo, ApplicationInfo appInfo)
- throws PackageManagerException {
+ private void validateInstallLocked(PackageInfo pkgInfo) throws PackageManagerException {
mPackageName = null;
mVersionCode = -1;
mSignatures = null;
@@ -752,7 +977,7 @@
mCertificates = apk.certificates;
}
- assertApkConsistent(String.valueOf(addedFile), apk);
+ assertApkConsistentLocked(String.valueOf(addedFile), apk);
// Take this opportunity to enforce uniform naming
final String targetName;
@@ -807,13 +1032,14 @@
} else {
// Partial installs must be consistent with existing install
- if (appInfo == null) {
+ if (pkgInfo == null || pkgInfo.applicationInfo == null) {
throw new PackageManagerException(INSTALL_FAILED_INVALID_APK,
"Missing existing base package for " + mPackageName);
}
final PackageLite existing;
final ApkLite existingBase;
+ ApplicationInfo appInfo = pkgInfo.applicationInfo;
try {
existing = PackageParser.parsePackageLite(new File(appInfo.getCodePath()), 0);
existingBase = PackageParser.parseApkLite(new File(appInfo.getBaseCodePath()),
@@ -822,7 +1048,7 @@
throw PackageManagerException.from(e);
}
- assertApkConsistent("Existing base", existingBase);
+ assertApkConsistentLocked("Existing base", existingBase);
// Inherit base if not overridden
if (mResolvedBaseFile == null) {
@@ -878,7 +1104,7 @@
}
}
- private void assertApkConsistent(String tag, ApkLite apk)
+ private void assertApkConsistentLocked(String tag, ApkLite apk)
throws PackageManagerException {
if (!mPackageName.equals(apk.packageName)) {
throw new PackageManagerException(INSTALL_FAILED_INVALID_APK, tag + " package "
@@ -959,6 +1185,15 @@
return true;
}
+ /**
+ * @return the uid of the owner this session
+ */
+ public int getInstallerUid() {
+ synchronized (mLock) {
+ return mInstallerUid;
+ }
+ }
+
private static String getRelativePath(File file, File base) throws IOException {
final String pathStr = file.getAbsolutePath();
final String baseStr = base.getAbsolutePath();
@@ -1106,9 +1341,9 @@
if (accepted) {
// Mark and kick off another install pass
synchronized (mLock) {
- mPermissionsAccepted = true;
+ mPermissionsManuallyAccepted = true;
+ mHandler.obtainMessage(MSG_COMMIT).sendToTarget();
}
- mHandler.obtainMessage(MSG_COMMIT).sendToTarget();
} else {
destroyInternal();
dispatchSessionFinished(INSTALL_FAILED_ABORTED, "User rejected permissions", null);
@@ -1120,7 +1355,9 @@
mCallback.onSessionActiveChanged(this, true);
}
+ boolean wasPrepared;
synchronized (mLock) {
+ wasPrepared = mPrepared;
if (!mPrepared) {
if (stageDir != null) {
prepareStageDir(stageDir);
@@ -1141,35 +1378,63 @@
}
mPrepared = true;
- mCallback.onSessionPrepared(this);
}
}
+
+ if (!wasPrepared) {
+ mCallback.onSessionPrepared(this);
+ }
}
@Override
public void close() {
- if (mActiveCount.decrementAndGet() == 0) {
+ closeInternal(true);
+ }
+
+ private void closeInternal(boolean checkCaller) {
+ int activeCount;
+ synchronized (mLock) {
+ if (checkCaller) {
+ assertCallerIsOwnerOrRootLocked();
+ }
+
+ activeCount = mActiveCount.decrementAndGet();
+ }
+
+ if (activeCount == 0) {
mCallback.onSessionActiveChanged(this, false);
}
}
@Override
public void abandon() {
- if (mRelinquished) {
- Slog.d(TAG, "Ignoring abandon after commit relinquished control");
- return;
+ synchronized (mLock) {
+ assertCallerIsOwnerOrRootLocked();
+
+ if (mRelinquished) {
+ Slog.d(TAG, "Ignoring abandon after commit relinquished control");
+ return;
+ }
+ destroyInternal();
}
- destroyInternal();
+
dispatchSessionFinished(INSTALL_FAILED_ABORTED, "Session was abandoned", null);
}
private void dispatchSessionFinished(int returnCode, String msg, Bundle extras) {
- mFinalStatus = returnCode;
- mFinalMessage = msg;
+ IPackageInstallObserver2 observer;
+ String packageName;
+ synchronized (mLock) {
+ mFinalStatus = returnCode;
+ mFinalMessage = msg;
- if (mRemoteObserver != null) {
+ observer = mRemoteObserver;
+ packageName = mPackageName;
+ }
+
+ if (observer != null) {
try {
- mRemoteObserver.onPackageInstalled(mPackageName, returnCode, msg, extras);
+ observer.onPackageInstalled(packageName, returnCode, msg, extras);
} catch (RemoteException ignored) {
}
}
@@ -1220,8 +1485,9 @@
pw.increaseIndent();
pw.printPair("userId", userId);
- pw.printPair("installerPackageName", installerPackageName);
- pw.printPair("installerUid", installerUid);
+ pw.printPair("mOriginalInstallerUid", mOriginalInstallerUid);
+ pw.printPair("mInstallerPackageName", mInstallerPackageName);
+ pw.printPair("mInstallerUid", mInstallerUid);
pw.printPair("createdMillis", createdMillis);
pw.printPair("stageDir", stageDir);
pw.printPair("stageCid", stageCid);
@@ -1232,7 +1498,7 @@
pw.printPair("mClientProgress", mClientProgress);
pw.printPair("mProgress", mProgress);
pw.printPair("mSealed", mSealed);
- pw.printPair("mPermissionsAccepted", mPermissionsAccepted);
+ pw.printPair("mPermissionsManuallyAccepted", mPermissionsManuallyAccepted);
pw.printPair("mRelinquished", mRelinquished);
pw.printPair("mDestroyed", mDestroyed);
pw.printPair("mFds", mFds.size());
@@ -1243,4 +1509,170 @@
pw.decreaseIndent();
}
+
+ private static void writeGrantedRuntimePermissionsLocked(XmlSerializer out,
+ String[] grantedRuntimePermissions) throws IOException {
+ if (grantedRuntimePermissions != null) {
+ for (String permission : grantedRuntimePermissions) {
+ out.startTag(null, TAG_GRANTED_RUNTIME_PERMISSION);
+ writeStringAttribute(out, ATTR_NAME, permission);
+ out.endTag(null, TAG_GRANTED_RUNTIME_PERMISSION);
+ }
+ }
+ }
+
+ private static File buildAppIconFile(int sessionId, @NonNull File sessionsDir) {
+ return new File(sessionsDir, "app_icon." + sessionId + ".png");
+ }
+
+ /**
+ * Write this session to a {@link XmlSerializer}.
+ *
+ * @param out Where to write the session to
+ * @param sessionsDir The directory containing the sessions
+ */
+ void write(@NonNull XmlSerializer out, @NonNull File sessionsDir) throws IOException {
+ synchronized (mLock) {
+ out.startTag(null, TAG_SESSION);
+
+ writeIntAttribute(out, ATTR_SESSION_ID, sessionId);
+ writeIntAttribute(out, ATTR_USER_ID, userId);
+ writeStringAttribute(out, ATTR_INSTALLER_PACKAGE_NAME,
+ mInstallerPackageName);
+ writeIntAttribute(out, ATTR_INSTALLER_UID, mInstallerUid);
+ writeLongAttribute(out, ATTR_CREATED_MILLIS, createdMillis);
+ if (stageDir != null) {
+ writeStringAttribute(out, ATTR_SESSION_STAGE_DIR,
+ stageDir.getAbsolutePath());
+ }
+ if (stageCid != null) {
+ writeStringAttribute(out, ATTR_SESSION_STAGE_CID, stageCid);
+ }
+ writeBooleanAttribute(out, ATTR_PREPARED, isPrepared());
+ writeBooleanAttribute(out, ATTR_SEALED, isSealed());
+
+ writeIntAttribute(out, ATTR_MODE, params.mode);
+ writeIntAttribute(out, ATTR_INSTALL_FLAGS, params.installFlags);
+ writeIntAttribute(out, ATTR_INSTALL_LOCATION, params.installLocation);
+ writeLongAttribute(out, ATTR_SIZE_BYTES, params.sizeBytes);
+ writeStringAttribute(out, ATTR_APP_PACKAGE_NAME, params.appPackageName);
+ writeStringAttribute(out, ATTR_APP_LABEL, params.appLabel);
+ writeUriAttribute(out, ATTR_ORIGINATING_URI, params.originatingUri);
+ writeIntAttribute(out, ATTR_ORIGINATING_UID, params.originatingUid);
+ writeUriAttribute(out, ATTR_REFERRER_URI, params.referrerUri);
+ writeStringAttribute(out, ATTR_ABI_OVERRIDE, params.abiOverride);
+ writeStringAttribute(out, ATTR_VOLUME_UUID, params.volumeUuid);
+ writeIntAttribute(out, ATTR_INSTALL_REASON, params.installReason);
+
+ // Persist app icon if changed since last written
+ File appIconFile = buildAppIconFile(sessionId, sessionsDir);
+ if (params.appIcon == null && appIconFile.exists()) {
+ appIconFile.delete();
+ } else if (params.appIcon != null
+ && appIconFile.lastModified() != params.appIconLastModified) {
+ if (LOGD) Slog.w(TAG, "Writing changed icon " + appIconFile);
+ FileOutputStream os = null;
+ try {
+ os = new FileOutputStream(appIconFile);
+ params.appIcon.compress(Bitmap.CompressFormat.PNG, 90, os);
+ } catch (IOException e) {
+ Slog.w(TAG, "Failed to write icon " + appIconFile + ": " + e.getMessage());
+ } finally {
+ IoUtils.closeQuietly(os);
+ }
+
+ params.appIconLastModified = appIconFile.lastModified();
+ }
+
+ writeGrantedRuntimePermissionsLocked(out, params.grantedRuntimePermissions);
+ }
+
+ out.endTag(null, TAG_SESSION);
+ }
+
+ private static String[] readGrantedRuntimePermissions(XmlPullParser in)
+ throws IOException, XmlPullParserException {
+ List<String> permissions = null;
+
+ final int outerDepth = in.getDepth();
+ int type;
+ while ((type = in.next()) != XmlPullParser.END_DOCUMENT
+ && (type != XmlPullParser.END_TAG || in.getDepth() > outerDepth)) {
+ if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) {
+ continue;
+ }
+ if (TAG_GRANTED_RUNTIME_PERMISSION.equals(in.getName())) {
+ String permission = readStringAttribute(in, ATTR_NAME);
+ if (permissions == null) {
+ permissions = new ArrayList<>();
+ }
+ permissions.add(permission);
+ }
+ }
+
+ if (permissions == null) {
+ return null;
+ }
+
+ String[] permissionsArray = new String[permissions.size()];
+ permissions.toArray(permissionsArray);
+ return permissionsArray;
+ }
+
+ /**
+ * Read new session from a {@link XmlPullParser xml description} and create it.
+ *
+ * @param in The source of the description
+ * @param callback Callback the session uses to notify about changes of it's state
+ * @param context Context to be used by the session
+ * @param pm PackageManager to use by the session
+ * @param installerThread Thread to be used for callbacks of this session
+ * @param sessionsDir The directory the sessions are stored in
+ *
+ * @return The newly created session
+ */
+ public static PackageInstallerSession readFromXml(@NonNull XmlPullParser in,
+ @NonNull PackageInstallerService.InternalCallback callback, @NonNull Context context,
+ @NonNull PackageManagerService pm, Looper installerThread, @NonNull File sessionsDir)
+ throws IOException, XmlPullParserException {
+ final int sessionId = readIntAttribute(in, ATTR_SESSION_ID);
+ final int userId = readIntAttribute(in, ATTR_USER_ID);
+ final String installerPackageName = readStringAttribute(in, ATTR_INSTALLER_PACKAGE_NAME);
+ final int installerUid = readIntAttribute(in, ATTR_INSTALLER_UID, pm.getPackageUid(
+ installerPackageName, PackageManager.MATCH_UNINSTALLED_PACKAGES, userId));
+ final long createdMillis = readLongAttribute(in, ATTR_CREATED_MILLIS);
+ final String stageDirRaw = readStringAttribute(in, ATTR_SESSION_STAGE_DIR);
+ final File stageDir = (stageDirRaw != null) ? new File(stageDirRaw) : null;
+ final String stageCid = readStringAttribute(in, ATTR_SESSION_STAGE_CID);
+ final boolean prepared = readBooleanAttribute(in, ATTR_PREPARED, true);
+ final boolean sealed = readBooleanAttribute(in, ATTR_SEALED);
+
+ final SessionParams params = new SessionParams(
+ SessionParams.MODE_INVALID);
+ params.mode = readIntAttribute(in, ATTR_MODE);
+ params.installFlags = readIntAttribute(in, ATTR_INSTALL_FLAGS);
+ params.installLocation = readIntAttribute(in, ATTR_INSTALL_LOCATION);
+ params.sizeBytes = readLongAttribute(in, ATTR_SIZE_BYTES);
+ params.appPackageName = readStringAttribute(in, ATTR_APP_PACKAGE_NAME);
+ params.appIcon = readBitmapAttribute(in, ATTR_APP_ICON);
+ params.appLabel = readStringAttribute(in, ATTR_APP_LABEL);
+ params.originatingUri = readUriAttribute(in, ATTR_ORIGINATING_URI);
+ params.originatingUid =
+ readIntAttribute(in, ATTR_ORIGINATING_UID, SessionParams.UID_UNKNOWN);
+ params.referrerUri = readUriAttribute(in, ATTR_REFERRER_URI);
+ params.abiOverride = readStringAttribute(in, ATTR_ABI_OVERRIDE);
+ params.volumeUuid = readStringAttribute(in, ATTR_VOLUME_UUID);
+ params.grantedRuntimePermissions = readGrantedRuntimePermissions(in);
+ params.installReason = readIntAttribute(in, ATTR_INSTALL_REASON);
+
+ final File appIconFile = buildAppIconFile(sessionId, sessionsDir);
+ if (appIconFile.exists()) {
+ params.appIcon = BitmapFactory.decodeFile(appIconFile.getAbsolutePath());
+ params.appIconLastModified = appIconFile.lastModified();
+ }
+
+ return new PackageInstallerSession(callback, context, pm,
+ installerThread, sessionId, userId, installerPackageName, installerUid,
+ params, createdMillis, stageDir, stageCid, prepared, sealed);
+ }
}
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index b68630e..99261ad 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -143,6 +143,7 @@
import android.content.pm.IPackageInstallObserver2;
import android.content.pm.IPackageInstaller;
import android.content.pm.IPackageManager;
+import android.content.pm.IPackageManagerNative;
import android.content.pm.IPackageMoveObserver;
import android.content.pm.IPackageStatsObserver;
import android.content.pm.InstantAppInfo;
@@ -448,6 +449,7 @@
static final int SCAN_FIRST_BOOT_OR_UPGRADE = 1<<16;
static final int SCAN_AS_INSTANT_APP = 1<<17;
static final int SCAN_AS_FULL_APP = 1<<18;
+ static final int SCAN_AS_VIRTUAL_PRELOAD = 1<<19;
/** Should not be with the scan flags */
static final int FLAGS_REMOVE_CHATTY = 1<<31;
@@ -2304,6 +2306,8 @@
factoryTest, onlyCore);
m.enableSystemUserPackages();
ServiceManager.addService("package", m);
+ final PackageManagerNative pmn = m.new PackageManagerNative();
+ ServiceManager.addService("package_native", pmn);
return m;
}
@@ -3354,7 +3358,7 @@
final List<ResolveInfo> matches = queryIntentReceiversInternal(intent, PACKAGE_MIME_TYPE,
MATCH_SYSTEM_ONLY | MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE,
- UserHandle.USER_SYSTEM);
+ UserHandle.USER_SYSTEM, false /*allowDynamicSplits*/);
if (matches.size() == 1) {
return matches.get(0).getComponentInfo().packageName;
} else if (matches.size() == 0) {
@@ -3414,7 +3418,7 @@
final List<ResolveInfo> matches = queryIntentReceiversInternal(intent, PACKAGE_MIME_TYPE,
MATCH_SYSTEM_ONLY | MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE,
- UserHandle.USER_SYSTEM);
+ UserHandle.USER_SYSTEM, false /*allowDynamicSplits*/);
ResolveInfo best = null;
final int N = matches.size();
for (int i = 0; i < N; i++) {
@@ -6409,7 +6413,18 @@
return null;
}
synchronized (mPackages) {
- return getNameForUidLocked(callingUid, uid);
+ Object obj = mSettings.getUserIdLPr(UserHandle.getAppId(uid));
+ if (obj instanceof SharedUserSetting) {
+ final SharedUserSetting sus = (SharedUserSetting) obj;
+ return sus.name + ":" + sus.userId;
+ } else if (obj instanceof PackageSetting) {
+ final PackageSetting ps = (PackageSetting) obj;
+ if (filterAppAccessLPr(ps, callingUid, UserHandle.getUserId(callingUid))) {
+ return null;
+ }
+ return ps.name;
+ }
+ return null;
}
}
@@ -6426,27 +6441,25 @@
synchronized (mPackages) {
for (int i = uids.length - 1; i >= 0; i--) {
final int uid = uids[i];
- names[i] = getNameForUidLocked(callingUid, uid);
+ Object obj = mSettings.getUserIdLPr(UserHandle.getAppId(uid));
+ if (obj instanceof SharedUserSetting) {
+ final SharedUserSetting sus = (SharedUserSetting) obj;
+ names[i] = "shared:" + sus.name;
+ } else if (obj instanceof PackageSetting) {
+ final PackageSetting ps = (PackageSetting) obj;
+ if (filterAppAccessLPr(ps, callingUid, UserHandle.getUserId(callingUid))) {
+ names[i] = null;
+ } else {
+ names[i] = ps.name;
+ }
+ } else {
+ names[i] = null;
+ }
}
}
return names;
}
- private String getNameForUidLocked(int callingUid, int uid) {
- Object obj = mSettings.getUserIdLPr(UserHandle.getAppId(uid));
- if (obj instanceof SharedUserSetting) {
- final SharedUserSetting sus = (SharedUserSetting) obj;
- return sus.name + ":" + sus.userId;
- } else if (obj instanceof PackageSetting) {
- final PackageSetting ps = (PackageSetting) obj;
- if (filterAppAccessLPr(ps, callingUid, UserHandle.getUserId(callingUid))) {
- return null;
- }
- return ps.name;
- }
- return null;
- }
-
@Override
public int getUidForSharedUser(String sharedUserName) {
if (getInstantAppPackageName(Binder.getCallingUid()) != null) {
@@ -6573,7 +6586,7 @@
Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "queryIntentActivities");
final List<ResolveInfo> query = queryIntentActivitiesInternal(intent, resolvedType,
- flags, callingUid, userId, resolveForStart);
+ flags, callingUid, userId, resolveForStart, true /*allowDynamicSplits*/);
Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
final ResolveInfo bestChoice =
@@ -7118,12 +7131,13 @@
private @NonNull List<ResolveInfo> queryIntentActivitiesInternal(Intent intent,
String resolvedType, int flags, int userId) {
return queryIntentActivitiesInternal(
- intent, resolvedType, flags, Binder.getCallingUid(), userId, false);
+ intent, resolvedType, flags, Binder.getCallingUid(), userId,
+ false /*resolveForStart*/, true /*allowDynamicSplits*/);
}
private @NonNull List<ResolveInfo> queryIntentActivitiesInternal(Intent intent,
String resolvedType, int flags, int filterCallingUid, int userId,
- boolean resolveForStart) {
+ boolean resolveForStart, boolean allowDynamicSplits) {
if (!sUserManager.exists(userId)) return Collections.emptyList();
final String instantAppPkgName = getInstantAppPackageName(filterCallingUid);
enforceCrossUserPermission(Binder.getCallingUid(), userId,
@@ -7180,7 +7194,8 @@
list.add(ri);
}
}
- return applyPostResolutionFilter(list, instantAppPkgName);
+ return applyPostResolutionFilter(
+ list, instantAppPkgName, allowDynamicSplits, filterCallingUid, userId);
}
// reader
@@ -7199,7 +7214,8 @@
List<ResolveInfo> xpResult = new ArrayList<ResolveInfo>(1);
xpResult.add(xpResolveInfo);
return applyPostResolutionFilter(
- filterIfNotSystemUser(xpResult, userId), instantAppPkgName);
+ filterIfNotSystemUser(xpResult, userId), instantAppPkgName,
+ allowDynamicSplits, filterCallingUid, userId);
}
// Check for results in the current profile.
@@ -7238,13 +7254,15 @@
// And we are not going to add emphemeral app, so we can return the
// result straight away.
result.add(xpDomainInfo.resolveInfo);
- return applyPostResolutionFilter(result, instantAppPkgName);
+ return applyPostResolutionFilter(result, instantAppPkgName,
+ allowDynamicSplits, filterCallingUid, userId);
}
} else if (result.size() <= 1 && !addEphemeral) {
// No result in parent user and <= 1 result in current profile, and we
// are not going to add emphemeral app, so we can return the result without
// further processing.
- return applyPostResolutionFilter(result, instantAppPkgName);
+ return applyPostResolutionFilter(result, instantAppPkgName,
+ allowDynamicSplits, filterCallingUid, userId);
}
// We have more than one candidate (combining results from current and parent
// profile), so we need filtering and sorting.
@@ -7279,7 +7297,8 @@
if (sortResult) {
Collections.sort(result, mResolvePrioritySorter);
}
- return applyPostResolutionFilter(result, instantAppPkgName);
+ return applyPostResolutionFilter(
+ result, instantAppPkgName, allowDynamicSplits, filterCallingUid, userId);
}
private List<ResolveInfo> maybeAddInstantAppInstaller(List<ResolveInfo> result, Intent intent,
@@ -7345,7 +7364,8 @@
// the instant application, we'll do the right thing.
final ApplicationInfo ai = localInstantApp.activityInfo.applicationInfo;
auxiliaryResponse = new AuxiliaryResolveInfo(
- ai.packageName, null /*splitName*/, ai.versionCode, null /*failureIntent*/);
+ ai.packageName, null /*splitName*/, null /*failureActivity*/,
+ ai.versionCode, null /*failureIntent*/);
}
}
if (auxiliaryResponse != null) {
@@ -7481,13 +7501,12 @@
* @return A filtered list of resolved activities.
*/
private List<ResolveInfo> applyPostResolutionFilter(List<ResolveInfo> resolveInfos,
- String ephemeralPkgName) {
+ String ephemeralPkgName, boolean allowDynamicSplits, int filterCallingUid, int userId) {
for (int i = resolveInfos.size() - 1; i >= 0; i--) {
final ResolveInfo info = resolveInfos.get(i);
- // TODO: When adding on-demand split support for non-instant apps, remove this check
- // and always apply post filtering
// allow activities that are defined in the provided package
- if (info.activityInfo.splitName != null
+ if (allowDynamicSplits
+ && info.activityInfo.splitName != null
&& !ArrayUtils.contains(info.activityInfo.applicationInfo.splitNames,
info.activityInfo.splitName)) {
// requested activity is defined in a split that hasn't been installed yet.
@@ -7496,9 +7515,13 @@
Slog.v(TAG, "Adding installer to the ResolveInfo list");
}
final ResolveInfo installerInfo = new ResolveInfo(mInstantAppInstallerInfo);
+ final ComponentName installFailureActivity = findInstallFailureActivity(
+ info.activityInfo.packageName, filterCallingUid, userId);
installerInfo.auxiliaryInfo = new AuxiliaryResolveInfo(
info.activityInfo.packageName, info.activityInfo.splitName,
- info.activityInfo.applicationInfo.versionCode, null /*failureIntent*/);
+ installFailureActivity,
+ info.activityInfo.applicationInfo.versionCode,
+ null /*failureIntent*/);
// make sure this resolver is the default
installerInfo.isDefault = true;
installerInfo.match = IntentFilter.MATCH_CATEGORY_SCHEME_SPECIFIC_PART
@@ -7529,6 +7552,34 @@
}
/**
+ * Returns the activity component that can handle install failures.
+ * <p>By default, the instant application installer handles failures. However, an
+ * application may want to handle failures on its own. Applications do this by
+ * creating an activity with an intent filter that handles the action
+ * {@link Intent#ACTION_INSTALL_FAILURE}.
+ */
+ private @Nullable ComponentName findInstallFailureActivity(
+ String packageName, int filterCallingUid, int userId) {
+ final Intent failureActivityIntent = new Intent(Intent.ACTION_INSTALL_FAILURE);
+ failureActivityIntent.setPackage(packageName);
+ // IMPORTANT: disallow dynamic splits to avoid an infinite loop
+ final List<ResolveInfo> result = queryIntentActivitiesInternal(
+ failureActivityIntent, null /*resolvedType*/, 0 /*flags*/, filterCallingUid, userId,
+ false /*resolveForStart*/, false /*allowDynamicSplits*/);
+ final int NR = result.size();
+ if (NR > 0) {
+ for (int i = 0; i < NR; i++) {
+ final ResolveInfo info = result.get(i);
+ if (info.activityInfo.splitName != null) {
+ continue;
+ }
+ return new ComponentName(packageName, info.activityInfo.name);
+ }
+ }
+ return null;
+ }
+
+ /**
* @param resolveInfos list of resolve infos in descending priority order
* @return if the list contains a resolve info with non-negative priority
*/
@@ -8015,11 +8066,12 @@
public @NonNull ParceledListSlice<ResolveInfo> queryIntentReceivers(Intent intent,
String resolvedType, int flags, int userId) {
return new ParceledListSlice<>(
- queryIntentReceiversInternal(intent, resolvedType, flags, userId));
+ queryIntentReceiversInternal(intent, resolvedType, flags, userId,
+ false /*allowDynamicSplits*/));
}
private @NonNull List<ResolveInfo> queryIntentReceiversInternal(Intent intent,
- String resolvedType, int flags, int userId) {
+ String resolvedType, int flags, int userId, boolean allowDynamicSplits) {
if (!sUserManager.exists(userId)) return Collections.emptyList();
final int callingUid = Binder.getCallingUid();
enforceCrossUserPermission(callingUid, userId,
@@ -8075,7 +8127,8 @@
list.add(ri);
}
}
- return applyPostResolutionFilter(list, instantAppPkgName);
+ return applyPostResolutionFilter(
+ list, instantAppPkgName, allowDynamicSplits, callingUid, userId);
}
// reader
@@ -8084,13 +8137,15 @@
if (pkgName == null) {
final List<ResolveInfo> result =
mReceivers.queryIntent(intent, resolvedType, flags, userId);
- return applyPostResolutionFilter(result, instantAppPkgName);
+ return applyPostResolutionFilter(
+ result, instantAppPkgName, allowDynamicSplits, callingUid, userId);
}
final PackageParser.Package pkg = mPackages.get(pkgName);
if (pkg != null) {
final List<ResolveInfo> result = mReceivers.queryIntentForPackage(
intent, resolvedType, flags, pkg.receivers, userId);
- return applyPostResolutionFilter(result, instantAppPkgName);
+ return applyPostResolutionFilter(
+ result, instantAppPkgName, allowDynamicSplits, callingUid, userId);
}
return Collections.emptyList();
}
@@ -8199,8 +8254,6 @@
private List<ResolveInfo> applyPostServiceResolutionFilter(List<ResolveInfo> resolveInfos,
String instantAppPkgName) {
- // TODO: When adding on-demand split support for non-instant apps, remove this check
- // and always apply post filtering
if (instantAppPkgName == null) {
return resolveInfos;
}
@@ -8220,7 +8273,8 @@
final ResolveInfo installerInfo = new ResolveInfo(mInstantAppInstallerInfo);
installerInfo.auxiliaryInfo = new AuxiliaryResolveInfo(
info.serviceInfo.packageName, info.serviceInfo.splitName,
- info.serviceInfo.applicationInfo.versionCode, null /*failureIntent*/);
+ null /*failureActivity*/, info.serviceInfo.applicationInfo.versionCode,
+ null /*failureIntent*/);
// make sure this resolver is the default
installerInfo.isDefault = true;
installerInfo.match = IntentFilter.MATCH_CATEGORY_SCHEME_SPECIFIC_PART
@@ -8320,8 +8374,6 @@
private List<ResolveInfo> applyPostContentProviderResolutionFilter(
List<ResolveInfo> resolveInfos, String instantAppPkgName) {
- // TODO: When adding on-demand split support for non-instant applications, remove
- // this check and always apply post filtering
if (instantAppPkgName == null) {
return resolveInfos;
}
@@ -8341,7 +8393,8 @@
final ResolveInfo installerInfo = new ResolveInfo(mInstantAppInstallerInfo);
installerInfo.auxiliaryInfo = new AuxiliaryResolveInfo(
info.providerInfo.packageName, info.providerInfo.splitName,
- info.providerInfo.applicationInfo.versionCode, null /*failureIntent*/);
+ null /*failureActivity*/, info.providerInfo.applicationInfo.versionCode,
+ null /*failureIntent*/);
// make sure this resolver is the default
installerInfo.isDefault = true;
installerInfo.match = IntentFilter.MATCH_CATEGORY_SCHEME_SPECIFIC_PART
@@ -9392,6 +9445,9 @@
if (ps != null && ps.getInstantApp(userId)) {
scanFlags |= SCAN_AS_INSTANT_APP;
}
+ if (ps != null && ps.getVirtulalPreload(userId)) {
+ scanFlags |= SCAN_AS_VIRTUAL_PRELOAD;
+ }
// Note that we invoke the following method only if we are about to unpack an application
PackageParser.Package scannedPkg = scanPackageLI(pkg, policyFlags, scanFlags
@@ -9875,17 +9931,19 @@
Collection<PackageParser.Package> deps = findSharedNonSystemLibraries(p);
final String[] instructionSets = getAppDexInstructionSets(p.applicationInfo);
if (!deps.isEmpty()) {
+ DexoptOptions libraryOptions = new DexoptOptions(options.getPackageName(),
+ options.getCompilerFilter(), options.getSplitName(),
+ options.getFlags() | DexoptOptions.DEXOPT_AS_SHARED_LIBRARY);
for (PackageParser.Package depPackage : deps) {
// TODO: Analyze and investigate if we (should) profile libraries.
pdo.performDexOpt(depPackage, null /* sharedLibraries */, instructionSets,
getOrCreateCompilerPackageStats(depPackage),
- true /* isUsedByOtherApps */,
- options);
+ mDexManager.getPackageUseInfoOrDefault(depPackage.packageName), libraryOptions);
}
}
return pdo.performDexOpt(p, p.usesLibraryFiles, instructionSets,
getOrCreateCompilerPackageStats(p),
- mDexManager.isUsedByOtherApps(p.packageName), options);
+ mDexManager.getPackageUseInfoOrDefault(p.packageName), options);
}
/**
@@ -10011,7 +10069,7 @@
public void shutdown() {
mPackageUsage.writeNow(mPackages);
mCompilerStats.writeNow();
- mDexManager.savePackageDexUsageNow();
+ mDexManager.writePackageDexUsageNow();
}
@Override
@@ -10642,15 +10700,17 @@
final String parentPackageName = (pkg.parentPackage != null)
? pkg.parentPackage.packageName : null;
final boolean instantApp = (scanFlags & SCAN_AS_INSTANT_APP) != 0;
+ final boolean virtualPreload = (scanFlags & SCAN_AS_VIRTUAL_PRELOAD) != 0;
// REMOVE SharedUserSetting from method; update in a separate call
pkgSetting = Settings.createNewSetting(pkg.packageName, origPackage,
disabledPkgSetting, realName, suid, destCodeFile, destResourceFile,
pkg.applicationInfo.nativeLibraryRootDir, pkg.applicationInfo.primaryCpuAbi,
pkg.applicationInfo.secondaryCpuAbi, pkg.mVersionCode,
pkg.applicationInfo.flags, pkg.applicationInfo.privateFlags, user,
- true /*allowInstall*/, instantApp, parentPackageName,
- pkg.getChildPackageNames(), UserManagerService.getInstance(),
- usesStaticLibraries, pkg.usesStaticLibrariesVersions);
+ true /*allowInstall*/, instantApp, virtualPreload,
+ parentPackageName, pkg.getChildPackageNames(),
+ UserManagerService.getInstance(), usesStaticLibraries,
+ pkg.usesStaticLibrariesVersions);
// SIDE EFFECTS; updates system state; move elsewhere
if (origPackage != null) {
mSettings.addRenamedPackageLPw(pkg.packageName, origPackage.name);
@@ -16204,7 +16264,8 @@
// Query all live verifiers based on current user state
final List<ResolveInfo> receivers = queryIntentReceiversInternal(verification,
- PACKAGE_MIME_TYPE, 0, verifierUser.getIdentifier());
+ PACKAGE_MIME_TYPE, 0, verifierUser.getIdentifier(),
+ false /*allowDynamicSplits*/);
if (DEBUG_VERIFY) {
Slog.d(TAG, "Found " + receivers.size() + " verifiers for intent "
@@ -18166,6 +18227,8 @@
final boolean instantApp = ((installFlags & PackageManager.INSTALL_INSTANT_APP) != 0);
final boolean fullApp = ((installFlags & PackageManager.INSTALL_FULL_APP) != 0);
final boolean forceSdk = ((installFlags & PackageManager.INSTALL_FORCE_SDK) != 0);
+ final boolean virtualPreload =
+ ((installFlags & PackageManager.INSTALL_VIRTUAL_PRELOAD) != 0);
boolean replace = false;
int scanFlags = SCAN_NEW_INSTALL | SCAN_UPDATE_SIGNATURE;
if (args.move != null) {
@@ -18181,6 +18244,9 @@
if (fullApp) {
scanFlags |= SCAN_AS_FULL_APP;
}
+ if (virtualPreload) {
+ scanFlags |= SCAN_AS_VIRTUAL_PRELOAD;
+ }
// Result object to be returned
res.setReturnCode(PackageManager.INSTALL_SUCCEEDED);
@@ -18560,7 +18626,7 @@
mPackageDexOptimizer.performDexOpt(pkg, pkg.usesLibraryFiles,
null /* instructionSets */,
getOrCreateCompilerPackageStats(pkg),
- mDexManager.isUsedByOtherApps(pkg.packageName),
+ mDexManager.getPackageUseInfoOrDefault(pkg.packageName),
dexoptOptions);
Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
}
@@ -19971,6 +20037,7 @@
false /*hidden*/,
false /*suspended*/,
false /*instantApp*/,
+ false /*virtualPreload*/,
null /*lastDisableAppCaller*/,
null /*enabledComponents*/,
null /*disabledComponents*/,
@@ -22858,7 +22925,8 @@
for (PackageParser.Package pkg : packages) {
ipw.println("[" + pkg.packageName + "]");
ipw.increaseIndent();
- mPackageDexOptimizer.dumpDexoptState(ipw, pkg);
+ mPackageDexOptimizer.dumpDexoptState(ipw, pkg,
+ mDexManager.getPackageUseInfoOrDefault(pkg.packageName));
ipw.decreaseIndent();
}
}
@@ -24789,6 +24857,20 @@
}
}
+ private class PackageManagerNative extends IPackageManagerNative.Stub {
+ @Override
+ public String[] getNamesForUids(int[] uids) throws RemoteException {
+ final String[] results = PackageManagerService.this.getNamesForUids(uids);
+ // massage results so they can be parsed by the native binder
+ for (int i = results.length - 1; i >= 0; --i) {
+ if (results[i] == null) {
+ results[i] = "";
+ }
+ }
+ return results;
+ }
+ }
+
private class PackageManagerInternalImpl extends PackageManagerInternal {
@Override
public void setLocationPackagesProvider(PackagesProvider provider) {
@@ -24937,7 +25019,7 @@
final String resolvedType = intent.resolveTypeIfNeeded(mContext.getContentResolver());
return PackageManagerService.this
.queryIntentActivitiesInternal(intent, resolvedType, flags, filterCallingUid,
- userId, false /*resolveForStart*/);
+ userId, false /*resolveForStart*/, true /*allowDynamicSplits*/);
}
@Override
@@ -25383,8 +25465,8 @@
if (ps == null) {
continue;
}
- PackageDexUsage.PackageUseInfo packageUseInfo = getDexManager().getPackageUseInfo(
- pkg.packageName);
+ PackageDexUsage.PackageUseInfo packageUseInfo =
+ getDexManager().getPackageUseInfoOrDefault(pkg.packageName);
if (PackageManagerServiceUtils
.isUnusedSinceTimeInMillis(ps.firstInstallTime, currentTimeInMillis,
downgradeTimeThresholdMillis, packageUseInfo,
diff --git a/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java b/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java
index a7031c9..25fef0a 100644
--- a/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java
+++ b/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java
@@ -25,7 +25,6 @@
import android.annotation.NonNull;
import android.app.AppGlobals;
import android.content.Intent;
-import android.content.pm.PackageInfo;
import android.content.pm.PackageParser;
import android.content.pm.ResolveInfo;
import android.os.Build;
@@ -137,9 +136,11 @@
sortTemp, packageManagerService);
// Give priority to apps used by other apps.
+ DexManager dexManager = packageManagerService.getDexManager();
applyPackageFilter((pkg) ->
- packageManagerService.getDexManager().isUsedByOtherApps(pkg.packageName), result,
- remainingPkgs, sortTemp, packageManagerService);
+ dexManager.getPackageUseInfoOrDefault(pkg.packageName)
+ .isAnyCodePathUsedByOtherApps(),
+ result, remainingPkgs, sortTemp, packageManagerService);
// Filter out packages that aren't recently used, add all remaining apps.
// TODO: add a property to control this?
@@ -209,12 +210,10 @@
// If the app was active in background during the threshold period and was used
// by other packages.
- // If packageUseInfo is null, it can be said that the package was not used by other
- // packages.
boolean isActiveInBackgroundAndUsedByOtherPackages = ((currentTimeInMillis
- latestPackageUseTimeInMillis)
< thresholdTimeinMillis)
- && (packageUseInfo != null && packageUseInfo.isUsedByOtherApps());
+ && packageUseInfo.isAnyCodePathUsedByOtherApps();
return !isActiveInBackgroundAndUsedByOtherPackages;
}
diff --git a/services/core/java/com/android/server/pm/PackageSettingBase.java b/services/core/java/com/android/server/pm/PackageSettingBase.java
index f685127..d3ca1fd 100644
--- a/services/core/java/com/android/server/pm/PackageSettingBase.java
+++ b/services/core/java/com/android/server/pm/PackageSettingBase.java
@@ -420,11 +420,19 @@
modifyUserState(userId).instantApp = instantApp;
}
+ boolean getVirtulalPreload(int userId) {
+ return readUserState(userId).virtualPreload;
+ }
+
+ void setVirtualPreload(boolean virtualPreload, int userId) {
+ modifyUserState(userId).virtualPreload = virtualPreload;
+ }
+
void setUserState(int userId, long ceDataInode, int enabled, boolean installed, boolean stopped,
boolean notLaunched, boolean hidden, boolean suspended, boolean instantApp,
- String lastDisableAppCaller, ArraySet<String> enabledComponents,
- ArraySet<String> disabledComponents, int domainVerifState,
- int linkGeneration, int installReason) {
+ boolean virtualPreload, String lastDisableAppCaller,
+ ArraySet<String> enabledComponents, ArraySet<String> disabledComponents,
+ int domainVerifState, int linkGeneration, int installReason) {
PackageUserState state = modifyUserState(userId);
state.ceDataInode = ceDataInode;
state.enabled = enabled;
@@ -440,6 +448,7 @@
state.appLinkGeneration = linkGeneration;
state.installReason = installReason;
state.instantApp = instantApp;
+ state.virtualPreload = virtualPreload;
}
ArraySet<String> getEnabledComponents(int userId) {
diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java
index 45d0c58..d99408f 100644
--- a/services/core/java/com/android/server/pm/Settings.java
+++ b/services/core/java/com/android/server/pm/Settings.java
@@ -226,6 +226,7 @@
private static final String ATTR_APP_LINK_GENERATION = "app-link-generation";
private static final String ATTR_INSTALL_REASON = "install-reason";
private static final String ATTR_INSTANT_APP = "instant-app";
+ private static final String ATTR_VIRTUAL_PRELOAD = "virtual-preload";
private static final String ATTR_PACKAGE_NAME = "packageName";
private static final String ATTR_FINGERPRINT = "fingerprint";
@@ -697,8 +698,9 @@
PackageSetting disabledPkg, String realPkgName, SharedUserSetting sharedUser,
File codePath, File resourcePath, String legacyNativeLibraryPath, String primaryCpuAbi,
String secondaryCpuAbi, int versionCode, int pkgFlags, int pkgPrivateFlags,
- UserHandle installUser, boolean allowInstall, boolean instantApp, String parentPkgName,
- List<String> childPkgNames, UserManagerService userManager,
+ UserHandle installUser, boolean allowInstall, boolean instantApp,
+ boolean virtualPreload, String parentPkgName, List<String> childPkgNames,
+ UserManagerService userManager,
String[] usesStaticLibraries, int[] usesStaticLibrariesVersions) {
final PackageSetting pkgSetting;
if (originalPkg != null) {
@@ -760,6 +762,7 @@
false /*hidden*/,
false /*suspended*/,
instantApp,
+ virtualPreload,
null /*lastDisableAppCaller*/,
null /*enabledComponents*/,
null /*disabledComponents*/,
@@ -1693,6 +1696,7 @@
false /*hidden*/,
false /*suspended*/,
false /*instantApp*/,
+ false /*virtualPreload*/,
null /*lastDisableAppCaller*/,
null /*enabledComponents*/,
null /*disabledComponents*/,
@@ -1766,6 +1770,8 @@
ATTR_BLOCK_UNINSTALL, false);
final boolean instantApp = XmlUtils.readBooleanAttribute(parser,
ATTR_INSTANT_APP, false);
+ final boolean virtualPreload = XmlUtils.readBooleanAttribute(parser,
+ ATTR_VIRTUAL_PRELOAD, false);
final int enabled = XmlUtils.readIntAttribute(parser, ATTR_ENABLED,
COMPONENT_ENABLED_STATE_DEFAULT);
final String enabledCaller = parser.getAttributeValue(null,
@@ -1805,8 +1811,8 @@
setBlockUninstallLPw(userId, name, true);
}
ps.setUserState(userId, ceDataInode, enabled, installed, stopped, notLaunched,
- hidden, suspended, instantApp, enabledCaller, enabledComponents,
- disabledComponents, verifState, linkGeneration,
+ hidden, suspended, instantApp, virtualPreload, enabledCaller,
+ enabledComponents, disabledComponents, verifState, linkGeneration,
installReason);
} else if (tagName.equals("preferred-activities")) {
readPreferredActivitiesLPw(parser, userId);
@@ -2117,6 +2123,9 @@
if (ustate.instantApp) {
serializer.attribute(null, ATTR_INSTANT_APP, "true");
}
+ if (ustate.virtualPreload) {
+ serializer.attribute(null, ATTR_VIRTUAL_PRELOAD, "true");
+ }
if (ustate.enabled != COMPONENT_ENABLED_STATE_DEFAULT) {
serializer.attribute(null, ATTR_ENABLED,
Integer.toString(ustate.enabled));
@@ -4603,6 +4612,7 @@
pw.print(ps.getStopped(user.id) ? "S" : "s");
pw.print(ps.getNotLaunched(user.id) ? "l" : "L");
pw.print(ps.getInstantApp(user.id) ? "IA" : "ia");
+ pw.print(ps.getVirtulalPreload(user.id) ? "VPI" : "vpi");
pw.print(",");
pw.print(ps.getEnabled(user.id));
String lastDisabledAppCaller = ps.getLastDisabledAppCaller(user.id);
@@ -4858,6 +4868,8 @@
pw.print(ps.getEnabled(user.id));
pw.print(" instant=");
pw.println(ps.getInstantApp(user.id));
+ pw.print(" virtual=");
+ pw.println(ps.getVirtulalPreload(user.id));
String[] overlayPaths = ps.getOverlayPaths(user.id);
if (overlayPaths != null && overlayPaths.length > 0) {
diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java
index 2d645c0..e6c6622 100644
--- a/services/core/java/com/android/server/pm/UserManagerService.java
+++ b/services/core/java/com/android/server/pm/UserManagerService.java
@@ -3652,7 +3652,7 @@
public UserInfo createUserEvenWhenDisallowed(String name, int flags) {
UserInfo user = createUserInternalUnchecked(name, flags, UserHandle.USER_NULL, null);
// Keep this in sync with UserManager.createUser
- if (user != null && !user.isAdmin()) {
+ if (user != null && !user.isAdmin() && !user.isDemo()) {
setUserRestriction(UserManager.DISALLOW_SMS, true, user.id);
setUserRestriction(UserManager.DISALLOW_OUTGOING_CALLS, true, user.id);
}
diff --git a/services/core/java/com/android/server/pm/dex/DexManager.java b/services/core/java/com/android/server/pm/dex/DexManager.java
index 947e01c4..6274754 100644
--- a/services/core/java/com/android/server/pm/dex/DexManager.java
+++ b/services/core/java/com/android/server/pm/dex/DexManager.java
@@ -36,6 +36,8 @@
import java.io.File;
import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
import java.util.List;
import java.util.HashMap;
import java.util.HashSet;
@@ -81,6 +83,19 @@
private static int DEX_SEARCH_FOUND_SPLIT = 2; // dex file is a split apk
private static int DEX_SEARCH_FOUND_SECONDARY = 3; // dex file is a secondary dex
+ /**
+ * We do not record packages that have no secondary dex files or that are not used by other
+ * apps. This is an optimization to reduce the amount of data that needs to be written to
+ * disk (apps will not usually be shared so this trims quite a bit the number we record).
+ *
+ * To make this behaviour transparent to the callers which need use information on packages,
+ * DexManager will return this DEFAULT instance from
+ * {@link DexManager#getPackageUseInfoOrDefault}. It has no data about secondary dex files and
+ * is marked as not being used by other apps. This reflects the intended behaviour when we don't
+ * find the package in the underlying data file.
+ */
+ private final static PackageUseInfo DEFAULT_USE_INFO = new PackageUseInfo();
+
public DexManager(IPackageManager pms, PackageDexOptimizer pdo,
Installer installer, Object installLock) {
mPackageCodeLocationsCache = new HashMap<>();
@@ -297,6 +312,8 @@
private void loadInternal(Map<Integer, List<PackageInfo>> existingPackages) {
Map<String, Set<Integer>> packageToUsersMap = new HashMap<>();
+ Map<String, Set<String>> packageToCodePaths = new HashMap<>();
+
// Cache the code locations for the installed packages. This allows for
// faster lookups (no locks) when finding what package owns the dex file.
for (Map.Entry<Integer, List<PackageInfo>> entry : existingPackages.entrySet()) {
@@ -306,25 +323,53 @@
// Cache the code locations.
cachePackageInfo(pi, userId);
- // Cache a map from package name to the set of user ids who installed the package.
+ // Cache two maps:
+ // - from package name to the set of user ids who installed the package.
+ // - from package name to the set of code paths.
// We will use it to sync the data and remove obsolete entries from
// mPackageDexUsage.
Set<Integer> users = putIfAbsent(
packageToUsersMap, pi.packageName, new HashSet<>());
users.add(userId);
+
+ Set<String> codePaths = putIfAbsent(
+ packageToCodePaths, pi.packageName, new HashSet<>());
+ codePaths.add(pi.applicationInfo.sourceDir);
+ if (pi.applicationInfo.splitSourceDirs != null) {
+ Collections.addAll(codePaths, pi.applicationInfo.splitSourceDirs);
+ }
}
}
mPackageDexUsage.read();
- mPackageDexUsage.syncData(packageToUsersMap);
+ mPackageDexUsage.syncData(packageToUsersMap, packageToCodePaths);
}
/**
* Get the package dex usage for the given package name.
- * @return the package data or null if there is no data available for this package.
+ * If there is no usage info the method will return a default {@code PackageUseInfo} with
+ * no data about secondary dex files and marked as not being used by other apps.
+ *
+ * Note that no use info means the package was not used or it was used but not by other apps.
+ * Also, note that right now we might prune packages which are not used by other apps.
+ * TODO(calin): maybe we should not (prune) so we can have an accurate view when we try
+ * to access the package use.
*/
- public PackageUseInfo getPackageUseInfo(String packageName) {
- return mPackageDexUsage.getPackageUseInfo(packageName);
+ public PackageUseInfo getPackageUseInfoOrDefault(String packageName) {
+ PackageUseInfo useInfo = mPackageDexUsage.getPackageUseInfo(packageName);
+ return useInfo == null ? DEFAULT_USE_INFO : useInfo;
+ }
+
+ /**
+ * Return whether or not the manager has usage information on the give package.
+ *
+ * Note that no use info means the package was not used or it was used but not by other apps.
+ * Also, note that right now we might prune packages which are not used by other apps.
+ * TODO(calin): maybe we should not (prune) so we can have an accurate view when we try
+ * to access the package use.
+ */
+ /*package*/ boolean hasInfoOnPackage(String packageName) {
+ return mPackageDexUsage.getPackageUseInfo(packageName) != null;
}
/**
@@ -343,7 +388,7 @@
? new PackageDexOptimizer.ForcedUpdatePackageDexOptimizer(mPackageDexOptimizer)
: mPackageDexOptimizer;
String packageName = options.getPackageName();
- PackageUseInfo useInfo = getPackageUseInfo(packageName);
+ PackageUseInfo useInfo = getPackageUseInfoOrDefault(packageName);
if (useInfo == null || useInfo.getDexUseInfoMap().isEmpty()) {
if (DEBUG) {
Slog.d(TAG, "No secondary dex use for package:" + packageName);
@@ -387,7 +432,7 @@
* deleted, update the internal records and delete any generated oat files.
*/
public void reconcileSecondaryDexFiles(String packageName) {
- PackageUseInfo useInfo = getPackageUseInfo(packageName);
+ PackageUseInfo useInfo = getPackageUseInfoOrDefault(packageName);
if (useInfo == null || useInfo.getDexUseInfoMap().isEmpty()) {
if (DEBUG) {
Slog.d(TAG, "No secondary dex use for package:" + packageName);
@@ -519,23 +564,6 @@
}
/**
- * Return true if the profiling data collected for the given app indicate
- * that the apps's APK has been loaded by another app.
- * Note that this returns false for all apps without any collected profiling data.
- */
- public boolean isUsedByOtherApps(String packageName) {
- PackageUseInfo useInfo = getPackageUseInfo(packageName);
- if (useInfo == null) {
- // No use info, means the package was not used or it was used but not by other apps.
- // Note that right now we might prune packages which are not used by other apps.
- // TODO(calin): maybe we should not (prune) so we can have an accurate view when we try
- // to access the package use.
- return false;
- }
- return useInfo.isUsedByOtherApps();
- }
-
- /**
* Retrieves the package which owns the given dexPath.
*/
private DexSearchResult getDexPackage(
@@ -593,9 +621,9 @@
}
/**
- * Saves the in-memory package dex usage to disk right away.
+ * Writes the in-memory package dex usage to disk right away.
*/
- public void savePackageDexUsageNow() {
+ public void writePackageDexUsageNow() {
mPackageDexUsage.writeNow();
}
diff --git a/services/core/java/com/android/server/pm/dex/DexoptOptions.java b/services/core/java/com/android/server/pm/dex/DexoptOptions.java
index f57cf5e..4fa47b5 100644
--- a/services/core/java/com/android/server/pm/dex/DexoptOptions.java
+++ b/services/core/java/com/android/server/pm/dex/DexoptOptions.java
@@ -50,6 +50,12 @@
// save disk space.
public static final int DEXOPT_DOWNGRADE = 1 << 5;
+ // When set, dexopt will compile the dex file as a shared library even if it is not actually
+ // used by other apps. This is used to force the compilation or shared libraries declared
+ // with in the manifest with ''uses-library' before we have a chance to detect they are
+ // actually shared at runtime.
+ public static final int DEXOPT_AS_SHARED_LIBRARY = 1 << 6;
+
// The name of package to optimize.
private final String mPackageName;
@@ -79,7 +85,8 @@
DEXOPT_BOOT_COMPLETE |
DEXOPT_ONLY_SECONDARY_DEX |
DEXOPT_ONLY_SHARED_DEX |
- DEXOPT_DOWNGRADE;
+ DEXOPT_DOWNGRADE |
+ DEXOPT_AS_SHARED_LIBRARY;
if ((flags & (~validityMask)) != 0) {
throw new IllegalArgumentException("Invalid flags : " + Integer.toHexString(flags));
}
@@ -122,7 +129,15 @@
return (mFlags & DEXOPT_DOWNGRADE) != 0;
}
+ public boolean isDexoptAsSharedLibrary() {
+ return (mFlags & DEXOPT_AS_SHARED_LIBRARY) != 0;
+ }
+
public String getSplitName() {
return mSplitName;
}
+
+ public int getFlags() {
+ return mFlags;
+ }
}
diff --git a/services/core/java/com/android/server/pm/dex/PackageDexUsage.java b/services/core/java/com/android/server/pm/dex/PackageDexUsage.java
index 6ee26d3..a4a0a54 100644
--- a/services/core/java/com/android/server/pm/dex/PackageDexUsage.java
+++ b/services/core/java/com/android/server/pm/dex/PackageDexUsage.java
@@ -35,6 +35,7 @@
import java.io.StringWriter;
import java.io.Writer;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.HashMap;
@@ -53,17 +54,21 @@
public class PackageDexUsage extends AbstractStatsBase<Void> {
private final static String TAG = "PackageDexUsage";
- // The last version update: add class loader contexts for secondary dex files.
- private final static int PACKAGE_DEX_USAGE_VERSION = 3;
// We support previous version to ensure that the usage list remains valid cross OTAs.
private final static int PACKAGE_DEX_USAGE_SUPPORTED_VERSION_1 = 1;
- // Version 2 added the list of packages that load the dex files.
+ // Version 2 added:
+ // - the list of packages that load the dex files
+ // - class loader contexts for secondary dex files
+ // - usage for all code paths (including splits)
private final static int PACKAGE_DEX_USAGE_SUPPORTED_VERSION_2 = 2;
+ private final static int PACKAGE_DEX_USAGE_VERSION = PACKAGE_DEX_USAGE_SUPPORTED_VERSION_2;
+
private final static String PACKAGE_DEX_USAGE_VERSION_HEADER =
"PACKAGE_MANAGER__PACKAGE_DEX_USAGE__";
private final static String SPLIT_CHAR = ",";
+ private final static String CODE_PATH_LINE_CHAR = "+";
private final static String DEX_LINE_CHAR = "#";
private final static String LOADING_PACKAGE_CHAR = "@";
@@ -130,9 +135,8 @@
// If we have a primary or a split apk, set isUsedByOtherApps.
// We do not need to record the loaderIsa or the owner because we compile
// primaries for all users and all ISAs.
- packageUseInfo.mIsUsedByOtherApps = isUsedByOtherApps;
- maybeAddLoadingPackage(owningPackageName, loadingPackageName,
- packageUseInfo.mLoadingPackages);
+ packageUseInfo.mergeCodePathUsedByOtherApps(dexPath, isUsedByOtherApps,
+ owningPackageName, loadingPackageName);
} else {
// For secondary dex files record the loaderISA and the owner. We'll need
// to know under which user to compile and for what ISA.
@@ -149,9 +153,8 @@
if (primaryOrSplit) {
// We have a possible update on the primary apk usage. Merge
// isUsedByOtherApps information and return if there was an update.
- boolean updateLoadingPackages = maybeAddLoadingPackage(owningPackageName,
- loadingPackageName, packageUseInfo.mLoadingPackages);
- return packageUseInfo.merge(isUsedByOtherApps) || updateLoadingPackages;
+ return packageUseInfo.mergeCodePathUsedByOtherApps(
+ dexPath, isUsedByOtherApps, owningPackageName, loadingPackageName);
} else {
DexUseInfo newData = new DexUseInfo(
isUsedByOtherApps, ownerUserId, classLoaderContext, loaderIsa);
@@ -230,22 +233,18 @@
*
* file_magic_version
* package_name_1
+ * +code_path1
* @ loading_package_1_1, loading_package_1_2...
+ * +code_path2
+ * @ loading_package_2_1, loading_package_2_2...
* #dex_file_path_1_1
- * @ loading_package_1_1_1, loading_package_1_1_2...
* user_1_1, used_by_other_app_1_1, user_isa_1_1_1, user_isa_1_1_2
+ * @ loading_package_1_1_1, loading_package_1_1_2...
+ * class_loader_context_1_1
* #dex_file_path_1_2
- * @ loading_package_1_2_1, loading_package_1_2_2...
* user_1_2, used_by_other_app_1_2, user_isa_1_2_1, user_isa_1_2_2
- * ...
- * package_name_2
- * @ loading_package_2_1, loading_package_2_1_2...
- * #dex_file_path_2_1
- * @ loading_package_2_1_1, loading_package_2_1_2...
- * user_2_1, used_by_other_app_2_1, user_isa_2_1_1, user_isa_2_1_2
- * #dex_file_path_2_2,
- * @ loading_package_2_2_1, loading_package_2_2_2...
- * user_2_2, used_by_other_app_2_2, user_isa_2_2_1, user_isa_2_2_2
+ * @ loading_package_1_2_1, loading_package_1_2_2...
+ * class_loader_context_1_2
* ...
*/
/* package */ void write(Writer out) {
@@ -262,27 +261,31 @@
// Write the package line.
String packageName = pEntry.getKey();
PackageUseInfo packageUseInfo = pEntry.getValue();
+ fpw.println(packageName);
- fpw.println(String.join(SPLIT_CHAR, packageName,
- writeBoolean(packageUseInfo.mIsUsedByOtherApps)));
- fpw.println(LOADING_PACKAGE_CHAR +
- String.join(SPLIT_CHAR, packageUseInfo.mLoadingPackages));
+ // Write the code paths used by other apps.
+ for (Map.Entry<String, Set<String>> codeEntry :
+ packageUseInfo.mCodePathsUsedByOtherApps.entrySet()) {
+ String codePath = codeEntry.getKey();
+ Set<String> loadingPackages = codeEntry.getValue();
+ fpw.println(CODE_PATH_LINE_CHAR + codePath);
+ fpw.println(LOADING_PACKAGE_CHAR + String.join(SPLIT_CHAR, loadingPackages));
+ }
// Write dex file lines.
for (Map.Entry<String, DexUseInfo> dEntry : packageUseInfo.mDexUseInfoMap.entrySet()) {
String dexPath = dEntry.getKey();
DexUseInfo dexUseInfo = dEntry.getValue();
fpw.println(DEX_LINE_CHAR + dexPath);
- fpw.println(LOADING_PACKAGE_CHAR +
- String.join(SPLIT_CHAR, dexUseInfo.mLoadingPackages));
- fpw.println(dexUseInfo.getClassLoaderContext());
-
fpw.print(String.join(SPLIT_CHAR, Integer.toString(dexUseInfo.mOwnerUserId),
- writeBoolean(dexUseInfo.mIsUsedByOtherApps)));
+ writeBoolean(dexUseInfo.mIsUsedByOtherApps)));
for (String isa : dexUseInfo.mLoaderIsas) {
fpw.print(SPLIT_CHAR + isa);
}
fpw.println();
+ fpw.println(LOADING_PACKAGE_CHAR
+ + String.join(SPLIT_CHAR, dexUseInfo.mLoadingPackages));
+ fpw.println(dexUseInfo.getClassLoaderContext());
}
}
fpw.flush();
@@ -324,7 +327,7 @@
}
}
- String s;
+ String line;
String currentPackage = null;
PackageUseInfo currentPackageData = null;
@@ -332,8 +335,8 @@
for (String abi : Build.SUPPORTED_ABIS) {
supportedIsas.add(VMRuntime.getInstructionSet(abi));
}
- while ((s = in.readLine()) != null) {
- if (s.startsWith(DEX_LINE_CHAR)) {
+ while ((line = in.readLine()) != null) {
+ if (line.startsWith(DEX_LINE_CHAR)) {
// This is the start of the the dex lines.
// We expect 4 lines for each dex entry:
// #dexPaths
@@ -345,25 +348,23 @@
"Malformed PackageDexUsage file. Expected package line before dex line.");
}
- // First line is the dex path.
- String dexPath = s.substring(DEX_LINE_CHAR.length());
+ // Line 1 is the dex path.
+ String dexPath = line.substring(DEX_LINE_CHAR.length());
- // In version 2 the second line contains the list of packages that loaded the file.
- List<String> loadingPackages = maybeReadLoadingPackages(in, version);
- // In version 3 the third line contains the class loader context.
- String classLoaderContext = maybeReadClassLoaderContext(in, version);
-
- // Next line is the dex data.
- s = in.readLine();
- if (s == null) {
+ // Line 2 is the dex data: (userId, isUsedByOtherApps, isa).
+ line = in.readLine();
+ if (line == null) {
throw new IllegalStateException("Could not find dexUseInfo line");
}
-
- // We expect at least 3 elements (isUsedByOtherApps, userId, isa).
- String[] elems = s.split(SPLIT_CHAR);
+ String[] elems = line.split(SPLIT_CHAR);
if (elems.length < 3) {
- throw new IllegalStateException("Invalid PackageDexUsage line: " + s);
+ throw new IllegalStateException("Invalid PackageDexUsage line: " + line);
}
+
+ // In version 2 we added the loading packages and class loader context.
+ Set<String> loadingPackages = maybeReadLoadingPackages(in, version);
+ String classLoaderContext = maybeReadClassLoaderContext(in, version);
+
int ownerUserId = Integer.parseInt(elems[0]);
boolean isUsedByOtherApps = readBoolean(elems[1]);
DexUseInfo dexUseInfo = new DexUseInfo(isUsedByOtherApps, ownerUserId,
@@ -386,17 +387,35 @@
continue;
}
currentPackageData.mDexUseInfoMap.put(dexPath, dexUseInfo);
+ } else if (line.startsWith(CODE_PATH_LINE_CHAR)) {
+ // This is a code path used by other apps line.
+ if (version < PACKAGE_DEX_USAGE_SUPPORTED_VERSION_2) {
+ throw new IllegalArgumentException("Unexpected code path line when parsing " +
+ "PackageDexUseData: " + line);
+ }
+
+ // Expects 2 lines:
+ // +code_paths
+ // @loading_packages
+ String codePath = line.substring(CODE_PATH_LINE_CHAR.length());
+ Set<String> loadingPackages = maybeReadLoadingPackages(in, version);
+ currentPackageData.mCodePathsUsedByOtherApps.put(codePath, loadingPackages);
} else {
// This is a package line.
- // We expect it to be: `packageName,isUsedByOtherApps`.
- String[] elems = s.split(SPLIT_CHAR);
- if (elems.length != 2) {
- throw new IllegalStateException("Invalid PackageDexUsage line: " + s);
+ if (version >= PACKAGE_DEX_USAGE_SUPPORTED_VERSION_2) {
+ currentPackage = line;
+ currentPackageData = new PackageUseInfo();
+ } else {
+ // Old version (<2)
+ // We expect it to be: `packageName,isUsedByOtherApps`.
+ String[] elems = line.split(SPLIT_CHAR);
+ if (elems.length != 2) {
+ throw new IllegalStateException("Invalid PackageDexUsage line: " + line);
+ }
+ currentPackage = elems[0];
+ currentPackageData = new PackageUseInfo();
+ currentPackageData.mUsedByOtherAppsBeforeUpgrade = readBoolean(elems[1]);
}
- currentPackage = elems[0];
- currentPackageData = new PackageUseInfo();
- currentPackageData.mIsUsedByOtherApps = readBoolean(elems[1]);
- currentPackageData.mLoadingPackages.addAll(maybeReadLoadingPackages(in, version));
data.put(currentPackage, currentPackageData);
}
}
@@ -413,7 +432,7 @@
*/
private String maybeReadClassLoaderContext(BufferedReader in, int version) throws IOException {
String context = null;
- if (version == PACKAGE_DEX_USAGE_VERSION) {
+ if (version >= PACKAGE_DEX_USAGE_SUPPORTED_VERSION_2) {
context = in.readLine();
if (context == null) {
throw new IllegalStateException("Could not find the classLoaderContext line.");
@@ -429,7 +448,7 @@
* Reads the list of loading packages from the buffer {@code in} if
* {@code version} is at least {PACKAGE_DEX_USAGE_SUPPORTED_VERSION_2}.
*/
- private List<String> maybeReadLoadingPackages(BufferedReader in, int version)
+ private Set<String> maybeReadLoadingPackages(BufferedReader in, int version)
throws IOException {
if (version >= PACKAGE_DEX_USAGE_SUPPORTED_VERSION_2) {
String line = in.readLine();
@@ -438,13 +457,15 @@
}
// We expect that most of the times the list of loading packages will be empty.
if (line.length() == LOADING_PACKAGE_CHAR.length()) {
- return Collections.emptyList();
+ return Collections.emptySet();
} else {
- return Arrays.asList(
+ Set<String> result = new HashSet<>();
+ Collections.addAll(result,
line.substring(LOADING_PACKAGE_CHAR.length()).split(SPLIT_CHAR));
+ return result;
}
} else {
- return Collections.emptyList();
+ return Collections.emptySet();
}
}
@@ -458,14 +479,15 @@
}
private boolean isSupportedVersion(int version) {
- return version == PACKAGE_DEX_USAGE_VERSION ||
- version == PACKAGE_DEX_USAGE_SUPPORTED_VERSION_1;
+ return version == PACKAGE_DEX_USAGE_SUPPORTED_VERSION_1
+ || version == PACKAGE_DEX_USAGE_SUPPORTED_VERSION_2;
}
/**
* Syncs the existing data with the set of available packages by removing obsolete entries.
*/
- public void syncData(Map<String, Set<Integer>> packageToUsersMap) {
+ /*package*/ void syncData(Map<String, Set<Integer>> packageToUsersMap,
+ Map<String, Set<String>> packageToCodePaths) {
synchronized (mPackageUseInfoMap) {
Iterator<Map.Entry<String, PackageUseInfo>> pIt =
mPackageUseInfoMap.entrySet().iterator();
@@ -489,8 +511,26 @@
dIt.remove();
}
}
- if (!packageUseInfo.mIsUsedByOtherApps
- && packageUseInfo.mDexUseInfoMap.isEmpty()) {
+
+ // Sync the code paths.
+ Set<String> codePaths = packageToCodePaths.get(packageName);
+ Iterator<Map.Entry<String, Set<String>>> codeIt =
+ packageUseInfo.mCodePathsUsedByOtherApps.entrySet().iterator();
+ while (codeIt.hasNext()) {
+ if (!codePaths.contains(codeIt.next().getKey())) {
+ codeIt.remove();
+ }
+ }
+
+ // In case the package was marked as used by other apps in a previous version
+ // propagate the flag to all the code paths.
+ // See mUsedByOtherAppsBeforeUpgrade docs on why it is important to do it.
+ if (packageUseInfo.mUsedByOtherAppsBeforeUpgrade) {
+ for (String codePath : codePaths) {
+ packageUseInfo.mergeCodePathUsedByOtherApps(codePath, true, null, null);
+ }
+ } else if (!packageUseInfo.isAnyCodePathUsedByOtherApps()
+ && packageUseInfo.mDexUseInfoMap.isEmpty()) {
// The package is not used by other apps and we removed all its dex files
// records. Remove the entire package record as well.
pIt.remove();
@@ -504,14 +544,13 @@
* Clears the {@code usesByOtherApps} marker for the package {@code packageName}.
* @return true if the package usage info was updated.
*/
- public boolean clearUsedByOtherApps(String packageName) {
+ /*package*/ boolean clearUsedByOtherApps(String packageName) {
synchronized (mPackageUseInfoMap) {
PackageUseInfo packageUseInfo = mPackageUseInfoMap.get(packageName);
- if (packageUseInfo == null || !packageUseInfo.mIsUsedByOtherApps) {
+ if (packageUseInfo == null) {
return false;
}
- packageUseInfo.mIsUsedByOtherApps = false;
- return true;
+ return packageUseInfo.clearCodePathUsedByOtherApps();
}
}
@@ -532,7 +571,7 @@
* @return true if the record was found and actually deleted,
* false if the record doesn't exist
*/
- public boolean removeUserPackage(String packageName, int userId) {
+ /*package*/ boolean removeUserPackage(String packageName, int userId) {
synchronized (mPackageUseInfoMap) {
PackageUseInfo packageUseInfo = mPackageUseInfoMap.get(packageName);
if (packageUseInfo == null) {
@@ -550,7 +589,8 @@
}
// If no secondary dex info is left and the package is not used by other apps
// remove the data since it is now useless.
- if (packageUseInfo.mDexUseInfoMap.isEmpty() && !packageUseInfo.mIsUsedByOtherApps) {
+ if (packageUseInfo.mDexUseInfoMap.isEmpty()
+ && !packageUseInfo.isAnyCodePathUsedByOtherApps()) {
mPackageUseInfoMap.remove(packageName);
updated = true;
}
@@ -564,7 +604,7 @@
* @return true if the record was found and actually deleted,
* false if the record doesn't exist
*/
- public boolean removeDexFile(String packageName, String dexFile, int userId) {
+ /*package*/ boolean removeDexFile(String packageName, String dexFile, int userId) {
synchronized (mPackageUseInfoMap) {
PackageUseInfo packageUseInfo = mPackageUseInfoMap.get(packageName);
if (packageUseInfo == null) {
@@ -586,7 +626,7 @@
return false;
}
- public PackageUseInfo getPackageUseInfo(String packageName) {
+ /*package*/ PackageUseInfo getPackageUseInfo(String packageName) {
synchronized (mPackageUseInfoMap) {
PackageUseInfo useInfo = mPackageUseInfoMap.get(packageName);
// The useInfo contains a map for secondary dex files which could be modified
@@ -601,7 +641,7 @@
/**
* Return all packages that contain records of secondary dex files.
*/
- public Set<String> getAllPackagesWithSecondaryDexFiles() {
+ /*package*/ Set<String> getAllPackagesWithSecondaryDexFiles() {
Set<String> packages = new HashSet<>();
synchronized (mPackageUseInfoMap) {
for (Map.Entry<String, PackageUseInfo> entry : mPackageUseInfoMap.entrySet()) {
@@ -639,15 +679,6 @@
throw new IllegalArgumentException("Unknown bool encoding: " + bool);
}
- private boolean contains(int[] array, int elem) {
- for (int i = 0; i < array.length; i++) {
- if (elem == array[i]) {
- return true;
- }
- }
- return false;
- }
-
public String dump() {
StringWriter sw = new StringWriter();
write(sw);
@@ -658,46 +689,94 @@
* Stores data on how a package and its dex files are used.
*/
public static class PackageUseInfo {
- // This flag is for the primary and split apks. It is set to true whenever one of them
- // is loaded by another app.
- private boolean mIsUsedByOtherApps;
+ // The app's code paths that are used by other apps.
+ // The key is the code path and the value is the set of loading packages.
+ private final Map<String, Set<String>> mCodePathsUsedByOtherApps;
// Map dex paths to their data (isUsedByOtherApps, owner id, loader isa).
private final Map<String, DexUseInfo> mDexUseInfoMap;
- // Packages who load this dex file.
- private final Set<String> mLoadingPackages;
+
+ // Keeps track of whether or not this package was used by other apps before
+ // we upgraded to VERSION 4 which records the info for each code path separately.
+ // This is unwanted complexity but without it we risk to profile guide compile
+ // something that supposed to be shared. For example:
+ // 1) we determine that chrome is used by another app
+ // 2) we take an OTA which upgrades the way we keep track of usage data
+ // 3) chrome doesn't get used until the background job executes
+ // 4) as part of the backgound job we now think that chrome is not used by others
+ // and we speed-profile.
+ // 5) as a result the next time someone uses chrome it will extract from apk since
+ // the compiled code will be private.
+ private boolean mUsedByOtherAppsBeforeUpgrade;
public PackageUseInfo() {
- mIsUsedByOtherApps = false;
+ mCodePathsUsedByOtherApps = new HashMap<>();
mDexUseInfoMap = new HashMap<>();
- mLoadingPackages = new HashSet<>();
}
// Creates a deep copy of the `other`.
public PackageUseInfo(PackageUseInfo other) {
- mIsUsedByOtherApps = other.mIsUsedByOtherApps;
+ mCodePathsUsedByOtherApps = new HashMap<>();
+ for (Map.Entry<String, Set<String>> e : other.mCodePathsUsedByOtherApps.entrySet()) {
+ mCodePathsUsedByOtherApps.put(e.getKey(), new HashSet<>(e.getValue()));
+ }
+
mDexUseInfoMap = new HashMap<>();
for (Map.Entry<String, DexUseInfo> e : other.mDexUseInfoMap.entrySet()) {
mDexUseInfoMap.put(e.getKey(), new DexUseInfo(e.getValue()));
}
- mLoadingPackages = new HashSet<>(other.mLoadingPackages);
}
- private boolean merge(boolean isUsedByOtherApps) {
- boolean oldIsUsedByOtherApps = mIsUsedByOtherApps;
- mIsUsedByOtherApps = mIsUsedByOtherApps || isUsedByOtherApps;
- return oldIsUsedByOtherApps != this.mIsUsedByOtherApps;
+ private boolean mergeCodePathUsedByOtherApps(String codePath, boolean isUsedByOtherApps,
+ String owningPackageName, String loadingPackage) {
+ if (!isUsedByOtherApps) {
+ // Nothing to update if the the code path is not used by other apps.
+ return false;
+ }
+
+ boolean newCodePath = false;
+ Set<String> loadingPackages = mCodePathsUsedByOtherApps.get(codePath);
+ if (loadingPackages == null) {
+ loadingPackages = new HashSet<>();
+ mCodePathsUsedByOtherApps.put(codePath, loadingPackages);
+ newCodePath = true;
+ }
+ boolean newLoadingPackage = loadingPackage != null
+ && !loadingPackage.equals(owningPackageName)
+ && loadingPackages.add(loadingPackage);
+ return newCodePath || newLoadingPackage;
}
- public boolean isUsedByOtherApps() {
- return mIsUsedByOtherApps;
+ public boolean isUsedByOtherApps(String codePath) {
+ return mCodePathsUsedByOtherApps.containsKey(codePath);
}
public Map<String, DexUseInfo> getDexUseInfoMap() {
return mDexUseInfoMap;
}
- public Set<String> getLoadingPackages() {
- return mLoadingPackages;
+ public Set<String> getLoadingPackages(String codePath) {
+ return mCodePathsUsedByOtherApps.getOrDefault(codePath, null);
+ }
+
+ public boolean isAnyCodePathUsedByOtherApps() {
+ return !mCodePathsUsedByOtherApps.isEmpty();
+ }
+
+ /**
+ * Clears the usedByOtherApps markers from all code paths.
+ * Returns whether or not there was an update.
+ */
+ /*package*/ boolean clearCodePathUsedByOtherApps() {
+ // Update mUsedByOtherAppsBeforeUpgrade as well to be consistent with
+ // the new data. This is not saved to disk so we don't need to return it.
+ mUsedByOtherAppsBeforeUpgrade = true;
+
+ if (mCodePathsUsedByOtherApps.isEmpty()) {
+ return false;
+ } else {
+ mCodePathsUsedByOtherApps.clear();
+ return true;
+ }
}
}
diff --git a/services/core/java/com/android/server/power/ShutdownThread.java b/services/core/java/com/android/server/power/ShutdownThread.java
index 92f1c83..d0ca57a 100644
--- a/services/core/java/com/android/server/power/ShutdownThread.java
+++ b/services/core/java/com/android/server/power/ShutdownThread.java
@@ -58,7 +58,9 @@
import com.android.internal.telephony.ITelephony;
import com.android.server.RescueParty;
+import com.android.server.LocalServices;
import com.android.server.pm.PackageManagerService;
+import com.android.server.statusbar.StatusBarManagerInternal;
import java.io.File;
import java.io.IOException;
@@ -289,6 +291,9 @@
pd.setMessage(context.getText(
com.android.internal.R.string.reboot_to_update_prepare));
} else {
+ if (showSysuiReboot()) {
+ return null;
+ }
pd.setIndeterminate(true);
pd.setMessage(context.getText(
com.android.internal.R.string.reboot_to_update_reboot));
@@ -308,37 +313,10 @@
com.android.internal.R.string.reboot_to_reset_message));
pd.setIndeterminate(true);
}
- } else if (mReason != null && mReason.equals(PowerManager.SHUTDOWN_USER_REQUESTED)) {
- Dialog d = new Dialog(context);
- d.setContentView(com.android.internal.R.layout.shutdown_dialog);
- d.setCancelable(false);
-
- int color;
- try {
- boolean onKeyguard = context.getSystemService(
- KeyguardManager.class).isKeyguardLocked();
- WallpaperColors currentColors = context.getSystemService(WallpaperManager.class)
- .getWallpaperColors(onKeyguard ?
- WallpaperManager.FLAG_LOCK : WallpaperManager.FLAG_SYSTEM);
- color = currentColors != null &&
- (currentColors.getColorHints() & WallpaperColors.HINT_SUPPORTS_DARK_TEXT)
- != 0 ?
- Color.BLACK : Color.WHITE;
- } catch (Exception e) {
- color = Color.WHITE;
- }
-
- ProgressBar bar = d.findViewById(com.android.internal.R.id.progress);
- bar.getIndeterminateDrawable().setTint(color);
- ((TextView) d.findViewById(com.android.internal.R.id.text1)).setTextColor(color);
- d.getWindow().getAttributes().width = ViewGroup.LayoutParams.MATCH_PARENT;
- d.getWindow().getAttributes().height = ViewGroup.LayoutParams.MATCH_PARENT;
- d.getWindow().setType(WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY);
- d.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
- d.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
- d.show();
- return null;
} else {
+ if (showSysuiReboot()) {
+ return null;
+ }
pd.setTitle(context.getText(com.android.internal.R.string.power_off));
pd.setMessage(context.getText(com.android.internal.R.string.shutdown_progress));
pd.setIndeterminate(true);
@@ -350,6 +328,23 @@
return pd;
}
+ private static boolean showSysuiReboot() {
+ Log.d(TAG, "Attempting to use SysUI shutdown UI");
+ try {
+ StatusBarManagerInternal service = LocalServices.getService(
+ StatusBarManagerInternal.class);
+ if (service.showShutdownUi(mReboot, mReason)) {
+ // Sysui will handle shutdown UI.
+ Log.d(TAG, "SysUI handling shutdown UI");
+ return true;
+ }
+ } catch (Exception e) {
+ // If anything went wrong, ignore it and use fallback ui
+ }
+ Log.d(TAG, "SysUI is unavailable");
+ return false;
+ }
+
private static void beginShutdownSequence(Context context) {
synchronized (sIsStartedGuard) {
if (sIsStarted) {
@@ -571,7 +566,7 @@
Thread t = new Thread() {
public void run() {
boolean nfcOff;
- boolean bluetoothOff;
+ boolean bluetoothReadyForShutdown;
boolean radioOff;
final INfcAdapter nfc =
@@ -595,15 +590,15 @@
}
try {
- bluetoothOff = bluetooth == null ||
+ bluetoothReadyForShutdown = bluetooth == null ||
bluetooth.getState() == BluetoothAdapter.STATE_OFF;
- if (!bluetoothOff) {
+ if (!bluetoothReadyForShutdown) {
Log.w(TAG, "Disabling Bluetooth...");
bluetooth.disable(mContext.getPackageName(), false); // disable but don't persist new state
}
} catch (RemoteException ex) {
Log.e(TAG, "RemoteException during bluetooth shutdown", ex);
- bluetoothOff = true;
+ bluetoothReadyForShutdown = true;
}
try {
@@ -628,14 +623,19 @@
sInstance.setRebootProgress(status, null);
}
- if (!bluetoothOff) {
+ if (!bluetoothReadyForShutdown) {
try {
- bluetoothOff = bluetooth.getState() == BluetoothAdapter.STATE_OFF;
+ // BLE only mode can happen when BT is turned off
+ // We will continue shutting down in such case
+ bluetoothReadyForShutdown =
+ bluetooth.getState() == BluetoothAdapter.STATE_OFF ||
+ bluetooth.getState() == BluetoothAdapter.STATE_BLE_TURNING_OFF ||
+ bluetooth.getState() == BluetoothAdapter.STATE_BLE_ON;
} catch (RemoteException ex) {
Log.e(TAG, "RemoteException during bluetooth shutdown", ex);
- bluetoothOff = true;
+ bluetoothReadyForShutdown = true;
}
- if (bluetoothOff) {
+ if (bluetoothReadyForShutdown) {
Log.i(TAG, "Bluetooth turned off.");
}
}
@@ -662,7 +662,7 @@
}
}
- if (radioOff && bluetoothOff && nfcOff) {
+ if (radioOff && bluetoothReadyForShutdown && nfcOff) {
Log.i(TAG, "NFC, Radio and Bluetooth shutdown complete.");
done[0] = true;
break;
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java b/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java
index 5e322da..866fdad 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java
@@ -80,6 +80,8 @@
void setGlobalActionsListener(GlobalActionsListener listener);
void showGlobalActions();
+ boolean showShutdownUi(boolean isReboot, String requestString);
+
public interface GlobalActionsListener {
/**
* Called when sysui starts and connects its status bar, or when the status bar binder
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
index ae04b83..d31c230 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
@@ -36,6 +36,7 @@
import android.util.ArrayMap;
import android.util.Slog;
+import com.android.internal.R;
import com.android.internal.statusbar.IStatusBar;
import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.statusbar.NotificationVisibility;
@@ -329,6 +330,20 @@
} catch (RemoteException ex) {}
}
}
+
+ @Override
+ public boolean showShutdownUi(boolean isReboot, String reason) {
+ if (!mContext.getResources().getBoolean(R.bool.config_showSysuiShutdown)) {
+ return false;
+ }
+ if (mBar != null) {
+ try {
+ mBar.showShutdownUi(isReboot, reason);
+ return true;
+ } catch (RemoteException ex) {}
+ }
+ return false;
+ }
};
// ================================================================================
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
index 46097ed..2fad7b1 100644
--- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
+++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
@@ -115,6 +115,7 @@
import java.io.InputStream;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
@@ -376,40 +377,39 @@
private void notifyColorListeners(@NonNull WallpaperColors wallpaperColors, int which,
int userId) {
final IWallpaperManagerCallback keyguardListener;
- final RemoteCallbackList<IWallpaperManagerCallback> currentUserColorListeners;
- final RemoteCallbackList<IWallpaperManagerCallback> userAllColorListeners;
+ final ArrayList<IWallpaperManagerCallback> colorListeners = new ArrayList<>();
synchronized (mLock) {
- currentUserColorListeners = mColorsChangedListeners.get(userId);
- userAllColorListeners = mColorsChangedListeners.get(UserHandle.USER_ALL);
+ final RemoteCallbackList<IWallpaperManagerCallback> currentUserColorListeners =
+ mColorsChangedListeners.get(userId);
+ final RemoteCallbackList<IWallpaperManagerCallback> userAllColorListeners =
+ mColorsChangedListeners.get(UserHandle.USER_ALL);
keyguardListener = mKeyguardListener;
+
+ if (currentUserColorListeners != null) {
+ final int count = currentUserColorListeners.beginBroadcast();
+ for (int i = 0; i < count; i++) {
+ colorListeners.add(currentUserColorListeners.getBroadcastItem(i));
+ }
+ currentUserColorListeners.finishBroadcast();
+ }
+
+ if (userAllColorListeners != null) {
+ final int count = userAllColorListeners.beginBroadcast();
+ for (int i = 0; i < count; i++) {
+ colorListeners.add(userAllColorListeners.getBroadcastItem(i));
+ }
+ userAllColorListeners.finishBroadcast();
+ }
}
- if (currentUserColorListeners != null) {
- int count = currentUserColorListeners.beginBroadcast();
- for (int i = 0; i < count; i++) {
- try {
- currentUserColorListeners.getBroadcastItem(i)
- .onWallpaperColorsChanged(wallpaperColors, which, userId);
- } catch (RemoteException e) {
- // Callback is gone, it's not necessary to unregister it since
- // RemoteCallbackList#getBroadcastItem will take care of it.
- }
+ final int count = colorListeners.size();
+ for (int i = 0; i < count; i++) {
+ try {
+ colorListeners.get(i).onWallpaperColorsChanged(wallpaperColors, which, userId);
+ } catch (RemoteException e) {
+ // Callback is gone, it's not necessary to unregister it since
+ // RemoteCallbackList#getBroadcastItem will take care of it.
}
- currentUserColorListeners.finishBroadcast();
- }
-
- if (userAllColorListeners != null) {
- int count = userAllColorListeners.beginBroadcast();
- for (int i = 0; i < count; i++) {
- try {
- userAllColorListeners.getBroadcastItem(i)
- .onWallpaperColorsChanged(wallpaperColors, which, userId);
- } catch (RemoteException e) {
- // Callback is gone, it's not necessary to unregister it since
- // RemoteCallbackList#getBroadcastItem will take care of it.
- }
- }
- userAllColorListeners.finishBroadcast();
}
if (keyguardListener != null) {
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 4d77d40..5bc4a6b 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -2681,7 +2681,7 @@
if (!w.getOrientationChanging()) {
return;
}
- w.setOrientationChanging(false);
+ w.orientationChangeTimedOut();
w.mLastFreezeDuration = (int)(SystemClock.elapsedRealtime()
- mService.mDisplayFreezeTime);
Slog.w(TAG_WM, "Force clearing orientation change: " + w);
diff --git a/services/core/java/com/android/server/wm/RemoteSurfaceTrace.java b/services/core/java/com/android/server/wm/RemoteSurfaceTrace.java
index 0508fdf..a12c2c4 100644
--- a/services/core/java/com/android/server/wm/RemoteSurfaceTrace.java
+++ b/services/core/java/com/android/server/wm/RemoteSurfaceTrace.java
@@ -32,7 +32,7 @@
// the surface control.
//
// See cts/hostsidetests/../../SurfaceTraceReceiver.java for parsing side.
-class RemoteSurfaceTrace extends SurfaceControl {
+class RemoteSurfaceTrace extends SurfaceControlWithBackground {
static final String TAG = "RemoteSurfaceTrace";
final FileDescriptor mWriteFd;
@@ -41,7 +41,8 @@
final WindowManagerService mService;
final WindowState mWindow;
- RemoteSurfaceTrace(FileDescriptor fd, SurfaceControl wrapped, WindowState window) {
+ RemoteSurfaceTrace(FileDescriptor fd, SurfaceControlWithBackground wrapped,
+ WindowState window) {
super(wrapped);
mWriteFd = fd;
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index 40528d0..7bcad9f 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -52,6 +52,7 @@
import static android.app.AppOpsManager.MODE_DEFAULT;
import static android.app.AppOpsManager.OP_NONE;
import static android.view.Display.DEFAULT_DISPLAY;
+import static android.view.Display.INVALID_DISPLAY;
import static android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_SUSTAINED_PERFORMANCE_MODE;
@@ -760,16 +761,21 @@
if (mUpdateRotation) {
if (DEBUG_ORIENTATION) Slog.d(TAG, "Performing post-rotate rotation");
-
- for (int displayNdx = 0; displayNdx < numDisplays; ++displayNdx) {
- final DisplayContent displayContent = mChildren.get(displayNdx);
- final int displayId = displayContent.getDisplayId();
- if (displayContent.updateRotationUnchecked(false /* inTransaction */)) {
- mService.mH.obtainMessage(SEND_NEW_CONFIGURATION, displayId).sendToTarget();
- } else if (displayId == DEFAULT_DISPLAY) {
- // TODO(multi-display): Track rotation updates for different displays separately
- mUpdateRotation = false;
- }
+ // TODO(multi-display): Update rotation for different displays separately.
+ final int displayId = defaultDisplay.getDisplayId();
+ if (defaultDisplay.updateRotationUnchecked(false /* inTransaction */)) {
+ mService.mH.obtainMessage(SEND_NEW_CONFIGURATION, displayId).sendToTarget();
+ } else {
+ mUpdateRotation = false;
+ }
+ // Update rotation of VR virtual display separately. Currently this is the only kind of
+ // secondary display that can be rotated because of the single-display limitations in
+ // PhoneWindowManager.
+ final DisplayContent vrDisplay = mService.mVr2dDisplayId != INVALID_DISPLAY
+ ? getDisplayContent(mService.mVr2dDisplayId) : null;
+ if (vrDisplay != null && vrDisplay.updateRotationUnchecked(false /* inTransaction */)) {
+ mService.mH.obtainMessage(SEND_NEW_CONFIGURATION, mService.mVr2dDisplayId)
+ .sendToTarget();
}
}
diff --git a/services/core/java/com/android/server/wm/SurfaceControlWithBackground.java b/services/core/java/com/android/server/wm/SurfaceControlWithBackground.java
new file mode 100644
index 0000000..85ea3c0
--- /dev/null
+++ b/services/core/java/com/android/server/wm/SurfaceControlWithBackground.java
@@ -0,0 +1,311 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.server.wm;
+
+import android.graphics.PixelFormat;
+import android.graphics.Rect;
+import android.graphics.Region;
+import android.os.IBinder;
+import android.os.Parcel;
+import android.view.Surface;
+import android.view.Surface.OutOfResourcesException;
+import android.view.SurfaceControl;
+import android.view.SurfaceSession;
+
+/**
+ * SurfaceControl extension that has background sized to match its container.
+ */
+class SurfaceControlWithBackground extends SurfaceControl {
+ // SurfaceControl that holds the background behind opaque letterboxed app windows.
+ private SurfaceControl mBackgroundControl;
+
+ // Flags that define whether the background should be shown.
+ private boolean mOpaque;
+ private boolean mVisible;
+
+ // Way to communicate with corresponding window.
+ private WindowSurfaceController mWindowSurfaceController;
+
+ // Rect to hold task bounds when computing metrics for background.
+ private Rect mTmpContainerRect = new Rect();
+
+ // Last metrics applied to the main SurfaceControl.
+ private float mLastWidth, mLastHeight;
+ private float mLastDsDx = 1, mLastDsDy = 1;
+ private float mLastX, mLastY;
+
+ public SurfaceControlWithBackground(SurfaceControlWithBackground other) {
+ super(other);
+ mBackgroundControl = other.mBackgroundControl;
+ mOpaque = other.mOpaque;
+ mVisible = other.mVisible;
+ mWindowSurfaceController = other.mWindowSurfaceController;
+ }
+
+ public SurfaceControlWithBackground(SurfaceSession s, String name, int w, int h, int format,
+ int flags, int windowType, int ownerUid,
+ WindowSurfaceController windowSurfaceController) throws OutOfResourcesException {
+ super(s, name, w, h, format, flags, windowType, ownerUid);
+
+ // We should only show background when the window is letterboxed in a task.
+ if (!windowSurfaceController.mAnimator.mWin.isLetterboxedAppWindow()) {
+ return;
+ }
+ mWindowSurfaceController = windowSurfaceController;
+ mLastWidth = w;
+ mLastHeight = h;
+ mOpaque = (flags & SurfaceControl.OPAQUE) != 0;
+ mWindowSurfaceController.getContainerRect(mTmpContainerRect);
+ mBackgroundControl = new SurfaceControl(s, "Background for - " + name,
+ mTmpContainerRect.width(), mTmpContainerRect.height(), PixelFormat.OPAQUE,
+ flags | SurfaceControl.FX_SURFACE_DIM);
+ }
+
+ @Override
+ public void setAlpha(float alpha) {
+ super.setAlpha(alpha);
+
+ if (mBackgroundControl == null) {
+ return;
+ }
+ mBackgroundControl.setAlpha(alpha);
+ }
+
+ @Override
+ public void setLayer(int zorder) {
+ super.setLayer(zorder);
+
+ if (mBackgroundControl == null) {
+ return;
+ }
+ // TODO: Use setRelativeLayer(Integer.MIN_VALUE) when it's fixed.
+ mBackgroundControl.setLayer(zorder - 1);
+ }
+
+ @Override
+ public void setPosition(float x, float y) {
+ super.setPosition(x, y);
+
+ if (mBackgroundControl == null) {
+ return;
+ }
+ mLastX = x;
+ mLastY = y;
+ updateBgPosition();
+ }
+
+ private void updateBgPosition() {
+ mWindowSurfaceController.getContainerRect(mTmpContainerRect);
+ final Rect winFrame = mWindowSurfaceController.mAnimator.mWin.mFrame;
+ final float offsetX = (mTmpContainerRect.left - winFrame.left) * mLastDsDx;
+ final float offsetY = (mTmpContainerRect.top - winFrame.top) * mLastDsDy;
+ mBackgroundControl.setPosition(mLastX + offsetX, mLastY + offsetY);
+ }
+
+ @Override
+ public void setSize(int w, int h) {
+ super.setSize(w, h);
+
+ if (mBackgroundControl == null) {
+ return;
+ }
+ mLastWidth = w;
+ mLastHeight = h;
+ mWindowSurfaceController.getContainerRect(mTmpContainerRect);
+ mBackgroundControl.setSize(mTmpContainerRect.width(), mTmpContainerRect.height());
+ }
+
+ @Override
+ public void setWindowCrop(Rect crop) {
+ super.setWindowCrop(crop);
+
+ if (mBackgroundControl == null) {
+ return;
+ }
+ if (crop.width() < mLastWidth || crop.height() < mLastHeight) {
+ // We're animating and cropping window, compute the appropriate crop for background.
+ calculateBgCrop(crop);
+ mBackgroundControl.setWindowCrop(mTmpContainerRect);
+ } else {
+ // When not animating just set crop to container rect.
+ mWindowSurfaceController.getContainerRect(mTmpContainerRect);
+ mBackgroundControl.setWindowCrop(mTmpContainerRect);
+ }
+ }
+
+ @Override
+ public void setFinalCrop(Rect crop) {
+ super.setFinalCrop(crop);
+
+ if (mBackgroundControl == null) {
+ return;
+ }
+ if (crop.width() < mLastWidth || crop.height() < mLastHeight) {
+ // We're animating and cropping window, compute the appropriate crop for background.
+ calculateBgCrop(crop);
+ mBackgroundControl.setFinalCrop(mTmpContainerRect);
+ } else {
+ // When not animating just set crop to container rect.
+ mWindowSurfaceController.getContainerRect(mTmpContainerRect);
+ mBackgroundControl.setFinalCrop(mTmpContainerRect);
+ }
+ }
+
+ /** Compute background crop based on current animation progress for main surface control. */
+ private void calculateBgCrop(Rect crop) {
+ // Track overall progress of animation by computing cropped portion of status bar.
+ final Rect contentInsets = mWindowSurfaceController.mAnimator.mWin.mContentInsets;
+ float d = contentInsets.top == 0 ? 0 : (float) crop.top / contentInsets.top;
+
+ // Compute additional offset for the background when app window is positioned not at (0,0).
+ // E.g. landscape with navigation bar on the left.
+ final Rect winFrame = mWindowSurfaceController.mAnimator.mWin.mFrame;
+ final int offsetX = (int) (winFrame.left * mLastDsDx * d + 0.5);
+ final int offsetY = (int) (winFrame.top * mLastDsDy * d + 0.5);
+
+ // Compute new scaled width and height for background that will depend on current animation
+ // progress. Those consist of current crop rect for the main surface + scaled areas outside
+ // of letterboxed area.
+ // TODO: Because the progress is computed with low precision we're getting smaller values
+ // for background width/height then screen size at the end of the animation. Will round when
+ // the value is smaller then some empiric epsilon. However, this should be fixed by
+ // computing correct frames for letterboxed windows in WindowState.
+ d = d < 0.02f ? 0 : d;
+ mWindowSurfaceController.getContainerRect(mTmpContainerRect);
+ final int backgroundWidth =
+ (int) (crop.width() + (mTmpContainerRect.width() - mLastWidth) * (1 - d) + 0.5);
+ final int backgroundHeight =
+ (int) (crop.height() + (mTmpContainerRect.height() - mLastHeight) * (1 - d) + 0.5);
+
+ mTmpContainerRect.set(crop);
+ // Make sure that part of background to left/top is visible and scaled.
+ mTmpContainerRect.offset(offsetX, offsetY);
+ // Set correct width/height, so that area to right/bottom is cropped properly.
+ mTmpContainerRect.right = mTmpContainerRect.left + backgroundWidth;
+ mTmpContainerRect.bottom = mTmpContainerRect.top + backgroundHeight;
+ }
+
+ @Override
+ public void setLayerStack(int layerStack) {
+ super.setLayerStack(layerStack);
+
+ if (mBackgroundControl == null) {
+ return;
+ }
+ mBackgroundControl.setLayerStack(layerStack);
+ }
+
+ @Override
+ public void setOpaque(boolean isOpaque) {
+ super.setOpaque(isOpaque);
+ mOpaque = isOpaque;
+ updateBackgroundVisibility();
+ }
+
+ @Override
+ public void setSecure(boolean isSecure) {
+ super.setSecure(isSecure);
+ }
+
+ @Override
+ public void setMatrix(float dsdx, float dtdx, float dtdy, float dsdy) {
+ super.setMatrix(dsdx, dtdx, dtdy, dsdy);
+
+ if (mBackgroundControl == null) {
+ return;
+ }
+ mBackgroundControl.setMatrix(dsdx, dtdx, dtdy, dsdy);
+ mLastDsDx = dsdx;
+ mLastDsDy = dsdy;
+ updateBgPosition();
+ }
+
+ @Override
+ public void hide() {
+ super.hide();
+ mVisible = false;
+ updateBackgroundVisibility();
+ }
+
+ @Override
+ public void show() {
+ super.show();
+ mVisible = true;
+ updateBackgroundVisibility();
+ }
+
+ @Override
+ public void destroy() {
+ super.destroy();
+
+ if (mBackgroundControl == null) {
+ return;
+ }
+ mBackgroundControl.destroy();
+ }
+
+ @Override
+ public void release() {
+ super.release();
+
+ if (mBackgroundControl == null) {
+ return;
+ }
+ mBackgroundControl.release();
+ }
+
+ @Override
+ public void setTransparentRegionHint(Region region) {
+ super.setTransparentRegionHint(region);
+
+ if (mBackgroundControl == null) {
+ return;
+ }
+ mBackgroundControl.setTransparentRegionHint(region);
+ }
+
+ @Override
+ public void deferTransactionUntil(IBinder handle, long frame) {
+ super.deferTransactionUntil(handle, frame);
+
+ if (mBackgroundControl == null) {
+ return;
+ }
+ mBackgroundControl.deferTransactionUntil(handle, frame);
+ }
+
+ @Override
+ public void deferTransactionUntil(Surface barrier, long frame) {
+ super.deferTransactionUntil(barrier, frame);
+
+ if (mBackgroundControl == null) {
+ return;
+ }
+ mBackgroundControl.deferTransactionUntil(barrier, frame);
+ }
+
+ private void updateBackgroundVisibility() {
+ if (mBackgroundControl == null) {
+ return;
+ }
+ if (mOpaque && mVisible) {
+ mBackgroundControl.show();
+ } else {
+ mBackgroundControl.hide();
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/wm/WindowAnimator.java b/services/core/java/com/android/server/wm/WindowAnimator.java
index fe5b7f2..079ae40 100644
--- a/services/core/java/com/android/server/wm/WindowAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowAnimator.java
@@ -33,7 +33,6 @@
import android.view.SurfaceControl;
import android.view.WindowManagerPolicy;
-import com.android.internal.view.SurfaceFlingerVsyncChoreographer;
import com.android.server.AnimationThread;
import java.io.PrintWriter;
@@ -134,26 +133,38 @@
* sure other threads can make progress if this happens.
*/
private void animate(long frameTimeNs) {
- boolean transactionOpen = false;
- try {
- synchronized (mService.mWindowMap) {
- if (!mInitialized) {
- return;
- }
- mCurrentTime = frameTimeNs / TimeUtils.NANOS_PER_MS;
- mBulkUpdateParams = SET_ORIENTATION_CHANGE_COMPLETE;
- mAnimating = false;
- mAppWindowAnimating = false;
- if (DEBUG_WINDOW_TRACE) {
- Slog.i(TAG, "!!! animate: entry time=" + mCurrentTime);
- }
+ synchronized (mService.mWindowMap) {
+ if (!mInitialized) {
+ return;
+ }
- if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION animate");
- mService.openSurfaceTransaction();
- transactionOpen = true;
- SurfaceControl.setAnimationTransaction();
+ // Schedule next frame already such that back-pressure happens continuously
+ scheduleAnimation();
+ }
+ // Simulate back-pressure by opening and closing an empty animation transaction. This makes
+ // sure that an animation frame is at least presented once on the screen. We do this outside
+ // of the regular transaction such that we can avoid holding the window manager lock in case
+ // we receive back-pressure from SurfaceFlinger. Since closing an animation transaction
+ // without the window manager locks leads to ordering issues (as the transaction will be
+ // processed only at the beginning of the next frame which may result in another transaction
+ // that was executed later in WM side gets executed first on SF side), we don't update any
+ // Surface properties here such that reordering doesn't cause issues.
+ mService.executeEmptyAnimationTransaction();
+
+ synchronized (mService.mWindowMap) {
+ mCurrentTime = frameTimeNs / TimeUtils.NANOS_PER_MS;
+ mBulkUpdateParams = SET_ORIENTATION_CHANGE_COMPLETE;
+ mAnimating = false;
+ mAppWindowAnimating = false;
+ if (DEBUG_WINDOW_TRACE) {
+ Slog.i(TAG, "!!! animate: entry time=" + mCurrentTime);
+ }
+
+ if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION animate");
+ mService.openSurfaceTransaction();
+ try {
final AccessibilityController accessibilityController =
mService.mAccessibilityController;
final int numDisplays = mDisplayContentsAnimators.size();
@@ -216,27 +227,20 @@
mAnimating |= mService.mDragState.stepAnimationLocked(mCurrentTime);
}
- if (mAnimating) {
- mService.scheduleAnimationLocked();
+ if (!mAnimating) {
+ cancelAnimation();
}
if (mService.mWatermark != null) {
mService.mWatermark.drawIfNeeded();
}
- }
- } catch (RuntimeException e) {
- Slog.wtf(TAG, "Unhandled exception in Window Manager", e);
- } finally {
- if (transactionOpen) {
-
- // Do not hold window manager lock while closing the transaction, as this might be
- // blocking until the next frame, which can lead to total lock starvation.
- mService.closeSurfaceTransaction(false /* withLockHeld */);
+ } catch (RuntimeException e) {
+ Slog.wtf(TAG, "Unhandled exception in Window Manager", e);
+ } finally {
+ mService.closeSurfaceTransaction();
if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION animate");
}
- }
- synchronized (mService.mWindowMap) {
boolean hasPendingLayoutChanges = mService.mRoot.hasPendingLayoutChanges(this);
boolean doRequest = false;
if (mBulkUpdateParams != 0) {
@@ -404,6 +408,13 @@
}
}
+ private void cancelAnimation() {
+ if (mAnimationFrameCallbackScheduled) {
+ mAnimationFrameCallbackScheduled = false;
+ mChoreographer.removeFrameCallback(mAnimationFrameCallback);
+ }
+ }
+
private class DisplayContentsAnimator {
ScreenRotationAnimation mScreenRotationAnimation = null;
}
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 83926af..5c664c2 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -911,29 +911,16 @@
}
}
- void closeSurfaceTransaction() {
- closeSurfaceTransaction(true /* withLockHeld */);
- }
-
/**
* Closes a surface transaction.
- *
- * @param withLockHeld Whether to acquire the window manager while doing so. In some cases
- * holding the lock my lead to starvation in WM in case closeTransaction
- * blocks and we call it repeatedly, like we do for animations.
*/
- void closeSurfaceTransaction(boolean withLockHeld) {
+ void closeSurfaceTransaction() {
try {
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "closeSurfaceTransaction");
synchronized (mWindowMap) {
if (mRoot.mSurfaceTraceEnabled) {
mRoot.mRemoteEventTrace.closeSurfaceTransaction();
}
- if (withLockHeld) {
- SurfaceControl.closeTransaction();
- }
- }
- if (!withLockHeld) {
SurfaceControl.closeTransaction();
}
} finally {
@@ -941,6 +928,34 @@
}
}
+ /**
+ * Executes an empty animation transaction without holding the WM lock to simulate
+ * back-pressure. See {@link WindowAnimator#animate} why this is needed.
+ */
+ void executeEmptyAnimationTransaction() {
+ try {
+ Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "openSurfaceTransaction");
+ synchronized (mWindowMap) {
+ if (mRoot.mSurfaceTraceEnabled) {
+ mRoot.mRemoteEventTrace.openSurfaceTransaction();
+ }
+ SurfaceControl.openTransaction();
+ SurfaceControl.setAnimationTransaction();
+ if (mRoot.mSurfaceTraceEnabled) {
+ mRoot.mRemoteEventTrace.closeSurfaceTransaction();
+ }
+ }
+ } finally {
+ Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
+ }
+ try {
+ Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "closeSurfaceTransaction");
+ SurfaceControl.closeTransaction();
+ } finally {
+ Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
+ }
+ }
+
/** Listener to notify activity manager about app transitions. */
final WindowManagerInternal.AppTransitionListener mActivityManagerAppTransitionNotifier
= new WindowManagerInternal.AppTransitionListener() {
@@ -3480,21 +3495,11 @@
}
if (!mBootAnimationStopped) {
- // Do this one time.
Trace.asyncTraceBegin(TRACE_TAG_WINDOW_MANAGER, "Stop bootanim", 0);
- try {
- IBinder surfaceFlinger = ServiceManager.getService("SurfaceFlinger");
- if (surfaceFlinger != null) {
- Slog.i(TAG_WM, "******* TELLING SURFACE FLINGER WE ARE BOOTED!");
- Parcel data = Parcel.obtain();
- data.writeInterfaceToken("android.ui.ISurfaceComposer");
- surfaceFlinger.transact(IBinder.FIRST_CALL_TRANSACTION, // BOOT_FINISHED
- data, null, 0);
- data.recycle();
- }
- } catch (RemoteException ex) {
- Slog.e(TAG_WM, "Boot completed: SurfaceFlinger is dead!");
- }
+ // stop boot animation
+ // formerly we would just kill the process, but we now ask it to exit so it
+ // can choose where to stop the animation.
+ SystemProperties.set("service.bootanim.exit", "1");
mBootAnimationStopped = true;
}
@@ -3503,6 +3508,20 @@
return;
}
+ try {
+ IBinder surfaceFlinger = ServiceManager.getService("SurfaceFlinger");
+ if (surfaceFlinger != null) {
+ Slog.i(TAG_WM, "******* TELLING SURFACE FLINGER WE ARE BOOTED!");
+ Parcel data = Parcel.obtain();
+ data.writeInterfaceToken("android.ui.ISurfaceComposer");
+ surfaceFlinger.transact(IBinder.FIRST_CALL_TRANSACTION, // BOOT_FINISHED
+ data, null, 0);
+ data.recycle();
+ }
+ } catch (RemoteException ex) {
+ Slog.e(TAG_WM, "Boot completed: SurfaceFlinger is dead!");
+ }
+
EventLog.writeEvent(EventLogTags.WM_BOOT_ANIMATION_DONE, SystemClock.uptimeMillis());
Trace.asyncTraceEnd(TRACE_TAG_WINDOW_MANAGER, "Stop bootanim", 0);
mDisplayEnabled = true;
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 0c217ca..f99d830 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -449,6 +449,17 @@
private boolean mOrientationChanging;
/**
+ * Sometimes in addition to the mOrientationChanging
+ * flag we report that the orientation is changing
+ * due to a mismatch in current and reported configuration.
+ *
+ * In the case of timeout we still need to make sure we
+ * leave the orientation changing state though, so we
+ * use this as a special time out escape hatch.
+ */
+ private boolean mOrientationChangeTimedOut;
+
+ /**
* The orientation during the last visible call to relayout. If our
* current orientation is different, the window can't be ready
* to be shown.
@@ -1226,11 +1237,17 @@
// better indicator consistent with the client.
return (mOrientationChanging || (isVisible()
&& getConfiguration().orientation != mLastReportedConfiguration.orientation))
- && !mSeamlesslyRotated;
+ && !mSeamlesslyRotated
+ && !mOrientationChangeTimedOut;
}
void setOrientationChanging(boolean changing) {
mOrientationChanging = changing;
+ mOrientationChangeTimedOut = false;
+ }
+
+ void orientationChangeTimedOut() {
+ mOrientationChangeTimedOut = true;
}
DisplayContent getDisplayContent() {
@@ -3244,6 +3261,15 @@
return !isInMultiWindowMode();
}
+ /** @return true when the window is in fullscreen task, but has non-fullscreen bounds set. */
+ boolean isLetterboxedAppWindow() {
+ final Task task = getTask();
+ final boolean taskIsFullscreen = task != null && task.isFullscreen();
+ final boolean appWindowIsFullscreen = mAppToken != null && !mAppToken.hasBounds();
+
+ return taskIsFullscreen && !appWindowIsFullscreen;
+ }
+
/** Returns the appropriate bounds to use for computing frames. */
private void getContainerBounds(Rect outBounds) {
if (isInMultiWindowMode()) {
diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java
index 0cc505e..86265c29 100644
--- a/services/core/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java
@@ -1200,7 +1200,8 @@
if (DEBUG_WINDOW_CROP) Slog.d(TAG, "Applying decor to crop win=" + w + " mDecorFrame="
+ w.mDecorFrame + " mSystemDecorRect=" + mSystemDecorRect);
- final boolean fullscreen = w.fillsDisplay();
+ final Task task = w.getTask();
+ final boolean fullscreen = w.fillsDisplay() || (task != null && task.isFullscreen());
final boolean isFreeformResizing =
w.isDragResizing() && w.getResizeMode() == DRAG_RESIZE_MODE_FREEFORM;
@@ -1526,6 +1527,19 @@
}
}
+ /**
+ * Get rect of the task this window is currently in. If there is no task, rect will be set to
+ * empty.
+ */
+ void getContainerRect(Rect rect) {
+ final Task task = mWin.getTask();
+ if (task != null) {
+ task.getDimBounds(rect);
+ } else {
+ rect.left = rect.top = rect.right = rect.bottom = 0;
+ }
+ }
+
void prepareSurfaceLocked(final boolean recoveringMemory) {
final WindowState w = mWin;
if (!hasSurface()) {
diff --git a/services/core/java/com/android/server/wm/WindowSurfaceController.java b/services/core/java/com/android/server/wm/WindowSurfaceController.java
index 1728cfb..110d5cb 100644
--- a/services/core/java/com/android/server/wm/WindowSurfaceController.java
+++ b/services/core/java/com/android/server/wm/WindowSurfaceController.java
@@ -50,7 +50,7 @@
final WindowStateAnimator mAnimator;
- private SurfaceControl mSurfaceControl;
+ private SurfaceControlWithBackground mSurfaceControl;
// Should only be set from within setShown().
private boolean mSurfaceShown = false;
@@ -97,15 +97,10 @@
mWindowType = windowType;
mWindowSession = win.mSession;
- if (DEBUG_SURFACE_TRACE) {
- mSurfaceControl = new SurfaceTrace(
- s, name, w, h, format, flags, windowType, ownerUid);
- } else {
- Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "new SurfaceControl");
- mSurfaceControl = new SurfaceControl(
- s, name, w, h, format, flags, windowType, ownerUid);
- Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
- }
+ Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "new SurfaceControl");
+ mSurfaceControl = new SurfaceControlWithBackground(
+ s, name, w, h, format, flags, windowType, ownerUid, this);
+ Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
if (mService.mRoot.mSurfaceTraceEnabled) {
mSurfaceControl = new RemoteSurfaceTrace(
@@ -118,7 +113,7 @@
}
void removeRemoteTrace() {
- mSurfaceControl = new SurfaceControl(mSurfaceControl);
+ mSurfaceControl = new SurfaceControlWithBackground(mSurfaceControl);
}
@@ -291,30 +286,30 @@
mSurfaceControl.setGeometryAppliesWithResize();
}
- void setMatrixInTransaction(float dsdx, float dtdx, float dsdy, float dtdy,
+ void setMatrixInTransaction(float dsdx, float dtdx, float dtdy, float dsdy,
boolean recoveringMemory) {
final boolean matrixChanged = mLastDsdx != dsdx || mLastDtdx != dtdx ||
- mLastDsdy != dsdy || mLastDtdy != dtdy;
+ mLastDtdy != dtdy || mLastDsdy != dsdy;
if (!matrixChanged) {
return;
}
mLastDsdx = dsdx;
mLastDtdx = dtdx;
- mLastDsdy = dsdy;
mLastDtdy = dtdy;
+ mLastDsdy = dsdy;
try {
if (SHOW_TRANSACTIONS) logSurface(
- "MATRIX [" + dsdx + "," + dtdx + "," + dsdy + "," + dtdy + "]", null);
+ "MATRIX [" + dsdx + "," + dtdx + "," + dtdy + "," + dsdy + "]", null);
mSurfaceControl.setMatrix(
- dsdx, dtdx, dsdy, dtdy);
+ dsdx, dtdx, dtdy, dsdy);
} catch (RuntimeException e) {
// If something goes wrong with the surface (such
// as running out of memory), don't take down the
// entire system.
Slog.e(TAG, "Error setting matrix on surface surface" + title
- + " MATRIX [" + dsdx + "," + dtdx + "," + dsdy + "," + dtdy + "]", null);
+ + " MATRIX [" + dsdx + "," + dtdx + "," + dtdy + "," + dsdy + "]", null);
if (!recoveringMemory) {
mAnimator.reclaimSomeSurfaceMemory("matrix", true);
}
@@ -421,6 +416,10 @@
}
}
+ void getContainerRect(Rect rect) {
+ mAnimator.getContainerRect(rect);
+ }
+
boolean showRobustlyInTransaction() {
if (SHOW_TRANSACTIONS) logSurface(
"SHOW (performLayout)", null);
diff --git a/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java b/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java
index 25ba66e..3cd24b8 100644
--- a/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java
+++ b/services/tests/servicestests/src/com/android/server/pm/PackageManagerSettingsTests.java
@@ -382,6 +382,7 @@
null /*installUser*/,
false /*allowInstall*/,
false /*instantApp*/,
+ false /*virtualPreload*/,
null /*parentPkgName*/,
null /*childPkgNames*/,
UserManagerService.getInstance(),
@@ -423,6 +424,7 @@
UserHandle.SYSTEM /*installUser*/,
true /*allowInstall*/,
false /*instantApp*/,
+ false /*virtualPreload*/,
null /*parentPkgName*/,
null /*childPkgNames*/,
UserManagerService.getInstance(),
@@ -467,6 +469,7 @@
null /*installUser*/,
false /*allowInstall*/,
false /*instantApp*/,
+ false /*virtualPreload*/,
null /*parentPkgName*/,
null /*childPkgNames*/,
UserManagerService.getInstance(),
@@ -511,6 +514,7 @@
null /*installUser*/,
false /*allowInstall*/,
false /*instantApp*/,
+ false /*virtualPreload*/,
null /*parentPkgName*/,
null /*childPkgNames*/,
UserManagerService.getInstance(),
diff --git a/services/tests/servicestests/src/com/android/server/pm/dex/DexManagerTests.java b/services/tests/servicestests/src/com/android/server/pm/dex/DexManagerTests.java
index e2dfb29..4db9a30 100644
--- a/services/tests/servicestests/src/com/android/server/pm/dex/DexManagerTests.java
+++ b/services/tests/servicestests/src/com/android/server/pm/dex/DexManagerTests.java
@@ -106,7 +106,7 @@
notifyDexLoad(mFooUser0, mFooUser0.getBaseAndSplitDexPaths(), mUser0);
// Package is not used by others, so we should get nothing back.
- assertNull(getPackageUseInfo(mFooUser0));
+ assertNoUseInfo(mFooUser0);
}
@Test
@@ -116,8 +116,7 @@
// Bar is used by others now and should be in our records
PackageUseInfo pui = getPackageUseInfo(mBarUser0);
- assertNotNull(pui);
- assertTrue(pui.isUsedByOtherApps());
+ assertIsUsedByOtherApps(mBarUser0, pui, true);
assertTrue(pui.getDexUseInfoMap().isEmpty());
}
@@ -128,8 +127,7 @@
notifyDexLoad(mFooUser0, fooSecondaries, mUser0);
PackageUseInfo pui = getPackageUseInfo(mFooUser0);
- assertNotNull(pui);
- assertFalse(pui.isUsedByOtherApps());
+ assertIsUsedByOtherApps(mFooUser0, pui, false);
assertEquals(fooSecondaries.size(), pui.getDexUseInfoMap().size());
assertSecondaryUse(mFooUser0, pui, fooSecondaries, /*isUsedByOtherApps*/false, mUser0);
}
@@ -141,8 +139,7 @@
notifyDexLoad(mFooUser0, barSecondaries, mUser0);
PackageUseInfo pui = getPackageUseInfo(mBarUser0);
- assertNotNull(pui);
- assertFalse(pui.isUsedByOtherApps());
+ assertIsUsedByOtherApps(mBarUser0, pui, false);
assertEquals(barSecondaries.size(), pui.getDexUseInfoMap().size());
assertSecondaryUse(mFooUser0, pui, barSecondaries, /*isUsedByOtherApps*/true, mUser0);
}
@@ -165,8 +162,7 @@
// Check bar usage. Should be used by other app (for primary and barSecondaries).
PackageUseInfo pui = getPackageUseInfo(mBarUser0);
- assertNotNull(pui);
- assertTrue(pui.isUsedByOtherApps());
+ assertIsUsedByOtherApps(mBarUser0, pui, true);
assertEquals(barSecondaries.size() + barSecondariesForOwnUse.size(),
pui.getDexUseInfoMap().size());
@@ -176,8 +172,7 @@
// Check foo usage. Should not be used by other app.
pui = getPackageUseInfo(mFooUser0);
- assertNotNull(pui);
- assertFalse(pui.isUsedByOtherApps());
+ assertIsUsedByOtherApps(mFooUser0, pui, false);
assertEquals(fooSecondaries.size(), pui.getDexUseInfoMap().size());
assertSecondaryUse(mFooUser0, pui, fooSecondaries, /*isUsedByOtherApps*/false, mUser0);
}
@@ -185,22 +180,22 @@
@Test
public void testPackageUseInfoNotFound() {
// Assert we don't get back data we did not previously record.
- assertNull(getPackageUseInfo(mFooUser0));
+ assertNoUseInfo(mFooUser0);
}
@Test
public void testInvalidIsa() {
// Notifying with an invalid ISA should be ignored.
notifyDexLoad(mInvalidIsa, mInvalidIsa.getSecondaryDexPaths(), mUser0);
- assertNull(getPackageUseInfo(mInvalidIsa));
+ assertNoUseInfo(mInvalidIsa);
}
@Test
- public void testNotExistingPackate() {
+ public void testNotExistingPackage() {
// Notifying about the load of a package which was previously not
// register in DexManager#load should be ignored.
notifyDexLoad(mDoesNotExist, mDoesNotExist.getBaseAndSplitDexPaths(), mUser0);
- assertNull(getPackageUseInfo(mDoesNotExist));
+ assertNoUseInfo(mDoesNotExist);
}
@Test
@@ -208,7 +203,7 @@
// Bar from User1 tries to load secondary dex files from User0 Bar.
// Request should be ignored.
notifyDexLoad(mBarUser1, mBarUser0.getSecondaryDexPaths(), mUser1);
- assertNull(getPackageUseInfo(mBarUser1));
+ assertNoUseInfo(mBarUser1);
}
@Test
@@ -217,7 +212,7 @@
// Note that the PackageManagerService already filters this out but we
// still check that nothing goes unexpected in DexManager.
notifyDexLoad(mBarUser0, mFooUser0.getBaseAndSplitDexPaths(), mUser1);
- assertNull(getPackageUseInfo(mBarUser1));
+ assertNoUseInfo(mBarUser1);
}
@Test
@@ -229,7 +224,7 @@
// Before we notify about the installation of the newPackage if mFoo
// is trying to load something from it we should not find it.
notifyDexLoad(mFooUser0, newSecondaries, mUser0);
- assertNull(getPackageUseInfo(newPackage));
+ assertNoUseInfo(newPackage);
// Notify about newPackage install and let mFoo load its dexes.
mDexManager.notifyPackageInstalled(newPackage.mPackageInfo, mUser0);
@@ -237,8 +232,7 @@
// We should get back the right info.
PackageUseInfo pui = getPackageUseInfo(newPackage);
- assertNotNull(pui);
- assertFalse(pui.isUsedByOtherApps());
+ assertIsUsedByOtherApps(newPackage, pui, false);
assertEquals(newSecondaries.size(), pui.getDexUseInfoMap().size());
assertSecondaryUse(newPackage, pui, newSecondaries, /*isUsedByOtherApps*/true, mUser0);
}
@@ -254,8 +248,7 @@
notifyDexLoad(newPackage, newSecondaries, mUser0);
PackageUseInfo pui = getPackageUseInfo(newPackage);
- assertNotNull(pui);
- assertFalse(pui.isUsedByOtherApps());
+ assertIsUsedByOtherApps(newPackage, pui, false);
assertEquals(newSecondaries.size(), pui.getDexUseInfoMap().size());
assertSecondaryUse(newPackage, pui, newSecondaries, /*isUsedByOtherApps*/false, mUser0);
}
@@ -267,8 +260,7 @@
// Bar is used by others now and should be in our records.
PackageUseInfo pui = getPackageUseInfo(mBarUser0);
- assertNotNull(pui);
- assertTrue(pui.isUsedByOtherApps());
+ assertIsUsedByOtherApps(mBarUser0, pui, true);
assertTrue(pui.getDexUseInfoMap().isEmpty());
// Notify that bar is updated.
@@ -278,8 +270,7 @@
// The usedByOtherApps flag should be clear now.
pui = getPackageUseInfo(mBarUser0);
- assertNotNull(pui);
- assertFalse(pui.isUsedByOtherApps());
+ assertIsUsedByOtherApps(mBarUser0, pui, false);
}
@Test
@@ -291,8 +282,7 @@
// We shouldn't find yet the new split as we didn't notify the package update.
notifyDexLoad(mFooUser0, newSplits, mUser0);
- PackageUseInfo pui = getPackageUseInfo(mBarUser0);
- assertNull(pui);
+ assertNoUseInfo(mBarUser0);
// Notify that bar is updated. splitSourceDirs will contain the updated path.
mDexManager.notifyPackageUpdated(mBarUser0.getPackageName(),
@@ -301,9 +291,9 @@
// Now, when the split is loaded we will find it and we should mark Bar as usedByOthers.
notifyDexLoad(mFooUser0, newSplits, mUser0);
- pui = getPackageUseInfo(mBarUser0);
+ PackageUseInfo pui = getPackageUseInfo(mBarUser0);
assertNotNull(pui);
- assertTrue(pui.isUsedByOtherApps());
+ assertIsUsedByOtherApps(newSplits, pui, true);
}
@Test
@@ -335,8 +325,7 @@
// Foo should still be around since it's used by other apps but with no
// secondary dex info.
PackageUseInfo pui = getPackageUseInfo(mFooUser0);
- assertNotNull(pui);
- assertTrue(pui.isUsedByOtherApps());
+ assertIsUsedByOtherApps(mFooUser0, pui, true);
assertTrue(pui.getDexUseInfoMap().isEmpty());
}
@@ -350,8 +339,7 @@
// Foo should not be around since all its secondary dex info were deleted
// and it is not used by other apps.
- PackageUseInfo pui = getPackageUseInfo(mFooUser0);
- assertNull(pui);
+ assertNoUseInfo(mFooUser0);
}
@Test
@@ -363,8 +351,7 @@
mDexManager.notifyPackageDataDestroyed(mBarUser0.getPackageName(), UserHandle.USER_ALL);
// Bar should not be around since it was removed for all users.
- PackageUseInfo pui = getPackageUseInfo(mBarUser0);
- assertNull(pui);
+ assertNoUseInfo(mBarUser0);
}
@Test
@@ -373,7 +360,7 @@
// Load a dex file from framework.
notifyDexLoad(mFooUser0, Arrays.asList(frameworkDex), mUser0);
// The dex file should not be recognized as a package.
- assertNull(mDexManager.getPackageUseInfo(frameworkDex));
+ assertFalse(mDexManager.hasInfoOnPackage(frameworkDex));
}
@Test
@@ -383,8 +370,7 @@
notifyDexLoad(mFooUser0, fooSecondaries, mUser0);
PackageUseInfo pui = getPackageUseInfo(mFooUser0);
- assertNotNull(pui);
- assertFalse(pui.isUsedByOtherApps());
+ assertIsUsedByOtherApps(mFooUser0, pui, false);
assertEquals(fooSecondaries.size(), pui.getDexUseInfoMap().size());
assertSecondaryUse(mFooUser0, pui, fooSecondaries, /*isUsedByOtherApps*/false, mUser0);
}
@@ -395,8 +381,7 @@
notifyDexLoad(mBarUser0UnsupportedClassLoader, secondaries, mUser0);
PackageUseInfo pui = getPackageUseInfo(mBarUser0UnsupportedClassLoader);
- assertNotNull(pui);
- assertFalse(pui.isUsedByOtherApps());
+ assertIsUsedByOtherApps(mBarUser0UnsupportedClassLoader, pui, false);
assertEquals(secondaries.size(), pui.getDexUseInfoMap().size());
// We expect that all the contexts are unsupported.
String[] expectedContexts =
@@ -413,8 +398,7 @@
notifyDexLoad(mBarUser0, secondaries, mUser0);
PackageUseInfo pui = getPackageUseInfo(mBarUser0);
- assertNotNull(pui);
- assertFalse(pui.isUsedByOtherApps());
+ assertIsUsedByOtherApps(mBarUser0, pui, false);
assertEquals(secondaries.size(), pui.getDexUseInfoMap().size());
assertSecondaryUse(mFooUser0, pui, secondaries, /*isUsedByOtherApps*/false, mUser0);
@@ -422,8 +406,7 @@
notifyDexLoad(mBarUser0DelegateLastClassLoader, secondaries, mUser0);
pui = getPackageUseInfo(mBarUser0);
- assertNotNull(pui);
- assertFalse(pui.isUsedByOtherApps());
+ assertIsUsedByOtherApps(mBarUser0, pui, false);
assertEquals(secondaries.size(), pui.getDexUseInfoMap().size());
// We expect that all the contexts to be changed to variable now.
String[] expectedContexts =
@@ -439,8 +422,7 @@
notifyDexLoad(mBarUser0UnsupportedClassLoader, secondaries, mUser0);
PackageUseInfo pui = getPackageUseInfo(mBarUser0UnsupportedClassLoader);
- assertNotNull(pui);
- assertFalse(pui.isUsedByOtherApps());
+ assertIsUsedByOtherApps(mBarUser0UnsupportedClassLoader, pui, false);
assertEquals(secondaries.size(), pui.getDexUseInfoMap().size());
// We expect that all the contexts are unsupported.
String[] expectedContexts =
@@ -484,6 +466,17 @@
expectedContexts);
}
+ private void assertIsUsedByOtherApps(TestData testData, PackageUseInfo pui,
+ boolean isUsedByOtherApps) {
+ assertIsUsedByOtherApps(testData.getBaseAndSplitDexPaths(), pui, isUsedByOtherApps);
+ }
+
+ private void assertIsUsedByOtherApps(List<String> codePaths, PackageUseInfo pui,
+ boolean isUsedByOtherApps) {
+ for (String codePath : codePaths) {
+ assertEquals(codePath, isUsedByOtherApps, pui.isUsedByOtherApps(codePath));
+ }
+ }
private void notifyDexLoad(TestData testData, List<String> dexPaths, int loaderUserId) {
// By default, assume a single class loader in the chain.
// This makes writing tests much easier.
@@ -499,7 +492,12 @@
}
private PackageUseInfo getPackageUseInfo(TestData testData) {
- return mDexManager.getPackageUseInfo(testData.mPackageInfo.packageName);
+ assertTrue(mDexManager.hasInfoOnPackage(testData.mPackageInfo.packageName));
+ return mDexManager.getPackageUseInfoOrDefault(testData.mPackageInfo.packageName);
+ }
+
+ private void assertNoUseInfo(TestData testData) {
+ assertFalse(mDexManager.hasInfoOnPackage(testData.mPackageInfo.packageName));
}
private static PackageInfo getMockPackageInfo(String packageName, int userId) {
diff --git a/services/tests/servicestests/src/com/android/server/pm/dex/DexoptOptionsTests.java b/services/tests/servicestests/src/com/android/server/pm/dex/DexoptOptionsTests.java
index 1eb5552..b64716c 100644
--- a/services/tests/servicestests/src/com/android/server/pm/dex/DexoptOptionsTests.java
+++ b/services/tests/servicestests/src/com/android/server/pm/dex/DexoptOptionsTests.java
@@ -62,7 +62,8 @@
DexoptOptions.DEXOPT_CHECK_FOR_PROFILES_UPDATES |
DexoptOptions.DEXOPT_ONLY_SECONDARY_DEX |
DexoptOptions.DEXOPT_ONLY_SHARED_DEX |
- DexoptOptions.DEXOPT_DOWNGRADE;
+ DexoptOptions.DEXOPT_DOWNGRADE |
+ DexoptOptions.DEXOPT_AS_SHARED_LIBRARY;
DexoptOptions opt = new DexoptOptions(mPackageName, mCompilerFilter, flags);
assertEquals(mPackageName, opt.getPackageName());
@@ -74,6 +75,7 @@
assertTrue(opt.isDexoptOnlySharedDex());
assertTrue(opt.isDowngrade());
assertTrue(opt.isForce());
+ assertTrue(opt.isDexoptAsSharedLibrary());
}
@Test
@@ -89,7 +91,7 @@
PackageManagerService.REASON_INSTALL,
PackageManagerService.REASON_BACKGROUND_DEXOPT,
PackageManagerService.REASON_AB_OTA,
- PackageManagerService.REASON_INACTIVE_PACKAGE_DOWNGRADE};
+ PackageManagerService.REASON_INACTIVE_PACKAGE_DOWNGRADE,};
for (int reason : reasons) {
DexoptOptions opt = new DexoptOptions(mPackageName, reason, flags);
@@ -102,6 +104,7 @@
assertFalse(opt.isDexoptOnlySharedDex());
assertFalse(opt.isDowngrade());
assertTrue(opt.isForce());
+ assertFalse(opt.isDexoptAsSharedLibrary());
}
}
@@ -119,6 +122,7 @@
assertFalse(opt.isDexoptOnlySharedDex());
assertFalse(opt.isDowngrade());
assertTrue(opt.isForce());
+ assertFalse(opt.isDexoptAsSharedLibrary());
}
@Test
diff --git a/services/tests/servicestests/src/com/android/server/pm/dex/PackageDexUsageTests.java b/services/tests/servicestests/src/com/android/server/pm/dex/PackageDexUsageTests.java
index 3fc12b4..69a148d 100644
--- a/services/tests/servicestests/src/com/android/server/pm/dex/PackageDexUsageTests.java
+++ b/services/tests/servicestests/src/com/android/server/pm/dex/PackageDexUsageTests.java
@@ -21,6 +21,7 @@
import android.support.test.runner.AndroidJUnit4;
import dalvik.system.VMRuntime;
+import java.util.Collections;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -249,7 +250,10 @@
Map<String, Set<Integer>> packageToUsersMap = new HashMap<>();
packageToUsersMap.put(mBarSecondary2User1.mPackageName,
new HashSet<>(Arrays.asList(mBarSecondary2User1.mOwnerUserId)));
- mPackageDexUsage.syncData(packageToUsersMap);
+ Map<String, Set<String>> packageToCodePaths = new HashMap<>();
+ packageToCodePaths.put(mBarBaseUser0.mPackageName,
+ new HashSet<>(Arrays.asList(mBarBaseUser0.mDexFile)));
+ mPackageDexUsage.syncData(packageToUsersMap, packageToCodePaths);
// Assert that only user 1 files are there.
assertPackageDexUsage(mBarBaseUser0, mBarSecondary2User1);
@@ -341,8 +345,8 @@
Set<String> usersExtra = new HashSet<>(Arrays.asList(
new String[] {"another.package.2", "another.package.3"}));
- assertTrue(record(packageDexUsageRecordUsers, mFooBaseUser0, users));
- assertTrue(record(packageDexUsageRecordUsers, mFooBaseUser0, usersExtra));
+ assertTrue(record(packageDexUsageRecordUsers, mFooSplit2UsedByOtherApps0, users));
+ assertTrue(record(packageDexUsageRecordUsers, mFooSplit2UsedByOtherApps0, usersExtra));
assertTrue(record(packageDexUsageRecordUsers, mFooSecondary1User0, users));
assertTrue(record(packageDexUsageRecordUsers, mFooSecondary1User0, usersExtra));
@@ -351,7 +355,7 @@
// Verify that the users were recorded.
Set<String> userAll = new HashSet<>(users);
userAll.addAll(usersExtra);
- assertPackageDexUsage(packageDexUsageRecordUsers, userAll, mFooBaseUser0,
+ assertPackageDexUsage(packageDexUsageRecordUsers, userAll, mFooSplit2UsedByOtherApps0,
mFooSecondary1User0);
}
@@ -359,19 +363,19 @@
public void testRecordDexFileUsersNotTheOwningPackage() {
PackageDexUsage packageDexUsageRecordUsers = new PackageDexUsage();
Set<String> users = new HashSet<>(Arrays.asList(
- new String[] {mFooBaseUser0.mPackageName}));
+ new String[] {mFooSplit2UsedByOtherApps0.mPackageName}));
Set<String> usersExtra = new HashSet<>(Arrays.asList(
new String[] {"another.package.2", "another.package.3"}));
- assertTrue(record(packageDexUsageRecordUsers, mFooBaseUser0, users));
- assertTrue(record(packageDexUsageRecordUsers, mFooBaseUser0, usersExtra));
+ assertTrue(record(packageDexUsageRecordUsers, mFooSplit2UsedByOtherApps0, users));
+ assertTrue(record(packageDexUsageRecordUsers, mFooSplit2UsedByOtherApps0, usersExtra));
assertTrue(record(packageDexUsageRecordUsers, mFooSecondary1User0, users));
assertTrue(record(packageDexUsageRecordUsers, mFooSecondary1User0, usersExtra));
packageDexUsageRecordUsers = writeAndReadBack(packageDexUsageRecordUsers);
// Verify that only the non owning packages were recorded.
- assertPackageDexUsage(packageDexUsageRecordUsers, usersExtra, mFooBaseUser0,
+ assertPackageDexUsage(packageDexUsageRecordUsers, usersExtra, mFooSplit2UsedByOtherApps0,
mFooSecondary1User0);
}
@@ -428,7 +432,6 @@
assertPackageDexUsage(null, mFooSecondary1User0);
}
-
@Test
public void testDexUsageClassLoaderContext() {
final boolean isUsedByOtherApps = false;
@@ -458,6 +461,80 @@
assertFalse(unknownContext.isVariableClassLoaderContext());
}
+ @Test
+ public void testReadVersion1() {
+ String isa = VMRuntime.getInstructionSet(Build.SUPPORTED_ABIS[0]);
+ // Equivalent to
+ // record(mFooSplit2UsedByOtherApps0);
+ // record(mFooSecondary1User0);
+ // record(mFooSecondary2UsedByOtherApps0);
+ // record(mBarBaseUser0);
+ // record(mBarSecondary1User0);
+ String content = "PACKAGE_MANAGER__PACKAGE_DEX_USAGE__1\n"
+ + "com.google.foo,1\n"
+ + "#/data/user/0/com.google.foo/sec-1.dex\n"
+ + "0,0," + isa + "\n"
+ + "#/data/user/0/com.google.foo/sec-2.dex\n"
+ + "0,1," + isa + "\n"
+ + "com.google.bar,0\n"
+ + "#/data/user/0/com.google.bar/sec-1.dex\n"
+ + "0,0," + isa + "\n";
+
+ PackageDexUsage packageDexUsage = new PackageDexUsage();
+ try {
+ packageDexUsage.read(new StringReader(content));
+ } catch (IOException e) {
+ fail();
+ }
+
+ // After the read we must sync the data to fill the missing information on the code paths.
+ Map<String, Set<Integer>> packageToUsersMap = new HashMap<>();
+ Map<String, Set<String>> packageToCodePaths = new HashMap<>();
+
+ // Handle foo package.
+ packageToUsersMap.put(mFooSplit2UsedByOtherApps0.mPackageName,
+ new HashSet<>(Arrays.asList(mFooSplit2UsedByOtherApps0.mOwnerUserId)));
+ packageToCodePaths.put(mFooSplit2UsedByOtherApps0.mPackageName,
+ new HashSet<>(Arrays.asList(mFooSplit2UsedByOtherApps0.mDexFile,
+ mFooSplit1User0.mDexFile, mFooBaseUser0.mDexFile)));
+ // Handle bar package.
+ packageToUsersMap.put(mBarBaseUser0.mPackageName,
+ new HashSet<>(Arrays.asList(mBarBaseUser0.mOwnerUserId)));
+ packageToCodePaths.put(mBarBaseUser0.mPackageName,
+ new HashSet<>(Arrays.asList(mBarBaseUser0.mDexFile)));
+
+ // Sync the data.
+ packageDexUsage.syncData(packageToUsersMap, packageToCodePaths);
+
+ // Update the class loaders to unknown before asserting if needed. Before version 2 we
+ // didn't have any.
+ String unknown = PackageDexUsage.UNKNOWN_CLASS_LOADER_CONTEXT;
+ TestData fooBaseUser0 = mFooBaseUser0.updateClassLoaderContext(unknown);
+ TestData fooSplit1User0 = mFooSplit1User0.updateClassLoaderContext(unknown);
+ TestData fooSplit2UsedByOtherApps0 =
+ mFooSplit2UsedByOtherApps0.updateClassLoaderContext(unknown);
+ TestData fooSecondary1User0 = mFooSecondary1User0.updateClassLoaderContext(unknown);
+ TestData fooSecondary2UsedByOtherApps0 =
+ mFooSecondary2UsedByOtherApps0.updateClassLoaderContext(unknown);
+ TestData barBaseUser0 = mBarBaseUser0.updateClassLoaderContext(unknown);
+ TestData barSecondary1User0 = mBarSecondary1User0.updateClassLoaderContext(unknown);
+
+ // Assert foo code paths. Note that we ignore the users during upgrade.
+ final Set<String> ignoredUsers = null;
+ assertPackageDexUsage(packageDexUsage, ignoredUsers,
+ fooSplit2UsedByOtherApps0, fooSecondary1User0, fooSecondary2UsedByOtherApps0);
+ // Because fooSplit2UsedByOtherApps0 is used by others, all the other code paths must
+ // share the same data.
+ assertPackageDexUsage(packageDexUsage, ignoredUsers,
+ fooSplit1User0.updateUseByOthers(true),
+ fooSecondary1User0, fooSecondary2UsedByOtherApps0);
+ assertPackageDexUsage(packageDexUsage, ignoredUsers, fooBaseUser0.updateUseByOthers(true),
+ fooSecondary1User0, fooSecondary2UsedByOtherApps0);
+
+ // Assert bar code paths. Note that we ignore the users during upgrade.
+ assertPackageDexUsage(packageDexUsage, ignoredUsers, barBaseUser0, barSecondary1User0);
+ }
+
private void assertPackageDexUsage(TestData primary, TestData... secondaries) {
assertPackageDexUsage(mPackageDexUsage, null, primary, secondaries);
}
@@ -470,9 +547,11 @@
// Check package use info
assertNotNull(pInfo);
- assertEquals(primaryUsedByOtherApps, pInfo.isUsedByOtherApps());
- if (users != null) {
- assertEquals(pInfo.getLoadingPackages(), users);
+ if (primary != null) {
+ assertEquals(primaryUsedByOtherApps, pInfo.isUsedByOtherApps(primary.mDexFile));
+ if (users != null) {
+ assertEquals(pInfo.getLoadingPackages(primary.mDexFile), users);
+ }
}
Map<String, DexUseInfo> dexUseInfoMap = pInfo.getDexUseInfoMap();
@@ -560,5 +639,10 @@
return new TestData(mPackageName, mDexFile, mOwnerUserId, mLoaderIsa, mUsedByOtherApps,
mPrimaryOrSplit, mUsedBy, newContext);
}
+
+ private TestData updateUseByOthers(boolean newUsedByOthers) {
+ return new TestData(mPackageName, mDexFile, mOwnerUserId, mLoaderIsa, newUsedByOthers,
+ mPrimaryOrSplit, mUsedBy, mClassLoaderContext);
+ }
}
}
diff --git a/services/tests/servicestests/src/com/android/server/wallpaper/WallpaperServiceTests.java b/services/tests/servicestests/src/com/android/server/wallpaper/WallpaperServiceTests.java
new file mode 100644
index 0000000..0d29e89
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/wallpaper/WallpaperServiceTests.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.server.wallpaper;
+
+import static org.junit.Assert.assertEquals;
+
+import android.app.WallpaperColors;
+import android.os.SystemClock;
+import android.service.wallpaper.WallpaperService;
+import android.support.test.filters.SmallTest;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.concurrent.CountDownLatch;
+
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public class WallpaperServiceTests {
+
+ @Test
+ public void testNotifyColorsChanged_rateLimit() throws Exception {
+ CountDownLatch eventCountdown = new CountDownLatch(2);
+ WallpaperService service = new WallpaperService() {
+ @Override
+ public Engine onCreateEngine() {
+ return new WallpaperService.Engine() {
+ @Override
+ public WallpaperColors onComputeColors() {
+ eventCountdown.countDown();
+ return null;
+ }
+ };
+ }
+ };
+ WallpaperService.Engine engine = service.onCreateEngine();
+
+ // Called because it's the first time.
+ engine.notifyColorsChanged();
+ assertEquals("OnComputeColors should have been called.",
+ 1, eventCountdown.getCount());
+
+ // Ignored since the call should be throttled.
+ engine.notifyColorsChanged();
+ assertEquals("OnComputeColors should have been throttled.",
+ 1, eventCountdown.getCount());
+ // Called after being deferred.
+ engine.setClockFunction(() -> SystemClock.elapsedRealtime() + 1500);
+ engine.notifyColorsChanged();
+ assertEquals("OnComputeColors should have been deferred.",
+ 0, eventCountdown.getCount());
+ }
+}
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index a78c261..23db6ac 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -1036,6 +1036,26 @@
*/
public static final String KEY_CARRIER_DEFAULT_ACTIONS_ON_RESET =
"carrier_default_actions_on_reset_string_array";
+
+ /**
+ * Defines carrier-specific actions which act upon
+ * com.android.internal.telephony.CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE,
+ * used for customization of the default carrier app
+ * Format:
+ * {
+ * "true : CARRIER_ACTION_IDX_1",
+ * "false: CARRIER_ACTION_IDX_2"
+ * }
+ * Where {@code true} is a boolean indicates default network available/unavailable
+ * Where {@code CARRIER_ACTION_IDX} is an integer defined in
+ * {@link com.android.carrierdefaultapp.CarrierActionUtils CarrierActionUtils}
+ * Example:
+ * {@link com.android.carrierdefaultapp.CarrierActionUtils
+ * #CARRIER_ACTION_ENABLE_DEFAULT_URL_HANDLER enable the app as the default URL handler}
+ * @hide
+ */
+ public static final String KEY_CARRIER_DEFAULT_ACTIONS_ON_DEFAULT_NETWORK_AVAILABLE =
+ "carrier_default_actions_on_default_network_available_string_array";
/**
* Defines a list of acceptable redirection url for default carrier app
* @hides
@@ -1712,9 +1732,10 @@
sDefaults.putString(KEY_CARRIER_SETUP_APP_STRING, "");
sDefaults.putStringArray(KEY_CARRIER_APP_WAKE_SIGNAL_CONFIG_STRING_ARRAY,
new String[]{
- "com.android.carrierdefaultapp/.CarrierDefaultBroadcastReceiver:" +
- "com.android.internal.telephony.CARRIER_SIGNAL_REDIRECTED," +
- "com.android.internal.telephony.CARRIER_SIGNAL_RESET"
+ "com.android.carrierdefaultapp/.CarrierDefaultBroadcastReceiver:"
+ + "com.android.internal.telephony.CARRIER_SIGNAL_REDIRECTED,"
+ + "com.android.internal.telephony.CARRIER_SIGNAL_RESET,"
+ + "com.android.internal.telephony.CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE"
});
sDefaults.putStringArray(KEY_CARRIER_APP_NO_WAKE_SIGNAL_CONFIG_STRING_ARRAY, null);
@@ -1722,12 +1743,22 @@
// Default carrier app configurations
sDefaults.putStringArray(KEY_CARRIER_DEFAULT_ACTIONS_ON_REDIRECTION_STRING_ARRAY,
new String[]{
- "4, 1"
+ "9, 4, 1"
+ //9: CARRIER_ACTION_REGISTER_NETWORK_AVAIL
//4: CARRIER_ACTION_DISABLE_METERED_APNS
//1: CARRIER_ACTION_SHOW_PORTAL_NOTIFICATION
});
sDefaults.putStringArray(KEY_CARRIER_DEFAULT_ACTIONS_ON_RESET, new String[]{
- "6" //6: CARRIER_ACTION_CANCEL_ALL_NOTIFICATIONS
+ "6, 8"
+ //6: CARRIER_ACTION_CANCEL_ALL_NOTIFICATIONS
+ //8: CARRIER_ACTION_DISABLE_DEFAULT_URL_HANDLER
+ });
+ sDefaults.putStringArray(KEY_CARRIER_DEFAULT_ACTIONS_ON_DEFAULT_NETWORK_AVAILABLE,
+ new String[] {
+ String.valueOf(false) + ": 7",
+ //7: CARRIER_ACTION_ENABLE_DEFAULT_URL_HANDLER
+ String.valueOf(true) + ": 8"
+ //8: CARRIER_ACTION_DISABLE_DEFAULT_URL_HANDLER
});
sDefaults.putStringArray(KEY_CARRIER_DEFAULT_REDIRECTION_URL_STRING_ARRAY, null);
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index cee77fb..6a9d00e 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -6673,6 +6673,25 @@
}
/**
+ * Action set from carrier signalling broadcast receivers to start/stop reporting default
+ * network available events
+ * Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
+ * @param subId the subscription ID that this action applies to.
+ * @param report control start/stop reporting network status.
+ * @hide
+ */
+ public void carrierActionReportDefaultNetworkStatus(int subId, boolean report) {
+ try {
+ ITelephony service = getITelephony();
+ if (service != null) {
+ service.carrierActionReportDefaultNetworkStatus(subId, report);
+ }
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error calling ITelephony#carrierActionReportDefaultNetworkStatus", e);
+ }
+ }
+
+ /**
* Get aggregated video call data usage since boot.
* Permissions android.Manifest.permission.READ_NETWORK_USAGE_HISTORY is required.
*
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index 654adb2..9262ec5 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -1303,6 +1303,16 @@
void carrierActionSetRadioEnabled(int subId, boolean enabled);
/**
+ * Action set from carrier signalling broadcast receivers to start/stop reporting default
+ * network conditions.
+ * Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
+ * @param subId the subscription ID that this action applies to.
+ * @param report control start/stop reporting default network events.
+ * @hide
+ */
+ void carrierActionReportDefaultNetworkStatus(int subId, boolean report);
+
+ /**
* Get aggregated video call data usage since boot.
* Permissions android.Manifest.permission.READ_NETWORK_USAGE_HISTORY is required.
*
diff --git a/telephony/java/com/android/internal/telephony/TelephonyIntents.java b/telephony/java/com/android/internal/telephony/TelephonyIntents.java
index 0343890..f29d993c 100644
--- a/telephony/java/com/android/internal/telephony/TelephonyIntents.java
+++ b/telephony/java/com/android/internal/telephony/TelephonyIntents.java
@@ -447,6 +447,20 @@
"com.android.internal.telephony.CARRIER_SIGNAL_PCO_VALUE";
/**
+ * <p>Broadcast Action: when system default network available/unavailable with
+ * carrier-disabled mobile data. Intended for carrier apps to set/reset carrier actions when
+ * other network becomes system default network, Wi-Fi for example.
+ * The intent will have the following extra values:</p>
+ * <ul>
+ * <li>defaultNetworkAvailable</li><dd>A boolean indicates default network available.</dd>
+ * <li>subId</li><dd>Sub Id which associated the default data.</dd>
+ * </ul>
+ * <p class="note">This is a protected intent that can only be sent by the system. </p>
+ */
+ public static final String ACTION_CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE =
+ "com.android.internal.telephony.CARRIER_SIGNAL_DEFAULT_NETWORK_AVAILABLE";
+
+ /**
* <p>Broadcast Action: when framework reset all carrier actions on sim load or absent.
* intended for carrier apps clean up (clear UI e.g.) and only sent to the specified carrier app
* The intent will have the following extra values:</p>
@@ -465,7 +479,7 @@
public static final String EXTRA_APN_PROTO_KEY = "apnProto";
public static final String EXTRA_PCO_ID_KEY = "pcoId";
public static final String EXTRA_PCO_VALUE_KEY = "pcoValue";
-
+ public static final String EXTRA_DEFAULT_NETWORK_AVAILABLE_KEY = "defaultNetworkAvailable";
/**
* Broadcast action to trigger CI OMA-DM Session.
diff --git a/tools/aapt2/ResourceParser.cpp b/tools/aapt2/ResourceParser.cpp
index 9a37913..a5783a5 100644
--- a/tools/aapt2/ResourceParser.cpp
+++ b/tools/aapt2/ResourceParser.cpp
@@ -268,8 +268,7 @@
continue;
}
- if (!parser->element_namespace().empty() ||
- parser->element_name() != "resources") {
+ if (!parser->element_namespace().empty() || parser->element_name() != "resources") {
diag_->Error(DiagMessage(source_.WithLine(parser->line_number()))
<< "root element must be <resources>");
return false;
@@ -328,8 +327,7 @@
parsed_resource.comment = std::move(comment);
// Extract the product name if it exists.
- if (Maybe<StringPiece> maybe_product =
- xml::FindNonEmptyAttribute(parser, "product")) {
+ if (Maybe<StringPiece> maybe_product = xml::FindNonEmptyAttribute(parser, "product")) {
parsed_resource.product = maybe_product.value().to_string();
}
@@ -348,10 +346,8 @@
for (const ResourceName& stripped_resource : stripped_resources) {
if (!table_->FindResource(stripped_resource)) {
// Failed to find the resource.
- diag_->Error(DiagMessage(source_)
- << "resource '" << stripped_resource
- << "' "
- "was filtered out but no product variant remains");
+ diag_->Error(DiagMessage(source_) << "resource '" << stripped_resource
+ << "' was filtered out but no product variant remains");
error = true;
}
}
@@ -589,7 +585,7 @@
// This can only be a StyledString.
std::unique_ptr<StyledString> styled_string =
util::make_unique<StyledString>(table_->string_pool.MakeRef(
- style_string, StringPool::Context(StringPool::Context::kStylePriority, config_)));
+ style_string, StringPool::Context(StringPool::Context::kNormalPriority, config_)));
styled_string->untranslatable_sections = std::move(untranslatable_sections);
return std::move(styled_string);
}
diff --git a/tools/aapt2/ResourceParser_test.cpp b/tools/aapt2/ResourceParser_test.cpp
index d47a529..1683c64 100644
--- a/tools/aapt2/ResourceParser_test.cpp
+++ b/tools/aapt2/ResourceParser_test.cpp
@@ -117,7 +117,7 @@
StyledString* str = test::GetValue<StyledString>(&table_, "string/foo");
ASSERT_THAT(str, NotNull());
- EXPECT_THAT(*str->value->str, Eq("This is my aunt\u2019s fickle string"));
+ EXPECT_THAT(str->value->value, Eq("This is my aunt\u2019s fickle string"));
EXPECT_THAT(str->value->spans, SizeIs(2));
EXPECT_THAT(str->untranslatable_sections, IsEmpty());
@@ -190,7 +190,7 @@
StyledString* str = test::GetValue<StyledString>(&table_, "string/foo");
ASSERT_THAT(str, NotNull());
- EXPECT_THAT(*str->value->str, Eq("There are %1$d apples"));
+ EXPECT_THAT(str->value->value, Eq("There are %1$d apples"));
ASSERT_THAT(str->untranslatable_sections, SizeIs(1));
// We expect indices and lengths that span to include the whitespace
diff --git a/tools/aapt2/ResourceUtils.cpp b/tools/aapt2/ResourceUtils.cpp
index 6e6a2ba..f193fe0 100644
--- a/tools/aapt2/ResourceUtils.cpp
+++ b/tools/aapt2/ResourceUtils.cpp
@@ -700,7 +700,7 @@
spans++;
}
return util::make_unique<StyledString>(dst_pool->MakeRef(
- style_str, StringPool::Context(StringPool::Context::kStylePriority, config)));
+ style_str, StringPool::Context(StringPool::Context::kNormalPriority, config)));
} else {
if (type != ResourceType::kString && util::StartsWith(str, "res/")) {
// This must be a FileReference.
diff --git a/tools/aapt2/ResourceValues.cpp b/tools/aapt2/ResourceValues.cpp
index 947e091..eb59175 100644
--- a/tools/aapt2/ResourceValues.cpp
+++ b/tools/aapt2/ResourceValues.cpp
@@ -253,10 +253,9 @@
}
void StyledString::Print(std::ostream* out) const {
- *out << "(styled string) \"" << *value->str << "\"";
+ *out << "(styled string) \"" << value->value << "\"";
for (const StringPool::Span& span : value->spans) {
- *out << " " << *span.name << ":" << span.first_char << ","
- << span.last_char;
+ *out << " " << *span.name << ":" << span.first_char << "," << span.last_char;
}
}
diff --git a/tools/aapt2/StringPool.cpp b/tools/aapt2/StringPool.cpp
index 57da5f0..705b1ab 100644
--- a/tools/aapt2/StringPool.cpp
+++ b/tools/aapt2/StringPool.cpp
@@ -27,7 +27,7 @@
#include "util/BigBuffer.h"
#include "util/Util.h"
-using android::StringPiece;
+using ::android::StringPiece;
namespace aapt {
@@ -75,9 +75,14 @@
return &entry_->value;
}
-const std::string& StringPool::Ref::operator*() const { return entry_->value; }
+const std::string& StringPool::Ref::operator*() const {
+ return entry_->value;
+}
-size_t StringPool::Ref::index() const { return entry_->index; }
+size_t StringPool::Ref::index() const {
+ // Account for the styles, which *always* come first.
+ return entry_->pool_->styles_.size() + entry_->index_;
+}
const StringPool::Context& StringPool::Ref::GetContext() const {
return entry_->context;
@@ -104,8 +109,7 @@
}
}
-StringPool::StyleRef& StringPool::StyleRef::operator=(
- const StringPool::StyleRef& rhs) {
+StringPool::StyleRef& StringPool::StyleRef::operator=(const StringPool::StyleRef& rhs) {
if (rhs.entry_ != nullptr) {
rhs.entry_->ref_++;
}
@@ -118,7 +122,7 @@
}
bool StringPool::StyleRef::operator==(const StyleRef& rhs) const {
- if (entry_->str != rhs.entry_->str) {
+ if (entry_->value != rhs.entry_->value) {
return false;
}
@@ -137,7 +141,9 @@
return true;
}
-bool StringPool::StyleRef::operator!=(const StyleRef& rhs) const { return !operator==(rhs); }
+bool StringPool::StyleRef::operator!=(const StyleRef& rhs) const {
+ return !operator==(rhs);
+}
const StringPool::StyleEntry* StringPool::StyleRef::operator->() const {
return entry_;
@@ -147,23 +153,24 @@
return *entry_;
}
-size_t StringPool::StyleRef::index() const { return entry_->str.index(); }
+size_t StringPool::StyleRef::index() const {
+ return entry_->index_;
+}
const StringPool::Context& StringPool::StyleRef::GetContext() const {
- return entry_->str.GetContext();
+ return entry_->context;
}
StringPool::Ref StringPool::MakeRef(const StringPiece& str) {
return MakeRefImpl(str, Context{}, true);
}
-StringPool::Ref StringPool::MakeRef(const StringPiece& str,
- const Context& context) {
+StringPool::Ref StringPool::MakeRef(const StringPiece& str, const Context& context) {
return MakeRefImpl(str, context, true);
}
-StringPool::Ref StringPool::MakeRefImpl(const StringPiece& str,
- const Context& context, bool unique) {
+StringPool::Ref StringPool::MakeRefImpl(const StringPiece& str, const Context& context,
+ bool unique) {
if (unique) {
auto iter = indexed_strings_.find(str);
if (iter != std::end(indexed_strings_)) {
@@ -171,82 +178,87 @@
}
}
- Entry* entry = new Entry();
+ std::unique_ptr<Entry> entry(new Entry());
entry->value = str.to_string();
entry->context = context;
- entry->index = strings_.size();
+ entry->index_ = strings_.size();
entry->ref_ = 0;
- strings_.emplace_back(entry);
- indexed_strings_.insert(std::make_pair(StringPiece(entry->value), entry));
- return Ref(entry);
+ entry->pool_ = this;
+
+ Entry* borrow = entry.get();
+ strings_.emplace_back(std::move(entry));
+ indexed_strings_.insert(std::make_pair(StringPiece(borrow->value), borrow));
+ return Ref(borrow);
}
StringPool::StyleRef StringPool::MakeRef(const StyleString& str) {
return MakeRef(str, Context{});
}
-StringPool::StyleRef StringPool::MakeRef(const StyleString& str,
- const Context& context) {
- Entry* entry = new Entry();
+StringPool::StyleRef StringPool::MakeRef(const StyleString& str, const Context& context) {
+ std::unique_ptr<StyleEntry> entry(new StyleEntry());
entry->value = str.str;
entry->context = context;
- entry->index = strings_.size();
+ entry->index_ = styles_.size();
entry->ref_ = 0;
- strings_.emplace_back(entry);
- indexed_strings_.insert(std::make_pair(StringPiece(entry->value), entry));
-
- StyleEntry* style_entry = new StyleEntry();
- style_entry->str = Ref(entry);
for (const aapt::Span& span : str.spans) {
- style_entry->spans.emplace_back(
- Span{MakeRef(span.name), span.first_char, span.last_char});
+ entry->spans.emplace_back(Span{MakeRef(span.name), span.first_char, span.last_char});
}
- style_entry->ref_ = 0;
- styles_.emplace_back(style_entry);
- return StyleRef(style_entry);
+
+ StyleEntry* borrow = entry.get();
+ styles_.emplace_back(std::move(entry));
+ return StyleRef(borrow);
}
StringPool::StyleRef StringPool::MakeRef(const StyleRef& ref) {
- Entry* entry = new Entry();
- entry->value = *ref.entry_->str;
- entry->context = ref.entry_->str.entry_->context;
- entry->index = strings_.size();
+ std::unique_ptr<StyleEntry> entry(new StyleEntry());
+ entry->value = ref.entry_->value;
+ entry->context = ref.entry_->context;
+ entry->index_ = styles_.size();
entry->ref_ = 0;
- strings_.emplace_back(entry);
- indexed_strings_.insert(std::make_pair(StringPiece(entry->value), entry));
-
- StyleEntry* style_entry = new StyleEntry();
- style_entry->str = Ref(entry);
for (const Span& span : ref.entry_->spans) {
- style_entry->spans.emplace_back(
- Span{MakeRef(*span.name), span.first_char, span.last_char});
+ entry->spans.emplace_back(Span{MakeRef(*span.name), span.first_char, span.last_char});
}
- style_entry->ref_ = 0;
- styles_.emplace_back(style_entry);
- return StyleRef(style_entry);
+
+ StyleEntry* borrow = entry.get();
+ styles_.emplace_back(std::move(entry));
+ return StyleRef(borrow);
+}
+
+void StringPool::ReAssignIndices() {
+ // Assign the style indices.
+ const size_t style_len = styles_.size();
+ for (size_t index = 0; index < style_len; index++) {
+ styles_[index]->index_ = index;
+ }
+
+ // Assign the string indices.
+ const size_t string_len = strings_.size();
+ for (size_t index = 0; index < string_len; index++) {
+ strings_[index]->index_ = index;
+ }
}
void StringPool::Merge(StringPool&& pool) {
- indexed_strings_.insert(pool.indexed_strings_.begin(),
- pool.indexed_strings_.end());
- pool.indexed_strings_.clear();
- std::move(pool.strings_.begin(), pool.strings_.end(),
- std::back_inserter(strings_));
- pool.strings_.clear();
- std::move(pool.styles_.begin(), pool.styles_.end(),
- std::back_inserter(styles_));
- pool.styles_.clear();
-
- // Assign the indices.
- const size_t len = strings_.size();
- for (size_t index = 0; index < len; index++) {
- strings_[index]->index = index;
+ // First, change the owning pool for the incoming strings.
+ for (std::unique_ptr<Entry>& entry : pool.strings_) {
+ entry->pool_ = this;
}
+
+ // Now move the styles, strings, and indices over.
+ std::move(pool.styles_.begin(), pool.styles_.end(), std::back_inserter(styles_));
+ pool.styles_.clear();
+ std::move(pool.strings_.begin(), pool.strings_.end(), std::back_inserter(strings_));
+ pool.strings_.clear();
+ indexed_strings_.insert(pool.indexed_strings_.begin(), pool.indexed_strings_.end());
+ pool.indexed_strings_.clear();
+
+ ReAssignIndices();
}
-void StringPool::HintWillAdd(size_t stringCount, size_t styleCount) {
- strings_.reserve(strings_.size() + stringCount);
- styles_.reserve(styles_.size() + styleCount);
+void StringPool::HintWillAdd(size_t string_count, size_t style_count) {
+ strings_.reserve(strings_.size() + string_count);
+ styles_.reserve(styles_.size() + style_count);
}
void StringPool::Prune() {
@@ -262,47 +274,42 @@
auto end_iter2 =
std::remove_if(strings_.begin(), strings_.end(),
- [](const std::unique_ptr<Entry>& entry) -> bool {
- return entry->ref_ <= 0;
- });
+ [](const std::unique_ptr<Entry>& entry) -> bool { return entry->ref_ <= 0; });
+ auto end_iter3 = std::remove_if(
+ styles_.begin(), styles_.end(),
+ [](const std::unique_ptr<StyleEntry>& entry) -> bool { return entry->ref_ <= 0; });
- auto end_iter3 =
- std::remove_if(styles_.begin(), styles_.end(),
- [](const std::unique_ptr<StyleEntry>& entry) -> bool {
- return entry->ref_ <= 0;
- });
-
- // Remove the entries at the end or else we'll be accessing
- // a deleted string from the StyleEntry.
+ // Remove the entries at the end or else we'll be accessing a deleted string from the StyleEntry.
strings_.erase(end_iter2, strings_.end());
styles_.erase(end_iter3, styles_.end());
- // Reassign the indices.
- const size_t len = strings_.size();
- for (size_t index = 0; index < len; index++) {
- strings_[index]->index = index;
+ ReAssignIndices();
+}
+
+template <typename E>
+static void SortEntries(
+ std::vector<std::unique_ptr<E>>& entries,
+ const std::function<int(const StringPool::Context&, const StringPool::Context&)>& cmp) {
+ using UEntry = std::unique_ptr<E>;
+
+ if (cmp != nullptr) {
+ std::sort(entries.begin(), entries.end(), [&cmp](const UEntry& a, const UEntry& b) -> bool {
+ int r = cmp(a->context, b->context);
+ if (r == 0) {
+ r = a->value.compare(b->value);
+ }
+ return r < 0;
+ });
+ } else {
+ std::sort(entries.begin(), entries.end(),
+ [](const UEntry& a, const UEntry& b) -> bool { return a->value < b->value; });
}
}
-void StringPool::Sort(
- const std::function<bool(const Entry&, const Entry&)>& cmp) {
- std::sort(
- strings_.begin(), strings_.end(),
- [&cmp](const std::unique_ptr<Entry>& a,
- const std::unique_ptr<Entry>& b) -> bool { return cmp(*a, *b); });
-
- // Assign the indices.
- const size_t len = strings_.size();
- for (size_t index = 0; index < len; index++) {
- strings_[index]->index = index;
- }
-
- // Reorder the styles.
- std::sort(styles_.begin(), styles_.end(),
- [](const std::unique_ptr<StyleEntry>& lhs,
- const std::unique_ptr<StyleEntry>& rhs) -> bool {
- return lhs->str.index() < rhs->str.index();
- });
+void StringPool::Sort(const std::function<int(const Context&, const Context&)>& cmp) {
+ SortEntries(styles_, cmp);
+ SortEntries(strings_, cmp);
+ ReAssignIndices();
}
template <typename T>
@@ -327,60 +334,31 @@
return length > kMaxSize ? 2 : 1;
}
-bool StringPool::Flatten(BigBuffer* out, const StringPool& pool, bool utf8) {
- const size_t start_index = out->size();
- android::ResStringPool_header* header =
- out->NextBlock<android::ResStringPool_header>();
- header->header.type = android::RES_STRING_POOL_TYPE;
- header->header.headerSize = sizeof(*header);
- header->stringCount = pool.size();
+static void EncodeString(const std::string& str, const bool utf8, BigBuffer* out) {
if (utf8) {
- header->flags |= android::ResStringPool_header::UTF8_FLAG;
- }
+ const std::string& encoded = str;
+ const ssize_t utf16_length =
+ utf8_to_utf16_length(reinterpret_cast<const uint8_t*>(str.data()), str.size());
+ CHECK(utf16_length >= 0);
- uint32_t* indices =
- pool.size() != 0 ? out->NextBlock<uint32_t>(pool.size()) : nullptr;
+ const size_t total_size = EncodedLengthUnits<char>(utf16_length) +
+ EncodedLengthUnits<char>(encoded.length()) + encoded.size() + 1;
- uint32_t* style_indices = nullptr;
- if (!pool.styles_.empty()) {
- header->styleCount = pool.styles_.back()->str.index() + 1;
- style_indices = out->NextBlock<uint32_t>(header->styleCount);
- }
+ char* data = out->NextBlock<char>(total_size);
- const size_t before_strings_index = out->size();
- header->stringsStart = before_strings_index - start_index;
+ // First encode the UTF16 string length.
+ data = EncodeLength(data, utf16_length);
- for (const auto& entry : pool) {
- *indices = out->size() - before_strings_index;
- indices++;
-
- if (utf8) {
- const std::string& encoded = entry->value;
- const ssize_t utf16_length = utf8_to_utf16_length(
- reinterpret_cast<const uint8_t*>(entry->value.data()),
- entry->value.size());
- CHECK(utf16_length >= 0);
-
- const size_t total_size = EncodedLengthUnits<char>(utf16_length) +
- EncodedLengthUnits<char>(encoded.length()) +
- encoded.size() + 1;
-
- char* data = out->NextBlock<char>(total_size);
-
- // First encode the UTF16 string length.
- data = EncodeLength(data, utf16_length);
-
- // Now encode the size of the real UTF8 string.
- data = EncodeLength(data, encoded.length());
- strncpy(data, encoded.data(), encoded.size());
+ // Now encode the size of the real UTF8 string.
+ data = EncodeLength(data, encoded.length());
+ strncpy(data, encoded.data(), encoded.size());
} else {
- const std::u16string encoded = util::Utf8ToUtf16(entry->value);
+ const std::u16string encoded = util::Utf8ToUtf16(str);
const ssize_t utf16_length = encoded.size();
// Total number of 16-bit words to write.
- const size_t total_size =
- EncodedLengthUnits<char16_t>(utf16_length) + encoded.size() + 1;
+ const size_t total_size = EncodedLengthUnits<char16_t>(utf16_length) + encoded.size() + 1;
char16_t* data = out->NextBlock<char16_t>(total_size);
@@ -395,31 +373,55 @@
// The null-terminating character is already here due to the block of data
// being set to 0s on allocation.
}
+}
+
+bool StringPool::Flatten(BigBuffer* out, const StringPool& pool, bool utf8) {
+ const size_t start_index = out->size();
+ android::ResStringPool_header* header = out->NextBlock<android::ResStringPool_header>();
+ header->header.type = util::HostToDevice16(android::RES_STRING_POOL_TYPE);
+ header->header.headerSize = util::HostToDevice16(sizeof(*header));
+ header->stringCount = util::HostToDevice32(pool.size());
+ header->styleCount = util::HostToDevice32(pool.styles_.size());
+ if (utf8) {
+ header->flags |= android::ResStringPool_header::UTF8_FLAG;
+ }
+
+ uint32_t* indices = pool.size() != 0 ? out->NextBlock<uint32_t>(pool.size()) : nullptr;
+ uint32_t* style_indices =
+ pool.styles_.size() != 0 ? out->NextBlock<uint32_t>(pool.styles_.size()) : nullptr;
+
+ const size_t before_strings_index = out->size();
+ header->stringsStart = before_strings_index - start_index;
+
+ // Styles always come first.
+ for (const std::unique_ptr<StyleEntry>& entry : pool.styles_) {
+ *indices++ = out->size() - before_strings_index;
+ EncodeString(entry->value, utf8, out);
+ }
+
+ for (const std::unique_ptr<Entry>& entry : pool.strings_) {
+ *indices++ = out->size() - before_strings_index;
+ EncodeString(entry->value, utf8, out);
}
out->Align4();
- if (!pool.styles_.empty()) {
+ if (style_indices != nullptr) {
const size_t before_styles_index = out->size();
- header->stylesStart = before_styles_index - start_index;
+ header->stylesStart = util::HostToDevice32(before_styles_index - start_index);
- size_t current_index = 0;
- for (const auto& entry : pool.styles_) {
- while (entry->str.index() > current_index) {
- style_indices[current_index++] = out->size() - before_styles_index;
+ for (const std::unique_ptr<StyleEntry>& entry : pool.styles_) {
+ *style_indices++ = out->size() - before_styles_index;
- uint32_t* span_offset = out->NextBlock<uint32_t>();
- *span_offset = android::ResStringPool_span::END;
- }
- style_indices[current_index++] = out->size() - before_styles_index;
-
- android::ResStringPool_span* span =
- out->NextBlock<android::ResStringPool_span>(entry->spans.size());
- for (const auto& s : entry->spans) {
- span->name.index = s.name.index();
- span->firstChar = s.first_char;
- span->lastChar = s.last_char;
- span++;
+ if (!entry->spans.empty()) {
+ android::ResStringPool_span* span =
+ out->NextBlock<android::ResStringPool_span>(entry->spans.size());
+ for (const Span& s : entry->spans) {
+ span->name.index = util::HostToDevice32(s.name.index());
+ span->firstChar = util::HostToDevice32(s.first_char);
+ span->lastChar = util::HostToDevice32(s.last_char);
+ span++;
+ }
}
uint32_t* spanEnd = out->NextBlock<uint32_t>();
@@ -436,7 +438,7 @@
memset(padding, 0xff, padding_length);
out->Align4();
}
- header->header.size = out->size() - start_index;
+ header->header.size = util::HostToDevice32(out->size() - start_index);
return true;
}
diff --git a/tools/aapt2/StringPool.h b/tools/aapt2/StringPool.h
index d1232a2..8350d0d 100644
--- a/tools/aapt2/StringPool.h
+++ b/tools/aapt2/StringPool.h
@@ -42,12 +42,16 @@
std::vector<Span> spans;
};
+// A StringPool for storing the value of String and StyledString resources.
+// Styles and Strings are stored separately, since the runtime variant of this
+// class -- ResStringPool -- requires that styled strings *always* appear first, since their
+// style data is stored as an array indexed by the same indices as the main string pool array.
+// Otherwise, the style data array would have to be sparse and take up more space.
class StringPool {
public:
class Context {
public:
enum : uint32_t {
- kStylePriority = 0u,
kHighPriority = 1u,
kNormalPriority = 0x7fffffffu,
kLowPriority = 0xffffffffu,
@@ -58,8 +62,8 @@
Context() = default;
Context(uint32_t p, const ConfigDescription& c) : priority(p), config(c) {}
explicit Context(uint32_t p) : priority(p) {}
- explicit Context(const ConfigDescription& c)
- : priority(kNormalPriority), config(c) {}
+ explicit Context(const ConfigDescription& c) : priority(kNormalPriority), config(c) {
+ }
};
class Entry;
@@ -116,13 +120,14 @@
public:
std::string value;
Context context;
- size_t index;
private:
friend class StringPool;
friend class Ref;
+ size_t index_;
int ref_;
+ const StringPool* pool_;
};
struct Span {
@@ -133,18 +138,18 @@
class StyleEntry {
public:
- Ref str;
+ std::string value;
+ Context context;
std::vector<Span> spans;
private:
friend class StringPool;
friend class StyleRef;
+ size_t index_;
int ref_;
};
- using const_iterator = std::vector<std::unique_ptr<Entry>>::const_iterator;
-
static bool FlattenUtf8(BigBuffer* out, const StringPool& pool);
static bool FlattenUtf16(BigBuffer* out, const StringPool& pool);
@@ -152,92 +157,61 @@
StringPool(StringPool&&) = default;
StringPool& operator=(StringPool&&) = default;
- /**
- * Adds a string to the pool, unless it already exists. Returns
- * a reference to the string in the pool.
- */
+ // Adds a string to the pool, unless it already exists. Returns a reference to the string in the
+ // pool.
Ref MakeRef(const android::StringPiece& str);
- /**
- * Adds a string to the pool, unless it already exists, with a context
- * object that can be used when sorting the string pool. Returns
- * a reference to the string in the pool.
- */
+ // Adds a string to the pool, unless it already exists, with a context object that can be used
+ // when sorting the string pool. Returns a reference to the string in the pool.
Ref MakeRef(const android::StringPiece& str, const Context& context);
- /**
- * Adds a style to the string pool and returns a reference to it.
- */
+ // Adds a style to the string pool and returns a reference to it.
StyleRef MakeRef(const StyleString& str);
- /**
- * Adds a style to the string pool with a context object that
- * can be used when sorting the string pool. Returns a reference
- * to the style in the string pool.
- */
+ // Adds a style to the string pool with a context object that can be used when sorting the string
+ // pool. Returns a reference to the style in the string pool.
StyleRef MakeRef(const StyleString& str, const Context& context);
- /**
- * Adds a style from another string pool. Returns a reference to the
- * style in the string pool.
- */
+ // Adds a style from another string pool. Returns a reference to the style in the string pool.
StyleRef MakeRef(const StyleRef& ref);
- /**
- * Moves pool into this one without coalescing strings. When this
- * function returns, pool will be empty.
- */
+ // Moves pool into this one without coalescing strings. When this function returns, pool will be
+ // empty.
void Merge(StringPool&& pool);
- /**
- * Returns the number of strings in the table.
- */
- inline size_t size() const;
+ inline const std::vector<std::unique_ptr<Entry>>& strings() const {
+ return strings_;
+ }
- /**
- * Reserves space for strings and styles as an optimization.
- */
+ // Returns the number of strings in the table.
+ inline size_t size() const {
+ return styles_.size() + strings_.size();
+ }
+
+ // Reserves space for strings and styles as an optimization.
void HintWillAdd(size_t string_count, size_t style_count);
- /**
- * Sorts the strings according to some comparison function.
- */
- void Sort(const std::function<bool(const Entry&, const Entry&)>& cmp);
+ // Sorts the strings according to their Context using some comparison function.
+ // Equal Contexts are further sorted by string value, lexicographically.
+ // If no comparison function is provided, values are only sorted lexicographically.
+ void Sort(const std::function<int(const Context&, const Context&)>& cmp = nullptr);
- /**
- * Removes any strings that have no references.
- */
+ // Removes any strings that have no references.
void Prune();
private:
DISALLOW_COPY_AND_ASSIGN(StringPool);
- friend const_iterator begin(const StringPool& pool);
- friend const_iterator end(const StringPool& pool);
-
static bool Flatten(BigBuffer* out, const StringPool& pool, bool utf8);
Ref MakeRefImpl(const android::StringPiece& str, const Context& context, bool unique);
+ void ReAssignIndices();
std::vector<std::unique_ptr<Entry>> strings_;
std::vector<std::unique_ptr<StyleEntry>> styles_;
std::unordered_multimap<android::StringPiece, Entry*> indexed_strings_;
};
-//
-// Inline implementation
-//
-
-inline size_t StringPool::size() const { return strings_.size(); }
-
-inline StringPool::const_iterator begin(const StringPool& pool) {
- return pool.strings_.begin();
-}
-
-inline StringPool::const_iterator end(const StringPool& pool) {
- return pool.strings_.end();
-}
-
} // namespace aapt
#endif // AAPT_STRING_POOL_H
diff --git a/tools/aapt2/StringPool_test.cpp b/tools/aapt2/StringPool_test.cpp
index f64a8cf..b1e5ce2 100644
--- a/tools/aapt2/StringPool_test.cpp
+++ b/tools/aapt2/StringPool_test.cpp
@@ -23,8 +23,12 @@
#include "test/Test.h"
#include "util/Util.h"
-using android::StringPiece;
-using android::StringPiece16;
+using ::android::StringPiece;
+using ::android::StringPiece16;
+using ::testing::Eq;
+using ::testing::Ne;
+using ::testing::NotNull;
+using ::testing::Pointee;
namespace aapt {
@@ -32,129 +36,127 @@
StringPool pool;
StringPool::Ref ref = pool.MakeRef("wut");
- EXPECT_EQ(*ref, "wut");
+ EXPECT_THAT(*ref, Eq("wut"));
}
TEST(StringPoolTest, InsertTwoUniqueStrings) {
StringPool pool;
- StringPool::Ref ref = pool.MakeRef("wut");
- StringPool::Ref ref2 = pool.MakeRef("hey");
+ StringPool::Ref ref_a = pool.MakeRef("wut");
+ StringPool::Ref ref_b = pool.MakeRef("hey");
- EXPECT_EQ(*ref, "wut");
- EXPECT_EQ(*ref2, "hey");
+ EXPECT_THAT(*ref_a, Eq("wut"));
+ EXPECT_THAT(*ref_b, Eq("hey"));
}
TEST(StringPoolTest, DoNotInsertNewDuplicateString) {
StringPool pool;
- StringPool::Ref ref = pool.MakeRef("wut");
- StringPool::Ref ref2 = pool.MakeRef("wut");
+ StringPool::Ref ref_a = pool.MakeRef("wut");
+ StringPool::Ref ref_b = pool.MakeRef("wut");
- EXPECT_EQ(*ref, "wut");
- EXPECT_EQ(*ref2, "wut");
- EXPECT_EQ(1u, pool.size());
+ EXPECT_THAT(*ref_a, Eq("wut"));
+ EXPECT_THAT(*ref_b, Eq("wut"));
+ EXPECT_THAT(pool.size(), Eq(1u));
}
TEST(StringPoolTest, MaintainInsertionOrderIndex) {
StringPool pool;
- StringPool::Ref ref = pool.MakeRef("z");
- StringPool::Ref ref2 = pool.MakeRef("a");
- StringPool::Ref ref3 = pool.MakeRef("m");
+ StringPool::Ref ref_a = pool.MakeRef("z");
+ StringPool::Ref ref_b = pool.MakeRef("a");
+ StringPool::Ref ref_c = pool.MakeRef("m");
- EXPECT_EQ(0u, ref.index());
- EXPECT_EQ(1u, ref2.index());
- EXPECT_EQ(2u, ref3.index());
+ EXPECT_THAT(ref_a.index(), Eq(0u));
+ EXPECT_THAT(ref_b.index(), Eq(1u));
+ EXPECT_THAT(ref_c.index(), Eq(2u));
}
TEST(StringPoolTest, PruneStringsWithNoReferences) {
StringPool pool;
- StringPool::Ref refA = pool.MakeRef("foo");
- {
- StringPool::Ref ref = pool.MakeRef("wut");
- EXPECT_EQ(*ref, "wut");
- EXPECT_EQ(2u, pool.size());
- }
- StringPool::Ref refB = pool.MakeRef("bar");
+ StringPool::Ref ref_a = pool.MakeRef("foo");
- EXPECT_EQ(3u, pool.size());
+ {
+ StringPool::Ref ref_b = pool.MakeRef("wut");
+ EXPECT_THAT(*ref_b, Eq("wut"));
+ EXPECT_THAT(pool.size(), Eq(2u));
+ pool.Prune();
+ EXPECT_THAT(pool.size(), Eq(2u));
+ }
+ EXPECT_THAT(pool.size(), Eq(2u));
+
+ {
+ StringPool::Ref ref_c = pool.MakeRef("bar");
+ EXPECT_THAT(pool.size(), Eq(3u));
+
+ pool.Prune();
+ EXPECT_THAT(pool.size(), Eq(2u));
+ }
+ EXPECT_THAT(pool.size(), Eq(2u));
+
pool.Prune();
- EXPECT_EQ(2u, pool.size());
- StringPool::const_iterator iter = begin(pool);
- EXPECT_EQ((*iter)->value, "foo");
- EXPECT_LT((*iter)->index, 2u);
- ++iter;
- EXPECT_EQ((*iter)->value, "bar");
- EXPECT_LT((*iter)->index, 2u);
+ EXPECT_THAT(pool.size(), Eq(1u));
}
-TEST(StringPoolTest, SortAndMaintainIndexesInReferences) {
+TEST(StringPoolTest, SortAndMaintainIndexesInStringReferences) {
StringPool pool;
- StringPool::Ref ref = pool.MakeRef("z");
- StringPool::StyleRef ref2 = pool.MakeRef(StyleString{{"a"}});
- StringPool::Ref ref3 = pool.MakeRef("m");
+ StringPool::Ref ref_a = pool.MakeRef("z");
+ StringPool::Ref ref_b = pool.MakeRef("a");
+ StringPool::Ref ref_c = pool.MakeRef("m");
- EXPECT_EQ(*ref, "z");
- EXPECT_EQ(0u, ref.index());
+ EXPECT_THAT(*ref_a, Eq("z"));
+ EXPECT_THAT(ref_a.index(), Eq(0u));
- EXPECT_EQ(*(ref2->str), "a");
- EXPECT_EQ(1u, ref2.index());
+ EXPECT_THAT(*ref_b, Eq("a"));
+ EXPECT_THAT(ref_b.index(), Eq(1u));
- EXPECT_EQ(*ref3, "m");
- EXPECT_EQ(2u, ref3.index());
+ EXPECT_THAT(*ref_c, Eq("m"));
+ EXPECT_THAT(ref_c.index(), Eq(2u));
- pool.Sort([](const StringPool::Entry& a, const StringPool::Entry& b) -> bool {
- return a.value < b.value;
- });
+ pool.Sort();
- EXPECT_EQ(*ref, "z");
- EXPECT_EQ(2u, ref.index());
+ EXPECT_THAT(*ref_a, Eq("z"));
+ EXPECT_THAT(ref_a.index(), Eq(2u));
- EXPECT_EQ(*(ref2->str), "a");
- EXPECT_EQ(0u, ref2.index());
+ EXPECT_THAT(*ref_b, Eq("a"));
+ EXPECT_THAT(ref_b.index(), Eq(0u));
- EXPECT_EQ(*ref3, "m");
- EXPECT_EQ(1u, ref3.index());
+ EXPECT_THAT(*ref_c, Eq("m"));
+ EXPECT_THAT(ref_c.index(), Eq(1u));
}
TEST(StringPoolTest, SortAndStillDedupe) {
StringPool pool;
- StringPool::Ref ref = pool.MakeRef("z");
- StringPool::Ref ref2 = pool.MakeRef("a");
- StringPool::Ref ref3 = pool.MakeRef("m");
+ StringPool::Ref ref_a = pool.MakeRef("z");
+ StringPool::Ref ref_b = pool.MakeRef("a");
+ StringPool::Ref ref_c = pool.MakeRef("m");
- pool.Sort([](const StringPool::Entry& a, const StringPool::Entry& b) -> bool {
- return a.value < b.value;
- });
+ pool.Sort();
- StringPool::Ref ref4 = pool.MakeRef("z");
- StringPool::Ref ref5 = pool.MakeRef("a");
- StringPool::Ref ref6 = pool.MakeRef("m");
+ StringPool::Ref ref_d = pool.MakeRef("z");
+ StringPool::Ref ref_e = pool.MakeRef("a");
+ StringPool::Ref ref_f = pool.MakeRef("m");
- EXPECT_EQ(ref4.index(), ref.index());
- EXPECT_EQ(ref5.index(), ref2.index());
- EXPECT_EQ(ref6.index(), ref3.index());
+ EXPECT_THAT(ref_d.index(), Eq(ref_a.index()));
+ EXPECT_THAT(ref_e.index(), Eq(ref_b.index()));
+ EXPECT_THAT(ref_f.index(), Eq(ref_c.index()));
}
TEST(StringPoolTest, AddStyles) {
StringPool pool;
- StyleString str{{"android"}, {Span{{"b"}, 2, 6}}};
-
- StringPool::StyleRef ref = pool.MakeRef(str);
-
- EXPECT_EQ(0u, ref.index());
- EXPECT_EQ(std::string("android"), *(ref->str));
- ASSERT_EQ(1u, ref->spans.size());
+ StringPool::StyleRef ref = pool.MakeRef(StyleString{{"android"}, {Span{{"b"}, 2, 6}}});
+ EXPECT_THAT(ref.index(), Eq(0u));
+ EXPECT_THAT(ref->value, Eq("android"));
+ ASSERT_THAT(ref->spans.size(), Eq(1u));
const StringPool::Span& span = ref->spans.front();
- EXPECT_EQ(*(span.name), "b");
- EXPECT_EQ(2u, span.first_char);
- EXPECT_EQ(6u, span.last_char);
+ EXPECT_THAT(*span.name, Eq("b"));
+ EXPECT_THAT(span.first_char, Eq(2u));
+ EXPECT_THAT(span.last_char, Eq(6u));
}
TEST(StringPoolTest, DoNotDedupeStyleWithSameStringAsNonStyle) {
@@ -163,9 +165,25 @@
StringPool::Ref ref = pool.MakeRef("android");
StyleString str{{"android"}};
- StringPool::StyleRef styleRef = pool.MakeRef(str);
+ StringPool::StyleRef style_ref = pool.MakeRef(StyleString{{"android"}});
- EXPECT_NE(ref.index(), styleRef.index());
+ EXPECT_THAT(ref.index(), Ne(style_ref.index()));
+}
+
+TEST(StringPoolTest, StylesAndStringsAreSeparateAfterSorting) {
+ StringPool pool;
+
+ StringPool::StyleRef ref_a = pool.MakeRef(StyleString{{"beta"}});
+ StringPool::Ref ref_b = pool.MakeRef("alpha");
+ StringPool::StyleRef ref_c = pool.MakeRef(StyleString{{"alpha"}});
+
+ EXPECT_THAT(ref_b.index(), Ne(ref_c.index()));
+
+ pool.Sort();
+
+ EXPECT_THAT(ref_c.index(), Eq(0u));
+ EXPECT_THAT(ref_a.index(), Eq(1u));
+ EXPECT_THAT(ref_b.index(), Eq(2u));
}
TEST(StringPoolTest, FlattenEmptyStringPoolUtf8) {
@@ -177,7 +195,7 @@
std::unique_ptr<uint8_t[]> data = util::Copy(buffer);
ResStringPool test;
- ASSERT_EQ(test.setTo(data.get(), buffer.size()), NO_ERROR);
+ ASSERT_THAT(test.setTo(data.get(), buffer.size()), Eq(NO_ERROR));
}
TEST(StringPoolTest, FlattenOddCharactersUtf16) {
@@ -193,9 +211,9 @@
ASSERT_EQ(test.setTo(data.get(), buffer.size()), NO_ERROR);
size_t len = 0;
const char16_t* str = test.stringAt(0, &len);
- EXPECT_EQ(1u, len);
- EXPECT_EQ(u'\u093f', *str);
- EXPECT_EQ(0u, str[1]);
+ EXPECT_THAT(len, Eq(1u));
+ EXPECT_THAT(str, Pointee(Eq(u'\u093f')));
+ EXPECT_THAT(str[1], Eq(0u));
}
constexpr const char* sLongString =
@@ -210,18 +228,20 @@
StringPool pool;
- StringPool::Ref ref1 = pool.MakeRef("hello");
- StringPool::Ref ref2 = pool.MakeRef("goodbye");
- StringPool::Ref ref3 = pool.MakeRef(sLongString);
- StringPool::Ref ref4 = pool.MakeRef("");
- StringPool::StyleRef ref5 = pool.MakeRef(
- StyleString{{"style"}, {Span{{"b"}, 0, 1}, Span{{"i"}, 2, 3}}});
+ StringPool::Ref ref_a = pool.MakeRef("hello");
+ StringPool::Ref ref_b = pool.MakeRef("goodbye");
+ StringPool::Ref ref_c = pool.MakeRef(sLongString);
+ StringPool::Ref ref_d = pool.MakeRef("");
+ StringPool::StyleRef ref_e =
+ pool.MakeRef(StyleString{{"style"}, {Span{{"b"}, 0, 1}, Span{{"i"}, 2, 3}}});
- EXPECT_EQ(0u, ref1.index());
- EXPECT_EQ(1u, ref2.index());
- EXPECT_EQ(2u, ref3.index());
- EXPECT_EQ(3u, ref4.index());
- EXPECT_EQ(4u, ref5.index());
+ // Styles are always first.
+ EXPECT_THAT(ref_e.index(), Eq(0u));
+
+ EXPECT_THAT(ref_a.index(), Eq(1u));
+ EXPECT_THAT(ref_b.index(), Eq(2u));
+ EXPECT_THAT(ref_c.index(), Eq(3u));
+ EXPECT_THAT(ref_d.index(), Eq(4u));
BigBuffer buffers[2] = {BigBuffer(1024), BigBuffer(1024)};
StringPool::FlattenUtf8(&buffers[0], pool);
@@ -234,38 +254,37 @@
ResStringPool test;
ASSERT_EQ(test.setTo(data.get(), buffer.size()), NO_ERROR);
- EXPECT_EQ(std::string("hello"), util::GetString(test, 0));
- EXPECT_EQ(StringPiece16(u"hello"), util::GetString16(test, 0));
+ EXPECT_THAT(util::GetString(test, 1), Eq("hello"));
+ EXPECT_THAT(util::GetString16(test, 1), Eq(u"hello"));
- EXPECT_EQ(std::string("goodbye"), util::GetString(test, 1));
- EXPECT_EQ(StringPiece16(u"goodbye"), util::GetString16(test, 1));
+ EXPECT_THAT(util::GetString(test, 2), Eq("goodbye"));
+ EXPECT_THAT(util::GetString16(test, 2), Eq(u"goodbye"));
- EXPECT_EQ(StringPiece(sLongString), util::GetString(test, 2));
- EXPECT_EQ(util::Utf8ToUtf16(sLongString), util::GetString16(test, 2).to_string());
+ EXPECT_THAT(util::GetString(test, 3), Eq(sLongString));
+ EXPECT_THAT(util::GetString16(test, 3), Eq(util::Utf8ToUtf16(sLongString)));
size_t len;
- EXPECT_TRUE(test.stringAt(3, &len) != nullptr ||
- test.string8At(3, &len) != nullptr);
+ EXPECT_TRUE(test.stringAt(4, &len) != nullptr || test.string8At(4, &len) != nullptr);
- EXPECT_EQ(std::string("style"), util::GetString(test, 4));
- EXPECT_EQ(StringPiece16(u"style"), util::GetString16(test, 4));
+ EXPECT_THAT(util::GetString(test, 0), Eq("style"));
+ EXPECT_THAT(util::GetString16(test, 0), Eq(u"style"));
- const ResStringPool_span* span = test.styleAt(4);
- ASSERT_NE(nullptr, span);
- EXPECT_EQ(std::string("b"), util::GetString(test, span->name.index));
- EXPECT_EQ(StringPiece16(u"b"), util::GetString16(test, span->name.index));
- EXPECT_EQ(0u, span->firstChar);
- EXPECT_EQ(1u, span->lastChar);
+ const ResStringPool_span* span = test.styleAt(0);
+ ASSERT_THAT(span, NotNull());
+ EXPECT_THAT(util::GetString(test, span->name.index), Eq("b"));
+ EXPECT_THAT(util::GetString16(test, span->name.index), Eq(u"b"));
+ EXPECT_THAT(span->firstChar, Eq(0u));
+ EXPECT_THAT(span->lastChar, Eq(1u));
span++;
- ASSERT_NE(ResStringPool_span::END, span->name.index);
- EXPECT_EQ(std::string("i"), util::GetString(test, span->name.index));
- EXPECT_EQ(StringPiece16(u"i"), util::GetString16(test, span->name.index));
- EXPECT_EQ(2u, span->firstChar);
- EXPECT_EQ(3u, span->lastChar);
+ ASSERT_THAT(span->name.index, Ne(ResStringPool_span::END));
+ EXPECT_THAT(util::GetString(test, span->name.index), Eq("i"));
+ EXPECT_THAT(util::GetString16(test, span->name.index), Eq(u"i"));
+ EXPECT_THAT(span->firstChar, Eq(2u));
+ EXPECT_THAT(span->lastChar, Eq(3u));
span++;
- EXPECT_EQ(ResStringPool_span::END, span->name.index);
+ EXPECT_THAT(span->name.index, Eq(ResStringPool_span::END));
}
}
diff --git a/tools/aapt2/cmd/Util.cpp b/tools/aapt2/cmd/Util.cpp
index 8741b7b..e1c45d6 100644
--- a/tools/aapt2/cmd/Util.cpp
+++ b/tools/aapt2/cmd/Util.cpp
@@ -179,6 +179,13 @@
xml::Attribute{"", "configForSplit", app_info.split_name.value()});
}
+ // Splits may contain more configurations than originally desired (fallback densities, etc.).
+ // This makes programmatic discovery of split targetting difficult. Encode the original
+ // split constraints intended for this split.
+ std::stringstream target_config_str;
+ target_config_str << util::Joiner(constraints.configs, ",");
+ manifest_el->attributes.push_back(xml::Attribute{"", "targetConfig", target_config_str.str()});
+
std::unique_ptr<xml::Element> application_el = util::make_unique<xml::Element>();
application_el->name = "application";
application_el->attributes.push_back(
diff --git a/tools/aapt2/compile/PseudolocaleGenerator.cpp b/tools/aapt2/compile/PseudolocaleGenerator.cpp
index a031ea4..871ed4f 100644
--- a/tools/aapt2/compile/PseudolocaleGenerator.cpp
+++ b/tools/aapt2/compile/PseudolocaleGenerator.cpp
@@ -120,7 +120,7 @@
// All Span indices are UTF-16 based, according to the resources.arsc format expected by the
// runtime. So we will do all our processing in UTF-16, then convert back.
- const std::u16string text16 = util::Utf8ToUtf16(*string->value->str);
+ const std::u16string text16 = util::Utf8ToUtf16(string->value->value);
// Convenient wrapper around the text that allows us to work with StringPieces.
const StringPiece16 text(text16);
diff --git a/tools/aapt2/compile/PseudolocaleGenerator_test.cpp b/tools/aapt2/compile/PseudolocaleGenerator_test.cpp
index b08e1da..711558a 100644
--- a/tools/aapt2/compile/PseudolocaleGenerator_test.cpp
+++ b/tools/aapt2/compile/PseudolocaleGenerator_test.cpp
@@ -31,7 +31,7 @@
util::make_unique<StyledString>(pool.MakeRef(original_style)).get(),
Pseudolocalizer::Method::kNone, &pool);
- EXPECT_EQ(original_style.str, *new_string->value->str);
+ EXPECT_EQ(original_style.str, new_string->value->value);
ASSERT_EQ(original_style.spans.size(), new_string->value->spans.size());
EXPECT_EQ(std::string("i"), *new_string->value->spans[0].name);
@@ -52,7 +52,7 @@
util::make_unique<StyledString>(pool.MakeRef(original_style)).get(),
Pseudolocalizer::Method::kAccent, &pool);
- EXPECT_EQ(std::string("[Ĥéļļö ŵöŕļð¡ one two]"), *new_string->value->str);
+ EXPECT_EQ(std::string("[Ĥéļļö ŵöŕļð¡ one two]"), new_string->value->value);
ASSERT_EQ(original_style.spans.size(), new_string->value->spans.size());
EXPECT_EQ(std::u16string(u"[").size(), new_string->value->spans[0].first_char);
@@ -79,7 +79,7 @@
Pseudolocalizer::Method::kAccent, &pool);
ASSERT_NE(nullptr, new_string);
ASSERT_EQ(2u, new_string->value->spans.size());
- EXPECT_EQ(std::string("[ɓöļð one]"), *new_string->value->str);
+ EXPECT_EQ(std::string("[ɓöļð one]"), new_string->value->value);
EXPECT_EQ(std::string("b"), *new_string->value->spans[0].name);
EXPECT_EQ(std::u16string(u"[").size(), new_string->value->spans[0].first_char);
@@ -101,7 +101,7 @@
Pseudolocalizer::Method::kAccent, &pool);
ASSERT_NE(nullptr, new_string);
ASSERT_EQ(2u, new_string->value->spans.size());
- EXPECT_EQ(std::string("[ɓöļð one]"), *new_string->value->str);
+ EXPECT_EQ(std::string("[ɓöļð one]"), new_string->value->value);
EXPECT_EQ(std::string("b"), *new_string->value->spans[0].name);
EXPECT_EQ(std::u16string(u"[").size(), new_string->value->spans[0].first_char);
@@ -126,7 +126,7 @@
ASSERT_EQ(4u, new_string->value->spans.size());
EXPECT_EQ(std::string(
"[Ţĥîš šéñţéñçé îš ñöţ ŵĥåţ ýöû ţĥîñķ îţ îš åţ åļļ. one two three four five six]"),
- *new_string->value->str);
+ new_string->value->value);
EXPECT_EQ(std::string("b"), *new_string->value->spans[0].name);
EXPECT_EQ(std::u16string(u"[Ţĥîš šéñţéñçé îš").size(), new_string->value->spans[0].first_char);
@@ -165,7 +165,7 @@
ASSERT_NE(nullptr, new_string);
ASSERT_EQ(2u, new_string->value->spans.size());
EXPECT_EQ(std::string("[Ţĥîš šĥöûļð NOT ɓé þšéûðöļöçåļîžéð. one two three four]"),
- *new_string->value->str);
+ new_string->value->value);
EXPECT_EQ(std::string("em"), *new_string->value->spans[0].name);
EXPECT_EQ(std::u16string(u"[Ţĥîš").size(), new_string->value->spans[0].first_char);
@@ -265,7 +265,7 @@
ASSERT_NE(nullptr, new_styled_string);
// "world" should be untranslated.
- EXPECT_NE(std::string::npos, new_styled_string->value->str->find("world"));
+ EXPECT_NE(std::string::npos, new_styled_string->value->value.find("world"));
String* new_string = test::GetValueForConfig<String>(table.get(), "android:string/bar",
test::ParseConfigOrDie("en-rXA"));
diff --git a/tools/aapt2/flatten/TableFlattener.cpp b/tools/aapt2/flatten/TableFlattener.cpp
index f4d0226..e5993a6 100644
--- a/tools/aapt2/flatten/TableFlattener.cpp
+++ b/tools/aapt2/flatten/TableFlattener.cpp
@@ -557,19 +557,15 @@
} // namespace
bool TableFlattener::Consume(IAaptContext* context, ResourceTable* table) {
- // We must do this before writing the resources, since the string pool IDs may
- // change.
- table->string_pool.Sort(
- [](const StringPool::Entry& a, const StringPool::Entry& b) -> bool {
- int diff = a.context.priority - b.context.priority;
- if (diff < 0) return true;
- if (diff > 0) return false;
- diff = a.context.config.compare(b.context.config);
- if (diff < 0) return true;
- if (diff > 0) return false;
- return a.value < b.value;
- });
+ // We must do this before writing the resources, since the string pool IDs may change.
table->string_pool.Prune();
+ table->string_pool.Sort([](const StringPool::Context& a, const StringPool::Context& b) -> int {
+ int diff = util::compare(a.priority, b.priority);
+ if (diff == 0) {
+ diff = a.config.compare(b.config);
+ }
+ return diff;
+ });
// Write the ResTable header.
ChunkWriter table_writer(buffer_);
diff --git a/tools/aapt2/flatten/XmlFlattener.cpp b/tools/aapt2/flatten/XmlFlattener.cpp
index bfebedef..331ef78 100644
--- a/tools/aapt2/flatten/XmlFlattener.cpp
+++ b/tools/aapt2/flatten/XmlFlattener.cpp
@@ -180,8 +180,7 @@
flatNode->lineNumber = util::HostToDevice32(node->line_number);
flatNode->comment.index = util::HostToDevice32(-1);
- ResXMLTree_namespaceExt* flat_ns =
- writer.NextBlock<ResXMLTree_namespaceExt>();
+ ResXMLTree_namespaceExt* flat_ns = writer.NextBlock<ResXMLTree_namespaceExt>();
AddString(node->namespace_prefix, kLowPriority, &flat_ns->prefix);
AddString(node->namespace_uri, kLowPriority, &flat_ns->uri);
@@ -289,8 +288,7 @@
BigBuffer* buffer_;
XmlFlattenerOptions options_;
- // Scratch vector to filter attributes. We avoid allocations
- // making this a member.
+ // Scratch vector to filter attributes. We avoid allocations making this a member.
std::vector<xml::Attribute*> filtered_attrs_;
};
@@ -307,10 +305,9 @@
}
// Sort the string pool so that attribute resource IDs show up first.
- visitor.pool.Sort(
- [](const StringPool::Entry& a, const StringPool::Entry& b) -> bool {
- return a.context.priority < b.context.priority;
- });
+ visitor.pool.Sort([](const StringPool::Context& a, const StringPool::Context& b) -> int {
+ return util::compare(a.priority, b.priority);
+ });
// Now we flatten the string pool references into the correct places.
for (const auto& ref_entry : visitor.string_refs) {
@@ -328,15 +325,13 @@
// Write the array of resource IDs, indexed by StringPool order.
ChunkWriter res_id_map_writer(buffer_);
res_id_map_writer.StartChunk<ResChunk_header>(RES_XML_RESOURCE_MAP_TYPE);
- for (const auto& str : visitor.pool) {
- ResourceId id = {str->context.priority};
- if (id.id == kLowPriority || !id.is_valid()) {
- // When we see the first non-resource ID,
- // we're done.
+ for (const auto& str : visitor.pool.strings()) {
+ ResourceId id(str->context.priority);
+ if (str->context.priority == kLowPriority || !id.is_valid()) {
+ // When we see the first non-resource ID, we're done.
break;
}
-
- *res_id_map_writer.NextBlock<uint32_t>() = id.id;
+ *res_id_map_writer.NextBlock<uint32_t>() = util::HostToDevice32(id.id);
}
res_id_map_writer.Finish();
}
diff --git a/tools/aapt2/proto/ProtoHelpers.cpp b/tools/aapt2/proto/ProtoHelpers.cpp
index 38bf4e3..6b21364 100644
--- a/tools/aapt2/proto/ProtoHelpers.cpp
+++ b/tools/aapt2/proto/ProtoHelpers.cpp
@@ -18,8 +18,7 @@
namespace aapt {
-void SerializeStringPoolToPb(const StringPool& pool,
- pb::StringPool* out_pb_pool) {
+void SerializeStringPoolToPb(const StringPool& pool, pb::StringPool* out_pb_pool) {
BigBuffer buffer(1024);
StringPool::FlattenUtf8(&buffer, pool);
@@ -28,14 +27,12 @@
size_t offset = 0;
for (const BigBuffer::Block& block : buffer) {
- data->insert(data->begin() + offset, block.buffer.get(),
- block.buffer.get() + block.size);
+ data->insert(data->begin() + offset, block.buffer.get(), block.buffer.get() + block.size);
offset += block.size;
}
}
-void SerializeSourceToPb(const Source& source, StringPool* src_pool,
- pb::Source* out_pb_source) {
+void SerializeSourceToPb(const Source& source, StringPool* src_pool, pb::Source* out_pb_source) {
StringPool::Ref ref = src_pool->MakeRef(source.path);
out_pb_source->set_path_idx(static_cast<uint32_t>(ref.index()));
if (source.line) {
@@ -43,8 +40,7 @@
}
}
-void DeserializeSourceFromPb(const pb::Source& pb_source,
- const android::ResStringPool& src_pool,
+void DeserializeSourceFromPb(const pb::Source& pb_source, const android::ResStringPool& src_pool,
Source* out_source) {
if (pb_source.has_path_idx()) {
out_source->path = util::GetString(src_pool, pb_source.path_idx());
@@ -80,8 +76,7 @@
return SymbolState::kUndefined;
}
-void SerializeConfig(const ConfigDescription& config,
- pb::ConfigDescription* out_pb_config) {
+void SerializeConfig(const ConfigDescription& config, pb::ConfigDescription* out_pb_config) {
android::ResTable_config flat_config = config;
flat_config.size = sizeof(flat_config);
flat_config.swapHtoD();
@@ -99,8 +94,7 @@
return false;
}
- config = reinterpret_cast<const android::ResTable_config*>(
- pb_config.data().data());
+ config = reinterpret_cast<const android::ResTable_config*>(pb_config.data().data());
out_config->copyFromDtoH(*config);
return true;
}
diff --git a/tools/aapt2/proto/TableProtoDeserializer.cpp b/tools/aapt2/proto/TableProtoDeserializer.cpp
index 4b56192..37d5ed0 100644
--- a/tools/aapt2/proto/TableProtoDeserializer.cpp
+++ b/tools/aapt2/proto/TableProtoDeserializer.cpp
@@ -195,8 +195,7 @@
spans++;
}
return util::make_unique<StyledString>(pool->MakeRef(
- style_str,
- StringPool::Context(StringPool::Context::kStylePriority, config)));
+ style_str, StringPool::Context(StringPool::Context::kNormalPriority, config)));
}
return util::make_unique<String>(
pool->MakeRef(str, StringPool::Context(config)));
diff --git a/tools/aapt2/proto/TableProtoSerializer.cpp b/tools/aapt2/proto/TableProtoSerializer.cpp
index d87d64e..730442c 100644
--- a/tools/aapt2/proto/TableProtoSerializer.cpp
+++ b/tools/aapt2/proto/TableProtoSerializer.cpp
@@ -87,7 +87,9 @@
pb_prim->set_data(val.data);
}
- void VisitItem(Item* item) override { LOG(FATAL) << "unimplemented item"; }
+ void VisitItem(Item* item) override {
+ LOG(FATAL) << "unimplemented item";
+ }
void Visit(Attribute* attr) override {
pb::Attribute* pb_attr = pb_compound_value()->mutable_attr();
@@ -207,19 +209,15 @@
} // namespace
std::unique_ptr<pb::ResourceTable> SerializeTableToPb(ResourceTable* table) {
- // We must do this before writing the resources, since the string pool IDs may
- // change.
- table->string_pool.Sort(
- [](const StringPool::Entry& a, const StringPool::Entry& b) -> bool {
- int diff = a.context.priority - b.context.priority;
- if (diff < 0) return true;
- if (diff > 0) return false;
- diff = a.context.config.compare(b.context.config);
- if (diff < 0) return true;
- if (diff > 0) return false;
- return a.value < b.value;
- });
+ // We must do this before writing the resources, since the string pool IDs may change.
table->string_pool.Prune();
+ table->string_pool.Sort([](const StringPool::Context& a, const StringPool::Context& b) -> int {
+ int diff = util::compare(a.priority, b.priority);
+ if (diff == 0) {
+ diff = a.config.compare(b.config);
+ }
+ return diff;
+ });
auto pb_table = util::make_unique<pb::ResourceTable>();
SerializeStringPoolToPb(table->string_pool, pb_table->mutable_string_pool());
diff --git a/tools/aapt2/unflatten/BinaryResourceParser.cpp b/tools/aapt2/unflatten/BinaryResourceParser.cpp
index f311670..728d1f4 100644
--- a/tools/aapt2/unflatten/BinaryResourceParser.cpp
+++ b/tools/aapt2/unflatten/BinaryResourceParser.cpp
@@ -38,20 +38,17 @@
using namespace android;
-using android::base::StringPrintf;
+using ::android::base::StringPrintf;
namespace {
-/*
- * Visitor that converts a reference's resource ID to a resource name,
- * given a mapping from resource ID to resource name.
- */
+// Visitor that converts a reference's resource ID to a resource name, given a mapping from
+// resource ID to resource name.
class ReferenceIdToNameVisitor : public ValueVisitor {
public:
using ValueVisitor::Visit;
- explicit ReferenceIdToNameVisitor(
- const std::map<ResourceId, ResourceName>* mapping)
+ explicit ReferenceIdToNameVisitor(const std::map<ResourceId, ResourceName>* mapping)
: mapping_(mapping) {
CHECK(mapping_ != nullptr);
}
@@ -99,7 +96,7 @@
if (parser.chunk()->type != android::RES_TABLE_TYPE) {
context_->GetDiagnostics()->Error(DiagMessage(source_)
<< StringPrintf("unknown chunk of type 0x%02x",
- (int)parser.chunk()->type));
+ static_cast<int>(parser.chunk()->type)));
return false;
}
@@ -115,7 +112,7 @@
context_->GetDiagnostics()->Warn(
DiagMessage(source_) << StringPrintf(
"unexpected chunk of type 0x%02x trailing RES_TABLE_TYPE",
- (int)parser.chunk()->type));
+ static_cast<int>(parser.chunk()->type)));
}
}
return true;
@@ -165,9 +162,8 @@
default:
context_->GetDiagnostics()->Warn(
- DiagMessage(source_)
- << "unexpected chunk type "
- << (int)util::DeviceToHost16(parser.chunk()->type));
+ DiagMessage(source_) << "unexpected chunk type "
+ << static_cast<int>(util::DeviceToHost16(parser.chunk()->type)));
break;
}
}
@@ -245,8 +241,7 @@
return false;
}
} else {
- context_->GetDiagnostics()->Warn(DiagMessage(source_)
- << "unexpected string pool");
+ context_->GetDiagnostics()->Warn(DiagMessage(source_) << "unexpected string pool");
}
break;
@@ -270,9 +265,8 @@
default:
context_->GetDiagnostics()->Warn(
- DiagMessage(source_)
- << "unexpected chunk type "
- << (int)util::DeviceToHost16(parser.chunk()->type));
+ DiagMessage(source_) << "unexpected chunk type "
+ << static_cast<int>(util::DeviceToHost16(parser.chunk()->type)));
break;
}
}
diff --git a/tools/aapt2/util/Util.h b/tools/aapt2/util/Util.h
index b9ada77..ad3989e 100644
--- a/tools/aapt2/util/Util.h
+++ b/tools/aapt2/util/Util.h
@@ -70,12 +70,6 @@
android::StringPiece TrimWhitespace(const android::StringPiece& str);
/**
- * UTF-16 isspace(). It basically checks for lower range characters that are
- * whitespace.
- */
-inline bool isspace16(char16_t c) { return c < 0x0080 && isspace(c); }
-
-/**
* Returns an iterator to the first character that is not alpha-numeric and that
* is not in the allowedChars set.
*/
@@ -104,6 +98,16 @@
Maybe<std::string> GetFullyQualifiedClassName(const android::StringPiece& package,
const android::StringPiece& class_name);
+template <typename T>
+typename std::enable_if<std::is_arithmetic<T>::value, int>::type compare(const T& a, const T& b) {
+ if (a < b) {
+ return -1;
+ } else if (a > b) {
+ return 1;
+ }
+ return 0;
+}
+
/**
* Makes a std::unique_ptr<> with the template parameter inferred by the compiler.
* This will be present in C++14 and can be removed then.