diff --git a/api/current.txt b/api/current.txt index f2afa529bad8b..c93fbc91a4bb6 100755 --- a/api/current.txt +++ b/api/current.txt @@ -42842,7 +42842,7 @@ package android.telephony { method public static int getDefaultSmsSubscriptionId(); method public static int getDefaultSubscriptionId(); method public static int getDefaultVoiceSubscriptionId(); - method public java.util.List getOpportunisticSubscriptions(int); + method public java.util.List getOpportunisticSubscriptions(); method public static int getSlotIndex(int); method public static int[] getSubscriptionIds(int); method public java.util.List getSubscriptionPlans(int); diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 876633c454f57..2b4ed43c0b444 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -2313,22 +2313,27 @@ public class SubscriptionManager { } /** - * Get opportunistic data Profiles. + * Return opportunistic subscriptions that can be visible to the caller. + * Opportunistic subscriptions are for opportunistic networks, which are cellular + * networks with limited capabilities and coverage, for example, CBRS. * - * Provide all available user downloaded profiles on phone which are used only for - * opportunistic data. - * @param slotIndex slot on which the profiles are queried from. - * @return the list of opportunistic subscription info. If none exists, an empty list. + *

Requires Permission: + * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} + * or that the calling app has carrier privileges (see + * {@link TelephonyManager#hasCarrierPrivileges}). + * + * @return the list of opportunistic subscription info. If none exists, an empty list. */ + @SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) - public @NonNull List getOpportunisticSubscriptions(int slotIndex) { + public @NonNull List getOpportunisticSubscriptions() { String pkgForDebug = mContext != null ? mContext.getOpPackageName() : ""; List subInfoList = null; try { ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub")); if (iSub != null) { - subInfoList = iSub.getOpportunisticSubscriptions(slotIndex, pkgForDebug); + subInfoList = iSub.getOpportunisticSubscriptions(pkgForDebug); } } catch (RemoteException ex) { // ignore it diff --git a/telephony/java/com/android/internal/telephony/ISub.aidl b/telephony/java/com/android/internal/telephony/ISub.aidl index 3aa7cbc7d1325..bc4451977d923 100755 --- a/telephony/java/com/android/internal/telephony/ISub.aidl +++ b/telephony/java/com/android/internal/telephony/ISub.aidl @@ -196,10 +196,10 @@ interface ISub { /** * Get User downloaded Profiles. * - * Provide all available user downloaded profile on the phone. - * @param slotId on which phone the switch will operate on + * Return opportunistic subscriptions that can be visible to the caller. + * @return the list of opportunistic subscription info. If none exists, an empty list. */ - List getOpportunisticSubscriptions(int slotId, String callingPackage); + List getOpportunisticSubscriptions(String callingPackage); int getSlotIndex(int subId);