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

Commit 6f197b5d authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix role holder atom logging" into main

parents 99e072b0 9c0e0e80
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -3661,16 +3661,17 @@ public class StatsPullAtomService extends SystemService {

                    if (!packageNames.isEmpty()) {
                        for (String packageName : packageNames) {
                            PackageInfo pkg;
                            int uid = INVALID_UID;
                            try {
                                pkg = pm.getPackageInfoAsUser(packageName, 0, userId);
                                PackageInfo pkg = pm.getPackageInfoAsUser(packageName, 0, userId);
                                uid = pkg.applicationInfo.uid;
                            } catch (PackageManager.NameNotFoundException e) {
                                Slog.w(TAG, "Role holder " + packageName + " not found");
                                return StatsManager.PULL_SKIP;
                                Slog.w(TAG, "Role holder " + packageName + " not found for user "
                                        + userId);
                            }

                            pulledData.add(FrameworkStatsLog.buildStatsEvent(
                                    atomTag, pkg.applicationInfo.uid, packageName, roleName));
                                    atomTag, uid, packageName, roleName));
                        }
                    } else {
                        // Ensure that roles set to None are logged with an empty state.
@@ -3679,6 +3680,9 @@ public class StatsPullAtomService extends SystemService {
                    }
                }
            }
        } catch (Throwable t) {
            Log.e(TAG, "Could not read role holders", t);
            return StatsManager.PULL_SKIP;
        } finally {
            Binder.restoreCallingIdentity(callingToken);
        }