Commit graph

13,045 commits

Message SHA1
Merge "Remove a comment from ConnectivityService"
Lucas Lin   authored and   Gerrit Code Review   commited 2020-11-20 01:10:21 +00:00
21b62782dd
Update toString() to use the correct request
Update ConnectivityService.NetworkReassignment#toString to use either
the current satisfier's request otherwise highest priority request when
executing toString(). This is part of the mulilayered request changes.

Bug: 173336774
Bug: 171991028
Test: atest FrameworksNetTests
Change-Id: Ibed6cdd4522133164b2b919f62ecc9411943f026

James Mattis   commited 2020-11-19 17:04:02 -08:00
b465e5c116
Update requestsSortedById() to sort by collection
Update requestsSortedById() to sort NetworkRequestInfo by their
nested collection of NetworkRequest objects vs a single request.
Before the NetworkRequestInfo with the request with the lowest
requestId would be sorted to the top. Now the NetworkRequestInfo
which contains the request with the lowest requestId will be
sorted to the top.

Bug: 173292541
Bug: 171991028
Test: atest FrameworksNetTests
Change-Id: I51e3c00d59443e37ddbf168c423d13df8d14fa64

James Mattis   commited 2020-11-19 17:04:02 -08:00
f8eb49ab6b
Allow a way to track the active request in an NRI
As we are now allowing for multi-layered requests in NetworkRequestInfo
(NRI), we need a way to track which of those requests ended up being
satisfied. This also includes updates to NetworkRequestInfo itself to
support multilayared requests.

Bug: 173146509
Bug: 171991028
Test: atest FrameworksNetTests
atest FrameworksNetIntegrationTests
atest CtsNetTestCasesLatestSdk
Change-Id: I7bb5a564769c90928871fe28de05195c9cfae6b5

Change-Id: Ibf37f94b53eb2e833821553e00d76fe38bfea266

James Mattis   commited 2020-11-19 17:03:51 -08:00
3f93a3146a
Merge "Clarify documentation on TEMP_NOT_METERED API" am: ca4f15b079 am: 783560bffd am: de759e0ebe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1504954

Change-Id: Ia98f52ff73000267b6c716e5033d35836d5d5f39

Sarah Chin   authored and   Automerger Merge Worker   commited 2020-11-19 19:13:46 +00:00
b236e66cfc
Merge "Clarify documentation on TEMP_NOT_METERED API" am: ca4f15b079 am: 783560bffd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1504954

Change-Id: I9c1c671478ea4e7e8db8a55f7d5a4b4fe119ff2d

Sarah Chin   authored and   Automerger Merge Worker   commited 2020-11-19 18:39:26 +00:00
de759e0ebe
Merge "Clarify documentation on TEMP_NOT_METERED API" am: ca4f15b079
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1504954

Change-Id: I36d911d227ed4ac8e7b23f52036ff384977e2248

Sarah Chin   authored and   Automerger Merge Worker   commited 2020-11-19 18:02:28 +00:00
783560bffd
Merge "Clarify documentation on TEMP_NOT_METERED API"
Sarah Chin   authored and   Gerrit Code Review   commited 2020-11-19 17:50:35 +00:00
ca4f15b079
Merge "Make MockVpn more realistic and easier to use." am: 0dd10f43c7 am: c927d555cd am: 49156dc401
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1501814

Change-Id: I949afe9dfa706ecce66f3b80a7f3e330dcc49413

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2020-11-19 12:14:27 +00:00
d591886ab8
Merge changes I3711b362,I49421183,Icc0701cb,I2f5ccc1d am: 40b4ef6dd7 am: 49038a76c2 am: 3968347b84
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1501951

Change-Id: I5e26e04f0ec77a2ea54681100d9dcfb991acdc95

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2020-11-19 12:14:00 +00:00
3dea488951
Merge "Make MockVpn more realistic and easier to use." am: 0dd10f43c7 am: c927d555cd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1501814

Change-Id: I96385c6463b791920199fd008743cddeaae6d348

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2020-11-19 11:58:00 +00:00
49156dc401
Merge changes I3711b362,I49421183,Icc0701cb,I2f5ccc1d am: 40b4ef6dd7 am: 49038a76c2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1501951

Change-Id: If8bab0ac75da87f417bc9bd925822a73002cecb7

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2020-11-19 11:57:47 +00:00
3968347b84
Merge "Make MockVpn more realistic and easier to use." am: 0dd10f43c7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1501814

Change-Id: I6584e231913841dc218573dc586429cd720621a3

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2020-11-19 10:42:04 +00:00
c927d555cd
Merge changes I3711b362,I49421183,Icc0701cb,I2f5ccc1d am: 40b4ef6dd7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1501951

Change-Id: I021b2719e8b6d76cbb64d979f1ce5f661a1a25a5

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2020-11-19 10:37:25 +00:00
49038a76c2
Merge "Make MockVpn more realistic and easier to use."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-11-19 10:32:19 +00:00
0dd10f43c7
Merge changes I3711b362,I49421183,Icc0701cb,I2f5ccc1d
* changes:
  Increase test coverage for VPN info sent to NetworkStatsService.
  Simplify MockVpn.
  Test a VPN with an underlying network that does not yet exist.
  Minor fixes to NetworkCapabilities#toString.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-11-19 10:20:00 +00:00
40b4ef6dd7
Clarify documentation on TEMP_NOT_METERED API
Test: build
Bug: 165337240
Change-Id: Ifc0843b529e7a205b0e1caf98420adfc377c28e7

Sarah Chin   commited 2020-11-19 01:15:48 -08:00
91a00f5ed5
Expose MIN_MTU_V6 as a public, @hide constant
MIN_MTU_V6 is increasingly used, and the LinkProperties version is used
as a source of truth for the constant.

Bug: 163602123
Test: atest FrameworksNetTests
Change-Id: I67134cd4fb7e2cf59c36947b62f681ac9b94ea4a

Benedict Wong   commited 2020-11-19 00:21:53 -08:00
53b6567c5e
Remove a comment from ConnectivityService
This comment is not true anymore since NetworkMonitor is not only
verifying the default network but also verifying VPN when private
DNS is enabled.

Test: Build pass.
Change-Id: Ib975aa28c84b9974a73d1baca9d5185c01b71217

lucaslin   commited 2020-11-19 16:19:10 +08:00
77e45c05e9
Make MockVpn more realistic and easier to use.
MockVpn is very difficult to use because it requires the test
caller keeping track of both the MockVpn object and an
accompanying TestNetworkAgentWrapper.

It's also not very realistic: for example, connect() doesn't
actually connect anything, it just makes it so that if
ConnectivityService tries to update the capabilities, the attempt
will not be ignored. Also, unlike the real code in Vpn, it
connects with empty NetworkCapabilities (in particular, with
empty UID ranges).

Make this easier to use and a bit more realistic by:
- Allowing TestNetworkAgentWrapper to take a "NetworkCapabilities
  template" that will form the initial capabilities sent when the
  agent registers with ConnectivityService. This allows the VPN
  to register its agent with its UID ranges already set, like the
  production code does.
- Providing separate methods to register the NetworkAgent and
  mark it connected for cases where the test needs to make
  changes to the NetworkAgent before connecting (e.g., poking
  NetworkMonitor).
- Putting the TestNetworkAgentWrapper inside MockVpn and driving
  it through MockVpn's methods. In order not to have too many
  wrapper functions (and because we can't delegate like in
  Kotlin), there's still an agent() method that returns the
  TestNetworkAgentWrapper.

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

Lorenzo Colitti   commited 2020-11-19 16:23:07 +09:00
925d1a9a82
Increase test coverage for VPN info sent to NetworkStatsService.
Bug: 173331190
Test: test-only change
Change-Id: I3711b362f31cb92b759e9f5c9d244fb88d9bd5e7

Lorenzo Colitti   commited 2020-11-19 14:56:50 +09:00
fdce3dde08
Simplify MockVpn.
This CL removes four methods in MockVpn by slightly changing the
test code to leverage the actual methods implemented by the
(production) Vpn superclass.

This works because setting mInterface results in
isRunningLocked() returning true, which makes a number of methods
behave as if the VPN is connected (which is what the test
expects).

The more realistic behaviour exposes a minor bug in the treatment
of underlying networks. Add a TODO to fix it.

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

Lorenzo Colitti   commited 2020-11-19 14:53:53 +09:00
d97d6e304b
Test a VPN with an underlying network that does not yet exist.
This test checks that if a VPN declares an underlying network
that does not exist, the capabilities of that network are applied
to the VPN as soon as the network starts to exist.

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

Lorenzo Colitti   commited 2020-11-19 14:46:32 +09:00
e50c0f8af4
Move BasicShellCommandHandler to frameworks/lib/modules-utils
BasicShellCommandHandler is used by mainline modules and the
framwork. There is a new repo that was created for putting
this kind of utility class. Move BasicShellCommandHandler for
the incoming ConnectivityService mainline and updating the
related usage.

Bug: 170598012
Test: m ; verify with adb shell cmd
Change-Id: I8a2873df6e7d8342b7a8b466bda155f74c807ee3
Merged-In: Ida30c877116090616d4bf3f87fdad835446dac84

Chiachang Wang   commited 2020-11-19 03:16:03 +00:00
2d7e03cd61
Add a test for TcpKeepalivePacketDataParcelable.toString().
Test: test-only change
Change-Id: I4c15f311e5bb328e8c74602e67d74baec3f89743

Lorenzo Colitti   commited 2020-11-18 10:53:44 +00:00
0efd39ad89
Merge "Replace InterfaceConfiguration usage with stable aidl" am: c0c71a50d6 am: 75cd8abbc7 am: 4ff4b9910f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1488356

Change-Id: Iec15205660c6a9bddb3cf644d91713a720e4178a

Chiachang Wang   authored and   Automerger Merge Worker   commited 2020-11-18 09:57:33 +00:00
50e11a6414
Merge "Replace InterfaceConfiguration usage with stable aidl" am: c0c71a50d6 am: 75cd8abbc7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1488356

Change-Id: I29d12cfa0b7ad7f048b253284077411484acc4a3

Chiachang Wang   authored and   Automerger Merge Worker   commited 2020-11-18 09:28:34 +00:00
4ff4b9910f
Merge "Replace InterfaceConfiguration usage with stable aidl" am: c0c71a50d6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1488356

Change-Id: I7be60028fb07d0d6fcc65d110c2d198a85ff2b29

Chiachang Wang   authored and   Automerger Merge Worker   commited 2020-11-18 09:14:35 +00:00
75cd8abbc7
Merge "Replace InterfaceConfiguration usage with stable aidl"
Chiachang Wang   authored and   Gerrit Code Review   commited 2020-11-18 09:05:59 +00:00
c0c71a50d6
Minor fixes to NetworkCapabilities#toString.
1. The current code only prints the array of administrator UIDs
   if it's empty. This is clearly an oversight. Print it only if
   it's non-empty.
2. Only print requestor UID and package name if they are set.
   This makes output shorter in the common case that they are
   unset.
3. Reorder the output at the end: group all UIDs together, and
   place SSID and private DNS broken bit after that.
4. Make the private DNS broken indication a single word instead
   of a sentence. This saves space and makes it easier to write
   regexps.

New format:
... SignalStrength: -72 OwnerUid: 1000 AdminUids: [1000] SSID: ...
... Uid: 1000 RequestorUid: 1000 RequestorPkg: android ...

Test: manual
Change-Id: I2f5ccc1d9e4af6ddacc4d193185a17723822972b

Lorenzo Colitti   commited 2020-11-18 17:10:11 +09:00
104d9701f9
Replace InterfaceConfiguration usage with stable aidl
Replace InterfaceConfiguration with InterfaceConfigurationParcel
for the incoming ConnectivityService mainline since mainline
modules could not use @hide API.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I17ce8741e985fd30e3c8f0c34e79564a82890dc6

Chiachang Wang   commited 2020-11-18 14:46:13 +08:00
db04f067b0
Merge "Separate 2 tests to verify canBeSatisfiedBy()" am: 59c5a7ee61 am: 2fd5ddbffd am: 1102259c8a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1495268

Change-Id: Ifcad77aabc1ee8b3ec40c7c23c61a6dfcc4e678b

Lucas Lin   authored and   Automerger Merge Worker   commited 2020-11-17 12:21:49 +00:00
e4674acfbe
Merge "Merge "Fix the comments left on aosp/1481197" am: 51a4f05ef8 am: ba157d8b07" into rvc-d1-dev-plus-aosp am: 95fd9d13c5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1494036

Change-Id: I583b1b7dd5ab13a35c41b76f1425f15b5a3117bf

Automerger Merge Worker   commited 2020-11-17 12:21:12 +00:00
38aaba118c
Merge "Separate 2 tests to verify canBeSatisfiedBy()" am: 59c5a7ee61 am: 2fd5ddbffd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1495268

Change-Id: If94d24c57b5f982180b04bad236c524183e4c5af

Lucas Lin   authored and   Automerger Merge Worker   commited 2020-11-17 11:56:30 +00:00
1102259c8a
Merge "Merge "Fix the comments left on aosp/1481197" am: 51a4f05ef8 am: ba157d8b07" into rvc-d1-dev-plus-aosp
Automerger Merge Worker   authored and   Android (Google) Code Review   commited 2020-11-17 11:56:14 +00:00
95fd9d13c5
Merge "Fix the comments left on aosp/1481197" am: 51a4f05ef8 am: ba157d8b07
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1494036

Change-Id: I6fca5804b1b70803cf0e3666da2870c299f089e5

Lucas Lin   authored and   Automerger Merge Worker   commited 2020-11-17 11:54:58 +00:00
34bf1ff904
Merge "Fix the comments left on aosp/1481197" am: 51a4f05ef8 am: ba157d8b07 am: bae14aa611
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1494036

Change-Id: Iefb07ae46a42b5ad751298470e11ec2c94716e37

Lucas Lin   authored and   Automerger Merge Worker   commited 2020-11-17 09:50:57 +00:00
dce5a4370c
Merge "Separate 2 tests to verify canBeSatisfiedBy()" am: 59c5a7ee61
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1495268

Change-Id: I8b2d43d11570f90b1bfa23c27fccb592269b16c9

Lucas Lin   authored and   Automerger Merge Worker   commited 2020-11-17 09:22:34 +00:00
2fd5ddbffd
Merge "Separate 2 tests to verify canBeSatisfiedBy()"
Lucas Lin   authored and   Gerrit Code Review   commited 2020-11-17 08:38:07 +00:00
59c5a7ee61
Merge "Fix the comments left on aosp/1481197" am: 51a4f05ef8 am: ba157d8b07
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1494036

Change-Id: Iea77eb0ed2ca0b5603d1257496bd1e8a14ed0d77

Lucas Lin   authored and   Automerger Merge Worker   commited 2020-11-17 08:11:57 +00:00
bae14aa611
Merge "Fix the comments left on aosp/1481197" am: 51a4f05ef8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1494036

Change-Id: I7f13f380db5fe30e67be9cedc9429519b9fd4b6e

Lucas Lin   authored and   Automerger Merge Worker   commited 2020-11-17 07:47:54 +00:00
ba157d8b07
Merge "Fix the comments left on aosp/1481197"
Lucas Lin   authored and   Gerrit Code Review   commited 2020-11-17 07:06:46 +00:00
51a4f05ef8
Merge changes I6a48d4db,I6741c41c,Ifec6bde5,Icd0717c5 am: 38ec07ff9e am: 63fbab6e6a am: 99b7bcd09c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490617

Change-Id: Ie76caf460ac86251cd0ceca981bdf2c7e4bcfc44

Junyu Lai   authored and   Automerger Merge Worker   commited 2020-11-12 09:47:50 +00:00
62229d3d33
Merge changes I6a48d4db,I6741c41c,Ifec6bde5,Icd0717c5 am: 38ec07ff9e am: 63fbab6e6a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490617

Change-Id: I11a56ed8d67f321a66fecc7550383db7d9f9c897

Junyu Lai   authored and   Automerger Merge Worker   commited 2020-11-12 09:35:38 +00:00
99b7bcd09c
Merge changes I6a48d4db,I6741c41c,Ifec6bde5,Icd0717c5 am: 38ec07ff9e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490617

Change-Id: I5545dddcb5c8499ac9c53325cbafd424124429e1

Junyu Lai   authored and   Automerger Merge Worker   commited 2020-11-12 09:02:13 +00:00
63fbab6e6a
Merge changes I6a48d4db,I6741c41c,Ifec6bde5,Icd0717c5
* changes:
  Remove unused variables
  Return offloaded traffic when querying from TrafficStats API
  Add hardware tethering traffic in testTethering test
  Remove unused getTetherStats

Junyu Lai   authored and   Gerrit Code Review   commited 2020-11-12 08:45:15 +00:00
38ec07ff9e
Add hardware tethering traffic in testTethering test
Test: atest com.android.server.net.NetworkStatsServiceTest#testTethering
Bug: 162292214
Change-Id: Ifec6bde5fd3231f2135f12536c42e42ec6b707de

junyulai   commited 2020-11-12 14:22:31 +08:00
2fae9c3667
Separate 2 tests to verify canBeSatisfiedBy()
In Android R, NetworkSpecifier#satisfiedBy() has changed to
NetworkSpecifier#canBeSatisfiedBy(), but its subclass -
MatchAllNetworkSpecifier hasn't.
In Android S, both of MatchAllNetworkSpecifier and
NetworkSpecifier has changed satisfiedBy() to canBeSatisfiedBy().
So if running the latest CTS on R device, it will verify
NetworkSpecifier#canBeSatisfiedBy() instead of
MatchAllNetworkSpecifier#satisfiedBy() and get the unexpected
result.
The fix is to separate 2 tests to verify canBeSatisfiedBy(), one
is for Android R or older version and the other is for Android
S+.

Bug: 172401624
Test: Run MatchAllNetworkSpecifierTest on Android R and S.
Change-Id: I1391bae9a0fc0298beb8fe80b5f388b492244566

lucaslin   commited 2020-11-12 12:48:16 +08:00
43e1a7971e
Merge "Replace the way to add legacy routing" am: e94bf1bc3c am: 1b1c460be6 am: e7ef9769d1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490244

Change-Id: Ie6fee224b995af4ace0b74a5508e21f1e008ba0b

Chiachang Wang   authored and   Automerger Merge Worker   commited 2020-11-11 06:14:25 +00:00
c2a352ecef
Merge "Replace the way to add legacy routing" am: e94bf1bc3c am: 1b1c460be6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490244

Change-Id: I363c642663877d7ac521f8e9d5729040deca7f9a

Chiachang Wang   authored and   Automerger Merge Worker   commited 2020-11-11 05:57:28 +00:00
e7ef9769d1