[Safer intents] Permission controller

To avoid implicit intents, make intents launch explicitly.

Test: build, manual
Bug: 323061508
Change-Id: Ib95b417fc8682f690890fc55f321b4fece2c0369
This commit is contained in:
Jason Chiu
2024-03-27 12:25:32 +08:00
parent 67bfb4141f
commit cf13dfd4c6
22 changed files with 182 additions and 49 deletions

View File

@@ -67,6 +67,7 @@ public class RecentLocationAccessPreferenceController extends LocationBasePrefer
@Override
public boolean onPreferenceClick(Preference preference) {
final Intent intent = new Intent(Intent.ACTION_MANAGE_APP_PERMISSION);
intent.setPackage(mContext.getPackageManager().getPermissionControllerPackageName());
intent.putExtra(Intent.EXTRA_PERMISSION_GROUP_NAME, LOCATION);
intent.putExtra(Intent.EXTRA_PACKAGE_NAME, mPackage);
intent.putExtra(Intent.EXTRA_USER, mUserHandle);