Move and rename Bluetooth profile inhibits to CarProjectionManager.
Move the "temporary Bluetooth profile disconnect" functionality,
previously available on CarBluetoothManager, to CarProjectionManager
under the name "Bluetooth profile inhibits". This makes it available
as a @SystemApi guarded by PERMISSION_CAR_PROJECTION.
Also, update implementation in BluetoothDeviceConnectionPolicy to
reflect the new name, and fix a small logic bug where newly-paired
devices would not be reenabled as expected.
Bug: 116226107
Test: manual test of inhibit/uninhibit with projection app
Change-Id: Iac6b72fd72156ef221228b73b24cc5c0eb421b8c
diff --git a/service/src/com/android/car/ICarImpl.java b/service/src/com/android/car/ICarImpl.java
index adcedf3..63ea2a7 100644
--- a/service/src/com/android/car/ICarImpl.java
+++ b/service/src/com/android/car/ICarImpl.java
@@ -124,8 +124,12 @@
mCarPackageManagerService = new CarPackageManagerService(serviceContext,
mCarUXRestrictionsService,
mSystemActivityMonitoringService);
+ mPerUserCarServiceHelper = new PerUserCarServiceHelper(serviceContext);
+ mCarBluetoothService = new CarBluetoothService(serviceContext, mCarPropertyService,
+ mPerUserCarServiceHelper, mCarUXRestrictionsService);
mCarInputService = new CarInputService(serviceContext, mHal.getInputHal());
- mCarProjectionService = new CarProjectionService(serviceContext, mCarInputService);
+ mCarProjectionService = new CarProjectionService(
+ serviceContext, mCarInputService, mCarBluetoothService);
mGarageModeService = new GarageModeService(mContext);
mAppFocusService = new AppFocusService(serviceContext, mSystemActivityMonitoringService);
mCarAudioService = new CarAudioService(serviceContext);
@@ -134,9 +138,6 @@
mAppFocusService, mCarInputService);
mSystemStateControllerService = new SystemStateControllerService(
serviceContext, mCarAudioService, this);
- mPerUserCarServiceHelper = new PerUserCarServiceHelper(serviceContext);
- mCarBluetoothService = new CarBluetoothService(serviceContext, mCarPropertyService,
- mPerUserCarServiceHelper, mCarUXRestrictionsService);
mVmsSubscriberService = new VmsSubscriberService(serviceContext, mHal.getVmsHal());
mVmsPublisherService = new VmsPublisherService(serviceContext, mHal.getVmsHal());
mCarDiagnosticService = new CarDiagnosticService(serviceContext, mHal.getDiagnosticHal());
@@ -162,11 +163,11 @@
allServices.add(mCarAudioService);
allServices.add(mCarNightService);
allServices.add(mInstrumentClusterService);
- allServices.add(mCarProjectionService);
allServices.add(mSystemStateControllerService);
- allServices.add(mCarBluetoothService);
- allServices.add(mCarDiagnosticService);
allServices.add(mPerUserCarServiceHelper);
+ allServices.add(mCarBluetoothService);
+ allServices.add(mCarProjectionService);
+ allServices.add(mCarDiagnosticService);
allServices.add(mCarStorageMonitoringService);
allServices.add(mCarConfigurationService);
allServices.add(mVmsSubscriberService);