NetworkMonitor obtained LinkProperties and NetworkCapabilities via
synchronous calls to ConnectivityManager after receiving an asynchronous
notification, which is prone to races: the network could be gone before
the LinkProperties/NetworkCapabilities can be fetched.
Fix the race by passing LinkProperties/NetworkCapabilities directly to
NetworkMonitor in the asynchronous notifications.
Test: atest FrameworksNetTests NetworkStackTests
Test: booted, WiFi works
Bug: 129375892
Change-Id: I200ac7ca6ff79590b11c9be705f650c92fd3cb63
Globs are only intended to support ** as a directory, i.e. **/*.java
not **.java.
Bug: 129411151
Test: m nothing
Change-Id: I0f6cb7c7ce8cd1ef8c09364c0946ac7157285a4d
Remove StaticIpConfigurationParcelable and ApfCapabilitiesParcelable and
use StaticIpConfiguration and ApfCapabilities directly.
These two classes are SystemApi and defined in framework.jar, so no
stability guarantee is needed: the parceled and unparceled class will
always be the framework.jar version.
Bug: 126477266
Fixes: 126477266
Test: atest FrameworksNetTests NetworkStackTests
Test: flashed, booted, WiFi and captive portal works.
Change-Id: Iaf80ae23e003752cc6d2300700021931923b6533
Fill correct TOS/TTL value by fetching them from kernel with
getsockopt.
bug: 123967966
Test: -build, flash, boot
-atest FrameworksNetTests
Change-Id: I75b1be51040b4a381163958b4cddd27dbb22bac1
The framework cannot return URLs used by the updatable NetworkStack,
which may use configurable URLs, changing URLs, or mechanisms not
involving URLs to detect captive portals. NetworkMonitor has already
been using random fallback URLs for a while that do not match the value
returned by ConnectivityManager#getCaptivePortalServerUrl.
With this change, the default value returned by the framework is
configured in framework resources as
config_networkDefaultCaptivePortalServerUrl. NetworkMonitor behavior may
change as it is an updatable component, but the current URL is
configured in NetworkMonitor resources as
config_captive_portal_http_url.
Test: flashed, booted, WiFi and captive portal working
Test: ConnectivityManager#getCaptivePortalServerUrl returns correct
value.
Bug: 127908503
Change-Id: I371dedc5b22efa909d7fd58e1ebe9b8aaced9780
Nothing in the framework uses these, so there is no point in
having the build be in frameworks/base/Android.bp.
Fix: 128804404
Test: builds, boots
Test: atest FrameworksNetTests
Change-Id: I2e8c2ad9ea8bfcd3668a83e4c044de10389a8a22
1. Some API's argument/return value must be marked either
@NonNull or @Nullable.
2. Change some system APIs to public APIs.
3. Modify the method name
Bug: 126700123
Bug: 126702339
Bug: 126699682
Bug: 118296575
Bug: 126699216
Bug: 126699675
Bug: 126699429
Bug: 126699193
Bug: 123586045
Test: atest FrameworksNetTests
Change-Id: Iaa2832cdcf83758ed0fec81b954a0c63bc5a7bf6
Replace TcpSocketInfo with TcpKeepalivePacketDataParcelable
because their structures are very similar.
bug: 128882321
Test: -build, flash, boot
-FrameworksNetTests
Change-Id: Iafb4031a64ba4775a495c156e2c997d890c6b261
This class is not used in framework.jar, only in services.jar.
Move it out of the framework so framework.jar can stop depending
on the NetworkStack stable AIDL interfaces.
This should really under com.android.server as well, but that's
a cross-project change to be done in another CL.
Test: m
Bug: 128804404
Change-Id: Ib2805f7fcc516a5f6989c252365d1c95b8042703
Merged-In: Ib2805f7fcc516a5f6989c252365d1c95b8042703
With the @JavaOnlyStableParcelable annotation, Network can now be used
as-is as a framework parcelable.
Test: atest FrameworksNetTests NetworkStackTests
Bug: 126477266
Change-Id: I5d9695a31b3ac48d10edcf08ccd0c34375353b79
The new @JavaOnlyStableParcelable annotation allows using the framework
parcelables directly, which removes a lot of boilerplate.
Includes new copy constructors for IpPrefix and LinkAddress so they can
be copied easily as-is into parcelables.
Test: atest FrameworksNetTests
Test: booted, WiFi works
Bug: 126477266
Change-Id: Icac8afe498d0b5ebf9a0d0b9eceb14d64a29b381
The NetworkStack needs to be marked as start requested before any client
can use it from the system server, so it knows to queue requests until
it actually comes up.
This fixes a bug introduced in commit:
I93315ad31925bd436e21d1eabb21d5967e6aae60
where a client trying to use the network stack in the system server
before ActivityManager.systemReady() could block and eventually timeout,
resulting in a null INetworkStackConnector.
Test: booted, WiFi working
Bug: 128620654
Change-Id: Ieca2657373eba78195b387fb266fa0424fce8ada
Also removed emeritus accounts ek@ and silberst@ from various places.
A cleanup using 'include' would probably be in order...
Test: N/A
Change-Id: I575e60dd5e600e42d9571ce8e8d7661d30e99bfe
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
If included in framework.jar, the interfaces conflict with any app that
needs to depend on them, including the NetworkStack.
Bug: 124033493
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I2db9f87b7154130726d4700b241d55b041635d98
Merged-In: I0ecae20d514bf888f3a80331f19369ceb1c52aa3
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 d8bc829a85c9c9bb390e18b59ef1455b6d0b94ec.
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