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

Commit e750921a authored by Ling Ma's avatar Ling Ma Committed by Automerger Merge Worker
Browse files

Refine QNS anomaly report am: ed5d3f90

parents fe7a641f ed5d3f90
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.
     *