Commit Graph

9945 Commits

Author SHA1 Message Date
Lorenzo Colitti
aa9db67edc Import ConnectivityManager.BLOCKED_REASON_* from ConstantsShim.
This is needed for the tests to compile in mainline-prod.

Bug: 165835257
Test: atest CtsNetTestCases:android.net.ConnectivityManagerTest
Change-Id: I32924824e9968996f379e31f1b28eb6a8f29bc5d
2021-04-15 10:25:46 +09:00
Lorenzo Colitti
b84176e9f9 Test ConnectivityManager module-lib APIs for VPNs and blocking.
This CL adds tests for:
- ConnectivityManager#setsetLegacyLockdownVpnEnabled
- ConnectivityManager#setRequireVpnForUids
- NetworkCallback#onBlockedStatusChanged(Network, int)

Bug: 165835257
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Change-Id: Ie9b73ec2a1634f3b3a3eb4d21acbe0803b77c70d
2021-04-13 17:30:49 +09:00
Chiachang Wang
0a5d964242 Merge "Update the method based on API feedback" 2021-04-13 08:15:47 +00:00
Lorenzo Colitti
a329e8c984 Fix a tethering crash when a 464xlat upstream disconnects.
When a 464xlat upstream disconnects, onLinkPropertiesChanged is
called after onLost. This breaks an UpstreamNetworkMonitor
assumption that no callback will ever arrive after onLost.

Bug: 173068192
Fix: 185117377
Test: new unit test
Change-Id: I4ff1eca6d5ed1680ff716c71b683891c8a0e5a77
2021-04-12 15:00:24 +00:00
Chiachang Wang
a31a9b6218 Update the method based on API feedback
UserHandle.getUid() is updated to a non-static API based on API
review feedback. Update the usage accordingly.

Bug: 184735865
Test: atest VpnTest
Change-Id: I884f427fae85b2b26973a0315b1ccf3d6f0824c6
2021-04-12 19:35:56 +08:00
Lorenzo Colitti
65bba3f6bc Merge changes from topic "peruidcallback-cts"
* changes:
  Cleanups to VPN hostside tests.
  Ensure the HostsideVpnTests passes with keyguard locked.
  Add CTS tests for registerDefaultNetworkCallbackAsUid.
2021-04-09 15:16:47 +00:00
junyulai
2e74377464 Fix NetworkCallback expecting wrong network
By current wifi design, wifi will report disconnected and
re-connected when changing from non-metered to metered.
However, the cts test app listens for all network, which
will get mobile network as active network when wifi is
changing meteredness. This is not expected. And causes
test failures when DUT has both wifi and mobile connections.

Thus, this change pass request to track currently active
network to the test app and register only for transport
types of currently active network to prevent from getting
unexpected network.

Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideNetworkCallbackTests
Bug: 182516128
Merged-In: I2dce6035b13472bbdc2609009d690aac96280033
Change-Id: I2dce6035b13472bbdc2609009d690aac96280033
  (cherry-picked from ag/14029457)
2021-04-09 10:16:18 +08:00
Lorenzo Colitti
08b33ff7fb Cleanups to VPN hostside tests.
Use TestableNetworkCallback instead of a hand-rolled class.
Remove unnecessary runWithShellPermissionIdentity around
unregisterNetworkCallback calls.

Bug: 165835257
Test: test-only change
Change-Id: I4557dfc64136f9c0b4bdaa1248c33b13e96ba3ed
2021-04-08 22:09:10 +09:00
Lorenzo Colitti
fd3b95c1f7 Ensure the HostsideVpnTests passes with keyguard locked.
The test app used in CtsHostsideNetworkTests already dismisses
the keyguard for its own activity, but that doesn't work for the
VPN tests. This is because as soon as the VPN dialog appears, the
test activity is no longer in the foreground and the keyguard
comes back. As a result, the test cannot click on the VPN dialog.

Test: test-only change
Change-Id: I7be1d7fb46a2f9547bc5325d75b5bd5546e6dc18
2021-04-08 21:50:15 +09:00
Lorenzo Colitti
ed26ffe92d Add CTS tests for registerDefaultNetworkCallbackAsUid.
Bug: 165835257
Test: test-only change
Change-Id: Ib3266665735ee587f3f8ae82dadd1e4ca7ce4353
2021-04-08 21:44:30 +09:00
Nucca Chen
68f6f5fe79 Merge "[NFCT.TETHER.11] Test TetherOffloadRule{Add, Remove} and set limit for IPv4" 2021-04-08 12:02:15 +00:00
Xiao Ma
3e557d777a Apply IPv6 utils struct stuff to build RA packet in the Daemon.
Traffic log of testSolicitRouterAdvertisement:
fe80::4473:4aff:fecb:7799 > ff02::1: ICMP6, router advertisement, length 88
fe80::1122:3344:5566:7788 > ff02::1: ICMP6, router solicitation, length 16
fe80::4473:4aff:fecb:7799 > fe80::1122:3344:5566:7788: ICMP6, router advertisement, length 88

Bug: 154669942
Test: atest TetheringPrivilegedTests --iterations
Change-Id: I7defb80ef9dd1832c9e04d154e1d06aed9e733dc
2021-04-08 04:50:49 +00:00
Treehugger Robot
662237f2f8 Merge "Improve RouterAdvertisementDaemonTest." 2021-04-08 04:07:14 +00:00
Xiao Ma
597d253f18 Improve RouterAdvertisementDaemonTest.
Add separate testing for unicast and multicast RAs.
Make the test more realistic by:
- Enabling forwarding. This ensures that the daemon actually
  receives the RS.
- Adding a link-local route. This ensures that the daemon is
  actually able to send a unicast response.

Bug: 154669942
Test: atest TetheringPrivilegedTests
Change-Id: Ibb1f51b5b1871657d7feff39335d3c71586cf64f
2021-04-08 11:02:02 +09:00
Nucca Chen
8ba40704f3 Merge changes I515be275,Ied159454,I5a29bdd1
* changes:
  bpf_progs - adjust for dstMac addition
  Populate the key destination mac address
  Set the limit whenever any IPv4 or IPv6 rule exists.
2021-04-07 14:08:37 +00:00
Maciej Żenczykowski
8e69ec111f bpf offload - make sure bpf code can access packet headers
If a tc ebpf program writes into a packet using direct packet access
then the packet will automatically be uncloned and pulled by
additional prologue inserted by the kernel itself.  See
tc_cls_act_prologue() & bpf_unclone_prologue() in kernel sources
(this is how the clat ebpf program works, which does DPA writes).

However in the forwarding programs we only *read* from the packets
using direct packet access, but never write.  All writes happen via
kernel bpf helpers (this is mostly an implementation detail: since
we need to use helpers for checksum updates, I decided to also use
checksums for the writes themselves).  As such the insert 'automatic
unclone/pull' logic doesn't trigger.

It is thus possible (it depends on the skb layout delivered by the
nic driver) for 0 bytes of the packet to be accessible for read
using direct packet access.  We thus need to explicitly try to pull
in the header of the packet so that we can inspect it.

In most cases (on most drivers for most packet types) this will
end up being a no-op (because the headers will already be in
the linear portion of the skb).  But on some drivers for some
packet types it ends up mattering.

Test: TreeHugger, makes icmpv6 tether forwarding work on bramble
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4b07e57728ce544ffb908527ea11ecc315e5acec
2021-04-06 21:50:17 +00:00
Chiachang Wang
7d0e27bd7c Merge "Update tests for onNetworkCreated and onNetworkDestroyed" 2021-04-06 11:04:30 +00:00
Chiachang Wang
674a907cc4 Merge "Ensure SSID is not exposed to apps without correct permission" 2021-04-06 08:58:50 +00:00
Maciej Żenczykowski
47851fc01b Merge "implement insertOrReplace()" 2021-04-06 08:17:42 +00:00
Frank Li
320cd17220 Merge "Add session ID to VpnTransportInfo" 2021-04-06 06:50:48 +00:00
Maciej Żenczykowski
a36ea6fb19 implement insertOrReplace()
Test: atest com.android.networkstack.tethering.BpfMapTest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4a40898f03293d6d79b57c35f743271c669a8ea7
2021-04-06 04:38:46 +00:00
Lorenzo Colitti
b6bffbca95 Fix DadProxyTest when forwarding is on.
When forwarding is on, DadProxyTest fails because forwarding
disables optimistic addresses. This results in the DAD proxy
getting EADDRNOTAVAIL.

Forwarding is on quite often on real hardware because many
solutions for wifi calling use forwarding.

Fix the test to retry after two seconds if the packet is not
forwarded on the first attempt.

It would also be possible to make this work more reliably in the
test by simply disabling DAD or disabling forwarding. However,
because DAD does happen in real usage (downstream interfaces
always disable DAD, but upstream interfaces don't), that seems
risky. For example, if the test disabled DAD, it would not catch
bugs where the DAD proxy crashed or stopped forwarding if it got
EADDRNOTAVAIL.

Test: atest TetheringPrivilegedTests on coral, which has forwarding on
Change-Id: I58280ef7c0e40371cd770ead4c8baa7190c288fd
2021-04-05 23:42:29 +09:00
Lorenzo Colitti
491999292b Fix a race condition in upstream selection.
Current upstream selection code suffers from a race where if the
CONNECTIVITY_ACTION broadcast for a given network switch is
received and processed before the NetworkCallbacks for that
network switch, upstream selection just re-selects the same
upstream it had before. The incorrect upstream persists until
another CONNECTIVITY_ACTION is received.

Fix this by defining a new EVENT_DEFAULT_SWITCHED message code
communicated from UpstreamNetworkMonitor to Tethering, and send
that whenever the default network switches.

The message is sent in onLinkPropertiesChanged, because the
tethering code stores all information about networks in an
UpstreamNetworkState structure that contains Network,
LinkProperties and NetworkCapabilities. When a network switch
occurs, onLinkPropertiesChanged always follows onAvailable and
onCapabilitiesChanged, and thus marks the first point in time
when all the information is available.

This CL tries not to change existing codepaths too much, but
it does move the update of mDefaultInternetNetwork from
onCapabilitiesChanged to onLinkPropertiesChanged. This should
not be a problem because the only thing that reads
mDefaultInternetNetwork is getCurrentPreferredUpstream, which,
in the case of a default network switch, will be run by the
onLinkPropertiesChanged which will immediately follow.

Bug: 173068192
Test: changes to existing unit tests show bug is fixed
Change-Id: Ic9196bc92892811b25bda463ffd839ee5c19d294
2021-04-05 22:52:13 +09:00
Lorenzo Colitti
6748e62ef2 Add unit tests for race conditions in upstream selection.
In the current tethering code, upstream selection is only
triggered by CONNECTIVITY_ACTION. But in automatic mode, the
upstream network is selected by listening to a NetworkCallback
that tracks the default network.

This causes a race where if the CONNECTIVITY_ACTION for a network
switch is received and processed before the callbacks for that
network switch, upstream selection just re-selects the upstream
currently in use.

Make it possible to test this by giving TestConnectivityManager
the ability to choose the ordering between NetworkCallbacks and
CONNECTIVITY_ACTION, and to run an arbitrary Runnable between
calling one and calling the other. TetheringTest passes a
Runnable that calls mLooper.dispatchAll(), which ensures that
the tethering code fully processes the first set of information
it receives (either the broadcast (or the callbacks) before
receiving any more information.

Add test coverage to testAutomaticUpstreamSelection that
exercises various orderings, and make the test pass by expecting
the buggy behaviour of the current code.

An upcoming CL will fix the bug and update the tests.

Bug: 173068192
Test: test-only change
Change-Id: I7805444dcf59f6d5f8517fbcf2f2b1641783d50b
2021-04-05 14:51:53 +09:00
Lorenzo Colitti
e9bc8c9db7 Dump the input destination MAC address for IPv4 flows.
This is needed for forwarding to work, so it should be dumped.

New output:

  Forwarding rules:
    29(29) -> 14(rmnet2) 86dd 00:00:00:00:00:00 00:00:00:00:00:00
    [ap_br_wlan2]: iif(iface) oif(iface) v6addr srcmac dstmac
      14(rmnet2) 29(ap_br_wlan2) 2001:240:2423:13fa:3c21:e35a:6a59:ff8a da:17:fd:70:3d:14 26:5b:b2:ee:bc:ba
    IPv4: [inDstMac] iif(iface) src -> nat -> dst
      [da:17:fd:70:3d:14] 29(29) 192.168.222.151:39208 -> 14(rmnet2) 100.102.14.231:39208 -> 172.217.175.3:80
      [da:17:fd:70:3d:14] 29(29) 192.168.222.151:47386 -> 14(rmnet2) 100.102.14.231:47386 -> 216.58.197.196:443

Also add a call to getHostAddress() to remove the / on IPv6
forwarding rules.

Test: manual
Change-Id: I347ea5a3fd88c51f1fae0c76c75dfa30c68a55ad
2021-04-02 05:42:22 +00:00
Maciej Żenczykowski
62733f5524 bpf_progs - adjust for dstMac addition
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I515be275d09dc7e6bae2564f7db2445ea15cc757
2021-04-02 05:12:33 +00:00
Aaron Huang
5316e1ff18 Merge "Update import class of TAG_SYSTEM_NEIGHBOR" 2021-04-01 15:59:39 +00:00
Hungming Chen
8078b9abfa [NFCT.TETHER.11] Test TetherOffloadRule{Add, Remove} and set limit for IPv4
Add a unit test to verify that BPF coordinator access downstream4
and upstream4 map while the conntrack event was received.

Verify shim API for IPv4:
- tetherOffloadRuleAdd
- tetherOffloadRuleRemove
- tetherOffloadGetAndClearStats
- tetherOffloadSetInterfaceQuota
- isAnyIpv4RuleOnUpstream

Test: atest TetheringCoverageTests

Change-Id: Ia57f07990d8750fd6ff67d7f4a18aa610336024a
2021-04-01 18:30:47 +08:00
Hungming Chen
9b8c60629f Populate the key destination mac address
Required because XDP offload needs input interface mac address
to be a part of the key. The mac address is used for checking
packets which are received from exceped input interface.

Test: atest TetheringCoverageTests, TetheringPrivilegedTests
Change-Id: Ied159454b516c0d70efe0a85744d1bb606892f2d
2021-04-01 18:30:43 +08:00
Lorenzo Colitti
dc6715c6f8 Set the limit whenever any IPv4 or IPv6 rule exists.
Currently, BpfCoordinator only sets the data limit on a given
upstream whenever the first IPv6 rule is created on that
upstream, and clears it whenever the last rule is deleted on that
upstream. It never does this when adding or removing IPv4 rules.

This makes it impossible to offload traffic on IPv4-only
networks.

Fix this by setting the limit when IPv4 rules are created or
deleted as well.

Test: atest TetheringCoverageTests
Manual tests as the follows
Test {add, clear} limit with IPv6-only network [OK]
Test {add} limit with IPv4-only upstream [OK]

TODO:
Test {clear} limit with IPv4-only network. blocked by aosp/1579873
because the IPv4 rules have never deleted.

Change-Id: I5a29bdd18e564318759f617023163e23fb5a3ed0
2021-04-01 18:30:43 +08:00
lifr
877fd475f5 Add session ID to VpnTransportInfo
- This will be visible only to apps with the NETWORK_SETTINGS
  permissions (signature), and will be redacted for all other callers.
- This string is expected to be the same as set by
  VpnService#setSession, and in general, VpnConfig.session. But it
  will be a general API that Vpn.java can call when setting the
  VpnTransportInfo.
- This string cannot be updated once the VPN NetworkAgent is connected.

Bug: 171872481
Ignore-AOSP-First: needed to prevent automerger race breaking build
Test: atest ConnectivityServiceTest
      atest VpnTransportInfoTest
      atest NetworkAgentTest
Change-Id: I883035262465238c35c5a931d89707f3e84feef8
Merged-In: I883035262465238c35c5a931d89707f3e84feef8
           (cherry-picked from ag/14008230)
2021-04-01 15:51:44 +08:00
Chiachang Wang
9a27925368 Update tests for onNetworkCreated and onNetworkDestroyed
Update test to:
1. verify onNetworkCreated callback called when network is
   created.
2. Verify onNetworkDestroyed callback called when agent
   updates its connection state to disconnect and native
   network is destroyed.

Bug: 178725261
Test: atest android.net.cts.NetworkAgentTest
Change-Id: Icd30440e0f553d0f97b860d0e69b4f3d4f0a2a1d
2021-04-01 11:13:42 +08:00
Lorenzo Colitti
9bbdac6275 Rename members in TestConnectivityManager.
These members are public mutable and their names are confusing.
Make them package-private and final.

Bug: 173068192
Test: test-only change
Change-Id: I87131c48f67b6614c25aa99e1cbc53196f49aa7c
2021-03-31 20:23:20 +09:00
Lorenzo Colitti
3e09f80e8a Add the ability to affect ordering in the tethering unit tests.
Currently, TestConnectivityManager immediately sends all
callbacks and broadcasts to the Tethering code as soon as the
test code makes any change.

This makes it impossible to affect the order in which those
events are delivered to the Tethering code, so it is not possible
to test for races.

Fix some of this as follows:
1. Make TestConnectivityManager post all its callbacks to the
   handlers that Tethering registered them with.
2. In TetheringTest, use the existing TestLooper object to
   advance time manually. Also use setUseRegisteredHandlers to
   ensure that the broadcasts are sent in order. This requires
   calling dispatchAll() after sending the broadcast to preserve
   the existing synchronous behaviour. Take advantage of that to
   remove lots of existing dispatchAll calls.
3. Add a TestLooper to UpstreamNetworkMonitorTest and use it.
   Keep the test passing by adding lots of mLooper.dispatchAll(),
   which is a bit ugly but probably acceptable given the
   additional coverage it provides.

This exposes an existing bug in the code where if upstream
selection is in automatic mode, and all CONNECTIVITY_ACTION
broadcasts are received before all NetworkCallbacks, the code
does not switch upstream.

In order to make the tests pass, re-order the CONNECTIVITY_ACTION
broadcasts with the NetworkCallbacks in TestConnectivityManager
so as not to trigger the bug. A future CL will make the order
configurable.

While I'm at it, switch TestConnectivityManager from HashMap to
ArrayMap, which is generally preferred for maps that do not
contain too many elements.

Bug: 173068192
Test: test-only change
Change-Id: I964f365c691fbc396ab0a87f292bd32b123011fe
2021-03-31 20:17:11 +09:00
Lorenzo Colitti
2bcde0fd97 Make Tethering file NetworkRequests only if needed.
Currently, Tethering files NetworkRequests even when
config_tether_upstream_automatic is enabled. This is incorrect:
when the automatic upstream selection is enabled, the tethering
upstream should always follow the default network and there is
no need to file any requests.

These requests are harmful when tethering is not using cellular
as its upstream, because:

- If the device does not use mobile data always on, the request
  causes the cellular network to be brought up, causing power
  draw.
- Even if the device does use mobile data always on, the request
  causes the cellular network to come to the foreground, which
  allows all apps to access it, causing potential data usage.

Amend the existing testGetCurrentPreferredUpstream to cover these
changes, by making that test case always set automatic upstream
mode. This does not result in any loss of meaningful test
coverage, because getCurrentPreferredUpstream is only ever called
when chooseUpstreamAutomatically is enabled.

Bug: 173068192
Test: atest TetheringTests
Change-Id: I068a5338699a3ed04f24f97f785ea89ff5890e50
2021-03-31 19:27:17 +09:00
Lorenzo Colitti
0e7e32ab2c Expose upstream requirements to UpstreamNetworkMonitor.
UpstreamNetworkMonitor is the part of tethering that files
NetworkRequests for upstream netwoks, but it currently does not
know all the requirements for upstream selection. For example, it
does not know whether automatic upstream selection is in use.
This forces the upstream selection code to be split between
UpstreamNetworkMonitor and Tethering. This makes it difficult to
follow.

This CL ensures that all information about upstream requirements
(DUN required, automatic upstream selection, tryCell) is passed
to UpstreamNetworkMonitor so it can be aware of it.

This CL also removes the ability for UpstreamNetworkMonitor's
callers to call registerMobileNetworkRequest or
releaseMobileNetworkRequest. In a future CL, this will be
automatically done by UpstreamNetworkMonitor depending on the
upstream requirements.

This CL is a no-op refactoring with no behaviour changes.

Bug: 173068192
Test: atest TetheringTests
Change-Id: I174f765c616e0dbe2aa493c12613e6131cff0666
2021-03-31 19:27:17 +09:00
Sudheer Shanka
b0f50c579b Check and skip certain operations if they are unsupported.
Fixes: 178334463
Test: com.android.cts.net.HostsideRestrictBackgroundNetworkTests#testMeteredNetworkAccess_expeditedJob
Change-Id: Ie68e17063454e7feeffc93b20b1b8fbb276e837f
Merged-In: Ie68e17063454e7feeffc93b20b1b8fbb276e837f
2021-03-30 16:22:43 +00:00
Chiachang Wang
d841868f39 Ensure SSID is not exposed to apps without correct permission
The class NetworkCapabilities has an extra field for SSID that
can be used by apps to obtain the router SSID (a surrogate for
location) without holding permission. This is a circumvention
of the permission system. Thus, add a test to ensure that
visibility of SSID for apps are controlled by NETWORK_SETTING
permission.

Bug: 183911251
Test: atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest
Change-Id: I18d17093e2da37cde88b730c091c6a1deda08a8a
2021-03-29 17:19:47 +08:00
Treehugger Robot
a7542972b1 Merge "Shorten the name for the dump file." 2021-03-22 21:34:02 +00:00
Sudheer Shanka
8bb9eb1912 Try reconnecting to wifi if it doesn't automatically connect.
When meteredness of wifi changes during test, wifi disconnects.
Try reconnecting if it automatically connects after this.
Also, change the way we update metereness so that we can
use callback mechanism to wait for the state change instead of
polling for it regularly.

Bug: 181686645
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Merged-In: I31fb127ef333d39fe4697043876c7cef15d525e3
Change-Id: Icc0b37730201aebeab2713c6527a3195f6dcf97d
2021-03-22 17:26:46 +00:00
Sudheer Shanka
8d92650da9 Shorten the name for the dump file.
The file name is getting truncated by tradefed and
we are missing the information to actually idenity
the test. So, instead shorten the filename to preserve
the test name.

Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Ignore-AOSP-First: Submitting internally first to avoid merge conflicts.
Merged-In: Ic0f87b97bb58e115fe81e2d688ce0e633397da42
Change-Id: I6ce3fc662782de82d8cad95414e24204b5f7f130
2021-03-22 17:24:46 +00:00
Lorenzo Colitti
60b26ee453 Mark most VpnServiceTest methods as @AppModeFull.
In S, instant apps can no longer access the system service that
backs the VPN APIs, so these tests started to fail in instant
mode.

Regardless of that change in S, though, instant apps cannot
create VPNs because they cannot access the package manager.

Previously, the tests were only passing because they did not
check that the VPN would actually work, they only checked that
the VPN API calls failed.

Fix: 181575083
Test: atest --instant CtsNetTestCases:VpnServiceTest
Change-Id: Idd35051bd1c908a8b85c02e8d0c54d3dea2dde38
2021-03-22 13:16:02 +00:00
Treehugger Robot
bf0c19e52f Merge "Revert^2 "Replace the usage of UidRange"" 2021-03-21 16:41:13 +00:00
Remi NGUYEN VAN
cc305b2fa5 Move connectivity AIDLs to android.net
java_sdk_libraries and apexes need to contain bootclasspath classes
under predefined packages. Tethering currently uses android.net, so make
sure all the connectivity bootclasspath classes are under android.net.

This avoids maintaining two packages for the tethering APEX, where
com.android.connectivity.aidl is only used by internal AIDL files.

Bug: 182984842
Test: m
Change-Id: I23feb26c5de2fd7a4177797a3bc1d0dcbef4ade7
Merged-In: I23feb26c5de2fd7a4177797a3bc1d0dcbef4ade7
2021-03-20 22:24:08 +09:00
Maciej Żenczykowski
b1ffd2ce9b bpf_progs - remove unused dependencies
Test: builds, atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9414bde566bb73b696593587db854de3fb14cdcc
2021-03-19 03:39:42 +00:00
Chiachang Wang
2fb0846d70 Revert^2 "Replace the usage of UidRange"
274c796731

The parameter of NetworkCapabilities.setUids() and
NetworkRequest.Builder.setUids() are updated to take a set of
integer Range instead of a set of UidRange because of refactor
work for the incoming connectivity mainline module.

The parameter change stops NetworkRequestTest to work in the
different API levels. Replace the usage with shims to work in
both current and stable APIs.

Bug: 172183305
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk

Change-Id: I7d18402f051051371f3054f6897b05b6da072105
Merged-In: I4bc0daf5ad9e4b4043f4a897ddab16aec8f8a536
2021-03-19 02:10:06 +00:00
Maciej Żenczykowski
63be468bf4 Merge changes Ibe325714,I44f3dc9e
* changes:
  fix whitespace in offload.c macro
  change PRIO_CLAT into a comment
2021-03-18 19:53:24 +00:00
Anthony Stange
83f77d83fd Merge "Revert "Replace the usage of UidRange"" 2021-03-18 16:40:53 +00:00
Anthony Stange
274c796731 Revert "Replace the usage of UidRange"
Revert "Replace the usage of UidRange"

Revert "Add shims for NetworkRequest"

Revert submission 1626206-replaceUidRange

Reason for revert: Breaking build - b/183106405
Reverted Changes:
I0b79c73e8:Add shims for NetworkRequest
I4bc0daf5a:Replace the usage of UidRange
I4e5aec6ef:Replace the usage of UidRange
I107c329d4:Expose uids related APIs in NetworkRequest and Net...

Change-Id: I5a4addc562d180487e2891fd2081c593126e6ffc
2021-03-18 16:30:59 +00:00
Chiachang Wang
1241156261 Merge "Replace the usage of UidRange" 2021-03-18 13:36:39 +00:00