Skip to content

Commit 323f059

Browse files
author
Naveen Kalla
committed
Do not explicity disconnect Data during power down for 1x.
In 1x, if the data call is torn down before radio power off, modem will have to send a data call release and change to initialization state followed by idle state and send out power down registration. If the power off request is sent to the modem during Initialization state after call release, there is a chance that modem does not perform power down registration. Instead if we directly initiate a power down, modem just sets a power down registration bit in the release order. This change also optimizes the power down procedure in 1x by letting the modem handle data call release during power down. Change-Id: I0f083cc3b005ec1e64105350abb43d10583b0881
1 parent bd6abed commit 323f059

File tree

1 file changed

+41
-20
lines changed

1 file changed

+41
-20
lines changed

telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java

100644100755
Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -552,32 +552,53 @@ protected void setPowerStateToDesired() {
552552
}
553553

554554
@Override
555-
protected void powerOffRadioSafely(){
556-
// clean data connection
555+
protected void powerOffRadioSafely() {
557556
DataConnectionTracker dcTracker = phone.mDataConnection;
558557

559558
Message msg = dcTracker.obtainMessage(DataConnectionTracker.EVENT_CLEAN_UP_CONNECTION);
560-
msg.arg1 = 1; // tearDown is true
561559
msg.obj = CDMAPhone.REASON_RADIO_TURNED_OFF;
562-
dcTracker.sendMessage(msg);
563560

564-
synchronized(this) {
565-
if (!mPendingRadioPowerOffAfterDataOff) {
566-
DataConnectionTracker.State currentState = dcTracker.getState();
567-
if (currentState != DataConnectionTracker.State.CONNECTED
568-
&& currentState != DataConnectionTracker.State.DISCONNECTING
569-
&& currentState != DataConnectionTracker.State.INITING) {
570-
if (DBG) log("Data disconnected, turn off radio right away.");
571-
hangupAndPowerOff();
572-
}
573-
else if (sendEmptyMessageDelayed(EVENT_SET_RADIO_POWER_OFF, 30000)) {
574-
if (DBG) {
575-
log("Wait up to 30 sec for data to disconnect, then turn off radio.");
561+
synchronized (this) {
562+
if (networkType == ServiceState.RADIO_TECHNOLOGY_1xRTT) {
563+
/*
564+
* In 1x CDMA , during radio power off modem will disconnect the
565+
* data call and sends the power down registration message along
566+
* with the data call release message to the network
567+
*/
568+
569+
msg.arg1 = 0; // tearDown is false since modem does it anyway for 1X
570+
dcTracker.sendMessage(msg);
571+
572+
Log.w(LOG_TAG, "Turn off the radio right away");
573+
hangupAndPowerOff();
574+
} else {
575+
if (!mPendingRadioPowerOffAfterDataOff) {
576+
DataConnectionTracker.State currentState = dcTracker.getState();
577+
if (currentState != DataConnectionTracker.State.CONNECTED
578+
&& currentState != DataConnectionTracker.State.DISCONNECTING
579+
&& currentState != DataConnectionTracker.State.INITING) {
580+
581+
msg.arg1 = 0; // tearDown is false as it is not needed.
582+
dcTracker.sendMessage(msg);
583+
584+
if (DBG)
585+
log("Data disconnected, turn off radio right away.");
586+
hangupAndPowerOff();
587+
} else {
588+
// clean data connection
589+
msg.arg1 = 1; // tearDown is true
590+
dcTracker.sendMessage(msg);
591+
592+
if (sendEmptyMessageDelayed(EVENT_SET_RADIO_POWER_OFF, 30000)) {
593+
if (DBG) {
594+
log("Wait upto 30s for data to disconnect, then turn off radio.");
595+
}
596+
mPendingRadioPowerOffAfterDataOff = true;
597+
} else {
598+
Log.w(LOG_TAG, "Cannot send delayed Msg, turn off radio right away.");
599+
hangupAndPowerOff();
600+
}
576601
}
577-
mPendingRadioPowerOffAfterDataOff = true;
578-
} else {
579-
Log.w(LOG_TAG, "Cannot send delayed Msg, turn off radio right away.");
580-
hangupAndPowerOff();
581602
}
582603
}
583604
}

0 commit comments

Comments
 (0)