Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d3cbf6c authored by Tyler Gunn's avatar Tyler Gunn Committed by Andy Chou
Browse files

Ensure ACTION_EMERGENCY_CALL_STATE_CHANGED doesn't send on GSM.

If on a CDMA carrier which supports ECM and roaming on GSM, we should not
be sending the ACTION_EMERGENCY_CALL_STATE_CHANGED intents since we will
not be going into ECM.

Test: Insert VZW SIM and dial emergency call, then check if WiFi can be turned off.
Bug: 117912348
Bug: 120583450

Change-Id: Ib2a9c5732fa9f81349ec93e8326d2e5753fed0f7
Merged-In: Ib2a9c5732fa9f81349ec93e8326d2e5753fed0f7
(cherry picked from commit 7f6a473a)
parent 67f3a783
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -641,11 +641,16 @@ public class GsmCdmaPhone extends Phone {
        intent.putExtra(PhoneConstants.PHONE_IN_ECM_STATE, isInEcm());
        intent.putExtra(PhoneConstants.PHONE_IN_ECM_STATE, isInEcm());
        SubscriptionManager.putPhoneIdAndSubIdExtra(intent, getPhoneId());
        SubscriptionManager.putPhoneIdAndSubIdExtra(intent, getPhoneId());
        ActivityManager.broadcastStickyIntent(intent, UserHandle.USER_ALL);
        ActivityManager.broadcastStickyIntent(intent, UserHandle.USER_ALL);
        if (DBG) logd("sendEmergencyCallbackModeChange");
        logi("sendEmergencyCallbackModeChange");
    }
    }


    @Override
    @Override
    public void sendEmergencyCallStateChange(boolean callActive) {
    public void sendEmergencyCallStateChange(boolean callActive) {
        if (!isPhoneTypeCdma()) {
            // It possible that this method got called from ImsPhoneCallTracker#
            logi("sendEmergencyCallbackModeChange - skip for non-cdma");
            return;
        }
        if (mBroadcastEmergencyCallStateChanges) {
        if (mBroadcastEmergencyCallStateChanges) {
            Intent intent = new Intent(TelephonyIntents.ACTION_EMERGENCY_CALL_STATE_CHANGED);
            Intent intent = new Intent(TelephonyIntents.ACTION_EMERGENCY_CALL_STATE_CHANGED);
            intent.putExtra(PhoneConstants.PHONE_IN_EMERGENCY_CALL, callActive);
            intent.putExtra(PhoneConstants.PHONE_IN_EMERGENCY_CALL, callActive);