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

Commit 082e71c7 authored by Sandeep Gutta's avatar Sandeep Gutta Committed by Steve Kondik
Browse files

Telephony: Managed Roaming feature re-design.

Add support to broadcast Managed Roaming intent.
When device is in manual network mode, if network rejects the
manual registration request with cause code "Persistent
location update reject", telephony broadcast this intent.

Change-Id: Ibddfb4a2007ab6e486a55b43bba95ec0c36080fc
parent 45793f90
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -732,6 +732,26 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
                    mNewSS.setRilVoiceRadioTechnology(type);
                    mNewSS.setCssIndicator(cssIndicator);

                    if ((regState == ServiceState.RIL_REG_STATE_DENIED
                            || regState == ServiceState.RIL_REG_STATE_DENIED_EMERGENCY_CALL_ENABLED)
                            && (states.length >= 14)) {
                        try {
                            int rejCode = Integer.parseInt(states[13]);
                            // Check if rejCode is "Persistent location update reject",
                            if (rejCode == 10) {
                                log(" Posting Managed roaming intent sub = "
                                        + mPhone.getSubId());
                                Intent intent =
                                        new Intent(TelephonyIntents.ACTION_MANAGED_ROAMING_IND);
                                intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY,
                                        mPhone.getSubId());
                                mPhone.getContext().sendBroadcast(intent);
                            }
                        } catch (NumberFormatException ex) {
                            loge("error parsing regCode: " + ex);
                        }
                    }

                    boolean isVoiceCapable = mPhoneBase.getContext().getResources()
                            .getBoolean(com.android.internal.R.bool.config_voice_capable);
                    if ((regState == ServiceState.RIL_REG_STATE_DENIED_EMERGENCY_CALL_ENABLED