Replace UserInfo with user id in CarUserManager
- UserInfo is hidden API, and this blocks stub library build.
- To resolve the above issue, this CL will replace UserInfo with user id
in CarUserManager.
Bug: 146658683
Test: Build and run CarUserServiceTest.
Change-Id: I5eb5963fade657fcc74bfdd1e2034b79bd0a5df7
diff --git a/service/src/com/android/car/user/CarUserService.java b/service/src/com/android/car/user/CarUserService.java
index f69330f..bde76f3 100644
--- a/service/src/com/android/car/user/CarUserService.java
+++ b/service/src/com/android/car/user/CarUserService.java
@@ -196,7 +196,12 @@
}
/**
- * @see CarUserManager.createDriver
+ * Creates a driver who is a regular user and is allowed to login to the driving occupant zone.
+ *
+ * @param name The name of the driver to be created.
+ * @param admin Whether the created driver will be an admin.
+ * @return {@link UserInfo} object of the created driver, or {@code null} if the driver could
+ * not be created.
*/
@Override
@Nullable
@@ -210,7 +215,12 @@
}
/**
- * @see CarUserManager.createPassenger
+ * Creates a passenger who is a profile of the given driver.
+ *
+ * @param name The name of the passenger to be created.
+ * @param driverId User id of the driver under whom a passenger is created.
+ * @return {@link UserInfo} object of the created passenger, or {@code null} if the passenger
+ * could not be created.
*/
@Override
@Nullable
@@ -269,7 +279,9 @@
}
/**
- * @see CarUserManager.getAllDrivers
+ * Returns all drivers who can occupy the driving zone. Guest users are included in the list.
+ *
+ * @return the list of {@link UserInfo} who can be a driver on the device.
*/
@Override
@NonNull
@@ -282,7 +294,10 @@
}
/**
- * @see CarUserManager.getPassengers
+ * Returns all passengers under the given driver.
+ *
+ * @param driverId User id of a driver.
+ * @return the list of {@link UserInfo} who is a passenger under the given driver.
*/
@Override
@NonNull