Commit graph android_packages_modules_Co.../tests/net/java/com
Message SHA1
Merge changes Ieb7f33bc,I81b56862 am: df7233f8e1 am: 92860eb233 am: 90cf1ed3f7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1570920

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie296e709b883fc2930b83dffbfb1366dd4a7e7e7

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-02-05 09:55:17 +00:00
87ce7654bf
Merge "Replace NPMI#isUidNetworkingBlocked()" am: 9113cf2872 am: c48b6bb362 am: b3cd3bb875
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1536313

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I53f5fb0996ad08c8a44c0560ab72725c47e39215

Paul Hu   authored and   Automerger Merge Worker   commited 2021-02-05 08:15:29 +00:00
0b756aeb45
Merge changes Ieb7f33bc,I81b56862
* changes:
  Fix the legacy VPN tests that start racoon.
  Make testLegacyLockdownVpn more realistic.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2021-02-05 07:34:43 +00:00
df7233f8e1
Merge "Replace NPMI#isUidNetworkingBlocked()"
Paul Hu   authored and   Gerrit Code Review   commited 2021-02-05 06:38:02 +00:00
9113cf2872
Fix the legacy VPN tests that start racoon.
These tests do not actually work, or at least not as designed.
What happens when they are run is that creating/connecting the
VPN throws an exception. The call to legacyRunnerReady.block()
times out after 10 seconds because the condition variable is
never opened, but the doesn't notice the timeout becasue it
doesn't check the return value of block().

There are two reasons for the VPN not coming up.
1. VpnConfig.getIntentForStatusPanel calls into PendingIntent and
   ActivityManager statics, which bypass all the mocks and fail
   with an appops denial. Fix this by making it a dependency.
2. The tests are broken due to the UserManager API changes
   tracked in b/175883995. Fixing by adding a bit of ad-hoc code
   into startLegacyVpn, with a TODO to delete it once the rest of
   the UserManager setup code is fixed.

Fix these and check the return value of block(). This ensures
that if any other breakage is added the test will actually fail.
Also check that the throw route survives all the way to the
LinkProperties sent to the agent.

Bug: 173331190
Test: atest com.android.server.connectivity.VpnTest
Change-Id: Ieb7f33bce283ac5ee562a912df8edb9c930ed2b0

Lorenzo Colitti   commited 2021-02-05 14:40:13 +09:00
f5a4ac9592
Make testLegacyLockdownVpn more realistic.
Bug: 173331190
Test: test-only change
Change-Id: I81b5686244f479d967c826e29eba4feb396a09cf

Lorenzo Colitti   commited 2021-02-05 14:36:54 +09:00
3a2a0a31f4
Replace NPMI#isUidNetworkingBlocked()
ConnectivityService is going to become a mainline module which
will not able to access hidden APIs. NetworkPolicyManagerInternal
is a internal serivce that CS can't be access after be a mainline
module. Thus, create NPM#checkUidNetworkingBlocked to replace it.

Bug: 170598012
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases
Test: atest CtsHostsideNetworkTests
Test: atest FrameworksCoreTests:NetworkPolicyManagerTest
Test: atest FrameworksServicesTests:NetworkPolicyManagerServiceTest
Change-Id: I7bee37522dc5c55c255b159fda9481eff663655a

paulhu   commited 2021-02-04 19:28:57 +08:00
97114c99b4
Merge "Revert the fallback naming into default network" am: 068b629dfe am: 74126b9bb0 am: 4e42931c64
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1574083

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I697cbceff12a2cdc2aa7c36bcfbf4ea28f68ab82

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-02-04 10:12:01 +00:00
a9c77e909e
Merge "Improve getConnectionOwnerUid tests." am: bd2f639a30 am: aa7644c9f9 am: 42f099f5c2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1572980

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie69cc409c24468aaebb4a0267009bdc4f9b7a622

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-02-04 10:11:21 +00:00
02e6ba7210
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 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
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 "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
[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 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