am d531c9eb: Merge "Do not explicity disconnect Data during power down for 1x."

Merge commit 'd531c9ebe18f0b554d29d3c3b8e4a00f84dae97a' into gingerbread-plus-aosp

* commit 'd531c9ebe18f0b554d29d3c3b8e4a00f84dae97a':
  Do not explicity disconnect Data during power down for 1x.
This commit is contained in:
Jake Hamby
2010-10-01 16:02:16 -07:00
committed by Android Git Automerger

View File

@@ -552,27 +552,46 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
} }
@Override @Override
protected void powerOffRadioSafely(){ protected void powerOffRadioSafely() {
// clean data connection
DataConnectionTracker dcTracker = phone.mDataConnection; DataConnectionTracker dcTracker = phone.mDataConnection;
Message msg = dcTracker.obtainMessage(DataConnectionTracker.EVENT_CLEAN_UP_CONNECTION); Message msg = dcTracker.obtainMessage(DataConnectionTracker.EVENT_CLEAN_UP_CONNECTION);
msg.arg1 = 1; // tearDown is true
msg.obj = CDMAPhone.REASON_RADIO_TURNED_OFF; msg.obj = CDMAPhone.REASON_RADIO_TURNED_OFF;
synchronized (this) {
if (networkType == ServiceState.RADIO_TECHNOLOGY_1xRTT) {
/*
* In 1x CDMA , during radio power off modem will disconnect the
* data call and sends the power down registration message along
* with the data call release message to the network
*/
msg.arg1 = 0; // tearDown is false since modem does it anyway for 1X
dcTracker.sendMessage(msg); dcTracker.sendMessage(msg);
synchronized(this) { Log.w(LOG_TAG, "Turn off the radio right away");
hangupAndPowerOff();
} else {
if (!mPendingRadioPowerOffAfterDataOff) { if (!mPendingRadioPowerOffAfterDataOff) {
DataConnectionTracker.State currentState = dcTracker.getState(); DataConnectionTracker.State currentState = dcTracker.getState();
if (currentState != DataConnectionTracker.State.CONNECTED if (currentState != DataConnectionTracker.State.CONNECTED
&& currentState != DataConnectionTracker.State.DISCONNECTING && currentState != DataConnectionTracker.State.DISCONNECTING
&& currentState != DataConnectionTracker.State.INITING) { && currentState != DataConnectionTracker.State.INITING) {
if (DBG) log("Data disconnected, turn off radio right away.");
msg.arg1 = 0; // tearDown is false as it is not needed.
dcTracker.sendMessage(msg);
if (DBG)
log("Data disconnected, turn off radio right away.");
hangupAndPowerOff(); hangupAndPowerOff();
} } else {
else if (sendEmptyMessageDelayed(EVENT_SET_RADIO_POWER_OFF, 30000)) { // clean data connection
msg.arg1 = 1; // tearDown is true
dcTracker.sendMessage(msg);
if (sendEmptyMessageDelayed(EVENT_SET_RADIO_POWER_OFF, 30000)) {
if (DBG) { if (DBG) {
log("Wait up to 30 sec for data to disconnect, then turn off radio."); log("Wait upto 30s for data to disconnect, then turn off radio.");
} }
mPendingRadioPowerOffAfterDataOff = true; mPendingRadioPowerOffAfterDataOff = true;
} else { } else {
@@ -582,6 +601,8 @@ final class CdmaServiceStateTracker extends ServiceStateTracker {
} }
} }
} }
}
}
@Override @Override
protected void updateSpnDisplay() { protected void updateSpnDisplay() {