Remove one-line wrappers and start cleaning up onUsersUpdateListener
Refactored:
- Started deprecation process of onUsersUpdateListener
- Updated DisplayInterface to no longer use onUsersUpdateListener and instead rely on intents directly
- Filed b/135472254 to clean up above mentioned intents
Removed from CarUserManagerHelper, opting to instead use UserManager directly:
- getSystemUserInfo()
- isPersistenUser()
- isCurrentProcessSystemUser()
- createNewAdminUser()
Cleanup:
- Updated CarLocationService to user UserHandle.USER_SYSTEM constant
Bug: 131779674
Test: atest CarServiceUnitTest
Change-Id: I5c471d6540c02b3af1ef7567cd755eab12e77e13
diff --git a/service/src/com/android/car/ICarImpl.java b/service/src/com/android/car/ICarImpl.java
index d5809c4..5b7de86 100644
--- a/service/src/com/android/car/ICarImpl.java
+++ b/service/src/com/android/car/ICarImpl.java
@@ -33,6 +33,7 @@
import android.os.IBinder;
import android.os.Process;
import android.os.Trace;
+import android.os.UserManager;
import android.util.Log;
import android.util.Slog;
import android.util.TimingsTraceLog;
@@ -121,10 +122,12 @@
mHal = new VehicleHal(vehicle);
mVehicleInterfaceName = vehicleInterfaceName;
mUserManagerHelper = new CarUserManagerHelper(serviceContext);
+ UserManager userManager =
+ (UserManager) serviceContext.getSystemService(Context.USER_SERVICE);
final Resources res = mContext.getResources();
final int maxRunningUsers = res.getInteger(
com.android.internal.R.integer.config_multiuserMaxRunningUsers);
- mCarUserService = new CarUserService(serviceContext, mUserManagerHelper,
+ mCarUserService = new CarUserService(serviceContext, mUserManagerHelper, userManager,
ActivityManager.getService(), maxRunningUsers);
mSystemActivityMonitoringService = new SystemActivityMonitoringService(serviceContext);
mCarPowerManagementService = new CarPowerManagementService(mContext, mHal.getPowerHal(),