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

Commit a4f979ce authored by Ivan Chiang's avatar Ivan Chiang
Browse files

[PM] Send ACTION_PACKAGE_CHANGED when the app is installed

Before sending the ACTION_PACKAGE_CHANGED, check whether the app is
installed on the user or not.

Test: manual. Install one Apk in one user, check the result after
updating the mimeGroup
Bug: 297517712

Change-Id: I35f7dc5f30381c0b8a05ff45ae4984e28757a464
parent 04b951c1
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -6272,10 +6272,14 @@ public class PackageManagerService implements PackageSender, TestUtilityService
                    final int[] userIds = resolveUserIds(UserHandle.USER_ALL);
                    final String reason = "The mimeGroup is changed";
                    for (int i = 0; i < userIds.length; i++) {
                        final PackageUserStateInternal pkgUserState =
                                packageState.getUserStates().get(userIds[i]);
                        if (pkgUserState != null && pkgUserState.isInstalled()) {
                            final int packageUid = UserHandle.getUid(userIds[i], appId);
                            mBroadcastHelper.sendPackageChangedBroadcast(snapShot, packageName,
                                    true /* dontKillApp */, components, packageUid, reason);
                        }
                    }
                });
            }