diff options
author | Jinghui Guo <w001091@motorola.com> | 2009-07-24 17:03:49 -0500 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2009-07-29 16:58:11 -0700 |
commit | 79ef673d56e2599932b8b7f13695d23b4df54d09 (patch) | |
tree | 062018f121ae246ee65f3c4662ffdf2335bbca4f /telephony | |
parent | 977e67bb5039c7a87968d8ebe72fe410d47544e2 (diff) | |
download | frameworks_base-79ef673d56e2599932b8b7f13695d23b4df54d09.zip frameworks_base-79ef673d56e2599932b8b7f13695d23b4df54d09.tar.gz frameworks_base-79ef673d56e2599932b8b7f13695d23b4df54d09.tar.bz2 |
Disable data call in emergency call
Diffstat (limited to 'telephony')
-rwxr-xr-x | telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java | 3 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java | 30 |
2 files changed, 33 insertions, 0 deletions
diff --git a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java index dda0187..28ce6a5 100755 --- a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java +++ b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java @@ -777,6 +777,9 @@ public class CDMAPhone extends PhoneBase { Intent intent = new Intent(TelephonyIntents.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS); ActivityManagerNative.broadcastStickyIntent(intent, null); return false; + } else if ((mCT.state == Phone.State.OFFHOOK) && mCT.isInEmergencyCall()) { + // Do not allow data call to be enabled when emergency call is going on + return false; } else { return mDataConnection.setDataEnabled(true); } diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java index 7788c75..84d6b3d 100644 --- a/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java +++ b/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java @@ -80,6 +80,7 @@ public final class CdmaCallTracker extends CallTracker { int pendingCallClirMode; Phone.State state = Phone.State.IDLE; + private boolean mIsInEmergencyCall = false; // boolean needsPoll; @@ -210,6 +211,9 @@ public final class CdmaCallTracker extends CallTracker { // Always unmute when initiating a new call setMute(false); + // Check data call + disableDataCallInEmergencyCall(dialString); + String inEcm=SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE, "false"); if(inEcm.equals("false")) { cm.dial(pendingMO.address, clirMode, obtainCompleteMessage()); @@ -236,6 +240,9 @@ public final class CdmaCallTracker extends CallTracker { private Connection dialThreeWay (String dialString) { if (!foregroundCall.isIdle()) { + // Check data call + disableDataCallInEmergencyCall(dialString); + // Attach the new connection to foregroundCall pendingMO = new CdmaConnection(phone.getContext(), dialString, this, foregroundCall); @@ -529,6 +536,9 @@ public final class CdmaCallTracker extends CallTracker { } } foregroundCall.setGeneric(false); + + mIsInEmergencyCall = false; + // Dropped connections are removed from the CallTracker // list but kept in the Call list connections[i] = null; @@ -967,6 +977,26 @@ public final class CdmaCallTracker extends CallTracker { } } + /** + * Disable data call when emergency call is connected + */ + private void disableDataCallInEmergencyCall(String dialString) { + if (PhoneNumberUtils.isEmergencyNumber(dialString)) { + phone.disableDataConnectivity(); + mIsInEmergencyCall = true; + } + } + + /** + * Check if current call is in emergency call + * + * @return true if it is in emergency call + * false if it is not in emergency call + */ + boolean isInEmergencyCall() { + return mIsInEmergencyCall; + } + protected void log(String msg) { Log.d(LOG_TAG, "[CdmaCallTracker] " + msg); } |