Merge "Add System API to indicate whether physical SIM can be disabled." am: 454c0659a6
am: 0b2531862f
Change-Id: If6fe7eabcd6b2bd92c2b516e5083fb3cb558cb09
This commit is contained in:
@@ -8582,6 +8582,7 @@ package android.telephony {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class SubscriptionManager {
|
public class SubscriptionManager {
|
||||||
|
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean canDisablePhysicalSubscription();
|
||||||
method public java.util.List<android.telephony.SubscriptionInfo> getAvailableSubscriptionInfoList();
|
method public java.util.List<android.telephony.SubscriptionInfo> getAvailableSubscriptionInfoList();
|
||||||
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEnabledSubscriptionId(int);
|
method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEnabledSubscriptionId(int);
|
||||||
method @NonNull public static android.content.res.Resources getResourcesForSubId(@NonNull android.content.Context, int);
|
method @NonNull public static android.content.res.Resources getResourcesForSubId(@NonNull android.content.Context, int);
|
||||||
|
|||||||
@@ -3104,7 +3104,11 @@ public class SubscriptionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables or disables a subscription. This is currently used in the settings page.
|
* Enables or disables a subscription. This is currently used in the settings page. It will
|
||||||
|
* fail and return false if operation is not supported or failed.
|
||||||
|
*
|
||||||
|
* To disable an active subscription on a physical (non-Euicc) SIM,
|
||||||
|
* {@link #canDisablePhysicalSubscription} needs to be true.
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
* Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
|
* Permissions android.Manifest.permission.MODIFY_PHONE_STATE is required
|
||||||
@@ -3135,6 +3139,38 @@ public class SubscriptionManager {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether it's supported to disable / re-enable a subscription on a physical (non-euicc) SIM.
|
||||||
|
*
|
||||||
|
* Physical SIM refers non-euicc, or aka non-programmable SIM.
|
||||||
|
*
|
||||||
|
* It provides whether a physical SIM card can be disabled without taking it out, which is done
|
||||||
|
* via {@link #setSubscriptionEnabled(int, boolean)} API.
|
||||||
|
*
|
||||||
|
* Requires Permission: READ_PRIVILEGED_PHONE_STATE.
|
||||||
|
*
|
||||||
|
* @return whether can disable subscriptions on physical SIMs.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@SystemApi
|
||||||
|
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
|
||||||
|
public boolean canDisablePhysicalSubscription() {
|
||||||
|
if (VDBG) {
|
||||||
|
logd("canDisablePhysicalSubscription");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
|
||||||
|
if (iSub != null) {
|
||||||
|
return iSub.canDisablePhysicalSubscription();
|
||||||
|
}
|
||||||
|
} catch (RemoteException ex) {
|
||||||
|
// ignore it
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DO NOT USE.
|
* DO NOT USE.
|
||||||
* This API is designed for features that are not finished at this point. Do not call this API.
|
* This API is designed for features that are not finished at this point. Do not call this API.
|
||||||
|
|||||||
@@ -283,4 +283,6 @@ interface ISub {
|
|||||||
boolean setAlwaysAllowMmsData(int subId, boolean alwaysAllow);
|
boolean setAlwaysAllowMmsData(int subId, boolean alwaysAllow);
|
||||||
|
|
||||||
int getActiveDataSubscriptionId();
|
int getActiveDataSubscriptionId();
|
||||||
|
|
||||||
|
boolean canDisablePhysicalSubscription();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user