From 0edb20374c63d66d0454f698fe80a545d36223ac Mon Sep 17 00:00:00 2001 From: Nikhil Kumar Date: Tue, 25 Apr 2023 18:23:04 +0100 Subject: Get userId from stored CallingUid when calling identity is cleared Test: atest ContextCrossProfileHostTest -c Bug: 279006975 Change-Id: I524797994218fee720a9168960b510a76a2f38ac --- services/core/java/com/android/server/am/ActiveServices.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index df3c95bdfaf3..678d58232f15 100644 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -3866,7 +3866,7 @@ public final class ActiveServices { if (UserHandle.isCore(callingUid)) { return; } - final int callingUserId = UserHandle.getCallingUserId(); + final int callingUserId = UserHandle.getUserId(callingUid); if (callingUserId == userId || !mAm.mUserController.isSameProfileGroup(callingUserId, userId)) { return; -- cgit v1.2.3-59-g8ed1b