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

Commit 40811b35 authored by Jack Yu's avatar Jack Yu
Browse files

Fixed setup data call failure triggers anomaly report

The network agent is created before data network connected, so
the setup failure can actually trigger onNetworkUnwanted from
connectivity service, which is not this issue catcher intended
to do.

Fix: 225412406
Test: Manual
Change-Id: Ia98c0c0b553385ae5af6a8cd7f35eed7d7701477
parent ca5d9a97
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -186,8 +186,9 @@ public class TelephonyNetworkAgent extends NetworkAgent implements NotifyQosSess
        }

        NetworkCapabilities capabilities = mDataNetwork.getNetworkCapabilities();
        if (capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_IMS)
                || capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)) {
        if ((mDataNetwork.isConnected() || mDataNetwork.isHandoverInProgress())
                && (capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_IMS)
                || capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET))) {
            trackNetworkUnwanted();
        }

@@ -208,7 +209,7 @@ public class TelephonyNetworkAgent extends NetworkAgent implements NotifyQosSess
    private void trackNetworkUnwanted() {
        if (sNetworkUnwantedCounter.addOccurrence()) {
            AnomalyReporter.reportAnomaly(
                    UUID.fromString("9f3bc55b-bfa6-4e26-afaa-5031426a66d1"),
                    UUID.fromString("9f3bc55b-bfa6-4e26-afaa-5031426a66d2"),
                    "Network Unwanted called 12 times in 5 minutes.");
        }
    }