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 b7240e2f0c50455a1c8f3ae1fc4f27d55b86e89b)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d8166274a030372f9b1184137fceef9d4dac83e1)
Merged-In: I860e9e606de6b8d3c99fa52a63b72ba7a99ce179
Change-Id: I860e9e606de6b8d3c99fa52a63b72ba7a99ce179
This commit is contained in:
committed by
Android Build Coastguard Worker
parent
504a34c4d4
commit
25ed933c4c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user