Commit graph

10,090 commits

Message SHA1
Make Tethering file NetworkRequests only if needed. am: 2bcde0fd97 am: cce64f0dd7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1556199

Change-Id: I66b565a18a850c020f1289566c646bdda1b6bd94

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-04-01 08:39:15 +00:00
bd868cd5d0
Expose upstream requirements to UpstreamNetworkMonitor. am: 0e7e32ab2c am: 9dcd8587ed
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1556198

Change-Id: I47a5bdced72c17ecc5182f57623de1ae21f29036

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-04-01 08:39:14 +00:00
9902d8c14f
Make Tethering file NetworkRequests only if needed. am: 2bcde0fd97
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1556199

Change-Id: Ieaedc7d8d7bea358b42dc4e8e5b4533c69c7c8e4

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-04-01 08:04:32 +00:00
cce64f0dd7
Expose upstream requirements to UpstreamNetworkMonitor. am: 0e7e32ab2c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1556198

Change-Id: I862c58cbf368567e88b6ed89c1f92f96c95f7243

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-04-01 08:04:31 +00:00
9dcd8587ed
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

Lorenzo Colitti   commited 2021-03-31 19:27:17 +09:00
2bcde0fd97
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

Lorenzo Colitti   commited 2021-03-31 19:27:17 +09:00
0e7e32ab2c
Check and skip certain operations if they are unsupported. am: b0f50c579b am: 7695f293a7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1658759

Change-Id: I29d4c5a2b332f6eff426393212583fae6a8c0e11

Sudheer Shanka   authored and   Automerger Merge Worker   commited 2021-03-30 23:48:30 +00:00
19d07566b9
Check and skip certain operations if they are unsupported. am: b0f50c579b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1658759

Change-Id: I8068e4beebfe928977a97e5c0241b19e5d719d06

Sudheer Shanka   authored and   Automerger Merge Worker   commited 2021-03-30 23:12:32 +00:00
7695f293a7
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

Sudheer Shanka   commited 2021-03-30 16:22:43 +00:00
b0f50c579b
[automerger skipped] Replace the usage of UidRange am: 2257ecc830 -s ours
am skip reason: skip tag Change-Id I2550cb3ddd9c72c12de0dbf9baf32eec6fa3b151 with SHA-1 00950274cb is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/13958466

Change-Id: I9e89c1a6e81b97e37254a23a4c4e28356836b77a

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-03-23 04:09:57 +00:00
20df1dc6cc
Replace the usage of UidRange
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
Merged-In: I4bc0daf5ad9e4b4043f4a897ddab16aec8f8a536
Merged-In: I2550cb3ddd9c72c12de0dbf9baf32eec6fa3b151
Change-Id: I90b3384d2a78275df9f8717dba9d654eb82036bd

Chiachang Wang   authored and   Lorenzo Colitti   commited 2021-03-23 08:51:40 +09:00
2257ecc830
Replace the usage of UidRange
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
Merged-In: I4bc0daf5ad9e4b4043f4a897ddab16aec8f8a536
Change-Id: I2550cb3ddd9c72c12de0dbf9baf32eec6fa3b151

Chiachang Wang   authored and   Lorenzo Colitti   commited 2021-03-23 08:48:41 +09:00
00950274cb
Merge "Shorten the name for the dump file." am: a7542972b1 am: 3935ac08fd
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1648668

Change-Id: Ifb3ab6932f7c562456379f960c18a57ce03e11eb

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-03-22 22:20:24 +00:00
9d3174e4cb
Merge "Shorten the name for the dump file." am: a7542972b1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1648668

Change-Id: I11f5ca67a111e7d923310b68d90f66ef383d015a

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-03-22 21:55:45 +00:00
3935ac08fd
Merge "Shorten the name for the dump file."
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-22 21:34:02 +00:00
a7542972b1
Try reconnecting to wifi if it doesn't automatically connect. am: 8bb9eb1912 am: bc0ca639a2
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1648670

Change-Id: Ibcd508be488d90fa147587dbc45de9a7066c8b8b

Sudheer Shanka   authored and   Automerger Merge Worker   commited 2021-03-22 21:15:58 +00:00
e2a709360c
Try reconnecting to wifi if it doesn't automatically connect. am: 8bb9eb1912
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1648670

Change-Id: I06fc9f6273a947811c97be0da2a642b078a372c2

Sudheer Shanka   authored and   Automerger Merge Worker   commited 2021-03-22 20:52:52 +00:00
bc0ca639a2
Mark most VpnServiceTest methods as @AppModeFull. am: 60b26ee453 am: f7ff930e3a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1648190

Change-Id: I7789fd1cfab1516948d93ab4e8cbf0882faee082

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-03-22 19:12:46 +00:00
29ab4cfc4a
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

Sudheer Shanka   commited 2021-03-22 17:26:46 +00:00
8bb9eb1912
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

Sudheer Shanka   commited 2021-03-22 17:24:46 +00:00
8d92650da9
Mark most VpnServiceTest methods as @AppModeFull. am: 60b26ee453
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1648190

Change-Id: I6fcb53be747a5e95d58f2d84b16214cf9607a3d0

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-03-22 15:29:05 +00:00
f7ff930e3a
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

Lorenzo Colitti   commited 2021-03-22 13:16:02 +00:00
60b26ee453
[automerger skipped] Merge "Revert^2 "Replace the usage of UidRange"" am: bf0c19e52f -s ours am: 1baa39f7b1 -s ours
am skip reason: skip tag Change-Id I4bc0daf5ad9e4b4043f4a897ddab16aec8f8a536 with SHA-1 c1f14634a4 is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1646849

Change-Id: I301142303402edb2a801014b937b5fbc37d1a8c7

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-03-21 17:30:02 +00:00
3e0e2d99c5
Move connectivity AIDLs to android.net am: cc305b2fa5 am: 1feb0c3076
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1596432

Change-Id: I45bfb05a3091d322b3395907d87334d406fee1cc

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-21 17:29:04 +00:00
7c031b31b9
[automerger skipped] Merge "Revert^2 "Replace the usage of UidRange"" am: bf0c19e52f -s ours
am skip reason: skip tag Change-Id I4bc0daf5ad9e4b4043f4a897ddab16aec8f8a536 with SHA-1 c1f14634a4 is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1646849

Change-Id: Id633ed17067ec06bb2a296d9e6c07a11db47978b

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-03-21 16:55:29 +00:00
1baa39f7b1
Merge "Revert^2 "Replace the usage of UidRange""
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-21 16:41:13 +00:00
bf0c19e52f
Move connectivity AIDLs to android.net am: cc305b2fa5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1596432

Change-Id: I5825db16d1fc8f41f8ec99eb08fae550aed2cbc9

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-21 16:37:03 +00:00
1feb0c3076
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

Remi NGUYEN VAN   authored and   Lorenzo Colitti   commited 2021-03-20 22:24:08 +09:00
cc305b2fa5
bpf_progs - remove unused dependencies am: b1ffd2ce9b am: 2f780deb38
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1646235

Change-Id: I7fbb943db076cf3a70686a9c208bc82798a02cf1

Maciej Żenczykowski   authored and   Automerger Merge Worker   commited 2021-03-19 09:58:37 +00:00
d65201b5a1
bpf_progs - remove unused dependencies am: b1ffd2ce9b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1646235

Change-Id: I36ee32c100eeb1f0fb89ea13fcb3c0b8c0869259

Maciej Żenczykowski   authored and   Automerger Merge Worker   commited 2021-03-19 09:38:40 +00:00
2f780deb38
bpf_progs - remove unused dependencies
Test: builds, atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9414bde566bb73b696593587db854de3fb14cdcc

Maciej Żenczykowski   commited 2021-03-19 03:39:42 +00:00
b1ffd2ce9b
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

Chiachang Wang   commited 2021-03-19 02:10:06 +00:00
2fb0846d70
Merge changes Ibe325714,I44f3dc9e am: 63be468bf4 am: 3828871130
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1644628

Change-Id: I1636d12476f44d6b1e92ecc6d5335626cc07ea76

Maciej Żenczykowski   authored and   Automerger Merge Worker   commited 2021-03-18 22:41:56 +00:00
5066bb74a5
Merge changes Ibe325714,I44f3dc9e am: 63be468bf4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1644628

Change-Id: Ic9317d85c0a8ea637dbc626b704ef354fc9e295f

Maciej Żenczykowski   authored and   Automerger Merge Worker   commited 2021-03-18 22:05:58 +00:00
3828871130
Merge changes Ibe325714,I44f3dc9e
* changes:
  fix whitespace in offload.c macro
  change PRIO_CLAT into a comment

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2021-03-18 19:53:24 +00:00
63be468bf4
Merge "Revert "Replace the usage of UidRange"" am: 83f77d83fd am: 0f97255402
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1645769

Change-Id: I05f7b4d1a54f032a57cd6a3771e016fbeafb7e40

Anthony Stange   authored and   Automerger Merge Worker   commited 2021-03-18 17:26:18 +00:00
4d66e2262b
Merge "Revert "Replace the usage of UidRange"" am: 83f77d83fd
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1645769

Change-Id: I2c1ea63ffad95538e8ae54d9cf601235191c6af0

Anthony Stange   authored and   Automerger Merge Worker   commited 2021-03-18 17:03:00 +00:00
0f97255402
Merge "Revert "Replace the usage of UidRange""
Anthony Stange   authored and   Gerrit Code Review   commited 2021-03-18 16:40:53 +00:00
83f77d83fd
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

Anthony Stange   commited 2021-03-18 16:30:59 +00:00
274c796731
Merge "Replace the usage of UidRange" am: 1241156261 am: 73a03e9ca8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1597481

Change-Id: Ib958517e695c9cec173d503954a44f3dcd6eabed

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-03-18 14:28:59 +00:00
9da0d42d61
Merge "Replace the usage of UidRange" am: 1241156261
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1597481

Change-Id: Ia6ed617c849fd8ae68874b530f108428676068e6

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-03-18 14:01:33 +00:00
73a03e9ca8
Merge "Replace the usage of UidRange"
Chiachang Wang   authored and   Gerrit Code Review   commited 2021-03-18 13:36:39 +00:00
1241156261
Merge "Fix a bug where any() returns null" am: 3a1932cd79 am: dea6a318db
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1640139

Change-Id: I12e93d0197f7920c240d9eae5d3fba2628756a20

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-03-18 11:14:33 +00:00
2b68c9c384
Merge "Fix a bug where any() returns null" am: 3a1932cd79
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1640139

Change-Id: Icb56bbae07dc6de85668c0a202829c92422cbb3d

Chalard Jean   authored and   Automerger Merge Worker   commited 2021-03-18 10:36:29 +00:00
dea6a318db
Merge "Fix a bug where any() returns null"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-03-18 09:59:21 +00:00
3a1932cd79
fix whitespace in offload.c macro
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibe325714f95a1accce8add16220a31ca15913816

Maciej Żenczykowski   commited 2021-03-18 02:34:01 -07:00
3f32a83207
change PRIO_CLAT into a comment
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I44f3dc9e3a3462f275a04ed5601370f664b985a2

Maciej Żenczykowski   commited 2021-03-18 02:33:56 -07:00
af1f314cbd
Merge "Remove networkAttributes resource usage" am: 584cfc6b67 am: 5916c38d92
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1639708

Change-Id: Iaa49de3f678181d9aaf6f009321f85c63b163689

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-17 12:34:48 +00:00
0835287e0e
Merge "Remove networkAttributes resource usage" am: 584cfc6b67
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1639708

Change-Id: I94c174ca3ee356706947f213cb05d0a47deff233

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-03-17 11:51:17 +00:00
5916c38d92
Merge "Remove networkAttributes resource usage"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-17 11:24:28 +00:00
584cfc6b67