From 637887b98f7a175148229fc6e70443b20d37f1f3 Mon Sep 17 00:00:00 2001 From: Cody Kesting Date: Wed, 27 May 2020 18:22:56 +0000 Subject: Comment reason for simulateDataStall structure. This change adds a comment to CS#simulateDataStall to explain why the Data Stall is wrapped in a DataStallReportParcelable before being passed to the ConnectivityDiagnostics handler. This approach is taken to ensure that simulated data stalls are handled the exact same as Data Stalls received directly from NetworkMonitor (including Data Stalls detected by methods that the platform does not understand). Bug: 156294356 Test: atest ConnectivityDiagnosticsManager Change-Id: I751054418bf328c72b977a1cc99c27cb9b8ab7ba Merged-In: I751054418bf328c72b977a1cc99c27cb9b8ab7ba (cherry picked from commit c86db7497a27cfbac5c662911a295598b1335bc0) --- services/core/java/com/android/server/ConnectivityService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 1e9a9d85e06a..1634f6e62897 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -8187,6 +8187,11 @@ public class ConnectivityService extends IConnectivityManager.Stub + "creators"); } + // Instead of passing the data stall directly to the ConnectivityDiagnostics handler, treat + // this as a Data Stall received directly from NetworkMonitor. This requires wrapping the + // Data Stall information as a DataStallReportParcelable and passing to + // #notifyDataStallSuspected. This ensures that unknown Data Stall detection methods are + // still passed to ConnectivityDiagnostics (with new detection methods masked). final DataStallReportParcelable p = new DataStallReportParcelable(); p.timestampMillis = timestampMillis; p.detectionMethod = detectionMethod; -- cgit v1.2.3-59-g8ed1b