Loading telephony/java/com/android/internal/telephony/DataConnectionTracker.java +17 −11 Original line number Diff line number Diff line Loading @@ -676,6 +676,15 @@ public abstract class DataConnectionTracker extends Handler { return result; } protected boolean isEmergency() { final boolean result; synchronized (mDataEnabledLock) { result = mPhone.isInEcm() || mPhone.isInEmergencyCall(); } log("isEmergency: result=" + result); return result; } protected int apnTypeToId(String type) { if (TextUtils.equals(type, Phone.APN_TYPE_DEFAULT)) { return APN_DEFAULT_ID; Loading Loading @@ -981,20 +990,17 @@ public abstract class DataConnectionTracker extends Handler { protected void onSetInternalDataEnabled(boolean enabled) { synchronized (mDataEnabledLock) { final boolean prevEnabled = getAnyDataEnabled(); if (mInternalDataEnabled != enabled) { mInternalDataEnabled = enabled; if (prevEnabled != getAnyDataEnabled()) { if (!prevEnabled) { if (enabled) { log("onSetInternalDataEnabled: changed to enabled, try to setup data call"); resetAllRetryCounts(); onTrySetupData(Phone.REASON_DATA_ENABLED); } else { log("onSetInternalDataEnabled: changed to disabled, cleanUpAllConnections"); cleanUpAllConnections(null); } } } } } public void cleanUpAllConnections(String cause) { Message msg = obtainMessage(EVENT_CLEAN_UP_ALL_CONNECTIONS); Loading telephony/java/com/android/internal/telephony/PhoneBase.java +16 −0 Original line number Diff line number Diff line Loading @@ -832,6 +832,22 @@ public abstract class PhoneBase extends Handler implements Phone { mNotifier.notifyOtaspChanged(this, otaspMode); } /** * @return true if a mobile originating emergency call is active */ public boolean isInEmergencyCall() { return false; } /** * @return true if we are in the emergency call back mode. This is a period where * the phone should be using as little power as possible and be ready to receive an * incoming call from the emergency operator. */ public boolean isInEcm() { return false; } public abstract String getPhoneName(); public abstract int getPhoneType(); Loading telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java +8 −0 Original line number Diff line number Diff line Loading @@ -848,6 +848,14 @@ public class CDMAPhone extends PhoneBase { mUnknownConnectionRegistrants.notifyResult(this); } public boolean isInEmergencyCall() { return mCT.isInEmergencyCall(); } public boolean isInEcm() { return mIsPhoneInEcmState; } void sendEmergencyCallbackModeChange(){ //Send an Intent Intent intent = new Intent(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED); Loading telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java +1 −1 Original line number Diff line number Diff line Loading @@ -248,7 +248,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker { boolean desiredPowerState = mCdmaPhone.mSST.getDesiredPowerState(); if ((mState == State.IDLE || mState == State.SCANNING) && isDataAllowed() && getAnyDataEnabled()) { isDataAllowed() && getAnyDataEnabled() && !isEmergency()) { boolean retValue = setupData(reason); notifyOffApnsOfAvailability(reason); return retValue; Loading telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +1 −1 Original line number Diff line number Diff line Loading @@ -686,7 +686,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { boolean desiredPowerState = mPhone.getServiceStateTracker().getDesiredPowerState(); if ((apnContext.getState() == State.IDLE || apnContext.getState() == State.SCANNING) && isDataAllowed(apnContext) && getAnyDataEnabled()) { isDataAllowed(apnContext) && getAnyDataEnabled() && !isEmergency()) { if (apnContext.getState() == State.IDLE) { ArrayList<ApnSetting> waitingApns = buildWaitingApns(apnContext.getApnType()); Loading Loading
telephony/java/com/android/internal/telephony/DataConnectionTracker.java +17 −11 Original line number Diff line number Diff line Loading @@ -676,6 +676,15 @@ public abstract class DataConnectionTracker extends Handler { return result; } protected boolean isEmergency() { final boolean result; synchronized (mDataEnabledLock) { result = mPhone.isInEcm() || mPhone.isInEmergencyCall(); } log("isEmergency: result=" + result); return result; } protected int apnTypeToId(String type) { if (TextUtils.equals(type, Phone.APN_TYPE_DEFAULT)) { return APN_DEFAULT_ID; Loading Loading @@ -981,20 +990,17 @@ public abstract class DataConnectionTracker extends Handler { protected void onSetInternalDataEnabled(boolean enabled) { synchronized (mDataEnabledLock) { final boolean prevEnabled = getAnyDataEnabled(); if (mInternalDataEnabled != enabled) { mInternalDataEnabled = enabled; if (prevEnabled != getAnyDataEnabled()) { if (!prevEnabled) { if (enabled) { log("onSetInternalDataEnabled: changed to enabled, try to setup data call"); resetAllRetryCounts(); onTrySetupData(Phone.REASON_DATA_ENABLED); } else { log("onSetInternalDataEnabled: changed to disabled, cleanUpAllConnections"); cleanUpAllConnections(null); } } } } } public void cleanUpAllConnections(String cause) { Message msg = obtainMessage(EVENT_CLEAN_UP_ALL_CONNECTIONS); Loading
telephony/java/com/android/internal/telephony/PhoneBase.java +16 −0 Original line number Diff line number Diff line Loading @@ -832,6 +832,22 @@ public abstract class PhoneBase extends Handler implements Phone { mNotifier.notifyOtaspChanged(this, otaspMode); } /** * @return true if a mobile originating emergency call is active */ public boolean isInEmergencyCall() { return false; } /** * @return true if we are in the emergency call back mode. This is a period where * the phone should be using as little power as possible and be ready to receive an * incoming call from the emergency operator. */ public boolean isInEcm() { return false; } public abstract String getPhoneName(); public abstract int getPhoneType(); Loading
telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java +8 −0 Original line number Diff line number Diff line Loading @@ -848,6 +848,14 @@ public class CDMAPhone extends PhoneBase { mUnknownConnectionRegistrants.notifyResult(this); } public boolean isInEmergencyCall() { return mCT.isInEmergencyCall(); } public boolean isInEcm() { return mIsPhoneInEcmState; } void sendEmergencyCallbackModeChange(){ //Send an Intent Intent intent = new Intent(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED); Loading
telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java +1 −1 Original line number Diff line number Diff line Loading @@ -248,7 +248,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker { boolean desiredPowerState = mCdmaPhone.mSST.getDesiredPowerState(); if ((mState == State.IDLE || mState == State.SCANNING) && isDataAllowed() && getAnyDataEnabled()) { isDataAllowed() && getAnyDataEnabled() && !isEmergency()) { boolean retValue = setupData(reason); notifyOffApnsOfAvailability(reason); return retValue; Loading
telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java +1 −1 Original line number Diff line number Diff line Loading @@ -686,7 +686,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker { boolean desiredPowerState = mPhone.getServiceStateTracker().getDesiredPowerState(); if ((apnContext.getState() == State.IDLE || apnContext.getState() == State.SCANNING) && isDataAllowed(apnContext) && getAnyDataEnabled()) { isDataAllowed(apnContext) && getAnyDataEnabled() && !isEmergency()) { if (apnContext.getState() == State.IDLE) { ArrayList<ApnSetting> waitingApns = buildWaitingApns(apnContext.getApnType()); Loading