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

Commit 2182702a 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
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a4f979ceb770a9776b86ef8769fb179d32b43f81)
Merged-In: I35f7dc5f30381c0b8a05ff45ae4984e28757a464
Change-Id: I35f7dc5f30381c0b8a05ff45ae4984e28757a464
parent 8ea780f2
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -6278,10 +6278,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);
                        }
                    }
                });
            }