summaryrefslogtreecommitdiff
path: root/core/java/android/net/ConnectivityDiagnosticsManager.java
Commit message (Collapse)AuthorAgeFilesLines
* Move module sources to packages/ConnectivityRemi NGUYEN VAN2021-02-011-777/+0
| | | | | | | | | | | | | | Files that are planned to be part of the connectivity module are grouped in packages/Connectivity, so they can be built separately and moved in one operation with their history into packages/modules/Connectivity. This places the files in the existing framework-connectivity-sources filegroup instead of the current framework-core-sources filegroup. Both are used the same way in framework-non-updatable-sources. Bug: 171540887 Test: m Change-Id: I62d9d91574ace6f5c4624035d190260c3126b91e
* Replace withCleanCallingIdentity with [clear|restore]CallingIdentitylucaslin2020-12-301-6/+15
| | | | | | | | | | To prevent using @hide method - withCleanCallingIdentity() from mainline module, use clearCallingIdentity() & restoreCallingIdentity() instead. Bug: 172183305 Test: FrameworksNetTests, CtsNetTestCasesLatestSdk Change-Id: Iccd492741a0a5b1c2531fc5fc1378933b65ae038
* Document the limitation to a hundred callbacks.Chalard Jean2020-06-111-0/+8
| | | | | | | | | | | Some developers have been surprised by this limitation and had trouble figuring out what the issue was. Add documentation to address this. This also includes a drive-by removal of a duplicate check. Bug: 149867479 Test: doc-only change Change-Id: I5911d01984695550b6c9afe7a8eb535bf5e320a1
* Forward unknown Data Stall types to Connectivity Diagnostics.Cody Kesting2020-05-191-3/+3
| | | | | | | | | | | | | | | | | | | | This CL forwards suspected Data Stall events detected with unknown detection methods to ConnectivityDiagnostics. Currently, ConnectivityService drops any data stall events with unknown detection methods, which leads to false negatives for Connectivity Diagnostics registrants. This change ensures that registrants will still be notified as NetworkStack is updated to use new detection methods. The documentation for ConnectivityDiagnosticsManager#DataStallReport is also updated to reflect that the detection methods included in the report are a bit mask of detection methods used. Implicitly, this means that data stalls detected via unknown methods will have an empty bit mask (0x00). Bug: 156294356 Test: atest ConnectivityDiagnosticsManager Change-Id: I62d0bf91fcc17c7921afd519c72551399906bd6b
* Clarify comments for Connectivity Diagnostics reports.Cody Kesting2020-03-301-2/+2
| | | | | | | | | | | Clarify when ConnectivityDiagnosticsCallback#onConnectivityReportAvailable will be invoked. Clarify when NetworkAgentInfo#mConnectivityReport will be null vs non-null. Bug: 147849853 Test: atest FrameworksNetTests Change-Id: I748bd9ded72a34d89f13bd4362d6d4da62b910b8
* Invoke onConnectivityReport on registering ConnectivityDiagnostics.Cody Kesting2020-03-301-1/+2
| | | | | | | | | | | | | This change updates the behavior for registering ConnectivityDiagnosticsCallbacks. Now, after a successful register() call, callbacks will receive cached ConnectivityReports for all matching, permissioned networks. This allows registrants to be updated with the network state for their networks without having to wait for the next network validation. Bug: 147849853 Test: atest FrameworksNetTests Change-Id: I924ba8fdcc847f453557021591bde38602fe089c
* Update ConnectivityDiagnosticsCallback function name.Cody Kesting2020-03-171-5/+5
| | | | | | | | | | API Council feedback suggests renaming ConnectivityDiagnosticsCallback 'onConnectivityReport' function to be 'onConnectivityReportAvailable'. Bug: 150598997 Test: atest FrameworksNetTests Change-Id: Ieea727ecee6cf358a53a215fd4b06233dfe967ea Merged-In: Ieea727ecee6cf358a53a215fd4b06233dfe967ea
* Merge "Add support for registering test networks with administrators."Cody Kesting2020-03-161-1/+1
|\
| * Add support for registering test networks with administrators.Cody Kesting2020-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | CTS testing for ConnectivityDiagnosticsManager requires registering TestNetworks with the administrator UIDs set. This sets up the CTS process to be an administrator over the test network, which allows it to receive ConnectivityDiagnosticsCallback callbacks. Bug: 148032944 Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest Test: atest IpSecManagerTunnelTest Change-Id: I7a443c368cf1ac470fbe40883ca24bc3143153b0
* | Update Javadoc comments for ConnectivityDiagnostics constants.Cody Kesting2020-03-061-0/+7
|/ | | | | | | | | | API Council feedback requested adding documentation for detection method constants used in DataStallReport to indicate how the Data Stall was detected. Bug: 150598997 Test: n/a Change-Id: Ib08f05562dd4b17973eeee97452d9f56d37e80fe
* Include NetworkCapabilities and LinkProperties in DataStallReport.Cody Kesting2020-02-111-3/+48
| | | | | | | | | | | DataStallReport is updated to include the NetworkCapabilities and Link Properties for the Network being reported on. This provides a more complete picture of the Network conditions when the suspected data stall was detected. Bug: 148966398 Test: atest FrameworksNetTests Change-Id: I913cf18c348b9f688f9d2a3d25a71bc94eb8f000
* Merge "Fix typo in ConnectivityDiagnosticsManager constant."Cody Kesting2020-02-071-1/+1
|\
| * Fix typo in ConnectivityDiagnosticsManager constant.Cody Kesting2020-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | This change fixes a typo in the value assigned to the constant KEY_NETWORK_PROBES_ATTEMPTED_BITMASK, which is defined in ConnectivityDiagnosticsManager.ConnectivityReport. Bug: 148939502 Test: compiles Change-Id: I63863efa8c69593012bf4e95d896db192c6bfb5c
* | Implement INetworkMonitorCallbacks#notifyNetworkTestedWithExtras.Cody Kesting2020-02-051-1/+2
|/ | | | | | | | | | | | | | | | | INetworkMonitorCallbacks defines notifyNetworkTestedWithExtras() for notifying ConnectivityService of networks being tested along with a PersistableBundle of extras. A new event is introduced for NetworkStateTrackerHandler to notify the ConnectivityDiagnosticsHandler before continuing with the normal processing for "network tested" notifications. The event is also used in the ConnectivityDiagnosticsHandler. Bug: 143187964 Bug: 147391402 Test: compiles. Test: atest CtsNetTestCases FrameworksNetTests Change-Id: Iab29da790c0f5faae68227770bc3a84bbc94f124 Merged-In: Iab29da790c0f5faae68227770bc3a84bbc94f124
* Update javadocs for ConnectivityDiagnosticsManager.Cody Kesting2020-01-311-4/+4
| | | | | | | | | | | | | | | | | ConnectivityDiagnosticsManager comments for registerConnectivityDiagnosticsCallback and unregisterConnectivityDiagnosticsCallback are updated to reflect several changes. For register calls, any app will be able to register callbacks, but only permissioned applications will have their callbacks invoked (and only for networks managed by the application). Additionally, only the registering app (uid) will be able to unregister a callback once registered. Bug: 143187964 Test: docs change only. compiles. Change-Id: Ie7ae86a1afccb22d6c84027dbac49d7b8e431e8c
* Add callback registration in ConnectivityService.Cody Kesting2020-01-311-9/+31
| | | | | | | | | | | | | | | | ConnectivityDiagnosticsManager will send callbacks to ConnectivityService for registering and unregistering them with the system. ConnectivityService needs to do the processing for persisting (and deleting) these callbacks on the ConnectivityService Thread, so messages are sent to the Connectivity Diagnostics Handler, which runs on the ConnectivityService Thread. Bug: 146444622 Bug: 143187964 Bug: 147848028 Test: compiles Test: atest FrameworksNetTests Change-Id: Ia5c8f90a60c050504e8676de9564a7607a9b03bc
* Define ConnectivityDiagnosticsCallback IBinder impl.Cody Kesting2020-01-231-0/+48
| | | | | | | | | | | | An IBinder implementation of the ConnectivityDiagnosticsCallback AIDL is needed so that apps can receive notfications with their registered callbacks for callbacks coming from ConnectivityService. Bug: 143187964 Bug: 147848028 Test: compiles Test: atest FrameworksNetTests Change-Id: Ie62678f794d81e1edee68977ec684a911b5070b7
* Merge "Define Bundle keys for ConnectivityDiagnostics."Nathan Harold2020-01-231-0/+169
|\
| * Define Bundle keys for ConnectivityDiagnostics.Cody Kesting2020-01-231-0/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ConnectivityDiagnosticsManager defines several callbacks that can be invoked for registered ConnectivityDiagnosticsCallback instances. onConnectivityReport and onDataStallSuspected include ConnectivityReport and DataStallReport, respectively, both of which contain a PersistableBundle to be used for passing information from the NetworkStack module to the registered callback. When values will be consistently passed inside these bundles, their keys are defined inside ConnectivityReport and DataStallReport. Bug: 147249364 Test: compiles Test: atest FrameworksNetTests Change-Id: Icc6bd4337865692b6ca7c18eacabff59ba3a5bb9
* | Fix generic inferred type argument.Cody Kesting2020-01-221-1/+1
|/ | | | | | Test: compiles. Test: atest FrameworksNetTests Change-Id: I0dffb3f44fb465ac8bae3c41f26176e86f65e825
* Add ConnectivityDiagnosticsManager to System Server.Cody Kesting2020-01-211-1/+9
| | | | | | | | | | | ConnectivityDiagnosticsManager should be accessed through Context#getService. In order for this to be possible, it needs to be defined as a service inside SystemServiceRegistry. Bug: 146444622 Test: compiles. Test: CTS testing in aosp/1211164 Change-Id: I6fe29441ecc9967a04ceb394b3bbe54830bef079
* Make DataStallReport Parcelable.Cody Kesting2020-01-201-19/+109
| | | | | | | | | | | DataStallReport is defined inside ConnectivityDiagnosticsManager. In order for DataStallReport to be used in aidls, it must implement the Parcelable interface. Bug: 143187964 Test: compiles Test: atest FrameworksNetTests Change-Id: Idbb4885e2f67fb3f85d406a622ae45d34492dca4
* Make ConnectivityReport Parcelable.Cody Kesting2020-01-201-11/+138
| | | | | | | | | | | ConnectivityReport is defined inside ConnectivityDiagnosticsManager. In order for ConnectivityReport to be used in aidl interfaces, it must implement the Parcelable interface. Bug: 143187964 Test: compiles Test: atest FrameworksNetTests Change-Id: I8e862c78bd84b5da14203f61ce44beb1ca4a623d
* Add API surface for ConnectivityDiagnostics API.Cody Kesting2020-01-021-0/+242
ConnectivityDiagnostics API will be used to provide callbacks to permissioned applications for notifications on network connectivity events. Bug: 143187964 Test: compiles Change-Id: Ib3c0b93f534a9c540e577891aa8aa0a2ad6de71f