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

Commit ca8aa125 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remove package name from the attribution tag." into rvc-dev am: c30e3937 am: e7a2e515

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11689596

Change-Id: I310eee2987b257232b7195c13c56def19ad91ad4
parents 6741fd74 e7a2e515
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -3577,7 +3577,16 @@ public class StatsPullAtomService extends SystemService {
    private void processHistoricalOp(AppOpsManager.HistoricalOp op,
            List<AppOpEntry> opsList, int uid, int samplingRatio, String packageName,
            @Nullable String attributionTag) {
        AppOpEntry entry = new AppOpEntry(packageName, attributionTag, op, uid);
        int firstChar = 0;
        if (attributionTag != null && attributionTag.startsWith(packageName)) {
            firstChar = packageName.length();
            if (firstChar < attributionTag.length() && attributionTag.charAt(firstChar) == '.') {
                firstChar++;
            }
        }
        AppOpEntry entry = new AppOpEntry(packageName,
                attributionTag == null ? null : attributionTag.substring(firstChar), op,
                uid);
        if (entry.mHash < samplingRatio) {
            opsList.add(entry);
        }