Cache correct calling UID for VcnStatusCallbacks.

This CL updates VcnManagementService to cache the correct UID for the
caller when a VcnStatusCallback is registered. Previously,
getBinderCallingUid() was checked after the calling identity was
cleared.

Bug: 183437200
Test: atest FrameworksVcnTests CtsVcnTestCases
Change-Id: Idfa2d2aad6bc03b3d08a137f9913276057632a3b
This commit is contained in:
Cody Kesting
2021-03-22 15:14:14 -07:00
parent 79ddf1afb8
commit 8ec617ad8d

View File

@@ -821,8 +821,7 @@ public class VcnManagementService extends IVcnManagementService.Stub {
final IBinder cbBinder = callback.asBinder();
final VcnStatusCallbackInfo cbInfo =
new VcnStatusCallbackInfo(
subGroup, callback, opPkgName, mDeps.getBinderCallingUid());
new VcnStatusCallbackInfo(subGroup, callback, opPkgName, callingUid);
try {
cbBinder.linkToDeath(cbInfo, 0 /* flags */);