Merge "Minor, internal improvements on UserHalService." into rvc-dev
diff --git a/service/src/com/android/car/hal/UserHalService.java b/service/src/com/android/car/hal/UserHalService.java
index f995047..b6e04a8 100644
--- a/service/src/com/android/car/hal/UserHalService.java
+++ b/service/src/com/android/car/hal/UserHalService.java
@@ -336,7 +336,7 @@
VehiclePropValue propRequest;
synchronized (mLock) {
checkSupportedLocked();
- int requestId = mNextRequestId++;
+ int requestId = getNextRequestId();
EventLog.writeEvent(EventLogTags.CAR_USER_HAL_LEGACY_SWITCH_USER_REQ, requestId,
targetInfo.userId, usersInfo.currentUser.userId);
propRequest = getPropRequestForSwitchUserLocked(requestId,
@@ -604,7 +604,7 @@
}
private void handleCheckIfRequestTimedOut(int requestId) {
- PendingRequest<?, ?> pendingRequest = getPendingResponse(requestId);
+ PendingRequest<?, ?> pendingRequest = getPendingRequest(requestId);
if (pendingRequest == null) return;
Log.w(TAG, "Request #" + requestId + " timed out");
@@ -613,7 +613,7 @@
}
@Nullable
- private PendingRequest<?, ?> getPendingResponse(int requestId) {
+ private PendingRequest<?, ?> getPendingRequest(int requestId) {
synchronized (mLock) {
return mPendingRequests.get(requestId);
}
@@ -703,7 +703,7 @@
}
private <T> HalCallback<T> handleGetPendingCallback(int requestId, Class<T> clazz) {
- PendingRequest<?, ?> pendingRequest = getPendingResponse(requestId);
+ PendingRequest<?, ?> pendingRequest = getPendingRequest(requestId);
if (pendingRequest == null) return null;
if (pendingRequest.responseClass != clazz) {