1 /*
2  * Copyright (C) 2017 The Android Open Source Project
3  *
4  * Licensed under the Apache License, versionCode 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #define DEBUG false  // STOPSHIP if true
17 #include "Log.h"
18 
19 #include "hash.h"
20 #include "stats_log_util.h"
21 #include "guardrail/StatsdStats.h"
22 #include "packages/UidMap.h"
23 
24 #include <inttypes.h>
25 
26 using namespace android;
27 
28 using android::base::StringPrintf;
29 using android::util::FIELD_COUNT_REPEATED;
30 using android::util::FIELD_TYPE_BOOL;
31 using android::util::FIELD_TYPE_FLOAT;
32 using android::util::FIELD_TYPE_INT32;
33 using android::util::FIELD_TYPE_INT64;
34 using android::util::FIELD_TYPE_UINT64;
35 using android::util::FIELD_TYPE_MESSAGE;
36 using android::util::FIELD_TYPE_STRING;
37 using android::util::ProtoOutputStream;
38 
39 namespace android {
40 namespace os {
41 namespace statsd {
42 
43 const int FIELD_ID_SNAPSHOT_PACKAGE_NAME = 1;
44 const int FIELD_ID_SNAPSHOT_PACKAGE_VERSION = 2;
45 const int FIELD_ID_SNAPSHOT_PACKAGE_UID = 3;
46 const int FIELD_ID_SNAPSHOT_PACKAGE_DELETED = 4;
47 const int FIELD_ID_SNAPSHOT_PACKAGE_NAME_HASH = 5;
48 const int FIELD_ID_SNAPSHOT_PACKAGE_VERSION_STRING = 6;
49 const int FIELD_ID_SNAPSHOT_PACKAGE_VERSION_STRING_HASH = 7;
50 const int FIELD_ID_SNAPSHOT_PACKAGE_INSTALLER = 8;
51 const int FIELD_ID_SNAPSHOT_PACKAGE_INSTALLER_HASH = 9;
52 const int FIELD_ID_SNAPSHOT_TIMESTAMP = 1;
53 const int FIELD_ID_SNAPSHOT_PACKAGE_INFO = 2;
54 const int FIELD_ID_SNAPSHOTS = 1;
55 const int FIELD_ID_CHANGES = 2;
56 const int FIELD_ID_CHANGE_DELETION = 1;
57 const int FIELD_ID_CHANGE_TIMESTAMP = 2;
58 const int FIELD_ID_CHANGE_PACKAGE = 3;
59 const int FIELD_ID_CHANGE_UID = 4;
60 const int FIELD_ID_CHANGE_NEW_VERSION = 5;
61 const int FIELD_ID_CHANGE_PREV_VERSION = 6;
62 const int FIELD_ID_CHANGE_PACKAGE_HASH = 7;
63 const int FIELD_ID_CHANGE_NEW_VERSION_STRING = 8;
64 const int FIELD_ID_CHANGE_PREV_VERSION_STRING = 9;
65 const int FIELD_ID_CHANGE_NEW_VERSION_STRING_HASH = 10;
66 const int FIELD_ID_CHANGE_PREV_VERSION_STRING_HASH = 11;
67 
UidMap()68 UidMap::UidMap() : mBytesUsed(0) {}
69 
~UidMap()70 UidMap::~UidMap() {}
71 
getInstance()72 sp<UidMap> UidMap::getInstance() {
73     static sp<UidMap> sInstance = new UidMap();
74     return sInstance;
75 }
76 
hasApp(int uid,const string & packageName) const77 bool UidMap::hasApp(int uid, const string& packageName) const {
78     lock_guard<mutex> lock(mMutex);
79 
80     auto it = mMap.find(std::make_pair(uid, packageName));
81     return it != mMap.end() && !it->second.deleted;
82 }
83 
normalizeAppName(const string & appName) const84 string UidMap::normalizeAppName(const string& appName) const {
85     string normalizedName = appName;
86     std::transform(normalizedName.begin(), normalizedName.end(), normalizedName.begin(), ::tolower);
87     return normalizedName;
88 }
89 
getAppNamesFromUid(const int32_t & uid,bool returnNormalized) const90 std::set<string> UidMap::getAppNamesFromUid(const int32_t& uid, bool returnNormalized) const {
91     lock_guard<mutex> lock(mMutex);
92     return getAppNamesFromUidLocked(uid,returnNormalized);
93 }
94 
getAppNamesFromUidLocked(const int32_t & uid,bool returnNormalized) const95 std::set<string> UidMap::getAppNamesFromUidLocked(const int32_t& uid, bool returnNormalized) const {
96     std::set<string> names;
97     for (const auto& kv : mMap) {
98         if (kv.first.first == uid && !kv.second.deleted) {
99             names.insert(returnNormalized ? normalizeAppName(kv.first.second) : kv.first.second);
100         }
101     }
102     return names;
103 }
104 
getAppVersion(int uid,const string & packageName) const105 int64_t UidMap::getAppVersion(int uid, const string& packageName) const {
106     lock_guard<mutex> lock(mMutex);
107 
108     auto it = mMap.find(std::make_pair(uid, packageName));
109     if (it == mMap.end() || it->second.deleted) {
110         return 0;
111     }
112     return it->second.versionCode;
113 }
114 
updateMap(const int64_t & timestamp,const vector<int32_t> & uid,const vector<int64_t> & versionCode,const vector<String16> & versionString,const vector<String16> & packageName,const vector<String16> & installer)115 void UidMap::updateMap(const int64_t& timestamp, const vector<int32_t>& uid,
116                        const vector<int64_t>& versionCode, const vector<String16>& versionString,
117                        const vector<String16>& packageName, const vector<String16>& installer) {
118     wp<PackageInfoListener> broadcast = NULL;
119     {
120         lock_guard<mutex> lock(mMutex);  // Exclusively lock for updates.
121 
122         std::unordered_map<std::pair<int, string>, AppData, PairHash> deletedApps;
123 
124         // Copy all the deleted apps.
125         for (const auto& kv : mMap) {
126             if (kv.second.deleted) {
127                 deletedApps[kv.first] = kv.second;
128             }
129         }
130 
131         mMap.clear();
132         for (size_t j = 0; j < uid.size(); j++) {
133             string package = string(String8(packageName[j]).string());
134             mMap[std::make_pair(uid[j], package)] =
135                     AppData(versionCode[j], string(String8(versionString[j]).string()),
136                             string(String8(installer[j]).string()));
137         }
138 
139         for (const auto& kv : deletedApps) {
140             auto mMapIt = mMap.find(kv.first);
141             if (mMapIt != mMap.end()) {
142                 // Insert this deleted app back into the current map.
143                 mMap[kv.first] = kv.second;
144             }
145         }
146 
147         ensureBytesUsedBelowLimit();
148         StatsdStats::getInstance().setCurrentUidMapMemory(mBytesUsed);
149         broadcast = mSubscriber;
150     }
151     // To avoid invoking callback while holding the internal lock. we get a copy of the listener
152     // and invoke the callback. It's still possible that after we copy the listener, it removes
153     // itself before we call it. It's then the listener's job to handle it (expect the callback to
154     // be called after listener is removed, and the listener should properly ignore it).
155     auto strongPtr = broadcast.promote();
156     if (strongPtr != NULL) {
157         strongPtr->onUidMapReceived(timestamp);
158     }
159 }
160 
updateApp(const int64_t & timestamp,const String16 & app_16,const int32_t & uid,const int64_t & versionCode,const String16 & versionString,const String16 & installer)161 void UidMap::updateApp(const int64_t& timestamp, const String16& app_16, const int32_t& uid,
162                        const int64_t& versionCode, const String16& versionString,
163                        const String16& installer) {
164     wp<PackageInfoListener> broadcast = NULL;
165     string appName = string(String8(app_16).string());
166     {
167         lock_guard<mutex> lock(mMutex);
168         int32_t prevVersion = 0;
169         string prevVersionString = "";
170         string newVersionString = string(String8(versionString).string());
171         bool found = false;
172         auto it = mMap.find(std::make_pair(uid, appName));
173         if (it != mMap.end()) {
174             found = true;
175             prevVersion = it->second.versionCode;
176             prevVersionString = it->second.versionString;
177             it->second.versionCode = versionCode;
178             it->second.versionString = newVersionString;
179             it->second.installer = string(String8(installer).string());
180             it->second.deleted = false;
181         }
182         if (!found) {
183             // Otherwise, we need to add an app at this uid.
184             mMap[std::make_pair(uid, appName)] =
185                     AppData(versionCode, newVersionString, string(String8(installer).string()));
186         } else {
187             // Only notify the listeners if this is an app upgrade. If this app is being installed
188             // for the first time, then we don't notify the listeners.
189             // It's also OK to split again if we're forming a partial bucket after re-installing an
190             // app after deletion.
191             broadcast = mSubscriber;
192         }
193         mChanges.emplace_back(false, timestamp, appName, uid, versionCode, newVersionString,
194                               prevVersion, prevVersionString);
195         mBytesUsed += kBytesChangeRecord;
196         ensureBytesUsedBelowLimit();
197         StatsdStats::getInstance().setCurrentUidMapMemory(mBytesUsed);
198         StatsdStats::getInstance().setUidMapChanges(mChanges.size());
199     }
200 
201     auto strongPtr = broadcast.promote();
202     if (strongPtr != NULL) {
203         strongPtr->notifyAppUpgrade(timestamp, appName, uid, versionCode);
204     }
205 }
206 
ensureBytesUsedBelowLimit()207 void UidMap::ensureBytesUsedBelowLimit() {
208     size_t limit;
209     if (maxBytesOverride <= 0) {
210         limit = StatsdStats::kMaxBytesUsedUidMap;
211     } else {
212         limit = maxBytesOverride;
213     }
214     while (mBytesUsed > limit) {
215         ALOGI("Bytes used %zu is above limit %zu, need to delete something", mBytesUsed, limit);
216         if (mChanges.size() > 0) {
217             mBytesUsed -= kBytesChangeRecord;
218             mChanges.pop_front();
219             StatsdStats::getInstance().noteUidMapDropped(1);
220         }
221     }
222 }
223 
removeApp(const int64_t & timestamp,const String16 & app_16,const int32_t & uid)224 void UidMap::removeApp(const int64_t& timestamp, const String16& app_16, const int32_t& uid) {
225     wp<PackageInfoListener> broadcast = NULL;
226     string app = string(String8(app_16).string());
227     {
228         lock_guard<mutex> lock(mMutex);
229 
230         int64_t prevVersion = 0;
231         string prevVersionString = "";
232         auto key = std::make_pair(uid, app);
233         auto it = mMap.find(key);
234         if (it != mMap.end() && !it->second.deleted) {
235             prevVersion = it->second.versionCode;
236             prevVersionString = it->second.versionString;
237             it->second.deleted = true;
238             mDeletedApps.push_back(key);
239         }
240         if (mDeletedApps.size() > StatsdStats::kMaxDeletedAppsInUidMap) {
241             // Delete the oldest one.
242             auto oldest = mDeletedApps.front();
243             mDeletedApps.pop_front();
244             mMap.erase(oldest);
245             StatsdStats::getInstance().noteUidMapAppDeletionDropped();
246         }
247         mChanges.emplace_back(true, timestamp, app, uid, 0, "", prevVersion, prevVersionString);
248         mBytesUsed += kBytesChangeRecord;
249         ensureBytesUsedBelowLimit();
250         StatsdStats::getInstance().setCurrentUidMapMemory(mBytesUsed);
251         StatsdStats::getInstance().setUidMapChanges(mChanges.size());
252         broadcast = mSubscriber;
253     }
254 
255     auto strongPtr = broadcast.promote();
256     if (strongPtr != NULL) {
257         strongPtr->notifyAppRemoved(timestamp, app, uid);
258     }
259 }
260 
setListener(wp<PackageInfoListener> listener)261 void UidMap::setListener(wp<PackageInfoListener> listener) {
262     lock_guard<mutex> lock(mMutex);  // Lock for updates
263     mSubscriber = listener;
264 }
265 
assignIsolatedUid(int isolatedUid,int parentUid)266 void UidMap::assignIsolatedUid(int isolatedUid, int parentUid) {
267     lock_guard<mutex> lock(mIsolatedMutex);
268 
269     mIsolatedUidMap[isolatedUid] = parentUid;
270 }
271 
removeIsolatedUid(int isolatedUid)272 void UidMap::removeIsolatedUid(int isolatedUid) {
273     lock_guard<mutex> lock(mIsolatedMutex);
274 
275     auto it = mIsolatedUidMap.find(isolatedUid);
276     if (it != mIsolatedUidMap.end()) {
277         mIsolatedUidMap.erase(it);
278     }
279 }
280 
getHostUidOrSelf(int uid) const281 int UidMap::getHostUidOrSelf(int uid) const {
282     lock_guard<mutex> lock(mIsolatedMutex);
283 
284     auto it = mIsolatedUidMap.find(uid);
285     if (it != mIsolatedUidMap.end()) {
286         return it->second;
287     }
288     return uid;
289 }
290 
clearOutput()291 void UidMap::clearOutput() {
292     mChanges.clear();
293     // Also update the guardrail trackers.
294     StatsdStats::getInstance().setUidMapChanges(0);
295     mBytesUsed = 0;
296     StatsdStats::getInstance().setCurrentUidMapMemory(mBytesUsed);
297 }
298 
getMinimumTimestampNs()299 int64_t UidMap::getMinimumTimestampNs() {
300     int64_t m = 0;
301     for (const auto& kv : mLastUpdatePerConfigKey) {
302         if (m == 0) {
303             m = kv.second;
304         } else if (kv.second < m) {
305             m = kv.second;
306         }
307     }
308     return m;
309 }
310 
getBytesUsed() const311 size_t UidMap::getBytesUsed() const {
312     return mBytesUsed;
313 }
314 
writeUidMapSnapshot(int64_t timestamp,bool includeVersionStrings,bool includeInstaller,const std::set<int32_t> & interestingUids,std::set<string> * str_set,ProtoOutputStream * proto)315 void UidMap::writeUidMapSnapshot(int64_t timestamp, bool includeVersionStrings,
316                                  bool includeInstaller, const std::set<int32_t>& interestingUids,
317                                  std::set<string>* str_set, ProtoOutputStream* proto) {
318     lock_guard<mutex> lock(mMutex);
319 
320     writeUidMapSnapshotLocked(timestamp, includeVersionStrings, includeInstaller, interestingUids,
321                               str_set, proto);
322 }
323 
writeUidMapSnapshotLocked(int64_t timestamp,bool includeVersionStrings,bool includeInstaller,const std::set<int32_t> & interestingUids,std::set<string> * str_set,ProtoOutputStream * proto)324 void UidMap::writeUidMapSnapshotLocked(int64_t timestamp, bool includeVersionStrings,
325                                        bool includeInstaller,
326                                        const std::set<int32_t>& interestingUids,
327                                        std::set<string>* str_set, ProtoOutputStream* proto) {
328     proto->write(FIELD_TYPE_INT64 | FIELD_ID_SNAPSHOT_TIMESTAMP, (long long)timestamp);
329     for (const auto& kv : mMap) {
330         if (!interestingUids.empty() &&
331             interestingUids.find(kv.first.first) == interestingUids.end()) {
332             continue;
333         }
334         uint64_t token = proto->start(FIELD_TYPE_MESSAGE | FIELD_COUNT_REPEATED |
335                                       FIELD_ID_SNAPSHOT_PACKAGE_INFO);
336         if (str_set != nullptr) {
337             str_set->insert(kv.first.second);
338             proto->write(FIELD_TYPE_UINT64 | FIELD_ID_SNAPSHOT_PACKAGE_NAME_HASH,
339                          (long long)Hash64(kv.first.second));
340             if (includeVersionStrings) {
341                 str_set->insert(kv.second.versionString);
342                 proto->write(FIELD_TYPE_UINT64 | FIELD_ID_SNAPSHOT_PACKAGE_VERSION_STRING_HASH,
343                              (long long)Hash64(kv.second.versionString));
344             }
345             if (includeInstaller) {
346                 str_set->insert(kv.second.installer);
347                 proto->write(FIELD_TYPE_UINT64 | FIELD_ID_SNAPSHOT_PACKAGE_INSTALLER_HASH,
348                              (long long)Hash64(kv.second.installer));
349             }
350         } else {
351             proto->write(FIELD_TYPE_STRING | FIELD_ID_SNAPSHOT_PACKAGE_NAME, kv.first.second);
352             if (includeVersionStrings) {
353                 proto->write(FIELD_TYPE_STRING | FIELD_ID_SNAPSHOT_PACKAGE_VERSION_STRING,
354                              kv.second.versionString);
355             }
356             if (includeInstaller) {
357                 proto->write(FIELD_TYPE_STRING | FIELD_ID_SNAPSHOT_PACKAGE_INSTALLER,
358                              kv.second.installer);
359             }
360         }
361 
362         proto->write(FIELD_TYPE_INT64 | FIELD_ID_SNAPSHOT_PACKAGE_VERSION,
363                      (long long)kv.second.versionCode);
364         proto->write(FIELD_TYPE_INT32 | FIELD_ID_SNAPSHOT_PACKAGE_UID, kv.first.first);
365         proto->write(FIELD_TYPE_BOOL | FIELD_ID_SNAPSHOT_PACKAGE_DELETED, kv.second.deleted);
366         proto->end(token);
367     }
368 }
369 
appendUidMap(const int64_t & timestamp,const ConfigKey & key,std::set<string> * str_set,bool includeVersionStrings,bool includeInstaller,ProtoOutputStream * proto)370 void UidMap::appendUidMap(const int64_t& timestamp, const ConfigKey& key, std::set<string>* str_set,
371                           bool includeVersionStrings, bool includeInstaller,
372                           ProtoOutputStream* proto) {
373     lock_guard<mutex> lock(mMutex);  // Lock for updates
374 
375     for (const ChangeRecord& record : mChanges) {
376         if (record.timestampNs > mLastUpdatePerConfigKey[key]) {
377             uint64_t changesToken =
378                     proto->start(FIELD_TYPE_MESSAGE | FIELD_COUNT_REPEATED | FIELD_ID_CHANGES);
379             proto->write(FIELD_TYPE_BOOL | FIELD_ID_CHANGE_DELETION, (bool)record.deletion);
380             proto->write(FIELD_TYPE_INT64 | FIELD_ID_CHANGE_TIMESTAMP,
381                          (long long)record.timestampNs);
382             if (str_set != nullptr) {
383                 str_set->insert(record.package);
384                 proto->write(FIELD_TYPE_UINT64 | FIELD_ID_CHANGE_PACKAGE_HASH,
385                              (long long)Hash64(record.package));
386                 if (includeVersionStrings) {
387                     str_set->insert(record.versionString);
388                     proto->write(FIELD_TYPE_UINT64 | FIELD_ID_CHANGE_NEW_VERSION_STRING_HASH,
389                                  (long long)Hash64(record.versionString));
390                     str_set->insert(record.prevVersionString);
391                     proto->write(FIELD_TYPE_UINT64 | FIELD_ID_CHANGE_PREV_VERSION_STRING_HASH,
392                                  (long long)Hash64(record.prevVersionString));
393                 }
394             } else {
395                 proto->write(FIELD_TYPE_STRING | FIELD_ID_CHANGE_PACKAGE, record.package);
396                 if (includeVersionStrings) {
397                     proto->write(FIELD_TYPE_STRING | FIELD_ID_CHANGE_NEW_VERSION_STRING,
398                                  record.versionString);
399                     proto->write(FIELD_TYPE_STRING | FIELD_ID_CHANGE_PREV_VERSION_STRING,
400                                  record.prevVersionString);
401                 }
402             }
403 
404             proto->write(FIELD_TYPE_INT32 | FIELD_ID_CHANGE_UID, (int)record.uid);
405             proto->write(FIELD_TYPE_INT64 | FIELD_ID_CHANGE_NEW_VERSION, (long long)record.version);
406             proto->write(FIELD_TYPE_INT64 | FIELD_ID_CHANGE_PREV_VERSION,
407                          (long long)record.prevVersion);
408             proto->end(changesToken);
409         }
410     }
411 
412     // Write snapshot from current uid map state.
413     uint64_t snapshotsToken =
414             proto->start(FIELD_TYPE_MESSAGE | FIELD_COUNT_REPEATED | FIELD_ID_SNAPSHOTS);
415     writeUidMapSnapshotLocked(timestamp, includeVersionStrings, includeInstaller,
416                               std::set<int32_t>() /*empty uid set means including every uid*/,
417                               str_set, proto);
418     proto->end(snapshotsToken);
419 
420     int64_t prevMin = getMinimumTimestampNs();
421     mLastUpdatePerConfigKey[key] = timestamp;
422     int64_t newMin = getMinimumTimestampNs();
423 
424     if (newMin > prevMin) {  // Delete anything possible now that the minimum has
425                              // moved forward.
426         int64_t cutoff_nanos = newMin;
427         for (auto it_changes = mChanges.begin(); it_changes != mChanges.end();) {
428             if (it_changes->timestampNs < cutoff_nanos) {
429                 mBytesUsed -= kBytesChangeRecord;
430                 it_changes = mChanges.erase(it_changes);
431             } else {
432                 ++it_changes;
433             }
434         }
435     }
436     StatsdStats::getInstance().setCurrentUidMapMemory(mBytesUsed);
437     StatsdStats::getInstance().setUidMapChanges(mChanges.size());
438 }
439 
printUidMap(int out) const440 void UidMap::printUidMap(int out) const {
441     lock_guard<mutex> lock(mMutex);
442 
443     for (const auto& kv : mMap) {
444         if (!kv.second.deleted) {
445             dprintf(out, "%s, v%" PRId64 ", %s, %s (%i)\n", kv.first.second.c_str(),
446                     kv.second.versionCode, kv.second.versionString.c_str(),
447                     kv.second.installer.c_str(), kv.first.first);
448         }
449     }
450 }
451 
OnConfigUpdated(const ConfigKey & key)452 void UidMap::OnConfigUpdated(const ConfigKey& key) {
453     mLastUpdatePerConfigKey[key] = -1;
454 }
455 
OnConfigRemoved(const ConfigKey & key)456 void UidMap::OnConfigRemoved(const ConfigKey& key) {
457     mLastUpdatePerConfigKey.erase(key);
458 }
459 
getAppUid(const string & package) const460 set<int32_t> UidMap::getAppUid(const string& package) const {
461     lock_guard<mutex> lock(mMutex);
462 
463     set<int32_t> results;
464     for (const auto& kv : mMap) {
465         if (kv.first.second == package && !kv.second.deleted) {
466             results.insert(kv.first.first);
467         }
468     }
469     return results;
470 }
471 
472 // Note not all the following AIDs are used as uids. Some are used only for gids.
473 // It's ok to leave them in the map, but we won't ever see them in the log's uid field.
474 // App's uid starts from 10000, and will not overlap with the following AIDs.
475 const std::map<string, uint32_t> UidMap::sAidToUidMapping = {{"AID_ROOT", 0},
476                                                              {"AID_SYSTEM", 1000},
477                                                              {"AID_RADIO", 1001},
478                                                              {"AID_BLUETOOTH", 1002},
479                                                              {"AID_GRAPHICS", 1003},
480                                                              {"AID_INPUT", 1004},
481                                                              {"AID_AUDIO", 1005},
482                                                              {"AID_CAMERA", 1006},
483                                                              {"AID_LOG", 1007},
484                                                              {"AID_COMPASS", 1008},
485                                                              {"AID_MOUNT", 1009},
486                                                              {"AID_WIFI", 1010},
487                                                              {"AID_ADB", 1011},
488                                                              {"AID_INSTALL", 1012},
489                                                              {"AID_MEDIA", 1013},
490                                                              {"AID_DHCP", 1014},
491                                                              {"AID_SDCARD_RW", 1015},
492                                                              {"AID_VPN", 1016},
493                                                              {"AID_KEYSTORE", 1017},
494                                                              {"AID_USB", 1018},
495                                                              {"AID_DRM", 1019},
496                                                              {"AID_MDNSR", 1020},
497                                                              {"AID_GPS", 1021},
498                                                              // {"AID_UNUSED1", 1022},
499                                                              {"AID_MEDIA_RW", 1023},
500                                                              {"AID_MTP", 1024},
501                                                              // {"AID_UNUSED2", 1025},
502                                                              {"AID_DRMRPC", 1026},
503                                                              {"AID_NFC", 1027},
504                                                              {"AID_SDCARD_R", 1028},
505                                                              {"AID_CLAT", 1029},
506                                                              {"AID_LOOP_RADIO", 1030},
507                                                              {"AID_MEDIA_DRM", 1031},
508                                                              {"AID_PACKAGE_INFO", 1032},
509                                                              {"AID_SDCARD_PICS", 1033},
510                                                              {"AID_SDCARD_AV", 1034},
511                                                              {"AID_SDCARD_ALL", 1035},
512                                                              {"AID_LOGD", 1036},
513                                                              {"AID_SHARED_RELRO", 1037},
514                                                              {"AID_DBUS", 1038},
515                                                              {"AID_TLSDATE", 1039},
516                                                              {"AID_MEDIA_EX", 1040},
517                                                              {"AID_AUDIOSERVER", 1041},
518                                                              {"AID_METRICS_COLL", 1042},
519                                                              {"AID_METRICSD", 1043},
520                                                              {"AID_WEBSERV", 1044},
521                                                              {"AID_DEBUGGERD", 1045},
522                                                              {"AID_MEDIA_CODEC", 1046},
523                                                              {"AID_CAMERASERVER", 1047},
524                                                              {"AID_FIREWALL", 1048},
525                                                              {"AID_TRUNKS", 1049},
526                                                              {"AID_NVRAM", 1050},
527                                                              {"AID_DNS", 1051},
528                                                              {"AID_DNS_TETHER", 1052},
529                                                              {"AID_WEBVIEW_ZYGOTE", 1053},
530                                                              {"AID_VEHICLE_NETWORK", 1054},
531                                                              {"AID_MEDIA_AUDIO", 1055},
532                                                              {"AID_MEDIA_VIDEO", 1056},
533                                                              {"AID_MEDIA_IMAGE", 1057},
534                                                              {"AID_TOMBSTONED", 1058},
535                                                              {"AID_MEDIA_OBB", 1059},
536                                                              {"AID_ESE", 1060},
537                                                              {"AID_OTA_UPDATE", 1061},
538                                                              {"AID_AUTOMOTIVE_EVS", 1062},
539                                                              {"AID_LOWPAN", 1063},
540                                                              {"AID_HSM", 1064},
541                                                              {"AID_RESERVED_DISK", 1065},
542                                                              {"AID_STATSD", 1066},
543                                                              {"AID_INCIDENTD", 1067},
544                                                              {"AID_SECURE_ELEMENT", 1068},
545                                                              {"AID_LMKD", 1069},
546                                                              {"AID_LLKD", 1070},
547                                                              {"AID_IORAPD", 1071},
548                                                              {"AID_GPU_SERVICE", 1072},
549                                                              {"AID_NETWORK_STACK", 1073},
550                                                              {"AID_GSID", 1074},
551                                                              {"AID_FSVERITY_CERT", 1075},
552                                                              {"AID_CREDSTORE", 1076},
553                                                              {"AID_EXTERNAL_STORAGE", 1077},
554                                                              {"AID_EXT_DATA_RW", 1078},
555                                                              {"AID_EXT_OBB_RW", 1079},
556                                                              {"AID_CONTEXT_HUB", 1080},
557                                                              {"AID_SHELL", 2000},
558                                                              {"AID_CACHE", 2001},
559                                                              {"AID_DIAG", 2002}};
560 
561 }  // namespace statsd
562 }  // namespace os
563 }  // namespace android
564