diff options
| author | 2020-06-11 13:28:03 +0000 | |
|---|---|---|
| committer | 2020-06-11 13:28:03 +0000 | |
| commit | c30e39377a60e138ac5db7b3b47532b56284c7c8 (patch) | |
| tree | 646e26852733a52082394e728f0f87ac93e79900 | |
| parent | 1f6b99d5fa0a4af04eb3c5b680a0e070f18c387e (diff) | |
| parent | 044b1790c5159cd6cc1cb9547360fd63b3a8fae7 (diff) | |
Merge "Remove package name from the attribution tag." into rvc-dev
| -rw-r--r-- | services/core/java/com/android/server/stats/pull/StatsPullAtomService.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java index c2bae1a8962b..bfdb9d291f28 100644 --- a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java +++ b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java @@ -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); } |