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/user/CarUserService.java b/service/src/com/android/car/user/CarUserService.java
index 92f32f1..cd21c3e 100644
--- a/service/src/com/android/car/user/CarUserService.java
+++ b/service/src/com/android/car/user/CarUserService.java
@@ -83,6 +83,7 @@
import android.sysprop.CarProperties;
import android.text.TextUtils;
import android.util.EventLog;
+import android.util.IndentingPrintWriter;
import android.util.Log;
import android.util.Slog;
import android.util.SparseArray;
@@ -334,7 +335,7 @@
}
@Override
- public void dump(@NonNull PrintWriter writer) {
+ public void dump(@NonNull IndentingPrintWriter writer) {
checkHasDumpPermissionGranted("dump()");
writer.println("*CarUserService*");