summaryrefslogtreecommitdiff
path: root/services/java/com/android
diff options
context:
space:
mode:
authorKalesh Singh <kaleshsingh@google.com>2021-03-29 17:03:19 -0400
committerKalesh Singh <kaleshsingh@google.com>2021-04-07 02:24:34 +0000
commit46d2cc8f824e2bb81b4a57520bce00cefeecf419 (patch)
tree312f4c83b8165cf143c1605804bad96b78820ed3 /services/java/com/android
parentf906029106c2fa26d47a4f23a61cd0f4035280b2 (diff)
Add memtrackproxy system server service
Serve memtrackproxy service from system server. This service enforces access control on requests for memory usage stats to the memtrack HAL based on the call context's PID and UID. Bug: 177664629 Test: memtrackproxy_test Change-Id: I10829ffcf4e5b2813d4c622268b0b59da6f171b6
Diffstat (limited to 'services/java/com/android')
-rw-r--r--services/java/com/android/server/SystemServer.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index fbf677dd0967..9b2a1e7a4e07 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -454,6 +454,11 @@ public final class SystemServer implements Dumpable {
private static native void startSensorService();
/**
+ * Start the memtrack proxy service.
+ */
+ private static native void startMemtrackProxyService();
+
+ /**
* Start all HIDL services that are run inside the system server. This may take some time.
*/
private static native void startHidlServices();
@@ -1024,6 +1029,12 @@ public final class SystemServer implements Dumpable {
mSystemServiceManager.startService(PowerStatsService.class);
t.traceEnd();
+ // Start MemtrackProxyService before ActivityManager, so that early calls
+ // to Memtrack::getMemory() don't fail.
+ t.traceBegin("MemtrackProxyService");
+ startMemtrackProxyService();
+ t.traceEnd();
+
// Activity manager runs the show.
t.traceBegin("StartActivityManager");
// TODO: Might need to move after migration to WM.