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

Commit dbcf85e5 authored by Stanislav Zholnin's avatar Stanislav Zholnin
Browse files

Trim "android.permission." from permission name to reduce reporting footprint.

Bug: 136134050
Test: ./out/host/linux-x86/bin/statsd_testdrive 10050
Change-Id: I32f4c83f3362ca06cf0893b60f523af86cbcda5c
parent fd2f367d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -188,6 +188,7 @@ public class StatsPullAtomService extends SystemService {
    private static final int MAX_BATTERY_STATS_HELPER_FREQUENCY_MS = 1000;
    private static final int CPU_TIME_PER_THREAD_FREQ_MAX_NUM_FREQUENCIES = 8;
    private static final int OP_FLAGS_PULLED = OP_FLAG_SELF | OP_FLAG_TRUSTED_PROXIED;
    private static final String COMMON_PERMISSION_PREFIX = "android.permission.";

    private final Object mNetworkStatsLock = new Object();
    @GuardedBy("mNetworkStatsLock")
@@ -2627,6 +2628,10 @@ public class StatsPullAtomService extends SystemService {
                            continue;
                        }

                        if (permName.startsWith(COMMON_PERMISSION_PREFIX)) {
                            permName = permName.substring(COMMON_PERMISSION_PREFIX.length());
                        }

                        StatsEvent.Builder e = StatsEvent.newBuilder();
                        e.setAtomId(atomTag);
                        e.writeString(permName);