Rename one of the two EVENT_NETWORK_TESTED messages.
Currently, there are two EVENT_NETWORK_TESTED message types in ConnectivityService. One is used by the ConnectivityService handler to process validation results, and one is used by ConnectivityDiagnosticsHandler to send connectivity reports. The two messages have different contents so it is confusing that they have the same integer and the same name. Rename the second one to CMD_SEND_CONNECTIVITY_REPORT. Test: atest ConnectivityServiceTest Test: atest CtsNetTestCases:android.net.cts.ConnectivityDiagnosticsManagerTest Change-Id: I77d63dad477315e1fcc7225a5ef03aff2bed8c35
This commit is contained in:
parent
dbb9280abc
commit
0261ced634
1 changed files with 4 additions and 6 deletions
|
|
@ -3873,7 +3873,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
ConnectivityReportEvent reportEvent =
|
||||
new ConnectivityReportEvent(p.timestampMillis, nai, extras);
|
||||
final Message m = mConnectivityDiagnosticsHandler.obtainMessage(
|
||||
ConnectivityDiagnosticsHandler.EVENT_NETWORK_TESTED, reportEvent);
|
||||
ConnectivityDiagnosticsHandler.CMD_SEND_CONNECTIVITY_REPORT, reportEvent);
|
||||
mConnectivityDiagnosticsHandler.sendMessage(m);
|
||||
}
|
||||
|
||||
|
|
@ -9598,14 +9598,12 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
|
||||
/**
|
||||
* Event for {@link NetworkStateTrackerHandler} to trigger ConnectivityReport callbacks
|
||||
* after processing {@link #EVENT_NETWORK_TESTED} events.
|
||||
* after processing {@link #CMD_SEND_CONNECTIVITY_REPORT} events.
|
||||
* obj = {@link ConnectivityReportEvent} representing ConnectivityReport info reported from
|
||||
* NetworkMonitor.
|
||||
* data = PersistableBundle of extras passed from NetworkMonitor.
|
||||
*
|
||||
* <p>See {@link ConnectivityService#EVENT_NETWORK_TESTED}.
|
||||
*/
|
||||
private static final int EVENT_NETWORK_TESTED = ConnectivityService.EVENT_NETWORK_TESTED;
|
||||
private static final int CMD_SEND_CONNECTIVITY_REPORT = 3;
|
||||
|
||||
/**
|
||||
* Event for NetworkMonitor to inform ConnectivityService that a potential data stall has
|
||||
|
|
@ -9643,7 +9641,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
(IConnectivityDiagnosticsCallback) msg.obj, msg.arg1);
|
||||
break;
|
||||
}
|
||||
case EVENT_NETWORK_TESTED: {
|
||||
case CMD_SEND_CONNECTIVITY_REPORT: {
|
||||
final ConnectivityReportEvent reportEvent =
|
||||
(ConnectivityReportEvent) msg.obj;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue