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
This commit is contained in:
Cody Kesting
2020-05-21 12:08:21 -07:00
parent b37958eec9
commit 652e3ec4f1

View File

@@ -8183,6 +8183,11 @@ public class ConnectivityService extends IConnectivityManager.Stub
+ "creators"); + "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(); final DataStallReportParcelable p = new DataStallReportParcelable();
p.timestampMillis = timestampMillis; p.timestampMillis = timestampMillis;
p.detectionMethod = detectionMethod; p.detectionMethod = detectionMethod;