diff --git a/services/core/java/com/android/server/Dumpable.java b/services/core/java/com/android/server/Dumpable.java index d2bd66f59b625..866f81c1c5c6c 100644 --- a/services/core/java/com/android/server/Dumpable.java +++ b/services/core/java/com/android/server/Dumpable.java @@ -21,6 +21,8 @@ import android.util.IndentingPrintWriter; /** * Interface used to dump {@link SystemServer} state that is not associated with any service. + * + *

See {@link SystemServer.SystemServerDumper} for usage example. */ public interface Dumpable { diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index aa5b2095b97ce..dae12754904fa 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -645,6 +645,21 @@ public final class SystemServer implements Dumpable { TimeUtils.formatDuration(mRuntimeStartElapsedTime, pw); pw.println(); } + /** + * Service used to dump {@link SystemServer} state that is not associated with any service. + * + *

To dump all services: + * + *

adb shell dumpsys system_server_dumper
+ * + *

To get a list of all services: + * + *

adb shell dumpsys system_server_dumper --list
+ * + *

To dump a specific service (use {@code --list} above to get service names): + * + *

adb shell dumpsys system_server_dumper --name NAME
+ */ private final class SystemServerDumper extends Binder { @GuardedBy("mDumpables")