Commit Graph

14477 Commits

Author SHA1 Message Date
Treehugger Robot
6f7e10d3ef Merge changes from topic "connectivitymanager-blockedreason-shim" am: bea56fbe11 am: 0cbabb7316
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1676430

Change-Id: Ib905d9247d8b19c5854a707f2870478be4b98eb8
2021-04-15 10:00:43 +00:00
Lorenzo Colitti
12bcbe5efa Don't expose raw IBinder APIs.
APIs should not expose raw IBinder objects.

Fix: 184735751
Test: builds, boots
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Test: atest CtsNetTestCases:android.net.cts.DnsResolverTest
Change-Id: Ia0c4170def31123f0b79318fec2cfe02e4fcd3bf
2021-04-15 18:47:21 +09:00
Chalard Jean
3c824eca72 Add documentation
Bug: 185121472
Test: doc-only change
Change-Id: I5fd68b209959043f6fe15ac34629c51233fea596
2021-04-15 18:07:56 +09:00
Treehugger Robot
0cbabb7316 Merge changes from topic "connectivitymanager-blockedreason-shim" am: bea56fbe11
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1676430

Change-Id: I6d9dc4e6fd3fa832efbafa4893cc20dccfe3d7a3
2021-04-15 08:27:32 +00:00
Chiachang Wang
7ceeabe0da Remove hidden method link in public addRoute API
The build will complain after moving connectivity framework code
outside framework because the hidden methods/members accesses are
not allowed anymore. Link to a hidden class will not work since
it's not visible in public.

Bug: 182859030
Test: make docs
Change-Id: I5726f80be7cf92b648ce851d9601d5f58bc2b647
2021-04-15 16:21:00 +08:00
Treehugger Robot
bea56fbe11 Merge changes from topic "connectivitymanager-blockedreason-shim"
* changes:
  Fix CtsNetTestCasesLatestSdk in AOSP.
  Use the non-API static UserHandle.getUid method in tests.
  Import ConnectivityManager.BLOCKED_REASON_* from ConstantsShim.
2021-04-15 07:30:24 +00:00
Chiachang Wang
3270871367 Extend framework-connectivity.impl visibility
Allow netlegacy22.api to use hidden connectivity methods.

Bug: 182859030
Test: m
Change-Id: I92936afb9fb533ea3b426490eb9617389f99fc8b
2021-04-15 13:06:39 +08:00
Lorenzo Colitti
ddeb269ca0 Fix CtsNetTestCasesLatestSdk in AOSP.
This test suite is broken in AOSP due to a number of tests that
depend on S APIs. We attempted to prevent those tests running on
R builds with:

@IgnoreUpTo(Build.VERSION_CODES.R)

but this is not sufficient for them to pass when the test is
compiled against the R SDK (e.g., in CtsNetTestCasesLatestSdk).
This is because when compiling against the R SDK, the test uses
the API 30 shims, which throw UnsupportedApiLevelException even
though the method actually exists on device.

Fix this using:

    assumeTrue(shouldTestSApis());

This is not great, but at least it unbreaks the tests for now.

Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.ConnectivityManagerTest
Change-Id: Ifee0aea5afef6bd4bc762a4b1f25fc05e562d49a
2021-04-15 13:30:02 +09:00
Lorenzo Colitti
7ba366de0b Use the non-API static UserHandle.getUid method in tests.
The code was updated in AOSP to use the new non-static
UserHandle#getUid(int), which is only available in S or above.
This fails to build in mainline-prod. Instead of defining a shim
for this, simply use an older method that takes a userId.

Bug: 165835257
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Test: CtsNetTestCasesLatestSdk:android.net.cts.ConnectivityManagerTest
Change-Id: Id529f8b201cc871aa3155aef0f44574d88040c2d
2021-04-15 13:20:02 +09:00
Junyu Lai
19a7cda181 Merge "Add CTS to verify NetworkAgent#setLingerDuration" into sc-dev 2021-04-15 03:23:54 +00:00
Lorenzo Colitti
aa9db67edc Import ConnectivityManager.BLOCKED_REASON_* from ConstantsShim.
This is needed for the tests to compile in mainline-prod.

Bug: 165835257
Test: atest CtsNetTestCases:android.net.ConnectivityManagerTest
Change-Id: I32924824e9968996f379e31f1b28eb6a8f29bc5d
2021-04-15 10:25:46 +09:00
Lorenzo Colitti
c7048ed83d Merge "Test ConnectivityManager module-lib APIs for VPNs and blocking." am: f6875cc583 am: 682cb315ee am: fcdf0c2894
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1671528

Change-Id: I1217a2475b0aeb58910570fe3046f0949f41af37
2021-04-14 17:21:44 +00:00
Lorenzo Colitti
52d0924665 Merge "Test ConnectivityManager module-lib APIs for VPNs and blocking." am: f6875cc583 am: 682cb315ee am: ddc265e884
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1671528

Change-Id: I17293cdf47468d634c3a6c26ea1673aa3a799b57
2021-04-14 16:59:58 +00:00
Lorenzo Colitti
fcdf0c2894 Merge "Test ConnectivityManager module-lib APIs for VPNs and blocking." am: f6875cc583 am: 682cb315ee
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1671528

Change-Id: Iaa2d6c4b497eba6a0340094294ba0c6f2ff74f04
2021-04-14 16:10:55 +00:00
Lorenzo Colitti
ddc265e884 Merge "Test ConnectivityManager module-lib APIs for VPNs and blocking." am: f6875cc583 am: 682cb315ee
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1671528

Change-Id: Ib3605afe37ef9ffab8008a187f99816b37c1bad8
2021-04-14 16:10:37 +00:00
Lorenzo Colitti
682cb315ee Merge "Test ConnectivityManager module-lib APIs for VPNs and blocking." am: f6875cc583
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1671528

Change-Id: I4d3f3c905fde3e9da08df5c3efa203fe570a2407
2021-04-14 15:29:03 +00:00
Lorenzo Colitti
f6875cc583 Merge "Test ConnectivityManager module-lib APIs for VPNs and blocking." 2021-04-14 14:46:29 +00:00
junyulai
3a7d92513f Fix CTS fail to register network callback since lack of permission
Currently, NetworkCallbackTest gets the capabilities of current
active network to track the network used for the tests. And
construct the request with the capabilities gets from the
network. This causes test fails if the capabilities contain
signal strength, since it requires NETWORK_SIGNAL_STRENGTH_WAKEUP
to be declared.

Thus, this patch null out several fields from capabilities
of the current active network to construct the new request
in order to prevent over-specifying the requirement.

Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideNetworkCallbackTests
Bug: 182516128
Change-Id: Ib79b38e63ad2083c29fd71a24b8686b3f6f4e12f
2021-04-14 22:18:39 +08:00
junyulai
cfb2af8659 Add CTS to verify NetworkAgent#setLingerDuration
Test: this
Bug: 184227264
Fix: 184796264
Ignore-AOSP-First: prevent merge conflict
Change-Id: I77818685b2bfea499c0294874d205544161677c5
2021-04-14 20:46:20 +08:00
Chalard Jean
85e65c8fc1 Allow network providers to set the linger duration.
Test: atest CtsNetTestCases:NetworkAgentTest#testSetLingerDuration
Ignore-AOSP-First: prevent merge conflict
CTS-Coverage-Bug: 184796264
Bug: 184227264
Change-Id: I7f420faa40863385114705d6971cf00887d03318
2021-04-14 20:26:12 +08:00
Remi NGUYEN VAN
254ba1512a Fix proguard rules for Struct in NetworkStack am: 9a82bbf368 am: 9aaeab539b am: 54024858a6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1674688

Change-Id: I4262236535ec9e1c7ff46ca84723e673647fb3c9
2021-04-14 06:12:25 +00:00
Remi NGUYEN VAN
00ca0671b4 Fix proguard rules for Struct in NetworkStack am: 9a82bbf368 am: 9aaeab539b am: 237561ebdf
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1674688

Change-Id: Id9ea41e2831af5a01e3088dc1d3feca89946c926
2021-04-14 06:11:59 +00:00
Remi NGUYEN VAN
237561ebdf Fix proguard rules for Struct in NetworkStack am: 9a82bbf368 am: 9aaeab539b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1674688

Change-Id: I722885350e2514dbf7af5c58602e6b94bd876ff8
2021-04-14 05:45:19 +00:00
Remi NGUYEN VAN
54024858a6 Fix proguard rules for Struct in NetworkStack am: 9a82bbf368 am: 9aaeab539b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1674688

Change-Id: I815875d909142ae2b1d860a3009daeafad23ab8c
2021-04-14 05:45:19 +00:00
Remi NGUYEN VAN
9aaeab539b Fix proguard rules for Struct in NetworkStack am: 9a82bbf368
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1674688

Change-Id: I49cf42126e03c4fd449577bd1167dd74dec1b6a5
2021-04-14 05:03:26 +00:00
Lorenzo Colitti
f40b20ec1c Merge "Add @RedactionType annotations to VpnTransportInfo." am: 97b4639efa am: 7dc61be0da am: b09793ab41
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1674568

Change-Id: I1193382337088113bf64a636b0b70429d28f8be6
2021-04-14 03:00:32 +00:00
Lorenzo Colitti
b09793ab41 Merge "Add @RedactionType annotations to VpnTransportInfo." am: 97b4639efa am: 7dc61be0da
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1674568

Change-Id: I3c13a27c78cb824d366095edbf37d30527978def
2021-04-14 02:33:11 +00:00
Remi NGUYEN VAN
9a82bbf368 Fix proguard rules for Struct in NetworkStack
All members of the Struct class need to be kept, not just the constructor.

Change-Id: I8705234eb2608c0dfe324c517b8885a93271b6c2
Test: m
2021-04-14 01:30:59 +00:00
Lorenzo Colitti
7dc61be0da Merge "Add @RedactionType annotations to VpnTransportInfo." am: 97b4639efa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1674568

Change-Id: I4febfa2d96c678decff23eb08e40ba0e33e4c7bf
2021-04-14 01:24:19 +00:00
Lorenzo Colitti
a34d4892a4 Add @RedactionType annotations to VpnTransportInfo.
This is in response to API council feedback.

Test: m
Bug: 185226718
Change-Id: I63d7249e7d14ac00558f311a3583f6adbf80e3d9
2021-04-14 00:28:19 +09:00
easoncylee
942a988249 Move CtsHostsideNetworkTests to group presubmit-large
The test config takes longer than 15mins to run. Move it to a dedicated
group for running slow presubmit Test Mapping test.

Some more context is in the referenced bug, e.g, b/174495337
The group will work exactly the same as presubmit for now.

Bug: 174654670
Bug: 174495337
Test: none
Change-Id: I7fe1286ed952a6058c56c36f28b4832947edb69f
2021-04-13 22:26:06 +08:00
Pedro Loureiro
386aeaa3d9 Merge "Add lint baseline to address NewApi errors" into sc-dev 2021-04-13 14:12:41 +00:00
Chiachang Wang
229de02f5b Merge "Extend framework-connectivity.impl visibility to more test" into sc-dev 2021-04-13 13:27:45 +00:00
Chiachang Wang
9c03e7354f Merge "Update the method based on API feedback" am: 0a5d964242 am: 80a70a3679 am: e1601cf66f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1671535

Change-Id: I329efe2b35dd49c9e68b5e2ac2d860627ac456c7
2021-04-13 13:06:43 +00:00
Chiachang Wang
bb996c3b1d Merge "Make getUid a method on UserHandle itself instead of static" am: 9500ca6b5f am: e2a6a92c30 am: c3f73bd1ac
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669185

Change-Id: Ic0b7887630c00404ff354c193b82a96930940556
2021-04-13 13:06:43 +00:00
Chiachang Wang
b014b5fdef Merge "Update the method based on API feedback" am: 0a5d964242 am: 80a70a3679 am: 807d7f2e41
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1671535

Change-Id: I3e3c69bbef95a6a4303a94f69dfa4415bfc1d11c
2021-04-13 13:04:56 +00:00
Chiachang Wang
e1601cf66f Merge "Update the method based on API feedback" am: 0a5d964242 am: 80a70a3679
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1671535

Change-Id: I59dcbafe7b0f0f9b6d87e69d2e6f3e2276a69ce3
2021-04-13 11:54:57 +00:00
Chiachang Wang
c3f73bd1ac Merge "Make getUid a method on UserHandle itself instead of static" am: 9500ca6b5f am: e2a6a92c30
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669185

Change-Id: Icc006ab751a1a03aa3c09c1999a6141ff061081d
2021-04-13 11:54:57 +00:00
Chiachang Wang
807d7f2e41 Merge "Update the method based on API feedback" am: 0a5d964242 am: 80a70a3679
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1671535

Change-Id: I13071221d470bd633ef8337889b803a388bcab05
2021-04-13 11:54:13 +00:00
Pedro Loureiro
57bc16e08a Add lint baseline to address NewApi errors
We are enabling a new lint check where the min sdk != compile sdk.
It has produced a lot of errors and adding the baseline file(s)
allows us to continue work without introducing more problems.

Bug: 150847901

Test: m lint-check
Change-Id: Ide8a8fe80ba31396f23853ab266afcbcc33af9a6
2021-04-13 10:51:51 +01:00
Chiachang Wang
80a70a3679 Merge "Update the method based on API feedback" am: 0a5d964242
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1671535

Change-Id: I9d85af6567422f0b5a05173ba58593137cb1181d
2021-04-13 08:51:12 +00:00
Chiachang Wang
e2a6a92c30 Merge "Make getUid a method on UserHandle itself instead of static" am: 9500ca6b5f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669185

Change-Id: If47dccc346aa78c7cb49aafbd5e07d35d3403c6a
2021-04-13 08:51:12 +00:00
Lorenzo Colitti
b84176e9f9 Test ConnectivityManager module-lib APIs for VPNs and blocking.
This CL adds tests for:
- ConnectivityManager#setsetLegacyLockdownVpnEnabled
- ConnectivityManager#setRequireVpnForUids
- NetworkCallback#onBlockedStatusChanged(Network, int)

Bug: 165835257
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Change-Id: Ie9b73ec2a1634f3b3a3eb4d21acbe0803b77c70d
2021-04-13 17:30:49 +09:00
Chiachang Wang
0a5d964242 Merge "Update the method based on API feedback" 2021-04-13 08:15:47 +00:00
Chiachang Wang
9500ca6b5f Merge "Make getUid a method on UserHandle itself instead of static" 2021-04-13 08:15:47 +00:00
Chiachang Wang
426a6de6b3 Extend framework-connectivity.impl visibility to more test
Allow captive portal tests to use hidden connectivity methods.

Bug: 182859030
Test: m
Change-Id: I2c51cbefa6d56c7ec53bacfffe735fa9d14c6510
2021-04-13 12:53:06 +08:00
Paul Hu
247b7233b4 Merge "Replace FIRST_SDK_INT to DEVICE_INITIAL_SDK_INT in Connectivity" into sc-dev 2021-04-13 02:05:21 +00:00
Lorenzo Colitti
36cd857c9e Fix a tethering crash when a 464xlat upstream disconnects. am: a329e8c984 am: dadc2fe3bb am: 0a250d57b5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1671533

Change-Id: I92cecaffe32a0d61cf630cd84f95c0857cb226e7
2021-04-12 17:04:20 +00:00
Lorenzo Colitti
a5c6a21b79 Fix a tethering crash when a 464xlat upstream disconnects. am: a329e8c984 am: dadc2fe3bb am: ffc11490ca
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1671533

Change-Id: I1b6408bd3274425de53f04afeaa9b3e79c16c99c
2021-04-12 17:03:54 +00:00
Lorenzo Colitti
ffc11490ca Fix a tethering crash when a 464xlat upstream disconnects. am: a329e8c984 am: dadc2fe3bb
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1671533

Change-Id: Ia7e17399aa5da6bbb84419ef2d840cf14ee70ea9
2021-04-12 16:15:17 +00:00