Loading core/java/android/provider/Settings.java +13 −0 Original line number Diff line number Diff line Loading @@ -6337,6 +6337,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. Loading telephony/java/android/telephony/MSimTelephonyManager.java +30 −0 Original line number Diff line number Diff line Loading @@ -1029,8 +1029,24 @@ 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 { Loading @@ -1042,6 +1058,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. */ Loading telephony/java/com/android/internal/telephony/msim/ITelephonyMSim.aidl +14 −2 Original line number Diff line number Diff line Loading @@ -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); } Loading
core/java/android/provider/Settings.java +13 −0 Original line number Diff line number Diff line Loading @@ -6337,6 +6337,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. Loading
telephony/java/android/telephony/MSimTelephonyManager.java +30 −0 Original line number Diff line number Diff line Loading @@ -1029,8 +1029,24 @@ 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 { Loading @@ -1042,6 +1058,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. */ Loading
telephony/java/com/android/internal/telephony/msim/ITelephonyMSim.aidl +14 −2 Original line number Diff line number Diff line Loading @@ -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); }