summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMuhammed Siju <msiju@codeaurora.org>2014-04-14 11:56:18 +0530
committerSteve Kondik <shade@chemlab.org>2014-05-08 14:50:47 -0700
commit4b3808dff7c0e055e216b04afdd56372797de8f6 (patch)
tree6b3444f85be705555d330286ffd36b31cdb7c35c
parent2e00347ec588f8a36c60be8175d8882548decfae (diff)
downloadandroid_frameworks_base-qcril.tar.gz
android_frameworks_base-qcril.tar.bz2
android_frameworks_base-qcril.zip
Add support for default data subscription setting.qcril
Default data subscription setting holds the default preference for data subscription. It will be updated when user changes data preference, sub deactivated or card removal. Current set preferred data subscription API does not update the default data subscription preference. This change is to handle temporary DDS switch by apps like MMS. New APIs to update and retrieve the default data subscription are added. Change-Id: I495266cff2a5319c57279d9decb77d6a87bbfae8 CRs-Fixed: 642210
-rw-r--r--core/java/android/provider/Settings.java13
-rw-r--r--telephony/java/android/telephony/MSimTelephonyManager.java30
-rw-r--r--telephony/java/com/android/internal/telephony/msim/ITelephonyMSim.aidl16
3 files changed, 57 insertions, 2 deletions
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 889355c3037..e63d269c5ce 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -7592,6 +7592,19 @@ public final class Settings {
public static final String MULTI_SIM_DATA_CALL_SUBSCRIPTION = "multi_sim_data_call";
/**
+ * Subscription set by user for data call on a multi sim device. The difference from
+ * MULTI_SIM_DATA_CALL_SUBSCRIPTION is that this is the subscription that user set
+ * originally. Where as MULTI_SIM_DATA_CALL_SUBSCRIPTION holds the current data call
+ * subscription value, which could be different from user preferred value due to
+ * temporary DDS switch for say a silent DDS switch for MMS transaction.
+ * The value may change dynamically in case of a SIM removal or de activation.
+ * The supported values are 0 = SUB1, 1 = SUB2, 2 = SUB3, etc.
+ * @hide
+ */
+ public static final String MULTI_SIM_DEFAULT_DATA_CALL_SUBSCRIPTION
+ = "multi_sim_defaut_data_call";
+
+ /**
* Subscription to be used for SMS on a multi sim device. The supported values
* are 0 = SUB1, 1 = SUB2 and etc.
* @hide
diff --git a/telephony/java/android/telephony/MSimTelephonyManager.java b/telephony/java/android/telephony/MSimTelephonyManager.java
index 4993bad2ab2..8a08869c989 100644
--- a/telephony/java/android/telephony/MSimTelephonyManager.java
+++ b/telephony/java/android/telephony/MSimTelephonyManager.java
@@ -1030,7 +1030,23 @@ public class MSimTelephonyManager {
}
/**
+ * Returns the default preferred data subscription value.
+ */
+ public int getDefaultDataSubscription() {
+ try {
+ return getITelephonyMSim().getDefaultDataSubscription();
+ } catch (RemoteException ex) {
+ return MSimConstants.DEFAULT_SUBSCRIPTION;
+ } catch (NullPointerException ex) {
+ return MSimConstants.DEFAULT_SUBSCRIPTION;
+ }
+ }
+
+ /**
* Sets the designated data subscription.
+ * This API may be used by apps which needs to switch the DDS temporarily
+ * like MMS app. Default data subscription setting will not be updated by
+ * this API.
*/
public boolean setPreferredDataSubscription(int subscription) {
try {
@@ -1043,6 +1059,20 @@ public class MSimTelephonyManager {
}
/**
+ * Sets the designated data subscription and updates the default data
+ * subscription setting.
+ */
+ public boolean setDefaultDataSubscription(int subscription) {
+ try {
+ return getITelephonyMSim().setDefaultDataSubscription(subscription);
+ } catch (RemoteException ex) {
+ return false;
+ } catch (NullPointerException ex) {
+ return false;
+ }
+ }
+
+ /**
* Returns the preferred voice subscription.
*/
public int getPreferredVoiceSubscription() {
diff --git a/telephony/java/com/android/internal/telephony/msim/ITelephonyMSim.aidl b/telephony/java/com/android/internal/telephony/msim/ITelephonyMSim.aidl
index 3689e909cbc..275e194cab1 100644
--- a/telephony/java/com/android/internal/telephony/msim/ITelephonyMSim.aidl
+++ b/telephony/java/com/android/internal/telephony/msim/ITelephonyMSim.aidl
@@ -359,15 +359,27 @@ interface ITelephonyMSim {
int getPreferredVoiceSubscription();
/**
- * get user prefered data subscription
+ * get current prefered data subscription
* @return subscription id
*/
int getPreferredDataSubscription();
+ /**
+ * get default prefered data subscription
+ * @return subscription id
+ */
+ int getDefaultDataSubscription();
+
/*
- * Set user prefered data subscription
+ * Set current prefered data subscription temporarily.
* @return true if success
*/
boolean setPreferredDataSubscription(int subscription);
+
+ /*
+ * Set prefered data subscription and updates default data subscription.
+ * @return true if success
+ */
+ boolean setDefaultDataSubscription(int subscription);
}