Commit Graph

2762 Commits

Author SHA1 Message Date
Sudheer Shanka
fd8bfb3f97 Merge "Revert NPMS threshold to BFGS." into sc-dev 2021-03-30 17:51:52 +00: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
lifr
ac6614fa05 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
2021-03-29 14:51:25 +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
Sudheer Shanka
384fb5cb42 Revert NPMS threshold to BFGS.
Earlier, we changed the threshold to IMP_FG to allow
HPJs to bypass power saving network restrictions but
later we made a change to instead use network capability
for HPJs, so reverting the threshold to BGFS.

Bug: 177641226
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Ignore-AOSP-First: This depends on an earlier cl which is not in AOSP
Change-Id: I6364ca04254bdbcc3d2081a70babfbd927e0084e
2021-03-26 13:25:58 -07:00
Chiachang Wang
b439ce8bda 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.

Ignore-AOSP-First: Prevent race in automerger
Bug: 172183305
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk

(cherry picked from commit 41918d6cd1)

Change-Id: I3ff97b9bbda8839d271151165b8d99a04ae9e1f1
Merged-In: I4bc0daf5ad9e4b4043f4a897ddab16aec8f8a536
2021-03-24 03:53:29 +00:00
Treehugger Robot
d802f4898f 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: Ia73a8459e6bba6f24fc1f40cdb8cfb3177d9f9bb
2021-03-22 22:20:28 +00:00
Treehugger Robot
3935ac08fd 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
2021-03-22 21:55:45 +00:00
Treehugger Robot
a7542972b1 Merge "Shorten the name for the dump file." 2021-03-22 21:34:02 +00:00
Sudheer Shanka
81330c83ce 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: Ief4defadb6e4f5b45a7ef3d3022953244eca4788
2021-03-22 21:14:50 +00:00
Sudheer Shanka
bc0ca639a2 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
2021-03-22 20:52:52 +00:00
Lorenzo Colitti
cb938eca7b Mark most VpnServiceTest methods as @AppModeFull. am: 60b26ee453 am: f7ff930e3a am: 29ab4cfc4a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1648190

Change-Id: I2e0c1d036bd8907df22eb98fa3d4a1218c5cfdc0
2021-03-22 19:55:59 +00:00
Lorenzo Colitti
2583e758e4 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: I3fe91bf6dd3c451aa01fbd5fcc290e8125adc43b
2021-03-22 19:12:34 +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
Sudheer Shanka
0d8452ab81 Merge "Try reconnecting to wifi if it doesn't automatically connect." into sc-dev 2021-03-22 17:12:30 +00:00
Lorenzo Colitti
f7ff930e3a Mark most VpnServiceTest methods as @AppModeFull. am: 60b26ee453
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1648190

Change-Id: I6fcb53be747a5e95d58f2d84b16214cf9607a3d0
2021-03-22 15:29:05 +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
Remi NGUYEN VAN
ddd1a6b40a 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: Ifd637a65600cc1185d27b15e486fcaeb83b244db
2021-03-21 17:26:59 +00:00
Treehugger Robot
bf0c19e52f Merge "Revert^2 "Replace the usage of UidRange"" 2021-03-21 16:41:13 +00:00
Sudheer Shanka
2b5735165a 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.
Change-Id: Ic0f87b97bb58e115fe81e2d688ce0e633397da42
2021-03-21 12:24:09 +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
Sudheer Shanka
aae0d619ae 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
Ignore-AOSP-First: Submitting internally first to avoid merge conflicts
Change-Id: I31fb127ef333d39fe4697043876c7cef15d525e3
2021-03-20 04:36:47 -07:00
Remi NGUYEN VAN
66a8357ede Merge "Move connectivity AIDLs to android.net" into sc-dev 2021-03-19 10:51:22 +00:00
Remi NGUYEN VAN
9cb8dfc110 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
Ignore-AOSP-First: needs manual cherry-pick
Change-Id: I23feb26c5de2fd7a4177797a3bc1d0dcbef4ade7
2021-03-19 08:57:00 +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
Chiachang Wang
41918d6cd1 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.

Ignore-AOSP-First: Prevent race in automerger
Bug: 172183305
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: I4bc0daf5ad9e4b4043f4a897ddab16aec8f8a536
2021-03-19 00:51:19 +00:00
Anthony Stange
ed43a3d28d Merge "Revert "Replace the usage of UidRange"" am: 83f77d83fd am: 0f97255402 am: abc4b59c47
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1645769

Change-Id: I7182b6f373405d7e12f92f29e7cbaf4ab66b8a13
2021-03-18 18:23:31 +00:00
Anthony Stange
abc4b59c47 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: I86886953ab47f4d176b11d64a915e637559b3987
2021-03-18 17:41:40 +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
871e5043d3 Merge "Replace the usage of UidRange" am: 1241156261 am: 73a03e9ca8 am: 54bf54b774
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1597481

Change-Id: I3998c164b05983a4f4528ed5bef8089e89868d3f
2021-03-18 15:12:52 +00:00
Chiachang Wang
54bf54b774 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: I82fadd50f3141dab679d361cd17bf7a1f4349e9c
2021-03-18 14:28:24 +00:00
Chiachang Wang
1241156261 Merge "Replace the usage of UidRange" 2021-03-18 13:36:39 +00:00
Chalard Jean
1be69c5bb6 Merge "Fix a bug where any() returns null" am: 3a1932cd79 am: dea6a318db am: 3f46774f42
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1640139

Change-Id: Ie5f6b41c8025940a1897a2fec5feb2bc605b4d8b
2021-03-18 12:04:13 +00:00
Chalard Jean
3f46774f42 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: I07d5c7f5e2a49cf7229176abc398f4f138351920
2021-03-18 11:14:37 +00:00
Chalard Jean
3a1932cd79 Merge "Fix a bug where any() returns null" 2021-03-18 09:59:21 +00:00
Remi NGUYEN VAN
48aac8f642 Merge "Remove networkAttributes resource usage" am: 584cfc6b67 am: 5916c38d92 am: 13e433b63e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1639708

Change-Id: Ia59896f5fb23f4bdd07641485c516f30bde7588f
2021-03-17 13:17:06 +00:00
Remi NGUYEN VAN
13e433b63e Merge "Remove networkAttributes resource usage" am: 584cfc6b67 am: 5916c38d92
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1639708

Change-Id: Ib09dccf181d2d9fa9cf31e8da3d4ee7454d2dc68
2021-03-17 12:34:22 +00:00
Remi NGUYEN VAN
584cfc6b67 Merge "Remove networkAttributes resource usage" 2021-03-17 11:24:28 +00:00
Kimberly Kreider
38e41e4404 Merge "Enable networking tests to be included in partial MTS files as well as full mts." am: 6f4d35119f am: 8266302ee7 am: 17eae52145
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1531141

Change-Id: Ic16ee449e5eec1e947ac215d5aa27845c0e2e675
2021-03-17 03:48:42 +00:00
Kimberly Kreider
17eae52145 Merge "Enable networking tests to be included in partial MTS files as well as full mts." am: 6f4d35119f am: 8266302ee7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1531141

Change-Id: Id1fc29e6bfcc8422a2a2b8b0f609035b6ab9ae09
2021-03-17 03:07:27 +00:00
Kimberly Kreider
6f4d35119f Merge "Enable networking tests to be included in partial MTS files as well as full mts." 2021-03-17 02:23:54 +00:00
Chalard Jean
1705798d13 Fix a bug where any() returns null
The type needs to be specified

Test: NetworkAgentTest
Change-Id: I7128ae520cb7175f1fb9467a94edfd1a4bdeb9da
2021-03-16 21:49:29 +09:00
Remi NGUYEN VAN
f1c04fb6b3 Remove networkAttributes resource usage
Supported network types are now deduced from system features, not the
networkAttributes resource.
Update the test to expect network types to be configured as per
resources before S, and to match system features on S+.

Bug: 146206136
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Change-Id: I715924d562f439f7239c1c95d2dc5bca7095a123
2021-03-16 16:54:17 +09:00
Chalard Jean
9ade183256 Merge "[NS01.cn] Adjust calls for NetworkScore" am: bc786632cf am: 1834461387 am: 830216e3f8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1620870

Change-Id: Id40e21d52e0c8bd059f91004b69f5993652c7b54
2021-03-16 07:11:40 +00:00
Chalard Jean
830216e3f8 Merge "[NS01.cn] Adjust calls for NetworkScore" am: bc786632cf am: 1834461387
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1620870

Change-Id: Ib4318c685e4dd62ce68004041551e26437a8a631
2021-03-16 07:07:59 +00:00
Chalard Jean
bc786632cf Merge "[NS01.cn] Adjust calls for NetworkScore" 2021-03-16 06:36:07 +00:00
Lorenzo Colitti
71a25a49ff Merge "Fix NullPointerException when running testRequestBackgroundNetwork" am: 25e4e50f25 am: 79cd256ec2 am: 6643be3850
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1635299

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie3cf6439b4d2873cc12a8c0a79b815db83f4c483
2021-03-15 15:09:22 +00:00
Lorenzo Colitti
ecada021e7 Merge "Fix NullPointerException when running testRequestBackgroundNetwork" am: 25e4e50f25 am: 79cd256ec2
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1635299

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iefc6962434fd20ed37c13904227ebc0cc9ee04f4
2021-03-15 14:25:23 +00:00