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

Commit 50ca0a44 authored by Jack Yu's avatar Jack Yu Committed by Automerger Merge Worker
Browse files

Merge "Added anomaly report for IP type mismatched case" into tm-qpr-dev am:...

Merge "Added anomaly report for IP type mismatched case" into tm-qpr-dev am: e65eea57 am: 4e58ab16

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/19979235



Change-Id: Iacaed9565cfda380029b427b81207cd403cf9b8d
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 306b2a27 4e58ab16
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -2487,6 +2487,29 @@ public class DataNetwork extends StateMachine {
                reportAnomaly("Invalid DataCallResponse detected",
                        "1f273e9d-b09c-46eb-ad1c-421d01f61164");
            }
            if (mDataProfile.getApnSetting() != null && mPhone.getServiceState().getDataRegState()
                    == ServiceState.STATE_IN_SERVICE) {
                boolean isRoaming = mPhone.getServiceState().getDataRoamingFromRegistration();
                int protocol = isRoaming ? mDataProfile.getApnSetting().getRoamingProtocol()
                        : mDataProfile.getApnSetting().getProtocol();
                if (protocol == ApnSetting.PROTOCOL_IP) {
                    if (response.getAddresses().stream().anyMatch(
                            la -> la.getAddress() instanceof java.net.Inet6Address)) {
                        loge("Invalid DataCallResponse. Requested IPv4 but got IPv6 address. "
                                + response);
                        reportAnomaly("RIL reported mismatched IP type. Requested IPv6 "
                                + "but got IPv4 address.", "7744f920-fb64-4db0-ba47-de0eae485a7f");
                    }
                } else if (protocol == ApnSetting.PROTOCOL_IPV6) {
                    if (response.getAddresses().stream().anyMatch(
                            la -> la.getAddress() instanceof java.net.Inet4Address)) {
                        loge("Invalid DataCallResponse. Requested IPv6 but got IPv4 address. "
                                + response);
                        reportAnomaly("RIL reported mismatched IP type. Requested IPv4 "
                                + "but got IPv6 address.", "7744f920-fb64-4db0-ba47-de0eae485a7f");
                    }
                }
            }
        } else if (!DataFailCause.isFailCauseExisting(failCause)) { // Setup data failed.
            loge("Invalid DataFailCause in " + response);
            reportAnomaly("Invalid DataFailCause: (0x" + Integer.toHexString(failCause)