am 1cef2289: Disable data call in emergency call
Merge commit '1cef22890d10417977397a5dccf34956858d0803' into eclair-plus-aosp * commit '1cef22890d10417977397a5dccf34956858d0803': Disable data call in emergency call
This commit is contained in:
@@ -749,6 +749,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);
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ public final class CdmaCallTracker extends CallTracker {
|
||||
CdmaConnection pendingMO;
|
||||
boolean hangupPendingMO;
|
||||
boolean pendingCallInEcm=false;
|
||||
boolean mIsInEmergencyCall = false;
|
||||
CDMAPhone phone;
|
||||
|
||||
boolean desiredMute = false; // false = mute off
|
||||
@@ -219,6 +220,9 @@ public final class CdmaCallTracker extends CallTracker {
|
||||
// Always unmute when initiating a new call
|
||||
setMute(false);
|
||||
|
||||
// Check data call
|
||||
disableDataCallInEmergencyCall(dialString);
|
||||
|
||||
// In Ecm mode, if another emergency call is dialed, Ecm mode will not exit.
|
||||
if(!isPhoneInEcmMode || (isPhoneInEcmMode && isEmergencyCall)) {
|
||||
cm.dial(pendingMO.address, clirMode, obtainCompleteMessage());
|
||||
@@ -245,6 +249,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);
|
||||
@@ -556,6 +563,8 @@ public final class CdmaCallTracker extends CallTracker {
|
||||
// Re-start Ecm timer when the connected emergency call ends
|
||||
if (mIsEcmTimerCanceled) {
|
||||
handleEcmTimer(phone.RESTART_ECM_TIMER);
|
||||
} else {
|
||||
mIsInEmergencyCall = false;
|
||||
}
|
||||
|
||||
// Dropped connections are removed from the CallTracker
|
||||
@@ -1010,6 +1019,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user