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
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
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)
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
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
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
TetheringConfiguration is a utility class to encapsulate the various
configuration elements.
Bug: 136040414
Test: -build, flash, boot
-atest TetheringTests
Change-Id: I9434ab213bc5e0fca59f14a6c8cea554abefc3a4
This is initial patch that don't contain any service for now.
Bug: 136040414
Test: -build, flash, boot
Change-Id: I0b49d7e9c3fcba5af3025163f9cc9eafb0778116
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
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
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
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
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
This makes the file match other branches, which should eliminate merge
conflicts.
Test: m
Merged-In: I673581b0067b9a3f72dd68a3ab622c18183ebd2e
Change-Id: Ida685159cb4afd6eceac6941e7126886518c8570
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
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)
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
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
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)