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

Commit ed5d3f90 authored by Ling Ma's avatar Ling Ma Committed by Jack Yu
Browse files

Refine QNS anomaly report

ignore report if the specified apn type is absent from the existing network requests.

Fix: 235390516
Test: basic manual phone call + data browsing
Merged-In: I5e6a222611232dae89ee0d7dc5905d3a0530bd64
Change-Id: I5e6a222611232dae89ee0d7dc5905d3a0530bd64
parent b662697d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -434,6 +434,9 @@ public class AccessNetworksManager extends Handler {
     * @param apnType The requested apnType.
     */
    private void trackFrequentApnTypeChange(@ApnSetting.ApnType int apnType) {
        DataNetworkController dnc = mPhone.getDataNetworkController();
        // ignore the report when no existing network request
        if (!dnc.isCapabilityRequestExisting(DataUtils.apnTypeToNetworkCapability(apnType))) return;
        SlidingWindowEventCounter counter = mApnTypeToQnsChangeNetworkCounter.get(apnType);
        if (counter == null) {
            counter = new SlidingWindowEventCounter(
@@ -445,7 +448,7 @@ public class AccessNetworksManager extends Handler {
            reportAnomaly("QNS requested network change for "
                            + ApnSetting.getApnTypeString(apnType) + " "
                            + counter.getFrequencyString(),
                    "3e89a3df-3524-45fa-b5f2-b8911abc7d57");
                    "3e89a3df-3524-45fa-b5f2-b8911abc7d56");
        }
    }

+12 −0
Original line number Diff line number Diff line
@@ -2101,6 +2101,18 @@ public class DataNetworkController extends Handler {
        return mAllNetworkRequestList.contains(networkRequest);
    }

    /**
     * Check if a request for the capability currently exists. Note this method id not thread safe
     * so can be only called within the modules in {@link com.android.internal.telephony.data}.
     *
     * @param capability Network capability to check
     * @return {@code true} if the request for the capability exists.
     */
    public boolean isCapabilityRequestExisting(@NetCapability int capability) {
        return mAllNetworkRequestList.stream()
                .anyMatch(request -> request.hasCapability(capability));
    }

    /**
     * Check if there are existing networks having the same interface name.
     *