From 6f8675f324ca9442b8c025cc3fb2c85b662d4bde Mon Sep 17 00:00:00 2001 From: hyosun Date: Mon, 29 Aug 2022 08:02:04 +0000 Subject: [PATCH] To read the group UUID, the calling app either needs carrier privileges or the READ_PHONE_STATE permission and access to device identifiers. If the app has only the READ_PHONE_STATE permission, it can no longer read the group UUID. When SubscriptionManager#getSubscriptionsInGroup is called, If the calling app has carrier permission or READ_PHONE_STATE permission and access to device identifiers, then returns a list. If not, it returns an empty list. Bug: 213902861 Test: atest SubscriptionManagerTest Test: atest SubscriptionControllerTest Test: manual (b/213902861#comment54) Change-Id: I4e764b1a5babfcacf675f6e83d2b1014ec570c1e Merged-In: I4e764b1a5babfcacf675f6e83d2b1014ec570c1e --- .../android/telephony/SubscriptionManager.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index d07d8097bce45..77408458c96bb 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -3426,10 +3426,20 @@ public class SubscriptionManager { * Get subscriptionInfo list of subscriptions that are in the same group of given subId. * See {@link #createSubscriptionGroup(List)} for more details. * - * Caller will either have {@link android.Manifest.permission#READ_PHONE_STATE} - * permission or had carrier privilege permission on the subscription. + * Caller must have {@link android.Manifest.permission#READ_PHONE_STATE} + * or carrier privilege permission on the subscription. * {@link TelephonyManager#hasCarrierPrivileges()} * + *

Starting with API level 33, this method will return an empty List if the caller does + * not have access to device identifiers. + * This method can be invoked if one of the following requirements is met: + *

+ * * @throws IllegalStateException if Telephony service is in bad state. * @throws SecurityException if the caller doesn't meet the requirements * outlined above.