Extend QosFilter address match function for IP address range based on
prefix length.
Bug: 406146808
Bug: 399960748
Flag: com.android.net.flags.qos_filter_ip_range_matching
Test: atest CtsNetTestCases
Test: atest ConnectivityCoverageTests
Change-Id: I78d995fda111d258da9a912c7afa5e472e43437f
On V+, ConnectivityService uses uid blocking state in BpfMap instead of
asking NetworkPolicyManager.
But, there was one behavior difference because NetworkPolicyManager
considers the network is always not blocked for apps without Internet
permission.
To ensure backward compatibility, the
NETWORK_BLOCKED_WITHOUT_INTERNET_PERMISSION flag was introduced in
aosp/3076606, aosp/3088285.
This CL updates enforceMeteredApnPolicy to respect this flag for
backward compatibility.
Test: CSEnforceMeteredApnPolicy
Bug: 404428733
Bug: 370383309
Flag: EXEMPT bugfix
Change-Id: I631f4f840818e1d40f20fccae1ec1a2cbbb6a166
Though all versions will parcel this, the behavior will not change
before B. Starting with B, this flag is parceled and handed over
to apps.
Test: ConnectivityCoverageTests, CtsNetTestCases
Flag: EXEMPT no behavior change before B
Change-Id: I7e9ae9011c74b80c208d8f297aa3b7d1aea176f2
Chalard Jeanauthored and Xiao Macommited 2025-04-07 11:46:38 +09:00
Changing this method to private broke OEM code that would link
directly against the non-public methods of the module. This
should not be allowed, and we have changes in the works to
disallow this, but in the mean time we can't afford to break
devices in the field.
Test: will have to see how it behaves in the lab on relevant devices
Flag: EXEMPT bugfix
Bug: 406489362
Change-Id: Ie6c1ebb04e49317fdda34ff3dd522cd9d4677556
The adb app compat command to enable fails for platform being old. Making this flag as disabled by default and overridable.
Bug: 405186661
Test: atest ConnectivityCoverageTests
Flag: EXEMPT bugfix
Change-Id: Ia1242803ed9b02290a5b66c4d1e224c87450d370
Revert submission 3561690-revert-3538339-SNUWWZJNJZ
Reason for revert: NewAPI error will be fixed by separate CL
Reverted changes: /q/submissionid:3561690-revert-3538339-SNUWWZJNJZ
Change-Id: Ia7367e9332f4d376bd0be4c03c095ee00de9177a
Revert submission 3538339
Reason for revert: Likely culprit for b/406432012 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Reverted changes: /q/submissionid:3538339
Change-Id: I61b02f2b1b667e9a41b677f8062e8e96aac09f6e
QUIC stack running on the app process will call this API and register
QUIC UDP socket and UDP payload that can close QUIC connection.
When the app loses network access (e.g. due to freezer or firewall
chain), ConnectivityService 1)destroys the registered UDP socket by
sending a SOCK_DESTROY netlink message and 2)sends the registered UDP
payload to the server. This prevents unnecessary modem wakeups caused
by packets from the server after the apps lose network access.
Additionally, to close QUIC connection for apps that crash or are
killed, ConnectivityService sends the registered UDP payload when it
receives a socket destroy diag message for the registered socket.
Bug: 311792075
Test: CSDestroySocketTest CtsNetTestCases
Change-Id: I6cd727bd8bb0fe1d17360edfa395f73d24da6920
* changes:
Add integration test of tethering local network agent feature
Add unit test of tethering local network agent feature
Support LocalNetworkAgent for Tethering
Treehugger Robotauthored and Gerrit Code Reviewcommited 2025-03-21 07:42:40 -07:00
Currently, apps targeting V can see thread local network.
This change introduces a mechanism to make existing
apps unable to see non-thread local networks to ensure minimal
impact on existing devices and applications while adopting this
behavior. Apps targeting B+ Sdk and run on V+ devices can see
non-thread local networks.
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.CSLocalAgentTests \
--update-device
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server --update-device
(on next/trunk_staging release config)
Bug: 349487600
Change-Id: I6aa43cebc20a9017c2d8a8a90ebb1d53040a27bb
The feature will be gradually enabled via flag rollout.
Sample ip rule output:
0: from all lookup local
10000: from all fwmark 0xc0000/0xd0000 lookup legacy_system
11000: from all iif lo oif dummy0 uidrange 0-0 lookup dummy0
11000: from all iif lo oif rmnet1 uidrange 0-0 lookup rmnet1
11000: from all iif lo oif wlan0 uidrange 0-0 lookup wlan0
16000: from all fwmark 0x10063/0x1ffff iif lo lookup local_network
16000: from all fwmark 0x10064/0x1ffff iif lo lookup rmnet1
16000: from all fwmark 0x10066/0x1ffff iif lo lookup wlan0
16000: from all fwmark 0x10063/0x1ffff iif lo lookup wlan0
17000: from all iif lo oif dummy0 lookup dummy0
17000: from all iif lo oif rmnet1 lookup rmnet1
17000: from all iif lo oif wlan0 lookup wlan0
18000: from all fwmark 0x0/0x10000 lookup legacy_system
19000: from all fwmark 0x0/0x10000 lookup legacy_network
20000: from all fwmark 0x0/0x10000 lookup local_network
20000: from all fwmark 0x0/0x10000 lookup wlan0
21000: from all iif wlan0 lookup rmnet1
23000: from all fwmark 0x64/0x1ffff iif lo lookup rmnet1
23000: from all fwmark 0x66/0x1ffff iif lo lookup wlan0
31000: from all fwmark 0x0/0xffff iif lo lookup rmnet1
32000: from all unreachable
Test: adb shell device_config put tethering tethering_local_network_agent 1
Test: atest TetheringTests:android.net.ip.IpServerTest TetheringManagerTest
Bug: 349487600
Change-Id: Iaa88dde645da917149fec0d44fff796c551bcc7e
The targetSdkVersion was set to enable after current_development version
so the test cases targetting current do not have change enabled. It was
observed that user builds did not allowed changing compat flag on
current values. Changing this to enabled after baklava.
Bug: 405183129
Test: atest ConnectivityCoverageTests
Change-Id: Ifeb7cde9f1a7d2b5a254f297207d625bf9d02731
This is for backwards compatibility. Apps targeting V or lower
SDK should not see Tethering network agent.
This restriction is still disabled to maintain no-op in this
change. Will be enabled when introducing ConnectivityService
part in the subsequent change.
Test: atest CtsNetTestCases:android.net.NetworkCapabilitiesTest \
ConnectivityCoverageTests:android.net.connectivity.com.android.server \
--update-device
Bug: 349487600
Change-Id: I99405ab62e82ff4b7fcebffd3a1a31ec6d8962a9
Now that the system server has a queue doing this job,
the queue on the network agent side can be removed.
Test: ConnectivityCoverageTests, CtsNetTestCases
Change-Id: Idf0435f447cfdd28d829a867d1085771837c6f9b
Now that faulty Telephony tests have been disabled temporarily
to allow for this bugfix, this can be reverted.
This reverts commit 653d5f1ef4.
Test: FrameworksTelephonyTests CtsNetTestCases
Change-Id: If6b1541981803dc84de57b48adb13d40c9997fa0
Revert submission 3535182
Reason for revert: <Droidmonitor created revert due to b/404070202.Will be verified through ABTD for standard investigation.>
Reverted changes: /q/submissionid:3535182
Change-Id: I2febd2ee7227d487d9cd69dcabd9c04f888fd2de
This is a resubmit of
I0fd90716b9f5501bdcdc7ee5165321737a0076ae
which did not account for testing of this private method
in Telephony tests.
Also make the network agent registry two way to eliminate
reordering possibilities.
Test: ConnectivityCoverageTest, CtsNetTests
Change-Id: I9ca025b1369dcb1202f906d5cff79e3d935b40da
This is a trick to help mocking registerNetworkAgent without
having to import its return type. In the near future the
return type will be changed to a non-public class, which
can't be seen in CTS.
Really this shouldn't be necessary because only Connectivity
tests should mock ConnectivityManager, but the practice is
different and other mockers need this support.
See also aosp/3538922
Test: NetworkAgentTest
Change-Id: I3ac63d95d3830a3b413f9ad12b84ac426b63dd08
This reverts commit 70ede3260c.
Reason for revert: Likely culprit for b/402365566 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Change-Id: If72cc264c5e505348309c6c11dbbfd11adeaf31b
Chaitanya Cheemala (xWF)authored and Gerrit Code Reviewcommited 2025-03-11 06:05:49 -07:00
Also make the network agent registry two way to eliminate
reordering possibilities.
Test: ConnectivityCoverageTest, CtsNetTests
Change-Id: I0fd90716b9f5501bdcdc7ee5165321737a0076ae
This was causing issues with jobs execution using JobScheduler, in apps that don't request INTERNET permission.
Bug: 397348342
Flag: EXEMPT changes a compat flag
Change-Id: I1c421cbaff815ed761ec4c0da3ead942ddc55d5c
aosp/3502915 use this method from ConnectivityService to get socket
cookie that is required for closing QUIC connection.
Bug: 311792075
Test: m, boot
Change-Id: I17d8a4dd24cfb84e9b008b8eb87eedec67b29020
Motomu Utsumiauthored and Maciej Żenczykowskicommited 2025-03-03 17:23:04 -08:00
These were added to allow tests to build against flagged off APIs, in
legacy downstream branches that did not support the flagging
infrastructure and stripped out flagged off APIs from the stubs.
Flagged off APIs are part of the regular stubs in branches used today,
so this is not needed anymore.
Bug: 399365344
Test: atest
Change-Id: Ica7df0c5c9be39d9dca49e0114711a7c43125c3d
Remi NGUYEN VANauthored and Paul Duffincommited 2025-02-28 10:47:40 +00:00
This change is finally (!) adding a builder class for creating tun/tap
interfaces for testing.
The various create*Interface() methods which are not marked as
@SystemApi can be removed after moving existing tests over to the new
API.
Bug: 237694424
Test: TH
Change-Id: I10eff755ebda4e2ef2550a50a3bfd1543a21e5b0
The CL has caused a memory regression in the Zygote, See: b/396156852
Test: Compile
Bug: 396156852
Change-Id: I0ca4cd430a6537d689a1b04739656afc84c43ce1
As part of the major tethering refactor to associate every IpServer with
a TetheringRequest, tether()/untether() APIs should be completely
removed in B and all tethering should go through startTethering() (with
the exception of Wifi LOHS and Wifi P2P, which will move to
startTethering() in a future CL).
Bug: 216524590
Test: atest CtsTetheringTests TetheringTests
Change-Id: If7981f1ee7d80ff0a1cc0069ba7a4ebf79144160
Quang Anh Luongcommited 2025-01-15 08:59:42 +09:00
A server network is created by using ConnectivityManger#reserveNetwork,
in which the app passes a specifier that sets:
reservationRequest = {
role = server
headerCompression = 6lowpan
remoteAddr = any (null)
psm = any
}
This specifier must subsequently match the blanket reservation offer,
and the reserved offer that is generated as a response:
blanketOffer = {
role = server
headerCompression = any
remoteAddr = any (null)
psm = any
}
reservedOffer = {
role = server
headerCompression = 6lowpan
remoteAddr = any (null)
psm = 0x81
}
And not the client network offer or a client network:
clientOffer = {
role = client
headerCompression = any
remoteAddr = any (null)
psm = any
}
clientNetwork = {
role = client
headerCompression = 6lowpan
remoteAddr = 01:02:03:04:05:06
psm = 0x81
}
Similarly the client request must match both the clientOffer and
clientNetweork, but not the reservedOffer (and technically
blanketOffer):
clientRequest = {
role = client
headerCompression = 6lowpan
remoteAddr = 01:02:03:04:05:06
psm = 0x81
}
Note, a request for TRANSPORT_BLUETOOTH with no specifier matches *any*
specifier per specifier matching semantics in NetworkCapabilities.
Test: L2capNetworkSpecifierTest
Change-Id: Ia16926b463a54530ae6e88278466e92ed82bf852
This is an invalid combination that never seems useful. Note that this
still allows ROLE_ANY in combination with a remote address. This still
doesn't seem particularly useful, but there is no good reason to
disallow it.
Test: TH
Change-Id: Ib0b7284cb99ee92f14113f8184af978eeb2318e7
Per discussion on aosp/3429160.
"It doesn't look like knowing the PSM of an L2CAP network would give
other apps any sort of useful information. They don't have the MAC, and
there are only 128 ephemeral PSM values anyway."
Test: TH
Change-Id: Ia81c97dd2e31611fd2d13d5899390fc0c67b6c0f