From 023f51f360472f6bb9bad495e55cdb32b5411bc5 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Wed, 29 Apr 2015 12:48:45 -0700 Subject: [PATCH] logd: uidToName add dex2oat UID - When searching for uidToName from /data/system/packages.list one must search for the uid % AID_USER; - If uid % AID_USER is greater than AID_SHARED_GID_START - AID_APP, then subract it and try again to pick up uidToName. Change-Id: I24df42957ff7e746fffa5d39484637b1b726b9c0 --- logd/LogStatistics.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/logd/LogStatistics.cpp b/logd/LogStatistics.cpp index 10f725558..2eab4dd72 100644 --- a/logd/LogStatistics.cpp +++ b/logd/LogStatistics.cpp @@ -131,7 +131,11 @@ char *LogStatistics::uidToName(uid_t uid) { } // Parse /data/system/packages.list - char *name = android::uidToName(uid); + uid_t userId = uid % AID_USER; + char *name = android::uidToName(userId); + if (!name && (userId > (AID_SHARED_GID_START - AID_APP))) { + name = android::uidToName(userId - (AID_SHARED_GID_START - AID_APP)); + } if (name) { return name; } @@ -149,7 +153,8 @@ char *LogStatistics::uidToName(uid_t uid) { name = strdup(n); } else if (strcmp(name, n)) { free(name); - return NULL; + name = NULL; + break; } } }