From 652e3ec4f178e9706c5726b08c24feb2769a7eea Mon Sep 17 00:00:00 2001 From: Cody Kesting Date: Thu, 21 May 2020 12:08:21 -0700 Subject: [PATCH] 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 --- .../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 6e026ab7fe..4b66cea88e 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -8183,6 +8183,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;