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

Commit 23e64c1f authored by Brad Ebinger's avatar Brad Ebinger Committed by android-build-merger
Browse files

Merge "Suppress Registration Errors when WFC disabled" into oc-dr1-dev

am: c30d264d

Change-Id: Icbe2c5b6763a0cc8d9828c412a43856692d74d4a
parents 45684db3 c30d264d
Loading
Loading
Loading
Loading
+89 −81
Original line number Diff line number Diff line
@@ -1586,7 +1586,16 @@ public class ImsPhone extends ImsPhoneBase {
    public void processDisconnectReason(ImsReasonInfo imsReasonInfo) {
        if (imsReasonInfo.mCode == imsReasonInfo.CODE_REGISTRATION_ERROR
                && imsReasonInfo.mExtraMessage != null) {
            // Suppress WFC Registration notifications if WFC is not enabled by the user.
            if (ImsManager.isWfcEnabledByUser(mContext)) {
                processWfcDisconnectForNotification(imsReasonInfo);
            }
        }
    }

    // Processes an IMS disconnect cause for possible WFC registration errors and optionally
    // disable WFC.
    private void processWfcDisconnectForNotification(ImsReasonInfo imsReasonInfo) {
        CarrierConfigManager configManager =
                (CarrierConfigManager) mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE);
        if (configManager == null) {
@@ -1644,9 +1653,9 @@ public class ImsPhone extends ImsPhoneBase {
                    com.android.internal.R.string.wfcRegErrorTitle);

            int idx = Integer.parseInt(codes[1]);
                if (idx < 0 ||
                        idx >= wfcOperatorErrorAlertMessages.length ||
                        idx >= wfcOperatorErrorNotificationMessages.length) {
            if (idx < 0
                    || idx >= wfcOperatorErrorAlertMessages.length
                    || idx >= wfcOperatorErrorNotificationMessages.length) {
                Rlog.e(LOG_TAG, "Invalid index: " + wfcOperatorErrorCodes[i]);
                continue;
            }
@@ -1680,7 +1689,6 @@ public class ImsPhone extends ImsPhoneBase {
            break;
        }
    }
    }

    @Override
    public boolean isUtEnabled() {