summaryrefslogtreecommitdiff
path: root/common/networkstackclient/src/android
AgeCommit message (Collapse)Author
2020-06-17Fix the potential NPE when calling IPMS API and ExecutionException is thrown.Xiao Ma
Listener callback argument is marked as @Nullable in some APIs, means client isn't interested in learning about return value, in these cases should check if it's null or not before using this callback. Bug: 147922038 Test: atest NetworkStackTests FrameworksNetTests Merged-In: Ib46624c76c2c1e50c73ccfbb295a0e90e6fa1c88 Change-Id: Ib46624c76c2c1e50c73ccfbb295a0e90e6fa1c88
2020-06-11Remove DhcpResults from NetworkStack shared libRemi NGUYEN VAN
Remove the dependency on DhcpResults in moduleutils by moving toStableParcelable to NetworkStack main code, and fromStableParcelable to the test only. Only NetworkStack should be generating DhcpResultsParcelables, and only the NetworkStack should be using DhcpResults at this point (eventually the class would move from frameworks/base/core to NetworkStack). Test: built, flashed, WiFi working Bug: 149403767 Original-Change: https://android-review.googlesource.com/1277444 Merged-In: I093fa48967a48f594b242b1e05e7d481fa9ee529 Change-Id: I093fa48967a48f594b242b1e05e7d481fa9ee529
2020-05-29Implement delete methodsChalard Jean
Test: New tests in this patch, IpMemoryStore*Tests Bug: 146460486 Change-Id: Ibda8eeb917c05876e06e78ae600acd626ca94749 Merged-In: I8680164cf34bae2fac1f5431c03a3369dd6318ab (cherry picked from commit 4f81f357bce66c9fca13242d83267ae89cd43f1d, aosp/1311637)
2020-05-29Rename groupHint to cluster.Chalard Jean
Bug: 146460486 Test: atest android.net.IpMemoryStoreTest Test: atest com.android.server.connectivity.ipmemorystore.IpMemoryStoreServiceTest Change-Id: I493472cb65262b04769192b702178351416c9869 Merged-In: I805733e201aa1286477cfac589cdf4ac18bb7e2b (cherry-picked from aosp/1311636)
2020-05-01Add default and nullable annotations to NetworkStack AIDLs.Treehugger Robot
All new fields should have defaults. Do that for fields added in v6 before we freeze v6. Fields added in v5 can no longer be changed because v5 is frozen. Test: m Bug: 133526962 Original-Change: https://android-review.googlesource.com/1299381 Merged-In: Ie2ecd84919a59adf89d0c56e4fdf2b2258fa1448 Change-Id: Ie2ecd84919a59adf89d0c56e4fdf2b2258fa1448
2020-04-28Address comments on NetworkStack AIDL v6Remi NGUYEN VAN
Address issues found during AIDL review: - Rename clientAddr to singleClientAddr - Do not use a ParcelableBundle for notifyNetworkTested or notifyDataStallSuspected; instead use AIDL parcelables for stronger backwards compatibility guarantees. As part of moving notifyNetworkTested to using a parcelable the test result int is split into two: the actual evaluation result, and the probesSucceeded int. It used to contain both as a bit mask, which does not make sense if probesAttempted is in a separate int itself. Test: atest NetworkMonitorTest ConnectivityServiceTest ConnectivityServiceIntegrationTest, manual Bug: 153500847 Merged-In: I4aac6ff7432472f8a9345fb5785c6314ec8946e4 Change-Id: I4aac6ff7432472f8a9345fb5785c6314ec8946e4
2020-04-20Get the l2key and grouphint from the initial provisioning configuration.Xiao Ma
The purpose of processing CMD_UPDATE_L2INFO command in the Stopped State is just to update the initial l2key and grouphint which are used when starting DhcpClient (e.g. for INIT-REBOOT). We can get both of l2key and groupHint from the initial prov configuration parcelable instead, then be able to delete CMD_UPDATE_L2INFO from the StoppedState. Bug: 154441742 Test: atest FrameworksNetTests NetworkStackTests Test: atest NetworkStackIntegrationTests Change-Id: I760957017b18975be969a2f519ec09ee4495ebad
2020-04-16Add a new field changePrefixOnDecline in DhcpServingParamsParcel.Xiao Ma
A new boolean flag (changePrefixOnDecline) to be added in the DhcpServingParamsParcel, indicating whether or not the DHCP server should request a new prefix (e.g. a different subnet prefix) from IpServer when receiving DHCPDECLINE message. Bug: 130741856 Test: atest NetworkStackTests NetworkStackNextTests Merged-In: I8cb0f844ef98a5f17d4e07e1812a1abf73aa4c07 Change-Id: I8cb0f844ef98a5f17d4e07e1812a1abf73aa4c07
2020-04-10Support specific client address configurationTreehugger Robot
If specific config "clientAddr" is set, the DHCP server will only offer "clientAddr". This is for peer-to-peer use case. If there are multiple clients for which "clientAddr" is already in use, dhcp server will not offer other addresses to clients. Bug: 141256482 Test: manual atest NetworkStackNextTests Merged-In: I96bc24a9c30bfc48dff38c3c4456085694fd381c Change-Id: I96bc24a9c30bfc48dff38c3c4456085694fd381c
2020-04-07Merge "Add bssid field in the ScanResultInfo class." into rvc-devXiao Ma
2020-04-07Add bssid field in the ScanResultInfo class.Xiao Ma
This change adds a new filed: bssid in the ScanResultInfo class which are encapsulated by WiFi when connecting to AP successfully, using current connected AP's bssid as a hint to determine whether L2 roaming happened or not. Also adding @NonNull annotation for fields, methods and constructor params. Bug: 131797393 Test: atest NetworkStackIntegrationTests NetworkStackTests Test: atest FrameworksNetTests Change-Id: Ia11f1954124f45f9586495f6be7fb7fb3430ae97
2020-04-07Rename IDhcpLeaseCallbacks to IDhcpEventCallbacks for more generic.Xiao Ma
This change renames IDhcpLeaseCallbacks, easier to expand in the future and adds a new method onNewPrefixRequest which will be called on DHCP server receives DHCPDECLINE message and request a new IPv4 prefix from IpServer. Bug: 130741856 Test: atest NetworkStackTests NetworkStackNextTests Merged-In: Ia7b08bb1e7feda08ffe9fbb8885dbc8b7bdd66c9 Change-Id: Ia7b08bb1e7feda08ffe9fbb8885dbc8b7bdd66c9
2020-04-02Add new method to update Layer2 information when L2 roaming happens.Xiao Ma
This change adds an new method updateLayer2Information in IIpClient.aidl to update layer2 info (e.g. bssid, l2key and grouphint) to detect whether L2 roaming happens or not. Bug: 131797393 Test: atest NetworkStackTests FrameworksNetTests Merged-In: I85eabccb6f5d5f322c8e3df556ceef6647616f5a (cherry picked from commit 3168e392320087c51a677b4d14e783c853ac652d) Change-Id: Ife93fd162803ae89fa85905b45a4bb1cfb5e7e43
2020-03-18Use NetworkStack.getService in NetworkStackClientRemi NGUYEN VAN
This avoids returning IBinder in Context.getSystemService, having a dedicated getter for the NetworkStack AIDL interface instead. Test: atest FrameworksNetTests NetworkStackTests Bug: 151243982 Change-Id: Ibeaeff5890631e14581a084863d9aeb3178c5d5c
2020-02-20Add ModuleNetworkStackClientRemi NGUYEN VAN
NetworkStackClientBase / ModuleNetworkStackClient extract functionality from NetworkStackClient in services.jar, only keeping what is needed for modules to communicate with the NetworkStack, and not the framework code that starts the NetworkStack (and uses hidden APIs). As the NetworkStack is started asynchronously, it is possible for it not to be registered yet right after boot, so some polling is implemented to queue requests until it is ready. NetworkStackClient will inherit from NetworkStackClientBase so that components in services.jar can access the NetworkStack, using the same asynchronous mechanism as before (execute pending requests once the service is connected). Bug: 147255753 Test: atest NetworkStackTests NetworkStackNextTests FrameworksNetTests Change-Id: I130aabb3992280d875e0d20b16bc09a9e0261fda
2020-02-18Revert "Revert "Add DhcpLeaseCallbacks""Lorenzo Colitti
This reverts commit e8fff42022f8c22e84d51bc093189d469bdd9af1. Bug: 135411507 Test: atest NetworkStackTests Change-Id: I0609301d7b37309a35c764a7551b0ca93b3faeee
2020-02-15Add CaptivePortalData fetching to NetworkMonitorRemi NGUYEN VAN
When a capport API URL is sent through notifyNetworkConnected or notifyLinkPropertiesChanged, NetworkMonitor will (re)evaluate to fetch the data, and report it back via notifyCaptivePortalDataChanged. Test: atest NetworkStackTests NetworkStackNextTests Bug: 139269711 Change-Id: I101e2b2799d399fa7b560bf5ea3d86dac7ba1be9
2020-02-14Add shims for network info classesRemi NGUYEN VAN
Combine shims for LinkProperties and NetworkCapabilities to avoid too many shim classes, and use static methods as the original types (and not the shims) would generally be used to reference the classes. CaptivePortalData is not available in API29 so CaptivePortalDataShim is used as a wrapper that can hold a reference to it in common code. Sample usage in NetworkMonitor: final CaptivePortalDataShim data; try { data = CaptivePortalDataShimImpl.fromJSON(obj); } catch (UnsupportedApiLevelException | JSONException e) { // Do some fallback return; } // Just to give an idea if (data.isCaptive()) { openCaptivePortalApp(data.getUserPortalUrl()); } data.notifyChanged(mCallbacks); Test: atest NetworkStackTests NetworkStackNextTests Bug: 139269711 Change-Id: I262aaa41013ebe1ec4263a6516bd8cab76509304
2020-02-13Merge "Revert "Add DhcpLeaseCallbacks""Treehugger Robot
2020-02-13Revert "Add DhcpLeaseCallbacks"Remi NGUYEN VAN
This reverts commit dc018dd943f0c11e0b9172dee0db0966871af20d. Reason for revert: crashes tethering: b/149458372 Bug: 149458372 Change-Id: I1fad8528443d8cc133f719aad042cb22d3a8e2a0
2020-02-13Merge "Add ScanResultInfo object in ProvisioningConfiguration parcel."Xiao Ma
2020-02-12Add DhcpLeaseCallbacksRemi NGUYEN VAN
The callbacks will be used by Tethering to provide callbacks when DHCP leases are updated. The current design only supports one client as Tethering may want to send callbacks to multiple callers, but DhcpServer is only owned by Tethering. Bug: 135411507 Test: atest NetworkStackTests Change-Id: I1e44221d6fbd1b1f2d0d0057a29c7445af1cdbcf
2020-02-10Add ScanResultInfo object in ProvisioningConfiguration parcel.Xiao Ma
Since wifi.ScanResult doesn't implement specific equals() yet, for comparing the ProvisioningConfiguration object better, this change encapuslates ScanResult#SSID and ScanResult#InformationElement member into a new class: ScanResultInfo inside ProvisioningConfiguration. Adding ScanResultInfo object in ProvisioningConfiguration parcelable is to check the InformationElement filed when starting IpClient and detect whether or not the specific OUI is included in the IEs. Bug: 137835398 Test: atest FrameworksNetTests NetworkStackTests NetworkStackNextTests Change-Id: I247ac7f343ef3e99b64b93b45549e2a25980a407
2020-02-05Define callback for suspected data stall.Cody Kesting
Currently, NetworkStack does not notify ConnectivityService explicitly when it detects a potential data stall. This adds a new method notifyDataStallSuspected() to INetworkMonitorCallbacks for notifying ConnectivityService. ConstantsShim is defined for using constants from the Android platform that are introduced after the NetworkStack mainline module was defined. Bug: 143187964 Test: compiles Test: atest NetworkStackTests Change-Id: Ie3b5b4e71e4a4b15a5a84f761eaead3acf6fc807 Merged-In: Ie3b5b4e71e4a4b15a5a84f761eaead3acf6fc807
2020-02-05Define callback for network tested with extras.Cody Kesting
A new callback function is defined in INetworkMonitorCallbacks for alerting ConnectivityService of a network test result along with a PersistableBundle of extras. Bug: 143187964 Test: compiles Test: atest NetworkStackTests Change-Id: Id07eda28f970e5423b323072d0639e77c8e6bd2e Merged-In: Id07eda28f970e5423b323072d0639e77c8e6bd2e
2020-01-29Add implementation of getInterfaceHash()Paul Trautrim
Exempt-From-Owner-Approval: cherry-pick from internal Bug: 136065010 Test: m Change-Id: Iaf682c850b7cf22980d6fb88d3d60e24c189b74c Merged-In: Iaf682c850b7cf22980d6fb88d3d60e24c189b74c
2019-12-04Add DHCP Rapid Commit FILS support.Xiao Ma
Bug: 140223017 Test: atest FrameworksNetTests NetworkStackTests Test: atest NetworkStackIntegrationTests Test: manual Change-Id: Ibf200891c9742825a599a21b43f02927869f98ab
2019-10-22Send the probe status from NetworkMonitor to ConnectivityServicelucaslin
Provide a new callback for NetworkMonitor to notify ConnectivityService that which probes are completed. Bug: 113242081 Test: atest NetworkStackTests Change-Id: I81f22002bc9a59c7c49d471e15e67722613d61a3
2019-09-05Move NetworkStackClient lib to NetworkStack folderRemi NGUYEN VAN
The AIDLs and ipmemorystore-client were already statically linked libraries, so their location in the source tree does not change anything (they were already built into the NetworkStack module and the framework). It makes more sense to have them in the NetworkStack module folder however, as changes to these files will be released with the same cadence as the module, not the framework. This CL creates a new directory and well-defined static library for the AIDL interface with the NetworkStack, and Java classes used as the interface Bug: 139106271 Test: built, flashed, WiFi working Test: atest FrameworksNetTests FrameworksWifiTests NetworkStackTests Change-Id: I821b476411287b5cbdf09c82e07bd9ed4889f60d