aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-07-09 03:08:08 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-07-09 03:08:08 +0000
commit14f0e3a4cedbb567a3506b4f28065199c6750a95 (patch)
treea13545021b72c2468c2e27378d8ff3e1ca232814
parent340ede2f0e4eb5bc8cda98f8323d19b192e26027 (diff)
parentdf0177f979a4f5ca82f302bc00aab03f417432b8 (diff)
downloadtelephony-14f0e3a4cedbb567a3506b4f28065199c6750a95.tar.gz
Snap for 5713174 from df0177f979a4f5ca82f302bc00aab03f417432b8 to qt-release
Change-Id: Ia4b336f486941a1e2cc71d23c1c5045ac6b4552c
-rw-r--r--src/java/com/android/internal/telephony/PhoneSubInfoController.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/java/com/android/internal/telephony/PhoneSubInfoController.java b/src/java/com/android/internal/telephony/PhoneSubInfoController.java
index d655468104..c5b7edafc2 100644
--- a/src/java/com/android/internal/telephony/PhoneSubInfoController.java
+++ b/src/java/com/android/internal/telephony/PhoneSubInfoController.java
@@ -126,7 +126,14 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub {
public String getSubscriberIdForSubscriber(int subId, String callingPackage) {
String message = "getSubscriberId";
- if (SubscriptionController.getInstance().isActiveSubId(subId, callingPackage)) {
+ long identity = Binder.clearCallingIdentity();
+ boolean isActive;
+ try {
+ isActive = SubscriptionController.getInstance().isActiveSubId(subId, callingPackage);
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ if (isActive) {
return callPhoneMethodForSubIdWithReadSubscriberIdentifiersCheck(subId, callingPackage,
message, (phone) -> phone.getSubscriberId());
} else {
@@ -134,7 +141,7 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub {
mContext, subId, callingPackage, message)) {
return null;
}
- final long identity = Binder.clearCallingIdentity();
+ identity = Binder.clearCallingIdentity();
try {
return SubscriptionController.getInstance().getImsiPrivileged(subId);
} finally {