diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2021-11-11 07:22:19 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-11-11 07:22:19 +0000 |
commit | c33b044bdfa8d42996773e8edd5824c60e364f54 (patch) | |
tree | b7f8b73b10a414d0bc6b8036d00e8c74b3594bb8 | |
parent | 2e425797ceda535fbc3adfa41a3e8d06975ec75f (diff) | |
parent | 15ba3bdf1325b2b8757f0ff0603958d756d58776 (diff) | |
download | telephony-c33b044bdfa8d42996773e8edd5824c60e364f54.tar.gz |
Merge "filter deviceIdentifiers for subscriptionInfo if callers without perm" into rvc-dev am: 27b607c49a am: 15ba3bdf13
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/16206383
Change-Id: Ic86f289109aac2ab328f99317268bceb476ae569
-rw-r--r-- | src/java/com/android/internal/telephony/SubscriptionController.java | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/java/com/android/internal/telephony/SubscriptionController.java b/src/java/com/android/internal/telephony/SubscriptionController.java index f03070fa19..49db160450 100644 --- a/src/java/com/android/internal/telephony/SubscriptionController.java +++ b/src/java/com/android/internal/telephony/SubscriptionController.java @@ -905,6 +905,19 @@ public class SubscriptionController extends ISub.Stub { @Override public List<SubscriptionInfo> getAllSubInfoList(String callingPackage, String callingFeatureId) { + return getAllSubInfoList(callingPackage, callingFeatureId, false); + } + + /** + * @param callingPackage The package making the IPC. + * @param callingFeatureId The feature in the package + * @param skipConditionallyRemoveIdentifier if set, skip removing identifier conditionally + * @return List of all SubscriptionInfo records in database, + * include those that were inserted before, maybe empty but not null. + * @hide + */ + public List<SubscriptionInfo> getAllSubInfoList(String callingPackage, + String callingFeatureId, boolean skipConditionallyRemoveIdentifier) { if (VDBG) logd("[getAllSubInfoList]+"); // This API isn't public, so no need to provide a valid subscription ID - we're not worried @@ -923,9 +936,9 @@ public class SubscriptionController extends ISub.Stub { } finally { Binder.restoreCallingIdentity(identity); } - if (subList != null) { + if (subList != null && !skipConditionallyRemoveIdentifier) { if (VDBG) logd("[getAllSubInfoList]- " + subList.size() + " infos return"); - subList.stream().map( + subList = subList.stream().map( subscriptionInfo -> conditionallyRemoveIdentifiers(subscriptionInfo, callingPackage, callingFeatureId, "getAllSubInfoList")) .collect(Collectors.toList()); @@ -3890,8 +3903,10 @@ public class SubscriptionController extends ISub.Stub { List<SubscriptionInfo> subInfoList; try { + // need to bypass removing identifier check because that will remove the subList without + // group id. subInfoList = getAllSubInfoList(mContext.getOpPackageName(), - mContext.getAttributionTag()); + mContext.getAttributionTag(), true); if (groupUuid == null || subInfoList == null || subInfoList.isEmpty()) { return new ArrayList<>(); } |