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

Commit 722f9a0f authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Remove additional logic around broadcasting emergency call state changes

Should be based only on carrier config. Wifi can decide if it should
disable on receiving the broadcasts based on its own config.

Bug: 31861987
Change-Id: If31d73deaea2a1e0bb34fbb33e594a3272732921
parent 6b859110
Loading
Loading
Loading
Loading
+5 −20
Original line number Diff line number Diff line
@@ -185,8 +185,6 @@ public class GsmCdmaPhone extends Phone {

    private int mRilVersion;
    private boolean mBroadcastEmergencyCallStateChanges = false;
    // flag to indicate if emergency call end broadcast should be sent
    boolean mSendEmergencyCallEnd = true;

    // Constructors

@@ -639,24 +637,11 @@ public class GsmCdmaPhone extends Phone {
    @Override
    public void sendEmergencyCallStateChange(boolean callActive) {
        if (mBroadcastEmergencyCallStateChanges) {
            if (callActive &&
                    getServiceState().getRilDataRadioTechnology() == ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN) {
                // if emergency call is started while on iwlan, do not send the start or end
                // broadcast
                mSendEmergencyCallEnd = false;
                if (DBG) Rlog.d(LOG_TAG, "sendEmergencyCallStateChange: not sending call start " +
                        "intent as voice tech is IWLAN");
            } else if (callActive || mSendEmergencyCallEnd) {
            Intent intent = new Intent(TelephonyIntents.ACTION_EMERGENCY_CALL_STATE_CHANGED);
            intent.putExtra(PhoneConstants.PHONE_IN_EMERGENCY_CALL, callActive);
            SubscriptionManager.putPhoneIdAndSubIdExtra(intent, getPhoneId());
            ActivityManagerNative.broadcastStickyIntent(intent, null, UserHandle.USER_ALL);
                if (DBG) Rlog.d(LOG_TAG, "sendEmergencyCallStateChange");
            } else {
                if (DBG) Rlog.d(LOG_TAG, "sendEmergencyCallStateChange: not sending call end " +
                        "intent as start was not sent");
                mSendEmergencyCallEnd = true;
            }
            if (DBG) Rlog.d(LOG_TAG, "sendEmergencyCallStateChange: callActive " + callActive);
        }
    }