Merge change 21754 into eclair
* changes: E911 call fix in ECM
This commit is contained in:
@@ -433,6 +433,20 @@ public interface Phone {
|
|||||||
*/
|
*/
|
||||||
void unregisterForMmiComplete(Handler h);
|
void unregisterForMmiComplete(Handler h);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registration point for Ecm timer reset
|
||||||
|
* @param h handler to notify
|
||||||
|
* @param what user-defined message code
|
||||||
|
* @param obj placed in Message.obj
|
||||||
|
*/
|
||||||
|
public void registerForEcmTimerReset(Handler h, int what, Object obj);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unregister for notification for Ecm timer reset
|
||||||
|
* @param h Handler to be removed from the registrant list.
|
||||||
|
*/
|
||||||
|
public void unregisterForEcmTimerReset(Handler h);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of MMI codes that are pending. (They have initiated
|
* Returns a list of MMI codes that are pending. (They have initiated
|
||||||
* but have not yet completed).
|
* but have not yet completed).
|
||||||
|
|||||||
@@ -760,6 +760,16 @@ public abstract class PhoneBase implements Phone {
|
|||||||
Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
|
Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void registerForEcmTimerReset(Handler h, int what, Object obj) {
|
||||||
|
// This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
|
||||||
|
Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void unregisterForEcmTimerReset(Handler h) {
|
||||||
|
// This function should be overridden by the class CDMAPhone. Not implemented in GSMPhone.
|
||||||
|
Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
|
||||||
|
}
|
||||||
|
|
||||||
public void registerForSignalInfo(Handler h, int what, Object obj) {
|
public void registerForSignalInfo(Handler h, int what, Object obj) {
|
||||||
mCM.registerForSignalInfo(h, what, obj);
|
mCM.registerForSignalInfo(h, what, obj);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -323,6 +323,14 @@ public class PhoneProxy extends Handler implements Phone {
|
|||||||
mActivePhone.unregisterForSubscriptionInfoReady(h);
|
mActivePhone.unregisterForSubscriptionInfoReady(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void registerForEcmTimerReset(Handler h, int what, Object obj) {
|
||||||
|
mActivePhone.registerForEcmTimerReset(h,what,obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void unregisterForEcmTimerReset(Handler h) {
|
||||||
|
mActivePhone.unregisterForEcmTimerReset(h);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean getIccRecordsLoaded() {
|
public boolean getIccRecordsLoaded() {
|
||||||
return mActivePhone.getIccRecordsLoaded();
|
return mActivePhone.getIccRecordsLoaded();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ import android.os.AsyncResult;
|
|||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.os.PowerManager;
|
||||||
|
import android.os.PowerManager.WakeLock;
|
||||||
import android.os.Registrant;
|
import android.os.Registrant;
|
||||||
import android.os.RegistrantList;
|
import android.os.RegistrantList;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
@@ -72,8 +74,7 @@ import static com.android.internal.telephony.TelephonyProperties.PROPERTY_ICC_OP
|
|||||||
import static com.android.internal.telephony.TelephonyProperties.PROPERTY_ICC_OPERATOR_ISO_COUNTRY;
|
import static com.android.internal.telephony.TelephonyProperties.PROPERTY_ICC_OPERATOR_ISO_COUNTRY;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Timer;
|
|
||||||
import java.util.TimerTask;
|
|
||||||
|
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
@@ -87,10 +88,14 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
|
|
||||||
// Default Emergency Callback Mode exit timer
|
// Default Emergency Callback Mode exit timer
|
||||||
private static final int DEFAULT_ECM_EXIT_TIMER_VALUE = 300000;
|
private static final int DEFAULT_ECM_EXIT_TIMER_VALUE = 300000;
|
||||||
|
|
||||||
static final String VM_COUNT_CDMA = "vm_count_key_cdma";
|
static final String VM_COUNT_CDMA = "vm_count_key_cdma";
|
||||||
private static final String VM_NUMBER_CDMA = "vm_number_key_cdma";
|
private static final String VM_NUMBER_CDMA = "vm_number_key_cdma";
|
||||||
private String mVmNumber = null;
|
private String mVmNumber = null;
|
||||||
|
|
||||||
|
static final int RESTART_ECM_TIMER = 0; // restart Ecm timer
|
||||||
|
static final int CANCEL_ECM_TIMER = 1; // cancel Ecm timer
|
||||||
|
|
||||||
//***** Instance Variables
|
//***** Instance Variables
|
||||||
CdmaCallTracker mCT;
|
CdmaCallTracker mCT;
|
||||||
CdmaSMSDispatcher mSMS;
|
CdmaSMSDispatcher mSMS;
|
||||||
@@ -103,6 +108,7 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
RuimSmsInterfaceManager mRuimSmsInterfaceManager;
|
RuimSmsInterfaceManager mRuimSmsInterfaceManager;
|
||||||
PhoneSubInfo mSubInfo;
|
PhoneSubInfo mSubInfo;
|
||||||
EriManager mEriManager;
|
EriManager mEriManager;
|
||||||
|
WakeLock mWakeLock;
|
||||||
|
|
||||||
// mNvLoadedRegistrants are informed after the EVENT_NV_READY
|
// mNvLoadedRegistrants are informed after the EVENT_NV_READY
|
||||||
private RegistrantList mNvLoadedRegistrants = new RegistrantList();
|
private RegistrantList mNvLoadedRegistrants = new RegistrantList();
|
||||||
@@ -110,17 +116,20 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
// mEriFileLoadedRegistrants are informed after the ERI text has been loaded
|
// mEriFileLoadedRegistrants are informed after the ERI text has been loaded
|
||||||
private RegistrantList mEriFileLoadedRegistrants = new RegistrantList();
|
private RegistrantList mEriFileLoadedRegistrants = new RegistrantList();
|
||||||
|
|
||||||
// mECMExitRespRegistrant is informed after the phone has been exited
|
// mEcmTimerResetRegistrants are informed after Ecm timer is canceled or re-started
|
||||||
|
private RegistrantList mEcmTimerResetRegistrants = new RegistrantList();
|
||||||
|
|
||||||
|
// mEcmExitRespRegistrant is informed after the phone has been exited
|
||||||
//the emergency callback mode
|
//the emergency callback mode
|
||||||
//keep track of if phone is in emergency callback mode
|
//keep track of if phone is in emergency callback mode
|
||||||
private boolean mIsPhoneInECMState;
|
private boolean mIsPhoneInEcmState;
|
||||||
private Registrant mECMExitRespRegistrant;
|
private Registrant mEcmExitRespRegistrant;
|
||||||
private String mEsn;
|
private String mEsn;
|
||||||
private String mMeid;
|
private String mMeid;
|
||||||
// string to define how the carrier specifies its own ota sp number
|
// string to define how the carrier specifies its own ota sp number
|
||||||
private String mCarrierOtaSpNumSchema;
|
private String mCarrierOtaSpNumSchema;
|
||||||
|
|
||||||
// A runnable which is used to automatically exit from ECM after a period of time.
|
// A runnable which is used to automatically exit from Ecm after a period of time.
|
||||||
private Runnable mExitEcmRunnable = new Runnable() {
|
private Runnable mExitEcmRunnable = new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
exitEmergencyCallbackMode();
|
exitEmergencyCallbackMode();
|
||||||
@@ -165,6 +174,9 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
mCM.registerForNVReady(h, EVENT_NV_READY, null);
|
mCM.registerForNVReady(h, EVENT_NV_READY, null);
|
||||||
mCM.setEmergencyCallbackMode(h, EVENT_EMERGENCY_CALLBACK_MODE_ENTER, null);
|
mCM.setEmergencyCallbackMode(h, EVENT_EMERGENCY_CALLBACK_MODE_ENTER, null);
|
||||||
|
|
||||||
|
PowerManager pm
|
||||||
|
= (PowerManager) context.getSystemService(Context.POWER_SERVICE);
|
||||||
|
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,LOG_TAG);
|
||||||
|
|
||||||
//Change the system setting
|
//Change the system setting
|
||||||
SystemProperties.set(TelephonyProperties.CURRENT_ACTIVE_PHONE,
|
SystemProperties.set(TelephonyProperties.CURRENT_ACTIVE_PHONE,
|
||||||
@@ -172,7 +184,7 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
|
|
||||||
// This is needed to handle phone process crashes
|
// This is needed to handle phone process crashes
|
||||||
String inEcm=SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE, "false");
|
String inEcm=SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE, "false");
|
||||||
mIsPhoneInECMState = inEcm.equals("true");
|
mIsPhoneInEcmState = inEcm.equals("true");
|
||||||
|
|
||||||
// get the string that specifies the carrier OTA Sp number
|
// get the string that specifies the carrier OTA Sp number
|
||||||
mCarrierOtaSpNumSchema = SystemProperties.get(
|
mCarrierOtaSpNumSchema = SystemProperties.get(
|
||||||
@@ -244,6 +256,10 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
|
|
||||||
protected void finalize() {
|
protected void finalize() {
|
||||||
if(DBG) Log.d(LOG_TAG, "CDMAPhone finalized");
|
if(DBG) Log.d(LOG_TAG, "CDMAPhone finalized");
|
||||||
|
if (mWakeLock.isHeld()) {
|
||||||
|
Log.e(LOG_TAG, "UNEXPECTED; mWakeLock is held when finalizing.");
|
||||||
|
mWakeLock.release();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -525,11 +541,11 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setOnEcbModeExitResponse(Handler h, int what, Object obj) {
|
public void setOnEcbModeExitResponse(Handler h, int what, Object obj) {
|
||||||
mECMExitRespRegistrant = new Registrant (h, what, obj);
|
mEcmExitRespRegistrant = new Registrant (h, what, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unsetOnEcbModeExitResponse(Handler h) {
|
public void unsetOnEcbModeExitResponse(Handler h) {
|
||||||
mECMExitRespRegistrant.clear();
|
mEcmExitRespRegistrant.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void registerForCallWaiting(Handler h, int what, Object obj) {
|
public void registerForCallWaiting(Handler h, int what, Object obj) {
|
||||||
@@ -729,7 +745,7 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
public boolean enableDataConnectivity() {
|
public boolean enableDataConnectivity() {
|
||||||
|
|
||||||
// block data activities when phone is in emergency callback mode
|
// block data activities when phone is in emergency callback mode
|
||||||
if (mIsPhoneInECMState) {
|
if (mIsPhoneInEcmState) {
|
||||||
Intent intent = new Intent(TelephonyIntents.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS);
|
Intent intent = new Intent(TelephonyIntents.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS);
|
||||||
ActivityManagerNative.broadcastStickyIntent(intent, null);
|
ActivityManagerNative.broadcastStickyIntent(intent, null);
|
||||||
return false;
|
return false;
|
||||||
@@ -826,8 +842,9 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
void sendEmergencyCallbackModeChange(){
|
void sendEmergencyCallbackModeChange(){
|
||||||
//Send an Intent
|
//Send an Intent
|
||||||
Intent intent = new Intent(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
|
Intent intent = new Intent(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
|
||||||
intent.putExtra(PHONE_IN_ECM_STATE, mIsPhoneInECMState);
|
intent.putExtra(PHONE_IN_ECM_STATE, mIsPhoneInEcmState);
|
||||||
ActivityManagerNative.broadcastStickyIntent(intent,null);
|
ActivityManagerNative.broadcastStickyIntent(intent,null);
|
||||||
|
if (DBG) Log.d(LOG_TAG, "sendEmergencyCallbackModeChange");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*package*/ void
|
/*package*/ void
|
||||||
@@ -859,15 +876,21 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exitEmergencyCallbackMode() {
|
public void exitEmergencyCallbackMode() {
|
||||||
|
if (mWakeLock.isHeld()) {
|
||||||
|
mWakeLock.release();
|
||||||
|
}
|
||||||
// Send a message which will invoke handleExitEmergencyCallbackMode
|
// Send a message which will invoke handleExitEmergencyCallbackMode
|
||||||
mCM.exitEmergencyCallbackMode(h.obtainMessage(EVENT_EXIT_EMERGENCY_CALLBACK_RESPONSE));
|
mCM.exitEmergencyCallbackMode(h.obtainMessage(EVENT_EXIT_EMERGENCY_CALLBACK_RESPONSE));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleEnterEmergencyCallbackMode(Message msg) {
|
private void handleEnterEmergencyCallbackMode(Message msg) {
|
||||||
Log.d(LOG_TAG, "Event EVENT_EMERGENCY_CALLBACK_MODE Received");
|
if (DBG) {
|
||||||
// if phone is not in ECM mode, and it's changed to ECM mode
|
Log.d(LOG_TAG, "handleEnterEmergencyCallbackMode,mIsPhoneInEcmState= "
|
||||||
if (mIsPhoneInECMState == false) {
|
+ mIsPhoneInEcmState);
|
||||||
mIsPhoneInECMState = true;
|
}
|
||||||
|
// if phone is not in Ecm mode, and it's changed to Ecm mode
|
||||||
|
if (mIsPhoneInEcmState == false) {
|
||||||
|
mIsPhoneInEcmState = true;
|
||||||
// notify change
|
// notify change
|
||||||
sendEmergencyCallbackModeChange();
|
sendEmergencyCallbackModeChange();
|
||||||
setSystemProperty(TelephonyProperties.PROPERTY_INECM_MODE, "true");
|
setSystemProperty(TelephonyProperties.PROPERTY_INECM_MODE, "true");
|
||||||
@@ -877,23 +900,27 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
long delayInMillis = SystemProperties.getLong(
|
long delayInMillis = SystemProperties.getLong(
|
||||||
TelephonyProperties.PROPERTY_ECM_EXIT_TIMER, DEFAULT_ECM_EXIT_TIMER_VALUE);
|
TelephonyProperties.PROPERTY_ECM_EXIT_TIMER, DEFAULT_ECM_EXIT_TIMER_VALUE);
|
||||||
h.postDelayed(mExitEcmRunnable, delayInMillis);
|
h.postDelayed(mExitEcmRunnable, delayInMillis);
|
||||||
|
// We don't want to go to sleep while in Ecm
|
||||||
|
mWakeLock.acquire();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleExitEmergencyCallbackMode(Message msg) {
|
private void handleExitEmergencyCallbackMode(Message msg) {
|
||||||
Log.d(LOG_TAG, "Event EVENT_EXIT_EMERGENCY_CALLBACK_RESPONSE Received");
|
|
||||||
AsyncResult ar = (AsyncResult)msg.obj;
|
AsyncResult ar = (AsyncResult)msg.obj;
|
||||||
|
if (DBG) {
|
||||||
// Remove pending exit ECM runnable, if any
|
Log.d(LOG_TAG, "handleExitEmergencyCallbackMode,ar.exception , mIsPhoneInEcmState "
|
||||||
|
+ ar.exception + mIsPhoneInEcmState);
|
||||||
|
}
|
||||||
|
// Remove pending exit Ecm runnable, if any
|
||||||
h.removeCallbacks(mExitEcmRunnable);
|
h.removeCallbacks(mExitEcmRunnable);
|
||||||
|
|
||||||
if (mECMExitRespRegistrant != null) {
|
if (mEcmExitRespRegistrant != null) {
|
||||||
mECMExitRespRegistrant.notifyRegistrant(ar);
|
mEcmExitRespRegistrant.notifyRegistrant(ar);
|
||||||
}
|
}
|
||||||
// if exiting ecm success
|
// if exiting ecm success
|
||||||
if (ar.exception == null) {
|
if (ar.exception == null) {
|
||||||
if (mIsPhoneInECMState) {
|
if (mIsPhoneInEcmState) {
|
||||||
mIsPhoneInECMState = false;
|
mIsPhoneInEcmState = false;
|
||||||
setSystemProperty(TelephonyProperties.PROPERTY_INECM_MODE, "false");
|
setSystemProperty(TelephonyProperties.PROPERTY_INECM_MODE, "false");
|
||||||
}
|
}
|
||||||
// send an Intent
|
// send an Intent
|
||||||
@@ -903,6 +930,42 @@ public class CDMAPhone extends PhoneBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle to cancel or restart Ecm timer in emergency call back mode
|
||||||
|
* if action is CANCEL_ECM_TIMER, cancel Ecm timer and notify apps the timer is canceled;
|
||||||
|
* otherwise, restart Ecm timer and notify apps the timer is restarted.
|
||||||
|
*/
|
||||||
|
void handleTimerInEmergencyCallbackMode(int action) {
|
||||||
|
switch(action) {
|
||||||
|
case CANCEL_ECM_TIMER:
|
||||||
|
h.removeCallbacks(mExitEcmRunnable);
|
||||||
|
mEcmTimerResetRegistrants.notifyResult(new Boolean(true));
|
||||||
|
break;
|
||||||
|
case RESTART_ECM_TIMER:
|
||||||
|
long delayInMillis = SystemProperties.getLong(
|
||||||
|
TelephonyProperties.PROPERTY_ECM_EXIT_TIMER, DEFAULT_ECM_EXIT_TIMER_VALUE);
|
||||||
|
h.postDelayed(mExitEcmRunnable, delayInMillis);
|
||||||
|
mEcmTimerResetRegistrants.notifyResult(new Boolean(false));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Log.e(LOG_TAG, "handleTimerInEmergencyCallbackMode, unsupported action " + action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registration point for Ecm timer reset
|
||||||
|
* @param h handler to notify
|
||||||
|
* @param what User-defined message code
|
||||||
|
* @param obj placed in Message.obj
|
||||||
|
*/
|
||||||
|
public void registerForEcmTimerReset(Handler h, int what, Object obj) {
|
||||||
|
mEcmTimerResetRegistrants.addUnique(h, what, obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void unregisterForEcmTimerReset(Handler h) {
|
||||||
|
mEcmTimerResetRegistrants.remove(h);
|
||||||
|
}
|
||||||
|
|
||||||
//***** Inner Classes
|
//***** Inner Classes
|
||||||
class MyHandler extends Handler {
|
class MyHandler extends Handler {
|
||||||
MyHandler() {
|
MyHandler() {
|
||||||
|
|||||||
49
telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java
Normal file → Executable file
49
telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java
Normal file → Executable file
@@ -72,7 +72,7 @@ public final class CdmaCallTracker extends CallTracker {
|
|||||||
|
|
||||||
CdmaConnection pendingMO;
|
CdmaConnection pendingMO;
|
||||||
boolean hangupPendingMO;
|
boolean hangupPendingMO;
|
||||||
boolean pendingCallInECM=false;
|
boolean pendingCallInEcm=false;
|
||||||
CDMAPhone phone;
|
CDMAPhone phone;
|
||||||
|
|
||||||
boolean desiredMute = false; // false = mute off
|
boolean desiredMute = false; // false = mute off
|
||||||
@@ -80,6 +80,7 @@ public final class CdmaCallTracker extends CallTracker {
|
|||||||
int pendingCallClirMode;
|
int pendingCallClirMode;
|
||||||
Phone.State state = Phone.State.IDLE;
|
Phone.State state = Phone.State.IDLE;
|
||||||
|
|
||||||
|
private boolean mIsEcmTimerCanceled = false;
|
||||||
|
|
||||||
// boolean needsPoll;
|
// boolean needsPoll;
|
||||||
|
|
||||||
@@ -182,6 +183,14 @@ public final class CdmaCallTracker extends CallTracker {
|
|||||||
throw new CallStateException("cannot dial in current state");
|
throw new CallStateException("cannot dial in current state");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String inEcm=SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE, "false");
|
||||||
|
boolean isPhoneInEcmMode = inEcm.equals("true");
|
||||||
|
boolean isEmergencyCall = PhoneNumberUtils.isEmergencyNumber(dialString);
|
||||||
|
|
||||||
|
// Cancel Ecm timer if a second emergency call is originating in Ecm mode
|
||||||
|
if (isPhoneInEcmMode && isEmergencyCall) {
|
||||||
|
handleEcmTimer(phone.CANCEL_ECM_TIMER);
|
||||||
|
}
|
||||||
|
|
||||||
// We are initiating a call therefore even if we previously
|
// We are initiating a call therefore even if we previously
|
||||||
// didn't know the state (i.e. Generic was true) we now know
|
// didn't know the state (i.e. Generic was true) we now know
|
||||||
@@ -210,14 +219,14 @@ public final class CdmaCallTracker extends CallTracker {
|
|||||||
// Always unmute when initiating a new call
|
// Always unmute when initiating a new call
|
||||||
setMute(false);
|
setMute(false);
|
||||||
|
|
||||||
String inEcm=SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE, "false");
|
// In Ecm mode, if another emergency call is dialed, Ecm mode will not exit.
|
||||||
if(inEcm.equals("false")) {
|
if(!isPhoneInEcmMode || (isPhoneInEcmMode && isEmergencyCall)) {
|
||||||
cm.dial(pendingMO.address, clirMode, obtainCompleteMessage());
|
cm.dial(pendingMO.address, clirMode, obtainCompleteMessage());
|
||||||
} else {
|
} else {
|
||||||
phone.exitEmergencyCallbackMode();
|
phone.exitEmergencyCallbackMode();
|
||||||
phone.setOnEcbModeExitResponse(this,EVENT_EXIT_ECM_RESPONSE_CDMA, null);
|
phone.setOnEcbModeExitResponse(this,EVENT_EXIT_ECM_RESPONSE_CDMA, null);
|
||||||
pendingCallClirMode=clirMode;
|
pendingCallClirMode=clirMode;
|
||||||
pendingCallInECM=true;
|
pendingCallInEcm=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -479,6 +488,11 @@ public final class CdmaCallTracker extends CallTracker {
|
|||||||
// Someone has already asked to hangup this call
|
// Someone has already asked to hangup this call
|
||||||
if (hangupPendingMO) {
|
if (hangupPendingMO) {
|
||||||
hangupPendingMO = false;
|
hangupPendingMO = false;
|
||||||
|
// Re-start Ecm timer when an uncompleted emergency call ends
|
||||||
|
if (mIsEcmTimerCanceled) {
|
||||||
|
handleEcmTimer(phone.RESTART_ECM_TIMER);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (Phone.DEBUG_PHONE) log(
|
if (Phone.DEBUG_PHONE) log(
|
||||||
"poll: hangupPendingMO, hangup conn " + i);
|
"poll: hangupPendingMO, hangup conn " + i);
|
||||||
@@ -532,6 +546,12 @@ public final class CdmaCallTracker extends CallTracker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
foregroundCall.setGeneric(false);
|
foregroundCall.setGeneric(false);
|
||||||
|
|
||||||
|
// Re-start Ecm timer when the connected emergency call ends
|
||||||
|
if (mIsEcmTimerCanceled) {
|
||||||
|
handleEcmTimer(phone.RESTART_ECM_TIMER);
|
||||||
|
}
|
||||||
|
|
||||||
// Dropped connections are removed from the CallTracker
|
// Dropped connections are removed from the CallTracker
|
||||||
// list but kept in the Call list
|
// list but kept in the Call list
|
||||||
connections[i] = null;
|
connections[i] = null;
|
||||||
@@ -571,8 +591,8 @@ public final class CdmaCallTracker extends CallTracker {
|
|||||||
droppedDuringPoll.add(pendingMO);
|
droppedDuringPoll.add(pendingMO);
|
||||||
pendingMO = null;
|
pendingMO = null;
|
||||||
hangupPendingMO = false;
|
hangupPendingMO = false;
|
||||||
if( pendingCallInECM) {
|
if( pendingCallInEcm) {
|
||||||
pendingCallInECM = false;
|
pendingCallInEcm = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -941,9 +961,9 @@ public final class CdmaCallTracker extends CallTracker {
|
|||||||
|
|
||||||
case EVENT_EXIT_ECM_RESPONSE_CDMA:
|
case EVENT_EXIT_ECM_RESPONSE_CDMA:
|
||||||
//no matter the result, we still do the same here
|
//no matter the result, we still do the same here
|
||||||
if (pendingCallInECM) {
|
if (pendingCallInEcm) {
|
||||||
cm.dial(pendingMO.address, pendingCallClirMode, obtainCompleteMessage());
|
cm.dial(pendingMO.address, pendingCallClirMode, obtainCompleteMessage());
|
||||||
pendingCallInECM = false;
|
pendingCallInEcm = false;
|
||||||
}
|
}
|
||||||
phone.unsetOnEcbModeExitResponse(this);
|
phone.unsetOnEcbModeExitResponse(this);
|
||||||
break;
|
break;
|
||||||
@@ -971,6 +991,19 @@ public final class CdmaCallTracker extends CallTracker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle Ecm timer to be canceled or re-started
|
||||||
|
*/
|
||||||
|
private void handleEcmTimer(int action) {
|
||||||
|
phone.handleTimerInEmergencyCallbackMode(action);
|
||||||
|
switch(action) {
|
||||||
|
case CDMAPhone.CANCEL_ECM_TIMER: mIsEcmTimerCanceled = true; break;
|
||||||
|
case CDMAPhone.RESTART_ECM_TIMER: mIsEcmTimerCanceled = false; break;
|
||||||
|
default:
|
||||||
|
Log.e(LOG_TAG, "handleEcmTimer, unsupported action " + action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void log(String msg) {
|
protected void log(String msg) {
|
||||||
Log.d(LOG_TAG, "[CdmaCallTracker] " + msg);
|
Log.d(LOG_TAG, "[CdmaCallTracker] " + msg);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user