Add log to confirm VHAL is ready
Bug: 62354776
Test: Confirm log is generated
Change-Id: I2aa44f2c3c199e83c3a5755a7e186825e1b82c5a
diff --git a/service/src/com/android/car/ICarImpl.java b/service/src/com/android/car/ICarImpl.java
index f58302d..c412b97 100644
--- a/service/src/com/android/car/ICarImpl.java
+++ b/service/src/com/android/car/ICarImpl.java
@@ -27,7 +27,10 @@
import android.os.Binder;
import android.os.IBinder;
import android.os.Process;
+import android.os.Trace;
+import android.util.BootTimingsTraceLog;
import android.util.Log;
+import android.util.Slog;
import com.android.car.cluster.InstrumentClusterService;
import com.android.car.hal.VehicleHal;
import com.android.car.internal.FeatureConfiguration;
@@ -76,6 +79,11 @@
private final CarServiceBase[] mAllServices;
+ private static final String TAG = "ICarImpl";
+ private static final String VHAL_TIMING_TAG = "VehicleHalTiming";
+ private static final BootTimingsTraceLog mBootTiming = new BootTimingsTraceLog(VHAL_TIMING_TAG,
+ Trace.TRACE_TAG_HAL);
+
/** Test only service. Populate it only when necessary. */
@GuardedBy("this")
private CarTestService mCarTestService;
@@ -150,10 +158,14 @@
}
public void init() {
+ traceBegin("VehicleHal.init");
mHal.init();
+ traceEnd();
+ traceBegin("CarService.initAllServices");
for (CarServiceBase service : mAllServices) {
service.init();
}
+ traceEnd();
}
public void release() {
@@ -342,6 +354,15 @@
new CarShellCommand().exec(args, writer);
}
+ private static void traceBegin(String name) {
+ Slog.i(TAG, name);
+ mBootTiming.traceBegin(name);
+ }
+
+ private static void traceEnd() {
+ mBootTiming.traceEnd();
+ }
+
private class CarShellCommand {
private static final String COMMAND_HELP = "-h";
private static final String COMMAND_DAY_NIGHT_MODE = "day-night-mode";