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)
The networkAttributesParcelable retrieved from IpMemoryStore might be
null, it might cause crash with NullPointerException when attepmting
to read from the field on a null object reference.
Bug: 122710829
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: Id7527199424e55f1e14836e81a5d1965d13013a2
DeviceConfig API is not yet submitted. Use Settings.Global instead, to
still allow writing tests against AOSP code (a test would try to use
adb shell device_config, and fallback to adb shell settings).
This is not merged anywhere else, the merged-in is here to ensure this
does not end up in branches that use DeviceConfig. This change should be
lost when AOSP is updated.
Test: flashed, force-crashed NetworkStack with different setting values:
observe rate-limited crash
Bug: 133725814
Merged-In: I423ca6ebb328f49b170baae0da9b8409a6429fcb
Change-Id: I399d3e37f1faaecb8a30428c1989fac8821379d8
Generated by re-freezing the API with the new aidl_interface code, and
replacing the previous API with the new files. This only adds comments.
Test: comments only, builds
Bug: 134452637
Change-Id: I6b3072e91170c97818c5fdb688d06fc612991ea1
Currently phone process fail to unparcel NattKeepalivePacketData
since it is not in framework. Moves NattKeepalivePacketData to
framework to make it can be utilized by telephony.
This change also removes the error feedback triggered by calling
add keepalive packet filter to an unsupported network agent. This
is misinterpreted by KeepaliveTracker that start keepalive is
failing.
Bug: 134048171
Test: 1. atest android.net.cts.ConnectivityManagerTest#testSocketKeepaliveLimitTelephony
2. atest android.net.cts.ConnectivityManagerTest
3. atest FrameworksNetTests
4. atest FrameworksTelephonyTests
Change-Id: If630d5b339aa722717258c721daa8ead8c431e2d
The previous model could have impact on boot time to read/write from/to
disk, and could potentially fail in some scenarios where the device does
full reboots instead of framework restarts.
The current design most simply avoids crashing in the first 30mins after
a full reboot, and optimistically checks the wall clock to rate-limit
the crashes to every 6h.
Test: manual as below, without IS_DEBUGGABLE condition
Test: Install new NetworkStack, force crash, observe rollback
Test: Set min_uptime_before_crash to 100, force crash, observe crash
Test: min_uptime_before_crash still 100, install new NetworkStack, force
crash: observe rollback (there was already a recent crash)
Test: Set min_crash_interval to 10, force crash: observe crash
Bug: 133725814
(Clean CP from I3fd5ba7047d7ac991cb62a7cab16a40f4ee731a3)
Merged-In: Ic6b2bb13b488f46cd4b8d87caa78342f622181c3
Change-Id: Ia3fdd80c85cde45452c8e9b877836dfa4204e83d
Instead of always crashing on userdebug builds, do the following on all
builds:
- If the device did not observe a NetworkStack crash in the last 6h
crash the system server. This is to handle spurious crashes of the
NetworkStack, so that the system can recover instead of staying
without connectivity.
- Otherwise, the device has had a recent crash. Notify the listeners
(watchdog listener to be added) that something is seriously wrong,
but do not crash to avoid bootlooping the device. This allows the
watchdog to do its job, and avoids bricking the device in
situations where the user could need to make emergency calls.
Bug: 133725814
Test: Killed the network stack, observe reboot of framework.
Test: Kill network stack again, observe nothing.
Test: Wipe data, install new network stack, kill it twice: rollback.
(with patch on top applied)
(Clean CP from If1fa00bed769eb60ca4832609006bdf15ceddb80)
Merged-In: Ic6b2bb13b488f46cd4b8d87caa78342f622181c3
Change-Id: Iad90c7a4e416257dfe63d215274866bb25cf3d85
Our stable AIDL interfaces need to use versioned build targets,
otherwise getVersion will always return 0, which makes it
impossible to support different components at different versions.
List generated with:
find . -name Android.bp -exec egrep \
-H "(netd|dnsresolver|ipmemorystore|networkstack).aidl.interface(s?)-(java|cpp)" {} \;
Bug: 133124190
Test: m
Change-Id: Id175c99daa77507847673777a8dcce51897ab17b
Currently, strict mode private DNS does not work on VPNs because
NetworkMonitor does not validate VPNs. When a VPN connects, it
immediately transitions to ValidatedState, skipping private DNS
hostname resolution.
This change makes NetworkMonitor perform private DNS hostname
resolution and evaluation even on VPNs.
In order to ensure that the system always immediately switches to
the VPN as soon as it connects, remove the unvalidated penalty
for VPN networks. This ensures that the VPN score is always 101
and the VPN always outscores other networks as soon as it
connects. Previously, it would only outscore other networks
when no-op validation completed.
Bug: 122652057
Test: atest FrameworksNetTests NetworkStackTests
Test: manually ran a VPN with private DNS in strict mode
atest android.net.cts.ConnectivityManagerTest com.android.cts.net.HostsideVpnTests
Change-Id: Iaa78a7edcf23755c89d7b354edbc28d37d74d891
This takes care of boilerplate tasks such as clearing calling
identity, catching RemoteExceptions, and converting to stable
parcelable objects.
Bug: 131206163
Test: builds, boots, wifi works
Test: atest FrameworksNetTests
Change-Id: I7cbe5fc105503d0983cba2bf77fb0097bd20d9ba
IIpClient#addNattKeepalivePacketFilter is the only difference
between version 2 and 3.
Generated with: m networkstack-aidl-interfaces-freeze-api
Test: -builds, boots
- atest NetworkStackTests
- atest ConnectivityServiceTest
Bug: 128803828
Change-Id: I22333c3c5930415cc43d83bc8cc6f566d0acb1f2
Merged-In: I22333c3c5930415cc43d83bc8cc6f566d0acb1f2
(cherry picked from commit a9690c1f66c63ce4dd22f622cc9980d89ad40d20)
Support adding NATT keepalive packet filter to APF
filter.
Generating APF program will be addressed in another CL.
Bug: 33530442
Test: - atest NetworkStackTests
- atest FrameworksNetTests
Change-Id: I4961d5da343d8700600269632787c28112f0f9f1
- Add the hostname to DhcpResultsParcelable.
- Don't store the server hostname if option overload is in use,
as this is not valid.
- Add unit tests.
Bug: 120584519
Bug: 127423755
Test: atest NetworkStackTests
Test: atest FrameworksNetTests
Change-Id: I47d9d53d1fb58968322cc8b071a44fbc8f7156e1
In order to allow NetworkMonitor to tell ConnectivityService
if the network is either parital, validated or both.
NetworkMonitor could update the probe result by passing the
bitmask to ConnectivityService.
Bug: 130078798
Bug: 130683832
Test: build
Change-Id: I429ccbd9b9afae3eafaf73b3c9eb835213c1f64d
This freezes the interface as of the latest beta build, not the tip of
tree. IIpClient#setL2KeyAndGroupHint is not in the frozen definition in
particular.
Generated with:
m networkstack-aidl-interfaces-freeze-api \
ipmemorystore-aidl-interfaces-freeze-api
Test: flashed, booted, WiFi and captive portal working
Bug: 128803828
Change-Id: Ideabe73fc93bbefca2d624ee9ca190cf31419424
Some names were still wrong somehow, and the wrappers were
missing.
Test: NetworkStack & FrameworkNetTests
Change-Id: I475bd011ad9bc714a07021a9dfd85c4876f8e9ad
Merged-In: I475bd011ad9bc714a07021a9dfd85c4876f8e9ad
For implementing parcelable interface for NattKeepalivePacketData.
Move this class out of framework.jar and move to services.jar
This class is used in telephony-common.jar and it also loads
service.jar.
Bug: 33530442
Test: - build pass
- atest NetworkStackTests
- atest ConnectivityServiceTest
Change-Id: Id2fdec5c4015d2cefd8a93e0cfdcc3c304fc9b64
As per API council feedback, these constants should live in
a place that is private to the network stack, only with a
range defined in system API.
Bug: 129433383
Test: m
Change-Id: I84a90f84a9af6fef4667ee4d512ebd0413222086
Merged-In: I4882686a86e7c6d42f4b0619b921d02619ed6d4c
Merged-In: I9b648ed6c687d56db61a54570c7880c51c1bae51
Crash the system server if it cannot bind to the network stack, or if
the network stack crashes. This is better than keeping the system
running in a bad state where all networking would be broken.
Before the network stack was moved to a different process, the whole
system would go down when it encountered a crash.
Test: added crash in NetworkStack, verified system_server restart
Bug: 130028724
Change-Id: Ia8ee7699c4b15ba4b1116c7ba9171bf6034b52c3
Carriers in Mainland China need to customize certain captive portal
urls. The main issue is that google servers are not accessible in
Mainland China.
Added the following captive portal resources to be targeted for overlay.
- config_captive_portal_http_url
- config_captive_portal_https_url
- config_captive_portal_fallback_urls (string-array)
- config_captive_portal_fallback_probe_specs (string-array)
These values can be customized for e g diffent countries
Bug: 111819230
Test: atest FrameworksNetTests NetworkStackTests
Test: Add a product RRO that targets a specific country code,
insert a SIM card that matches that country code and check the log
what URL is used.
Change-Id: I38a294a5e14417f65e96e76235ea153c53c4d7cc
This API was added in Q but is not necessary anymore as
Os#setsockoptTimeval was exposed as public API.
Test: m
Fixes: 129433363
Change-Id: Ifd04c0314f7f7c0dbd0ed89dbaf69b9c152d3330
The system server (in SystemServer.java) defines the boot
sequence, during which an event called SystemReady happens.
This corresponds to a time when critical system services
that are depended upon by other components in the system
server are ready to handle requests from their dependencies.
Some system services are listening to this event to defer
initializations that depend on the critical services.
Because the network stack is only started after SystemReady,
there is no way any NetworkMonitor may be started before
SystemReady. Remove the associated mechanism.
Fix: 129376083
Test: FrameworksNetTests
Change-Id: I071eeb10d0b7c4f71af6653d322c7b442b2cc7ee
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