summaryrefslogtreecommitdiffstats
path: root/logd
diff options
context:
space:
mode:
Diffstat (limited to 'logd')
-rw-r--r--logd/LogStatistics.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/logd/LogStatistics.cpp b/logd/LogStatistics.cpp
index 10f7255..2eab4dd 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;
}
}
}