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

Commit b270fc22 authored by Fyodor Kupolov's avatar Fyodor Kupolov
Browse files

Use sharedUserId as package name if there are collisions

Per-UID Summary (cpu_time, % of total cpu_time, call_count, exception_count, package/uid):
    13095032  43%    44663   0 shared:com.package.shareduid/u0a35
     8872156  29%     5831   0 com.package2/u0a75
     2379684   8%     1549   0 com.package3/u0a23

Test: manual dumpsys binder_calls_stats
Test: BinderCallsStatsTest + BinderCallsStatsPerfTest
Bug: 75318418
Change-Id: I9b122252d8f8d3d2297bc71d46d5944c4402fd5e
parent 0c40911e
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -106,7 +106,13 @@ public class BinderCallsStatsService extends Binder {
        }
        Map<Integer,String> map = new HashMap<>();
        for (PackageInfo pkg : packages) {
            map.put(pkg.applicationInfo.uid, pkg.packageName);
            String name = pkg.packageName;
            int uid = pkg.applicationInfo.uid;
            // Use sharedUserId string as package name if there are collisions
            if (pkg.sharedUserId != null && map.containsKey(uid)) {
                name = "shared:" + pkg.sharedUserId;
            }
            map.put(uid, name);
        }
        return map;
    }