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

Commit ce1bad19 authored by Cody Kesting's avatar Cody Kesting Committed by Automerger Merge Worker
Browse files

Merge "Move Data Stall logic to CS from NetworkMonitorCallbacks." into rvc-dev...

Merge "Move Data Stall logic to CS from NetworkMonitorCallbacks." into rvc-dev am: 992a6e20 am: 82a4c385

Change-Id: I57169f46a39949fba377d1d9495330ce9b4d4294
parents 5b95c916 82a4c385
Loading
Loading
Loading
Loading
+26 −23
Original line number Diff line number Diff line
@@ -3087,6 +3087,21 @@ public class ConnectivityService extends IConnectivityManager.Stub

        @Override
        public void notifyDataStallSuspected(DataStallReportParcelable p) {
            ConnectivityService.this.notifyDataStallSuspected(p, mNetId);
        }

        @Override
        public int getInterfaceVersion() {
            return this.VERSION;
        }

        @Override
        public String getInterfaceHash() {
            return this.HASH;
        }
    }

    private void notifyDataStallSuspected(DataStallReportParcelable p, int netId) {
        final PersistableBundle extras = new PersistableBundle();
        switch (p.detectionMethod) {
            case DETECTION_METHOD_DNS_EVENTS:
@@ -3098,30 +3113,19 @@ public class ConnectivityService extends IConnectivityManager.Stub
                        p.tcpMetricsCollectionPeriodMillis);
                break;
            default:
                // TODO(b/156294356): update for new data stall detection methods
                log("Unknown data stall detection method, ignoring: " + p.detectionMethod);
                return;
        }

            proxyDataStallToConnectivityDiagnosticsHandler(
                    p.detectionMethod, mNetId, p.timestampMillis, extras);
        notifyDataStallSuspected(p.detectionMethod, netId, p.timestampMillis, extras);
    }

        @Override
        public int getInterfaceVersion() {
            return this.VERSION;
        }

        @Override
        public String getInterfaceHash() {
            return this.HASH;
        }
    }

    private void proxyDataStallToConnectivityDiagnosticsHandler(int detectionMethod, int netId,
            long timestampMillis, @NonNull PersistableBundle extras) {
    private void notifyDataStallSuspected(int detectionMethod, int netId, long timestampMillis,
            @NonNull PersistableBundle extras) {
        final Message msg = mConnectivityDiagnosticsHandler.obtainMessage(
                    ConnectivityDiagnosticsHandler.EVENT_DATA_STALL_SUSPECTED,
                    detectionMethod, netId, timestampMillis);
                ConnectivityDiagnosticsHandler.EVENT_DATA_STALL_SUSPECTED, detectionMethod, netId,
                timestampMillis);
        msg.setData(new Bundle(extras));

        // NetworkStateTrackerHandler currently doesn't take any actions based on data
@@ -8185,7 +8189,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
                + "creators");
        }

        proxyDataStallToConnectivityDiagnosticsHandler(
                detectionMethod, network.netId, timestampMillis, extras);
        notifyDataStallSuspected(detectionMethod, network.netId, timestampMillis, extras);
    }
}