Merge "Clean up SubMgr#getOpportunisticSubscriptions."
am: 103d515c80
Change-Id: I5dc75bd9b1a8e64df547f621e6792e4816167be7
This commit is contained in:
@@ -42842,7 +42842,7 @@ package android.telephony {
|
|||||||
method public static int getDefaultSmsSubscriptionId();
|
method public static int getDefaultSmsSubscriptionId();
|
||||||
method public static int getDefaultSubscriptionId();
|
method public static int getDefaultSubscriptionId();
|
||||||
method public static int getDefaultVoiceSubscriptionId();
|
method public static int getDefaultVoiceSubscriptionId();
|
||||||
method public java.util.List<android.telephony.SubscriptionInfo> getOpportunisticSubscriptions(int);
|
method public java.util.List<android.telephony.SubscriptionInfo> getOpportunisticSubscriptions();
|
||||||
method public static int getSlotIndex(int);
|
method public static int getSlotIndex(int);
|
||||||
method public static int[] getSubscriptionIds(int);
|
method public static int[] getSubscriptionIds(int);
|
||||||
method public java.util.List<android.telephony.SubscriptionPlan> getSubscriptionPlans(int);
|
method public java.util.List<android.telephony.SubscriptionPlan> getSubscriptionPlans(int);
|
||||||
|
|||||||
@@ -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
|
* <p>Requires Permission:
|
||||||
* opportunistic data.
|
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
|
||||||
* @param slotIndex slot on which the profiles are queried from.
|
* or that the calling app has carrier privileges (see
|
||||||
* @return the list of opportunistic subscription info. If none exists, an empty list.
|
* {@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)
|
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
|
||||||
public @NonNull List<SubscriptionInfo> getOpportunisticSubscriptions(int slotIndex) {
|
public @NonNull List<SubscriptionInfo> getOpportunisticSubscriptions() {
|
||||||
String pkgForDebug = mContext != null ? mContext.getOpPackageName() : "<unknown>";
|
String pkgForDebug = mContext != null ? mContext.getOpPackageName() : "<unknown>";
|
||||||
List<SubscriptionInfo> subInfoList = null;
|
List<SubscriptionInfo> subInfoList = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
|
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
|
||||||
if (iSub != null) {
|
if (iSub != null) {
|
||||||
subInfoList = iSub.getOpportunisticSubscriptions(slotIndex, pkgForDebug);
|
subInfoList = iSub.getOpportunisticSubscriptions(pkgForDebug);
|
||||||
}
|
}
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
// ignore it
|
// ignore it
|
||||||
|
|||||||
@@ -196,10 +196,10 @@ interface ISub {
|
|||||||
/**
|
/**
|
||||||
* Get User downloaded Profiles.
|
* Get User downloaded Profiles.
|
||||||
*
|
*
|
||||||
* Provide all available user downloaded profile on the phone.
|
* Return opportunistic subscriptions that can be visible to the caller.
|
||||||
* @param slotId on which phone the switch will operate on
|
* @return the list of opportunistic subscription info. If none exists, an empty list.
|
||||||
*/
|
*/
|
||||||
List<SubscriptionInfo> getOpportunisticSubscriptions(int slotId, String callingPackage);
|
List<SubscriptionInfo> getOpportunisticSubscriptions(String callingPackage);
|
||||||
|
|
||||||
int getSlotIndex(int subId);
|
int getSlotIndex(int subId);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user