IMS : Fix the user handle being passed to Telecom
- Currently during SDK API calls for start conference,
we are clearing the Binder identity and send the user handle
to CallsManager, due to which Guest restriction are not
applied properly.
- To fix this we need to the userhandle before clearing the
identity and then invoke CallsManager API.
Change-Id: I4f74d46154b41b6e082af0869efdcceaaafb1f7f
Bug: 326376472
diff --git a/src/com/android/server/telecom/TelecomServiceImpl.java b/src/com/android/server/telecom/TelecomServiceImpl.java
index 1dd68c9..bd2a975 100644
--- a/src/com/android/server/telecom/TelecomServiceImpl.java
+++ b/src/com/android/server/telecom/TelecomServiceImpl.java
@@ -1749,11 +1749,12 @@
throw new SecurityException("Package " + callingPackage + " is not allowed"
+ " to start conference call");
}
-
+ // Binder is clearing the identity, so we need to keep the store the handle
+ UserHandle currentUserHandle = Binder.getCallingUserHandle();
long token = Binder.clearCallingIdentity();
try {
mCallsManager.startConference(participants, extras, callingPackage,
- Binder.getCallingUserHandle());
+ currentUserHandle);
} finally {
Binder.restoreCallingIdentity(token);
}