MSIM: voice/sms subscription related API changes.
- Add APIs to get/set the default sms subscription
- Add APIs to get/set Voice/SMS prompt mode status
Conflicts:
telephony/java/android/telephony/SubscriptionManager.java
Change-Id: I7f06a1f45d59c617e07c1b142a11828f7cda944b
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index fe68263..4557501 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -791,6 +791,30 @@
return getPhoneId(getDefaultVoiceSubId());
}
+ public static boolean isSMSPromptEnabled() {
+ try {
+ ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
+ if (iSub != null) {
+ return iSub.isSMSPromptEnabled();
+ }
+ } catch (RemoteException ex) {
+ // ignore it
+ }
+ return false;
+ }
+
+ public static void setSMSPromptEnabled(boolean enabled) {
+ try {
+ ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
+ if (iSub != null) {
+ iSub.setSMSPromptEnabled(enabled);
+ }
+ } catch (RemoteException ex) {
+ // ignore it
+ }
+ }
+
+ /** @hide */
/**
* @return subId of the DefaultSms subscription or the value INVALID_SUB_ID if an error.
* @hide - to be unhidden
@@ -990,5 +1014,28 @@
return subId;
}
+
+ public static boolean isVoicePromptEnabled() {
+ try {
+ ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
+ if (iSub != null) {
+ return iSub.isVoicePromptEnabled();
+ }
+ } catch (RemoteException ex) {
+ // ignore it
+ }
+ return false;
+ }
+
+ public static void setVoicePromptEnabled(boolean enabled) {
+ try {
+ ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
+ if (iSub != null) {
+ iSub.setVoicePromptEnabled(enabled);
+ }
+ } catch (RemoteException ex) {
+ // ignore it
+ }
+ }
}
diff --git a/telephony/java/com/android/internal/telephony/ISms.aidl b/telephony/java/com/android/internal/telephony/ISms.aidl
index b8ca7e8..9c94882 100644
--- a/telephony/java/com/android/internal/telephony/ISms.aidl
+++ b/telephony/java/com/android/internal/telephony/ISms.aidl
@@ -553,12 +553,6 @@
*/
boolean isImsSmsSupportedForSubscriber(long subId);
- /*
- * get user prefered SMS subId
- * @return subId id
- */
- long getPreferredSmsSubscription();
-
/**
* Gets SMS format supported on IMS. SMS over IMS format is
* either 3GPP or 3GPP2.
@@ -583,12 +577,6 @@
*/
String getImsSmsFormatForSubscriber(long subId);
- /*
- * Get SMS prompt property, enabled or not
- * @return true if enabled, false otherwise
- */
- boolean isSMSPromptEnabled();
-
/**
* Send a system stored text message.
*
diff --git a/telephony/java/com/android/internal/telephony/ISub.aidl b/telephony/java/com/android/internal/telephony/ISub.aidl
index b87365e..c5ecd85 100755
--- a/telephony/java/com/android/internal/telephony/ISub.aidl
+++ b/telephony/java/com/android/internal/telephony/ISub.aidl
@@ -151,4 +151,12 @@
void clearDefaultsForInactiveSubIds();
long[] getActiveSubIdList();
+
+ boolean isSMSPromptEnabled();
+
+ void setSMSPromptEnabled(boolean enabled);
+
+ boolean isVoicePromptEnabled();
+
+ void setVoicePromptEnabled(boolean enabled);
}
diff --git a/telephony/java/com/android/internal/telephony/PhoneConstants.java b/telephony/java/com/android/internal/telephony/PhoneConstants.java
index 62b5596..8886e84 100644
--- a/telephony/java/com/android/internal/telephony/PhoneConstants.java
+++ b/telephony/java/com/android/internal/telephony/PhoneConstants.java
@@ -169,6 +169,10 @@
public static final int SIM_ID_3 = 2;
public static final int SIM_ID_4 = 3;
+ public static final int PHONE_ID1 = 0;
+ public static final int PHONE_ID2 = 1;
+ public static final int PHONE_ID3 = 2;
+
// ICC SIM Application Types
// TODO: Replace the IccCardApplicationStatus.AppType enums with these constants
public static final int APPTYPE_UNKNOWN = 0;