Skip to content

Instantly share code, notes, and snippets.

@adeveloper79
Forked from pawitp/msim_frameworks_base.diff
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adeveloper79/694630da53a6372bb274 to your computer and use it in GitHub Desktop.
Save adeveloper79/694630da53a6372bb274 to your computer and use it in GitHub Desktop.
From d81e9ae26dc5d3417d1f6d7be4e01f8c32950dd9 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sat, 8 Mar 2014 19:45:44 +0700
Subject: [PATCH] MSimTelephonyManager: set properties in Broadcom-style as
expected by RIL
Change-Id: I64b37ac34fdec096ea77ccb7afc4b3cfccadcd3d
---
.../android/telephony/MSimTelephonyManager.java | 43 +++-------------------
1 file changed, 6 insertions(+), 37 deletions(-)
diff --git a/telephony/java/android/telephony/MSimTelephonyManager.java b/telephony/java/android/telephony/MSimTelephonyManager.java
index 3f4c067..3081af8 100644
--- a/telephony/java/android/telephony/MSimTelephonyManager.java
+++ b/telephony/java/android/telephony/MSimTelephonyManager.java
@@ -953,35 +953,10 @@ public class MSimTelephonyManager {
* @hide
*/
public static void setTelephonyProperty(String property, int index, String value) {
- String propVal = "";
- String p[] = null;
- String prop = SystemProperties.get(property);
-
- if (value == null) {
- value = "";
- }
-
- if (prop != null) {
- p = prop.split(",");
- }
-
- if (index < 0) return;
-
- for (int i = 0; i < index; i++) {
- String str = "";
- if ((p != null) && (i < p.length)) {
- str = p[i];
- }
- propVal = propVal + str + ",";
+ if (index != 0) {
+ property += "_" + index;
}
-
- propVal = propVal + value;
- if (p != null) {
- for (int i = index+1; i < p.length; i++) {
- propVal = propVal + "," + p[i];
- }
- }
- SystemProperties.set(property, propVal);
+ SystemProperties.set(property, value);
}
/**
@@ -990,16 +965,10 @@ public class MSimTelephonyManager {
* @hide
*/
public static String getTelephonyProperty(String property, int index, String defaultVal) {
- String propVal = null;
- String prop = SystemProperties.get(property);
-
- if ((prop != null) && (prop.length() > 0)) {
- String values[] = prop.split(",");
- if ((index >= 0) && (index < values.length) && (values[index] != null)) {
- propVal = values[index];
- }
+ if (index != 0) {
+ property += "_" + index;
}
- return propVal == null ? defaultVal : propVal;
+ return SystemProperties.get(property, defaultVal);
}
/**
--
1.9.3 (Apple Git-50)
From a4a4e95365a78bfe099b1cfc21dd92634364d712 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Wed, 9 Jul 2014 13:40:27 +0900
Subject: [PATCH] Revert "Add support for SIM availability in Flight Mode."
Not supported on Broadcom RILs
This reverts commit 5418f0f57bc7769acff7a86b756e665f8a895fb3.
Conflicts:
frameworks/src/com/codeaurora/telephony/msim/MSimCDMALTEPhone.java
frameworks/src/com/codeaurora/telephony/msim/MSimGSMPhone.java
Change-Id: I5b920dd42a7838b18418fe55a4ea6c2b6acd56a5
---
.../telephony/msim/CardSubscriptionManager.java | 69 ++++++++++++++++++++--
.../telephony/msim/MSimCDMALTEPhone.java | 1 -
.../codeaurora/telephony/msim/MSimGSMPhone.java | 1 -
.../telephony/msim/MSimUiccController.java | 1 -
.../telephony/msim/SubscriptionManager.java | 52 +++++++++++++++-
5 files changed, 114 insertions(+), 10 deletions(-)
diff --git a/frameworks/src/com/codeaurora/telephony/msim/CardSubscriptionManager.java b/frameworks/src/com/codeaurora/telephony/msim/CardSubscriptionManager.java
index 9357c83..a21d51d 100644
--- a/frameworks/src/com/codeaurora/telephony/msim/CardSubscriptionManager.java
+++ b/frameworks/src/com/codeaurora/telephony/msim/CardSubscriptionManager.java
@@ -143,11 +143,13 @@ public class CardSubscriptionManager extends Handler {
//***** Events
- private static final int EVENT_RADIO_NOT_AVAILABLE = 1;
+ private static final int EVENT_RADIO_OFF_OR_NOT_AVAILABLE = 0;
+ private static final int EVENT_RADIO_ON = 1;
private static final int EVENT_ICC_CHANGED = 2;
private static final int EVENT_GET_ICCID_DONE = 3;
private static final int EVENT_UPDATE_UICC_STATUS = 4;
private static final int EVENT_SIM_REFRESH = 5;
+ private static final int EVENT_RADIO_NOT_AVAILABLE = 6;
//***** Class Variables
private static CardSubscriptionManager sCardSubscriptionManager;
@@ -156,6 +158,7 @@ public class CardSubscriptionManager extends Handler {
private CommandsInterface[] mCi;
private MSimUiccController mUiccController;
private int mNumPhones = MSimTelephonyManager.getDefault().getPhoneCount();
+ private boolean[] mRadioOn = new boolean[mNumPhones];
private boolean[] mSubActivated = new boolean[mNumPhones];
private int mUpdateUiccStatusContext = 0;
@@ -203,10 +206,13 @@ public class CardSubscriptionManager extends Handler {
for (int i = 0; i < mCi.length; i++) {
// Register for Subscription ready event for both the subscriptions.
Integer slot = new Integer(i);
+ mCi[i].registerForOffOrNotAvailable(this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, slot);
mCi[i].registerForNotAvailable(this, EVENT_RADIO_NOT_AVAILABLE, slot);
+ mCi[i].registerForOn(this, EVENT_RADIO_ON, slot);
// Register for SIM Refresh events
mCi[i].registerForIccRefresh(this, EVENT_SIM_REFRESH, new Integer(i));
+ mRadioOn[i] = false;
mSubActivated[i] = false;
}
@@ -231,6 +237,16 @@ public class CardSubscriptionManager extends Handler {
@Override
public void handleMessage(Message msg) {
switch(msg.what) {
+ case EVENT_RADIO_OFF_OR_NOT_AVAILABLE:
+ logd("EVENT_RADIO_OFF_OR_NOT_AVAILABLE");
+ processRadioOffOrNotAvailable((AsyncResult)msg.obj);
+ break;
+
+ case EVENT_RADIO_ON:
+ logd("EVENT_RADIO_ON");
+ processRadioOn((AsyncResult)msg.obj);
+ break;
+
case EVENT_RADIO_NOT_AVAILABLE:
logd("EVENT_RADIO_NOT_AVAILABLE");
processRadioNotAvailable((AsyncResult)msg.obj);
@@ -280,12 +296,35 @@ public class CardSubscriptionManager extends Handler {
}
}
+ private void processRadioOffOrNotAvailable(AsyncResult ar) {
+ Integer cardIndex = (Integer)ar.userObj;
+
+ logd("processRadioOffOrNotAvailable on cardIndex = " + cardIndex);
+
+ if (cardIndex >= 0 && cardIndex < mRadioOn.length) {
+ mRadioOn[cardIndex] = false;
+ //If sub is deactivated then reset card info.
+ if (mSubActivated[cardIndex] == false) {
+ resetCardInfo(cardIndex);
+ //CardInfo is not valid. Inform others that card info not available.
+ notifyCardInfoNotAvailable(cardIndex,
+ CardUnavailableReason.REASON_RADIO_UNAVAILABLE);
+ // Reset the flag card info available to false, so that
+ // next time it notifies all cards info available.
+ mAllCardsInfoAvailable = false;
+ }
+ } else {
+ logd("Invalid Index!!!");
+ }
+ }
+
private void processRadioNotAvailable(AsyncResult ar) {
Integer cardIndex = (Integer)ar.userObj;
logd("processRadioNotAvailable on cardIndex = " + cardIndex);
- if (cardIndex >= 0 && cardIndex < mNumPhones) {
+ if (cardIndex >= 0 && cardIndex < mRadioOn.length) {
+ mRadioOn[cardIndex] = false;
//Radio unavailable comes in case of rild crash or Modem SSR.
//reset card info in case of radio Unavailable in order to send SET_UICC later.
resetCardInfo(cardIndex);
@@ -301,6 +340,18 @@ public class CardSubscriptionManager extends Handler {
}
}
+ private void processRadioOn(AsyncResult ar) {
+ Integer cardIndex = (Integer)ar.userObj;
+
+ logd("processRadioOn on cardIndex = " + cardIndex);
+
+ if (cardIndex >= 0 && cardIndex < mRadioOn.length) {
+ mRadioOn[cardIndex] = true;
+ } else {
+ logd("Invalid Index!!!");
+ }
+ }
+
/**
* Process the ICC_CHANGED notification.
*/
@@ -312,6 +363,10 @@ public class CardSubscriptionManager extends Handler {
if ((ar.exception == null) && (ar.result != null)) {
Integer cardIndex = (Integer) ar.result;
+ if (!mRadioOn[cardIndex]) {
+ logd("handleIccChanged: radio not available - EXIT");
+ return;
+ }
UiccCard uiccCard = mUiccController.getUiccCards()[cardIndex];
UiccCard card = mUiccCardList.get(cardIndex).getUiccCard();
@@ -451,6 +506,11 @@ public class CardSubscriptionManager extends Handler {
logd("handleGetIccIdDone: cardIndex = " + cardIndex);
+ if (!mRadioOn[cardIndex]) {
+ logd("handleGetIccIdDone: radio not available - EXIT");
+ return;
+ }
+
String iccId = null;
if (ar.exception != null) {
@@ -588,7 +648,8 @@ public class CardSubscriptionManager extends Handler {
uiccCard = cardInfo.getUiccCard();
}
- if (uiccCard == null) {
+ if (uiccCard == null || mRadioOn[cardIndex] == false) {
+ logd("onUpdateUiccStatus(): mRadioOn[" + cardIndex + "] = " + mRadioOn[cardIndex]);
logd("onUpdateUiccStatus(): NO Card!!!!! at index : " + cardIndex);
if (mCardSubData[cardIndex] != null) {
// Card is removed.
@@ -713,7 +774,7 @@ public class CardSubscriptionManager extends Handler {
// Required to notify only once!!!
// Notify if all card info is available.
- if (isValidCards() && !mAllCardsInfoAvailable) {
+ if (isValidCards() && !mAllCardsInfoAvailable && mRadioOn[cardIndex]) {
mAllCardsInfoAvailable = true;
notifyAllCardsInfoAvailable();
}
diff --git a/frameworks/src/com/codeaurora/telephony/msim/MSimCDMALTEPhone.java b/frameworks/src/com/codeaurora/telephony/msim/MSimCDMALTEPhone.java
index 1e59103..4ef8c59 100644
--- a/frameworks/src/com/codeaurora/telephony/msim/MSimCDMALTEPhone.java
+++ b/frameworks/src/com/codeaurora/telephony/msim/MSimCDMALTEPhone.java
@@ -99,7 +99,6 @@ public class MSimCDMALTEPhone extends CDMALTEPhone {
this, EVENT_SUBSCRIPTION_ACTIVATED, null);
subMgr.registerForSubscriptionDeactivated(mSubscription,
this, EVENT_SUBSCRIPTION_DEACTIVATED, null);
- mSubscriptionData = subMgr.getCurrentSubscription(mSubscription);
}
@Override
diff --git a/frameworks/src/com/codeaurora/telephony/msim/MSimGSMPhone.java b/frameworks/src/com/codeaurora/telephony/msim/MSimGSMPhone.java
index c968593..81c21f3 100644
--- a/frameworks/src/com/codeaurora/telephony/msim/MSimGSMPhone.java
+++ b/frameworks/src/com/codeaurora/telephony/msim/MSimGSMPhone.java
@@ -85,7 +85,6 @@ public class MSimGSMPhone extends GSMPhone {
this, EVENT_SUBSCRIPTION_ACTIVATED, null);
subMgr.registerForSubscriptionDeactivated(mSubscription,
this, EVENT_SUBSCRIPTION_DEACTIVATED, null);
- mSubscriptionData = subMgr.getCurrentSubscription(mSubscription);
setProperties();
}
diff --git a/frameworks/src/com/codeaurora/telephony/msim/MSimUiccController.java b/frameworks/src/com/codeaurora/telephony/msim/MSimUiccController.java
index 6bac98f..fba03fe 100644
--- a/frameworks/src/com/codeaurora/telephony/msim/MSimUiccController.java
+++ b/frameworks/src/com/codeaurora/telephony/msim/MSimUiccController.java
@@ -157,7 +157,6 @@ public class MSimUiccController extends UiccController {
Integer index = new Integer(i);
mCis[i].registerForIccStatusChanged(this, EVENT_ICC_STATUS_CHANGED, index);
// TODO remove this once modem correctly notifies the unsols
- mCis[i].registerForAvailable(this, EVENT_ICC_STATUS_CHANGED, index);
mCis[i].registerForOn(this, EVENT_ICC_STATUS_CHANGED, index);
mCis[i].registerForNotAvailable(this, EVENT_RADIO_UNAVAILABLE, index);
}
diff --git a/frameworks/src/com/codeaurora/telephony/msim/SubscriptionManager.java b/frameworks/src/com/codeaurora/telephony/msim/SubscriptionManager.java
index 84da678..5356cee 100644
--- a/frameworks/src/com/codeaurora/telephony/msim/SubscriptionManager.java
+++ b/frameworks/src/com/codeaurora/telephony/msim/SubscriptionManager.java
@@ -164,6 +164,7 @@ public class SubscriptionManager extends Handler {
private boolean[] mCardInfoAvailable = new boolean[mNumPhones];
private boolean[] mIsNewCard = new boolean[mNumPhones];
+ private boolean[] mRadioOn = new boolean[mNumPhones];
private HashMap<SubscriptionId, Subscription> mActivatePending;
private HashMap<SubscriptionId, Subscription> mDeactivatePending;
@@ -272,6 +273,7 @@ public class SubscriptionManager extends Handler {
mCardInfoAvailable[i] = false;
mIsNewCard[i] = false;
+ mRadioOn[i] = false;
}
mSubDeactivatedRegistrants = new RegistrantList[mNumPhones];
@@ -323,15 +325,21 @@ public class SubscriptionManager extends Handler {
ar = (AsyncResult)msg.obj;
subId = (Integer)ar.userObj;
logd("EVENT_RADIO_OFF_OR_NOT_AVAILABLE on SUB: " + subId);
- mSetSubscriptionInProgress = false;
- mSetDdsRequired = true;
+ mRadioOn[subId] = false;
+ if (!isAllRadioOn()) {
+ mSetSubscriptionInProgress = false;
+ mSetDdsRequired = true;
+ }
break;
case EVENT_RADIO_ON:
ar = (AsyncResult)msg.obj;
subId = (Integer)ar.userObj;
logd("EVENT_RADIO_ON on SUB: " + subId);
- sendDefaultSubsInfo();
+ mRadioOn[subId] = true;
+ if (isAllRadioOn()) {
+ sendDefaultSubsInfo();
+ }
break;
case EVENT_CARD_INFO_AVAILABLE:
@@ -581,6 +589,11 @@ public class SubscriptionManager extends Handler {
* @param ar
*/
private void processCleanupDataConnectionDone(Integer subId) {
+ if (!mRadioOn[subId]) {
+ logd("processCleanupDataConnectionDone: Radio Not Available on subId = " + subId);
+ return;
+ }
+
// Cleanup data connection is done! Start processing the
// pending deactivate requests now.
mDataActive = false;
@@ -599,6 +612,11 @@ public class SubscriptionManager extends Handler {
logd("processSubscriptionStatusChanged sub = " + subId
+ " actStatus = " + actStatus);
+ if (!mRadioOn[subId]) {
+ logd("processSubscriptionStatusChanged: Radio Not Available on subId = " + subId);
+ return;
+ }
+
if ((isSubReady == true && actStatus == SUB_STATUS_ACTIVATED) ||
(isSubReady == false && actStatus == SUB_STATUS_DEACTIVATED)) {
logd("processSubscriptionStatusChanged: CurrentSubStatus and NewSubStatus are same" +
@@ -662,6 +680,12 @@ public class SubscriptionManager extends Handler {
SubscriptionStatus subStatus = SubscriptionStatus.SUB_INVALID;
Subscription currentSub = null;
+ if (!mRadioOn[setSubParam.subId]) {
+ logd("processSetUiccSubscriptionDone: Radio Not Available on subId = "
+ + setSubParam.subId);
+ return;
+ }
+
if (setSubParam.appType.equals("GLOBAL") &&
(setSubParam.subStatus == SubscriptionStatus.SUB_ACTIVATE)) {
if ((mCardSubMgr.is3gppApp(setSubParam.subId, setSubParam.app3gppId)) &&
@@ -1000,6 +1024,11 @@ public class SubscriptionManager extends Handler {
* Handles EVENT_ALL_CARDS_INFO_AVAILABLE.
*/
private void processAllCardsInfoAvailable() {
+ if (!isAllRadioOn()) {
+ logd("processAllCardsInfoAvailable: Radio Not Available ");
+ return;
+ }
+
int availableCards = 0;
mAllCardsStatusAvailable = true;
@@ -1028,6 +1057,10 @@ public class SubscriptionManager extends Handler {
* Handles EVENT_PROCESS_AVAILABLE_CARDS
*/
private void processAvailableCards() {
+ if (!isAllRadioOn()) {
+ logd("processAvailableCards: Radio Not Available ");
+ return;
+ }
if (mSetSubscriptionInProgress) {
logd("processAvailableCards: set subscription in progress!!");
return;
@@ -1144,6 +1177,11 @@ public class SubscriptionManager extends Handler {
private void processCardInfoAvailable(AsyncResult ar) {
Integer cardIndex = (Integer)ar.userObj;
+ if (!mRadioOn[cardIndex]) {
+ logd("processCardInfoAvailable: Radio Not Available on cardIndex = " + cardIndex);
+ return;
+ }
+
mCardInfoAvailable[cardIndex] = true;
logd("processCardInfoAvailable: CARD:" + cardIndex + " is available");
@@ -1196,6 +1234,14 @@ public class SubscriptionManager extends Handler {
mContext.startActivity(setSubscriptionIntent);
}
+ private boolean isAllRadioOn() {
+ boolean result = true;
+ for (boolean radioOn : mRadioOn) {
+ result = result && radioOn;
+ }
+ return result;
+ }
+
private boolean isAllCardsInfoAvailable() {
boolean result = true;
for (boolean available : mCardInfoAvailable) {
--
1.8.5.2 (Apple Git-48)
From 879d04dbd6da85468e7616af9e232184e9284e5d Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Wed, 13 Aug 2014 12:58:19 +0700
Subject: [PATCH] telephony: HACK: fix call waiting audio on Dual-SIM
Change-Id: I9978f97cf893512fcce05458d8e5da170aae3fee
---
src/java/com/android/internal/telephony/ExtCallManager.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/java/com/android/internal/telephony/ExtCallManager.java b/src/java/com/android/internal/telephony/ExtCallManager.java
index 0a91eb9..646bd04 100644
--- a/src/java/com/android/internal/telephony/ExtCallManager.java
+++ b/src/java/com/android/internal/telephony/ExtCallManager.java
@@ -331,6 +331,18 @@ public class ExtCallManager extends CallManager {
case RINGING:
if (VDBG) Rlog.d(LOG_TAG, "setAudioMode RINGING");
int curAudioMode = mAudioManager.getMode();
+
+ // HACK: When Dual-SIM is enabled and call waiting occurs,
+ // com.android.phone.CallCommandService.setActiveSubscription
+ // will cause setAudioMode to be called, causing the audio
+ // mode to be chagned to "MODE_RINGTONE", rendering the active
+ // conversation to be inaudiable.
+ // (The setAudioMode() call does not occur without Dual-SIM.)
+ if (curAudioMode == AudioManager.MODE_IN_CALL) {
+ Rlog.d(LOG_TAG, "Skip MODE_IN_CALL -> MODE_RINGTONE (assume call waiting)");
+ return;
+ }
+
if (curAudioMode != AudioManager.MODE_RINGTONE) {
// only request audio focus if the ringtone is going to be heard
if (mAudioManager.getStreamVolume(AudioManager.STREAM_RING) > 0) {
--
1.8.5.2 (Apple Git-48)
From 44dee519bd09ed06ecc66b5bd7984c2d9bcf8901 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Sat, 8 Mar 2014 19:34:18 +0700
Subject: [PATCH] Settings: MSim: remove settings not used on I9082
Change-Id: Ic33db5e60db34cf707116082b1f738918b3a395f
---
res/xml/multi_sim_settings.xml | 10 ----------
src/com/android/settings/MultiSimSettings.java | 13 -------------
2 files changed, 23 deletions(-)
diff --git a/res/xml/multi_sim_settings.xml b/res/xml/multi_sim_settings.xml
index 9a7a258..87f1ab9 100644
--- a/res/xml/multi_sim_settings.xml
+++ b/res/xml/multi_sim_settings.xml
@@ -31,16 +31,6 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
- <PreferenceScreen
- android:key="config_sub"
- android:title="@string/sel_sub_title"
- android:summary="@string/sel_sub_summary"
- android:persistent="false">
- <intent android:action="android.intent.action.MAIN"
- android:targetPackage="com.android.phone"
- android:targetClass="com.android.phone.SetSubscription" />
- </PreferenceScreen>
-
<CheckBoxPreference
android:key="tune_away"
android:title="@string/tune_away_title"
diff --git a/src/com/android/settings/MultiSimSettings.java b/src/com/android/settings/MultiSimSettings.java
index 646337c..b620c40 100644
--- a/src/com/android/settings/MultiSimSettings.java
+++ b/src/com/android/settings/MultiSimSettings.java
@@ -100,7 +100,6 @@ public class MultiSimSettings extends PreferenceActivity implements DialogInterf
private ListPreference mVoice;
private ListPreference mData;
private ListPreference mSms;
- private PreferenceScreen mConfigSub;
private CharSequence[] entries; // Used for entries like Subscription1, Subscription2 ...
private CharSequence[] entryValues; // Used for entryValues like 0, 1 ,2 ...
private CharSequence[] summaries; // Used for Summaries like Aubscription1, Subscription2....
@@ -141,8 +140,6 @@ public class MultiSimSettings extends PreferenceActivity implements DialogInterf
mData.setOnPreferenceChangeListener(this);
mSms = (ListPreference) findPreference(KEY_SMS);
mSms.setOnPreferenceChangeListener(this);
- mConfigSub = (PreferenceScreen) findPreference(KEY_CONFIG_SUB);
- mConfigSub.getIntent().putExtra(CONFIG_SUB, true);
mTuneAway = (CheckBoxPreference) findPreference(TUNE_AWAY);
mTuneAway.setOnPreferenceChangeListener(this);
mPrioritySub = (ListPreference) findPreference(PRIORITY_SUB);
@@ -224,14 +221,9 @@ public class MultiSimSettings extends PreferenceActivity implements DialogInterf
Log.d(TAG, "mIccCardCount = " + mIccCardCount);
if (mIccCardCount == 0) {
- mConfigSub.setEnabled(false);
- mConfigSub.setSelectable(false);
displayAlertDialog(getResources().getString(R.string.no_sim_info));
configureMSimMenu(false);
} else if (mIccCardCount == 1) {
- //1 SIM card is present. Config sub must be accessible
- mConfigSub.setEnabled(true);
- mConfigSub.setSelectable(true);
configureMSimMenu(false);
} else if ( (mIccCardCount > 1) && (mIccCardCount <= MAX_SUBSCRIPTIONS) ) {
configureMSimMenu(true);
@@ -605,11 +597,6 @@ public class MultiSimSettings extends PreferenceActivity implements DialogInterf
}
break;
- case EVENT_SUBSCRIPTION_ACTIVATED:
- case EVENT_SUBSCRIPTION_DEACTIVATED:
- updateMultiSimEntriesForVoice();
- updateMultiSimEntriesForSms();
- break;
case EVENT_SET_VOICE_SUBSCRIPTION:
if (!mHasTuneAway) {
--
1.8.5.2 (Apple Git-48)
From 348e9f121f86363b6d99e8cdf84cdbcf2ae9c627 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Wed, 9 Jul 2014 10:54:05 +0900
Subject: [PATCH] HACK: fix crash when pressing back on top left of FDN setting
on MSim
Change-Id: Id809495b847792e73104eea3fc015ac2b86699a0
---
src/com/android/phone/CallFeaturesSetting.java | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index 8f7d451..4518e66 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -56,6 +56,7 @@ import android.preference.PreferenceScreen;
import android.provider.ContactsContract.CommonDataKinds;
import android.provider.MediaStore;
import android.provider.Settings;
+import android.telephony.MSimTelephonyManager;
import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.util.Log;
@@ -2646,10 +2647,15 @@ public class CallFeaturesSetting extends PreferenceActivity
* This is useful for implementing "HomeAsUp" capability for second-level Settings.
*/
public static void goUpToTopLevelSetting(Activity activity) {
- Intent intent = new Intent(activity, CallFeaturesSetting.class);
- intent.setAction(Intent.ACTION_MAIN);
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- activity.startActivity(intent);
+ if (!MSimTelephonyManager.getDefault().isMultiSimEnabled()) {
+ // HACK: This doesn't work on multi-SIM (and we have multiple)
+ // hierachy (MSimCallFeaturesSetting and MSimCallFeatureSubSetting)
+ // so let just allow this to act like "back" button
+ Intent intent = new Intent(activity, CallFeaturesSetting.class);
+ intent.setAction(Intent.ACTION_MAIN);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ activity.startActivity(intent);
+ }
activity.finish();
}
--
1.9.3 (Apple Git-50)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment