summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2020-03-18Add hashes for AIDL APIsPaul Trautrim
All frozen AIDL APIs are required to have a hash, and these are checked for accuracy at build time. This ensures that these interfaces aren't changed, since we are relying on their stability over time. Bug: 149952131 Bug: 150154330 Test: m Exempt-From-Owner-Approval: cherry-pick from aosp Merged-In: I42ee68bcbb320ea2531144f81292675528b3038c Change-Id: I382806d428c670470cc2474af24e796c423e94f8
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-03-04Freeze networkstack and ipmemorystore stable AIDL to version 5.Xiao Ma
Bug: 140223017 Test: atest NetworkStackTests NetworkStackIntegrationTests Merged-In: I1e74864a51f7d2c5c5cb59427cdcfa3e6d22f5a5 (cherry picked from commit d762752abcbe3685796001e3f68b15de2d8eaec8) Change-Id: Idb488032099c6c9fb6b67db12b50eb1eb884e394
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-19Add a hasMacAddress member to InterfaceParams.Lorenzo Colitti
This is a convenience function for callers who would like to know whether the interface has a MAC address. It is needed because the constructed object will have a MAC address of 02:00:00:00:00:00 if the interface did not have a MAC address. Test: added minimal unit test coverage Change-Id: I422422d032afbbabcf8594def76702bb053f0a96
2020-02-18Allow tethering to use IpNeighborMonitor.Lorenzo Colitti
Test: m Change-Id: I4ca0c47d62ea90c30f88278b3ebf766be2c5a2e9
2020-02-18Revert "Revert "Add DhcpLeaseCallbacks""Lorenzo Colitti
This reverts commit e8fff42022f8c22e84d51bc093189d469bdd9af1. Bug: 135411507 Test: atest NetworkStackTests Change-Id: I0609301d7b37309a35c764a7551b0ca93b3faeee
2020-02-17Merge "Reorganize NetworkStack common srcs"Lorenzo Colitti
2020-02-17Reorganize NetworkStack common srcsRemi NGUYEN VAN
This specifies the exact set of files in NetworkStack that are used in frameworks/base/services/net. It will allow us to add other files to the directory without exposing them to services/net (which would make it harder to remove all services.net dependencies on NetworkStack). Test: m Change-Id: I6abee79523d04c0c3f9ed3e96b1dd9cb37dc4cc3
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
2020-01-08[Tether09] Add RouteUtils and NetdUtilsmarkchien
Add RouteUtils and NetdUtils file to NetworkStack module shared folder. And it would statically linked into framework and tethering module. Bug: 136040414 Test: -build, flash, boot -atest TetheringTest Change-Id: I8c2781597b410d12407ddb743f1621bf92d2a852
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-11-26Follow up commit of aosp/1157146Chiachang Wang
Address follow up actions and comments Bug: 130325409 Test: NetworkStackTests NetworkStackNextTests Change-Id: Ic768f08e5e54667e375c0d486df278773d9c707a
2019-11-26Remove netlinkclient dependency on shared-srcsRemi NGUYEN VAN
Usage of shared-srcs should be avoided as including shared sources in multiple build rules is inefficient and error-prone. (clean cherry-pick of internal change) Bug: 145146475 Test: m netlink-client FrameworksTelephonyTests Merged-In: I57b2e470d5ec70bfc354d016555c0bbfb9ffdbe4 Change-Id: I57b2e470d5ec70bfc354d016555c0bbfb9ffdbe4
2019-11-25Merge "Remove api_dir property"Treehugger Robot
2019-11-20Remove api_dir propertySundong Ahn
The api_dir property is removed, and the api dir path for aidl_interface is fixed to aidl_api/{module_name}. According to this rule, all api dirs are moved to aidl_api/{module_name}. Bug: 113134692 Test: m -j Change-Id: I0feb7b6c6b2ee8620e0e1b7c07c409a294e3a9d2 Merged-In: I0feb7b6c6b2ee8620e0e1b7c07c409a294e3a9d2 (cherry picked from commit d1dcab928d38d25736ffd7fa942c33d3757daac9)
2019-11-20Move shared packages to NetworkStack projectRemi NGUYEN VAN
Both were already statically linked both in the NetworkStack module and the framework, so this change only reorganizes the file locations. It makes more sense to have the library files in the NetworkStack module folder, as changes to these files will be released with the same cadence as the module, not the framework. Bug: 139106271 Test: built, flashed, WiFi working Change-Id: Ibcf9967ebb837e7f3c012a5dd7bf8917344e2ee5
2019-11-12Freeze NetworkStack AIDLs to v4Remi NGUYEN VAN
V4 corresponds to the M-2020-01 release. Bug: 144317572 Test: m NetworkStack NetworkStackNext Change-Id: I3a4d14c44fe6497d4501893ec1c2f05c39584323
2019-10-29Change AIDL module nameJeongik Cha
Naming rule for aidl module is changed to make using unstable AIDL module more explicit So, to use unstable version AIDL module, use "-unstable" suffix version And also, module name without any suffix means latest frozen version. But wrt modules for C++ and NDK, module name with latest frozen version is not available for now. In b/139280289, more background is explained Test: m Bug: 139280289 Change-Id: Idbfe29d16524bb6b0888f9a8db69deabfafb336e Merged-In: Idbfe29d16524bb6b0888f9a8db69deabfafb336e
2019-10-28Compile NetworkStackApiStable as system_29Remi NGUYEN VAN
Also slightly change the structure of shims so that the compat version uses a different package (com.android.networkstack.apishim.api29), which is jarjared to the main package name on API stable builds. On API current builds, the shim falls back to the compat version if Build.VERSION is older, or uses the main package otherwise. Jarjar requires using a java_library instead of a filegroup, so the shims build targets are converted to java_libraries. This allows the API current build to be usable on older devices, since it will automatically fall back to the compat APIs. When the new SDK is finalized, the API current build can then be shipped without code modification. The code also looks better in IDEs as there are no package conflicts. If there are several versions of the same shim depending on the API level (so different implementations for different methods in SocketUtilsShimImpl depending on the API level), having the shim extend the previous version shim allows to add methods with compatibility behavior without re-implementing the whole class. Test: m NetworkStack NetworkStackApiStable Test: flashed, WiFi working Test: atest NetworkStackTests Change-Id: I86f28912b80b8396d6b9b2acd2e247651ba80289
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
2019-09-05Reorganize captiveportal-lib filesRemi NGUYEN VAN
The files were not in folders matching their package names. Also moved build rule to its own Android.bp. Test: m Change-Id: I82d058151ed5a4a5be81ec32cc905a66305b2bc2
2019-04-02Make CaptivePortalProbeSpec and CaptivePortalProbeResult as a librarypaulhu
These two classes were added to @SystemApi because they are used both by NetworkMonitor and CaptivePortalLogin. However it turns out they are not needed in the framework, so having them as a library sounds better. Change-Id: Iadf77ec5952b6da8812dc6d006a39bd4e93d2bd9 Fix: 129433264 Test: atest NetworkStackTests FrameworksNetTests