[Safer intents] Connectivity

To avoid implicit intents, make intents launch explicitly.

Bug: 323061508
Test: build
Change-Id: I44ff8a789d933f11ba7e68e52055575245276224
This commit is contained in:
Jason Chiu
2024-03-26 16:44:48 +08:00
parent 67bfb4141f
commit c53a73ef70
15 changed files with 32 additions and 9 deletions

View File

@@ -55,7 +55,8 @@ public abstract class ProfileSettingsPreferenceFragment extends RestrictedDashbo
final UserHandle selectedUser = profileSpinnerAdapter.getUserHandle(position);
if (selectedUser.getIdentifier() != UserHandle.myUserId()) {
final Activity activity = getActivity();
Intent intent = new Intent(getIntentActionString());
Intent intent = new Intent(getIntentActionString())
.setPackage(getContext().getPackageName());
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
activity.startActivityAsUser(intent, selectedUser);