Loading core/java/android/content/Intent.java +1 −1 Original line number Diff line number Diff line Loading @@ -11488,7 +11488,7 @@ public class Intent implements Parcelable, Cloneable { private void toUriInner(StringBuilder uri, String scheme, String defAction, String defPackage, int flags) { if (scheme != null) { uri.append("scheme=").append(scheme).append(';'); uri.append("scheme=").append(Uri.encode(scheme)).append(';'); } if (mAction != null && !mAction.equals(defAction)) { uri.append("action=").append(Uri.encode(mAction)).append(';'); Loading core/java/android/content/IntentSender.java +39 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.content; import android.annotation.Nullable; import android.app.ActivityManager; import android.app.ActivityManager.PendingIntentInfo; import android.app.ActivityOptions; import android.compat.annotation.UnsupportedAppUsage; import android.os.Bundle; import android.os.Handler; Loading Loading @@ -158,7 +159,7 @@ public class IntentSender implements Parcelable { */ public void sendIntent(Context context, int code, Intent intent, OnFinished onFinished, Handler handler) throws SendIntentException { sendIntent(context, code, intent, onFinished, handler, null); sendIntent(context, code, intent, onFinished, handler, null, null /* options */); } /** Loading Loading @@ -190,6 +191,42 @@ public class IntentSender implements Parcelable { public void sendIntent(Context context, int code, Intent intent, OnFinished onFinished, Handler handler, String requiredPermission) throws SendIntentException { sendIntent(context, code, intent, onFinished, handler, requiredPermission, null /* options */); } /** * Perform the operation associated with this IntentSender, allowing the * caller to specify information about the Intent to use and be notified * when the send has completed. * * @param context The Context of the caller. This may be null if * <var>intent</var> is also null. * @param code Result code to supply back to the IntentSender's target. * @param intent Additional Intent data. See {@link Intent#fillIn * Intent.fillIn()} for information on how this is applied to the * original Intent. Use null to not modify the original Intent. * @param onFinished The object to call back on when the send has * completed, or null for no callback. * @param handler Handler identifying the thread on which the callback * should happen. If null, the callback will happen from the thread * pool of the process. * @param requiredPermission Name of permission that a recipient of the PendingIntent * is required to hold. This is only valid for broadcast intents, and * corresponds to the permission argument in * {@link Context#sendBroadcast(Intent, String) Context.sendOrderedBroadcast(Intent, String)}. * If null, no permission is required. * @param options Additional options the caller would like to provide to modify the sending * behavior. May be built from an {@link ActivityOptions} to apply to an activity start. * * @throws SendIntentException Throws CanceledIntentException if the IntentSender * is no longer allowing more intents to be sent through it. * @hide */ public void sendIntent(Context context, int code, Intent intent, OnFinished onFinished, Handler handler, String requiredPermission, @Nullable Bundle options) throws SendIntentException { try { String resolvedType = intent != null ? intent.resolveTypeIfNeeded(context.getContentResolver()) Loading @@ -199,7 +236,7 @@ public class IntentSender implements Parcelable { onFinished != null ? new FinishedDispatcher(this, onFinished, handler) : null, requiredPermission, null); requiredPermission, options); if (res < 0) { throw new SendIntentException(); } Loading packages/SystemUI/animation/src/com/android/systemui/animation/DialogLaunchAnimator.kt +10 −4 Original line number Diff line number Diff line Loading @@ -298,10 +298,16 @@ constructor( ) { val view = openedDialogs.firstOrNull { it.dialog == animateFrom }?.dialogContentWithBackground ?: throw IllegalStateException( "The animateFrom dialog was not animated using " + "DialogLaunchAnimator.showFrom(View|Dialog)" if (view == null) { Log.w( TAG, "Showing dialog $dialog normally as the dialog it is shown from was not shown " + "using DialogLaunchAnimator" ) dialog.show() return } showFromView( dialog, view, Loading packages/SystemUI/tests/src/com/android/systemui/animation/DialogLaunchAnimatorTest.kt +6 −0 Original line number Diff line number Diff line Loading @@ -260,6 +260,12 @@ class DialogLaunchAnimatorTest : SysuiTestCase() { assertThat(touchSurface.visibility).isEqualTo(View.GONE) } @Test fun showFromDialogDoesNotCrashWhenShownFromRandomDialog() { val dialog = createDialogAndShowFromDialog(animateFrom = TestDialog(context)) dialog.dismiss() } private fun createAndShowDialog( animator: DialogLaunchAnimator = dialogLaunchAnimator, ): TestDialog { Loading services/core/java/com/android/server/accounts/AccountManagerService.java +12 −8 Original line number Diff line number Diff line Loading @@ -3091,7 +3091,7 @@ public class AccountManagerService } } Intent intent = result.getParcelable(AccountManager.KEY_INTENT); Intent intent = result.getParcelable(AccountManager.KEY_INTENT, Intent.class); if (intent != null && notifyOnAuthFailure && !customTokens) { /* * Make sure that the supplied intent is owned by the authenticator Loading Loading @@ -3516,8 +3516,7 @@ public class AccountManagerService Bundle.setDefusable(result, true); mNumResults++; Intent intent = null; if (result != null && (intent = result.getParcelable(AccountManager.KEY_INTENT)) != null) { if (result != null) { if (!checkKeyIntent( Binder.getCallingUid(), result)) { Loading Loading @@ -4885,8 +4884,10 @@ public class AccountManagerService EventLog.writeEvent(0x534e4554, "250588548", authUid, ""); return false; } Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT, Intent.class); if (intent == null) { return true; } // Explicitly set an empty ClipData to ensure that we don't offer to // promote any Uris contained inside for granting purposes if (intent.getClipData() == null) { Loading Loading @@ -4936,8 +4937,12 @@ public class AccountManagerService Bundle simulateBundle = p.readBundle(); p.recycle(); Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT, Intent.class); return (intent.filterEquals(simulateBundle.getParcelable(AccountManager.KEY_INTENT, Intent.class))); Intent simulateIntent = simulateBundle.getParcelable(AccountManager.KEY_INTENT, Intent.class); if (intent == null) { return (simulateIntent == null); } return intent.filterEquals(simulateIntent); } private boolean isExportedSystemActivity(ActivityInfo activityInfo) { Loading Loading @@ -5082,8 +5087,7 @@ public class AccountManagerService } } } if (result != null && (intent = result.getParcelable(AccountManager.KEY_INTENT)) != null) { if (result != null) { if (!checkKeyIntent( Binder.getCallingUid(), result)) { Loading Loading
core/java/android/content/Intent.java +1 −1 Original line number Diff line number Diff line Loading @@ -11488,7 +11488,7 @@ public class Intent implements Parcelable, Cloneable { private void toUriInner(StringBuilder uri, String scheme, String defAction, String defPackage, int flags) { if (scheme != null) { uri.append("scheme=").append(scheme).append(';'); uri.append("scheme=").append(Uri.encode(scheme)).append(';'); } if (mAction != null && !mAction.equals(defAction)) { uri.append("action=").append(Uri.encode(mAction)).append(';'); Loading
core/java/android/content/IntentSender.java +39 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.content; import android.annotation.Nullable; import android.app.ActivityManager; import android.app.ActivityManager.PendingIntentInfo; import android.app.ActivityOptions; import android.compat.annotation.UnsupportedAppUsage; import android.os.Bundle; import android.os.Handler; Loading Loading @@ -158,7 +159,7 @@ public class IntentSender implements Parcelable { */ public void sendIntent(Context context, int code, Intent intent, OnFinished onFinished, Handler handler) throws SendIntentException { sendIntent(context, code, intent, onFinished, handler, null); sendIntent(context, code, intent, onFinished, handler, null, null /* options */); } /** Loading Loading @@ -190,6 +191,42 @@ public class IntentSender implements Parcelable { public void sendIntent(Context context, int code, Intent intent, OnFinished onFinished, Handler handler, String requiredPermission) throws SendIntentException { sendIntent(context, code, intent, onFinished, handler, requiredPermission, null /* options */); } /** * Perform the operation associated with this IntentSender, allowing the * caller to specify information about the Intent to use and be notified * when the send has completed. * * @param context The Context of the caller. This may be null if * <var>intent</var> is also null. * @param code Result code to supply back to the IntentSender's target. * @param intent Additional Intent data. See {@link Intent#fillIn * Intent.fillIn()} for information on how this is applied to the * original Intent. Use null to not modify the original Intent. * @param onFinished The object to call back on when the send has * completed, or null for no callback. * @param handler Handler identifying the thread on which the callback * should happen. If null, the callback will happen from the thread * pool of the process. * @param requiredPermission Name of permission that a recipient of the PendingIntent * is required to hold. This is only valid for broadcast intents, and * corresponds to the permission argument in * {@link Context#sendBroadcast(Intent, String) Context.sendOrderedBroadcast(Intent, String)}. * If null, no permission is required. * @param options Additional options the caller would like to provide to modify the sending * behavior. May be built from an {@link ActivityOptions} to apply to an activity start. * * @throws SendIntentException Throws CanceledIntentException if the IntentSender * is no longer allowing more intents to be sent through it. * @hide */ public void sendIntent(Context context, int code, Intent intent, OnFinished onFinished, Handler handler, String requiredPermission, @Nullable Bundle options) throws SendIntentException { try { String resolvedType = intent != null ? intent.resolveTypeIfNeeded(context.getContentResolver()) Loading @@ -199,7 +236,7 @@ public class IntentSender implements Parcelable { onFinished != null ? new FinishedDispatcher(this, onFinished, handler) : null, requiredPermission, null); requiredPermission, options); if (res < 0) { throw new SendIntentException(); } Loading
packages/SystemUI/animation/src/com/android/systemui/animation/DialogLaunchAnimator.kt +10 −4 Original line number Diff line number Diff line Loading @@ -298,10 +298,16 @@ constructor( ) { val view = openedDialogs.firstOrNull { it.dialog == animateFrom }?.dialogContentWithBackground ?: throw IllegalStateException( "The animateFrom dialog was not animated using " + "DialogLaunchAnimator.showFrom(View|Dialog)" if (view == null) { Log.w( TAG, "Showing dialog $dialog normally as the dialog it is shown from was not shown " + "using DialogLaunchAnimator" ) dialog.show() return } showFromView( dialog, view, Loading
packages/SystemUI/tests/src/com/android/systemui/animation/DialogLaunchAnimatorTest.kt +6 −0 Original line number Diff line number Diff line Loading @@ -260,6 +260,12 @@ class DialogLaunchAnimatorTest : SysuiTestCase() { assertThat(touchSurface.visibility).isEqualTo(View.GONE) } @Test fun showFromDialogDoesNotCrashWhenShownFromRandomDialog() { val dialog = createDialogAndShowFromDialog(animateFrom = TestDialog(context)) dialog.dismiss() } private fun createAndShowDialog( animator: DialogLaunchAnimator = dialogLaunchAnimator, ): TestDialog { Loading
services/core/java/com/android/server/accounts/AccountManagerService.java +12 −8 Original line number Diff line number Diff line Loading @@ -3091,7 +3091,7 @@ public class AccountManagerService } } Intent intent = result.getParcelable(AccountManager.KEY_INTENT); Intent intent = result.getParcelable(AccountManager.KEY_INTENT, Intent.class); if (intent != null && notifyOnAuthFailure && !customTokens) { /* * Make sure that the supplied intent is owned by the authenticator Loading Loading @@ -3516,8 +3516,7 @@ public class AccountManagerService Bundle.setDefusable(result, true); mNumResults++; Intent intent = null; if (result != null && (intent = result.getParcelable(AccountManager.KEY_INTENT)) != null) { if (result != null) { if (!checkKeyIntent( Binder.getCallingUid(), result)) { Loading Loading @@ -4885,8 +4884,10 @@ public class AccountManagerService EventLog.writeEvent(0x534e4554, "250588548", authUid, ""); return false; } Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT, Intent.class); if (intent == null) { return true; } // Explicitly set an empty ClipData to ensure that we don't offer to // promote any Uris contained inside for granting purposes if (intent.getClipData() == null) { Loading Loading @@ -4936,8 +4937,12 @@ public class AccountManagerService Bundle simulateBundle = p.readBundle(); p.recycle(); Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT, Intent.class); return (intent.filterEquals(simulateBundle.getParcelable(AccountManager.KEY_INTENT, Intent.class))); Intent simulateIntent = simulateBundle.getParcelable(AccountManager.KEY_INTENT, Intent.class); if (intent == null) { return (simulateIntent == null); } return intent.filterEquals(simulateIntent); } private boolean isExportedSystemActivity(ActivityInfo activityInfo) { Loading Loading @@ -5082,8 +5087,7 @@ public class AccountManagerService } } } if (result != null && (intent = result.getParcelable(AccountManager.KEY_INTENT)) != null) { if (result != null) { if (!checkKeyIntent( Binder.getCallingUid(), result)) { Loading