Loading core/java/android/app/ActivityOptions.java +5 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ import static android.Manifest.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIO import static android.app.ActivityTaskManager.SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT; import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; import static android.content.Intent.FLAG_RECEIVER_FOREGROUND; import static android.view.Display.INVALID_DISPLAY; import android.annotation.NonNull; Loading Loading @@ -1372,7 +1374,9 @@ public class ActivityOptions extends ComponentOptions { * @hide */ public int getPendingIntentLaunchFlags() { return mPendingIntentLaunchFlags; // b/243794108: Ignore all flags except the new task flag, to be reconsidered in b/254490217 return mPendingIntentLaunchFlags & (FLAG_ACTIVITY_NEW_TASK | FLAG_RECEIVER_FOREGROUND); } /** Loading core/java/android/app/Notification.java +11 −0 Original line number Diff line number Diff line Loading @@ -2510,6 +2510,17 @@ public class Notification implements Parcelable if (person != null && person.getIconUri() != null) { visitor.accept(person.getIconUri()); } final RemoteInputHistoryItem[] history = (RemoteInputHistoryItem[]) extras.getParcelableArray(Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS); if (history != null) { for (int i = 0; i < history.length; i++) { RemoteInputHistoryItem item = history[i]; if (item.getUri() != null) { visitor.accept(item.getUri()); } } } } if (MessagingStyle.class.equals(getNotificationStyle()) && extras != null) { Loading core/java/android/content/pm/ShortcutInfo.java +17 −3 Original line number Diff line number Diff line Loading @@ -261,6 +261,12 @@ public final class ShortcutInfo implements Parcelable { */ public static final int DISABLED_REASON_OTHER_RESTORE_ISSUE = 103; /** * The maximum length of Shortcut ID. IDs will be truncated at this limit. * @hide */ public static final int MAX_ID_LENGTH = 1000; /** @hide */ @IntDef(prefix = { "DISABLED_REASON_" }, value = { DISABLED_REASON_NOT_DISABLED, Loading Loading @@ -436,8 +442,7 @@ public final class ShortcutInfo implements Parcelable { private ShortcutInfo(Builder b) { mUserId = b.mContext.getUserId(); mId = Preconditions.checkStringNotEmpty(b.mId, "Shortcut ID must be provided"); mId = getSafeId(Preconditions.checkStringNotEmpty(b.mId, "Shortcut ID must be provided")); // Note we can't do other null checks here because SM.updateShortcuts() takes partial // information. Loading Loading @@ -539,6 +544,14 @@ public final class ShortcutInfo implements Parcelable { return ret; } @NonNull private static String getSafeId(@NonNull String id) { if (id.length() > MAX_ID_LENGTH) { return id.substring(0, MAX_ID_LENGTH); } return id; } /** * Throws if any of the mandatory fields is not set. * Loading Loading @@ -2090,7 +2103,8 @@ public final class ShortcutInfo implements Parcelable { final ClassLoader cl = getClass().getClassLoader(); mUserId = source.readInt(); mId = source.readString8(); mId = getSafeId(Preconditions.checkStringNotEmpty(source.readString8(), "Shortcut ID must be provided")); mPackageName = source.readString8(); mActivity = source.readParcelable(cl); mFlags = source.readInt(); Loading core/java/android/util/apk/ApkSignatureSchemeV2Verifier.java +10 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,11 @@ public class ApkSignatureSchemeV2Verifier { private static final int APK_SIGNATURE_SCHEME_V2_BLOCK_ID = 0x7109871a; /** * The maximum number of signers supported by the v2 APK signature scheme. */ private static final int MAX_V2_SIGNERS = 10; /** * Returns {@code true} if the provided APK contains an APK Signature Scheme V2 signature. * Loading Loading @@ -183,6 +188,11 @@ public class ApkSignatureSchemeV2Verifier { } while (signers.hasRemaining()) { signerCount++; if (signerCount > MAX_V2_SIGNERS) { throw new SecurityException( "APK Signature Scheme v2 only supports a maximum of " + MAX_V2_SIGNERS + " signers"); } try { ByteBuffer signer = getLengthPrefixedSlice(signers); X509Certificate[] certs = verifySigner(signer, contentDigests, certFactory); Loading core/java/android/util/jar/StrictJarVerifier.java +11 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,11 @@ class StrictJarVerifier { "SHA1", }; /** * The maximum number of signers supported by the JAR signature scheme. */ private static final int MAX_JAR_SIGNERS = 10; private final String jarName; private final StrictJarManifest manifest; private final HashMap<String, byte[]> metaEntries; Loading Loading @@ -293,10 +298,16 @@ class StrictJarVerifier { return false; } int signerCount = 0; Iterator<String> it = metaEntries.keySet().iterator(); while (it.hasNext()) { String key = it.next(); if (key.endsWith(".DSA") || key.endsWith(".RSA") || key.endsWith(".EC")) { if (++signerCount > MAX_JAR_SIGNERS) { throw new SecurityException( "APK Signature Scheme v1 only supports a maximum of " + MAX_JAR_SIGNERS + " signers"); } verifyCertificate(key); it.remove(); } Loading Loading
core/java/android/app/ActivityOptions.java +5 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ import static android.Manifest.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIO import static android.app.ActivityTaskManager.SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT; import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; import static android.content.Intent.FLAG_RECEIVER_FOREGROUND; import static android.view.Display.INVALID_DISPLAY; import android.annotation.NonNull; Loading Loading @@ -1372,7 +1374,9 @@ public class ActivityOptions extends ComponentOptions { * @hide */ public int getPendingIntentLaunchFlags() { return mPendingIntentLaunchFlags; // b/243794108: Ignore all flags except the new task flag, to be reconsidered in b/254490217 return mPendingIntentLaunchFlags & (FLAG_ACTIVITY_NEW_TASK | FLAG_RECEIVER_FOREGROUND); } /** Loading
core/java/android/app/Notification.java +11 −0 Original line number Diff line number Diff line Loading @@ -2510,6 +2510,17 @@ public class Notification implements Parcelable if (person != null && person.getIconUri() != null) { visitor.accept(person.getIconUri()); } final RemoteInputHistoryItem[] history = (RemoteInputHistoryItem[]) extras.getParcelableArray(Notification.EXTRA_REMOTE_INPUT_HISTORY_ITEMS); if (history != null) { for (int i = 0; i < history.length; i++) { RemoteInputHistoryItem item = history[i]; if (item.getUri() != null) { visitor.accept(item.getUri()); } } } } if (MessagingStyle.class.equals(getNotificationStyle()) && extras != null) { Loading
core/java/android/content/pm/ShortcutInfo.java +17 −3 Original line number Diff line number Diff line Loading @@ -261,6 +261,12 @@ public final class ShortcutInfo implements Parcelable { */ public static final int DISABLED_REASON_OTHER_RESTORE_ISSUE = 103; /** * The maximum length of Shortcut ID. IDs will be truncated at this limit. * @hide */ public static final int MAX_ID_LENGTH = 1000; /** @hide */ @IntDef(prefix = { "DISABLED_REASON_" }, value = { DISABLED_REASON_NOT_DISABLED, Loading Loading @@ -436,8 +442,7 @@ public final class ShortcutInfo implements Parcelable { private ShortcutInfo(Builder b) { mUserId = b.mContext.getUserId(); mId = Preconditions.checkStringNotEmpty(b.mId, "Shortcut ID must be provided"); mId = getSafeId(Preconditions.checkStringNotEmpty(b.mId, "Shortcut ID must be provided")); // Note we can't do other null checks here because SM.updateShortcuts() takes partial // information. Loading Loading @@ -539,6 +544,14 @@ public final class ShortcutInfo implements Parcelable { return ret; } @NonNull private static String getSafeId(@NonNull String id) { if (id.length() > MAX_ID_LENGTH) { return id.substring(0, MAX_ID_LENGTH); } return id; } /** * Throws if any of the mandatory fields is not set. * Loading Loading @@ -2090,7 +2103,8 @@ public final class ShortcutInfo implements Parcelable { final ClassLoader cl = getClass().getClassLoader(); mUserId = source.readInt(); mId = source.readString8(); mId = getSafeId(Preconditions.checkStringNotEmpty(source.readString8(), "Shortcut ID must be provided")); mPackageName = source.readString8(); mActivity = source.readParcelable(cl); mFlags = source.readInt(); Loading
core/java/android/util/apk/ApkSignatureSchemeV2Verifier.java +10 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,11 @@ public class ApkSignatureSchemeV2Verifier { private static final int APK_SIGNATURE_SCHEME_V2_BLOCK_ID = 0x7109871a; /** * The maximum number of signers supported by the v2 APK signature scheme. */ private static final int MAX_V2_SIGNERS = 10; /** * Returns {@code true} if the provided APK contains an APK Signature Scheme V2 signature. * Loading Loading @@ -183,6 +188,11 @@ public class ApkSignatureSchemeV2Verifier { } while (signers.hasRemaining()) { signerCount++; if (signerCount > MAX_V2_SIGNERS) { throw new SecurityException( "APK Signature Scheme v2 only supports a maximum of " + MAX_V2_SIGNERS + " signers"); } try { ByteBuffer signer = getLengthPrefixedSlice(signers); X509Certificate[] certs = verifySigner(signer, contentDigests, certFactory); Loading
core/java/android/util/jar/StrictJarVerifier.java +11 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,11 @@ class StrictJarVerifier { "SHA1", }; /** * The maximum number of signers supported by the JAR signature scheme. */ private static final int MAX_JAR_SIGNERS = 10; private final String jarName; private final StrictJarManifest manifest; private final HashMap<String, byte[]> metaEntries; Loading Loading @@ -293,10 +298,16 @@ class StrictJarVerifier { return false; } int signerCount = 0; Iterator<String> it = metaEntries.keySet().iterator(); while (it.hasNext()) { String key = it.next(); if (key.endsWith(".DSA") || key.endsWith(".RSA") || key.endsWith(".EC")) { if (++signerCount > MAX_JAR_SIGNERS) { throw new SecurityException( "APK Signature Scheme v1 only supports a maximum of " + MAX_JAR_SIGNERS + " signers"); } verifyCertificate(key); it.remove(); } Loading