621 Commits

Author SHA1 Message Date
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
Remi NGUYEN VAN
de500155f1 Merge "Refactor Module connectors for testing" am: 288c75d055
am: c8cc5781e0

Change-Id: I3ad283828d42e88354f5a25eb47cbb6b66ae6236
2019-09-01 21:12:26 -07:00
Treehugger Robot
288c75d055 Merge "Refactor Module connectors for testing" 2019-09-02 03:41:32 +00:00
Remi NGUYEN VAN
91e39d9a45 Refactor Module connectors for testing
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-30 15:15:34 +09:00
Luke Huang
f03f803aaf Merge "Support enable/disable dns forwarding of dnsmasq when start tethering" am: 6fecb94292
am: a3ddee80fd

Change-Id: If5a280508dcc95df911d1d72671857a8c58bbbd4
2019-08-28 06:18:40 -07:00
Luke Huang
6fecb94292 Merge "Support enable/disable dns forwarding of dnsmasq when start tethering" 2019-08-28 12:53:16 +00:00
Remi NGUYEN VAN
341c0f026a Fix spacing in NetworkStackClient
This makes the file match other branches, which should eliminate merge
conflicts.

Test: m
Merged-In: I673581b0067b9a3f72dd68a3ab622c18183ebd2e
Change-Id: Ida685159cb4afd6eceac6941e7126886518c8570
2019-08-28 10:59:34 +09:00
Roshan Pius
15b5a03ef6 NetworkStackClient: Refactor network stack process interaction
Refactor NetworkStackClient class to move the module service binding &
network stack process death monitoring to a separate class. This class
will only instantiated in the SystemServer process.
The new class |SystemServerToNetworkStackConnector| will be used from
the client classes corresponding to each module running on the network
stack process (NetworkStackClient, WifiStackClient, etc)

This has 2 main advantages:
a) Reduces code duplication (Otherwise the various Client classes need
to replicate the service bindding & process death monitoring).
b) Central crash recovery for the network stack process (Otherwise the
various Client classes will trigger multiple recovery for a single
network stack process crash).

Bug: 135679762
Test: Device boots up & connects to wifi networks.
(cherry-picked from 7e6f5f5e080f2d2ae3ef0397c21bd666f5ce4d31 & applied
aosp/977048)

Change-Id: I673581b0067b9a3f72dd68a3ab622c18183ebd2e
Merged-In: I673581b0067b9a3f72dd68a3ab622c18183ebd2e
2019-08-23 10:40:07 -07:00
Roshan Pius
b51c428f41 NetworkStackClient: Refactor network stack process interaction
Refactor NetworkStackClient class to move the module service binding &
network stack process death monitoring to a separate class. This class
will only instantiated in the SystemServer process.
The new class |SystemServerToNetworkStackConnector| will be used from
the client classes corresponding to each module running on the network
stack process (NetworkStackClient, WifiStackClient, etc)

This has 2 main advantages:
a) Reduces code duplication (Otherwise the various Client classes need
to replicate the service bindding & process death monitoring).
b) Central crash recovery for the network stack process (Otherwise the
various Client classes will trigger multiple recovery for a single
network stack process crash).

Bug: 135679762
Test: Device boots up & connects to wifi networks.
Change-Id: I673581b0067b9a3f72dd68a3ab622c18183ebd2e
Merged-In: I673581b0067b9a3f72dd68a3ab622c18183ebd2e
(cherry picked from commit 7e6f5f5e080f2d2ae3ef0397c21bd666f5ce4d31)
2019-08-23 12:18:52 +09:00
Luke Huang
b0d52464f1 Support enable/disable dns forwarding of dnsmasq when start tethering
Bug: 128782815
Test: built, flashed, booted
Change-Id: Ic6ee985b42cbe77e8f2208fba62108604fc7bbcf
2019-08-20 20:42:13 +08:00
Remi NGUYEN VAN
5833474d58 Merge "Fix interfaceVersion in DhcpServerCallbacks"
am: e921001f2d

Change-Id: I5e917252cc3632a823d3912094066f96597da3ae
2019-08-08 06:02:06 -07:00
Remi NGUYEN VAN
5488c56b98 Fix interfaceVersion in DhcpServerCallbacks
The getInterfaceVersion method was missed when freezing the AIDL
interface version.
This causes Q devices to return 0 instead of 3 on this interface.

Bug: 139110717
Test: toggle tethering, dumpsys network_stack version
Change-Id: If587cc9ead4191b9c2ad2ae65473bd89e7c37b5c
2019-08-08 17:45:24 +09:00
Remi NGUYEN VAN
fe1ad3d0b8 Merge "Fix leak of DhcpServer on tethering stop error" am: 7e5a5a6983
am: 7afb36786c

Change-Id: Ie73481e8d91ce43e4939f8c31a9ce431e382c6d9
2019-06-25 01:33:52 -07:00
Remi NGUYEN VAN
6dcffa0c77 Fix leak of DhcpServer on tethering stop error
Tactical, minimal fix to make sure the DhcpServer is stopped when
disabling tethering. The current code may throw if the interface is gone
when calling mNMService.setInterfaceConfig() on teardown. Make sure DHCP
is stopped regardless of what happens.

A longer term fix will be to figure out the right flow to teardown the
interface and avoid errors on setInterfaceConfig().

Bug: 124520692
Test: Manual: no more socket leaked when stopping USB tethering
Change-Id: Ib87d89a2e5fdb64b8f3dfae48d82c970f3ae6161
2019-06-24 23:28:06 +09:00
Roshan Pius
beec6d629a Merge "NetworkStackClient: Allow modules with network_stack uid" am: 891422900d
am: e4b2d05705

Change-Id: I63c6ff6e0aa8255d45165fb1d607aa21f9934fcc
2019-06-18 21:31:08 -07:00
Roshan Pius
4c854cfb8e NetworkStackClient: Allow modules with network_stack uid
The wifi service will start running with network_stack uid, so allow
modules with the same uid to use the network stack interfaces.

Note: Only modules signed with the same certificate (same as network_stack
APK) can share the uid, so this is restricted to Google signed modules.

Bug: 113174748
Test: Local wifi stack testing
Change-Id: I83263770e5c17dd28e4423e46d82ac8067e98f3a
(Cherry-picked from 51e9edae314f5ef758fff0bf42e12325f8a55362)
2019-06-18 09:57:22 -07:00
Remi NGUYEN VAN
870c267b6c Merge changes I399d3e37,Ia3fdd80c,Iad90c7a4
* changes:
  Remove DeviceConfig usage from NetworkStackClient
  Simplify crash conditions in NetworkStackClient
  Proper handling of NetworkStack crash
2019-06-10 01:19:24 +00:00
Xiao Ma
590bf9a468 Merge "Fix the potential NullPointerException." am: 4b5c8e1076
am: e15f92e37f

Change-Id: Ie6b5c293b4ca17622674d5f735a9d62e04410088
2019-06-08 04:42:36 -07:00
Xiao Ma
4b5c8e1076 Merge "Fix the potential NullPointerException." 2019-06-08 11:21:44 +00:00