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

Commit 31f01cc8 authored by Jeffrey Huang's avatar Jeffrey Huang
Browse files

Update SCS to use #getUserHandles

Bug: 144930182
Test: GTS Tests
Change-Id: I358aeba9e0b23d98f0c84c7e75782b1321951a96
parent 56911a86
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -541,9 +541,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;
@@ -570,11 +570,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;