Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit ac20891e authored by Michael Bestas's avatar Michael Bestas
Browse files

Merge tag 'android-13.0.0_r41' into staging/lineage-20.0_merge-android-13.0.0_r41

Android 13.0.0 Release 41 (TQ2A.230405.003.E1)

# -----BEGIN PGP SIGNATURE-----
#
# iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCZDSEtAAKCRDorT+BmrEO
# eIa5AJ0YO+zwn0hFvMDLy4uelLPSzikj7ACffuknQvmFhYKPwx0tA9Zbxe0po/M=
# =THdP
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue Apr 11 00:50:44 2023 EEST
# gpg:                using DSA key 4340D13570EF945E83810964E8AD3F819AB10E78
# gpg: Good signature from "The Android Open Source Project <initial-contribution@android.com>" [marginal]
# gpg: initial-contribution@android.com: Verified 1654 signatures in the past
#      17 months.  Encrypted 4 messages in the past 15 months.
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 4340 D135 70EF 945E 8381  0964 E8AD 3F81 9AB1 0E78

# By Louis Chang (3) and others
# Via Android Build Coastguard Worker
* tag 'android-13.0.0_r41':
  Revert change that would detectFp when FP is locked out
  Revert change that would detectFp when FP is locked out
  Make DialogLaunchAnimator.showFromDialog more lenient
  [RESTRICT AUTOMERGE] Fix bypass BG-FGS and BAL via package manager APIs
  Fix bypass BAL via LocationManager.requestFlush
  [RESTRICT AUTOMERGE] Limit length of the name in <uses-permission>
  DO NOT MERGE: Context#startInstrumentation could be started from SHELL only now.
  Lower per-app NotificationChannelGroup limit.
  Encode Intent scheme when serializing to URI string RESTRICT AUTOMERGE
  Fix checkKeyIntentParceledCorrectly's bypass
  Checking if package belongs to UID before registering broadcast receiver
  Strip part of the activity info of another uid if no privilege
  Revert "Trim the activity info of another uid if no privilege"
  Trim the activity info of another uid if no privilege

Change-Id: I75eb48562e2f77e63885d3cf9c01f9468c941717
parents ad4f0754 cdc63a6b
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -11488,7 +11488,7 @@ public class Intent implements Parcelable, Cloneable {
    private void toUriInner(StringBuilder uri, String scheme, String defAction,
    private void toUriInner(StringBuilder uri, String scheme, String defAction,
            String defPackage, int flags) {
            String defPackage, int flags) {
        if (scheme != null) {
        if (scheme != null) {
            uri.append("scheme=").append(scheme).append(';');
            uri.append("scheme=").append(Uri.encode(scheme)).append(';');
        }
        }
        if (mAction != null && !mAction.equals(defAction)) {
        if (mAction != null && !mAction.equals(defAction)) {
            uri.append("action=").append(Uri.encode(mAction)).append(';');
            uri.append("action=").append(Uri.encode(mAction)).append(';');
+39 −2
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@ package android.content;
import android.annotation.Nullable;
import android.annotation.Nullable;
import android.app.ActivityManager;
import android.app.ActivityManager;
import android.app.ActivityManager.PendingIntentInfo;
import android.app.ActivityManager.PendingIntentInfo;
import android.app.ActivityOptions;
import android.compat.annotation.UnsupportedAppUsage;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Bundle;
import android.os.Bundle;
import android.os.Handler;
import android.os.Handler;
@@ -158,7 +159,7 @@ public class IntentSender implements Parcelable {
     */
     */
    public void sendIntent(Context context, int code, Intent intent,
    public void sendIntent(Context context, int code, Intent intent,
            OnFinished onFinished, Handler handler) throws SendIntentException {
            OnFinished onFinished, Handler handler) throws SendIntentException {
        sendIntent(context, code, intent, onFinished, handler, null);
        sendIntent(context, code, intent, onFinished, handler, null, null /* options */);
    }
    }


    /**
    /**
@@ -190,6 +191,42 @@ public class IntentSender implements Parcelable {
    public void sendIntent(Context context, int code, Intent intent,
    public void sendIntent(Context context, int code, Intent intent,
            OnFinished onFinished, Handler handler, String requiredPermission)
            OnFinished onFinished, Handler handler, String requiredPermission)
            throws SendIntentException {
            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 {
        try {
            String resolvedType = intent != null ?
            String resolvedType = intent != null ?
                    intent.resolveTypeIfNeeded(context.getContentResolver())
                    intent.resolveTypeIfNeeded(context.getContentResolver())
@@ -199,7 +236,7 @@ public class IntentSender implements Parcelable {
                    onFinished != null
                    onFinished != null
                            ? new FinishedDispatcher(this, onFinished, handler)
                            ? new FinishedDispatcher(this, onFinished, handler)
                            : null,
                            : null,
                    requiredPermission, null);
                    requiredPermission, options);
            if (res < 0) {
            if (res < 0) {
                throw new SendIntentException();
                throw new SendIntentException();
            }
            }
+10 −4
Original line number Original line Diff line number Diff line
@@ -298,10 +298,16 @@ constructor(
    ) {
    ) {
        val view =
        val view =
            openedDialogs.firstOrNull { it.dialog == animateFrom }?.dialogContentWithBackground
            openedDialogs.firstOrNull { it.dialog == animateFrom }?.dialogContentWithBackground
                ?: throw IllegalStateException(
        if (view == null) {
                    "The animateFrom dialog was not animated using " +
            Log.w(
                        "DialogLaunchAnimator.showFrom(View|Dialog)"
                TAG,
                "Showing dialog $dialog normally as the dialog it is shown from was not shown " +
                    "using DialogLaunchAnimator"
            )
            )
            dialog.show()
            return
        }

        showFromView(
        showFromView(
            dialog,
            dialog,
            view,
            view,
+6 −0
Original line number Original line Diff line number Diff line
@@ -260,6 +260,12 @@ class DialogLaunchAnimatorTest : SysuiTestCase() {
        assertThat(touchSurface.visibility).isEqualTo(View.GONE)
        assertThat(touchSurface.visibility).isEqualTo(View.GONE)
    }
    }


    @Test
    fun showFromDialogDoesNotCrashWhenShownFromRandomDialog() {
        val dialog = createDialogAndShowFromDialog(animateFrom = TestDialog(context))
        dialog.dismiss()
    }

    private fun createAndShowDialog(
    private fun createAndShowDialog(
        animator: DialogLaunchAnimator = dialogLaunchAnimator,
        animator: DialogLaunchAnimator = dialogLaunchAnimator,
    ): TestDialog {
    ): TestDialog {
+12 −8
Original line number Original line Diff line number Diff line
@@ -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) {
                        if (intent != null && notifyOnAuthFailure && !customTokens) {
                            /*
                            /*
                             * Make sure that the supplied intent is owned by the authenticator
                             * Make sure that the supplied intent is owned by the authenticator
@@ -3516,8 +3516,7 @@ public class AccountManagerService
            Bundle.setDefusable(result, true);
            Bundle.setDefusable(result, true);
            mNumResults++;
            mNumResults++;
            Intent intent = null;
            Intent intent = null;
            if (result != null
            if (result != null) {
                    && (intent = result.getParcelable(AccountManager.KEY_INTENT)) != null) {
                if (!checkKeyIntent(
                if (!checkKeyIntent(
                        Binder.getCallingUid(),
                        Binder.getCallingUid(),
                        result)) {
                        result)) {
@@ -4885,8 +4884,10 @@ public class AccountManagerService
            	EventLog.writeEvent(0x534e4554, "250588548", authUid, "");
            	EventLog.writeEvent(0x534e4554, "250588548", authUid, "");
                return false;
                return false;
            }
            }

            Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT, Intent.class);
            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
            // Explicitly set an empty ClipData to ensure that we don't offer to
            // promote any Uris contained inside for granting purposes
            // promote any Uris contained inside for granting purposes
            if (intent.getClipData() == null) {
            if (intent.getClipData() == null) {
@@ -4936,8 +4937,12 @@ public class AccountManagerService
            Bundle simulateBundle = p.readBundle();
            Bundle simulateBundle = p.readBundle();
            p.recycle();
            p.recycle();
            Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT, Intent.class);
            Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT, Intent.class);
            return (intent.filterEquals(simulateBundle.getParcelable(AccountManager.KEY_INTENT,
            Intent simulateIntent = simulateBundle.getParcelable(AccountManager.KEY_INTENT,
                Intent.class)));
                    Intent.class);
            if (intent == null) {
                return (simulateIntent == null);
            }
            return intent.filterEquals(simulateIntent);
        }
        }


        private boolean isExportedSystemActivity(ActivityInfo activityInfo) {
        private boolean isExportedSystemActivity(ActivityInfo activityInfo) {
@@ -5082,8 +5087,7 @@ public class AccountManagerService
                    }
                    }
                }
                }
            }
            }
            if (result != null
            if (result != null) {
                    && (intent = result.getParcelable(AccountManager.KEY_INTENT)) != null) {
                if (!checkKeyIntent(
                if (!checkKeyIntent(
                        Binder.getCallingUid(),
                        Binder.getCallingUid(),
                        result)) {
                        result)) {
Loading