CarService dump() improvements:
- Use IndentingPrintWriter by default
- dump() PerUserCarServiceHelper
- Replaced some string concatenations by printf()
- Dump isLocationEnabled()
Test: adb shell dumpsys activity service com.android.car/.PerUserCarService
Test: adb shell dumpsys car_service --services CarBluetoothService
Test: m ExperimentalCarService
Test: atest GarageModeServiceTest CarStatsServiceTest
Bug: 143815470
Bug: 178040439
Change-Id: I4c863e6f287aa0a6794dc0854d866647ed9fb671
diff --git a/service/src/com/android/car/CarServiceBase.java b/service/src/com/android/car/CarServiceBase.java
index c4b578d..ec5d297 100644
--- a/service/src/com/android/car/CarServiceBase.java
+++ b/service/src/com/android/car/CarServiceBase.java
@@ -16,7 +16,7 @@
package com.android.car;
-import java.io.PrintWriter;
+import android.util.IndentingPrintWriter;
/**
* Base class for all Car specific services.
@@ -35,5 +35,6 @@
/** Called when connection to Vehicle HAL was restored. */
default void vehicleHalReconnected() {}
- void dump(PrintWriter writer);
+ /** Dumps its state. */
+ void dump(IndentingPrintWriter writer);
}