Instead of having a library in the classpath where the NetworkStack is
created by reflection on devices using the network stack in-process,
just bind to a version of the network stack service that runs in the
system process.
If the in-process version is installed it will be used, otherwise the
module is used with its own process.
Bug: 127908503
Test: blueline boots and has functional WiFi
Test: atest FrameworksNetTests NetworkStackTests
Test: svelte build boots and has functional WiFi
Change-Id: I7722b173e5686e0dbb9cfddcfb34344b0f4135d9
IPv6 link local is an automatically configured address. The routing should be
activated regardless of the DHCP service.
Bug: 126063997
Test: Unit tests - atest FrameworksNetTests
Test: Unit tests - atest FrameworksWifiTests
Test: * DUT1 enables hotspot
* DUT2 associates to DUT1
* use ping6 to verify the local link on both side
Test: * DUT1 creates a P2P group
* DUT2 joins this group as a legacy client
* use ping6 to verify the local link on both side
Change-Id: I102bf29e8da14808097e43c840d74d41b6b3758f
- connect, sendTo, bind were added as public API, so do not need to be
maintained as SystemApi in SocketUtils. These APIs were added in Q
timeframe.
- Add @Nullable/@NonNull annotations.
Bug: 126699304
Bug: 126477266
Test: booted, WiFi works
Change-Id: I3f086ac8952cfd6a4d8f861d2e1c7aa1ca8be999
[Prerequisites]
Default value of mRaLength is 0, so getNextMulticastTransmitDelaySec()
returns DAY_IN_SECONDS (1 day) in this scenario.
[Issue Details]
Examine MulticastTransmitter.run() for detail:
676 public void run() {
677 while (isSocketValid()) {
678 try {
679 Thread.sleep(getNextMulticastTransmitDelayMs());
Invoke RouterAdvertisementDaemon.stop() here. Since MulticastTransmitter
is in a sleep, this thread will pend 1 day until the next check of
isSocketValid() triggers the quit action, which causes thread leakage
during Wi-Fi Hotspot on/off stress test.
680 } catch (InterruptedException ignored) {
[Solution]
Invoke maybeNotifyMulticastTransmitter() after closing socket in
RouterAdvertisementDaemon.stop() to interrupt MulticastTransmitter from
waiting.
Bug: 123491872
Test: FrameworksNetTests
adb shell am instrument -w com.android.frameworks.tests.net
Test: CTS - CtsNetTestCases
ANDROID_BUILD_droid-cts/tools/cts-tradefed run cts -m CtsNetTestCases
Test: CTS - CtsNetTestCasesLegacyApi22
ANDROID_BUILD_droid-cts/tools/cts-tradefed run cts -m
CtsNetTestCasesLegacyApi22
Test: CTS - CtsNetTestCasesLegacyPermission22
ANDROID_BUILD_droid-cts/tools/cts-tradefed run cts -m
CtsNetTestCasesLegacyPermission22
Change-Id: I0c0d63b43a88e1026aaecfc1853309ad63f62268
The current logging relies on the system log that may rotate. This is a
problem to investigate bugs where the network stack service is not
started. Add a SharedLog to NetworkStackClient and dump it in
ConnectivityService (for lack of a better place to dump it).
Bug: 124307802
Test: Booted, dumpsys connectivity shows the log
Change-Id: If596451d0613645f68a8a32acb032eea76ea506c
The wrong overload of PackageManager is being called, setting
USER_SYSTEM as flag instead of the user to resolve the network stack
UID.
Test: phone boots, WiFi works, additional tests in child CLs
Change-Id: I89b11b38c390d0e77a5917c74daccccd74c2d0a3
Classes that are used in framework.jar cannot be linked in NetworkStack,
as the framework takes precedence in the classpath. This prevents the
networkstack from using these classes due to the hidden API usage
detection.
Do the following:
- jarjar any shared source file between framework and NetworkStack, so
the version in the NetworkStack uses a different package.
- Move any shared class not used in the NetworkStack to services.net
The CL uses jarjar on the app copy and not the framework classes, as
the framework cannot be updated without an OTA, and non-network stack
specific classes should not be renamed because of the network stack.
Test: atest FrameworksNetTests NetworkStackTests
Test: flashed svelte build, WiFi works
Bug: 124033493
Change-Id: I85d888b756adc28c36638913632bfdfdbf0e0486
NetworkStack is only used in services.net or clients of services.net. It
cannot stay in framework.jar because it needs to depend on AIDL
interfaces, which would conflict with app implementations if they were
in framework.jar.
Test: atest FrameworksNetTests NetworkStackTests
Bug: 124033493
Change-Id: Ib1d08a3669983640119d008db7e2990fa798724f
Merged-In: I501b125a388c1100c2182bde4670944c2f0d7a02
Includes various small changes to stop using hidden APIs
Test: make NetworkStack
Test: flashed, booted, WiFi and tethering working
Bug: 112869080
Change-Id: Id2830795a444f484b377ed6437435a1cd833697a
This reverts commit d8bc829a85.
Reason for revert: Refactoring was unnecessary
Merged-In: Ib4e7da3274e49f25676505a08e6ce7e7b0dfdb8d
Change-Id: Iff332c680315b560f0b762c1d7311ec83d539115
Includes @SystemApi for Context.NETD_SERVICE so system apps (including
the network stack) can obtain the service.
Test: m
Bug: 112869080
Change-Id: Ida63747cd30abb7b3c19559803353eb0e42e6efa
The wrapper was useful to help clients migrate out of the old API, but
all clients are now migrated.
It also conflicts with IpClient in the NetworkStack on Go devices.
Test: Flashed, booted, WiFI works
Bug: 123371264
Change-Id: Ibf04ad9371a07d2c66c478547539ba41c540116f
This will allow us to use network observers in the NetworkStack
app without duplicating too much code.
Bug: 112869080
Test: atest FrameworksNetTests
Test: builds, boots, wifi works
Change-Id: If54fa3a88110ffa815899d385dbb0d5770abaead
This avoids the need to expose ConnectivityService implementation
details as @SystemApi and the complexities that would be required
to make NetworkCapabilities parcelable in stable AIDL.
Bug: 112869080
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: Icd5d25b9b8e9b7a7d1899b000c92dc4976c3b3d7
The wrapper allows migrating clients of the IpClient in the NetworkStack
independently.
Test: atest FrameworksNetTests NetworkStackTests FrameworksWifiTests
Bug: 112869080
Change-Id: I1250730c07166298bee2816f05351ba95416994a
This helps remove the dependency on MultinetworkPolicyTracker from
IpClient.
Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: If56791dbed564772f25a859f301b8b52d84e38a3
- DhcpClient only shares its handler with IpClient, and NetworkMonitor
has its own handler: remove Protocol.BASE_DHCP,
Protocol.BASE_NETWORK_MONITOR
- Remove dependency on Network.netid in NetworkMonitor
- Remove dependency on Sets.newArraySet in DhcpServingParams
- Remove dependency on formatDuration() in DhcpClient
- Replace isMetered() with hasCapability() in NetworkMonitor
- Use WifiManager.isScanAlwaysAvailable instead of reading setting
Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: Ieef54d847ddc081fb33cbad0b050b06d2e52548e
Added methods are used by the NetworkStack.
Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: I8822d43c1a4981ca39289525685b3f975fb0e8d5
libcore.io.SizeOf is an internal API and is going away soon.
Note: The files touched by this CL have some other unused
imports which I did not touch. Therefore I had to use
"repo upload --no-verify" to upload this CL to gerrit.
Bug: 123174577
Test: Manually checked that this CL applies cleanly in internal
master and that no other uses of SizeOf then remain in
internal master's frameworks/base
Test: Treehugger
Change-Id: Ib29a195f3dda2f21ebbe2f7073e0af4dbb524b19
The API will be used to interact with IpClient once it is moved to the
NetworkStack process.
This change keeps compatibility with the previous API so that clients
can be migrated independently.
Test: atest FrameworksNetTests NetworkStackTests
Bug: b/112869080
Change-Id: I57d8164afae849230bbc0e25f17859c0b22d0f29
Introduce a stable AIDL parcel class, DhcpServingParamsParcel, and
methods to convert to and from that class to DhcpServingParams.
This will be used to move DhcpServer to the NetworkStack app.
Test: atest FrameworksNetTests
Bug: b/112869080
Change-Id: I276b7affccb938059769c90a53f0f6beb26e6ede