Merge "Make some SubscriptionManager APIs system APIs"
diff --git a/api/system-current.txt b/api/system-current.txt
index 5fd2bf8..af902d4d3 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -5397,6 +5397,8 @@
public class SubscriptionManager {
method public java.util.List<android.telephony.SubscriptionInfo> getAvailableSubscriptionInfoList();
method public void requestEmbeddedSubscriptionInfoListRefresh();
+ method public void setDefaultDataSubId(int);
+ method public void setDefaultSmsSubId(int);
field public static final android.net.Uri ADVANCED_CALLING_ENABLED_CONTENT_URI;
field public static final android.net.Uri VT_ENABLED_CONTENT_URI;
field public static final android.net.Uri WFC_ENABLED_CONTENT_URI;
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index b3c4b82..3235507 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -1601,14 +1601,23 @@
return subId;
}
- /** @hide */
- @UnsupportedAppUsage
- public void setDefaultSmsSubId(int subId) {
- if (VDBG) logd("setDefaultSmsSubId sub id = " + subId);
+ /**
+ * Set the subscription which will be used by default for SMS, with the subscription which
+ * the supplied subscription ID corresponds to; or throw a RuntimeException if the supplied
+ * subscription ID is not usable (check with {@link #isUsableSubscriptionId(int)}).
+ *
+ * @param subscriptionId the supplied subscription ID
+ *
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
+ public void setDefaultSmsSubId(int subscriptionId) {
+ if (VDBG) logd("setDefaultSmsSubId sub id = " + subscriptionId);
try {
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
if (iSub != null) {
- iSub.setDefaultSmsSubId(subId);
+ iSub.setDefaultSmsSubId(subscriptionId);
}
} catch (RemoteException ex) {
// ignore it
@@ -1656,14 +1665,23 @@
return subId;
}
- /** @hide */
- @UnsupportedAppUsage
- public void setDefaultDataSubId(int subId) {
- if (VDBG) logd("setDataSubscription sub id = " + subId);
+ /**
+ * Set the subscription which will be used by default for data, with the subscription which
+ * the supplied subscription ID corresponds to; or throw a RuntimeException if the supplied
+ * subscription ID is not usable (check with {@link #isUsableSubscriptionId(int)}).
+ *
+ * @param subscriptionId the supplied subscription ID
+ *
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
+ public void setDefaultDataSubId(int subscriptionId) {
+ if (VDBG) logd("setDataSubscription sub id = " + subscriptionId);
try {
ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
if (iSub != null) {
- iSub.setDefaultDataSubId(subId);
+ iSub.setDefaultDataSubId(subscriptionId);
}
} catch (RemoteException ex) {
// ignore it