Remove CarUserManagerHelper #getCurrentForegroundUserInfo and #getCurrentForegroundUserId
Removes these two APIs in favor of using UserManager APIs and
ActivityManager.getCurrentUser().
Bug: 131776619
Test: atest CarServiceUnitTest
Test: atest CarServiceTest
Test: atest CarSettingsRoboTests
Change-Id: Ibd205259e699a5817203598b51e090d7abfe8463
diff --git a/service/src/com/android/car/ICarImpl.java b/service/src/com/android/car/ICarImpl.java
index 6e0b6fa..b3cbd16 100644
--- a/service/src/com/android/car/ICarImpl.java
+++ b/service/src/com/android/car/ICarImpl.java
@@ -146,8 +146,7 @@
mCarDrivingStateService, mCarPropertyService);
mCarPackageManagerService = new CarPackageManagerService(serviceContext,
mCarUXRestrictionsService,
- mSystemActivityMonitoringService,
- mUserManagerHelper);
+ mSystemActivityMonitoringService);
mPerUserCarServiceHelper = new PerUserCarServiceHelper(serviceContext);
mCarBluetoothService = new CarBluetoothService(serviceContext, mPerUserCarServiceHelper);
mCarInputService = new CarInputService(serviceContext, mHal.getInputHal());
@@ -164,8 +163,7 @@
serviceContext, mCarAudioService, this);
mVmsBrokerService = new VmsBrokerService();
mVmsClientManager = new VmsClientManager(
- serviceContext, mVmsBrokerService, mCarUserService, mUserManagerHelper,
- mHal.getVmsHal());
+ serviceContext, mVmsBrokerService, mCarUserService, mHal.getVmsHal());
mVmsSubscriberService = new VmsSubscriberService(
serviceContext, mVmsBrokerService, mVmsClientManager, mHal.getVmsHal());
mVmsPublisherService = new VmsPublisherService(
@@ -736,8 +734,7 @@
break;
case COMMAND_REMOVE_TRUSTED_DEVICES:
mCarTrustedDeviceService.getCarTrustAgentEnrollmentService()
- .removeAllTrustedDevices(
- mUserManagerHelper.getCurrentForegroundUserId());
+ .removeAllTrustedDevices(ActivityManager.getCurrentUser());
break;
case COMMAND_SET_UID_TO_ZONE:
if (args.length != 3) {