Merge "libmeminfo: Add libmeminfo to gather global and per-process memory stats"
diff --git a/libutils/include/utils/Thread.h b/libutils/include/utils/Thread.h
index 3525138..fc67656 100644
--- a/libutils/include/utils/Thread.h
+++ b/libutils/include/utils/Thread.h
@@ -47,6 +47,7 @@
virtual ~Thread();
// Start the thread in threadLoop() which needs to be implemented.
+ // NOLINTNEXTLINE(google-default-arguments)
virtual status_t run( const char* name,
int32_t priority = PRIORITY_DEFAULT,
size_t stack = 0);
diff --git a/run-as/run-as.cpp b/run-as/run-as.cpp
index d005ecf..ac470d4 100644
--- a/run-as/run-as.cpp
+++ b/run-as/run-as.cpp
@@ -167,6 +167,15 @@
if (!packagelist_parse(packagelist_parse_callback, &info)) {
error(1, errno, "packagelist_parse failed");
}
+
+ // Handle a multi-user data path
+ if (userId > 0) {
+ free(info.data_dir);
+ if (asprintf(&info.data_dir, "/data/user/%d/%s", userId, pkgname) == -1) {
+ error(1, errno, "asprintf failed");
+ }
+ }
+
if (info.uid == 0) {
error(1, 0, "unknown package: %s", pkgname);
}