Update PS state when radio off or unavailable
Ye Jingjing [Thu, 6 Sep 2012 08:12:08 +0000 (10:12 +0200)]
When radio off or unavailable, CS state has been reset,
but PS state has not updated, in fact both CS and PS
state should be out of service. So SMS will try to be
sent out when sending sms, the result is "could not send"
rather than sms being queued for sending.
This fix will reset PS state to power off or out of
service when radio off or unavailable accordingly.

Bug: 8265430
Change-Id: I46e962c30021ff1273dcc559579bdedc7f432a64

src/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java [changed mode: 0755->0644]
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java

index d92488e..9a84303 100644 (file)
@@ -223,6 +223,7 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
         switch (cm.getRadioState()) {
             case RADIO_UNAVAILABLE:
                 newSS.setStateOutOfService();
+                mLteSS.setStateOutOfService();
                 newCellLoc.setStateInvalid();
                 setSignalStrengthDefaultValues();
                 mGotCountryCode = false;
@@ -232,6 +233,7 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
 
             case RADIO_OFF:
                 newSS.setStateOff();
+                mLteSS.setStateOff();
                 newCellLoc.setStateInvalid();
                 setSignalStrengthDefaultValues();
                 mGotCountryCode = false;
old mode 100755 (executable)
new mode 100644 (file)
index a6f5aaf..5909ec2
@@ -832,6 +832,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
         switch (cm.getRadioState()) {
         case RADIO_UNAVAILABLE:
             newSS.setStateOutOfService();
+            mNewDataConnectionState = ServiceState.STATE_OUT_OF_SERVICE;
             newCellLoc.setStateInvalid();
             setSignalStrengthDefaultValues();
             mGotCountryCode = false;
@@ -841,6 +842,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
 
         case RADIO_OFF:
             newSS.setStateOff();
+            mNewDataConnectionState = ServiceState.STATE_POWER_OFF;
             newCellLoc.setStateInvalid();
             setSignalStrengthDefaultValues();
             mGotCountryCode = false;
index bd13374..25ac850 100644 (file)
@@ -745,6 +745,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
         switch (cm.getRadioState()) {
             case RADIO_UNAVAILABLE:
                 newSS.setStateOutOfService();
+                newGPRSState = ServiceState.STATE_OUT_OF_SERVICE;
                 newCellLoc.setStateInvalid();
                 setSignalStrengthDefaultValues();
                 mGotCountryCode = false;
@@ -754,6 +755,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
 
             case RADIO_OFF:
                 newSS.setStateOff();
+                newGPRSState = ServiceState.STATE_POWER_OFF;
                 newCellLoc.setStateInvalid();
                 setSignalStrengthDefaultValues();
                 mGotCountryCode = false;