summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2021-01-28 22:43:32 +0000
committerSteven Moreland <smoreland@google.com>2021-01-28 22:53:23 +0000
commitf6fee67b6ea83e1092d8386ebf478941946b9fce (patch)
tree4c038fa93b0302587edfa223cd7d2ab4f1195a50 /core/java
parent7e69b0a93d09f45d93e38cbdfd4bff7042d6de9a (diff)
WatchDog: support dumping AIDL HALs
Similar to how HIDL HALs are here, we don't know the commandline of the service, so we can dump them based on service name prefixes. Power stats and lights are added here, for parity w/ HIDL since these hvae been converted to AIDL. Fixes: 175322136 Test: after `adb shell am hang`, we can verify the light service is dumped, when it wasn't before: vsoc_x86_64:/data/anr # cat anr_2021-01-28-22-42-44-969 | grep light Cmd line: /vendor/bin/hw/android.hardware.lights-service.example Change-Id: I8c8b0cff0c102221875114015a5524c03cfb5b5c
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/os/ServiceManager.java14
-rw-r--r--core/java/android/os/ServiceManagerNative.java4
2 files changed, 18 insertions, 0 deletions
diff --git a/core/java/android/os/ServiceManager.java b/core/java/android/os/ServiceManager.java
index 71344f90de75..f853e67f87d0 100644
--- a/core/java/android/os/ServiceManager.java
+++ b/core/java/android/os/ServiceManager.java
@@ -288,6 +288,20 @@ public final class ServiceManager {
}
/**
+ * Get service debug info.
+ * @return an array of information for each service (like listServices, but with PIDs)
+ * @hide
+ */
+ public static ServiceDebugInfo[] getServiceDebugInfo() {
+ try {
+ return getIServiceManager().getServiceDebugInfo();
+ } catch (RemoteException e) {
+ Log.e(TAG, "error in getServiceDebugInfo", e);
+ return null;
+ }
+ }
+
+ /**
* This is only intended to be called when the process is first being brought
* up and bound by the activity manager. There is only one thread in the process
* at that time, so no locking is done.
diff --git a/core/java/android/os/ServiceManagerNative.java b/core/java/android/os/ServiceManagerNative.java
index b70b6b5d209e..60acc57d0cfe 100644
--- a/core/java/android/os/ServiceManagerNative.java
+++ b/core/java/android/os/ServiceManagerNative.java
@@ -103,6 +103,10 @@ class ServiceManagerProxy implements IServiceManager {
throw new RemoteException();
}
+ public ServiceDebugInfo[] getServiceDebugInfo() throws RemoteException {
+ return mServiceManager.getServiceDebugInfo();
+ }
+
/**
* Same as mServiceManager but used by apps.
*