From 9569bc70f923127e7884bd7abfe051e0ccd0216a Mon Sep 17 00:00:00 2001 From: Malcolm Chen Date: Tue, 23 Oct 2018 18:44:03 -0700 Subject: Clean up SubMgr#getOpportunisticSubscriptions. Adding more descriptive comments for this API. Remove param slotIndex. Bug: 117832560 Bug: 117830188 Test: build Change-Id: I906cfb8ccb1851bde6be09c273d47092337ed1c1 --- api/current.txt | 2 +- .../java/android/telephony/SubscriptionManager.java | 19 ++++++++++++------- .../java/com/android/internal/telephony/ISub.aidl | 6 +++--- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/api/current.txt b/api/current.txt index 21bab7cf5d1e..06a51c740d9c 100755 --- a/api/current.txt +++ b/api/current.txt @@ -43124,7 +43124,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 3b4016437e9a..07d91ef1c904 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -2227,22 +2227,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 0ccd748c31df..c80c72e3a67c 100755 --- a/telephony/java/com/android/internal/telephony/ISub.aidl +++ b/telephony/java/com/android/internal/telephony/ISub.aidl @@ -187,10 +187,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); -- cgit v1.2.3-59-g8ed1b