@@ -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