Commit graph android_packages_modules_Co.../tests/net/java
Message SHA1
[VCN07] Bypass VCN for non-internet app accessible cellular services
Deduce the NET_CAPABILITY_NOT_VCN_MANAGED capability from other
capabilities and user intention, which includes:
   1. For the requests that don't have anything besides
      VCN_SUPPORTED_CAPABILITIES, add the NOT_VCN_MANAGED to
      allow the callers automatically utilize VCN networks
      if available.
   2. For the requests that explicitly add or remove
      NOT_VCN_MANAGED,  do not alter them to allow user fire
      request that suits their need.

Test: atest NetworkRequestTest#testBypassingVcnForNonInternetRequest
Bug: 175662146
Change-Id: I9936894b9530a22fb186cfd25cbee0fced65b72b

junyulai   commited 2021-02-04 17:07:23 +08:00
1243a00669
Merge "Revert the fallback naming into default network"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-02-04 08:48:21 +00:00
068b629dfe
Improve getConnectionOwnerUid tests.
Currently, the tests only check whether the method throws a
SecurityException or not. Also check the return value of the
call, by mocking out InetDiagMessage.getConnectionOwnerUid.

This is required to test an upcoming change that will never
throw SecurityException but always return INVALID_UID if the
caller lacks permissions.

Bug: 173331190
Test: test-only change
Change-Id: I63f42a2f098fcf8796c9b4525a3a7b8320c0a139

Lorenzo Colitti   commited 2021-02-04 04:19:28 +00:00
dbcd5d632a
Revert the fallback naming into default network
There is strong opposition in the team to this rename.
Reverting to the old language.

Test: FrameworksNetTests
Change-Id: Icefa3090966c07fd66692ddd5b44dfc94485a914

Chalard Jean   commited 2021-02-04 13:14:05 +09:00
1bc77a99e3
Merge changes Ifa2aa335,I09366a7f am: 7fed667205 am: 1700ac64d3 am: 61074fe878
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1565201

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2ac2a510eb5837acd77b2d7884da0af14cca502f

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-02-03 16:33:10 +00:00
b1014ac0e4
Merge "[NS] Tests : don't expect a score in NF#acceptRequest" am: c6bf15898a am: 8b1998bfb2 am: 66ab10ca12
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556098

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie9e2883453e20f09a269b99ccf8e3ec86b66964b

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-02-03 10:25:02 +00:00
a02d3f4256
Allow passing the underlying network to startLegacyVpn.
This will be used by a future change that makes the legacy
lockdown VPN pass the underlying network.

Bug: 173331190
Test: tests in subsequent CLs in stack
Change-Id: I09366a7f872ef3d4538962a75b0114a2ecb536e6

Lorenzo Colitti   commited 2021-02-03 19:03:53 +09:00
94d03aecfc
Merge "[NS] Tests : don't expect a score in NF#acceptRequest"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-02-03 08:10:19 +00:00
c6bf15898a
Merge "Adding support for multiple "default" networks" am: ca0ab687be am: 24bc30f408 am: b68cb3106c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1532548

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibcb06ea4004e988190ac8ae0dfaa2498d79777fb

James Mattis   authored and   Automerger Merge Worker   commited 2021-02-03 06:44:30 +00:00
959f869760
Adding support for multiple "default" networks
Updating ConnectivityService foundational support for multiple default
networks by extending mDefaultRequest and mDefaultNetworkNai from single
instances to a HashMap to support more than a single default network.

Bug: 176027457
Bug: 172347841
Test: atest FrameworksNetTests
atest NetworkStackTests
atest FrameworksNetIntegrationTests
atest NetworkStackIntegrationTests
atest CtsNetTestCasesLatestSdk

Change-Id: I2f5fa96c2d21ab883499e82afa74e73f3ca606cd

James Mattis   commited 2021-02-02 16:14:36 -08:00
8af2d60519
Merge "Update frameworks to use unbundled version of BouncyCastle." am: 9671b7eca8 am: f477bba3c4 am: ec9bb8cd13
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1559779

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iaf00137fbdfc3dacd99537f9f4e2da0ffbc9a844

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-02-02 15:59:03 +00:00
633444ee84
Merge "Update frameworks to use unbundled version of BouncyCastle."
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-02-02 14:37:05 +00:00
9671b7eca8
Merge changes I4f38a539,Id4f6c7f4 am: 7b49264237 am: 6964d11672 am: 79f031dadc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1565198

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I49cd86725c481827b4278e05afd4847c3a06e8d7

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-02-02 11:49:08 +00:00
89ef449561
Improve testing for network blocking.
This simplifies the uidNetworkingBlocked method and makes it more
realistic by supporting more combinations of rules than just the
four used by this test.

Also support RULE_ALLOW_METERED, and add test coverage for it.

Test: test-only change
Change-Id: Id4f6c7f41429f3ae7841d3214b3e5e95ec591f85

Lorenzo Colitti   commited 2021-02-02 16:17:22 +09:00
786947b4ac
[NS] Tests : don't expect a score in NF#acceptRequest
The score argument is going away, so there no longer
is a need to test it. It's never been used by anybody
and is actually a problem going forward.

Since removing the argument requires a small re-arch
of the testing tool anyway, rebuild expecting requests
on top of TrackRecord. This simplifies the test a
great deal, as well as (as observed in running the
tests) makes the test faster.

Test: this
Change-Id: If03b9e64f14ac8ffa5398b964939a9a45a74b28d

Chalard Jean   commited 2021-02-01 23:06:49 +09:00
efb8409f66
Merge changes Idcc9e32c,I58769bb7 am: e73a36ba21 am: 203c72f86c am: 910fb03907
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552503

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3d15c00910467d51531a25c025efb491b446b6a4

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-02-01 12:41:24 +00:00
ec960a86ce
Merge changes Idcc9e32c,I58769bb7
* changes:
  Remove getFilteredNetworkState and add @NonNull in NetworkState.
  Add test coverage for get*NetworkInfo on metered networks.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2021-02-01 10:56:19 +00:00
e73a36ba21
Add test coverage for get*NetworkInfo on metered networks.
Test: test-only change
Change-Id: I58769bb768978d0acff1da6d32c2f6942c43508b

Lorenzo Colitti   commited 2021-02-01 15:58:12 +09:00
0e920055dc
Merge "[FUI04] Refactor VpnInfo" am: 149add890e am: ba245e077f am: 55c1a77fea
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1537211

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icfa9918e41fc3f952a23956108df4db449741364

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-01-29 23:38:06 +00:00
680e2d4f64
Merge "[VCN06] Support request background network" am: 2141aec60a am: 336c5d93a7 am: 4d9ef0fc1e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553866

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I50867bc7cb21eb134f20af9ef55c44c2bd8962e9

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-01-29 23:36:41 +00:00
3c48d0cf6f
Merge "[FUI04] Refactor VpnInfo"
Junyu Lai   authored and   Gerrit Code Review   commited 2021-01-29 13:54:53 +00:00
149add890e
Merge "[VCN06] Support request background network"
Junyu Lai   authored and   Gerrit Code Review   commited 2021-01-29 11:02:02 +00:00
2141aec60a
[FUI04] Refactor VpnInfo
As a preparation of exposing system API. This patch does some
harmless refactoring, which includes:
  1. Change raw arrays into lists according to API guidelines.
  2. Write test.
  3. Rename class to UnderlyingNetworkInfo.
  4. Rename vpnIface to iface.
  5. Make underlyingIfaces @NonNull in order to adapt new
     unparceling code.
  6. implement equals and hashCode for testing.

Test: atest android.net.UnderlyingNetworkInfoTest
Bug: 174123988

Change-Id: I405c21e57c4af8a12a9dd0a1749b9e6690f87045

junyulai   commited 2021-01-29 17:44:32 +08:00
62d35f7e59
[VCN06] Support request background network
This will be mainly used by VCN management service which will
need to hold the networks but preserve the backgrounded-ness
of the networks.

Test: android.net.ConnectivityManagerTest#testRequestType
Test: android.net.cts.ConnectivityManagerTest#testRequestBackgroundNetwork /
      --rerun-until-failure 100
Test: ConnectivityServiceTest#testBackgroundNetworks
Test: m -j doc-comment-check-docs
Bug: 175662146

Change-Id: I463c7a3139a286e50ea71e674060975ce228caa9

Junyu Lai   authored and   junyulai   commited 2021-01-29 14:42:32 +08:00
23568a4f04
Merge "[VCN01] Add NOT_VCN_MANAGED capability" am: 00caf89795 am: 227fc5d23d am: f76c711734
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1549897

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ide501fcf659637c0ec175d3f6f5926c2482734e0

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-01-28 14:58:38 +00:00
8d06e8aba8
Merge "[VCN01] Add NOT_VCN_MANAGED capability"
Junyu Lai   authored and   Gerrit Code Review   commited 2021-01-28 13:04:59 +00:00
00caf89795
Merge "Fix legacy APIs when VPN switches to suspended underlying network." am: 83563fd735 am: d892e45c9b am: edd29a2f23
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1547497

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I21c1c7913987a2bb4d486e6ce8da24a76ddf2dc6

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-01-28 08:06:46 +00:00
29e36cb8c8
Update frameworks to use unbundled version of BouncyCastle.
Previously BouncyCastle methods were exposed as libcore APIs (@CorePlatformApi), which no longer possible when ART is updatable module (and can't guarantee BouncyCastle API stability)

Bug: 154796679
Test: Treehugger

Change-Id: I908681841a6766de88761767c77c4e2d4b5f56d5

Daulet Zhanguzin   commited 2021-01-28 07:51:22 +00:00
8ef2001b7f
Merge "Note network interfaces based on transport"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-01-28 07:45:20 +00:00
a7656b2d7e
Merge "Fix legacy APIs when VPN switches to suspended underlying network."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2021-01-28 07:07:37 +00:00
83563fd735
Note network interfaces based on transport
Instead of classifying interfaces by network type in BatteryStats,
classify them based on the transports array provided by the
NetworkAgent.

Network types are deprecated and transports should be used instead. This
change allows BatteryStats to stop depending on unstable APIs such as
isNetworkTypeMobile.

This change also updates nullability annotations in ConnectivityService
and NetworkAgentInfo to show that the NetworkCapabilities are non-null
(as provided by the network agent) when calling
noteNetworkInterfaceTransports.

Bug: 174436414
Test: atest
  atest ConnectivityServiceTest#testBatteryStatsNetworkType \
      --rerun-until-failure 40

Merged-In: I4e928fac8a57a9b1fc758a44af2a5719b8c871b8

Change-Id: I4e928fac8a57a9b1fc758a44af2a5719b8c871b8

Remi NGUYEN VAN   commited 2021-01-28 15:10:54 +09:00
afd7560b29
Merge "Revert "Revert "Note network interfaces based on transport""" into sc-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2021-01-28 05:55:23 +00:00
359e963945
Merge "[FUI03] No-op refactoring of VpnInfo" am: c1140f2a33 am: 2b6868d243 am: 85c56d4826
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1547637

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I05e6b14fca44919610317831c147413b0a431224

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-01-27 14:16:00 +00:00
524489652e
Revert "Revert "Note network interfaces based on transport""
Instead of classifying interfaces by network type in BatteryStats,
classify them based on the transports array provided by the
NetworkAgent.

Network types are deprecated and transports should be used instead. This
change allows BatteryStats to stop depending on unstable APIs such as
isNetworkTypeMobile.

This change also updates nullability annotations in ConnectivityService
and NetworkAgentInfo to show that the NetworkCapabilities are non-null
(as provided by the network agent) when calling
noteNetworkInterfaceTransports.

This is rolling forward a previously reverted change. The new change
also fixes MobileRadioPowerCalculatorTest that was broken when
submitting the previous change.

Bug: 174436414
Test: atest
      atest ConnectivityServiceTest#testBatteryStatsNetworkType \
          --rerun-until-failure 40

Merged-In: I4e928fac8a57a9b1fc758a44af2a5719b8c871b8

Change-Id: I4e928fac8a57a9b1fc758a44af2a5719b8c871b8
(cherry picked from commit 2d17d202bc709c205506c03149d847f00f92d78d)

Remi NGUYEN VAN   commited 2021-01-27 09:02:22 +00:00
4768f6316e
[VCN01] Add NOT_VCN_MANAGED capability
Add new capability to indicate whether a network is
managed by Virtual Carrier Network (VCN). This is needed
to identify networks between VCN managed network and
others. And this capability will be:
  1. mutable
  2. requestable
  3. set by default for network agents and requests
  4. allowed for test networks

Note that this commit is identical to aosp/1529959 except the
capability remains hidden to address the javadoc problem first.
And this CL also needs to be bound with the counter part change
to prevent build breakage.

Test: 1. atest FrameworksNetTests CtsNetTestCases
      2. adb shell dumpsys connectivity
      3. atest ConnectivityServiceTest#testLoseMutableAndRequestableCaps
Bug: 175662146

Change-Id: I37a6f492c2aba72836e36851b50b67398f8bdd36

Junyu Lai   authored and   junyulai   commited 2021-01-27 16:13:01 +08:00
120e49e971
Merge changes I713bc2ec,Ib9ab07c9 am: c5a7a59483 am: efeaa56ba6 am: 8b8a8fc5de
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1537264

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4b291a4e82b89d3808e9bcd980d5b2aa4d2b1b71

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-01-27 07:53:30 +00:00
6d457c9156
[FUI03] No-op refactoring of VpnInfo
As a preparation of exposing system API. This patch does some
harmless refactoring, which includes:
  1. Move VpnInfo to android.net
  2. Add nullability annotations
  3. Make members final

Bug: 174123988
Test: TH
Change-Id: I1530bb45d0e84c28c6deac33596bc686058afc0d

junyulai   commited 2021-01-27 15:03:06 +08:00
bd7f3cd75b
Merge changes I713bc2ec,Ib9ab07c9
* changes:
  [FUI05] Remove wimax data usage unit test
  [FUI14] Get SSID from NetworkCapabilities

Treehugger Robot   authored and   Gerrit Code Review   commited 2021-01-26 13:13:24 +00:00
c5a7a59483
Merge "Revert "Note network interfaces based on transport""
Remi NGUYEN VAN   authored and   Android (Google) Code Review   commited 2021-01-26 04:25:56 +00:00
f4ae885dbd
Revert "Note network interfaces based on transport"
This reverts commit 6e1b16c9fe.

Reason for revert: Broke build of tests: b/178441996

Change-Id: Idaf35fa02f76852fa8134b0d505467007f6d0f60

Remi NGUYEN VAN   commited 2021-01-26 04:22:54 +00:00
f9054ed6bd
Merge "Note network interfaces based on transport"
Remi NGUYEN VAN   authored and   Android (Google) Code Review   commited 2021-01-26 03:20:21 +00:00
5e420d9ef4
Merge "Add method to match address \ port with QosFilter" am: 591fe5327c am: c6e47cad53 am: 22b01d88ca
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1510591

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id9951a0be8821192e3fb403787d096c538d691cf

Daniel Bright   authored and   Automerger Merge Worker   commited 2021-01-26 00:22:58 +00:00
946f6661c2
[FUI05] Remove wimax data usage unit test
In follow-up patches, the network type will be derived from
transport types, which officially doesn't support wimax.
Thus, remove the test which rely on it first since it is
not needed and will not be needed.

Test: atest FrameworksNetTests
Bug: 174123988
Change-Id: I713bc2ec39e3a4fa19ed13d2e9ff9ae35477d726

junyulai   commited 2021-01-22 23:58:14 +08:00
cb95247c1e
[FUI14] Get SSID from NetworkCapabilities
This allows subsequent patches to remove the need of exposing
SSID in NetworkState.

Test: atest NetworkStatsServiceTest
Bug: 174123988
Change-Id: Ib9ab07c9610954c9a5de035a3aefbf6d0bb0b53b

junyulai   commited 2021-01-22 23:58:14 +08:00
de493c006a
Merge "Add Qos Callback support" am: 29f0f6d47f am: b97f23ae96 am: f14671c09a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1386623

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If0a123f16951c88cc5881fba8865fae822ba92f0

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-01-22 14:52:58 +00:00
04ba35dc06
Add method to match address \ port with QosFilter
* The match method is only for local address and port since we have
no other use case.

Bug: 155176305
Test: Added new test
Change-Id: I7b45f9912af6a192fc60606f5e0b4cc479aea93f

Daniel Bright   commited 2021-01-22 06:24:41 -08:00
07dd129bbe
Add Qos Callback support
* Provide App Developers Qos related info associated to
  a bound socket through ConnectivityManager
* Qos sessions are generated and filtered by Network Agents
  and sent back through the Connectivity Service to the
  API consumer.
* The structure of the code within com.android.server
  is designed to support different types of filters in the
  the future.
* The first type of Qos Attributes are related to EPS
  Bearers in order support RCS.

Bug: 155176305
Test: Added to cts/NetworkAgentTest
Test: Added to ConnectivityServiceTest
Change-Id: I145dd065d9deeee449eb9695ab3f6c8556ee7c09

Daniel Bright   commited 2021-01-21 20:14:52 -08:00
60f02ed76b
Note network interfaces based on transport
Instead of classifying interfaces by network type in BatteryStats,
classify them based on the transports array provided by the
NetworkAgent.

Network types are deprecated and transports should be used instead. This
change allows BatteryStats to stop depending on unstable APIs such as
isNetworkTypeMobile.

This change also updates nullability annotations in ConnectivityService
and NetworkAgentInfo to show that the NetworkCapabilities are non-null
(as provided by the network agent) when calling
noteNetworkInterfaceTransports.

Bug: 174436414
Test: atest
      atest ConnectivityServiceTest#testBatteryStatsNetworkType \
          --rerun-until-failure 40

Change-Id: Icc912473d97a42eef73eb953607c9161fdbeb794

Remi NGUYEN VAN   commited 2021-01-20 15:53:54 +09:00
6e1b16c9fe
Fix legacy APIs when VPN switches to suspended underlying network.
Currently, when the VPN underlying network changes from a
network that is not suspended to one that is suspended (or vice
versa), some of the legacy APIs return incorrect results.

This is because the VPN's NetworkInfo can get into SUSPENDED
state even though the capabilities have the NOT_SUSPENDED
capability. This happens because the code in updateCapabilities
that checks for changes in NOT_SUSPENDED and NOT_ROAMING (which
are the capabilities that can affect the NetworkInfo state) is
only run when the capabilities change in a certain way.

Fix this by always checking for changes in these capabilities,
regardless of what else has changed.

This results in sending a lot more SUSPENDED and RESUMED
callbacks than the code sent previously. This should hopefully
not impact apps because those callback methods have never been
public API, though because they're just callbacks, it's possible
that apps found out via code inspection that the callbacks
existed and implemented them.

Bug: 172870110
Test: changes to existing tests in ConnectivityServiceTest
Change-Id: I6ec246a6a4e61f634956a165797fbb80296efd6a

Lorenzo Colitti   commited 2021-01-20 11:32:51 +09:00
246d176689
Merge "Revert "[VCN06] Support request background network"" am: 2fa034c812 am: b7b3064394 am: dd7029fd30
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1553864

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I896c2008e29163527b03f031623e1c70d16e1da4

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-01-19 12:39:27 +00:00
12703ee175