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

Commit b7240e2f authored by Adam Bookatz's avatar Adam Bookatz
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
Change-Id: I860e9e606de6b8d3c99fa52a63b72ba7a99ce179
parent 7a30c084
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -665,8 +665,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);
@@ -680,7 +681,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;