Clear caller identify before registering and unregistering phone acct.
This was causing a problem with the intents broadcast from CallsManager.
Test: Ran CTS, Manual
Bug: 37430159
Change-Id: I7c7486cfe13f1465bd7fafa7ad64dc426289c987
diff --git a/src/com/android/server/telecom/TelecomServiceImpl.java b/src/com/android/server/telecom/TelecomServiceImpl.java
index d4e1096..40ba21d 100644
--- a/src/com/android/server/telecom/TelecomServiceImpl.java
+++ b/src/com/android/server/telecom/TelecomServiceImpl.java
@@ -399,7 +399,12 @@
enforceRegisterMultiUser();
}
enforceUserHandleMatchesCaller(account.getAccountHandle());
- mPhoneAccountRegistrar.registerPhoneAccount(account);
+ final long token = Binder.clearCallingIdentity();
+ try {
+ mPhoneAccountRegistrar.registerPhoneAccount(account);
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
} catch (Exception e) {
Log.e(this, e, "registerPhoneAccount %s", account);
throw e;
@@ -418,7 +423,12 @@
enforcePhoneAccountModificationForPackage(
accountHandle.getComponentName().getPackageName());
enforceUserHandleMatchesCaller(accountHandle);
- mPhoneAccountRegistrar.unregisterPhoneAccount(accountHandle);
+ final long token = Binder.clearCallingIdentity();
+ try {
+ mPhoneAccountRegistrar.unregisterPhoneAccount(accountHandle);
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
} catch (Exception e) {
Log.e(this, e, "unregisterPhoneAccount %s", accountHandle);
throw e;