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

Commit ca8f012d authored by Adam Bookatz's avatar Adam Bookatz Committed by Android Build Coastguard Worker
Browse files

startActivityForResult with earlier new Intent

We already make sure to use a copy of the Intent, but now we do so
earlier. See bug.

Bug: 353680402
Flag: EXEMPT bugfix
Test: manual
Test: atest com.android.settings.users.UserSettingsTest
            com.android.settings.users.UserDetailsSettingsTest
(cherry picked from commit b7240e2f)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7ffa1f91350d51cbd26a5ee1ac4aada7ae1ca7be)
Merged-In: I860e9e606de6b8d3c99fa52a63b72ba7a99ce179
Change-Id: I860e9e606de6b8d3c99fa52a63b72ba7a99ce179
parent cee46cf8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -669,8 +669,9 @@ public class AppRestrictionsFragment extends SettingsPreferenceFragment implemen
         */
        private Intent assertSafeToStartCustomActivity(Intent intent) {
            EventLog.writeEvent(0x534e4554, "223578534", -1 /* UID */, "");
            final Intent vettedIntent = new Intent(intent);
            ResolveInfo resolveInfo = mPackageManager.resolveActivity(
                    intent, PackageManager.MATCH_DEFAULT_ONLY);
                    vettedIntent, PackageManager.MATCH_DEFAULT_ONLY);

            if (resolveInfo == null) {
                throw new ActivityNotFoundException("No result for resolving " + intent);
@@ -684,7 +685,6 @@ public class AppRestrictionsFragment extends SettingsPreferenceFragment implemen

            // We were able to vet the given intent this time. Make a copy using the components
            // that were used to do the vetting, since that's as much as we've verified is safe.
            final Intent vettedIntent = new Intent(intent);
            vettedIntent.setComponent(activityInfo.getComponentName());
            vettedIntent.setPackage(activityInfo.packageName);
            return vettedIntent;