Check for permissions on CarUserService.getInitialUserInfo().
Test: atest CarUserServiceTest#testGetInitialUserInfo_invalidPermission
Fixes: 152647107
Change-Id: I67725253d888dfb99d28d6fba49ff03bf7610989
diff --git a/service/src/com/android/car/user/CarUserService.java b/service/src/com/android/car/user/CarUserService.java
index 7a1a89e..ec10818 100644
--- a/service/src/com/android/car/user/CarUserService.java
+++ b/service/src/com/android/car/user/CarUserService.java
@@ -491,6 +491,7 @@
public void getInitialUserInfo(int requestType, int timeoutMs,
@NonNull IResultReceiver receiver) {
Objects.requireNonNull(receiver, "receiver cannot be null");
+ checkManageUsersPermission("getInitialInfo");
UsersInfo usersInfo = getUsersInfo();
mHal.getInitialUserInfo(requestType, timeoutMs, usersInfo, (status, resp) -> {
try {
@@ -533,6 +534,7 @@
public void getInitialUserInfo(int requestType,
HalCallback<InitialUserInfoResponse> callback) {
Objects.requireNonNull(callback, "callback cannot be null");
+ checkManageUsersPermission("getInitialUserInfo");
UsersInfo usersInfo = getUsersInfo();
mHal.getInitialUserInfo(requestType, mHalTimeoutMs, usersInfo, callback);
}