diff options
author | Jake Hamby <jhamby@google.com> | 2010-10-01 17:07:58 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-10-01 17:07:58 -0700 |
commit | 3621be68a2f4912c76b08cd1a9df8601006215b9 (patch) | |
tree | 1505f365c4f7308637355020fe5182da7940e449 /telephony | |
parent | 7091f66fc267a238f52eaa8e876726af3aaa51b1 (diff) | |
parent | edec27a1e9ffc022e68f0d6200ba90499da4b9e9 (diff) | |
download | frameworks_base-3621be68a2f4912c76b08cd1a9df8601006215b9.zip frameworks_base-3621be68a2f4912c76b08cd1a9df8601006215b9.tar.gz frameworks_base-3621be68a2f4912c76b08cd1a9df8601006215b9.tar.bz2 |
am edec27a1: am d531c9eb: Merge "Do not explicity disconnect Data during power down for 1x."
Merge commit 'edec27a1e9ffc022e68f0d6200ba90499da4b9e9'
* commit 'edec27a1e9ffc022e68f0d6200ba90499da4b9e9':
Do not explicity disconnect Data during power down for 1x.
Diffstat (limited to 'telephony')
-rwxr-xr-x[-rw-r--r--] | telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java | 61 |
1 files changed, 41 insertions, 20 deletions
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java index b71cf13..7d2013b 100644..100755 --- a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java +++ b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java @@ -551,32 +551,53 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { } @Override - protected void powerOffRadioSafely(){ - // clean data connection + protected void powerOffRadioSafely() { DataConnectionTracker dcTracker = phone.mDataConnection; Message msg = dcTracker.obtainMessage(DataConnectionTracker.EVENT_CLEAN_UP_CONNECTION); - msg.arg1 = 1; // tearDown is true msg.obj = CDMAPhone.REASON_RADIO_TURNED_OFF; - dcTracker.sendMessage(msg); - synchronized(this) { - if (!mPendingRadioPowerOffAfterDataOff) { - DataConnectionTracker.State currentState = dcTracker.getState(); - if (currentState != DataConnectionTracker.State.CONNECTED - && currentState != DataConnectionTracker.State.DISCONNECTING - && currentState != DataConnectionTracker.State.INITING) { - if (DBG) log("Data disconnected, turn off radio right away."); - hangupAndPowerOff(); - } - else if (sendEmptyMessageDelayed(EVENT_SET_RADIO_POWER_OFF, 30000)) { - if (DBG) { - log("Wait up to 30 sec for data to disconnect, then turn off radio."); + 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); + + Log.w(LOG_TAG, "Turn off the radio right away"); + hangupAndPowerOff(); + } else { + if (!mPendingRadioPowerOffAfterDataOff) { + DataConnectionTracker.State currentState = dcTracker.getState(); + if (currentState != DataConnectionTracker.State.CONNECTED + && currentState != DataConnectionTracker.State.DISCONNECTING + && currentState != DataConnectionTracker.State.INITING) { + + 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(); + } else { + // clean data connection + msg.arg1 = 1; // tearDown is true + dcTracker.sendMessage(msg); + + if (sendEmptyMessageDelayed(EVENT_SET_RADIO_POWER_OFF, 30000)) { + if (DBG) { + log("Wait upto 30s for data to disconnect, then turn off radio."); + } + mPendingRadioPowerOffAfterDataOff = true; + } else { + Log.w(LOG_TAG, "Cannot send delayed Msg, turn off radio right away."); + hangupAndPowerOff(); + } } - mPendingRadioPowerOffAfterDataOff = true; - } else { - Log.w(LOG_TAG, "Cannot send delayed Msg, turn off radio right away."); - hangupAndPowerOff(); } } } |