diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-06-16 01:13:14 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-06-16 01:13:14 +0000 |
commit | 656bab2efbe889c8bd0c91ea16d54a756bab73b1 (patch) | |
tree | 17ea9f9a271ca679b7e5f45f31666ddbe8d62514 | |
parent | 10a271abc88baff3297a50f8992f648fbbd5dba3 (diff) | |
parent | 3987dc05c4cbf727d73c2e847692856df9aee6d2 (diff) | |
download | telephony-android11-qpr3-s1-release.tar.gz |
Merge cherrypicks of [14988379, 14988380, 14984749, 14988513, 14988333, 14988334, 14988398, 14985920, 14988097, 14988381, 14985921, 14988891, 14987186, 14988382, 14989110, 14988514, 14988515, 14988652, 14988653, 14988654, 14988399, 14988400, 14988401, 14984579, 14987188, 14988532, 14988533, 14988402, 14983067, 14983068, 14974447, 14974448, 14988656, 14988535, 14988536, 14988537, 14988538, 14988539, 14988540, 14988541] into rvc-qpr3-releaseandroid-11.0.0_r43android-11.0.0_r40android11-qpr3-s1-release
Change-Id: I7625273e7d19d9056cafcd5e249d49df1272aa37
-rw-r--r-- | src/java/com/android/internal/telephony/SubscriptionController.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/java/com/android/internal/telephony/SubscriptionController.java b/src/java/com/android/internal/telephony/SubscriptionController.java index c0939f1c1e..8a03431f99 100644 --- a/src/java/com/android/internal/telephony/SubscriptionController.java +++ b/src/java/com/android/internal/telephony/SubscriptionController.java @@ -59,6 +59,7 @@ import android.telephony.UiccAccessRule; import android.telephony.UiccSlotInfo; import android.telephony.euicc.EuiccManager; import android.text.TextUtils; +import android.util.EventLog; import android.util.LocalLog; import android.util.Log; @@ -891,6 +892,10 @@ public class SubscriptionController extends ISub.Stub { subList = getSubInfo(null, null); if (subList != null) { if (VDBG) logd("[getAllSubInfoList]- " + subList.size() + " infos return"); + subList.stream().map( + subscriptionInfo -> conditionallyRemoveIdentifiers(subscriptionInfo, + callingPackage, callingFeatureId, "getAllSubInfoList")) + .collect(Collectors.toList()); } else { if (VDBG) logd("[getAllSubInfoList]- no info return"); } @@ -1051,12 +1056,18 @@ public class SubscriptionController extends ISub.Stub { @Override public List<SubscriptionInfo> getAvailableSubscriptionInfoList(String callingPackage, String callingFeatureId) { - // This API isn't public, so no need to provide a valid subscription ID - we're not worried - // about carrier-privileged callers not having access. - if (!TelephonyPermissions.checkCallingOrSelfReadPhoneState( - mContext, SubscriptionManager.INVALID_SUBSCRIPTION_ID, callingPackage, - callingFeatureId, "getAvailableSubscriptionInfoList")) { - throw new SecurityException("Need READ_PHONE_STATE to call " + try { + enforceReadPrivilegedPhoneState("getAvailableSubscriptionInfoList"); + } catch (SecurityException e) { + try { + mContext.enforceCallingOrSelfPermission(Manifest.permission.READ_PHONE_STATE, null); + // If caller doesn't have READ_PRIVILEGED_PHONE_STATE permission but only + // has READ_PHONE_STATE permission, log this event. + EventLog.writeEvent(0x534e4554, "185235454", Binder.getCallingUid()); + } catch (SecurityException ex) { + // Ignore + } + throw new SecurityException("Need READ_PRIVILEGED_PHONE_STATE to call " + " getAvailableSubscriptionInfoList"); } @@ -4074,6 +4085,7 @@ public class SubscriptionController extends ISub.Stub { if (!hasIdentifierAccess) { result.clearIccId(); result.clearCardString(); + result.clearGroupUuid(); } if (!hasPhoneNumberAccess) { result.clearNumber(); |