base: Redirect Google PermissionController intents to AOSP
Add intent redirection logic in ActivityTaskManagerService to intercept explicit activity launches targeting com.google.android.permissioncontroller and redirect them to com.android.permissioncontroller. This fixes crashes in Google Play Store and other GMS apps that hardcode explicit intents to Google's PermissionController package when opening permission management UIs. Without Google's PermissionController APEX installed, these intents fail with ActivityNotFoundException. Change-Id: Ic63961c0a982424be30f8f6f223d1fe5fc69cffb Signed-off-by: ARINDAM BHATTACHARJEE <abhattacharjee717@gmail.com>
This commit is contained in:
committed by
Zabuka_zuzu
parent
19bf8d3350
commit
2a545c4c6a
@@ -1277,6 +1277,23 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
@Nullable String callingFeatureId, Intent intent, String resolvedType,
|
||||
IBinder resultTo, String resultWho, int requestCode, int startFlags,
|
||||
ProfilerInfo profilerInfo, Bundle bOptions, int userId, boolean validateIncomingUser) {
|
||||
|
||||
// CUSTOM HACK: Redirect Google PermissionController explicit intents to AOSP
|
||||
if (intent != null && intent.getComponent() != null) {
|
||||
ComponentName comp = intent.getComponent();
|
||||
String pkg = comp.getPackageName();
|
||||
String cls = comp.getClassName();
|
||||
|
||||
if ("com.google.android.permissioncontroller".equals(pkg)) {
|
||||
// Replace package name in class name to redirect to AOSP
|
||||
String newCls = cls.replace("com.google.android.permissioncontroller",
|
||||
"com.android.permissioncontroller");
|
||||
intent.setComponent(new ComponentName("com.android.permissioncontroller", newCls));
|
||||
Slog.w(TAG, "HACK: Redirected Google PermissionController intent: "
|
||||
+ comp + " -> " + intent.getComponent());
|
||||
}
|
||||
}
|
||||
|
||||
mAmInternal.addCreatorToken(intent, callingPackage);
|
||||
final int callingPid = Binder.getCallingPid();
|
||||
final int callingUid = Binder.getCallingUid();
|
||||
|
||||
Reference in New Issue
Block a user