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

Commit ae4bb7b0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Update SCS to use #getUserHandles"

parents 41df8e46 31f01cc8
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -542,9 +542,9 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
    private void informAllUidsLocked(Context context) throws RemoteException {
        UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
        PackageManager pm = context.getPackageManager();
        final List<UserInfo> users = um.getUsers(true);
        final List<UserHandle> users = um.getUserHandles(true);
        if (DEBUG) {
            Slog.d(TAG, "Iterating over " + users.size() + " profiles.");
            Slog.d(TAG, "Iterating over " + users.size() + " userHandles.");
        }

        ParcelFileDescriptor[] fds;
@@ -571,11 +571,11 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
                ProtoOutputStream output = new ProtoOutputStream(fout);
                int numRecords = 0;
                // Add in all the apps for every user/profile.
                for (UserInfo profile : users) {
                for (UserHandle userHandle : users) {
                    List<PackageInfo> pi =
                            pm.getInstalledPackagesAsUser(PackageManager.MATCH_UNINSTALLED_PACKAGES
                                            | PackageManager.MATCH_ANY_USER,
                                    profile.id);
                                    userHandle.getIdentifier());
                    for (int j = 0; j < pi.size(); j++) {
                        if (pi.get(j).applicationInfo != null) {
                            String installer;