diff options
author | chengzhi.hou <chengzhi.hou@ck-telecom.com> | 2016-08-22 15:23:07 +0800 |
---|---|---|
committer | Chengzhi.Hou <chengzhi.hou@ck-telecom.com> | 2016-10-17 19:03:38 -0700 |
commit | b8655dc761dc98734f40440d1888e26b6593bb95 (patch) | |
tree | f31ac65be78a0e8158c2c3243ae2f6687e5757fe | |
parent | 9330f1c4cbb0a51bcc10baaf8514d6375bfd46cc (diff) | |
download | android_packages_services_Telephony-b8655dc761dc98734f40440d1888e26b6593bb95.tar.gz android_packages_services_Telephony-b8655dc761dc98734f40440d1888e26b6593bb95.tar.bz2 android_packages_services_Telephony-b8655dc761dc98734f40440d1888e26b6593bb95.zip |
Telephony: Redirect to roaming SIM network setting(Dual SIM)
When inserted two SIM card and one is roaming SIM,
click Data Roaming notification redirect to roaming
SIM network setting not SIM1's network setting.
Change-Id: I8f701478ce771bbf6e0f70ea23149afd70b34464
-rwxr-xr-x | src/com/android/phone/MobileNetworkSettings.java | 6 | ||||
-rw-r--r-- | src/com/android/phone/NotificationMgr.java | 6 | ||||
-rw-r--r-- | src/com/android/phone/PhoneGlobals.java | 7 |
3 files changed, 15 insertions, 4 deletions
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java index bad4be1ee..176913aba 100755 --- a/src/com/android/phone/MobileNetworkSettings.java +++ b/src/com/android/phone/MobileNetworkSettings.java @@ -88,6 +88,8 @@ public class MobileNetworkSettings extends PreferenceActivity private static final boolean DBG = true; public static final int REQUEST_CODE_EXIT_ECM = 17; + public static final String EXTRA_INITIAL_SLOT_TAB = "initial_slot_id"; + // Number of active Subscriptions to show tabs private static final int TAB_THRESHOLD = 2; @@ -532,6 +534,10 @@ public class MobileNetworkSettings extends PreferenceActivity IntentFilter intentFilter = new IntentFilter( TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED); registerReceiver(mPhoneChangeReceiver, intentFilter); + int initialSlotId = getIntent().getIntExtra(EXTRA_INITIAL_SLOT_TAB , -1); + if (initialSlotId != -1) { + mTabHost.setCurrentTab(initialSlotId); + } if (DBG) log("onCreate:-"); } diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java index 468c26f90..2fc6d793b 100644 --- a/src/com/android/phone/NotificationMgr.java +++ b/src/com/android/phone/NotificationMgr.java @@ -653,12 +653,14 @@ public class NotificationMgr { * appears when you lose data connectivity because you're roaming and * you have the "data roaming" feature turned off. */ - /* package */ void showDataDisconnectedRoaming() { + /* package */ void showDataDisconnectedRoaming(int roamingSlotId) { if (DBG) log("showDataDisconnectedRoaming()..."); // "Mobile network settings" screen / dialog Intent intent = new Intent(mContext, com.android.phone.MobileNetworkSettings.class); - PendingIntent contentIntent = PendingIntent.getActivity(mContext, 0, intent, 0); + intent.putExtra(MobileNetworkSettings.EXTRA_INITIAL_SLOT_TAB , roamingSlotId); + PendingIntent contentIntent = PendingIntent.getActivity(mContext, 0, intent, + PendingIntent.FLAG_UPDATE_CURRENT); final CharSequence contentText = mContext.getText(R.string.roaming_reenable_message); diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java index 9c9aaea6b..8b743e8a0 100644 --- a/src/com/android/phone/PhoneGlobals.java +++ b/src/com/android/phone/PhoneGlobals.java @@ -251,7 +251,7 @@ public class PhoneGlobals extends ContextWrapper { break; case EVENT_DATA_ROAMING_DISCONNECTED: - notificationMgr.showDataDisconnectedRoaming(); + notificationMgr.showDataDisconnectedRoaming(msg.arg1); break; case EVENT_DATA_ROAMING_OK: @@ -809,8 +809,11 @@ public class PhoneGlobals extends ContextWrapper { intent.getStringExtra(PhoneConstants.STATE_CHANGE_REASON_KEY)); if (mDataDisconnectedDueToRoaming != disconnectedDueToRoaming) { mDataDisconnectedDueToRoaming = disconnectedDueToRoaming; - mHandler.sendEmptyMessage(disconnectedDueToRoaming + int defaultDataSubId = SubscriptionManager.getDefaultDataSubId(); + Message msg = mHandler.obtainMessage(disconnectedDueToRoaming ? EVENT_DATA_ROAMING_DISCONNECTED : EVENT_DATA_ROAMING_OK); + msg.arg1 = SubscriptionManager.getSlotId(defaultDataSubId); + mHandler.sendMessage(msg); } } else if ((action.equals(TelephonyIntents.ACTION_SIM_STATE_CHANGED)) && (mPUKEntryActivity != null)) { |