Can't dial Emergency call when user turn on airplane mode.
STEPS TO REPRODUCE:
1.Insert double sim card
2.open airplane mode
3.Dial emergency call
EXPECTED RESULTS:
Turn on airplane mode,dial Emergency call.
OBSERVED RESULTS:
The state of RadioState and ServiceState are out of sync:
phone.getServiceStateTracker().isRadioOn() is true, but phone.getServiceState().getState() is ServiceState.STATE_POWER_OFF.
In this case, framework will throw CallStateException(because phone.getServiceState().getState() == ServiceState.STATE_POWER_OFF).
Bug: 120180814
Test case: open flight mode,dial Emergency call
Change-Id: Iff2bb442a818ca0ffc827317f46cfc571bffb6c3
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java
index f986994..8ae7b8a 100644
--- a/src/com/android/services/telephony/TelephonyConnectionService.java
+++ b/src/com/android/services/telephony/TelephonyConnectionService.java
@@ -433,7 +433,7 @@
// been powered on and isn't in the UNAVAILABLE state, even if it is
// reporting the OUT_OF_SERVICE state.
return (phone.getState() == PhoneConstants.State.OFFHOOK)
- || phone.getServiceStateTracker().isRadioOn();
+ || phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
} else {
// It is not an emergency number, so wait until we are in service and ready
// to make calls. This can happen when we power down the radio on bluetooth