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

Commit 9d420343 authored by Jackal Guo's avatar Jackal Guo Committed by Presubmit Automerger Backend
Browse files

[automerge] [RESTRICT AUTOMERGE] Correct the behavior of ACTION_PACKAGE_DATA_CLEARED 2p: 1748c4e3

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20302364

Bug: 240267890
Change-Id: I3cbe20a8111634773900dc0c363cf0486178ed52
parents eee2531e 1748c4e3
Loading
Loading
Loading
Loading
+19 −14
Original line number Diff line number Diff line
@@ -3517,20 +3517,25 @@ public class ActivityManagerService extends IActivityManager.Stub
                            finishForceStopPackageLocked(packageName, appInfo.uid);
                        }
                    }
                    if (succeeded) {
                        final Intent intent = new Intent(Intent.ACTION_PACKAGE_DATA_CLEARED,
                            Uri.fromParts("package", packageName, null));
                                Uri.fromParts("package", packageName, null /* fragment */));
                        intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
                    intent.putExtra(Intent.EXTRA_UID, (appInfo != null) ? appInfo.uid : -1);
                        intent.putExtra(Intent.EXTRA_UID,
                                (appInfo != null) ? appInfo.uid : INVALID_UID);
                        intent.putExtra(Intent.EXTRA_USER_HANDLE, resolvedUserId);
                        if (isInstantApp) {
                            intent.putExtra(Intent.EXTRA_PACKAGE_NAME, packageName);
                        broadcastIntentInPackage("android", null, SYSTEM_UID, uid, pid, intent,
                                null, null, 0, null, null, permission.ACCESS_INSTANT_APPS, null,
                                false, false, resolvedUserId, false, null);
                    } else {
                        broadcastIntentInPackage("android", null, SYSTEM_UID, uid, pid, intent,
                                null, null, 0, null, null, null, null, false, false, resolvedUserId,
                                false, null);
                        }
                        broadcastIntentInPackage("android", null /* featureId */, SYSTEM_UID,
                                uid, pid, intent, null /* resolvedType */, null /* resultTo */,
                                0 /* resultCode */, null /* resultData */, null /* resultExtras */,
                                isInstantApp ? permission.ACCESS_INSTANT_APPS : null,
                                null /* bOptions */, false /* serialized */, false /* sticky */,
                                resolvedUserId, false /* allowBackgroundActivityStarts */,
                                null /* backgroundActivityStartsToken */);
                    }
                    if (observer != null) {