summaryrefslogtreecommitdiff
path: root/services/net/java
AgeCommit message (Collapse)Author
2023-08-14Remove the duplicated RFC7421_PREFIX_LENGTH constants. Xiao Ma
The RFC7421_PREFIX_LENGTH has been moved to NetworkStackConstants which can be shared with modules, remove the duplicated one. Bug: 290885904 Test: TH Change-Id: Iac4c33bf442bf7fa7530e4f5d16b0b8db4a3211f
2022-07-06Remove SharedLog usage from NetworkStackClient Patrick Rohr
As was pointed out, SharedLog in NetworkStackClient (and ConnectivityModuleConnector) was only used for dump() functionality which is not called by anyone. This CL removes the unused dump() functions and removes SharedLog usage in favor of android.util.Log. Also cleaning up usage of Slog so only logWtf logs to the system log in both NetworkStackClient and ConnectivityModuleConnector. Test: m Bug: 235901424 Change-Id: Ia484ee825cd714fd8eb7704ca1d16acfbe2e7331 Merged-In: Ia484ee825cd714fd8eb7704ca1d16acfbe2e7331
2021-10-04Improve "Lost network stack" error message Remi NGUYEN VAN
The "Lost network stack" message often gets reported as suspected root cause of a crash, but it is actually just a side-effect of a crash of the network_stack process, which often was just killed together with the rest of the system. Clarify the error message, so that it is clear that the root cause should be visible earlier in logs. Bug: 198681439 Change-Id: Ieb79ace34170f8bd9ea847175199590998278d57 Test: m
2021-06-17Remove most of the NetworkStack dependencies on frameworks/base. Lorenzo Colitti
Most of these files are being moved to the networkstack-client library in packages/modules/NetworkStack, with the exception of DhcpResultsCompatUtil which is unused and is being deleted. Test: m Bug: 151052811 Change-Id: I72ec43987faf9138cd68dc47c6bf2abe8c67aa38
2021-06-17Apply ag/12775659 to IpClientManager. Lorenzo Colitti
ag/12775659 was merged only in internal gerrit and prevents us from moving or deleting IpClientManager in AOSP. Apply to IpClientManager the changes made in that CL. Test: m Bug: 155703208 Merged-In: I74cb958b68d55a647547aae21baff6ddc364859b Change-Id: I9e1f9bf5b28b87cfd40cf3abbf8bcd9abf46ecfe
2021-04-08Replace fields with getters in keepalive API Remi NGUYEN VAN
General guidance is to have getters in the API instead of fields. Fixes: 181014882 Test: m Change-Id: Id4bfc447701e8d0380163047779fbba043f17b6f
2020-12-14Use API TcpKeepalivePacketData in ClientModeImpl Remi NGUYEN VAN
Instead of statically linking against and jarjaring TcpKeepalivePacketData, use the new android.net.TcpKeepalivePacketData API for S. On R, build the KeepalivePacketDataParcelable from the base KeepalivePacketData class. The current ClientModeImpl code that uses a statically linked TcpKeepalivePacketData is actually broken, as since R the system_server has been sending a @hide android.net.TcpKeepalivePacketData, and ClientModeImpl was testing it against com.android.wifi.x.android.net.*. To fix this on R, this change rebuilds a TcpKeepalivePacketDataParcelable class from the packet data included in the base KeepalivePacketData class. Bug: 172789687 Test: atest ConnectivityManagerTest#testCreateTcpKeepalive See associated test change Change-Id: Ia32b4444dbf90306b2cfd37ec13d4ba4e90cd1e8
2020-12-14Add TcpKeepalivePacketData to SystemApi Remi NGUYEN VAN
This is consistent with NattKeepalivePacketData, which is also a subclass of KeepalivePacketData. TcpKeepalivePacketData is already used by the wifi module, but statically linked. Bug: 172789687 Test: m Change-Id: I6aee1ae205987521bea4a3838bbece279ffa0e37
2020-10-05Move IpUtils to frameworks/libs/net Remi NGUYEN VAN
The utility classes are useful for mainline modules and their tests, for example IpClientIntegrationTest. Bug: 168868607 Test: m && atest NetworkStaticLibTests Change-Id: If2b1613aa18a7990391e2d31cc2951ca93f1cf3c
2020-08-07Revert "Revert "Move Inet[4]AddressUtils to libs/net"" Chalard Jean
This patch is still needed and should go in now that the error is fixed. The patch was submitted into rvc-dev and is already in rvc-dev-plus-aosp (patch in in ag/11923559, revert skipped in ag/12072199). A follow-up will remove the unused services.net-module-wifi target. Test: originally tested in aosp/1324109 Test: m; manual: flashed, wifi and telephony working Test: atest NetworkStackCoverageTests Change-Id: I1074eedb0b0f156a1135e11210ec102de15ea674 Merged-In: Icd141a992c46290c74929785e261a1cd57bc001b
2020-07-02Revert "Move Inet[4]AddressUtils to libs/net" Chalard Jean
This reverts commit 57d68e3c55176083ba40947be8f335534d958006. Reason for revert: Breaks the build b/160390899 Merged-In: Icd141a992c46290c74929785e261a1cd57bc001b Change-Id: Ie10e66f61393602f17fbb61bf17230b176bf1f44
2020-07-02Move Inet[4]AddressUtils to libs/net Remi NGUYEN VAN
The classes should not be picked up from frameworks/base, as they are part of several mainline modules. Also refine comments in DhcpResults following feedback in previous change. (cherry-pick from internal branch skipping wifi classes; no other conflict) Bug: 151052811 Test: m; manual: flashed, wifi and telephony working Test: atest NetworkStackCoverageTests Merged-In: I7074651c6a2a7a6b11bcf13cc4bb03833d7d655f Change-Id: I7074651c6a2a7a6b11bcf13cc4bb03833d7d655f
2020-06-09Remove IpClientCallbacks dependency on DhcpResults Remi NGUYEN VAN
DhcpResults should only be used inside the NetworkStack: modules are expected to use DhcpResultsParcelable instead. Add a compat utility so current users of DhcpResults can do the conversion (wifi in AOSP in particular). The utility can be removed when changes to stop depending on DhcpResults are merged in AOSP. Bug: 149403767 Test: built, flashed, WiFi working Change-Id: I5b85c1a541ecdf9dd3e9403b9fb1c2b5aba98dd8
2020-03-31Merge "Add new method to update Layer2 information when L2 roaming happens." Xiao Ma
2020-03-24API review: access field by method Aaron Huang
- InvalidPacketException, public field should be a method so add getter to get error code. - KeepalivePacketData, public fields should be methods so add getter for fields. Bug: 151322799 Test: atest FrameworksNetTests atest FrameworksWifiTests atest FrameworksTelephonyTests: some failure in CarrierAppUtilsTest Copy from ag/10731108 Change-Id: Id01e6135193716cc21bba11da529bf1507a954f7 Merged-In: Id01e6135193716cc21bba11da529bf1507a954f7
2020-03-16services.net: Add a static library needed by wifi module Roshan Pius
Add a new static library that compiles against system_current which includes all the parts needed by the wifi mainline module. Also, a) Refactored TcpKeepalivePacketData to use public APIs. The parcel read/write methods in the base class are @hide and they're not used by the other child class (NatKeepalivePacketData). So, remove the @hide method from base class and use it direcly in the child class. Bug: 145825329 Test: Device boots up & connects to wifi networks. Change-Id: Ifde69b579cfe5b813766f676acb10e436e64a44c Merged-In: Ifde69b579cfe5b813766f676acb10e436e64a44c
2020-03-12services.net: Use the new ModuleNetworkStackClient Roshan Pius
Use the new ModuleNetworkStackClient to retrieve instances IpMemoryStore & IpClient. Bug: 145825329 Test: Compiles Change-Id: I065525fdbd64b9509ef0f47bb35954d267c65fd2 Merged-In: I065525fdbd64b9509ef0f47bb35954d267c65fd2
2020-03-05Add new method to update Layer2 information when L2 roaming happens. Xiao Ma
Bug: 131797393 Test: atest FrameworksNetTests Change-Id: I72f2752f73be9df693996c4b23115937c4bcadb3
2020-01-29Add implementation of getInterfaceHash() Paul Trautrim
Exempt-From-Owner-Approval: cherry-pick from internal Bug: 136065010 Test: m Change-Id: I314f19aeca82cc8653eab71c9526ea7a208e6b50 Merged-In: I314f19aeca82cc8653eab71c9526ea7a208e6b50
2020-01-10Merge "Add IpClientCallbacks.onNewDhcpResults(DhcpResultsParcelable)" Treehugger Robot
2020-01-10Merge "Add keepalive related methods and fields to system APIs" Aaron Huang
2020-01-10Add IpClientCallbacks.onNewDhcpResults(DhcpResultsParcelable) Chiachang Wang
Add new callback to replace old one. Target to remove onNewDhcpResults(Dhcpresults). The previous onNewDhcpResults callback will be removed after clients are migrated. Bug: 135998869 Test: build Test: atest FrameworksNetTests NetworkStackTests Change-Id: Id6c72228560dc3c387755c27adacaa9aece6309a
2019-12-17Add keepalive related methods and fields to system APIs Aaron Huang
Add KeepalivePacketData to system API for mainline support. Also, remove InvalidPacketException class from SocketKeepalive and create a new InvalidPacketException class in android.net Bug: 139268426 Bug: 135998869 Bug: 138306002 Test: atest FrameworksNetTests atest NetworkStackTests atest FrameworksTelephonyTests ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh atest android.net.cts atest android.net.wifi.cts atest android.telephony.cts Change-Id: I2d982e8abb5cb6b4c74a20483550b18cf814320d Merged-In: I2d982e8abb5cb6b4c74a20483550b18cf814320d
2019-12-17Add services-stubs for in-process APIs in services.jar Jiyong Park
services-stubs is a stubs library for services.jar. It provides the in-process APIs that's available inside the system server process running services.jar. Currently, all APIs in the jar are hidden by annotating com.android.server package with @android.annotation.Hide. To add some APIs, 1) remove package-info.java for com.android.server 2) add package-info.java for other sub packages 3) annotate them with @android.annotation.Hide except for the package where the newly added APIs are in This change also added android.annotation.Hide class which can be used to hide an API without using the @hide javadoc tag. This opens up the possibility of running metalava over the compiled jar, which is expected to be much faster than when ran with source files. Bug: 139391334 Test: m Test: m services-stubs Exempt-From-Owner-Approval: cherry-pick from internal Merged-In: I027b8a22b3e7533f6203aabb9dc3f690e4e842a6 (cherry picked from commit abc72e45c647d6f617ce90b7a5d4a3121c0aa87d) Change-Id: I027b8a22b3e7533f6203aabb9dc3f690e4e842a6
2019-12-05Merge "Add DHCP Rapid Commit FILS support." Xiao Ma
2019-12-03Add DHCP Rapid Commit FILS support. Xiao Ma
Bug: 140223017 Test: atest FrameworksNetTests NetworkStackTests Test: atest NetworkStackIntegrationTests Test: manual Change-Id: Ia73e92058f30acee16eff27e05ec53d2eb0e7110
2019-11-30[Tether07] Migrate Tethering into module markchien
am: 0df2ebc43d Change-Id: I1aaa034e91eae2d6e9abcbbd70741a54a18b3ddc
2019-11-30[Tether07] Migrate Tethering into module markchien
Now tethering would be run in dedicated service. TetheringManager is the interface used to communicate with TetheringService. The new call flow would be: ConnectivityManager -> ConnectivityService -> TetheringManager -> TetheringService. Note: the return value of #tether(), #untether() and #setUsbTethering() APIs would always be no error. Client can use #getLastTetherError() or #getTetheredIfaces or listen tether state change to check status of corresponding interface. Bug: 136040414 Bug: 144742179 Test: -build, flash, boot -atest TetheringTests -atest FrameworksNetTests Change-Id: I7e78c0e0a3e70f940a749ba2a39ece7c7ec5b9b3 Merged-In: I7e78c0e0a3e70f940a749ba2a39ece7c7ec5b9b3
2019-11-21Merge "Move shared packages to NetworkStack project" Remi NGUYEN VAN
am: 27253f29ad Change-Id: I17068de9e9b4388b8ec025ce3e1dc722e471ccbb
2019-11-22Merge "Move shared packages to NetworkStack project" Remi NGUYEN VAN
2019-11-20Move shared packages to NetworkStack project Remi 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: Ifaa882b53d1084ef32db6b27d35b56eb226c468f
2019-11-19Merge "NetworkStackClient: Use @SystemApi alternative for isSameApp" Roshan Pius
am: 6a612863e6 Change-Id: Ib2cea3e218fdee4ebe054912465b4a1f575b3dd2
2019-11-18NetworkStackClient: Use @SystemApi alternative for isSameApp Roshan Pius
This introduces an @hide dependency on the wifi stack which is statically linking services.net library. Bug: 142935310 Test: Compiles Change-Id: I0040df6b3392fc68e950364092ed07cf5dc5a00e (cherry-picked from e1a2455d503917d080038b0e714beb7b3506cbd7)
2019-10-31Merge "DO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into ↵ TreeHugger Robot
stage-aosp-master" into stage-aosp-master
2019-10-31Merge "[Tether05] Migrate UpstreamNetworkMonitor into module" Mark Chien
2019-10-30DO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into ↵ Xin Li
stage-aosp-master Bug: 142003500 Change-Id: If5056a73ede668b0048ca107b686413695e5b3b6
2019-10-30[Tether05] Migrate UpstreamNetworkMonitor into module markchien
Bug: 136040414 Test: -build, flash, boot -atest TetheringTests -atest FrameworksNetTests Change-Id: Ic1d9deecb66aaba0a4264a57f2e6579ea491ac9b
2019-10-25Merge "[Tether03] Migrate IpServer into module" Mark Chien
2019-10-24Merge "Extend netlink class to fit the data structure" Chiachang Wang
2019-10-24[Tether03] Migrate IpServer into module markchien
Add IpServer which is used to serve ip configuration, dhcp, dns proxy and nat for downstream interface. Bug: 136040414 Test: -build, flash, boot -atest TetheringTests -atest FrameworksNetTests Change-Id: I23652ae0b9509abe7d38da96d523eb22ab00a343
2019-10-23Extend netlink class to fit the data structure Chiachang Wang
In order to get the tcp_info via netlink socket from kernel, NetworkStack needs to use netlink class to pack and parse the InetDiagReq. Current design hardcodes ididag_ext field in InetDiagReqV2. The structure is also not allowed to take null id to not to specify certain socket. Update the constructor and backward support exising constructor. Bug: 136162280 Test: atest FrameworksNetTests NetworkStackTests Change-Id: Id66da1797da183ae3d99073f80bad1df929946dc
2019-10-18Merge "p2p: mirgrate p2p into tethering modes" Jimmy Chen
2019-10-08p2p: mirgrate p2p into tethering modes Jimmy Chen
Bug: 137602441 Bug: 139783330 Test: atest FrameworksNetTests Test: atest FrameworksWifiTests Test: CtsVerifier - Wi-Fi Direct Test: Enable hotspot when P2P GO is running * P2P GO is terminated * hotspot is running Test: Enable P2P GO when hotspot is running * hotspot is intact * P2P GO could not be launched Test: Verify P2P functions with legacy WifiP2pService Change-Id: Icb2e2b106ae52b19af29b7a1ebc55d3cdf80db9c
2019-09-30Merge "Fix FD leak in ConnectivityManager.getConnectionOwnerUid" am: 20bdc26698 Jeffrey Vander Stoep
am: 0b6d974713 Change-Id: I5d3b329018a1f640f086887ec222c5cf7e2975b4
2019-09-30Fix FD leak in ConnectivityManager.getConnectionOwnerUid Jeff Vander Stoep
Add unit tests to verify that bug has been fixed. Re-enable testGetConnectionOwnerUid() unit tests in presubmit. These were disabled due to test flakiness caused by expected failures passing as a result of other sockets on the system. This is fixed by checking that failures do not have the UID of the calling process instead of INVALID_UID since previously some Qualcomm telephony sockets were causing lookup successes. Test: atest InetDiagSocketTest#testGetConnectionOwnerUid Test: ls -1 /proc/<pid of system_server>/fd | wca Test: atest --generate-new-metrics 200 InetDiagSocketTest#testGetConnectionOwnerUid To verify flakes have been cleaned up. Bug: 141603906 Bug: 141459241 Change-Id: Ib76674f10e4bd24952c557bac7b9c65fba42fdb2
2019-09-24Merge "Move NetworkStack AIDLs to NetworkStack folder" am: 1c3acc8f8a Remi NGUYEN VAN
am: 7569988e6f Change-Id: Icbddddc52bfe2913b3c980d42f47cd885b5b3587
2019-09-05Move NetworkStack AIDLs to NetworkStack folder Remi 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. Bug: 139106271 Test: built, flashed, WiFi working Change-Id: I886acae850a5e8a9a7bc3ca8aac8690d681ca2cd
2019-09-01Merge "Refactor Module connectors for testing" am: 288c75d055 Remi NGUYEN VAN
am: c8cc5781e0 Change-Id: I3ad283828d42e88354f5a25eb47cbb6b66ae6236
2019-08-30Refactor Module connectors for testing Remi NGUYEN VAN
Move getModuleServiceIntent to a dependencies object to allow clients to create test versions of the class that return test intents and avoid the permissions checks. Refactor dependencies in NetworkStackClient in a dependencies object for the same test purposes. Test: manual: built, booted, WiFi working Change-Id: I9b115f4cd26f36eee5c669226ea6296b8d7d2d06
2019-08-28Fix spacing in NetworkStackClient Remi NGUYEN VAN
This makes the file match other branches, which should eliminate merge conflicts. Test: m Merged-In: I673581b0067b9a3f72dd68a3ab622c18183ebd2e Change-Id: Ida685159cb4afd6eceac6941e7126886518c8570