639 Commits

Author SHA1 Message Date
chenbruce
5d95562622 Set transport types to resolver
For a given network, resolver doesn't know what transport types are.
Therefore, when a new network is created or transport types are changed
in a give network, transport types will be updated and sent by calling
setResolverConfiguration(). In the same time, if link properties or
transport types are null, setResolverConfiguration() won't be called.
The original behaviors of setResolverConfiguration() aren't changed.
Only increasing one new behavior that when a given network has transport
type change, calling setResolverConfiguration() directly and resolver
updates the transport types for that given network.

Bug: 143732914
Test: atest FrameworksNetTests
      atest FrameworksNetIntegrationTests
Change-Id: I6527cde0e177ba08c886576131b35fc769c2bb53
2020-04-11 14:39:59 +08:00
Luke Huang
76fc58e1f1 Use the lastest frozen netd_aidl_interface in framework
Bug: 140541991
Test: build
Merged-In: I984969e09f8d5196945a7412c51bd8880223ad9e
Change-Id: I984969e09f8d5196945a7412c51bd8880223ad9e
2020-04-09 16:20:44 +00:00
Xiao Ma
048839c02e Add new method to update Layer2 information when L2 roaming happens.
Bug: 131797393
Test: atest FrameworksNetTests

Merged-In: I171bd5e22b5afd5c62029392af627d7bdfe32161
(cherry picked from commit 1083b27f7c30d6ccfd8a6f4402788b4b4789ef60)

Change-Id: I23019658acfec18d342d38e8c189dcfaeb7b6f4a
2020-04-02 10:15:29 +00:00
Aaron Huang
8745384d71 API review: access field by method
- 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
Change-Id: Id01e6135193716cc21bba11da529bf1507a954f7
2020-03-19 11:38:24 +08:00
Roshan Pius
b6361f9490 services.net: Add a static library needed by wifi module
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.
b) Add jar-jar rules for all the statically linked dependencies in wifi
service jar rules.

Exempt-From-Owner-Approval: Minor change on top of owner's approval.
Bug: 145825329
Test: Device boots up & connects to wifi networks.
Change-Id: Ifde69b579cfe5b813766f676acb10e436e64a44c
2020-03-13 14:42:09 +00:00
Roshan Pius
86a84576b5 services.net: Use the new ModuleNetworkStackClient
Use the new ModuleNetworkStackClient to retrieve instances IpMemoryStore
& IpClient.

Bug: 145825329
Test: Compiles
Change-Id: I065525fdbd64b9509ef0f47bb35954d267c65fd2
2020-03-12 18:26:13 -07:00
Paul Trautrim
af2e082e43 Add implementation of getInterfaceHash()
Bug: 136065010
Test: m
Change-Id: I314f19aeca82cc8653eab71c9526ea7a208e6b50
2020-01-28 10:33:11 +09:00
Remi NGUYEN VAN
0e4d731bbc Merge "Delete NetworkFactory from frameworks/base/core." 2020-01-22 08:06:32 +00:00
Lorenzo Colitti
a0d43919ba Delete NetworkFactory from frameworks/base/core.
It is being moved to frameworks/libs/net.

Test: builds
Test: atest FrameworksNetTests
Test: atest FrameworksWifiTests
Test: atest FrameworksTelephonyTests
Bug: 138306002
Bug: 139268426
Change-Id: I4eec40bed93679a029a20d38c114b1dbc80aa12e
2020-01-15 20:57:54 +09:00
markchien
6aa796135c Tethering: remove redundant source code
Bug: 143195885
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: I92cbb51a0d4fb048aa75ba9932e3b106d181bad9
2020-01-15 04:33:10 +00:00
Treehugger Robot
7595e62842 Merge "Add IpClientCallbacks.onNewDhcpResults(DhcpResultsParcelable)" 2020-01-10 14:28:28 +00:00
Aaron Huang
b7d665988d Merge "Add keepalive related methods and fields to system APIs" 2020-01-10 06:16:04 +00:00
Chiachang Wang
570260393a Add IpClientCallbacks.onNewDhcpResults(DhcpResultsParcelable)
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
2020-01-10 03:46:50 +00:00
Treehugger Robot
99d091ee81 Merge "Add services-stubs for in-process APIs in services.jar" 2019-12-22 01:38:33 +00:00
markchien
6d06f6d51a [Tether13] Move TetheringManager into framework
Move tethering out of ConnectivityService. All client would
use TetheringManager to talk with TetheringService directly.

Bug: 144320246
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
Merged-In: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
2019-12-19 20:53:06 +08:00
Aaron Huang
08d9ade8e2 Add keepalive related methods and fields to system APIs
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-17 16:21:19 +00:00
Jiyong Park
759a269a65 Add services-stubs for in-process APIs in services.jar
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-17 14:20:15 +09:00
Jiyong Park
e86e89acff Add filegroups for services.* libraries
... in preparation for creating a stub library from services.jar

Bug: 139391334
Test: m

Exempt-From-Owner-Approval: cherry-pick from internal

Merged-In: Ifd6cfc77acf2284804a2f64011c2733b5c222369
(cherry picked from commit bae2e907966dce0cb3eaf3e3a81cca4364b7d941)
Change-Id: Ifd6cfc77acf2284804a2f64011c2733b5c222369
2019-12-11 15:55:33 +09:00
Xiao Ma
488c2b03d7 Merge "Add DHCP Rapid Commit FILS support." 2019-12-05 02:13:02 +00:00
Xiao Ma
9484e48ea4 Add DHCP Rapid Commit FILS support.
Bug: 140223017
Test: atest FrameworksNetTests NetworkStackTests
Test: atest NetworkStackIntegrationTests
Test: manual

Change-Id: Ia73e92058f30acee16eff27e05ec53d2eb0e7110
2019-12-03 21:44:34 +09:00
markchien
6b828d2915 [Tether07] Migrate Tethering into module
am: 0df2ebc43d

Change-Id: I1aaa034e91eae2d6e9abcbbd70741a54a18b3ddc
2019-11-30 04:25:57 -08:00
markchien
0df2ebc43d [Tether07] Migrate Tethering into module
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-30 10:03:08 +00:00
Remi NGUYEN VAN
8a72e3d3b4 Merge "Move shared packages to NetworkStack project"
am: 27253f29ad

Change-Id: I17068de9e9b4388b8ec025ce3e1dc722e471ccbb
2019-11-21 23:15:29 -08:00
Remi NGUYEN VAN
27253f29ad Merge "Move shared packages to NetworkStack project" 2019-11-22 06:50:22 +00:00
Remi NGUYEN VAN
882d8b31bc Move shared packages to NetworkStack project
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-20 17:01:25 +09:00
Roshan Pius
e8ba3232b7 Merge "NetworkStackClient: Use @SystemApi alternative for isSameApp"
am: 6a612863e6

Change-Id: Ib2cea3e218fdee4ebe054912465b4a1f575b3dd2
2019-11-19 15:18:58 -08:00
Roshan Pius
f1259565f4 NetworkStackClient: Use @SystemApi alternative for isSameApp
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-11-18 07:41:10 -08:00
Mark Chien
3bb2eae1b8 Merge "[Tether06] Migrate tether offload controller into module"
am: 5d6eea1bc5

Change-Id: I612e98f03127253a07709312626875c339c08c8c
2019-11-05 05:12:11 -08:00
markchien
77c17be6f3 [Tether06] Migrate tether offload controller into module
The tether offload JNI library in this patch still have many dependencies
with internal libraries. Will have follow up changes to cut the
dependencies to let it be a unbundled library.

Bug: 136040414
Test: -build, flash, boot
      -atest TetheringTests
      -atest FrameworksNetTests

Change-Id: Iacf8e0b94135e35672de3ee77c474ee39a00c591
2019-11-05 12:49:50 +09:00
TreeHugger Robot
abc015499a Merge "DO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into stage-aosp-master" into stage-aosp-master 2019-10-31 18:38:40 +00:00
Mark Chien
259fdbb0b3 Merge "[Tether05] Migrate UpstreamNetworkMonitor into module" 2019-10-31 13:05:32 +00:00
Mark Chien
47db7adcca Merge "[Tether04] Migrate EntitlementManager into module" 2019-10-31 07:33:21 +00:00
Xin Li
6f48900f50 DO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into stage-aosp-master
Bug: 142003500
Change-Id: If5056a73ede668b0048ca107b686413695e5b3b6
2019-10-30 14:33:01 -07:00
markchien
d020e55723 [Tether05] Migrate UpstreamNetworkMonitor into module
Bug: 136040414
Test: -build, flash, boot
      -atest TetheringTests
      -atest FrameworksNetTests

Change-Id: Ic1d9deecb66aaba0a4264a57f2e6579ea491ac9b
2019-10-30 12:42:42 +00:00
markchien
f303c5a881 [Tether04] Migrate EntitlementManager into module
Bug: 136040414
Test: -build, flash, boot
      -atest TetheringTests
      -atest FrameworksNetTests

Change-Id: Ifdfc6cd95377351c37946a146b60896f07ece59d
Merged-In: Ifdfc6cd95377351c37946a146b60896f07ece59d
2019-10-30 11:06:28 +00:00
Jeongik Cha
cc0b57ca06 Change AIDL module name
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: Ib38e2cb114cc373ef50652f421ddaff9b4fbe5b9
Merged-In: Ib38e2cb114cc373ef50652f421ddaff9b4fbe5b9
2019-10-29 16:01:18 +09:00
Mark Chien
634c6a512f Merge "[Tether03] Migrate IpServer into module" 2019-10-25 06:41:49 +00:00
Mark Chien
72d5460dda Merge "[Tether02] Migrate TetheringConfiguration into module" 2019-10-24 13:10:24 +00:00
Mark Chien
8c26c38984 Merge "[Tether01] Add Tethering App" 2019-10-24 13:10:04 +00:00
Chiachang Wang
0825500b27 Merge "Extend netlink class to fit the data structure" 2019-10-24 07:31:53 +00:00
markchien
08cc03051a [Tether03] Migrate IpServer into module
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-24 14:20:52 +08:00
markchien
a6ba54d59d [Tether02] Migrate TetheringConfiguration into module
TetheringConfiguration is a utility class to encapsulate the various
configuration elements.

Bug: 136040414
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: I9434ab213bc5e0fca59f14a6c8cea554abefc3a4
2019-10-24 14:00:05 +08:00
markchien
017fef23a0 [Tether01] Add Tethering App
This is initial patch that don't contain any service for now.

Bug: 136040414
Test: -build, flash, boot
Change-Id: I0b49d7e9c3fcba5af3025163f9cc9eafb0778116
2019-10-24 13:35:41 +08:00
Chiachang Wang
5d62167efc Extend netlink class to fit the data structure
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-23 21:52:36 +09:00
Jimmy Chen
8a9a9adaeb Merge "p2p: mirgrate p2p into tethering modes" 2019-10-18 05:42:31 +00:00
Jimmy Chen
bcd86d0c9b p2p: mirgrate p2p into tethering modes
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-10-08 14:37:19 +08:00
Jeffrey Vander Stoep
48547ce1d0 Merge "Fix FD leak in ConnectivityManager.getConnectionOwnerUid" am: 20bdc26698
am: 0b6d974713

Change-Id: I5d3b329018a1f640f086887ec222c5cf7e2975b4
2019-09-30 12:49:49 -07:00
Jeff Vander Stoep
59940afb16 Fix FD leak in ConnectivityManager.getConnectionOwnerUid
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-30 12:46:03 +02:00
Remi NGUYEN VAN
94b247370a Merge "Move NetworkStack AIDLs to NetworkStack folder" am: 1c3acc8f8a
am: 7569988e6f

Change-Id: Icbddddc52bfe2913b3c980d42f47cd885b5b3587
2019-09-24 19:25:21 -07:00
Remi NGUYEN VAN
ee27a94773 Move NetworkStack AIDLs to NetworkStack folder
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-05 17:55:48 +09:00