Merge "Change ConvertWithBp2build signature" into main
diff --git a/AconfigFlags.bp b/AconfigFlags.bp
index 3fea8fc..55f5436 100644
--- a/AconfigFlags.bp
+++ b/AconfigFlags.bp
@@ -18,6 +18,7 @@
// Add java_aconfig_libraries to here to add them to the core framework
srcs: [
+ ":android.os.flags-aconfig-java{.generated_srcjars}",
":android.security.flags-aconfig-java{.generated_srcjars}",
":com.android.hardware.camera2-aconfig-java{.generated_srcjars}",
":com.android.window.flags.window-aconfig-java{.generated_srcjars}",
@@ -88,6 +89,19 @@
defaults: ["framework-minus-apex-aconfig-java-defaults"],
}
+// OS
+aconfig_declarations {
+ name: "android.os.flags-aconfig",
+ package: "android.os",
+ srcs: ["core/java/android/os/*.aconfig"],
+}
+
+java_aconfig_library {
+ name: "android.os.flags-aconfig-java",
+ aconfig_declarations: "android.os.flags-aconfig",
+ defaults: ["framework-minus-apex-aconfig-java-defaults"],
+}
+
// Security
aconfig_declarations {
name: "android.security.flags-aconfig",
diff --git a/OWNERS b/OWNERS
index 6c25324..4e5c7d8 100644
--- a/OWNERS
+++ b/OWNERS
@@ -28,7 +28,7 @@
# Support bulk translation updates
per-file */res*/values*/*.xml = byi@google.com, delphij@google.com
-per-file **.bp,**.mk = hansson@google.com, joeo@google.com
+per-file **.bp,**.mk = hansson@google.com, joeo@google.com, lamontjones@google.com
per-file TestProtoLibraries.bp = file:platform/platform_testing:/libraries/health/OWNERS
per-file TestProtoLibraries.bp = file:platform/tools/tradefederation:/OWNERS
diff --git a/api/gen_combined_removed_dex.sh b/api/gen_combined_removed_dex.sh
index 9225fe8..71f366a 100755
--- a/api/gen_combined_removed_dex.sh
+++ b/api/gen_combined_removed_dex.sh
@@ -6,6 +6,6 @@
# Convert each removed.txt to the "dex format" equivalent, and print all output.
for f in "$@"; do
- "$metalava_path" --no-banner "$f" --dex-api "${tmp_dir}/tmp"
+ "$metalava_path" "$f" --dex-api "${tmp_dir}/tmp"
cat "${tmp_dir}/tmp"
done
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp
index fadf82a..0ed47e7 100644
--- a/cmds/bootanimation/BootAnimation.cpp
+++ b/cmds/bootanimation/BootAnimation.cpp
@@ -1790,7 +1790,7 @@
fn.c_str());
return nullptr;
}
- ZipFileRO *zip = ZipFileRO::open(fn);
+ ZipFileRO *zip = ZipFileRO::open(fn.c_str());
if (zip == nullptr) {
SLOGE("Failed to open animation zip \"%s\": %s",
fn.c_str(), strerror(errno));
diff --git a/cmds/idmap2/idmap2/Lookup.cpp b/cmds/idmap2/idmap2/Lookup.cpp
index f41e57c..0862fbe 100644
--- a/cmds/idmap2/idmap2/Lookup.cpp
+++ b/cmds/idmap2/idmap2/Lookup.cpp
@@ -94,7 +94,7 @@
const ResStringPool* pool = am->GetStringPoolForCookie(value.cookie);
out->append("\"");
if (auto str = pool->string8ObjectAt(value.data); str.ok()) {
- out->append(*str);
+ out->append(str->c_str());
}
} break;
default:
diff --git a/cmds/incidentd/src/IncidentService.cpp b/cmds/incidentd/src/IncidentService.cpp
index 53c7b74..82c8707 100644
--- a/cmds/incidentd/src/IncidentService.cpp
+++ b/cmds/incidentd/src/IncidentService.cpp
@@ -563,7 +563,7 @@
fprintf(out, "Not enough arguments for section\n");
return NO_ERROR;
}
- int id = atoi(args[1]);
+ int id = atoi(args[1].c_str());
int idx = 0;
while (SECTION_LIST[idx] != NULL) {
const Section* section = SECTION_LIST[idx];
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 26c72f0..c1c2788 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -2976,6 +2976,7 @@
field public static final String SYSTEM_CONFIG_SERVICE = "system_config";
field public static final String SYSTEM_UPDATE_SERVICE = "system_update";
field public static final String TETHERING_SERVICE = "tethering";
+ field public static final String THREAD_NETWORK_SERVICE = "thread_network";
field public static final String TRANSLATION_MANAGER_SERVICE = "translation";
field public static final String UI_TRANSLATION_SERVICE = "ui_translation";
field public static final String UWB_SERVICE = "uwb";
diff --git a/core/java/Android.bp b/core/java/Android.bp
index 5d7d7ba..da6a6d4 100644
--- a/core/java/Android.bp
+++ b/core/java/Android.bp
@@ -9,6 +9,11 @@
default_applicable_licenses: ["frameworks_base_license"],
}
+aidl_library {
+ name: "HardwareBuffer_aidl",
+ hdrs: ["android/hardware/HardwareBuffer.aidl"],
+}
+
filegroup {
name: "framework-core-sources",
srcs: [
diff --git a/core/java/android/app/KeyguardManager.java b/core/java/android/app/KeyguardManager.java
index c802d20..efbdd7e 100644
--- a/core/java/android/app/KeyguardManager.java
+++ b/core/java/android/app/KeyguardManager.java
@@ -48,7 +48,6 @@
import android.util.Log;
import android.view.IOnKeyguardExitResult;
import android.view.IWindowManager;
-import android.view.WindowManager.LayoutParams;
import android.view.WindowManagerGlobal;
import com.android.internal.policy.IKeyguardDismissCallback;
@@ -68,9 +67,7 @@
import java.util.concurrent.Executor;
/**
- * Class that can be used to lock and unlock the keyguard. The
- * actual class to control the keyguard locking is
- * {@link android.app.KeyguardManager.KeyguardLock}.
+ * Class to manage and query the state of the lock screen (also known as Keyguard).
*/
@SystemService(Context.KEYGUARD_SERVICE)
public class KeyguardManager {
@@ -204,7 +201,9 @@
* {@link android.app.Activity#RESULT_OK} if the user successfully completes the challenge.
*
* @return the intent for launching the activity or null if no password is required.
- * @deprecated see BiometricPrompt.Builder#setDeviceCredentialAllowed(boolean)
+ *
+ * @deprecated see {@link
+ * android.hardware.biometrics.BiometricPrompt.Builder#setAllowedAuthenticators(int)}
*/
@Deprecated
@RequiresFeature(PackageManager.FEATURE_SECURE_LOCK_SCREEN)
@@ -383,13 +382,12 @@
/**
* Handle returned by {@link KeyguardManager#newKeyguardLock} that allows
- * you to disable / reenable the keyguard.
+ * you to temporarily disable / reenable the keyguard (lock screen).
*
- * @deprecated Use {@link LayoutParams#FLAG_DISMISS_KEYGUARD}
- * and/or {@link LayoutParams#FLAG_SHOW_WHEN_LOCKED}
- * instead; this allows you to seamlessly hide the keyguard as your application
- * moves in and out of the foreground and does not require that any special
- * permissions be requested.
+ * @deprecated Use {@link android.R.attr#showWhenLocked} or {@link
+ * android.app.Activity#setShowWhenLocked(boolean)} instead. This allows you to seamlessly
+ * occlude and unocclude the keyguard as your application moves in and out of the foreground
+ * and does not require that any special permissions be requested.
*/
@Deprecated
public class KeyguardLock {
@@ -404,12 +402,12 @@
* Disable the keyguard from showing. If the keyguard is currently
* showing, hide it. The keyguard will be prevented from showing again
* until {@link #reenableKeyguard()} is called.
- *
+ * <p>
+ * This only works if the keyguard is not secure.
+ * <p>
* A good place to call this is from {@link android.app.Activity#onResume()}
*
- * Note: This call has no effect while any {@link android.app.admin.DevicePolicyManager}
- * is enabled that requires a password.
- *
+ * @see KeyguardManager#isKeyguardSecure()
* @see #reenableKeyguard()
*/
@RequiresPermission(Manifest.permission.DISABLE_KEYGUARD)
@@ -426,9 +424,6 @@
*
* A good place to call this is from {@link android.app.Activity#onPause()}
*
- * Note: This call has no effect while any {@link android.app.admin.DevicePolicyManager}
- * is enabled that requires a password.
- *
* @see #disableKeyguard()
*/
@RequiresPermission(Manifest.permission.DISABLE_KEYGUARD)
@@ -527,20 +522,18 @@
}
/**
- * Enables you to lock or unlock the keyguard. Get an instance of this class by
- * calling {@link android.content.Context#getSystemService(java.lang.String) Context.getSystemService()}.
- * This class is wrapped by {@link android.app.KeyguardManager KeyguardManager}.
+ * Enables you to temporarily disable / reenable the keyguard (lock screen).
+ *
* @param tag A tag that informally identifies who you are (for debugging who
* is disabling the keyguard).
*
* @return A {@link KeyguardLock} handle to use to disable and reenable the
* keyguard.
*
- * @deprecated Use {@link LayoutParams#FLAG_DISMISS_KEYGUARD}
- * and/or {@link LayoutParams#FLAG_SHOW_WHEN_LOCKED}
- * instead; this allows you to seamlessly hide the keyguard as your application
- * moves in and out of the foreground and does not require that any special
- * permissions be requested.
+ * @deprecated Use {@link android.R.attr#showWhenLocked} or {@link
+ * android.app.Activity#setShowWhenLocked(boolean)} instead. This allows you to seamlessly
+ * occlude and unocclude the keyguard as your application moves in and out of the foreground
+ * and does not require that any special permissions be requested.
*/
@Deprecated
public KeyguardLock newKeyguardLock(String tag) {
@@ -548,9 +541,36 @@
}
/**
- * Return whether the keyguard is currently locked.
+ * Returns whether the lock screen (also known as Keyguard) is showing.
+ * <p>
+ * Specifically, this returns {@code true} in the following cases:
+ * <ul>
+ * <li>The lock screen is showing in the foreground.</li>
+ * <li>The lock screen is showing, but it is occluded by an activity that is showing on top of
+ * it. A common example is the phone app receiving a call or making an emergency call.</li>
+ * <li>The lock screen was showing but is temporarily disabled as a result of <a
+ * href="https://developer.android.com/work/dpc/dedicated-devices/lock-task-mode">lock task
+ * mode</a> or an app using the deprecated {@link KeyguardLock} API.</li>
+ * </ul>
+ * <p>
+ * "Showing" refers to a logical state of the UI, regardless of whether the screen happens to be
+ * on. When the power button is pressed on an unlocked device, the lock screen starts "showing"
+ * immediately when the screen turns off.
+ * <p>
+ * This method does not distinguish a lock screen that is requiring authentication (e.g. with
+ * PIN, pattern, password, or biometric) from a lock screen that is trivially dismissible (e.g.
+ * with swipe). It also does not distinguish a lock screen requesting a SIM card PIN from a
+ * normal device lock screen. Finally, it always returns the global lock screen state and does
+ * not consider the {@link Context}'s user specifically.
+ * <p>
+ * Note that {@code isKeyguardLocked()} is confusingly named and probably should be called
+ * {@code isKeyguardShowing()}. On many devices, the lock screen displays an <i>unlocked</i>
+ * padlock icon when it is trivially dismissible. As mentioned above, {@code isKeyguardLocked()}
+ * actually returns {@code true} in this case, not {@code false} as might be expected. {@link
+ * #isDeviceLocked()} is an alternative API that has slightly different semantics.
*
- * @return {@code true} if the keyguard is locked.
+ * @return {@code true} if the lock screen is showing
+ * @see #isDeviceLocked()
*/
public boolean isKeyguardLocked() {
try {
@@ -561,12 +581,23 @@
}
/**
- * Return whether the keyguard is secured by a PIN, pattern or password or a SIM card
- * is currently locked.
+ * Returns whether the user has a secure lock screen or there is a locked SIM card.
+ * <p>
+ * Specifically, this returns {@code true} if at least one of the following is true:
+ * <ul>
+ * <li>The {@link Context}'s user has a secure lock screen. A full user has a secure lock
+ * screen if its lock screen is set to PIN, pattern, or password, as opposed to swipe or none.
+ * A profile that uses a unified challenge is considered to have a secure lock screen if and
+ * only if its parent user has a secure lock screen.</li>
+ * <li>At least one SIM card is currently locked and requires a PIN.</li>
+ * </ul>
+ * <p>
+ * This method does not consider whether the lock screen is currently showing or not.
+ * <p>
+ * See also {@link #isDeviceSecure()} which excludes locked SIM cards.
*
- * <p>See also {@link #isDeviceSecure()} which ignores SIM locked states.
- *
- * @return {@code true} if a PIN, pattern or password is set or a SIM card is locked.
+ * @return {@code true} if the user has a secure lock screen or there is a locked SIM card
+ * @see #isDeviceSecure()
*/
public boolean isKeyguardSecure() {
try {
@@ -577,11 +608,11 @@
}
/**
- * If keyguard screen is showing or in restricted key input mode (i.e. in
- * keyguard password emergency screen). When in such mode, certain keys,
- * such as the Home key and the right soft keys, don't work.
+ * Returns whether the lock screen is showing.
+ * <p>
+ * This is exactly the same as {@link #isKeyguardLocked()}.
*
- * @return {@code true} if in keyguard restricted input mode.
+ * @return the value of {@link #isKeyguardLocked()}
* @deprecated Use {@link #isKeyguardLocked()} instead.
*/
public boolean inKeyguardRestrictedInputMode() {
@@ -589,11 +620,26 @@
}
/**
- * Returns whether the device is currently locked and requires a PIN, pattern or
- * password to unlock.
+ * Returns whether the device is currently locked for the user.
+ * <p>
+ * This returns the device locked state for the {@link Context}'s user. If this user is the
+ * current user, then the device is considered "locked" when the lock screen is showing (i.e.
+ * {@link #isKeyguardLocked()} returns {@code true}) and is not trivially dismissible (e.g. with
+ * swipe), and the user has a PIN, pattern, or password.
+ * <p>
+ * Note: the above definition implies that a user with no PIN, pattern, or password is never
+ * considered locked, even if the lock screen is showing and requesting a SIM card PIN. The
+ * device PIN and SIM PIN are separate. Also, the user is not considered locked if face
+ * authentication has just completed or a trust agent is keeping the device unlocked, since in
+ * these cases the lock screen is dismissible with swipe.
+ * <p>
+ * For a user that is not the current user but can be switched to (usually this means "another
+ * full user"), and that has a PIN, pattern, or password, the device is always considered
+ * locked. For a profile with a unified challenge, the device is considered locked if and only
+ * if the device is locked for the parent user.
*
- * @return {@code true} if unlocking the device currently requires a PIN, pattern or
- * password.
+ * @return {@code true} if the device is currently locked for the user
+ * @see #isKeyguardLocked()
*/
public boolean isDeviceLocked() {
return isDeviceLocked(mContext.getUserId());
@@ -614,12 +660,19 @@
}
/**
- * Returns whether the device is secured with a PIN, pattern or
- * password.
+ * Returns whether the user has a secure lock screen.
+ * <p>
+ * This returns {@code true} if the {@link Context}'s user has a secure lock screen. A full user
+ * has a secure lock screen if its lock screen is set to PIN, pattern, or password, as opposed
+ * to swipe or none. A profile that uses a unified challenge is considered to have a secure lock
+ * screen if and only if its parent user has a secure lock screen.
+ * <p>
+ * This method does not consider whether the lock screen is currently showing or not.
+ * <p>
+ * See also {@link #isKeyguardSecure()} which includes locked SIM cards.
*
- * <p>See also {@link #isKeyguardSecure} which treats SIM locked states as secure.
- *
- * @return {@code true} if a PIN, pattern or password was set.
+ * @return {@code true} if the user has a secure lock screen
+ * @see #isKeyguardSecure()
*/
public boolean isDeviceSecure() {
return isDeviceSecure(mContext.getUserId());
@@ -640,8 +693,7 @@
}
/**
- * If the device is currently locked (see {@link #isKeyguardLocked()}, requests the Keyguard to
- * be dismissed.
+ * Requests that the Keyguard (lock screen) be dismissed if it is currently showing.
* <p>
* If the Keyguard is not secure or the device is currently in a trusted state, calling this
* method will immediately dismiss the Keyguard without any user interaction.
@@ -652,8 +704,9 @@
* If the value set for the {@link Activity} attr {@link android.R.attr#turnScreenOn} is true,
* the screen will turn on when the keyguard is dismissed.
*
- * @param activity The activity requesting the dismissal. The activity must be either visible
- * by using {@link LayoutParams#FLAG_SHOW_WHEN_LOCKED} or must be in a state in
+ * @param activity The activity requesting the dismissal. The activity must either be visible
+ * by using {@link android.R.attr#showWhenLocked} or {@link
+ * android.app.Activity#setShowWhenLocked(boolean)}, or must be in a state in
* which it would be visible if Keyguard would not be hiding it. If that's not
* the case, the request will fail immediately and
* {@link KeyguardDismissCallback#onDismissError} will be invoked.
@@ -668,8 +721,7 @@
}
/**
- * If the device is currently locked (see {@link #isKeyguardLocked()}, requests the Keyguard to
- * be dismissed.
+ * Requests that the Keyguard (lock screen) be dismissed if it is currently showing.
* <p>
* If the Keyguard is not secure or the device is currently in a trusted state, calling this
* method will immediately dismiss the Keyguard without any user interaction.
@@ -680,8 +732,9 @@
* If the value set for the {@link Activity} attr {@link android.R.attr#turnScreenOn} is true,
* the screen will turn on when the keyguard is dismissed.
*
- * @param activity The activity requesting the dismissal. The activity must be either visible
- * by using {@link LayoutParams#FLAG_SHOW_WHEN_LOCKED} or must be in a state in
+ * @param activity The activity requesting the dismissal. The activity must either be visible
+ * by using {@link android.R.attr#showWhenLocked} or {@link
+ * android.app.Activity#setShowWhenLocked(boolean)}, or must be in a state in
* which it would be visible if Keyguard would not be hiding it. If that's not
* the case, the request will fail immediately and
* {@link KeyguardDismissCallback#onDismissError} will be invoked.
@@ -735,12 +788,12 @@
* @param callback Lets you know whether the operation was successful and
* it is safe to launch anything that would normally be considered safe
* once the user has gotten past the keyguard.
-
- * @deprecated Use {@link LayoutParams#FLAG_DISMISS_KEYGUARD}
- * and/or {@link LayoutParams#FLAG_SHOW_WHEN_LOCKED}
- * instead; this allows you to seamlessly hide the keyguard as your application
- * moves in and out of the foreground and does not require that any special
- * permissions be requested.
+ *
+ * @deprecated Use {@link android.R.attr#showWhenLocked} or {@link
+ * android.app.Activity#setShowWhenLocked(boolean)} to seamlessly occlude and unocclude the
+ * keyguard as your application moves in and out of the foreground, without requiring any
+ * special permissions. Use {@link #requestDismissKeyguard(android.app.Activity,
+ * KeyguardDismissCallback)} to request dismissal of the keyguard.
*/
@Deprecated
@RequiresPermission(Manifest.permission.DISABLE_KEYGUARD)
diff --git a/core/java/android/app/trust/ITrustListener.aidl b/core/java/android/app/trust/ITrustListener.aidl
index e4ac0119..8d44784 100644
--- a/core/java/android/app/trust/ITrustListener.aidl
+++ b/core/java/android/app/trust/ITrustListener.aidl
@@ -24,6 +24,7 @@
* {@hide}
*/
oneway interface ITrustListener {
+ void onEnabledTrustAgentsChanged(int userId);
void onTrustChanged(boolean enabled, boolean newlyUnlocked, int userId, int flags,
in List<String> trustGrantedMessages);
void onTrustManagedChanged(boolean managed, int userId);
diff --git a/core/java/android/app/trust/TrustManager.java b/core/java/android/app/trust/TrustManager.java
index 62f755d..3552ce0 100644
--- a/core/java/android/app/trust/TrustManager.java
+++ b/core/java/android/app/trust/TrustManager.java
@@ -43,6 +43,7 @@
private static final int MSG_TRUST_CHANGED = 1;
private static final int MSG_TRUST_MANAGED_CHANGED = 2;
private static final int MSG_TRUST_ERROR = 3;
+ private static final int MSG_ENABLED_TRUST_AGENTS_CHANGED = 4;
private static final String TAG = "TrustManager";
private static final String DATA_FLAGS = "initiatedByUser";
@@ -187,6 +188,13 @@
}
@Override
+ public void onEnabledTrustAgentsChanged(int userId) {
+ final Message m = mHandler.obtainMessage(MSG_ENABLED_TRUST_AGENTS_CHANGED,
+ userId, 0, trustListener);
+ m.sendToTarget();
+ }
+
+ @Override
public void onTrustManagedChanged(boolean managed, int userId) {
mHandler.obtainMessage(MSG_TRUST_MANAGED_CHANGED, (managed ? 1 : 0), userId,
trustListener).sendToTarget();
@@ -283,6 +291,10 @@
case MSG_TRUST_ERROR:
final CharSequence message = msg.peekData().getCharSequence(DATA_MESSAGE);
((TrustListener) msg.obj).onTrustError(message);
+ break;
+ case MSG_ENABLED_TRUST_AGENTS_CHANGED:
+ ((TrustListener) msg.obj).onEnabledTrustAgentsChanged(msg.arg1);
+ break;
}
}
};
@@ -316,5 +328,10 @@
* @param message A message that should be displayed on the UI.
*/
void onTrustError(CharSequence message);
+
+ /**
+ * Reports that the enabled trust agents for the specified user has changed.
+ */
+ void onEnabledTrustAgentsChanged(int userId);
}
}
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index d04d8be..518234f 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -3825,6 +3825,7 @@
VIBRATOR_MANAGER_SERVICE,
VIBRATOR_SERVICE,
//@hide: STATUS_BAR_SERVICE,
+ THREAD_NETWORK_SERVICE,
CONNECTIVITY_SERVICE,
PAC_PROXY_SERVICE,
VCN_MANAGEMENT_SERVICE,
@@ -4496,6 +4497,20 @@
/**
* Use with {@link #getSystemService(String)} to retrieve a
+ * {@link android.net.thread.ThreadNetworkManager}.
+ *
+ * <p>On devices without {@link PackageManager#FEATURE_THREAD_NETWORK} system feature
+ * the {@link #getSystemService(String)} will return {@code null}.
+ *
+ * @see #getSystemService(String)
+ * @see android.net.thread.ThreadNetworkManager
+ * @hide
+ */
+ @SystemApi
+ public static final String THREAD_NETWORK_SERVICE = "thread_network";
+
+ /**
+ * Use with {@link #getSystemService(String)} to retrieve a
* {@link android.net.IpSecManager} for encrypting Sockets or Networks with
* IPSec.
*
diff --git a/core/java/android/content/om/OWNERS b/core/java/android/content/om/OWNERS
index 3669817..72aed2d 100644
--- a/core/java/android/content/om/OWNERS
+++ b/core/java/android/content/om/OWNERS
@@ -1,6 +1,5 @@
# Bug component: 568631
-toddke@android.com
-toddke@google.com
patb@google.com
zyy@google.com
+jakmcbane@google.com
\ No newline at end of file
diff --git a/core/java/android/content/res/OWNERS b/core/java/android/content/res/OWNERS
index d12d920..6b128a9 100644
--- a/core/java/android/content/res/OWNERS
+++ b/core/java/android/content/res/OWNERS
@@ -1,6 +1,7 @@
# Bug component: 568761
-toddke@android.com
-toddke@google.com
patb@google.com
zyy@google.com
+branliu@google.com
+
+per-file FontScaleConverter*=fuego@google.com
diff --git a/core/java/android/os/Binder.java b/core/java/android/os/Binder.java
index 3f04ca4..8e60102 100644
--- a/core/java/android/os/Binder.java
+++ b/core/java/android/os/Binder.java
@@ -186,6 +186,8 @@
/**
* Get the binder transaction observer for this process.
*
+ * TODO(b/299356196): only applies to Java code, not C++/Rust
+ *
* @hide
*/
public static void setObserver(@Nullable BinderInternal.Observer observer) {
@@ -202,6 +204,8 @@
* that require a result must be sent as {@link IBinder#FLAG_ONEWAY} calls
* which deliver results through a callback interface.
*
+ * TODO(b/299355525): only applies to Java code, not C++/Rust
+ *
* @hide
*/
public static void setWarnOnBlocking(boolean warnOnBlocking) {
@@ -218,6 +222,8 @@
* interfaces hosted by package that could be upgraded or replaced,
* otherwise you risk system instability if that remote interface wedges.
*
+ * TODO(b/299355525): only applies to Java code, not C++/Rust
+ *
* @hide
*/
public static IBinder allowBlocking(IBinder binder) {
@@ -1307,6 +1313,8 @@
int callingUid) {
// Make sure the observer won't change while processing a transaction.
final BinderInternal.Observer observer = sObserver;
+
+ // TODO(b/299356196): observer should also observe transactions in native code
final CallSession callSession =
observer != null ? observer.callStarted(this, code, UNSET_WORKSOURCE) : null;
// Theoretically, we should call transact, which will call onTransact,
@@ -1329,7 +1337,7 @@
final boolean tracingEnabled = tagEnabled && transactionTraceName != null;
try {
- // TODO - this logic should not be in Java - it should be in native
+ // TODO(b/299356201) - this logic should not be in Java - it should be in native
// code in libbinder so that it works for all binder users.
final BinderCallHeavyHitterWatcher heavyHitterWatcher = sHeavyHitterWatcher;
if (heavyHitterWatcher != null && callingUid != -1) {
@@ -1340,9 +1348,9 @@
Trace.traceBegin(Trace.TRACE_TAG_AIDL, transactionTraceName);
}
- // TODO - this logic should not be in Java - it should be in native
- // code in libbinder so that it works for all binder users. Further,
- // this should not re-use flags.
+ // TODO(b/299353919) - this logic should not be in Java - it should be
+ // in native code in libbinder so that it works for all binder users.
+ // Further, this should not re-use flags.
if ((flags & FLAG_COLLECT_NOTED_APP_OPS) != 0 && callingUid != -1) {
AppOpsManager.startNotedAppOpsCollection(callingUid);
try {
diff --git a/core/java/android/os/ServiceManager.java b/core/java/android/os/ServiceManager.java
index b210c46..e96c24d 100644
--- a/core/java/android/os/ServiceManager.java
+++ b/core/java/android/os/ServiceManager.java
@@ -245,7 +245,7 @@
public static boolean isDeclared(@NonNull String name) {
try {
return getIServiceManager().isDeclared(name);
- } catch (RemoteException e) {
+ } catch (RemoteException | SecurityException e) {
Log.e(TAG, "error in isDeclared", e);
return false;
}
diff --git a/core/java/android/os/flags.aconfig b/core/java/android/os/flags.aconfig
new file mode 100644
index 0000000..851aa6d
--- /dev/null
+++ b/core/java/android/os/flags.aconfig
@@ -0,0 +1,8 @@
+package: "android.os"
+
+flag {
+ name: "disallow_cellular_null_ciphers_restriction"
+ namespace: "cellular_security"
+ description: "Guards a new UserManager user restriction that admins can use to require cellular encryption on their managed devices."
+ bug: "276752881"
+}
diff --git a/core/java/android/security/flags.aconfig b/core/java/android/security/flags.aconfig
index b27dac2..b6c2b83 100644
--- a/core/java/android/security/flags.aconfig
+++ b/core/java/android/security/flags.aconfig
@@ -6,3 +6,10 @@
description: "Feature flag for fs-verity API"
bug: "285185747"
}
+
+flag {
+ name: "fix_unlocked_device_required_keys"
+ namespace: "hardware_backed_security"
+ description: "Fix bugs in behavior of UnlockedDeviceRequired keystore keys"
+ bug: "296464083"
+}
diff --git a/core/java/android/util/Patterns.java b/core/java/android/util/Patterns.java
index ece069f..c4660c4 100644
--- a/core/java/android/util/Patterns.java
+++ b/core/java/android/util/Patterns.java
@@ -111,7 +111,7 @@
/**
* Regular expression to match all IANA top-level domains.
*
- * List accurate as of 2015/11/24. List taken from:
+ * List accurate as of 2023/09/11. List taken from:
* http://data.iana.org/TLD/tlds-alpha-by-domain.txt
* This pattern is auto-generated by frameworks/ex/common/tools/make-iana-tld-pattern.py
*
@@ -119,121 +119,167 @@
*/
static final String IANA_TOP_LEVEL_DOMAINS =
"(?:"
- + "(?:aaa|aarp|abb|abbott|abogado|academy|accenture|accountant|accountants|aco|active"
- + "|actor|ads|adult|aeg|aero|afl|agency|aig|airforce|airtel|allfinanz|alsace|amica|amsterdam"
- + "|android|apartments|app|apple|aquarelle|aramco|archi|army|arpa|arte|asia|associates"
- + "|attorney|auction|audio|auto|autos|axa|azure|a[cdefgilmoqrstuwxz])"
- + "|(?:band|bank|bar|barcelona|barclaycard|barclays|bargains|bauhaus|bayern|bbc|bbva"
- + "|bcn|beats|beer|bentley|berlin|best|bet|bharti|bible|bid|bike|bing|bingo|bio|biz|black"
- + "|blackfriday|bloomberg|blue|bms|bmw|bnl|bnpparibas|boats|bom|bond|boo|boots|boutique"
- + "|bradesco|bridgestone|broadway|broker|brother|brussels|budapest|build|builders|business"
- + "|buzz|bzh|b[abdefghijmnorstvwyz])"
- + "|(?:cab|cafe|cal|camera|camp|cancerresearch|canon|capetown|capital|car|caravan|cards"
- + "|care|career|careers|cars|cartier|casa|cash|casino|cat|catering|cba|cbn|ceb|center|ceo"
- + "|cern|cfa|cfd|chanel|channel|chat|cheap|chloe|christmas|chrome|church|cipriani|cisco"
- + "|citic|city|cityeats|claims|cleaning|click|clinic|clothing|cloud|club|clubmed|coach"
- + "|codes|coffee|college|cologne|com|commbank|community|company|computer|comsec|condos"
- + "|construction|consulting|contractors|cooking|cool|coop|corsica|country|coupons|courses"
- + "|credit|creditcard|creditunion|cricket|crown|crs|cruises|csc|cuisinella|cymru|cyou|c[acdfghiklmnoruvwxyz])"
- + "|(?:dabur|dad|dance|date|dating|datsun|day|dclk|deals|degree|delivery|dell|delta"
- + "|democrat|dental|dentist|desi|design|dev|diamonds|diet|digital|direct|directory|discount"
- + "|dnp|docs|dog|doha|domains|doosan|download|drive|durban|dvag|d[ejkmoz])"
- + "|(?:earth|eat|edu|education|email|emerck|energy|engineer|engineering|enterprises"
- + "|epson|equipment|erni|esq|estate|eurovision|eus|events|everbank|exchange|expert|exposed"
- + "|express|e[cegrstu])"
- + "|(?:fage|fail|fairwinds|faith|family|fan|fans|farm|fashion|feedback|ferrero|film"
- + "|final|finance|financial|firmdale|fish|fishing|fit|fitness|flights|florist|flowers|flsmidth"
- + "|fly|foo|football|forex|forsale|forum|foundation|frl|frogans|fund|furniture|futbol|fyi"
- + "|f[ijkmor])"
- + "|(?:gal|gallery|game|garden|gbiz|gdn|gea|gent|genting|ggee|gift|gifts|gives|giving"
- + "|glass|gle|global|globo|gmail|gmo|gmx|gold|goldpoint|golf|goo|goog|google|gop|gov|grainger"
- + "|graphics|gratis|green|gripe|group|gucci|guge|guide|guitars|guru|g[abdefghilmnpqrstuwy])"
- + "|(?:hamburg|hangout|haus|healthcare|help|here|hermes|hiphop|hitachi|hiv|hockey|holdings"
- + "|holiday|homedepot|homes|honda|horse|host|hosting|hoteles|hotmail|house|how|hsbc|hyundai"
- + "|h[kmnrtu])"
- + "|(?:ibm|icbc|ice|icu|ifm|iinet|immo|immobilien|industries|infiniti|info|ing|ink|institute"
- + "|insure|int|international|investments|ipiranga|irish|ist|istanbul|itau|iwc|i[delmnoqrst])"
- + "|(?:jaguar|java|jcb|jetzt|jewelry|jlc|jll|jobs|joburg|jprs|juegos|j[emop])"
- + "|(?:kaufen|kddi|kia|kim|kinder|kitchen|kiwi|koeln|komatsu|krd|kred|kyoto|k[eghimnprwyz])"
- + "|(?:lacaixa|lancaster|land|landrover|lasalle|lat|latrobe|law|lawyer|lds|lease|leclerc"
- + "|legal|lexus|lgbt|liaison|lidl|life|lifestyle|lighting|limited|limo|linde|link|live"
- + "|lixil|loan|loans|lol|london|lotte|lotto|love|ltd|ltda|lupin|luxe|luxury|l[abcikrstuvy])"
- + "|(?:madrid|maif|maison|man|management|mango|market|marketing|markets|marriott|mba"
- + "|media|meet|melbourne|meme|memorial|men|menu|meo|miami|microsoft|mil|mini|mma|mobi|moda"
- + "|moe|moi|mom|monash|money|montblanc|mormon|mortgage|moscow|motorcycles|mov|movie|movistar"
- + "|mtn|mtpc|mtr|museum|mutuelle|m[acdeghklmnopqrstuvwxyz])"
- + "|(?:nadex|nagoya|name|navy|nec|net|netbank|network|neustar|new|news|nexus|ngo|nhk"
- + "|nico|ninja|nissan|nokia|nra|nrw|ntt|nyc|n[acefgilopruz])"
- + "|(?:obi|office|okinawa|omega|one|ong|onl|online|ooo|oracle|orange|org|organic|osaka"
- + "|otsuka|ovh|om)"
- + "|(?:page|panerai|paris|partners|parts|party|pet|pharmacy|philips|photo|photography"
- + "|photos|physio|piaget|pics|pictet|pictures|ping|pink|pizza|place|play|playstation|plumbing"
- + "|plus|pohl|poker|porn|post|praxi|press|pro|prod|productions|prof|properties|property"
- + "|protection|pub|p[aefghklmnrstwy])"
- + "|(?:qpon|quebec|qa)"
- + "|(?:racing|realtor|realty|recipes|red|redstone|rehab|reise|reisen|reit|ren|rent|rentals"
- + "|repair|report|republican|rest|restaurant|review|reviews|rich|ricoh|rio|rip|rocher|rocks"
- + "|rodeo|rsvp|ruhr|run|rwe|ryukyu|r[eosuw])"
- + "|(?:saarland|sakura|sale|samsung|sandvik|sandvikcoromant|sanofi|sap|sapo|sarl|saxo"
- + "|sbs|sca|scb|schmidt|scholarships|school|schule|schwarz|science|scor|scot|seat|security"
- + "|seek|sener|services|seven|sew|sex|sexy|shiksha|shoes|show|shriram|singles|site|ski"
- + "|sky|skype|sncf|soccer|social|software|sohu|solar|solutions|sony|soy|space|spiegel|spreadbetting"
- + "|srl|stada|starhub|statoil|stc|stcgroup|stockholm|studio|study|style|sucks|supplies"
- + "|supply|support|surf|surgery|suzuki|swatch|swiss|sydney|systems|s[abcdeghijklmnortuvxyz])"
- + "|(?:tab|taipei|tatamotors|tatar|tattoo|tax|taxi|team|tech|technology|tel|telefonica"
- + "|temasek|tennis|thd|theater|theatre|tickets|tienda|tips|tires|tirol|today|tokyo|tools"
- + "|top|toray|toshiba|tours|town|toyota|toys|trade|trading|training|travel|trust|tui|t[cdfghjklmnortvwz])"
- + "|(?:ubs|university|uno|uol|u[agksyz])"
- + "|(?:vacations|vana|vegas|ventures|versicherung|vet|viajes|video|villas|vin|virgin"
- + "|vision|vista|vistaprint|viva|vlaanderen|vodka|vote|voting|voto|voyage|v[aceginu])"
- + "|(?:wales|walter|wang|watch|webcam|website|wed|wedding|weir|whoswho|wien|wiki|williamhill"
- + "|win|windows|wine|wme|work|works|world|wtc|wtf|w[fs])"
- + "|(?:\u03b5\u03bb|\u0431\u0435\u043b|\u0434\u0435\u0442\u0438|\u043a\u043e\u043c|\u043c\u043a\u0434"
+ + "(?:aaa|aarp|abb|abbott|abbvie|abc|able|abogado|abudhabi|academy|accenture|accountant"
+ + "|accountants|aco|actor|ads|adult|aeg|aero|aetna|afl|africa|agakhan|agency|aig|airbus"
+ + "|airforce|airtel|akdn|alibaba|alipay|allfinanz|allstate|ally|alsace|alstom|amazon|americanexpress"
+ + "|americanfamily|amex|amfam|amica|amsterdam|analytics|android|anquan|anz|aol|apartments"
+ + "|app|apple|aquarelle|arab|aramco|archi|army|arpa|art|arte|asda|asia|associates|athleta"
+ + "|attorney|auction|audi|audible|audio|auspost|author|auto|autos|avianca|aws|axa|azure"
+ + "|a[cdefgilmoqrstuwxz])"
+ + "|(?:baby|baidu|banamex|bananarepublic|band|bank|bar|barcelona|barclaycard|barclays"
+ + "|barefoot|bargains|baseball|basketball|bauhaus|bayern|bbc|bbt|bbva|bcg|bcn|beats|beauty"
+ + "|beer|bentley|berlin|best|bestbuy|bet|bharti|bible|bid|bike|bing|bingo|bio|biz|black"
+ + "|blackfriday|blockbuster|blog|bloomberg|blue|bms|bmw|bnpparibas|boats|boehringer|bofa"
+ + "|bom|bond|boo|book|booking|bosch|bostik|boston|bot|boutique|box|bradesco|bridgestone"
+ + "|broadway|broker|brother|brussels|build|builders|business|buy|buzz|bzh|b[abdefghijmnorstvwyz])"
+ + "|(?:cab|cafe|cal|call|calvinklein|cam|camera|camp|canon|capetown|capital|capitalone"
+ + "|car|caravan|cards|care|career|careers|cars|casa|case|cash|casino|cat|catering|catholic"
+ + "|cba|cbn|cbre|cbs|center|ceo|cern|cfa|cfd|chanel|channel|charity|chase|chat|cheap|chintai"
+ + "|christmas|chrome|church|cipriani|circle|cisco|citadel|citi|citic|city|cityeats|claims"
+ + "|cleaning|click|clinic|clinique|clothing|cloud|club|clubmed|coach|codes|coffee|college"
+ + "|cologne|com|comcast|commbank|community|company|compare|computer|comsec|condos|construction"
+ + "|consulting|contact|contractors|cooking|cool|coop|corsica|country|coupon|coupons|courses"
+ + "|cpa|credit|creditcard|creditunion|cricket|crown|crs|cruise|cruises|cuisinella|cymru"
+ + "|cyou|c[acdfghiklmnoruvwxyz])"
+ + "|(?:dabur|dad|dance|data|date|dating|datsun|day|dclk|dds|deal|dealer|deals|degree"
+ + "|delivery|dell|deloitte|delta|democrat|dental|dentist|desi|design|dev|dhl|diamonds|diet"
+ + "|digital|direct|directory|discount|discover|dish|diy|dnp|docs|doctor|dog|domains|dot"
+ + "|download|drive|dtv|dubai|dunlop|dupont|durban|dvag|dvr|d[ejkmoz])"
+ + "|(?:earth|eat|eco|edeka|edu|education|email|emerck|energy|engineer|engineering|enterprises"
+ + "|epson|equipment|ericsson|erni|esq|estate|etisalat|eurovision|eus|events|exchange|expert"
+ + "|exposed|express|extraspace|e[cegrstu])"
+ + "|(?:fage|fail|fairwinds|faith|family|fan|fans|farm|farmers|fashion|fast|fedex|feedback"
+ + "|ferrari|ferrero|fidelity|fido|film|final|finance|financial|fire|firestone|firmdale"
+ + "|fish|fishing|fit|fitness|flickr|flights|flir|florist|flowers|fly|foo|food|football"
+ + "|ford|forex|forsale|forum|foundation|fox|free|fresenius|frl|frogans|frontdoor|frontier"
+ + "|ftr|fujitsu|fun|fund|furniture|futbol|fyi|f[ijkmor])"
+ + "|(?:gal|gallery|gallo|gallup|game|games|gap|garden|gay|gbiz|gdn|gea|gent|genting"
+ + "|george|ggee|gift|gifts|gives|giving|glass|gle|global|globo|gmail|gmbh|gmo|gmx|godaddy"
+ + "|gold|goldpoint|golf|goo|goodyear|goog|google|gop|got|gov|grainger|graphics|gratis|green"
+ + "|gripe|grocery|group|guardian|gucci|guge|guide|guitars|guru|g[abdefghilmnpqrstuwy])"
+ + "|(?:hair|hamburg|hangout|haus|hbo|hdfc|hdfcbank|health|healthcare|help|helsinki|here"
+ + "|hermes|hiphop|hisamitsu|hitachi|hiv|hkt|hockey|holdings|holiday|homedepot|homegoods"
+ + "|homes|homesense|honda|horse|hospital|host|hosting|hot|hotels|hotmail|house|how|hsbc"
+ + "|hughes|hyatt|hyundai|h[kmnrtu])"
+ + "|(?:ibm|icbc|ice|icu|ieee|ifm|ikano|imamat|imdb|immo|immobilien|inc|industries|infiniti"
+ + "|info|ing|ink|institute|insurance|insure|int|international|intuit|investments|ipiranga"
+ + "|irish|ismaili|ist|istanbul|itau|itv|i[delmnoqrst])"
+ + "|(?:jaguar|java|jcb|jeep|jetzt|jewelry|jio|jll|jmp|jnj|jobs|joburg|jot|joy|jpmorgan"
+ + "|jprs|juegos|juniper|j[emop])"
+ + "|(?:kaufen|kddi|kerryhotels|kerrylogistics|kerryproperties|kfh|kia|kids|kim|kinder"
+ + "|kindle|kitchen|kiwi|koeln|komatsu|kosher|kpmg|kpn|krd|kred|kuokgroup|kyoto|k[eghimnprwyz])"
+ + "|(?:lacaixa|lamborghini|lamer|lancaster|land|landrover|lanxess|lasalle|lat|latino"
+ + "|latrobe|law|lawyer|lds|lease|leclerc|lefrak|legal|lego|lexus|lgbt|lidl|life|lifeinsurance"
+ + "|lifestyle|lighting|like|lilly|limited|limo|lincoln|link|lipsy|live|living|llc|llp|loan"
+ + "|loans|locker|locus|lol|london|lotte|lotto|love|lpl|lplfinancial|ltd|ltda|lundbeck|luxe"
+ + "|luxury|l[abcikrstuvy])"
+ + "|(?:madrid|maif|maison|makeup|man|management|mango|map|market|marketing|markets|marriott"
+ + "|marshalls|mattel|mba|mckinsey|med|media|meet|melbourne|meme|memorial|men|menu|merckmsd"
+ + "|miami|microsoft|mil|mini|mint|mit|mitsubishi|mlb|mls|mma|mobi|mobile|moda|moe|moi|mom"
+ + "|monash|money|monster|mormon|mortgage|moscow|moto|motorcycles|mov|movie|msd|mtn|mtr"
+ + "|museum|music|m[acdeghklmnopqrstuvwxyz])"
+ + "|(?:nab|nagoya|name|natura|navy|nba|nec|net|netbank|netflix|network|neustar|new|news"
+ + "|next|nextdirect|nexus|nfl|ngo|nhk|nico|nike|nikon|ninja|nissan|nissay|nokia|norton"
+ + "|now|nowruz|nowtv|nra|nrw|ntt|nyc|n[acefgilopruz])"
+ + "|(?:obi|observer|office|okinawa|olayan|olayangroup|oldnavy|ollo|omega|one|ong|onl"
+ + "|online|ooo|open|oracle|orange|org|organic|origins|osaka|otsuka|ott|ovh|om)"
+ + "|(?:page|panasonic|paris|pars|partners|parts|party|pay|pccw|pet|pfizer|pharmacy|phd"
+ + "|philips|phone|photo|photography|photos|physio|pics|pictet|pictures|pid|pin|ping|pink"
+ + "|pioneer|pizza|place|play|playstation|plumbing|plus|pnc|pohl|poker|politie|porn|post"
+ + "|pramerica|praxi|press|prime|pro|prod|productions|prof|progressive|promo|properties"
+ + "|property|protection|pru|prudential|pub|pwc|p[aefghklmnrstwy])"
+ + "|(?:qpon|quebec|quest|qa)"
+ + "|(?:racing|radio|read|realestate|realtor|realty|recipes|red|redstone|redumbrella"
+ + "|rehab|reise|reisen|reit|reliance|ren|rent|rentals|repair|report|republican|rest|restaurant"
+ + "|review|reviews|rexroth|rich|richardli|ricoh|ril|rio|rip|rocher|rocks|rodeo|rogers|room"
+ + "|rsvp|rugby|ruhr|run|rwe|ryukyu|r[eosuw])"
+ + "|(?:saarland|safe|safety|sakura|sale|salon|samsclub|samsung|sandvik|sandvikcoromant"
+ + "|sanofi|sap|sarl|sas|save|saxo|sbi|sbs|sca|scb|schaeffler|schmidt|scholarships|school"
+ + "|schule|schwarz|science|scot|search|seat|secure|security|seek|select|sener|services"
+ + "|seven|sew|sex|sexy|sfr|shangrila|sharp|shaw|shell|shia|shiksha|shoes|shop|shopping"
+ + "|shouji|show|showtime|silk|sina|singles|site|ski|skin|sky|skype|sling|smart|smile|sncf"
+ + "|soccer|social|softbank|software|sohu|solar|solutions|song|sony|soy|spa|space|sport"
+ + "|spot|srl|stada|staples|star|statebank|statefarm|stc|stcgroup|stockholm|storage|store"
+ + "|stream|studio|study|style|sucks|supplies|supply|support|surf|surgery|suzuki|swatch"
+ + "|swiss|sydney|systems|s[abcdeghijklmnorstuvxyz])"
+ + "|(?:tab|taipei|talk|taobao|target|tatamotors|tatar|tattoo|tax|taxi|tci|tdk|team|tech"
+ + "|technology|tel|temasek|tennis|teva|thd|theater|theatre|tiaa|tickets|tienda|tips|tires"
+ + "|tirol|tjmaxx|tjx|tkmaxx|tmall|today|tokyo|tools|top|toray|toshiba|total|tours|town"
+ + "|toyota|toys|trade|trading|training|travel|travelers|travelersinsurance|trust|trv|tube"
+ + "|tui|tunes|tushu|tvs|t[cdfghjklmnortvwz])"
+ + "|(?:ubank|ubs|unicom|university|uno|uol|ups|u[agksyz])"
+ + "|(?:vacations|vana|vanguard|vegas|ventures|verisign|versicherung|vet|viajes|video"
+ + "|vig|viking|villas|vin|vip|virgin|visa|vision|viva|vivo|vlaanderen|vodka|volkswagen"
+ + "|volvo|vote|voting|voto|voyage|v[aceginu])"
+ + "|(?:wales|walmart|walter|wang|wanggou|watch|watches|weather|weatherchannel|webcam"
+ + "|weber|website|wed|wedding|weibo|weir|whoswho|wien|wiki|williamhill|win|windows|wine"
+ + "|winners|wme|wolterskluwer|woodside|work|works|world|wow|wtc|wtf|w[fs])"
+ + "|(?:\u03b5\u03bb|\u03b5\u03c5|\u0431\u0433|\u0431\u0435\u043b|\u0434\u0435\u0442\u0438"
+ + "|\u0435\u044e|\u043a\u0430\u0442\u043e\u043b\u0438\u043a|\u043a\u043e\u043c|\u043c\u043a\u0434"
+ "|\u043c\u043e\u043d|\u043c\u043e\u0441\u043a\u0432\u0430|\u043e\u043d\u043b\u0430\u0439\u043d"
+ "|\u043e\u0440\u0433|\u0440\u0443\u0441|\u0440\u0444|\u0441\u0430\u0439\u0442|\u0441\u0440\u0431"
- + "|\u0443\u043a\u0440|\u049b\u0430\u0437|\u0570\u0561\u0575|\u05e7\u05d5\u05dd|\u0627\u0631\u0627\u0645\u0643\u0648"
- + "|\u0627\u0644\u0627\u0631\u062f\u0646|\u0627\u0644\u062c\u0632\u0627\u0626\u0631|\u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629"
- + "|\u0627\u0644\u0645\u063a\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062a|\u0627\u06cc\u0631\u0627\u0646"
- + "|\u0628\u0627\u0632\u0627\u0631|\u0628\u06be\u0627\u0631\u062a|\u062a\u0648\u0646\u0633"
- + "|\u0633\u0648\u062f\u0627\u0646|\u0633\u0648\u0631\u064a\u0629|\u0634\u0628\u0643\u0629"
- + "|\u0639\u0631\u0627\u0642|\u0639\u0645\u0627\u0646|\u0641\u0644\u0633\u0637\u064a\u0646"
- + "|\u0642\u0637\u0631|\u0643\u0648\u0645|\u0645\u0635\u0631|\u0645\u0644\u064a\u0633\u064a\u0627"
- + "|\u0645\u0648\u0642\u0639|\u0915\u0949\u092e|\u0928\u0947\u091f|\u092d\u093e\u0930\u0924"
- + "|\u0938\u0902\u0917\u0920\u0928|\u09ad\u09be\u09b0\u09a4|\u0a2d\u0a3e\u0a30\u0a24|\u0aad\u0abe\u0ab0\u0aa4"
- + "|\u0b87\u0ba8\u0bcd\u0ba4\u0bbf\u0baf\u0bbe|\u0b87\u0bb2\u0b99\u0bcd\u0b95\u0bc8|\u0b9a\u0bbf\u0b99\u0bcd\u0b95\u0baa\u0bcd\u0baa\u0bc2\u0bb0\u0bcd"
- + "|\u0c2d\u0c3e\u0c30\u0c24\u0c4d|\u0dbd\u0d82\u0d9a\u0dcf|\u0e04\u0e2d\u0e21|\u0e44\u0e17\u0e22"
- + "|\u10d2\u10d4|\u307f\u3093\u306a|\u30b0\u30fc\u30b0\u30eb|\u30b3\u30e0|\u4e16\u754c"
- + "|\u4e2d\u4fe1|\u4e2d\u56fd|\u4e2d\u570b|\u4e2d\u6587\u7f51|\u4f01\u4e1a|\u4f5b\u5c71"
- + "|\u4fe1\u606f|\u5065\u5eb7|\u516b\u5366|\u516c\u53f8|\u516c\u76ca|\u53f0\u6e7e|\u53f0\u7063"
- + "|\u5546\u57ce|\u5546\u5e97|\u5546\u6807|\u5728\u7ebf|\u5927\u62ff|\u5a31\u4e50|\u5de5\u884c"
- + "|\u5e7f\u4e1c|\u6148\u5584|\u6211\u7231\u4f60|\u624b\u673a|\u653f\u52a1|\u653f\u5e9c"
- + "|\u65b0\u52a0\u5761|\u65b0\u95fb|\u65f6\u5c1a|\u673a\u6784|\u6de1\u9a6c\u9521|\u6e38\u620f"
- + "|\u70b9\u770b|\u79fb\u52a8|\u7ec4\u7ec7\u673a\u6784|\u7f51\u5740|\u7f51\u5e97|\u7f51\u7edc"
- + "|\u8c37\u6b4c|\u96c6\u56e2|\u98de\u5229\u6d66|\u9910\u5385|\u9999\u6e2f|\ub2f7\ub137"
- + "|\ub2f7\ucef4|\uc0bc\uc131|\ud55c\uad6d|xbox"
- + "|xerox|xin|xn\\-\\-11b4c3d|xn\\-\\-1qqw23a|xn\\-\\-30rr7y|xn\\-\\-3bst00m|xn\\-\\-3ds443g"
- + "|xn\\-\\-3e0b707e|xn\\-\\-3pxu8k|xn\\-\\-42c2d9a|xn\\-\\-45brj9c|xn\\-\\-45q11c|xn\\-\\-4gbrim"
- + "|xn\\-\\-55qw42g|xn\\-\\-55qx5d|xn\\-\\-6frz82g|xn\\-\\-6qq986b3xl|xn\\-\\-80adxhks"
- + "|xn\\-\\-80ao21a|xn\\-\\-80asehdb|xn\\-\\-80aswg|xn\\-\\-90a3ac|xn\\-\\-90ais|xn\\-\\-9dbq2a"
- + "|xn\\-\\-9et52u|xn\\-\\-b4w605ferd|xn\\-\\-c1avg|xn\\-\\-c2br7g|xn\\-\\-cg4bki|xn\\-\\-clchc0ea0b2g2a9gcd"
- + "|xn\\-\\-czr694b|xn\\-\\-czrs0t|xn\\-\\-czru2d|xn\\-\\-d1acj3b|xn\\-\\-d1alf|xn\\-\\-efvy88h"
- + "|xn\\-\\-estv75g|xn\\-\\-fhbei|xn\\-\\-fiq228c5hs|xn\\-\\-fiq64b|xn\\-\\-fiqs8s|xn\\-\\-fiqz9s"
- + "|xn\\-\\-fjq720a|xn\\-\\-flw351e|xn\\-\\-fpcrj9c3d|xn\\-\\-fzc2c9e2c|xn\\-\\-gecrj9c"
- + "|xn\\-\\-h2brj9c|xn\\-\\-hxt814e|xn\\-\\-i1b6b1a6a2e|xn\\-\\-imr513n|xn\\-\\-io0a7i"
- + "|xn\\-\\-j1aef|xn\\-\\-j1amh|xn\\-\\-j6w193g|xn\\-\\-kcrx77d1x4a|xn\\-\\-kprw13d|xn\\-\\-kpry57d"
+ + "|\u0443\u043a\u0440|\u049b\u0430\u0437|\u0570\u0561\u0575|\u05d9\u05e9\u05e8\u05d0\u05dc"
+ + "|\u05e7\u05d5\u05dd|\u0627\u0628\u0648\u0638\u0628\u064a|\u0627\u062a\u0635\u0627\u0644\u0627\u062a"
+ + "|\u0627\u0631\u0627\u0645\u0643\u0648|\u0627\u0644\u0627\u0631\u062f\u0646|\u0627\u0644\u0628\u062d\u0631\u064a\u0646"
+ + "|\u0627\u0644\u062c\u0632\u0627\u0626\u0631|\u0627\u0644\u0633\u0639\u0648\u062f\u064a\u0629"
+ + "|\u0627\u0644\u0639\u0644\u064a\u0627\u0646|\u0627\u0644\u0645\u063a\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062a"
+ + "|\u0627\u06cc\u0631\u0627\u0646|\u0628\u0627\u0631\u062a|\u0628\u0627\u0632\u0627\u0631"
+ + "|\u0628\u064a\u062a\u0643|\u0628\u06be\u0627\u0631\u062a|\u062a\u0648\u0646\u0633|\u0633\u0648\u062f\u0627\u0646"
+ + "|\u0633\u0648\u0631\u064a\u0629|\u0634\u0628\u0643\u0629|\u0639\u0631\u0627\u0642|\u0639\u0631\u0628"
+ + "|\u0639\u0645\u0627\u0646|\u0641\u0644\u0633\u0637\u064a\u0646|\u0642\u0637\u0631|\u0643\u0627\u062b\u0648\u0644\u064a\u0643"
+ + "|\u0643\u0648\u0645|\u0645\u0635\u0631|\u0645\u0644\u064a\u0633\u064a\u0627|\u0645\u0648\u0631\u064a\u062a\u0627\u0646\u064a\u0627"
+ + "|\u0645\u0648\u0642\u0639|\u0647\u0645\u0631\u0627\u0647|\u067e\u0627\u06a9\u0633\u062a\u0627\u0646"
+ + "|\u0680\u0627\u0631\u062a|\u0915\u0949\u092e|\u0928\u0947\u091f|\u092d\u093e\u0930\u0924"
+ + "|\u092d\u093e\u0930\u0924\u092e\u094d|\u092d\u093e\u0930\u094b\u0924|\u0938\u0902\u0917\u0920\u0928"
+ + "|\u09ac\u09be\u0982\u09b2\u09be|\u09ad\u09be\u09b0\u09a4|\u09ad\u09be\u09f0\u09a4|\u0a2d\u0a3e\u0a30\u0a24"
+ + "|\u0aad\u0abe\u0ab0\u0aa4|\u0b2d\u0b3e\u0b30\u0b24|\u0b87\u0ba8\u0bcd\u0ba4\u0bbf\u0baf\u0bbe"
+ + "|\u0b87\u0bb2\u0b99\u0bcd\u0b95\u0bc8|\u0b9a\u0bbf\u0b99\u0bcd\u0b95\u0baa\u0bcd\u0baa\u0bc2\u0bb0\u0bcd"
+ + "|\u0c2d\u0c3e\u0c30\u0c24\u0c4d|\u0cad\u0cbe\u0cb0\u0ca4|\u0d2d\u0d3e\u0d30\u0d24\u0d02"
+ + "|\u0dbd\u0d82\u0d9a\u0dcf|\u0e04\u0e2d\u0e21|\u0e44\u0e17\u0e22|\u0ea5\u0eb2\u0ea7|\u10d2\u10d4"
+ + "|\u307f\u3093\u306a|\u30a2\u30de\u30be\u30f3|\u30af\u30e9\u30a6\u30c9|\u30b0\u30fc\u30b0\u30eb"
+ + "|\u30b3\u30e0|\u30b9\u30c8\u30a2|\u30bb\u30fc\u30eb|\u30d5\u30a1\u30c3\u30b7\u30e7\u30f3"
+ + "|\u30dd\u30a4\u30f3\u30c8|\u4e16\u754c|\u4e2d\u4fe1|\u4e2d\u56fd|\u4e2d\u570b|\u4e2d\u6587\u7f51"
+ + "|\u4e9a\u9a6c\u900a|\u4f01\u4e1a|\u4f5b\u5c71|\u4fe1\u606f|\u5065\u5eb7|\u516b\u5366"
+ + "|\u516c\u53f8|\u516c\u76ca|\u53f0\u6e7e|\u53f0\u7063|\u5546\u57ce|\u5546\u5e97|\u5546\u6807"
+ + "|\u5609\u91cc|\u5609\u91cc\u5927\u9152\u5e97|\u5728\u7ebf|\u5927\u62ff|\u5929\u4e3b\u6559"
+ + "|\u5a31\u4e50|\u5bb6\u96fb|\u5e7f\u4e1c|\u5fae\u535a|\u6148\u5584|\u6211\u7231\u4f60"
+ + "|\u624b\u673a|\u62db\u8058|\u653f\u52a1|\u653f\u5e9c|\u65b0\u52a0\u5761|\u65b0\u95fb"
+ + "|\u65f6\u5c1a|\u66f8\u7c4d|\u673a\u6784|\u6de1\u9a6c\u9521|\u6e38\u620f|\u6fb3\u9580"
+ + "|\u70b9\u770b|\u79fb\u52a8|\u7ec4\u7ec7\u673a\u6784|\u7f51\u5740|\u7f51\u5e97|\u7f51\u7ad9"
+ + "|\u7f51\u7edc|\u8054\u901a|\u8c37\u6b4c|\u8d2d\u7269|\u901a\u8ca9|\u96c6\u56e2|\u96fb\u8a0a\u76c8\u79d1"
+ + "|\u98de\u5229\u6d66|\u98df\u54c1|\u9910\u5385|\u9999\u683c\u91cc\u62c9|\u9999\u6e2f"
+ + "|\ub2f7\ub137|\ub2f7\ucef4|\uc0bc\uc131|\ud55c\uad6d"
+ + "|xbox|xerox|xfinity|xihuan|xin|xn\\-\\-11b4c3d|xn\\-\\-1ck2e1b|xn\\-\\-1qqw23a|xn\\-\\-2scrj9c"
+ + "|xn\\-\\-30rr7y|xn\\-\\-3bst00m|xn\\-\\-3ds443g|xn\\-\\-3e0b707e|xn\\-\\-3hcrj9c|xn\\-\\-3pxu8k"
+ + "|xn\\-\\-42c2d9a|xn\\-\\-45br5cyl|xn\\-\\-45brj9c|xn\\-\\-45q11c|xn\\-\\-4dbrk0ce|xn\\-\\-4gbrim"
+ + "|xn\\-\\-54b7fta0cc|xn\\-\\-55qw42g|xn\\-\\-55qx5d|xn\\-\\-5su34j936bgsg|xn\\-\\-5tzm5g"
+ + "|xn\\-\\-6frz82g|xn\\-\\-6qq986b3xl|xn\\-\\-80adxhks|xn\\-\\-80ao21a|xn\\-\\-80aqecdr1a"
+ + "|xn\\-\\-80asehdb|xn\\-\\-80aswg|xn\\-\\-8y0a063a|xn\\-\\-90a3ac|xn\\-\\-90ae|xn\\-\\-90ais"
+ + "|xn\\-\\-9dbq2a|xn\\-\\-9et52u|xn\\-\\-9krt00a|xn\\-\\-b4w605ferd|xn\\-\\-bck1b9a5dre4c"
+ + "|xn\\-\\-c1avg|xn\\-\\-c2br7g|xn\\-\\-cck2b3b|xn\\-\\-cckwcxetd|xn\\-\\-cg4bki|xn\\-\\-clchc0ea0b2g2a9gcd"
+ + "|xn\\-\\-czr694b|xn\\-\\-czrs0t|xn\\-\\-czru2d|xn\\-\\-d1acj3b|xn\\-\\-d1alf|xn\\-\\-e1a4c"
+ + "|xn\\-\\-eckvdtc9d|xn\\-\\-efvy88h|xn\\-\\-fct429k|xn\\-\\-fhbei|xn\\-\\-fiq228c5hs"
+ + "|xn\\-\\-fiq64b|xn\\-\\-fiqs8s|xn\\-\\-fiqz9s|xn\\-\\-fjq720a|xn\\-\\-flw351e|xn\\-\\-fpcrj9c3d"
+ + "|xn\\-\\-fzc2c9e2c|xn\\-\\-fzys8d69uvgm|xn\\-\\-g2xx48c|xn\\-\\-gckr3f0f|xn\\-\\-gecrj9c"
+ + "|xn\\-\\-gk3at1e|xn\\-\\-h2breg3eve|xn\\-\\-h2brj9c|xn\\-\\-h2brj9c8c|xn\\-\\-hxt814e"
+ + "|xn\\-\\-i1b6b1a6a2e|xn\\-\\-imr513n|xn\\-\\-io0a7i|xn\\-\\-j1aef|xn\\-\\-j1amh|xn\\-\\-j6w193g"
+ + "|xn\\-\\-jlq480n2rg|xn\\-\\-jvr189m|xn\\-\\-kcrx77d1x4a|xn\\-\\-kprw13d|xn\\-\\-kpry57d"
+ "|xn\\-\\-kput3i|xn\\-\\-l1acc|xn\\-\\-lgbbat1ad8j|xn\\-\\-mgb9awbf|xn\\-\\-mgba3a3ejt"
- + "|xn\\-\\-mgba3a4f16a|xn\\-\\-mgbaam7a8h|xn\\-\\-mgbab2bd|xn\\-\\-mgbayh7gpa|xn\\-\\-mgbbh1a71e"
- + "|xn\\-\\-mgbc0a9azcg|xn\\-\\-mgberp4a5d4ar|xn\\-\\-mgbpl2fh|xn\\-\\-mgbtx2b|xn\\-\\-mgbx4cd0ab"
- + "|xn\\-\\-mk1bu44c|xn\\-\\-mxtq1m|xn\\-\\-ngbc5azd|xn\\-\\-node|xn\\-\\-nqv7f|xn\\-\\-nqv7fs00ema"
- + "|xn\\-\\-nyqy26a|xn\\-\\-o3cw4h|xn\\-\\-ogbpf8fl|xn\\-\\-p1acf|xn\\-\\-p1ai|xn\\-\\-pgbs0dh"
- + "|xn\\-\\-pssy2u|xn\\-\\-q9jyb4c|xn\\-\\-qcka1pmc|xn\\-\\-qxam|xn\\-\\-rhqv96g|xn\\-\\-s9brj9c"
- + "|xn\\-\\-ses554g|xn\\-\\-t60b56a|xn\\-\\-tckwe|xn\\-\\-unup4y|xn\\-\\-vermgensberater\\-ctb"
- + "|xn\\-\\-vermgensberatung\\-pwb|xn\\-\\-vhquv|xn\\-\\-vuq861b|xn\\-\\-wgbh1c|xn\\-\\-wgbl6a"
+ + "|xn\\-\\-mgba3a4f16a|xn\\-\\-mgba7c0bbn0a|xn\\-\\-mgbaakc7dvf|xn\\-\\-mgbaam7a8h|xn\\-\\-mgbab2bd"
+ + "|xn\\-\\-mgbah1a3hjkrd|xn\\-\\-mgbai9azgqp6j|xn\\-\\-mgbayh7gpa|xn\\-\\-mgbbh1a|xn\\-\\-mgbbh1a71e"
+ + "|xn\\-\\-mgbc0a9azcg|xn\\-\\-mgbca7dzdo|xn\\-\\-mgbcpq6gpa1a|xn\\-\\-mgberp4a5d4ar|xn\\-\\-mgbgu82a"
+ + "|xn\\-\\-mgbi4ecexp|xn\\-\\-mgbpl2fh|xn\\-\\-mgbt3dhd|xn\\-\\-mgbtx2b|xn\\-\\-mgbx4cd0ab"
+ + "|xn\\-\\-mix891f|xn\\-\\-mk1bu44c|xn\\-\\-mxtq1m|xn\\-\\-ngbc5azd|xn\\-\\-ngbe9e0a|xn\\-\\-ngbrx"
+ + "|xn\\-\\-node|xn\\-\\-nqv7f|xn\\-\\-nqv7fs00ema|xn\\-\\-nyqy26a|xn\\-\\-o3cw4h|xn\\-\\-ogbpf8fl"
+ + "|xn\\-\\-otu796d|xn\\-\\-p1acf|xn\\-\\-p1ai|xn\\-\\-pgbs0dh|xn\\-\\-pssy2u|xn\\-\\-q7ce6a"
+ + "|xn\\-\\-q9jyb4c|xn\\-\\-qcka1pmc|xn\\-\\-qxa6a|xn\\-\\-qxam|xn\\-\\-rhqv96g|xn\\-\\-rovu88b"
+ + "|xn\\-\\-rvc1e0am3e|xn\\-\\-s9brj9c|xn\\-\\-ses554g|xn\\-\\-t60b56a|xn\\-\\-tckwe|xn\\-\\-tiq49xqyj"
+ + "|xn\\-\\-unup4y|xn\\-\\-vermgensberater\\-ctb|xn\\-\\-vermgensberatung\\-pwb|xn\\-\\-vhquv"
+ + "|xn\\-\\-vuq861b|xn\\-\\-w4r85el8fhu5dnra|xn\\-\\-w4rs40l|xn\\-\\-wgbh1c|xn\\-\\-wgbl6a"
+ "|xn\\-\\-xhq521b|xn\\-\\-xkc2al3hye2a|xn\\-\\-xkc2dl3a5ee0h|xn\\-\\-y9a3aq|xn\\-\\-yfro4i67o"
- + "|xn\\-\\-ygbi2ammx|xn\\-\\-zfr164b|xperia|xxx|xyz)"
- + "|(?:yachts|yamaxun|yandex|yodobashi|yoga|yokohama|youtube|y[et])"
- + "|(?:zara|zip|zone|zuerich|z[amw]))";
-
+ + "|xn\\-\\-ygbi2ammx|xn\\-\\-zfr164b|xxx|xyz)"
+ + "|(?:yachts|yahoo|yamaxun|yandex|yodobashi|yoga|yokohama|you|youtube|yun|y[et])"
+ + "|(?:zappos|zara|zero|zip|zone|zuerich|z[amw]))";
/**
* Kept for backward compatibility reasons.
*
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 9f0ad11..6dace15 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -4400,7 +4400,7 @@
* @param drawingPosition the drawing order position.
* @return the container position of a child for this drawing order position.
*
- * @see #getChildDrawingOrder(int, int)}
+ * @see #getChildDrawingOrder(int, int)
*/
public final int getChildDrawingOrder(int drawingPosition) {
return getChildDrawingOrder(getChildCount(), drawingPosition);
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 450bb1e..81320a4 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -13355,6 +13355,9 @@
final ClipDescription description =
getClipboardManagerForUser().getPrimaryClipDescription();
+ if (description == null) {
+ return false;
+ }
final boolean isPlainType = description.hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN);
return (isPlainType && description.isStyledText())
|| description.hasMimeType(ClipDescription.MIMETYPE_TEXT_HTML);
diff --git a/core/java/android/window/flags/windowing_frontend.aconfig b/core/java/android/window/flags/windowing_frontend.aconfig
new file mode 100644
index 0000000..7a4c5bc
--- /dev/null
+++ b/core/java/android/window/flags/windowing_frontend.aconfig
@@ -0,0 +1,8 @@
+package: "com.android.window.flags"
+
+flag {
+ name: "nav_bar_transparent_by_default"
+ namespace: "windowing_frontend"
+ description: "Make nav bar color transparent by default when targeting SDK 35 or greater"
+ bug: "232195501"
+}
diff --git a/core/java/com/android/internal/util/FileRotator.java b/core/java/com/android/internal/util/FileRotator.java
index 5bc48c5..c9d9926 100644
--- a/core/java/com/android/internal/util/FileRotator.java
+++ b/core/java/com/android/internal/util/FileRotator.java
@@ -19,6 +19,9 @@
import android.annotation.NonNull;
import android.os.FileUtils;
import android.util.Log;
+import android.util.Pair;
+
+import libcore.io.IoUtils;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
@@ -28,12 +31,12 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.util.Comparator;
import java.util.Objects;
+import java.util.TreeSet;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
-import libcore.io.IoUtils;
-
/**
* Utility that rotates files over time, similar to {@code logrotate}. There is
* a single "active" file, which is periodically rotated into historical files,
@@ -302,17 +305,24 @@
public void readMatching(Reader reader, long matchStartMillis, long matchEndMillis)
throws IOException {
final FileInfo info = new FileInfo(mPrefix);
+ final TreeSet<Pair<Long, String>> readSet = new TreeSet<>(
+ Comparator.comparingLong(o -> o.first));
for (String name : mBasePath.list()) {
if (!info.parse(name)) continue;
- // read file when it overlaps
+ // Add file to set when it overlaps.
if (info.startMillis <= matchEndMillis && matchStartMillis <= info.endMillis) {
- if (LOGD) Log.d(TAG, "reading matching " + name);
-
- final File file = new File(mBasePath, name);
- readFile(file, reader);
+ readSet.add(new Pair(info.startMillis, name));
}
}
+
+ // Read files in ascending order of start timestamp.
+ for (Pair<Long, String> pair : readSet) {
+ final String name = pair.second;
+ if (LOGD) Log.d(TAG, "reading matching " + name);
+ final File file = new File(mBasePath, name);
+ readFile(file, reader);
+ }
}
/**
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index bbaea0a..418000f 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -1806,15 +1806,10 @@
if (!is_system_server && getuid() == 0) {
const int rc = createProcessGroup(uid, getpid());
if (rc != 0) {
- if (rc == -ESRCH) {
- // If process is dead, treat this as a non-fatal error
- ALOGE("createProcessGroup(%d, %d) failed: %s", uid, /* pid= */ 0, strerror(-rc));
- } else {
- fail_fn(rc == -EROFS ? CREATE_ERROR("createProcessGroup failed, kernel missing "
- "CONFIG_CGROUP_CPUACCT?")
- : CREATE_ERROR("createProcessGroup(%d, %d) failed: %s", uid,
- /* pid= */ 0, strerror(-rc)));
- }
+ fail_fn(rc == -EROFS ? CREATE_ERROR("createProcessGroup failed, kernel missing "
+ "CONFIG_CGROUP_CPUACCT?")
+ : CREATE_ERROR("createProcessGroup(%d, %d) failed: %s", uid,
+ /* pid= */ 0, strerror(-rc)));
}
}
diff --git a/core/tests/coretests/src/android/service/quicksettings/OWNERS b/core/tests/coretests/src/android/service/quicksettings/OWNERS
new file mode 100644
index 0000000..5665490
--- /dev/null
+++ b/core/tests/coretests/src/android/service/quicksettings/OWNERS
@@ -0,0 +1 @@
+include platform/frameworks/base:/core/java/android/service/quicksettings/OWNERS
diff --git a/core/tests/coretests/src/android/util/PatternsTest.java b/core/tests/coretests/src/android/util/PatternsTest.java
index 6cea2f3..dd8f73f 100644
--- a/core/tests/coretests/src/android/util/PatternsTest.java
+++ b/core/tests/coretests/src/android/util/PatternsTest.java
@@ -399,7 +399,7 @@
@SmallTest
public void testAutoLinkWebUrl_doesNotMatchUrlsWithoutProtocolAndWithUnknownTld()
throws Exception {
- String url = "thank.you";
+ String url = "thank.unknowntld";
assertFalse("Should not match URL that does not start with a protocol and " +
"does not contain a known TLD",
Patterns.AUTOLINK_WEB_URL.matcher(url).matches());
@@ -422,7 +422,7 @@
@SmallTest
public void testAutoLinkWebUrl_doesNotMatchUrlsWithEmojiWithoutProtocolAndWithoutKnownTld()
throws Exception {
- String url = "Thank\u263A.you";
+ String url = "Thank\u263A.unknowntld";
assertFalse("Should not match URLs containing emoji and with unknown TLD",
Patterns.AUTOLINK_WEB_URL.matcher(url).matches());
}
diff --git a/core/tests/utiltests/src/com/android/internal/util/FileRotatorTest.java b/core/tests/utiltests/src/com/android/internal/util/FileRotatorTest.java
index 95272132..73e47e16 100644
--- a/core/tests/utiltests/src/com/android/internal/util/FileRotatorTest.java
+++ b/core/tests/utiltests/src/com/android/internal/util/FileRotatorTest.java
@@ -366,6 +366,16 @@
assertReadAll(rotate, "bar");
}
+ public void testReadSorted() throws Exception {
+ write("rotator.1024-2048", "2");
+ write("rotator.2048-4096", "3");
+ write("rotator.512-1024", "1");
+
+ final FileRotator rotate = new FileRotator(
+ mBasePath, PREFIX, SECOND_IN_MILLIS, SECOND_IN_MILLIS);
+ assertReadAll(rotate, "1", "2", "3");
+ }
+
public void testFileSystemInaccessible() throws Exception {
File inaccessibleDir = null;
String dirPath = getContext().getFilesDir() + File.separator + "inaccessible";
@@ -422,16 +432,7 @@
}
public void assertRead(String... expected) {
- assertEquals(expected.length, mActual.size());
-
- final ArrayList<String> actualCopy = new ArrayList<String>(mActual);
- for (String value : expected) {
- if (!actualCopy.remove(value)) {
- final String expectedString = Arrays.toString(expected);
- final String actualString = Arrays.toString(mActual.toArray());
- fail("expected: " + expectedString + " but was: " + actualString);
- }
- }
+ assertEquals(Arrays.asList(expected), mActual);
}
}
}
diff --git a/data/keyboards/qwerty.idc b/data/keyboards/qwerty.idc
deleted file mode 100644
index 375d785..0000000
--- a/data/keyboards/qwerty.idc
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 2010 The Android Open 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.
-
-#
-# Emulator keyboard configuration file #1.
-#
-
-touch.deviceType = touchScreen
-touch.orientationAware = 1
-
-keyboard.layout = qwerty
-keyboard.characterMap = qwerty
-keyboard.orientationAware = 1
-keyboard.builtIn = 1
-
-cursor.mode = navigation
-cursor.orientationAware = 1
diff --git a/data/keyboards/qwerty.kcm b/data/keyboards/qwerty.kcm
deleted file mode 100644
index f3e15241..0000000
--- a/data/keyboards/qwerty.kcm
+++ /dev/null
@@ -1,508 +0,0 @@
-# Copyright (C) 2010 The Android Open 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.
-
-#
-# Emulator keyboard character map #1.
-#
-# This file is no longer used as the platform's default keyboard character map.
-# Refer to Generic.kcm and Virtual.kcm instead.
-#
-
-type ALPHA
-
-key A {
- label: 'A'
- number: '2'
- base: 'a'
- shift, capslock: 'A'
- alt: '#'
- shift+alt, capslock+alt: none
-}
-
-key B {
- label: 'B'
- number: '2'
- base: 'b'
- shift, capslock: 'B'
- alt: '<'
- shift+alt, capslock+alt: none
-}
-
-key C {
- label: 'C'
- number: '2'
- base: 'c'
- shift, capslock: 'C'
- alt: '9'
- shift+alt, capslock+alt: '\u00e7'
-}
-
-key D {
- label: 'D'
- number: '3'
- base: 'd'
- shift, capslock: 'D'
- alt: '5'
- shift+alt, capslock+alt: none
-}
-
-key E {
- label: 'E'
- number: '3'
- base: 'e'
- shift, capslock: 'E'
- alt: '2'
- shift+alt, capslock+alt: '\u0301'
-}
-
-key F {
- label: 'F'
- number: '3'
- base: 'f'
- shift, capslock: 'F'
- alt: '6'
- shift+alt, capslock+alt: '\u00a5'
-}
-
-key G {
- label: 'G'
- number: '4'
- base: 'g'
- shift, capslock: 'G'
- alt: '-'
- shift+alt, capslock+alt: '_'
-}
-
-key H {
- label: 'H'
- number: '4'
- base: 'h'
- shift, capslock: 'H'
- alt: '['
- shift+alt, capslock+alt: '{'
-}
-
-key I {
- label: 'I'
- number: '4'
- base: 'i'
- shift, capslock: 'I'
- alt: '$'
- shift+alt, capslock+alt: '\u0302'
-}
-
-key J {
- label: 'J'
- number: '5'
- base: 'j'
- shift, capslock: 'J'
- alt: ']'
- shift+alt, capslock+alt: '}'
-}
-
-key K {
- label: 'K'
- number: '5'
- base: 'k'
- shift, capslock: 'K'
- alt: '"'
- shift+alt, capslock+alt: '~'
-}
-
-key L {
- label: 'L'
- number: '5'
- base: 'l'
- shift, capslock: 'L'
- alt: '\''
- shift+alt, capslock+alt: '`'
-}
-
-key M {
- label: 'M'
- number: '6'
- base: 'm'
- shift, capslock: 'M'
- alt: '!'
- shift+alt, capslock+alt: none
-}
-
-key N {
- label: 'N'
- number: '6'
- base: 'n'
- shift, capslock: 'N'
- alt: '>'
- shift+alt, capslock+alt: '\u0303'
-}
-
-key O {
- label: 'O'
- number: '6'
- base: 'o'
- shift, capslock: 'O'
- alt: '('
- shift+alt, capslock+alt: none
-}
-
-key P {
- label: 'P'
- number: '7'
- base: 'p'
- shift, capslock: 'P'
- alt: ')'
- shift+alt, capslock+alt: none
-}
-
-key Q {
- label: 'Q'
- number: '7'
- base: 'q'
- shift, capslock: 'Q'
- alt: '*'
- shift+alt, capslock+alt: '\u0300'
-}
-
-key R {
- label: 'R'
- number: '7'
- base: 'r'
- shift, capslock: 'R'
- alt: '3'
- shift+alt, capslock+alt: '\u20ac'
-}
-
-key S {
- label: 'S'
- number: '7'
- base: 's'
- shift, capslock: 'S'
- alt: '4'
- shift+alt, capslock+alt: '\u00df'
-}
-
-key T {
- label: 'T'
- number: '8'
- base: 't'
- shift, capslock: 'T'
- alt: '+'
- shift+alt, capslock+alt: '\u00a3'
-}
-
-key U {
- label: 'U'
- number: '8'
- base: 'u'
- shift, capslock: 'U'
- alt: '&'
- shift+alt, capslock+alt: '\u0308'
-}
-
-key V {
- label: 'V'
- number: '8'
- base: 'v'
- shift, capslock: 'V'
- alt: '='
- shift+alt, capslock+alt: '^'
-}
-
-key W {
- label: 'W'
- number: '9'
- base: 'w'
- shift, capslock: 'W'
- alt: '1'
- shift+alt, capslock+alt: none
-}
-
-key X {
- label: 'X'
- number: '9'
- base: 'x'
- shift, capslock: 'X'
- alt: '8'
- shift+alt, capslock+alt: '\uef00'
-}
-
-key Y {
- label: 'Y'
- number: '9'
- base: 'y'
- shift, capslock: 'Y'
- alt: '%'
- shift+alt, capslock+alt: '\u00a1'
-}
-
-key Z {
- label: 'Z'
- number: '9'
- base: 'z'
- shift, capslock: 'Z'
- alt: '7'
- shift+alt, capslock+alt: none
-}
-
-key COMMA {
- label: ','
- number: ','
- base: ','
- shift: ';'
- alt: ';'
- shift+alt: '|'
-}
-
-key PERIOD {
- label: '.'
- number: '.'
- base: '.'
- shift: ':'
- alt: ':'
- shift+alt: '\u2026'
-}
-
-key AT {
- label: '@'
- number: '0'
- base: '@'
- shift: '0'
- alt: '0'
- shift+alt: '\u2022'
-}
-
-key SLASH {
- label: '/'
- number: '/'
- base: '/'
- shift: '?'
- alt: '?'
- shift+alt: '\\'
-}
-
-key SPACE {
- label: ' '
- number: ' '
- base: ' '
- shift: ' '
- alt: '\uef01'
- shift+alt: '\uef01'
-}
-
-key ENTER {
- label: '\n'
- number: '\n'
- base: '\n'
- shift: '\n'
- alt: '\n'
- shift+alt: '\n'
-}
-
-key TAB {
- label: '\t'
- number: '\t'
- base: '\t'
- shift: '\t'
- alt: '\t'
- shift+alt: '\t'
-}
-
-key 0 {
- label: '0'
- number: '0'
- base: '0'
- shift: ')'
- alt: ')'
- shift+alt: ')'
-}
-
-key 1 {
- label: '1'
- number: '1'
- base: '1'
- shift: '!'
- alt: '!'
- shift+alt: '!'
-}
-
-key 2 {
- label: '2'
- number: '2'
- base: '2'
- shift: '@'
- alt: '@'
- shift+alt: '@'
-}
-
-key 3 {
- label: '3'
- number: '3'
- base: '3'
- shift: '#'
- alt: '#'
- shift+alt: '#'
-}
-
-key 4 {
- label: '4'
- number: '4'
- base: '4'
- shift: '$'
- alt: '$'
- shift+alt: '$'
-}
-
-key 5 {
- label: '5'
- number: '5'
- base: '5'
- shift: '%'
- alt: '%'
- shift+alt: '%'
-}
-
-key 6 {
- label: '6'
- number: '6'
- base: '6'
- shift: '^'
- alt: '^'
- shift+alt: '^'
-}
-
-key 7 {
- label: '7'
- number: '7'
- base: '7'
- shift: '&'
- alt: '&'
- shift+alt: '&'
-}
-
-key 8 {
- label: '8'
- number: '8'
- base: '8'
- shift: '*'
- alt: '*'
- shift+alt: '*'
-}
-
-key 9 {
- label: '9'
- number: '9'
- base: '9'
- shift: '('
- alt: '('
- shift+alt: '('
-}
-
-key GRAVE {
- label: '`'
- number: '`'
- base: '`'
- shift: '~'
- alt: '`'
- shift+alt: '~'
-}
-
-key MINUS {
- label: '-'
- number: '-'
- base: '-'
- shift: '_'
- alt: '-'
- shift+alt: '_'
-}
-
-key EQUALS {
- label: '='
- number: '='
- base: '='
- shift: '+'
- alt: '='
- shift+alt: '+'
-}
-
-key LEFT_BRACKET {
- label: '['
- number: '['
- base: '['
- shift: '{'
- alt: '['
- shift+alt: '{'
-}
-
-key RIGHT_BRACKET {
- label: ']'
- number: ']'
- base: ']'
- shift: '}'
- alt: ']'
- shift+alt: '}'
-}
-
-key BACKSLASH {
- label: '\\'
- number: '\\'
- base: '\\'
- shift: '|'
- alt: '\\'
- shift+alt: '|'
-}
-
-key SEMICOLON {
- label: ';'
- number: ';'
- base: ';'
- shift: ':'
- alt: ';'
- shift+alt: ':'
-}
-
-key APOSTROPHE {
- label: '\''
- number: '\''
- base: '\''
- shift: '"'
- alt: '\''
- shift+alt: '"'
-}
-
-key STAR {
- label: '*'
- number: '*'
- base: '*'
- shift: '*'
- alt: '*'
- shift+alt: '*'
-}
-
-key POUND {
- label: '#'
- number: '#'
- base: '#'
- shift: '#'
- alt: '#'
- shift+alt: '#'
-}
-
-key PLUS {
- label: '+'
- number: '+'
- base: '+'
- shift: '+'
- alt: '+'
- shift+alt: '+'
-}
diff --git a/data/keyboards/qwerty.kl b/data/keyboards/qwerty.kl
deleted file mode 100644
index 2fd99ab..0000000
--- a/data/keyboards/qwerty.kl
+++ /dev/null
@@ -1,131 +0,0 @@
-# Copyright (C) 2010 The Android Open 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.
-
-#
-# Emulator keyboard layout #1.
-#
-# This file is no longer used as the platform's default keyboard layout.
-# Refer to Generic.kl instead.
-#
-
-key 399 GRAVE
-key 2 1
-key 3 2
-key 4 3
-key 5 4
-key 6 5
-key 7 6
-key 8 7
-key 9 8
-key 10 9
-key 11 0
-key 158 BACK
-key 230 SOFT_RIGHT
-key 60 SOFT_LEFT
-key 107 ENDCALL
-key 62 ENDCALL
-key 229 MENU
-key 139 MENU
-key 59 MENU
-key 127 SEARCH
-key 217 SEARCH
-key 228 POUND
-key 227 STAR
-key 231 CALL
-key 61 CALL
-key 232 DPAD_CENTER
-key 108 DPAD_DOWN
-key 103 DPAD_UP
-key 102 HOME
-key 105 DPAD_LEFT
-key 106 DPAD_RIGHT
-key 115 VOLUME_UP
-key 114 VOLUME_DOWN
-key 116 POWER
-key 212 CAMERA
-
-key 16 Q
-key 17 W
-key 18 E
-key 19 R
-key 20 T
-key 21 Y
-key 22 U
-key 23 I
-key 24 O
-key 25 P
-key 26 LEFT_BRACKET
-key 27 RIGHT_BRACKET
-key 43 BACKSLASH
-
-key 30 A
-key 31 S
-key 32 D
-key 33 F
-key 34 G
-key 35 H
-key 36 J
-key 37 K
-key 38 L
-key 39 SEMICOLON
-key 40 APOSTROPHE
-key 14 DEL
-
-key 44 Z
-key 45 X
-key 46 C
-key 47 V
-key 48 B
-key 49 N
-key 50 M
-key 51 COMMA
-key 52 PERIOD
-key 53 SLASH
-key 28 ENTER
-
-key 56 ALT_LEFT
-key 100 ALT_RIGHT
-key 42 SHIFT_LEFT
-key 54 SHIFT_RIGHT
-key 15 TAB
-key 57 SPACE
-key 150 EXPLORER
-key 155 ENVELOPE
-
-key 12 MINUS
-key 13 EQUALS
-key 215 AT
-
-# On an AT keyboard: ESC, F10
-key 1 BACK
-key 68 MENU
-
-# App switch = Overview key
-key 580 APP_SWITCH
-
-# Media control keys
-key 160 MEDIA_CLOSE
-key 161 MEDIA_EJECT
-key 163 MEDIA_NEXT
-key 164 MEDIA_PLAY_PAUSE
-key 165 MEDIA_PREVIOUS
-key 166 MEDIA_STOP
-key 167 MEDIA_RECORD
-key 168 MEDIA_REWIND
-
-key 142 SLEEP
-key 581 STEM_PRIMARY
-key 582 STEM_1
-key 583 STEM_2
-key 584 STEM_3
diff --git a/data/keyboards/qwerty2.idc b/data/keyboards/qwerty2.idc
deleted file mode 100644
index 369205e..0000000
--- a/data/keyboards/qwerty2.idc
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 2010 The Android Open 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.
-
-#
-# Emulator keyboard configuration file #2.
-#
-
-touch.deviceType = touchScreen
-touch.orientationAware = 1
-
-keyboard.layout = qwerty
-keyboard.characterMap = qwerty2
-keyboard.orientationAware = 1
-keyboard.builtIn = 1
-
-cursor.mode = navigation
-cursor.orientationAware = 1
diff --git a/data/keyboards/qwerty2.kcm b/data/keyboards/qwerty2.kcm
deleted file mode 100644
index b981d83..0000000
--- a/data/keyboards/qwerty2.kcm
+++ /dev/null
@@ -1,505 +0,0 @@
-# Copyright (C) 2010 The Android Open 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.
-
-#
-# Emulator keyboard character map #2.
-#
-
-type ALPHA
-
-key A {
- label: 'A'
- number: '2'
- base: 'a'
- shift, capslock: 'A'
- alt: '\u00e1'
- shift+alt, capslock+alt: '\u00c1'
-}
-
-key B {
- label: 'B'
- number: '2'
- base: 'b'
- shift, capslock: 'B'
- alt: 'b'
- shift+alt, capslock+alt: 'B'
-}
-
-key C {
- label: 'C'
- number: '2'
- base: 'c'
- shift, capslock: 'C'
- alt: '\u00a9'
- shift+alt, capslock+alt: '\u00a2'
-}
-
-key D {
- label: 'D'
- number: '3'
- base: 'd'
- shift, capslock: 'D'
- alt: '\u00f0'
- shift+alt, capslock+alt: '\u00d0'
-}
-
-key E {
- label: 'E'
- number: '3'
- base: 'e'
- shift, capslock: 'E'
- alt: '\u00e9'
- shift+alt, capslock+alt: '\u00c9'
-}
-
-key F {
- label: 'F'
- number: '3'
- base: 'f'
- shift, capslock: 'F'
- alt: '['
- shift+alt, capslock+alt: '['
-}
-
-key G {
- label: 'G'
- number: '4'
- base: 'g'
- shift, capslock: 'G'
- alt: ']'
- shift+alt, capslock+alt: ']'
-}
-
-key H {
- label: 'H'
- number: '4'
- base: 'h'
- shift, capslock: 'H'
- alt: '<'
- shift+alt, capslock+alt: '<'
-}
-
-key I {
- label: 'I'
- number: '4'
- base: 'i'
- shift, capslock: 'I'
- alt: '\u00ed'
- shift+alt, capslock+alt: '\u00cd'
-}
-
-key J {
- label: 'J'
- number: '5'
- base: 'j'
- shift, capslock: 'J'
- alt: '>'
- shift+alt, capslock+alt: '>'
-}
-
-key K {
- label: 'K'
- number: '5'
- base: 'k'
- shift, capslock: 'K'
- alt: ';'
- shift+alt, capslock+alt: '~'
-}
-
-key L {
- label: 'L'
- number: '5'
- base: 'l'
- shift, capslock: 'L'
- alt: '\u00f8'
- shift+alt, capslock+alt: '\u00d8'
-}
-
-key M {
- label: 'M'
- number: '6'
- base: 'm'
- shift, capslock: 'M'
- alt: '\u00b5'
- shift+alt, capslock+alt: none
-}
-
-key N {
- label: 'N'
- number: '6'
- base: 'n'
- shift, capslock: 'N'
- alt: '\u00f1'
- shift+alt, capslock+alt: '\u00d1'
-}
-
-key O {
- label: 'O'
- number: '6'
- base: 'o'
- shift, capslock: 'O'
- alt: '\u00f3'
- shift+alt, capslock+alt: '\u00d3'
-}
-
-key P {
- label: 'P'
- number: '7'
- base: 'p'
- shift, capslock: 'P'
- alt: '\u00f6'
- shift+alt, capslock+alt: '\u00d6'
-}
-
-key Q {
- label: 'Q'
- number: '7'
- base: 'q'
- shift, capslock: 'Q'
- alt: '\u00e4'
- shift+alt, capslock+alt: '\u00c4'
-}
-
-key R {
- label: 'R'
- number: '7'
- base: 'r'
- shift, capslock: 'R'
- alt: '\u00ae'
- shift+alt, capslock+alt: 'R'
-}
-
-key S {
- label: 'S'
- number: '7'
- base: 's'
- shift, capslock: 'S'
- alt: '\u00df'
- shift+alt, capslock+alt: '\u00a7'
-}
-
-key T {
- label: 'T'
- number: '8'
- base: 't'
- shift, capslock: 'T'
- alt: '\u00fe'
- shift+alt, capslock+alt: '\u00de'
-}
-
-key U {
- label: 'U'
- number: '8'
- base: 'u'
- shift, capslock: 'U'
- alt: '\u00fa'
- shift+alt, capslock+alt: '\u00da'
-}
-
-key V {
- label: 'V'
- number: '8'
- base: 'v'
- shift, capslock: 'V'
- alt: 'v'
- shift+alt, capslock+alt: 'V'
-}
-
-key W {
- label: 'W'
- number: '9'
- base: 'w'
- shift, capslock: 'W'
- alt: '\u00e5'
- shift+alt, capslock+alt: '\u00c5'
-}
-
-key X {
- label: 'X'
- number: '9'
- base: 'x'
- shift, capslock: 'X'
- alt: 'x'
- shift+alt, capslock+alt: '\uef00'
-}
-
-key Y {
- label: 'Y'
- number: '9'
- base: 'y'
- shift, capslock: 'Y'
- alt: '\u00fc'
- shift+alt, capslock+alt: '\u00dc'
-}
-
-key Z {
- label: 'Z'
- number: '9'
- base: 'z'
- shift, capslock: 'Z'
- alt: '\u00e6'
- shift+alt, capslock+alt: '\u00c6'
-}
-
-key COMMA {
- label: ','
- number: ','
- base: ','
- shift: '<'
- alt: '\u00e7'
- shift+alt: '\u00c7'
-}
-
-key PERIOD {
- label: '.'
- number: '.'
- base: '.'
- shift: '>'
- alt: '.'
- shift+alt: '\u2026'
-}
-
-key AT {
- label: '@'
- number: '@'
- base: '@'
- shift: '@'
- alt: '@'
- shift+alt: '\u2022'
-}
-
-key SLASH {
- label: '/'
- number: '/'
- base: '/'
- shift: '?'
- alt: '\u00bf'
- shift+alt: '?'
-}
-
-key SPACE {
- label: ' '
- number: ' '
- base: ' '
- shift: ' '
- alt: '\uef01'
- shift+alt: '\uef01'
-}
-
-key ENTER {
- label: '\n'
- number: '\n'
- base: '\n'
- shift: '\n'
- alt: '\n'
- shift+alt: '\n'
-}
-
-key TAB {
- label: '\t'
- number: '\t'
- base: '\t'
- shift: '\t'
- alt: '\t'
- shift+alt: '\t'
-}
-
-key 0 {
- label: '0'
- number: '0'
- base: '0'
- shift: ')'
- alt: '\u02bc'
- shift+alt: ')'
-}
-
-key 1 {
- label: '1'
- number: '1'
- base: '1'
- shift: '!'
- alt: '\u00a1'
- shift+alt: '\u00b9'
-}
-
-key 2 {
- label: '2'
- number: '2'
- base: '2'
- shift: '@'
- alt: '\u00b2'
- shift+alt: '@'
-}
-
-key 3 {
- label: '3'
- number: '3'
- base: '3'
- shift: '#'
- alt: '\u00b3'
- shift+alt: '#'
-}
-
-key 4 {
- label: '4'
- number: '4'
- base: '4'
- shift: '$'
- alt: '\u00a4'
- shift+alt: '\u00a3'
-}
-
-key 5 {
- label: '5'
- number: '5'
- base: '5'
- shift: '%'
- alt: '\u20ac'
- shift+alt: '%'
-}
-
-key 6 {
- label: '6'
- number: '6'
- base: '6'
- shift: '^'
- alt: '\u00bc'
- shift+alt: '\u0302'
-}
-
-key 7 {
- label: '7'
- number: '7'
- base: '7'
- shift: '&'
- alt: '\u00bd'
- shift+alt: '&'
-}
-
-key 8 {
- label: '8'
- number: '8'
- base: '8'
- shift: '*'
- alt: '\u00be'
- shift+alt: '*'
-}
-
-key 9 {
- label: '9'
- number: '9'
- base: '9'
- shift: '('
- alt: '\u02bb'
- shift+alt: '('
-}
-
-key GRAVE {
- label: '`'
- number: '`'
- base: '`'
- shift: '~'
- alt: '\u0300'
- shift+alt: '\u0303'
-}
-
-key MINUS {
- label: '-'
- number: '-'
- base: '-'
- shift: '_'
- alt: '\u00a5'
- shift+alt: '_'
-}
-
-key EQUALS {
- label: '='
- number: '='
- base: '='
- shift: '+'
- alt: '\u00d7'
- shift+alt: '\u00f7'
-}
-
-key LEFT_BRACKET {
- label: '['
- number: '['
- base: '['
- shift: '{'
- alt: '\u00ab'
- shift+alt: '{'
-}
-
-key RIGHT_BRACKET {
- label: ']'
- number: ']'
- base: ']'
- shift: '}'
- alt: '\u00bb'
- shift+alt: '}'
-}
-
-key BACKSLASH {
- label: '\\'
- number: '\\'
- base: '\\'
- shift: '|'
- alt: '\u00ac'
- shift+alt: '\u00a6'
-}
-
-key SEMICOLON {
- label: ';'
- number: ';'
- base: ';'
- shift: ':'
- alt: '\u00b6'
- shift+alt: '\u00b0'
-}
-
-key APOSTROPHE {
- label: '\''
- number: '\''
- base: '\''
- shift: '"'
- alt: '\u0301'
- shift+alt: '\u0308'
-}
-
-key STAR {
- label: '*'
- number: '*'
- base: '*'
- shift: '*'
- alt: '*'
- shift+alt: '*'
-}
-
-key POUND {
- label: '#'
- number: '#'
- base: '#'
- shift: '#'
- alt: '#'
- shift+alt: '#'
-}
-
-key PLUS {
- label: '+'
- number: '+'
- base: '+'
- shift: '+'
- alt: '+'
- shift+alt: '+'
-}
diff --git a/keystore/java/android/security/AndroidKeyStoreMaintenance.java b/keystore/java/android/security/AndroidKeyStoreMaintenance.java
index 919a93b..0f3488b 100644
--- a/keystore/java/android/security/AndroidKeyStoreMaintenance.java
+++ b/keystore/java/android/security/AndroidKeyStoreMaintenance.java
@@ -20,6 +20,7 @@
import android.annotation.Nullable;
import android.os.ServiceManager;
import android.os.ServiceSpecificException;
+import android.os.StrictMode;
import android.security.maintenance.IKeystoreMaintenance;
import android.system.keystore2.Domain;
import android.system.keystore2.KeyDescriptor;
@@ -51,6 +52,7 @@
* @hide
*/
public static int onUserAdded(@NonNull int userId) {
+ StrictMode.noteDiskWrite();
try {
getService().onUserAdded(userId);
return 0;
@@ -71,6 +73,7 @@
* @hide
*/
public static int onUserRemoved(int userId) {
+ StrictMode.noteDiskWrite();
try {
getService().onUserRemoved(userId);
return 0;
@@ -93,6 +96,7 @@
* @hide
*/
public static int onUserPasswordChanged(int userId, @Nullable byte[] password) {
+ StrictMode.noteDiskWrite();
try {
getService().onUserPasswordChanged(userId, password);
return 0;
@@ -110,6 +114,7 @@
* be cleared.
*/
public static int clearNamespace(@Domain int domain, long namespace) {
+ StrictMode.noteDiskWrite();
try {
getService().clearNamespace(domain, namespace);
return 0;
@@ -129,6 +134,7 @@
* @return UserState enum variant as integer if successful or an error
*/
public static int getState(int userId) {
+ StrictMode.noteDiskRead();
try {
return getService().getState(userId);
} catch (ServiceSpecificException e) {
@@ -144,6 +150,7 @@
* Informs Keystore 2.0 that an off body event was detected.
*/
public static void onDeviceOffBody() {
+ StrictMode.noteDiskWrite();
try {
getService().onDeviceOffBody();
} catch (Exception e) {
@@ -172,6 +179,7 @@
* * SYSTEM_ERROR if an unexpected error occurred.
*/
public static int migrateKeyNamespace(KeyDescriptor source, KeyDescriptor destination) {
+ StrictMode.noteDiskWrite();
try {
getService().migrateKeyNamespace(source, destination);
return 0;
diff --git a/keystore/java/android/security/Authorization.java b/keystore/java/android/security/Authorization.java
index 00219e7..2d2dd24 100644
--- a/keystore/java/android/security/Authorization.java
+++ b/keystore/java/android/security/Authorization.java
@@ -22,6 +22,7 @@
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ServiceSpecificException;
+import android.os.StrictMode;
import android.security.authorization.IKeystoreAuthorization;
import android.security.authorization.LockScreenEvent;
import android.system.keystore2.ResponseCode;
@@ -48,6 +49,7 @@
* @return 0 if successful or {@code ResponseCode.SYSTEM_ERROR}.
*/
public static int addAuthToken(@NonNull HardwareAuthToken authToken) {
+ StrictMode.noteSlowCall("addAuthToken");
try {
getService().addAuthToken(authToken);
return 0;
@@ -81,6 +83,7 @@
*/
public static int onLockScreenEvent(@NonNull boolean locked, @NonNull int userId,
@Nullable byte[] syntheticPassword, @Nullable long[] unlockingSids) {
+ StrictMode.noteDiskWrite();
try {
if (locked) {
getService().onLockScreenEvent(LockScreenEvent.LOCK, userId, null, unlockingSids);
diff --git a/keystore/java/android/security/KeyStore.java b/keystore/java/android/security/KeyStore.java
index 8811a7f..8045f55 100644
--- a/keystore/java/android/security/KeyStore.java
+++ b/keystore/java/android/security/KeyStore.java
@@ -18,6 +18,7 @@
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
+import android.os.StrictMode;
import android.os.UserHandle;
import android.security.maintenance.UserState;
@@ -126,6 +127,8 @@
* a {@code KeymasterDefs.KM_ERROR_} value or {@code KeyStore} ResponseCode.
*/
public int addAuthToken(byte[] authToken) {
+ StrictMode.noteDiskWrite();
+
return Authorization.addAuthToken(authToken);
}
diff --git a/keystore/java/android/security/KeyStore2.java b/keystore/java/android/security/KeyStore2.java
index 74597c5..2661b61 100644
--- a/keystore/java/android/security/KeyStore2.java
+++ b/keystore/java/android/security/KeyStore2.java
@@ -23,6 +23,7 @@
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ServiceSpecificException;
+import android.os.StrictMode;
import android.security.keymaster.KeymasterDefs;
import android.system.keystore2.Domain;
import android.system.keystore2.IKeystoreService;
@@ -147,6 +148,8 @@
}
void delete(KeyDescriptor descriptor) throws KeyStoreException {
+ StrictMode.noteDiskWrite();
+
handleRemoteExceptionWithRetry((service) -> {
service.deleteKey(descriptor);
return 0;
@@ -157,6 +160,8 @@
* List all entries in the keystore for in the given namespace.
*/
public KeyDescriptor[] list(int domain, long namespace) throws KeyStoreException {
+ StrictMode.noteDiskRead();
+
return handleRemoteExceptionWithRetry((service) -> service.listEntries(domain, namespace));
}
@@ -165,6 +170,8 @@
*/
public KeyDescriptor[] listBatch(int domain, long namespace, String startPastAlias)
throws KeyStoreException {
+ StrictMode.noteDiskRead();
+
return handleRemoteExceptionWithRetry(
(service) -> service.listEntriesBatched(domain, namespace, startPastAlias));
}
@@ -227,6 +234,8 @@
*/
public KeyDescriptor grant(KeyDescriptor descriptor, int granteeUid, int accessVector)
throws KeyStoreException {
+ StrictMode.noteDiskWrite();
+
return handleRemoteExceptionWithRetry(
(service) -> service.grant(descriptor, granteeUid, accessVector)
);
@@ -242,6 +251,8 @@
*/
public void ungrant(KeyDescriptor descriptor, int granteeUid)
throws KeyStoreException {
+ StrictMode.noteDiskWrite();
+
handleRemoteExceptionWithRetry((service) -> {
service.ungrant(descriptor, granteeUid);
return 0;
@@ -258,6 +269,8 @@
*/
public KeyEntryResponse getKeyEntry(@NonNull KeyDescriptor descriptor)
throws KeyStoreException {
+ StrictMode.noteDiskRead();
+
return handleRemoteExceptionWithRetry((service) -> service.getKeyEntry(descriptor));
}
@@ -289,6 +302,8 @@
*/
public void updateSubcomponents(@NonNull KeyDescriptor key, byte[] publicCert,
byte[] publicCertChain) throws KeyStoreException {
+ StrictMode.noteDiskWrite();
+
handleRemoteExceptionWithRetry((service) -> {
service.updateSubcomponent(key, publicCert, publicCertChain);
return 0;
@@ -304,6 +319,8 @@
*/
public void deleteKey(@NonNull KeyDescriptor descriptor)
throws KeyStoreException {
+ StrictMode.noteDiskWrite();
+
handleRemoteExceptionWithRetry((service) -> {
service.deleteKey(descriptor);
return 0;
@@ -314,6 +331,8 @@
* Returns the number of Keystore entries for a given domain and namespace.
*/
public int getNumberOfEntries(int domain, long namespace) throws KeyStoreException {
+ StrictMode.noteDiskRead();
+
return handleRemoteExceptionWithRetry((service)
-> service.getNumberOfEntries(domain, namespace));
}
diff --git a/keystore/java/android/security/KeyStoreOperation.java b/keystore/java/android/security/KeyStoreOperation.java
index 737ff2b..7c9b8eb 100644
--- a/keystore/java/android/security/KeyStoreOperation.java
+++ b/keystore/java/android/security/KeyStoreOperation.java
@@ -21,6 +21,7 @@
import android.os.Binder;
import android.os.RemoteException;
import android.os.ServiceSpecificException;
+import android.os.StrictMode;
import android.security.keymaster.KeymasterDefs;
import android.system.keystore2.IKeystoreOperation;
import android.system.keystore2.ResponseCode;
@@ -97,6 +98,7 @@
* @throws KeyStoreException
*/
public void updateAad(@NonNull byte[] input) throws KeyStoreException {
+ StrictMode.noteSlowCall("updateAad");
handleExceptions(() -> {
mOperation.updateAad(input);
return 0;
@@ -112,6 +114,7 @@
* @hide
*/
public byte[] update(@NonNull byte[] input) throws KeyStoreException {
+ StrictMode.noteSlowCall("update");
return handleExceptions(() -> mOperation.update(input));
}
@@ -125,6 +128,7 @@
* @hide
*/
public byte[] finish(byte[] input, byte[] signature) throws KeyStoreException {
+ StrictMode.noteSlowCall("finish");
return handleExceptions(() -> mOperation.finish(input, signature));
}
@@ -135,6 +139,7 @@
* @hide
*/
public void abort() throws KeyStoreException {
+ StrictMode.noteSlowCall("abort");
handleExceptions(() -> {
mOperation.abort();
return 0;
diff --git a/keystore/java/android/security/KeyStoreSecurityLevel.java b/keystore/java/android/security/KeyStoreSecurityLevel.java
index 9c0b46c..6ab148a 100644
--- a/keystore/java/android/security/KeyStoreSecurityLevel.java
+++ b/keystore/java/android/security/KeyStoreSecurityLevel.java
@@ -22,6 +22,7 @@
import android.os.Binder;
import android.os.RemoteException;
import android.os.ServiceSpecificException;
+import android.os.StrictMode;
import android.security.keystore.BackendBusyException;
import android.security.keystore.KeyStoreConnectException;
import android.system.keystore2.AuthenticatorSpec;
@@ -75,6 +76,7 @@
*/
public KeyStoreOperation createOperation(@NonNull KeyDescriptor keyDescriptor,
Collection<KeyParameter> args) throws KeyStoreException {
+ StrictMode.noteDiskWrite();
while (true) {
try {
CreateOperationResponse createOperationResponse =
@@ -142,6 +144,8 @@
public KeyMetadata generateKey(@NonNull KeyDescriptor descriptor, KeyDescriptor attestationKey,
Collection<KeyParameter> args, int flags, byte[] entropy)
throws KeyStoreException {
+ StrictMode.noteDiskWrite();
+
return handleExceptions(() -> mSecurityLevel.generateKey(
descriptor, attestationKey, args.toArray(new KeyParameter[args.size()]),
flags, entropy));
@@ -163,6 +167,8 @@
public KeyMetadata importKey(KeyDescriptor descriptor, KeyDescriptor attestationKey,
Collection<KeyParameter> args, int flags, byte[] keyData)
throws KeyStoreException {
+ StrictMode.noteDiskWrite();
+
return handleExceptions(() -> mSecurityLevel.importKey(descriptor, attestationKey,
args.toArray(new KeyParameter[args.size()]), flags, keyData));
}
@@ -186,6 +192,7 @@
@NonNull byte[] wrappedKey, byte[] maskingKey,
Collection<KeyParameter> args, @NonNull AuthenticatorSpec[] authenticatorSpecs)
throws KeyStoreException {
+ StrictMode.noteDiskWrite();
KeyDescriptor keyDescriptor = new KeyDescriptor();
keyDescriptor.alias = wrappedKeyDescriptor.alias;
keyDescriptor.nspace = wrappedKeyDescriptor.nspace;
diff --git a/keystore/java/android/security/LegacyVpnProfileStore.java b/keystore/java/android/security/LegacyVpnProfileStore.java
index c85b6b1..0cc4dfa 100644
--- a/keystore/java/android/security/LegacyVpnProfileStore.java
+++ b/keystore/java/android/security/LegacyVpnProfileStore.java
@@ -19,6 +19,7 @@
import android.annotation.NonNull;
import android.os.ServiceManager;
import android.os.ServiceSpecificException;
+import android.os.StrictMode;
import android.security.legacykeystore.ILegacyKeystore;
import android.util.Log;
@@ -51,6 +52,7 @@
* @hide
*/
public static boolean put(@NonNull String alias, @NonNull byte[] profile) {
+ StrictMode.noteDiskWrite();
try {
getService().put(alias, ILegacyKeystore.UID_SELF, profile);
return true;
@@ -70,6 +72,7 @@
* @hide
*/
public static byte[] get(@NonNull String alias) {
+ StrictMode.noteDiskRead();
try {
return getService().get(alias, ILegacyKeystore.UID_SELF);
} catch (ServiceSpecificException e) {
@@ -89,6 +92,7 @@
* @hide
*/
public static boolean remove(@NonNull String alias) {
+ StrictMode.noteDiskWrite();
try {
getService().remove(alias, ILegacyKeystore.UID_SELF);
return true;
@@ -109,6 +113,7 @@
* @hide
*/
public static @NonNull String[] list(@NonNull String prefix) {
+ StrictMode.noteDiskRead();
try {
final String[] aliases = getService().list(prefix, ILegacyKeystore.UID_SELF);
for (int i = 0; i < aliases.length; ++i) {
diff --git a/keystore/java/android/security/SystemKeyStore.java b/keystore/java/android/security/SystemKeyStore.java
index e07eaa2..d481a07 100644
--- a/keystore/java/android/security/SystemKeyStore.java
+++ b/keystore/java/android/security/SystemKeyStore.java
@@ -18,6 +18,9 @@
import android.os.Environment;
import android.os.FileUtils;
+import android.os.StrictMode;
+
+import libcore.io.IoUtils;
import java.io.File;
import java.io.FileOutputStream;
@@ -28,8 +31,6 @@
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
-import libcore.io.IoUtils;
-
/**
*@hide
*/
@@ -69,6 +70,7 @@
public byte[] generateNewKey(int numBits, String algName, String keyName)
throws NoSuchAlgorithmException {
+ StrictMode.noteDiskWrite();
// Check if key with similar name exists. If so, return null.
File keyFile = getKeyFile(keyName);
@@ -103,6 +105,7 @@
}
private File getKeyFile(String keyName) {
+ StrictMode.noteDiskWrite();
File sysKeystoreDir = new File(Environment.getDataDirectory(),
SYSTEM_KEYSTORE_DIRECTORY);
File keyFile = new File(sysKeystoreDir, keyName + KEY_FILE_EXTENSION);
@@ -114,6 +117,7 @@
}
public byte[] retrieveKey(String keyName) throws IOException {
+ StrictMode.noteDiskRead();
File keyFile = getKeyFile(keyName);
if (!keyFile.exists()) {
return null;
@@ -122,6 +126,7 @@
}
public void deleteKey(String keyName) {
+ StrictMode.noteDiskWrite();
// Get the file first.
File keyFile = getKeyFile(keyName);
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreCipherSpiBase.java b/keystore/java/android/security/keystore2/AndroidKeyStoreCipherSpiBase.java
index d129891..9ac0f6d 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreCipherSpiBase.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreCipherSpiBase.java
@@ -20,6 +20,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.hardware.security.keymint.KeyParameter;
+import android.os.StrictMode;
import android.security.KeyStoreException;
import android.security.KeyStoreOperation;
import android.security.keymaster.KeymasterDefs;
@@ -137,6 +138,7 @@
if (!(key instanceof AndroidKeyStorePrivateKey)
&& (key instanceof PrivateKey || key instanceof PublicKey)) {
try {
+ StrictMode.noteSlowCall("engineInit");
mCipher = Cipher.getInstance(getTransform());
String transform = getTransform();
@@ -203,6 +205,7 @@
if (!(key instanceof AndroidKeyStorePrivateKey)
&& (key instanceof PrivateKey || key instanceof PublicKey)) {
try {
+ StrictMode.noteSlowCall("engineInit");
mCipher = Cipher.getInstance(getTransform());
mCipher.init(opmode, key, params, random);
return;
@@ -233,6 +236,7 @@
if (!(key instanceof AndroidKeyStorePrivateKey)
&& (key instanceof PrivateKey || key instanceof PublicKey)) {
try {
+ StrictMode.noteSlowCall("engineInit");
mCipher = Cipher.getInstance(getTransform());
mCipher.init(opmode, key, params, random);
return;
@@ -346,6 +350,7 @@
parameters.add(KeyStore2ParameterUtils.makeEnum(KeymasterDefs.KM_TAG_PURPOSE, purpose));
try {
+ StrictMode.noteDiskRead();
mOperation = mKey.getSecurityLevel().createOperation(
mKey.getKeyIdDescriptor(),
parameters
@@ -521,6 +526,7 @@
@Override
protected final void engineUpdateAAD(byte[] input, int inputOffset, int inputLen) {
if (mCipher != null) {
+ StrictMode.noteSlowCall("engineUpdateAAD");
mCipher.updateAAD(input, inputOffset, inputLen);
return;
}
@@ -562,6 +568,7 @@
@Override
protected final void engineUpdateAAD(ByteBuffer src) {
if (mCipher != null) {
+ StrictMode.noteSlowCall("engineUpdateAAD");
mCipher.updateAAD(src);
return;
}
@@ -715,6 +722,7 @@
throw new NullPointerException("key == null");
}
byte[] encoded = null;
+ StrictMode.noteSlowCall("engineWrap");
if (key instanceof SecretKey) {
if ("RAW".equalsIgnoreCase(key.getFormat())) {
encoded = key.getEncoded();
@@ -807,6 +815,7 @@
throw new InvalidKeyException("Failed to unwrap key", e);
}
+ StrictMode.noteSlowCall("engineUnwrap");
switch (wrappedKeyType) {
case Cipher.SECRET_KEY:
{
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreECDSASignatureSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreECDSASignatureSpi.java
index ace2053..9d3fca8 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreECDSASignatureSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreECDSASignatureSpi.java
@@ -195,7 +195,7 @@
protected final void initKey(AndroidKeyStoreKey key) throws InvalidKeyException {
if (!ACCEPTED_SIGNING_SCHEMES.contains(key.getAlgorithm().toLowerCase())) {
throw new InvalidKeyException("Unsupported key algorithm: " + key.getAlgorithm()
- + ". Only" + Arrays.toString(ACCEPTED_SIGNING_SCHEMES.stream().toArray())
+ + ". Only " + Arrays.toString(ACCEPTED_SIGNING_SCHEMES.stream().toArray())
+ " supported");
}
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreKeyAgreementSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreKeyAgreementSpi.java
index 7292cd3..66e9f71 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreKeyAgreementSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreKeyAgreementSpi.java
@@ -20,6 +20,7 @@
import android.hardware.security.keymint.KeyParameter;
import android.hardware.security.keymint.KeyPurpose;
import android.hardware.security.keymint.Tag;
+import android.os.StrictMode;
import android.security.KeyStoreException;
import android.security.KeyStoreOperation;
import android.security.keystore.KeyStoreCryptoOperation;
@@ -174,6 +175,7 @@
}
byte[] otherPartyKeyEncoded = mOtherPartyKey.getEncoded();
+ StrictMode.noteSlowCall("engineGenerateSecret");
try {
return mOperation.finish(otherPartyKeyEncoded, null);
} catch (KeyStoreException e) {
@@ -245,6 +247,7 @@
Tag.PURPOSE, KeyPurpose.AGREE_KEY
));
+ StrictMode.noteDiskWrite();
try {
mOperation =
mKey.getSecurityLevel().createOperation(mKey.getKeyIdDescriptor(), parameters);
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreKeyGeneratorSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreKeyGeneratorSpi.java
index f1681ec..d283b05 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreKeyGeneratorSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreKeyGeneratorSpi.java
@@ -18,6 +18,7 @@
import android.hardware.security.keymint.KeyParameter;
import android.hardware.security.keymint.SecurityLevel;
+import android.os.StrictMode;
import android.security.KeyStore2;
import android.security.KeyStoreSecurityLevel;
import android.security.keymaster.KeymasterDefs;
@@ -281,6 +282,7 @@
@Override
protected SecretKey engineGenerateKey() {
+ StrictMode.noteSlowCall("engineGenerateKey");
KeyGenParameterSpec spec = mSpec;
if (spec == null) {
throw new IllegalStateException("Not initialized");
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreKeyPairGeneratorSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreKeyPairGeneratorSpi.java
index 474b7ea..1398da3 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreKeyPairGeneratorSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreKeyPairGeneratorSpi.java
@@ -27,6 +27,7 @@
import android.hardware.security.keymint.SecurityLevel;
import android.hardware.security.keymint.Tag;
import android.os.Build;
+import android.os.StrictMode;
import android.security.KeyPairGeneratorSpec;
import android.security.KeyStore2;
import android.security.KeyStoreException;
@@ -617,6 +618,7 @@
@Override
public KeyPair generateKeyPair() {
+ StrictMode.noteSlowCall("generateKeyPair");
if (mKeyStore == null || mSpec == null) {
throw new IllegalStateException("Not initialized");
}
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreRSASignatureSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreRSASignatureSpi.java
index 931c2f8..d5fb49a 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreRSASignatureSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreRSASignatureSpi.java
@@ -189,7 +189,7 @@
protected final void initKey(AndroidKeyStoreKey key) throws InvalidKeyException {
if (!KeyProperties.KEY_ALGORITHM_RSA.equalsIgnoreCase(key.getAlgorithm())) {
throw new InvalidKeyException("Unsupported key algorithm: " + key.getAlgorithm()
- + ". Only" + KeyProperties.KEY_ALGORITHM_RSA + " supported");
+ + ". Only " + KeyProperties.KEY_ALGORITHM_RSA + " supported");
}
super.initKey(key);
}
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
index ced58a2..eef8179 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
@@ -24,6 +24,7 @@
import android.hardware.security.keymint.HardwareAuthenticatorType;
import android.hardware.security.keymint.KeyParameter;
import android.hardware.security.keymint.SecurityLevel;
+import android.os.StrictMode;
import android.security.GateKeeper;
import android.security.KeyStore2;
import android.security.KeyStoreParameter;
@@ -164,6 +165,7 @@
KeyDescriptor descriptor = makeKeyDescriptor(alias);
try {
+ StrictMode.noteDiskRead();
return mKeyStore.getKeyEntry(descriptor);
} catch (android.security.KeyStoreException e) {
if (e.getErrorCode() != ResponseCode.KEY_NOT_FOUND) {
@@ -447,6 +449,7 @@
assertCanReplace(alias, targetDomain, mNamespace, descriptor);
try {
+ StrictMode.noteDiskWrite();
mKeyStore.updateSubcomponents(
((AndroidKeyStorePrivateKey) key).getKeyIdDescriptor(),
userCertBytes, chainBytes);
@@ -597,6 +600,7 @@
importArgs, flags, pkcs8EncodedPrivateKeyBytes);
try {
+ StrictMode.noteDiskWrite();
mKeyStore.updateSubcomponents(metadata.key, userCertBytes, chainBytes);
} catch (android.security.KeyStoreException e) {
mKeyStore.deleteKey(metadata.key);
@@ -932,6 +936,7 @@
KeyEntryResponse response = null;
try {
+ StrictMode.noteDiskRead();
response = mKeyStore.getKeyEntry(wrappingkey);
} catch (android.security.KeyStoreException e) {
throw new KeyStoreException("Failed to import wrapped key. Keystore error code: "
@@ -988,6 +993,7 @@
}
try {
+ StrictMode.noteDiskWrite();
securityLevel.importWrappedKey(
wrappedKey, wrappingkey,
entry.getWrappedKeyBytes(),
@@ -1048,6 +1054,7 @@
}
try {
+ StrictMode.noteDiskWrite();
mKeyStore.updateSubcomponents(makeKeyDescriptor(alias),
null /* publicCert - unused when used as pure certificate store. */,
encoded);
@@ -1060,6 +1067,7 @@
public void engineDeleteEntry(String alias) throws KeyStoreException {
KeyDescriptor descriptor = makeKeyDescriptor(alias);
try {
+ StrictMode.noteDiskWrite();
mKeyStore.deleteKey(descriptor);
} catch (android.security.KeyStoreException e) {
if (e.getErrorCode() != ResponseCode.KEY_NOT_FOUND) {
@@ -1070,6 +1078,7 @@
private KeyDescriptor[] getAliasesBatch(String startPastAlias) {
try {
+ StrictMode.noteDiskRead();
return mKeyStore.listBatch(
getTargetDomain(),
mNamespace,
@@ -1097,6 +1106,7 @@
@Override
public int engineSize() {
try {
+ StrictMode.noteDiskRead();
return mKeyStore.getNumberOfEntries(
getTargetDomain(),
mNamespace
@@ -1160,6 +1170,7 @@
KeyDescriptor[] keyDescriptors = null;
try {
+ StrictMode.noteDiskRead();
keyDescriptors = mKeyStore.list(
getTargetDomain(),
mNamespace
diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp
index fd6e18e..68befff 100644
--- a/libs/androidfw/AssetManager.cpp
+++ b/libs/androidfw/AssetManager.cpp
@@ -812,10 +812,10 @@
/* check the appropriate Zip file */
ZipFileRO* pZip = getZipFileLocked(ap);
if (pZip != NULL) {
- ALOGV("GOT zip, checking NA '%s'", (const char*) path);
+ ALOGV("GOT zip, checking NA '%s'", path.c_str());
ZipEntryRO entry = pZip->findEntryByName(path.c_str());
if (entry != NULL) {
- ALOGV("FOUND NA in Zip file for %s", (const char*) path);
+ ALOGV("FOUND NA in Zip file for %s", path.c_str());
pAsset = openAssetFromZipLocked(pZip, entry, mode, path);
pZip->releaseEntry(entry);
}
@@ -1425,7 +1425,7 @@
mResourceTableAsset(NULL), mResourceTable(NULL)
{
if (kIsDebug) {
- ALOGI("Creating SharedZip %p %s\n", this, (const char*)mPath);
+ ALOGI("Creating SharedZip %p %s\n", this, mPath.c_str());
}
ALOGV("+++ opening zip '%s'\n", mPath.c_str());
mZipFile = ZipFileRO::open(mPath.c_str());
@@ -1439,7 +1439,7 @@
mResourceTableAsset(NULL), mResourceTable(NULL)
{
if (kIsDebug) {
- ALOGI("Creating SharedZip %p fd=%d %s\n", this, fd, (const char*)mPath);
+ ALOGI("Creating SharedZip %p fd=%d %s\n", this, fd, mPath.c_str());
}
ALOGV("+++ opening zip fd=%d '%s'\n", fd, mPath.c_str());
mZipFile = ZipFileRO::openFd(fd, mPath.c_str());
@@ -1453,7 +1453,7 @@
bool createIfNotPresent)
{
AutoMutex _l(gLock);
- time_t modWhen = getFileModDate(path);
+ time_t modWhen = getFileModDate(path.c_str());
sp<SharedZip> zip = gOpen.valueFor(path).promote();
if (zip != NULL && zip->mModWhen == modWhen) {
return zip;
@@ -1541,7 +1541,7 @@
AssetManager::SharedZip::~SharedZip()
{
if (kIsDebug) {
- ALOGI("Destroying SharedZip %p %s\n", this, (const char*)mPath);
+ ALOGI("Destroying SharedZip %p %s\n", this, mPath.c_str());
}
if (mResourceTable != NULL) {
delete mResourceTable;
diff --git a/libs/androidfw/AssetManager2.cpp b/libs/androidfw/AssetManager2.cpp
index fc9dd14..daed277 100644
--- a/libs/androidfw/AssetManager2.cpp
+++ b/libs/androidfw/AssetManager2.cpp
@@ -99,6 +99,13 @@
StringPoolRef entry_string_ref;
};
+struct Theme::Entry {
+ uint32_t attr_res_id;
+ ApkAssetsCookie cookie;
+ uint32_t type_spec_flags;
+ Res_value value;
+};
+
AssetManager2::AssetManager2() {
memset(&configuration_, 0, sizeof(configuration_));
}
@@ -897,7 +904,7 @@
log_stream << "\nBest matching is from "
<< (last_resolution_.best_config_name.empty() ? "default"
- : last_resolution_.best_config_name)
+ : last_resolution_.best_config_name.c_str())
<< " configuration of " << last_resolution_.best_package_name;
return log_stream.str();
}
@@ -1411,13 +1418,6 @@
Theme::~Theme() = default;
-struct Theme::Entry {
- uint32_t attr_res_id;
- ApkAssetsCookie cookie;
- uint32_t type_spec_flags;
- Res_value value;
-};
-
namespace {
struct ThemeEntryKeyComparer {
bool operator() (const Theme::Entry& entry, uint32_t attr_res_id) const noexcept {
diff --git a/libs/androidfw/OWNERS b/libs/androidfw/OWNERS
index 436f107..ef4cc46 100644
--- a/libs/androidfw/OWNERS
+++ b/libs/androidfw/OWNERS
@@ -1,5 +1,4 @@
set noparent
-toddke@google.com
zyy@google.com
patb@google.com
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index cc38062..11d153e 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -5214,19 +5214,19 @@
*outType = *defType;
}
*outName = String16(p, end-p);
- if(**outPackage == 0) {
+ if(outPackage->empty()) {
if(outErrorMsg) {
*outErrorMsg = "Resource package cannot be an empty string";
}
return false;
}
- if(**outType == 0) {
+ if(outType->empty()) {
if(outErrorMsg) {
*outErrorMsg = "Resource type cannot be an empty string";
}
return false;
}
- if(**outName == 0) {
+ if(outName->empty()) {
if(outErrorMsg) {
*outErrorMsg = "Resource id cannot be an empty string";
}
diff --git a/libs/protoutil/include/android/util/ProtoOutputStream.h b/libs/protoutil/include/android/util/ProtoOutputStream.h
index f4a358d..1bfb874 100644
--- a/libs/protoutil/include/android/util/ProtoOutputStream.h
+++ b/libs/protoutil/include/android/util/ProtoOutputStream.h
@@ -102,7 +102,7 @@
bool write(uint64_t fieldId, long val);
bool write(uint64_t fieldId, long long val);
bool write(uint64_t fieldId, bool val);
- bool write(uint64_t fieldId, std::string val);
+ bool write(uint64_t fieldId, std::string_view val);
bool write(uint64_t fieldId, const char* val, size_t size);
/**
diff --git a/libs/protoutil/src/ProtoOutputStream.cpp b/libs/protoutil/src/ProtoOutputStream.cpp
index fcf82ee..a44a1b2 100644
--- a/libs/protoutil/src/ProtoOutputStream.cpp
+++ b/libs/protoutil/src/ProtoOutputStream.cpp
@@ -170,13 +170,13 @@
}
bool
-ProtoOutputStream::write(uint64_t fieldId, std::string val)
+ProtoOutputStream::write(uint64_t fieldId, std::string_view val)
{
if (mCompact) return false;
const uint32_t id = (uint32_t)fieldId;
switch (fieldId & FIELD_TYPE_MASK) {
case FIELD_TYPE_STRING:
- writeUtf8StringImpl(id, val.c_str(), val.size());
+ writeUtf8StringImpl(id, val.data(), val.size());
return true;
default:
ALOGW("Field type %" PRIu64 " is not supported when writing string val.",
diff --git a/media/java/android/media/AudioFormat.java b/media/java/android/media/AudioFormat.java
index b8090c4..1100c54 100644
--- a/media/java/android/media/AudioFormat.java
+++ b/media/java/android/media/AudioFormat.java
@@ -1240,7 +1240,8 @@
* {@link AudioFormat#CHANNEL_OUT_SIDE_RIGHT}.
* <p> For a valid {@link AudioTrack} channel position mask,
* the following conditions apply:
- * <br> (1) at most eight channel positions may be used;
+ * <br> (1) at most {@link AudioSystem#OUT_CHANNEL_COUNT_MAX} channel positions may be
+ * used;
* <br> (2) right/left pairs should be matched.
* <p> For input or {@link AudioRecord}, the mask should be
* {@link AudioFormat#CHANNEL_IN_MONO} or
diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp
index 44a0baa..27fc6ae 100644
--- a/media/jni/android_media_MediaCodec.cpp
+++ b/media/jni/android_media_MediaCodec.cpp
@@ -1040,7 +1040,7 @@
CHECK(ctor != NULL);
ScopedLocalRef<jstring> msgObj(
- env, env->NewStringUTF(msg != NULL ? msg : String8::format("Error %#x", err)));
+ env, env->NewStringUTF(msg != NULL ? msg : String8::format("Error %#x", err).c_str()));
// translate action code to Java equivalent
switch (actionCode) {
@@ -2912,7 +2912,7 @@
if (mode != NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW
&& mode != NATIVE_WINDOW_SCALING_MODE_SCALE_CROP) {
jniThrowException(env, "java/lang/IllegalArgumentException",
- String8::format("Unrecognized mode: %d", mode));
+ String8::format("Unrecognized mode: %d", mode).c_str());
return;
}
@@ -3337,27 +3337,27 @@
if (err == NAME_NOT_FOUND) {
// fail and do not try again.
jniThrowException(env, "java/lang/IllegalArgumentException",
- String8::format("Failed to initialize %s, error %#x (NAME_NOT_FOUND)", tmp, err));
+ String8::format("Failed to initialize %s, error %#x (NAME_NOT_FOUND)", tmp, err).c_str());
env->ReleaseStringUTFChars(name, tmp);
return;
}
if (err == NO_MEMORY) {
throwCodecException(env, err, ACTION_CODE_TRANSIENT,
- String8::format("Failed to initialize %s, error %#x (NO_MEMORY)", tmp, err));
+ String8::format("Failed to initialize %s, error %#x (NO_MEMORY)", tmp, err).c_str());
env->ReleaseStringUTFChars(name, tmp);
return;
}
if (err == PERMISSION_DENIED) {
jniThrowException(env, "java/lang/SecurityException",
String8::format("Failed to initialize %s, error %#x (PERMISSION_DENIED)", tmp,
- err));
+ err).c_str());
env->ReleaseStringUTFChars(name, tmp);
return;
}
if (err != OK) {
// believed possible to try again
jniThrowException(env, "java/io/IOException",
- String8::format("Failed to find matching codec %s, error %#x (?)", tmp, err));
+ String8::format("Failed to find matching codec %s, error %#x (?)", tmp, err).c_str());
env->ReleaseStringUTFChars(name, tmp);
return;
}
diff --git a/media/jni/android_media_MediaDescrambler.cpp b/media/jni/android_media_MediaDescrambler.cpp
index c61365a..37111c2 100644
--- a/media/jni/android_media_MediaDescrambler.cpp
+++ b/media/jni/android_media_MediaDescrambler.cpp
@@ -368,7 +368,7 @@
ScopedLocalRef<jstring> msgObj(
env, env->NewStringUTF(msg != NULL ?
- msg : String8::format("Error %#x", serviceSpecificError)));
+ msg : String8::format("Error %#x", serviceSpecificError).c_str()));
return (jthrowable)env->NewObject(
clazz.get(), ctor, serviceSpecificError, msgObj.get());
diff --git a/media/jni/android_media_MediaPlayer.cpp b/media/jni/android_media_MediaPlayer.cpp
index 43de378..febaba9 100644
--- a/media/jni/android_media_MediaPlayer.cpp
+++ b/media/jni/android_media_MediaPlayer.cpp
@@ -260,7 +260,7 @@
status_t opStatus =
mp->setDataSource(
httpService,
- pathStr,
+ pathStr.c_str(),
headersVector.size() > 0? &headersVector : NULL);
process_media_player_call(
diff --git a/native/android/obb.cpp b/native/android/obb.cpp
index e990024..a14fa7e 100644
--- a/native/android/obb.cpp
+++ b/native/android/obb.cpp
@@ -42,7 +42,7 @@
}
const char* AObbInfo_getPackageName(AObbInfo* obbInfo) {
- return obbInfo->getPackageName();
+ return obbInfo->getPackageName().c_str();
}
int32_t AObbInfo_getVersion(AObbInfo* obbInfo) {
diff --git a/packages/CredentialManager/horologist/OWNERS b/packages/CredentialManager/horologist/OWNERS
new file mode 100644
index 0000000..b679328
--- /dev/null
+++ b/packages/CredentialManager/horologist/OWNERS
@@ -0,0 +1,4 @@
+include /core/java/android/credentials/OWNERS
+
+shuanghao@google.com
+gustavopagani@google.com
diff --git a/packages/CredentialManager/shared/OWNERS b/packages/CredentialManager/shared/OWNERS
new file mode 100644
index 0000000..b679328
--- /dev/null
+++ b/packages/CredentialManager/shared/OWNERS
@@ -0,0 +1,4 @@
+include /core/java/android/credentials/OWNERS
+
+shuanghao@google.com
+gustavopagani@google.com
diff --git a/packages/CredentialManager/wear/OWNERS b/packages/CredentialManager/wear/OWNERS
new file mode 100644
index 0000000..b679328
--- /dev/null
+++ b/packages/CredentialManager/wear/OWNERS
@@ -0,0 +1,4 @@
+include /core/java/android/credentials/OWNERS
+
+shuanghao@google.com
+gustavopagani@google.com
diff --git a/packages/SystemUI/OWNERS b/packages/SystemUI/OWNERS
index 5b2409a..b1ba5c0 100644
--- a/packages/SystemUI/OWNERS
+++ b/packages/SystemUI/OWNERS
@@ -4,7 +4,6 @@
dsandler@android.com
-aaliomer@google.com
aaronjli@google.com
achalke@google.com
acul@google.com
@@ -36,6 +35,7 @@
gwasserman@google.com
hwwang@google.com
hyunyoungs@google.com
+ikateryna@google.com
jaggies@google.com
jamesoleary@google.com
jbolinger@google.com
@@ -78,7 +78,6 @@
pixel@google.com
pomini@google.com
rahulbanerjee@google.com
-rasheedlewis@google.com
roosa@google.com
saff@google.com
santie@google.com
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
index a08f540..6507488 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -549,6 +549,18 @@
dispatchErrorMessage(message);
}
+ @Override
+ public void onEnabledTrustAgentsChanged(int userId) {
+ Assert.isMainThread();
+
+ for (int i = 0; i < mCallbacks.size(); i++) {
+ KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
+ if (cb != null) {
+ cb.onEnabledTrustAgentsChanged(userId);
+ }
+ }
+ }
+
private void handleSimSubscriptionInfoChanged() {
Assert.isMainThread();
mLogger.v("onSubscriptionInfoChanged()");
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java
index feff216..7394005 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java
@@ -322,4 +322,9 @@
* Called when keyguard is going away or not going away.
*/
public void onKeyguardGoingAway() { }
+
+ /**
+ * Called when the enabled trust agents associated with the specified user.
+ */
+ public void onEnabledTrustAgentsChanged(int userId) { }
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/TrustRepository.kt b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/TrustRepository.kt
index d90f328..e912053 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/TrustRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/TrustRepository.kt
@@ -75,6 +75,8 @@
override fun onTrustError(message: CharSequence?) = Unit
override fun onTrustManagedChanged(enabled: Boolean, userId: Int) = Unit
+
+ override fun onEnabledTrustAgentsChanged(userId: Int) = Unit
}
trustManager.registerTrustListener(callback)
logger.trustListenerRegistered()
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateControllerImpl.java
index f1269f2..f4cf4ef 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateControllerImpl.java
@@ -452,5 +452,10 @@
public void onBiometricsCleared() {
update(false /* alwaysUpdate */);
}
+
+ @Override
+ public void onEnabledTrustAgentsChanged(int userId) {
+ update(false /* updateAlways */);
+ }
}
}
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
index b1051af..417eb40 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
@@ -144,6 +144,7 @@
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
+import java.util.Random;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -722,6 +723,18 @@
}
@Test
+ public void testOnEnabledTrustAgentsChangedCallback() {
+ final Random random = new Random();
+ final int userId = random.nextInt();
+ final KeyguardUpdateMonitorCallback callback = mock(KeyguardUpdateMonitorCallback.class);
+
+ mKeyguardUpdateMonitor.registerCallback(callback);
+ mKeyguardUpdateMonitor.onEnabledTrustAgentsChanged(userId);
+
+ verify(callback).onEnabledTrustAgentsChanged(eq(userId));
+ }
+
+ @Test
public void trustAgentHasTrust_fingerprintLockout() {
// GIVEN user has trust
mKeyguardUpdateMonitor.onTrustChanged(true, true, getCurrentUser(), 0, null);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/KeyguardStateControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/KeyguardStateControllerTest.java
index 8f363ef..d787ada 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/KeyguardStateControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/KeyguardStateControllerTest.java
@@ -31,18 +31,23 @@
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardUpdateMonitor;
+import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.keyguard.logging.KeyguardUpdateMonitorLogger;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.keyguard.KeyguardUnlockAnimationController;
+import dagger.Lazy;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import dagger.Lazy;
+import java.util.Random;
+
@SmallTest
@TestableLooper.RunWithLooper
@@ -169,4 +174,19 @@
verify(callback).onKeyguardDismissAmountChanged();
}
+ @Test
+ public void testOnEnabledTrustAgentsChangedCallback() {
+ final Random random = new Random();
+ final ArgumentCaptor<KeyguardUpdateMonitorCallback> updateCallbackCaptor =
+ ArgumentCaptor.forClass(KeyguardUpdateMonitorCallback.class);
+
+ verify(mKeyguardUpdateMonitor).registerCallback(updateCallbackCaptor.capture());
+ final KeyguardStateController.Callback stateCallback =
+ mock(KeyguardStateController.Callback.class);
+ mKeyguardStateController.addCallback(stateCallback);
+
+ when(mLockPatternUtils.isSecure(anyInt())).thenReturn(true);
+ updateCallbackCaptor.getValue().onEnabledTrustAgentsChanged(random.nextInt());
+ verify(stateCallback).onUnlockedChanged();
+ }
}
diff --git a/services/backup/backuplib/java/com/android/server/backup/TransportManager.java b/services/backup/backuplib/java/com/android/server/backup/TransportManager.java
index 930f49e..ff5f509f 100644
--- a/services/backup/backuplib/java/com/android/server/backup/TransportManager.java
+++ b/services/backup/backuplib/java/com/android/server/backup/TransportManager.java
@@ -706,6 +706,9 @@
try {
String transportName = transport.name();
String transportDirName = transport.transportDirName();
+ if (transportName == null || transportDirName == null) {
+ return BackupManager.ERROR_TRANSPORT_INVALID;
+ }
registerTransport(transportComponent, transport);
// If registerTransport() hasn't thrown...
Slog.d(TAG, "Transport " + transportString + " registered");
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index b837688..1d028c8 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -4201,21 +4201,6 @@
profile.addPss(mi.getTotalPss(),
mi.getTotalUss(), mi.getTotalRss(), false,
ProcessStats.ADD_PSS_EXTERNAL_SLOW, duration);
- proc.getPkgList().forEachPackageProcessStats(holder -> {
- final ProcessState state = holder.state;
- FrameworkStatsLog.write(FrameworkStatsLog.PROCESS_MEMORY_STAT_REPORTED,
- proc.info.uid,
- state != null ? state.getName() : proc.processName,
- state != null ? state.getPackage() : proc.info.packageName,
- mi.getTotalPss(),
- mi.getTotalUss(),
- mi.getTotalRss(),
- ProcessStats.ADD_PSS_EXTERNAL_SLOW,
- duration,
- holder.appVersion,
- profile.getCurrentHostingComponentTypes(),
- profile.getHistoricalHostingComponentTypes());
- });
}
}
}
@@ -4262,20 +4247,6 @@
// Record this for posterity if the process has been stable.
profile.addPss(pi, tmpUss[0], tmpUss[2], false,
ProcessStats.ADD_PSS_EXTERNAL, duration);
- proc.getPkgList().forEachPackageProcessStats(holder -> {
- FrameworkStatsLog.write(FrameworkStatsLog.PROCESS_MEMORY_STAT_REPORTED,
- proc.info.uid,
- holder.state.getName(),
- holder.state.getPackage(),
- pi,
- tmpUss[0],
- tmpUss[2],
- ProcessStats.ADD_PSS_EXTERNAL,
- duration,
- holder.appVersion,
- profile.getCurrentHostingComponentTypes(),
- profile.getHistoricalHostingComponentTypes());
- });
}
}
}
@@ -11411,17 +11382,6 @@
// Record this for posterity if the process has been stable.
r.mProfile.addPss(myTotalPss, myTotalUss, myTotalRss, true,
reportType, endTime - startTime);
- r.getPkgList().forEachPackageProcessStats(holder -> {
- FrameworkStatsLog.write(FrameworkStatsLog.PROCESS_MEMORY_STAT_REPORTED,
- r.info.uid,
- holder.state.getName(),
- holder.state.getPackage(),
- myTotalPss, myTotalUss, myTotalRss, reportType,
- endTime-startTime,
- holder.appVersion,
- r.mProfile.getCurrentHostingComponentTypes(),
- r.mProfile.getHistoricalHostingComponentTypes());
- });
}
}
@@ -12057,16 +12017,6 @@
// Record this for posterity if the process has been stable.
r.mProfile.addPss(myTotalPss, myTotalUss, myTotalRss, true,
reportType, endTime - startTime);
- r.getPkgList().forEachPackageProcessStats(holder -> {
- FrameworkStatsLog.write(FrameworkStatsLog.PROCESS_MEMORY_STAT_REPORTED,
- r.info.uid,
- holder.state.getName(),
- holder.state.getPackage(),
- myTotalPss, myTotalUss, myTotalRss, reportType, endTime-startTime,
- holder.appVersion,
- r.mProfile.getCurrentHostingComponentTypes(),
- r.mProfile.getHistoricalHostingComponentTypes());
- });
}
}
diff --git a/services/core/java/com/android/server/am/AppProfiler.java b/services/core/java/com/android/server/am/AppProfiler.java
index 15efb7d..7c04a57 100644
--- a/services/core/java/com/android/server/am/AppProfiler.java
+++ b/services/core/java/com/android/server/am/AppProfiler.java
@@ -567,17 +567,6 @@
swapPss * 1024, rss * 1024, statType, procState, pssDuration);
profile.setLastPssTime(now);
profile.addPss(pss, uss, rss, true, statType, pssDuration);
- proc.getPkgList().forEachPackageProcessStats(holder -> {
- FrameworkStatsLog.write(FrameworkStatsLog.PROCESS_MEMORY_STAT_REPORTED,
- proc.info.uid,
- holder.state.getName(),
- holder.state.getPackage(),
- pss, uss, rss,
- statType, pssDuration,
- holder.appVersion,
- profile.getCurrentHostingComponentTypes(),
- profile.getHistoricalHostingComponentTypes());
- });
if (DEBUG_PSS) {
Slog.d(TAG_PSS,
"pss of " + proc.toShortString() + ": " + pss
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21UdfpsMock.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21UdfpsMock.java
index 846c2d9..a53d096 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21UdfpsMock.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21UdfpsMock.java
@@ -433,6 +433,11 @@
}
@Override
+ public void onEnabledTrustAgentsChanged(int userId) {
+
+ }
+
+ @Override
@NonNull
public List<FingerprintSensorPropertiesInternal> getSensorProperties() {
final List<FingerprintSensorPropertiesInternal> properties = new ArrayList<>();
diff --git a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
index 10e72f5..13b4f7f 100644
--- a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
+++ b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
@@ -1480,12 +1480,9 @@
if (dir.isDirectory() && dir.canRead()) {
Collections.addAll(ret, dir.listFiles());
}
- // For IoT devices, we check the oem partition for default permissions for each app.
- if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_EMBEDDED, 0)) {
- dir = new File(Environment.getOemDirectory(), "etc/default-permissions");
- if (dir.isDirectory() && dir.canRead()) {
- Collections.addAll(ret, dir.listFiles());
- }
+ dir = new File(Environment.getOemDirectory(), "etc/default-permissions");
+ if (dir.isDirectory() && dir.canRead()) {
+ Collections.addAll(ret, dir.listFiles());
}
return ret.isEmpty() ? null : ret.toArray(new File[0]);
}
diff --git a/services/core/java/com/android/server/trust/TrustManagerService.java b/services/core/java/com/android/server/trust/TrustManagerService.java
index 04cd7f7..e3abf0c 100644
--- a/services/core/java/com/android/server/trust/TrustManagerService.java
+++ b/services/core/java/com/android/server/trust/TrustManagerService.java
@@ -53,6 +53,7 @@
import android.os.DeadObjectException;
import android.os.Handler;
import android.os.IBinder;
+import android.os.Looper;
import android.os.Message;
import android.os.PersistableBundle;
import android.os.RemoteException;
@@ -150,6 +151,8 @@
private final ArrayList<ITrustListener> mTrustListeners = new ArrayList<>();
private final Receiver mReceiver = new Receiver();
+ private final Handler mHandler;
+
/* package */ final TrustArchive mArchive = new TrustArchive();
private final Context mContext;
private final LockPatternUtils mLockPatternUtils;
@@ -158,10 +161,26 @@
private VirtualDeviceManagerInternal mVirtualDeviceManager;
private enum TrustState {
- UNTRUSTED, // the phone is not unlocked by any trustagents
- TRUSTABLE, // the phone is in a semi-locked state that can be unlocked if
- // FLAG_GRANT_TRUST_TEMPORARY_AND_RENEWABLE is passed and a trustagent is trusted
- TRUSTED // the phone is unlocked
+ // UNTRUSTED means that TrustManagerService is currently *not* giving permission for the
+ // user's Keyguard to be dismissed, and grants of trust by trust agents are remembered in
+ // the corresponding TrustAgentWrapper but are not recognized until the device is unlocked
+ // for the user. I.e., if the device is locked and the state is UNTRUSTED, it cannot be
+ // unlocked by a trust agent. Automotive devices are an exception; grants of trust are
+ // always recognized on them.
+ UNTRUSTED,
+
+ // TRUSTABLE is the same as UNTRUSTED except that new grants of trust using
+ // FLAG_GRANT_TRUST_TEMPORARY_AND_RENEWABLE are recognized for moving to TRUSTED. I.e., if
+ // the device is locked and the state is TRUSTABLE, it can be unlocked by a trust agent,
+ // provided that the trust agent chooses to use Active Unlock. The TRUSTABLE state is only
+ // possible as a result of a downgrade from TRUSTED, after a trust agent used
+ // FLAG_GRANT_TRUST_TEMPORARY_AND_RENEWABLE in its most recent grant.
+ TRUSTABLE,
+
+ // TRUSTED means that TrustManagerService is currently giving permission for the user's
+ // Keyguard to be dismissed. This implies that the device is unlocked for the user (where
+ // the case of Keyguard showing but dismissible just with swipe counts as "unlocked").
+ TRUSTED
};
@GuardedBy("mUserTrustState")
@@ -224,13 +243,40 @@
private boolean mTrustAgentsCanRun = false;
private int mCurrentUser = UserHandle.USER_SYSTEM;
+ /**
+ * A class for providing dependencies to {@link TrustManagerService} in both production and test
+ * cases.
+ */
+ protected static class Injector {
+ private final LockPatternUtils mLockPatternUtils;
+ private final Looper mLooper;
+
+ public Injector(LockPatternUtils lockPatternUtils, Looper looper) {
+ mLockPatternUtils = lockPatternUtils;
+ mLooper = looper;
+ }
+
+ LockPatternUtils getLockPatternUtils() {
+ return mLockPatternUtils;
+ }
+
+ Looper getLooper() {
+ return mLooper;
+ }
+ }
+
public TrustManagerService(Context context) {
+ this(context, new Injector(new LockPatternUtils(context), Looper.myLooper()));
+ }
+
+ protected TrustManagerService(Context context, Injector injector) {
super(context);
mContext = context;
+ mHandler = createHandler(injector.getLooper());
mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
mActivityManager = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
- mLockPatternUtils = new LockPatternUtils(context);
- mStrongAuthTracker = new StrongAuthTracker(context);
+ mLockPatternUtils = injector.getLockPatternUtils();
+ mStrongAuthTracker = new StrongAuthTracker(context, injector.getLooper());
mAlarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);
mSettingsObserver = new SettingsObserver(mHandler);
}
@@ -814,6 +860,12 @@
}
}
+ private TrustState getUserTrustStateInner(int userId) {
+ synchronized (mUserTrustState) {
+ return mUserTrustState.get(userId, TrustState.UNTRUSTED);
+ }
+ }
+
boolean isDeviceLockedInner(int userId) {
synchronized (mDeviceLockedForUser) {
return mDeviceLockedForUser.get(userId, true);
@@ -864,7 +916,12 @@
continue;
}
- boolean trusted = aggregateIsTrusted(id);
+ final boolean trusted;
+ if (android.security.Flags.fixUnlockedDeviceRequiredKeys()) {
+ trusted = getUserTrustStateInner(id) == TrustState.TRUSTED;
+ } else {
+ trusted = aggregateIsTrusted(id);
+ }
boolean showingKeyguard = true;
boolean biometricAuthenticated = false;
boolean currentUserIsUnlocked = false;
@@ -1365,6 +1422,23 @@
}
}
+ private void dispatchOnEnabledTrustAgentsChanged(int userId) {
+ if (DEBUG) {
+ Log.i(TAG, "onEnabledTrustAgentsChanged(" + userId + ")");
+ }
+ for (int i = 0; i < mTrustListeners.size(); i++) {
+ try {
+ mTrustListeners.get(i).onEnabledTrustAgentsChanged(userId);
+ } catch (DeadObjectException e) {
+ Slog.d(TAG, "Removing dead TrustListener.");
+ mTrustListeners.remove(i);
+ i--;
+ } catch (RemoteException e) {
+ Slog.e(TAG, "Exception while notifying TrustListener.", e);
+ }
+ }
+ }
+
private void dispatchOnTrustManagedChanged(boolean managed, int userId) {
if (DEBUG) {
Log.i(TAG, "onTrustManagedChanged(" + managed + ", " + userId + ")");
@@ -1468,9 +1542,7 @@
@Override
public void reportEnabledTrustAgentsChanged(int userId) throws RemoteException {
enforceReportPermission();
- // coalesce refresh messages.
- mHandler.removeMessages(MSG_ENABLED_AGENTS_CHANGED);
- mHandler.sendEmptyMessage(MSG_ENABLED_AGENTS_CHANGED);
+ mHandler.obtainMessage(MSG_ENABLED_AGENTS_CHANGED, userId, 0).sendToTarget();
}
@Override
@@ -1628,7 +1700,7 @@
if (isCurrent) {
fout.print(" (current)");
}
- fout.print(": trusted=" + dumpBool(aggregateIsTrusted(user.id)));
+ fout.print(": trustState=" + getUserTrustStateInner(user.id));
fout.print(", trustManaged=" + dumpBool(aggregateIsTrustManaged(user.id)));
fout.print(", deviceLocked=" + dumpBool(isDeviceLockedInner(user.id)));
fout.print(", strongAuthRequired=" + dumpHex(
@@ -1781,88 +1853,91 @@
}
}
- private final Handler mHandler = new Handler() {
- @Override
- public void handleMessage(Message msg) {
- switch (msg.what) {
- case MSG_REGISTER_LISTENER:
- addListener((ITrustListener) msg.obj);
- break;
- case MSG_UNREGISTER_LISTENER:
- removeListener((ITrustListener) msg.obj);
- break;
- case MSG_DISPATCH_UNLOCK_ATTEMPT:
- dispatchUnlockAttempt(msg.arg1 != 0, msg.arg2);
- break;
- case MSG_USER_REQUESTED_UNLOCK:
- dispatchUserRequestedUnlock(msg.arg1, msg.arg2 != 0);
- break;
- case MSG_USER_MAY_REQUEST_UNLOCK:
- dispatchUserMayRequestUnlock(msg.arg1);
- break;
- case MSG_DISPATCH_UNLOCK_LOCKOUT:
- dispatchUnlockLockout(msg.arg1, msg.arg2);
- break;
- case MSG_ENABLED_AGENTS_CHANGED:
- refreshAgentList(UserHandle.USER_ALL);
- // This is also called when the security mode of a user changes.
- refreshDeviceLockedForUser(UserHandle.USER_ALL);
- break;
- case MSG_KEYGUARD_SHOWING_CHANGED:
- dispatchTrustableDowngrade();
- refreshDeviceLockedForUser(mCurrentUser);
- break;
- case MSG_START_USER:
- case MSG_CLEANUP_USER:
- case MSG_UNLOCK_USER:
- refreshAgentList(msg.arg1);
- break;
- case MSG_SWITCH_USER:
- mCurrentUser = msg.arg1;
- mSettingsObserver.updateContentObserver();
- refreshDeviceLockedForUser(UserHandle.USER_ALL);
- break;
- case MSG_STOP_USER:
- setDeviceLockedForUser(msg.arg1, true);
- break;
- case MSG_FLUSH_TRUST_USUALLY_MANAGED:
- SparseBooleanArray usuallyManaged;
- synchronized (mTrustUsuallyManagedForUser) {
- usuallyManaged = mTrustUsuallyManagedForUser.clone();
- }
-
- for (int i = 0; i < usuallyManaged.size(); i++) {
- int userId = usuallyManaged.keyAt(i);
- boolean value = usuallyManaged.valueAt(i);
- if (value != mLockPatternUtils.isTrustUsuallyManaged(userId)) {
- mLockPatternUtils.setTrustUsuallyManaged(value, userId);
+ private Handler createHandler(Looper looper) {
+ return new Handler(looper) {
+ @Override
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case MSG_REGISTER_LISTENER:
+ addListener((ITrustListener) msg.obj);
+ break;
+ case MSG_UNREGISTER_LISTENER:
+ removeListener((ITrustListener) msg.obj);
+ break;
+ case MSG_DISPATCH_UNLOCK_ATTEMPT:
+ dispatchUnlockAttempt(msg.arg1 != 0, msg.arg2);
+ break;
+ case MSG_USER_REQUESTED_UNLOCK:
+ dispatchUserRequestedUnlock(msg.arg1, msg.arg2 != 0);
+ break;
+ case MSG_USER_MAY_REQUEST_UNLOCK:
+ dispatchUserMayRequestUnlock(msg.arg1);
+ break;
+ case MSG_DISPATCH_UNLOCK_LOCKOUT:
+ dispatchUnlockLockout(msg.arg1, msg.arg2);
+ break;
+ case MSG_ENABLED_AGENTS_CHANGED:
+ refreshAgentList(UserHandle.USER_ALL);
+ // This is also called when the security mode of a user changes.
+ refreshDeviceLockedForUser(UserHandle.USER_ALL);
+ dispatchOnEnabledTrustAgentsChanged(msg.arg1);
+ break;
+ case MSG_KEYGUARD_SHOWING_CHANGED:
+ dispatchTrustableDowngrade();
+ refreshDeviceLockedForUser(mCurrentUser);
+ break;
+ case MSG_START_USER:
+ case MSG_CLEANUP_USER:
+ case MSG_UNLOCK_USER:
+ refreshAgentList(msg.arg1);
+ break;
+ case MSG_SWITCH_USER:
+ mCurrentUser = msg.arg1;
+ mSettingsObserver.updateContentObserver();
+ refreshDeviceLockedForUser(UserHandle.USER_ALL);
+ break;
+ case MSG_STOP_USER:
+ setDeviceLockedForUser(msg.arg1, true);
+ break;
+ case MSG_FLUSH_TRUST_USUALLY_MANAGED:
+ SparseBooleanArray usuallyManaged;
+ synchronized (mTrustUsuallyManagedForUser) {
+ usuallyManaged = mTrustUsuallyManagedForUser.clone();
}
- }
- break;
- case MSG_REFRESH_DEVICE_LOCKED_FOR_USER:
- if (msg.arg2 == 1) {
- updateTrust(msg.arg1, 0 /* flags */, true /* isFromUnlock */, null);
- }
- final int unlockedUser = msg.getData().getInt(
- REFRESH_DEVICE_LOCKED_EXCEPT_USER, UserHandle.USER_NULL);
- refreshDeviceLockedForUser(msg.arg1, unlockedUser);
- break;
- case MSG_SCHEDULE_TRUST_TIMEOUT:
- boolean shouldOverride = msg.arg1 == 1 ? true : false;
- TimeoutType timeoutType =
- msg.arg2 == 1 ? TimeoutType.TRUSTABLE : TimeoutType.TRUSTED;
- handleScheduleTrustTimeout(shouldOverride, timeoutType);
- break;
- case MSG_REFRESH_TRUSTABLE_TIMERS_AFTER_AUTH:
- TrustableTimeoutAlarmListener trustableAlarm =
- mTrustableTimeoutAlarmListenerForUser.get(msg.arg1);
- if (trustableAlarm != null && trustableAlarm.isQueued()) {
- refreshTrustableTimers(msg.arg1);
- }
- break;
+
+ for (int i = 0; i < usuallyManaged.size(); i++) {
+ int userId = usuallyManaged.keyAt(i);
+ boolean value = usuallyManaged.valueAt(i);
+ if (value != mLockPatternUtils.isTrustUsuallyManaged(userId)) {
+ mLockPatternUtils.setTrustUsuallyManaged(value, userId);
+ }
+ }
+ break;
+ case MSG_REFRESH_DEVICE_LOCKED_FOR_USER:
+ if (msg.arg2 == 1) {
+ updateTrust(msg.arg1, 0 /* flags */, true /* isFromUnlock */, null);
+ }
+ final int unlockedUser = msg.getData().getInt(
+ REFRESH_DEVICE_LOCKED_EXCEPT_USER, UserHandle.USER_NULL);
+ refreshDeviceLockedForUser(msg.arg1, unlockedUser);
+ break;
+ case MSG_SCHEDULE_TRUST_TIMEOUT:
+ boolean shouldOverride = msg.arg1 == 1 ? true : false;
+ TimeoutType timeoutType =
+ msg.arg2 == 1 ? TimeoutType.TRUSTABLE : TimeoutType.TRUSTED;
+ handleScheduleTrustTimeout(shouldOverride, timeoutType);
+ break;
+ case MSG_REFRESH_TRUSTABLE_TIMERS_AFTER_AUTH:
+ TrustableTimeoutAlarmListener trustableAlarm =
+ mTrustableTimeoutAlarmListenerForUser.get(msg.arg1);
+ if (trustableAlarm != null && trustableAlarm.isQueued()) {
+ refreshTrustableTimers(msg.arg1);
+ }
+ break;
+ }
}
- }
- };
+ };
+ }
private final PackageMonitor mPackageMonitor = new PackageMonitor() {
@Override
@@ -1960,8 +2035,8 @@
SparseBooleanArray mStartFromSuccessfulUnlock = new SparseBooleanArray();
- public StrongAuthTracker(Context context) {
- super(context);
+ StrongAuthTracker(Context context, Looper looper) {
+ super(context, looper);
}
@Override
diff --git a/services/tests/mockingservicestests/src/com/android/server/trust/OWNERS b/services/tests/mockingservicestests/src/com/android/server/trust/OWNERS
new file mode 100644
index 0000000..e2c6ce1
--- /dev/null
+++ b/services/tests/mockingservicestests/src/com/android/server/trust/OWNERS
@@ -0,0 +1 @@
+include /core/java/android/service/trust/OWNERS
diff --git a/services/tests/mockingservicestests/src/com/android/server/trust/TrustManagerServiceTest.java b/services/tests/mockingservicestests/src/com/android/server/trust/TrustManagerServiceTest.java
index 33870f1..9851bc1 100644
--- a/services/tests/mockingservicestests/src/com/android/server/trust/TrustManagerServiceTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/trust/TrustManagerServiceTest.java
@@ -16,15 +16,26 @@
package com.android.server.trust;
+import static android.content.pm.PackageManager.PERMISSION_GRANTED;
+
import static com.android.dx.mockito.inline.extended.ExtendedMockito.any;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.anyInt;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.argThat;
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.eq;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.mock;
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.mockitoSession;
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.when;
import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+
+import android.Manifest;
import android.annotation.Nullable;
+import android.app.trust.ITrustListener;
+import android.app.trust.ITrustManager;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
@@ -36,11 +47,16 @@
import android.content.pm.ServiceInfo;
import android.net.Uri;
import android.os.Handler;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.os.ServiceManager;
import android.os.UserHandle;
import android.os.test.TestLooper;
import android.provider.Settings;
import android.service.trust.TrustAgentService;
import android.testing.TestableContext;
+import android.view.IWindowManager;
+import android.view.WindowManagerGlobal;
import androidx.test.core.app.ApplicationProvider;
@@ -55,13 +71,16 @@
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
+import org.mockito.ArgumentCaptor;
import org.mockito.ArgumentMatcher;
import org.mockito.Mock;
+import org.mockito.MockitoSession;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.Random;
public class TrustManagerServiceTest {
@@ -255,6 +274,43 @@
systemTrustAgent1);
}
+ @Test
+ public void reportEnabledTrustAgentsChangedInformsListener() throws RemoteException {
+ final LockPatternUtils utils = mock(LockPatternUtils.class);
+ final TrustManagerService service = new TrustManagerService(mMockContext,
+ new TrustManagerService.Injector(utils, mLooper.getLooper()));
+ final ITrustListener trustListener = mock(ITrustListener.class);
+ final IWindowManager windowManager = mock(IWindowManager.class);
+ final int userId = new Random().nextInt();
+
+ mMockContext.getTestablePermissions().setPermission(Manifest.permission.TRUST_LISTENER,
+ PERMISSION_GRANTED);
+
+ when(utils.getKnownTrustAgents(anyInt())).thenReturn(new ArrayList<>());
+
+ MockitoSession mockSession = mockitoSession()
+ .initMocks(this)
+ .mockStatic(ServiceManager.class)
+ .mockStatic(WindowManagerGlobal.class)
+ .startMocking();
+
+ doReturn(windowManager).when(() -> {
+ WindowManagerGlobal.getWindowManagerService();
+ });
+
+ service.onStart();
+ ArgumentCaptor<IBinder> binderArgumentCaptor = ArgumentCaptor.forClass(IBinder.class);
+ verify(() -> ServiceManager.addService(eq(Context.TRUST_SERVICE),
+ binderArgumentCaptor.capture(), anyBoolean(), anyInt()));
+ ITrustManager manager = ITrustManager.Stub.asInterface(binderArgumentCaptor.getValue());
+ manager.registerTrustListener(trustListener);
+ mLooper.dispatchAll();
+ manager.reportEnabledTrustAgentsChanged(userId);
+ mLooper.dispatchAll();
+ verify(trustListener).onEnabledTrustAgentsChanged(eq(userId));
+ mockSession.finishMocking();
+ }
+
private void addTrustAgent(ComponentName agentComponentName, boolean isSystemApp) {
ApplicationInfo applicationInfo = new ApplicationInfo();
if (isSystemApp) {
diff --git a/telephony/java/android/telephony/CarrierConfigManager.java b/telephony/java/android/telephony/CarrierConfigManager.java
index 34a901c..e6b7cf3b 100644
--- a/telephony/java/android/telephony/CarrierConfigManager.java
+++ b/telephony/java/android/telephony/CarrierConfigManager.java
@@ -4439,12 +4439,12 @@
*
* <p>Example:
*
- * <pre><code>
+ * <pre>{@code
* <string-array name="carrier_service_name_array" num="2">
* <item value="Police"/>
* <item value="Ambulance"/>
* </string-array>
- * </code></pre>
+ * }</pre>
*/
public static final String KEY_CARRIER_SERVICE_NAME_STRING_ARRAY = "carrier_service_name_array";
@@ -4458,18 +4458,18 @@
*
* <ul>
* <li>The number of items in both the arrays are equal
- * <li>The item added in this key follows a specific format. Either it should be all numbers,
- * or "+" followed by all numbers.
+ * <li>The item should contain dialable characters only which includes 0-9, -, *, #, (, ),
+ * SPACE.
* </ul>
*
* <p>Example:
*
- * <pre><code>
+ * <pre>{@code
* <string-array name="carrier_service_number_array" num="2">
- * <item value="123"/>
- * <item value="+343"/>
+ * <item value="*123"/>
+ * <item value="+ (111) 111-111"/>
* </string-array>
- * </code></pre>
+ * }</pre>
*/
public static final String KEY_CARRIER_SERVICE_NUMBER_STRING_ARRAY =
"carrier_service_number_array";
diff --git a/tests/TrustTests/Android.bp b/tests/TrustTests/Android.bp
index a1b888a..c216bce 100644
--- a/tests/TrustTests/Android.bp
+++ b/tests/TrustTests/Android.bp
@@ -25,6 +25,7 @@
"androidx.test.rules",
"androidx.test.ext.junit",
"androidx.test.uiautomator_uiautomator",
+ "flag-junit",
"mockito-target-minus-junit4",
"servicestests-utils",
"truth-prebuilt",
diff --git a/tests/TrustTests/src/android/trust/test/GrantAndRevokeTrustTest.kt b/tests/TrustTests/src/android/trust/test/GrantAndRevokeTrustTest.kt
index f864fed..1dfd5c0 100644
--- a/tests/TrustTests/src/android/trust/test/GrantAndRevokeTrustTest.kt
+++ b/tests/TrustTests/src/android/trust/test/GrantAndRevokeTrustTest.kt
@@ -16,6 +16,10 @@
package android.trust.test
+import android.content.pm.PackageManager
+import android.platform.test.annotations.RequiresFlagsDisabled
+import android.platform.test.annotations.RequiresFlagsEnabled
+import android.platform.test.flag.junit.DeviceFlagsValueProvider
import android.service.trust.GrantTrustResult
import android.trust.BaseTrustAgentService
import android.trust.TrustTestActivity
@@ -27,6 +31,7 @@
import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
import androidx.test.uiautomator.UiDevice
import com.android.server.testutils.mock
+import org.junit.Assume.assumeFalse
import org.junit.Before
import org.junit.Rule
import org.junit.Test
@@ -45,6 +50,7 @@
private val activityScenarioRule = ActivityScenarioRule(TrustTestActivity::class.java)
private val lockStateTrackingRule = LockStateTrackingRule()
private val trustAgentRule = TrustAgentRule<GrantAndRevokeTrustAgent>()
+ private val packageManager = getInstrumentation().getTargetContext().getPackageManager()
@get:Rule
val rule: RuleChain = RuleChain
@@ -52,6 +58,7 @@
.around(ScreenLockRule())
.around(lockStateTrackingRule)
.around(trustAgentRule)
+ .around(DeviceFlagsValueProvider.createCheckFlagsRule())
@Before
fun manageTrust() {
@@ -72,7 +79,7 @@
trustAgentRule.agent.grantTrust(GRANT_MESSAGE, 10000, 0) {}
uiDevice.sleep()
- lockStateTrackingRule.assertUnlocked()
+ lockStateTrackingRule.assertUnlockedAndTrusted()
}
@Test
@@ -86,6 +93,51 @@
}
@Test
+ @RequiresFlagsEnabled(android.security.Flags.FLAG_FIX_UNLOCKED_DEVICE_REQUIRED_KEYS)
+ fun grantCannotActivelyUnlockDevice() {
+ // On automotive, trust agents can actively unlock the device.
+ assumeFalse(packageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE))
+
+ // Lock the device.
+ uiDevice.sleep()
+ lockStateTrackingRule.assertLocked()
+
+ // Grant trust.
+ trustAgentRule.agent.grantTrust(GRANT_MESSAGE, 10000, 0) {}
+
+ // The grant should not have unlocked the device. Wait a bit so that
+ // TrustManagerService probably will have finished processing the grant.
+ await()
+ lockStateTrackingRule.assertLocked()
+
+ // Turn the screen on and off to cause TrustManagerService to refresh
+ // its deviceLocked state. Then verify the state is still locked. This
+ // part failed before the fix for b/296464083.
+ uiDevice.wakeUp()
+ uiDevice.sleep()
+ await()
+ lockStateTrackingRule.assertLocked()
+ }
+
+ @Test
+ @RequiresFlagsDisabled(android.security.Flags.FLAG_FIX_UNLOCKED_DEVICE_REQUIRED_KEYS)
+ fun grantCouldCauseWrongDeviceLockedStateDueToBug() {
+ // On automotive, trust agents can actively unlock the device.
+ assumeFalse(packageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE))
+
+ // Verify that b/296464083 exists. That is, when the device is locked
+ // and a trust agent grants trust, the deviceLocked state incorrectly
+ // becomes false even though the device correctly remains locked.
+ uiDevice.sleep()
+ lockStateTrackingRule.assertLocked()
+ trustAgentRule.agent.grantTrust(GRANT_MESSAGE, 10000, 0) {}
+ uiDevice.wakeUp()
+ uiDevice.sleep()
+ await()
+ lockStateTrackingRule.assertUnlockedButNotReally()
+ }
+
+ @Test
fun grantDoesNotCallBack() {
val callback = mock<(GrantTrustResult) -> Unit>()
trustAgentRule.agent.grantTrust(GRANT_MESSAGE, 0, 0, callback)
diff --git a/tests/TrustTests/src/android/trust/test/TemporaryAndRenewableTrustTest.kt b/tests/TrustTests/src/android/trust/test/TemporaryAndRenewableTrustTest.kt
index ae72247..96362b8 100644
--- a/tests/TrustTests/src/android/trust/test/TemporaryAndRenewableTrustTest.kt
+++ b/tests/TrustTests/src/android/trust/test/TemporaryAndRenewableTrustTest.kt
@@ -102,7 +102,7 @@
trustAgentRule.agent.grantTrust(
GRANT_MESSAGE, 0, FLAG_GRANT_TRUST_TEMPORARY_AND_RENEWABLE) {}
- lockStateTrackingRule.assertUnlocked()
+ lockStateTrackingRule.assertUnlockedAndTrusted()
}
@Test
@@ -125,7 +125,7 @@
Log.i(TAG, "Callback received; status=${it.status}")
result = it
}
- lockStateTrackingRule.assertUnlocked()
+ lockStateTrackingRule.assertUnlockedAndTrusted()
wait("callback triggered") { result?.status == STATUS_UNLOCKED_BY_GRANT }
}
diff --git a/tests/TrustTests/src/android/trust/test/lib/LockStateTrackingRule.kt b/tests/TrustTests/src/android/trust/test/lib/LockStateTrackingRule.kt
index 1930a1c..fe47fde 100644
--- a/tests/TrustTests/src/android/trust/test/lib/LockStateTrackingRule.kt
+++ b/tests/TrustTests/src/android/trust/test/lib/LockStateTrackingRule.kt
@@ -16,6 +16,7 @@
package android.trust.test.lib
+import android.app.KeyguardManager
import android.app.trust.TrustManager
import android.app.trust.TrustManager.TrustListener
import android.content.Context
@@ -27,18 +28,23 @@
import org.junit.runners.model.Statement
/**
- * Rule for tracking the lock state of the device based on events emitted to [TrustListener].
+ * Rule for tracking the trusted state of the device based on events emitted to
+ * [TrustListener]. Provides helper methods for verifying that the trusted
+ * state has a particular value and is consistent with (a) the keyguard "locked"
+ * (i.e. showing) value when applicable, and (b) the device locked value that is
+ * tracked by TrustManagerService and is queryable via KeyguardManager.
*/
class LockStateTrackingRule : TestRule {
private val context: Context = getApplicationContext()
- private val windowManager = WindowManagerGlobal.getWindowManagerService()
+ private val windowManager = checkNotNull(WindowManagerGlobal.getWindowManagerService())
+ private val keyguardManager = context.getSystemService(KeyguardManager::class.java) as KeyguardManager
- @Volatile lateinit var lockState: LockState
+ @Volatile lateinit var trustState: TrustState
private set
override fun apply(base: Statement, description: Description) = object : Statement() {
override fun evaluate() {
- lockState = LockState(locked = windowManager.isKeyguardLocked)
+ trustState = TrustState()
val trustManager = context.getSystemService(TrustManager::class.java) as TrustManager
val listener = Listener()
@@ -52,12 +58,25 @@
}
fun assertLocked() {
- wait("un-locked per TrustListener") { lockState.locked == true }
- wait("keyguard lock") { windowManager.isKeyguardLocked }
+ wait("device locked") { keyguardManager.isDeviceLocked }
+ // isDeviceLocked implies isKeyguardLocked && !trusted.
+ wait("keyguard locked") { windowManager.isKeyguardLocked }
+ wait("not trusted") { trustState.trusted == false }
}
- fun assertUnlocked() {
- wait("locked per TrustListener") { lockState.locked == false }
+ // TODO(b/299298338) remove this when removing FLAG_FIX_UNLOCKED_DEVICE_REQUIRED_KEYS
+ fun assertUnlockedButNotReally() {
+ wait("device unlocked") { !keyguardManager.isDeviceLocked }
+ wait("not trusted") { trustState.trusted == false }
+ wait("keyguard locked") { windowManager.isKeyguardLocked }
+ }
+
+ fun assertUnlockedAndTrusted() {
+ wait("device unlocked") { !keyguardManager.isDeviceLocked }
+ wait("trusted") { trustState.trusted == true }
+ // Can't check for !isKeyguardLocked here, since isKeyguardLocked
+ // returns true in the case where the keyguard is dismissible with
+ // swipe, which is considered "device unlocked"!
}
inner class Listener : TrustListener {
@@ -69,7 +88,7 @@
trustGrantedMessages: MutableList<String>
) {
Log.d(TAG, "Device became trusted=$enabled")
- lockState = lockState.copy(locked = !enabled)
+ trustState = trustState.copy(trusted=enabled)
}
override fun onTrustManagedChanged(enabled: Boolean, userId: Int) {
@@ -77,10 +96,13 @@
override fun onTrustError(message: CharSequence) {
}
+
+ override fun onEnabledTrustAgentsChanged(userId: Int) {
+ }
}
- data class LockState(
- val locked: Boolean? = null
+ data class TrustState(
+ val trusted: Boolean? = null
)
companion object {
diff --git a/tests/TrustTests/src/android/trust/test/lib/ScreenLockRule.kt b/tests/TrustTests/src/android/trust/test/lib/ScreenLockRule.kt
index 4189baa..f1edca3 100644
--- a/tests/TrustTests/src/android/trust/test/lib/ScreenLockRule.kt
+++ b/tests/TrustTests/src/android/trust/test/lib/ScreenLockRule.kt
@@ -36,7 +36,7 @@
class ScreenLockRule : TestRule {
private val context: Context = getApplicationContext()
private val uiDevice = UiDevice.getInstance(getInstrumentation())
- private val windowManager = WindowManagerGlobal.getWindowManagerService()
+ private val windowManager = checkNotNull(WindowManagerGlobal.getWindowManagerService())
private val lockPatternUtils = LockPatternUtils(context)
private var instantLockSavedValue = false
diff --git a/tools/aapt/AaptAssets.cpp b/tools/aapt/AaptAssets.cpp
index 0aaf3e8..82bcfc2 100644
--- a/tools/aapt/AaptAssets.cpp
+++ b/tools/aapt/AaptAssets.cpp
@@ -99,7 +99,7 @@
String8 fullPath(root);
appendPath(fullPath, String8(path));
- FileType type = getFileType(fullPath);
+ FileType type = getFileType(fullPath.c_str());
int plen = strlen(path);
@@ -287,19 +287,19 @@
Vector<String8> subtags = AaptUtil::splitAndLowerCase(part, '+');
subtags.removeItemsAt(0);
if (subtags.size() == 1) {
- setLanguage(subtags[0]);
+ setLanguage(subtags[0].c_str());
} else if (subtags.size() == 2) {
- setLanguage(subtags[0]);
+ setLanguage(subtags[0].c_str());
// The second tag can either be a region, a variant or a script.
switch (subtags[1].size()) {
case 2:
case 3:
- setRegion(subtags[1]);
+ setRegion(subtags[1].c_str());
break;
case 4:
if (isAlpha(subtags[1])) {
- setScript(subtags[1]);
+ setScript(subtags[1].c_str());
break;
}
// This is not alphabetical, so we fall through to variant
@@ -308,7 +308,7 @@
case 6:
case 7:
case 8:
- setVariant(subtags[1]);
+ setVariant(subtags[1].c_str());
break;
default:
fprintf(stderr, "ERROR: Invalid BCP 47 tag in directory name %s\n",
@@ -317,14 +317,14 @@
}
} else if (subtags.size() == 3) {
// The language is always the first subtag.
- setLanguage(subtags[0]);
+ setLanguage(subtags[0].c_str());
// The second subtag can either be a script or a region code.
// If its size is 4, it's a script code, else it's a region code.
if (subtags[1].size() == 4) {
- setScript(subtags[1]);
+ setScript(subtags[1].c_str());
} else if (subtags[1].size() == 2 || subtags[1].size() == 3) {
- setRegion(subtags[1]);
+ setRegion(subtags[1].c_str());
} else {
fprintf(stderr, "ERROR: Invalid BCP 47 tag in directory name %s\n", part.c_str());
return -1;
@@ -333,15 +333,15 @@
// The third tag can either be a region code (if the second tag was
// a script), else a variant code.
if (subtags[2].size() >= 4) {
- setVariant(subtags[2]);
+ setVariant(subtags[2].c_str());
} else {
- setRegion(subtags[2]);
+ setRegion(subtags[2].c_str());
}
} else if (subtags.size() == 4) {
- setLanguage(subtags[0]);
- setScript(subtags[1]);
- setRegion(subtags[2]);
- setVariant(subtags[3]);
+ setLanguage(subtags[0].c_str());
+ setScript(subtags[1].c_str());
+ setRegion(subtags[2].c_str());
+ setVariant(subtags[3].c_str());
} else {
fprintf(stderr, "ERROR: Invalid BCP 47 tag in directory name: %s\n", part.c_str());
return -1;
@@ -351,7 +351,7 @@
} else {
if ((part.length() == 2 || part.length() == 3)
&& isAlpha(part) && strcmp("car", part.c_str())) {
- setLanguage(part);
+ setLanguage(part.c_str());
if (++currentIndex == size) {
return size;
}
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index 800466a..43a8b52 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -401,7 +401,7 @@
Vector<String8> getNfcAidCategories(AssetManager& assets, const String8& xmlPath, bool offHost,
String8 *outError = NULL)
{
- Asset* aidAsset = assets.openNonAsset(xmlPath, Asset::ACCESS_BUFFER);
+ Asset* aidAsset = assets.openNonAsset(xmlPath.c_str(), Asset::ACCESS_BUFFER);
if (aidAsset == NULL) {
if (outError != NULL) *outError = "xml resource does not exist";
return Vector<String8>();
@@ -2760,7 +2760,7 @@
appendPath(dependencyFile, "R.java.d");
}
// Make sure we have a clean dependency file to start with
- fp = fopen(dependencyFile, "w");
+ fp = fopen(dependencyFile.c_str(), "w");
fclose(fp);
}
@@ -2849,7 +2849,7 @@
if (bundle->getGenDependencies()) {
// Now that writeResourceSymbols or writeAPK has taken care of writing
// the targets to our dependency file, we'll write the prereqs
- fp = fopen(dependencyFile, "a+");
+ fp = fopen(dependencyFile.c_str(), "a+");
fprintf(fp, " : ");
bool includeRaw = (outputAPKFile != NULL);
err = writeDependencyPreReqs(bundle, assets, fp, includeRaw);
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp
index 3a198fd..7e4e186 100644
--- a/tools/aapt/Resource.cpp
+++ b/tools/aapt/Resource.cpp
@@ -924,7 +924,7 @@
if (bundle->getCompileSdkVersion() != 0) {
if (!addTagAttribute(root, RESOURCES_ANDROID_NAMESPACE, "compileSdkVersion",
- String8::format("%d", bundle->getCompileSdkVersion()),
+ String8::format("%d", bundle->getCompileSdkVersion()).c_str(),
errorOnFailedInsert, true)) {
return UNKNOWN_ERROR;
}
@@ -932,21 +932,21 @@
if (bundle->getCompileSdkVersionCodename() != "") {
if (!addTagAttribute(root, RESOURCES_ANDROID_NAMESPACE, "compileSdkVersionCodename",
- bundle->getCompileSdkVersionCodename(), errorOnFailedInsert, true)) {
+ bundle->getCompileSdkVersionCodename().c_str(), errorOnFailedInsert, true)) {
return UNKNOWN_ERROR;
}
}
if (bundle->getPlatformBuildVersionCode() != "") {
if (!addTagAttribute(root, "", "platformBuildVersionCode",
- bundle->getPlatformBuildVersionCode(), errorOnFailedInsert, true)) {
+ bundle->getPlatformBuildVersionCode().c_str(), errorOnFailedInsert, true)) {
return UNKNOWN_ERROR;
}
}
if (bundle->getPlatformBuildVersionName() != "") {
if (!addTagAttribute(root, "", "platformBuildVersionName",
- bundle->getPlatformBuildVersionName(), errorOnFailedInsert, true)) {
+ bundle->getPlatformBuildVersionName().c_str(), errorOnFailedInsert, true)) {
return UNKNOWN_ERROR;
}
}
@@ -1210,7 +1210,7 @@
sp<XMLNode> manifest = XMLNode::newElement(filename, String16(), String16("manifest"));
// Add the 'package' attribute which is set to the package name.
- const char* packageName = assets->getPackage();
+ const char* packageName = assets->getPackage().c_str();
const char* manifestPackageNameOverride = bundle->getManifestPackageNameOverride();
if (manifestPackageNameOverride != NULL) {
packageName = manifestPackageNameOverride;
diff --git a/tools/aapt/StringPool.cpp b/tools/aapt/StringPool.cpp
index 8d02683..1af8d6f 100644
--- a/tools/aapt/StringPool.cpp
+++ b/tools/aapt/StringPool.cpp
@@ -472,13 +472,13 @@
ENCODE_LENGTH(strings, sizeof(uint8_t), encSize)
- strncpy((char*)strings, encStr, encSize+1);
+ strncpy((char*)strings, encStr.c_str(), encSize + 1);
} else {
char16_t* strings = (char16_t*)dat;
ENCODE_LENGTH(strings, sizeof(char16_t), strSize)
- strcpy16_htod(strings, ent.value);
+ strcpy16_htod(strings, ent.value.c_str());
}
strPos += totalSize;
@@ -592,7 +592,7 @@
ssize_t res = indices != NULL && indices->size() > 0 ? indices->itemAt(0) : -1;
if (kIsDebug) {
printf("Offset for string %s: %zd (%s)\n", String8(val).c_str(), res,
- res >= 0 ? String8(mEntries[mEntryArray[res]].value).c_str() : String8());
+ res >= 0 ? String8(mEntries[mEntryArray[res]].value).c_str() : "");
}
return res;
}
diff --git a/tools/aapt/XMLNode.cpp b/tools/aapt/XMLNode.cpp
index a887ac9..1a648c0 100644
--- a/tools/aapt/XMLNode.cpp
+++ b/tools/aapt/XMLNode.cpp
@@ -559,7 +559,7 @@
root->removeWhitespace(stripAll, cDataTags);
if (kIsDebug) {
- printf("Input XML from %s:\n", (const char*)file->getPrintableSource());
+ printf("Input XML from %s:\n", file->getPrintableSource().c_str());
root->print();
}
sp<AaptFile> rsc = new AaptFile(String8(), AaptGroupEntry(), String8());
diff --git a/tools/aapt/ZipEntry.cpp b/tools/aapt/ZipEntry.cpp
index 5339285..6886993 100644
--- a/tools/aapt/ZipEntry.cpp
+++ b/tools/aapt/ZipEntry.cpp
@@ -18,6 +18,8 @@
// Access to entries in a Zip archive.
//
+#define _POSIX_THREAD_SAFE_FUNCTIONS // For mingw localtime_r().
+
#define LOG_TAG "zip"
#include "ZipEntry.h"
@@ -337,39 +339,26 @@
/*
* Set the CDE/LFH timestamp from UNIX time.
*/
-void ZipEntry::setModWhen(time_t when)
-{
-#if !defined(_WIN32)
- struct tm tmResult;
-#endif
- time_t even;
- unsigned short zdate, ztime;
-
- struct tm* ptm;
-
+void ZipEntry::setModWhen(time_t when) {
/* round up to an even number of seconds */
- even = (time_t)(((unsigned long)(when) + 1) & (~1));
+ time_t even = (time_t)(((unsigned long)(when) + 1) & (~1));
/* expand */
-#if !defined(_WIN32)
- ptm = localtime_r(&even, &tmResult);
-#else
- ptm = localtime(&even);
-#endif
+ struct tm tmResult;
+ struct tm* ptm = localtime_r(&even, &tmResult);
int year;
year = ptm->tm_year;
if (year < 80)
year = 80;
- zdate = (year - 80) << 9 | (ptm->tm_mon+1) << 5 | ptm->tm_mday;
- ztime = ptm->tm_hour << 11 | ptm->tm_min << 5 | ptm->tm_sec >> 1;
+ unsigned short zdate = (year - 80) << 9 | (ptm->tm_mon + 1) << 5 | ptm->tm_mday;
+ unsigned short ztime = ptm->tm_hour << 11 | ptm->tm_min << 5 | ptm->tm_sec >> 1;
mCDE.mLastModFileTime = mLFH.mLastModFileTime = ztime;
mCDE.mLastModFileDate = mLFH.mLastModFileDate = zdate;
}
-
/*
* ===========================================================================
* ZipEntry::LocalFileHeader
diff --git a/tools/aapt/tests/AaptGroupEntry_test.cpp b/tools/aapt/tests/AaptGroupEntry_test.cpp
index bf5ca59..8621e9b 100644
--- a/tools/aapt/tests/AaptGroupEntry_test.cpp
+++ b/tools/aapt/tests/AaptGroupEntry_test.cpp
@@ -24,7 +24,7 @@
static ::testing::AssertionResult TestParse(AaptGroupEntry& entry, const String8& dirName,
String8* outType) {
- if (entry.initFromDirName(dirName, outType)) {
+ if (entry.initFromDirName(dirName.c_str(), outType)) {
return ::testing::AssertionSuccess() << dirName << " was successfully parsed";
}
return ::testing::AssertionFailure() << dirName << " could not be parsed";
diff --git a/tools/aapt2/DominatorTree_test.cpp b/tools/aapt2/DominatorTree_test.cpp
index a0679a6..087f456 100644
--- a/tools/aapt2/DominatorTree_test.cpp
+++ b/tools/aapt2/DominatorTree_test.cpp
@@ -50,8 +50,8 @@
private:
void VisitConfig(const DominatorTree::Node* node, const int indent) {
auto config_string = node->value()->config.toString();
- buffer_ << std::string(indent, ' ') << (config_string.empty() ? "<default>" : config_string)
- << std::endl;
+ buffer_ << std::string(indent, ' ')
+ << (config_string.empty() ? "<default>" : config_string.c_str()) << std::endl;
}
void VisitNode(const DominatorTree::Node* node, const int indent) {
diff --git a/tools/aapt2/OWNERS b/tools/aapt2/OWNERS
index 4f655e5..55bab7d 100644
--- a/tools/aapt2/OWNERS
+++ b/tools/aapt2/OWNERS
@@ -1,4 +1,4 @@
set noparent
-toddke@google.com
zyy@google.com
-patb@google.com
\ No newline at end of file
+patb@google.com
+markpun@google.com
diff --git a/tools/aapt2/compile/InlineXmlFormatParser.h b/tools/aapt2/compile/InlineXmlFormatParser.h
index 4300023..3a5161b 100644
--- a/tools/aapt2/compile/InlineXmlFormatParser.h
+++ b/tools/aapt2/compile/InlineXmlFormatParser.h
@@ -21,8 +21,8 @@
#include <vector>
#include "android-base/macros.h"
-
#include "process/IResourceTableConsumer.h"
+#include "xml/XmlDom.h"
namespace aapt {
diff --git a/tools/validatekeymaps/Main.cpp b/tools/validatekeymaps/Main.cpp
index 0d7d5f9..6cae3ec 100644
--- a/tools/validatekeymaps/Main.cpp
+++ b/tools/validatekeymaps/Main.cpp
@@ -165,7 +165,7 @@
case FileType::INPUT_DEVICE_CONFIGURATION: {
android::base::Result<std::unique_ptr<PropertyMap>> propertyMap =
- PropertyMap::load(String8(filename));
+ PropertyMap::load(String8(filename).c_str());
if (!propertyMap.ok()) {
error("Error %d parsing input device configuration file.\n\n",
propertyMap.error().code());