Post-O. Sketch out CarDiagnosticManager API surface
Provide an implementation of all layers required to plumb CarDiagnosticManager through:
* CarDiagnosticEvent
* DiagnosticHalService
* CarDiagnosticService
* CarDiagnosticManager
If FutureFeatures are enabled, this is integrated end-to-end enough to run trivial tests of the API
Test: build with TARGET_USES_CAR_FUTURE_FEATURES=true then at a shell runtest -x packages/services/Car/tests/android_car_api_test/ -c android.car.apitest.CarDiagnosticManagerTest
Change-Id: I0f2aafd039d26fec15182dd7029cf8c7995ce85b
diff --git a/service/src/com/android/car/ICarImpl.java b/service/src/com/android/car/ICarImpl.java
index 2d58eb1..d98ca25 100644
--- a/service/src/com/android/car/ICarImpl.java
+++ b/service/src/com/android/car/ICarImpl.java
@@ -78,6 +78,8 @@
private final CarVendorExtensionService mCarVendorExtensionService;
private final CarBluetoothService mCarBluetoothService;
@FutureFeature
+ private CarDiagnosticService mCarDiagnosticService;
+ @FutureFeature
private VmsSubscriberService mVmsSubscriberService;
private final CarServiceBase[] mAllServices;
@@ -118,6 +120,10 @@
if (FeatureConfiguration.ENABLE_VEHICLE_MAP_SERVICE) {
mVmsSubscriberService = new VmsSubscriberService(serviceContext, mHal.getVmsHal());
}
+ if (FeatureConfiguration.ENABLE_DIAGNOSTIC) {
+ mCarDiagnosticService = new CarDiagnosticService(serviceContext,
+ mHal.getDiagnosticHal());
+ }
// Be careful with order. Service depending on other service should be inited later.
List<CarServiceBase> allServices = new ArrayList<>(Arrays.asList(
@@ -144,6 +150,9 @@
if (FeatureConfiguration.ENABLE_VEHICLE_MAP_SERVICE) {
allServices.add(mVmsSubscriberService);
}
+ if (FeatureConfiguration.ENABLE_DIAGNOSTIC) {
+ allServices.add(mCarDiagnosticService);
+ }
mAllServices = allServices.toArray(new CarServiceBase[0]);
}
@@ -188,6 +197,9 @@
case Car.CAMERA_SERVICE:
assertCameraPermission(mContext);
return mCarCameraService;
+ case Car.DIAGNOSTIC_SERVICE:
+ //TODO(egranata): handle permissions
+ return mCarDiagnosticService;
case Car.HVAC_SERVICE:
assertHvacPermission(mContext);
return mCarHvacService;