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

Commit 788a208c authored by Jeffrey Huang's avatar Jeffrey Huang Committed by Android (Google) Code Review
Browse files

Merge "Update some APIs to System and Public"

parents 509428e9 8ee4547a
Loading
Loading
Loading
Loading
+6 −8
Original line number Original line Diff line number Diff line
@@ -565,7 +565,8 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
                // Add in all the apps for every user/profile.
                // Add in all the apps for every user/profile.
                for (UserInfo profile : users) {
                for (UserInfo profile : users) {
                    List<PackageInfo> pi =
                    List<PackageInfo> pi =
                            pm.getInstalledPackagesAsUser(PackageManager.MATCH_KNOWN_PACKAGES,
                            pm.getInstalledPackagesAsUser(PackageManager.MATCH_UNINSTALLED_PACKAGES
                                            | PackageManager.MATCH_ANY_USER,
                                    profile.id);
                                    profile.id);
                    for (int j = 0; j < pi.size(); j++) {
                    for (int j = 0; j < pi.size(); j++) {
                        if (pi.get(j).applicationInfo != null) {
                        if (pi.get(j).applicationInfo != null) {
@@ -2736,23 +2737,20 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
                filter.addAction(Intent.ACTION_PACKAGE_ADDED);
                filter.addAction(Intent.ACTION_PACKAGE_ADDED);
                filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
                filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
                filter.addDataScheme("package");
                filter.addDataScheme("package");
                mContext.registerReceiverAsUser(mAppUpdateReceiver, UserHandle.ALL, filter,
                mContext.registerReceiverForAllUsers(mAppUpdateReceiver, filter, null, null);
                        null,
                        null);


                // Setup receiver for user initialize (which happens once for a new user)
                // Setup receiver for user initialize (which happens once for a new user)
                // and
                // and
                // if a user is removed.
                // if a user is removed.
                filter = new IntentFilter(Intent.ACTION_USER_INITIALIZE);
                filter = new IntentFilter(Intent.ACTION_USER_INITIALIZE);
                filter.addAction(Intent.ACTION_USER_REMOVED);
                filter.addAction(Intent.ACTION_USER_REMOVED);
                mContext.registerReceiverAsUser(mUserUpdateReceiver, UserHandle.ALL,
                mContext.registerReceiverForAllUsers(mUserUpdateReceiver, filter, null, null);
                        filter, null, null);


                // Setup receiver for device reboots or shutdowns.
                // Setup receiver for device reboots or shutdowns.
                filter = new IntentFilter(Intent.ACTION_REBOOT);
                filter = new IntentFilter(Intent.ACTION_REBOOT);
                filter.addAction(Intent.ACTION_SHUTDOWN);
                filter.addAction(Intent.ACTION_SHUTDOWN);
                mContext.registerReceiverAsUser(
                mContext.registerReceiverForAllUsers(
                        mShutdownEventReceiver, UserHandle.ALL, filter, null, null);
                        mShutdownEventReceiver, filter, null, null);
                final long token = Binder.clearCallingIdentity();
                final long token = Binder.clearCallingIdentity();
                try {
                try {
                    // Pull the latest state of UID->app name, version mapping when
                    // Pull the latest state of UID->app name, version mapping when