Commit Graph

9532 Commits

Author SHA1 Message Date
Chalard Jean
fe2c8cf87c [automerger skipped] Merge "Address nit from aosp/1301317" into rvc-dev am: 75fddad9b4 -s ours
am skip reason: Change-Id If5e5439b22f05e08a293fd83da4d54f6a4363ca5 with SHA-1 1f9e9ce3d5 is in history

Change-Id: Ifaf50fb9e04b1403cc75d9002e46c6955e111a40
2020-05-21 07:04:30 +00:00
Chalard Jean
3743eca9f2 [automerger skipped] Merge "Fix a bug where VPNs start out suspended on cellular" into rvc-dev am: 8c06a845ac -s ours
am skip reason: Change-Id I3e4ff990c0d4825b21c7679be29a482a2d1324ec with SHA-1 91a1beddcc is in history

Change-Id: I22ecee256894e850f85ab02b299136283ebe9a08
2020-05-21 07:03:53 +00:00
Chalard Jean
cb21e90728 [automerger skipped] Merge "Fix a bug where a spurious capabilities callback is sent." into rvc-dev am: acdacbfe65 -s ours
am skip reason: Change-Id Id7d8bba486bada1a7ba5b0f152d2aa02e407f249 with SHA-1 8c5e45895d is in history

Change-Id: I655cca7c9e1ba6ba4fae95b221b1e46e91da5f6d
2020-05-21 07:02:51 +00:00
Chalard Jean
75fddad9b4 Merge "Address nit from aosp/1301317" into rvc-dev 2020-05-21 06:44:30 +00:00
Chalard Jean
8c06a845ac Merge "Fix a bug where VPNs start out suspended on cellular" into rvc-dev 2020-05-21 06:43:56 +00:00
Treehugger Robot
436608cf39 Address nit from aosp/1301317
Test: atest ConnectivityServiceTest#testVpnSetUnderlyingNetworks
Bug: 150570873
Original-Change: https://android-review.googlesource.com/1307374
Merged-In: If5e5439b22f05e08a293fd83da4d54f6a4363ca5
Change-Id: If5e5439b22f05e08a293fd83da4d54f6a4363ca5
2020-05-21 05:12:41 +00:00
Chalard Jean
fc7054d0e9 Fix a bug where VPNs start out suspended on cellular
As NetworkAgent is in a transition where all agents need
to include the NOT_SUSPENDED capability as part of their
migration to the system API, ConnectivityService adds it
forcefully to all agents that don't have the CELLULAR
transport. This doesn't include VPNs when VPNs have some
cellular network as their underlying network.

The best way to solve this is to make sure the VPN
capabilities reflect those of the underlying networks as
far as the NOT_SUSPENDED capability is concerned. This
is how they work for other similar capabilities.

This also happens to contain a drive-by fix for an issue
with a spurious capabilities callback is triggered when
a VPN connects and it has any underlying network (which
means almost always, because it will take the default
network if it doesn't declare any). Fixing this was
necessary to have a cogent test of this issue, but it
could be moved to another patch or it could stay unfixed
with some minor ajustment to the tests if judged too
dangerous to include in R at this point.

Test: New tests in this patch. Also manually tested with
      tcpdump as described in b/150570873.
Bug: 150570873
Original-Change: https://android-review.googlesource.com/1301317
Merged-In: I3e4ff990c0d4825b21c7679be29a482a2d1324ec
Change-Id: I3e4ff990c0d4825b21c7679be29a482a2d1324ec
2020-05-21 05:10:37 +00:00
Chalard Jean
1112dd3d83 Fix a bug where a spurious capabilities callback is sent.
When a VPN connects and it has any underlying network (which
means almost always, because it will take the default network
if it doesn't declare any), it has default capabilities and
will only take the capabilities of its underlying network
as part of an update happening after making the network
available but before the rematch can take place. This in turn
causes the capabilities callback sent as part of the rematch
to be spuriously sent.

Test: FrameworksNetTests. Also tested together with a
      followup that adds tests with drive-by coverage for this.
Bug: 150570873
Original-Change: https://android-review.googlesource.com/1305393
Merged-In: Id7d8bba486bada1a7ba5b0f152d2aa02e407f249
Change-Id: Id7d8bba486bada1a7ba5b0f152d2aa02e407f249
2020-05-21 05:09:15 +00:00
Remi NGUYEN VAN
bd08afe9e1 Merge "Add integration test for capport API" am: f2853503c3 am: 987e504c1e
Change-Id: Ib0051ca4bf36f88cac7ab15741c0a7e8bc53c005
2020-05-20 09:42:15 +00:00
Remi NGUYEN VAN
987e504c1e Merge "Add integration test for capport API" am: f2853503c3
Change-Id: I9e4ebb0e6746806a466544261def371eff4c8e21
2020-05-20 09:41:45 +00:00
Remi NGUYEN VAN
c8e627feb5 Add integration test for capport API
Add a test to verify the ConnectivityService / NetworkMonitor
integration around the captive portal API.

Test: atest ConnectivityServiceIntegrationTest
Bug: 156062304
Change-Id: I4eed02e09fc4943c011d871c58ba97ec572c7763
2020-05-20 15:11:14 +09:00
Treehugger Robot
faff36977c Merge "Add an exported flag in integration tests manifest" am: 17df6cbb6d am: 2d35a023b5
Change-Id: I566ae57dc9a64636a72aba836f61d1686f5377c9
2020-05-19 10:20:31 +00:00
Treehugger Robot
2d35a023b5 Merge "Add an exported flag in integration tests manifest" am: 17df6cbb6d
Change-Id: Iadfaca436895055de90e8018f881b07a6bab4bea
2020-05-19 09:58:50 +00:00
Treehugger Robot
17df6cbb6d Merge "Add an exported flag in integration tests manifest" 2020-05-19 09:32:39 +00:00
Remi NGUYEN VAN
cdd6f0e9ea Add an exported flag in integration tests manifest
(partial cherry-pick of internal change:
I4457ff2bd466a4c56fed2570e110f251031c2385)

With b/150232615, we will need an explicit value set for the exported
flag when intent filters are present, as the default behavior is
changing for S+. This change adds the value reflecting the previous
default to the manifest.

These changes were made using an automated tool, the xml file may be
reformatted slightly creating a larger diff. The only "real" change is
the addition of "android:exported" to activities, services, and
receivers that have one or more intent-filters.

Bug: 150232615
Test: TH
Merged-In: I4457ff2bd466a4c56fed2570e110f251031c2385
Change-Id: I65a1ca1678048bbf09edc9a0485b673644c8109d
2020-05-19 17:53:32 +09:00
Cody Kesting
16ead64d17 Merge "Move Data Stall logic to CS from NetworkMonitorCallbacks." am: 8a38affcbf am: 07b9ebd24f
Change-Id: I3b6facc6220c5818565fc8d0ed3d1cad4bede2af
2020-05-18 18:29:29 +00:00
Cody Kesting
07b9ebd24f Merge "Move Data Stall logic to CS from NetworkMonitorCallbacks." am: 8a38affcbf
Change-Id: I0884098a86de1e96b93dd1c753d7863641f34f0b
2020-05-18 17:38:34 +00:00
Cody Kesting
8a38affcbf Merge "Move Data Stall logic to CS from NetworkMonitorCallbacks." 2020-05-18 17:21:21 +00:00
Cody Kesting
e4e4239b68 [automerger skipped] Merge "Create TestApi for simulating a Data Stall on ConnectivityService." into rvc-dev am: aa921179de -s ours
am skip reason: Change-Id Icad439efa2ab4c872c21d3ee6ceaae8c5b49f18d with SHA-1 b5c7abd071 is in history

Change-Id: Idb6ea8087b39242e1bab79d7227107303a81f59d
2020-05-15 15:56:40 +00:00
Cody Kesting
e1fa6e1eed [automerger skipped] Merge "Set owner and administrator UIDs for test networks." into rvc-dev am: 52655a00d0 -s ours
am skip reason: Change-Id I3a974700aa1d83cb285295ed1de0aa263e2e5b58 with SHA-1 ba3433669a is in history

Change-Id: I378c8d86396f0a8ddb803b86ef8426b4dca1c153
2020-05-15 15:56:20 +00:00
Treehugger Robot
b0af0ee400 Merge "Address nit from aosp/1301317" am: 14a5bf9510 am: 7b20fde8c9
Change-Id: I7ae9b80954309b18eb6923da3aeaab3d1b8e3231
2020-05-15 07:14:29 +00:00
Treehugger Robot
7b20fde8c9 Merge "Address nit from aosp/1301317" am: 14a5bf9510
Change-Id: I2443c5da4b69bce693a39e894c41db5b25b6cf03
2020-05-15 07:03:31 +00:00
Treehugger Robot
14a5bf9510 Merge "Address nit from aosp/1301317" 2020-05-15 06:43:42 +00:00
Benedict Wong
b1368b92eb Merge "Add methods for IKEv2/IPsec test mode profiles" am: 0dfb2b7b68 am: c2bdca3a27
Change-Id: I353d999ebcdd108a900abfe20be232e83147b6d2
2020-05-15 02:51:43 +00:00
Benedict Wong
c2bdca3a27 Merge "Add methods for IKEv2/IPsec test mode profiles" am: 0dfb2b7b68
Change-Id: I9ff22188a641fce6b7bd44f7619d1b825988667a
2020-05-15 02:35:39 +00:00
Benedict Wong
0dfb2b7b68 Merge "Add methods for IKEv2/IPsec test mode profiles" 2020-05-15 02:18:02 +00:00
Cody Kesting
aa921179de Merge "Create TestApi for simulating a Data Stall on ConnectivityService." into rvc-dev 2020-05-14 18:56:36 +00:00
Cody Kesting
52655a00d0 Merge "Set owner and administrator UIDs for test networks." into rvc-dev 2020-05-14 18:56:16 +00:00
Remi NGUYEN VAN
8f06ddccbe [automerger skipped] Merge "Use the new NetworkStackConnector constructor" into rvc-dev am: 2404bc617a -s ours
am skip reason: Change-Id I46f247268310e12d420531745a22e93cf3550e89 with SHA-1 8e2758aa42 is in history

Change-Id: I6e4c65d2d8fb53a2f39d2c94e020f171f50de2b2
2020-05-14 00:12:01 +00:00
Remi NGUYEN VAN
cc0836c5e6 Use the new NetworkStackConnector constructor
The constructor was changed to allow for unit tests.

Bug: 137328719
Test: atest FrameworksNetIntegrationTests
Original-Change: https://android-review.googlesource.com/1295360
Merged-In: I46f247268310e12d420531745a22e93cf3550e89
Change-Id: I46f247268310e12d420531745a22e93cf3550e89
2020-05-13 09:18:52 +00:00
Benedict Wong
cb09f72f47 Add methods for IKEv2/IPsec test mode profiles
This change adds the ability for IKEv2/IPsec VPN profiles to run on Test
Networks. If enabled, the IKEv2/IPsec VPN profiles will request ONLY
test networks.

Bug: 148582947
Test: FrameworksNetTests passing
Test: Added for testing
Change-Id: I2511b39b27a1e29ae97907cdb12728d13fb1628f
2020-05-12 22:55:55 -07:00
Remi NGUYEN VAN
a8e2c32155 [automerger skipped] Merge "Send full LinkProperties to NetworkMonitor" into rvc-dev am: 4c0ddfa692 -s ours
am skip reason: Change-Id Ifd4e9c02a6b9a2b2b8b254fc4da7bfb9e0a84550 with SHA-1 3b1d8b491d is in history

Change-Id: Ic5d0d8461cbaf0a75da92b47d2d0aaa7a7743fb6
2020-05-13 00:48:39 +00:00
Remi NGUYEN VAN
4c0ddfa692 Merge "Send full LinkProperties to NetworkMonitor" into rvc-dev 2020-05-13 00:34:41 +00:00
Cody Kesting
6784cf6966 Move Data Stall logic to CS from NetworkMonitorCallbacks.
This change moves the logic for handling Data Stall notifications from
NetworkMonitorCallbacks to ConnectivityService. This avoids duplicate
logic for managing data stall simulation requests from
ConnectivityManager. This also puts all of the logic for proxying Data
Stall notifications to the ConnectivityDiagnosticsHandler into one
place.

Bug: 148032944
Test: atest ConnectivityDiagnosticsManagerTest
Change-Id: Ie2f6a1a2376c5c452750ab417cb5e8c24fc44fc3
2020-05-12 16:24:46 -07:00
TreeHugger Robot
d4cd49c306 [automerger skipped] Merge changes I37dd459d,I1959f308 into rvc-dev am: 0cd6d1cb70 -s ours
am skip reason: Change-Id I37dd459d08b57b14f72f3b28ea80fa231b152f10 with SHA-1 d06d390b20 is in history

Change-Id: I0b5556bcaa27ca0a379f910bfba80aec506348c9
2020-05-12 20:41:03 +00:00
Automerger Merge Worker
f4a7e96585 Create TestApi for simulating a Data Stall on ConnectivityService.
This change adds a TestApi for simulating a Data Stall to
ConnectivityService. This allows for Data Stalls to be triggered without
having to manipulate the signals used by NetworkMonitor . This also
allows NetworkMonitor to update the ways it detects Data Stalls without
affecting CTS tests for ConnectivityDiagnosticsManager.

Bug: 148032944
Test: atest ConnectivityDiagnosticsManagerTest
Change-Id: Icad439efa2ab4c872c21d3ee6ceaae8c5b49f18d
Merged-In: Icad439efa2ab4c872c21d3ee6ceaae8c5b49f18d
(cherry picked from commit b06463a002eb6215e9dda64e599eabd74cb56382)
2020-05-12 20:34:50 +00:00
Cody Kesting
ccfd0ff534 Set owner and administrator UIDs for test networks.
This change sets the owner and administrator UIDs for test networks when
their initial values match the UID for the app creating the test
network. This ensures that apps registering test networks can only make
themselves owners / administrators of the network.

Bug: 153449964
Test: atest NetworkAgentTest
Change-Id: I3a974700aa1d83cb285295ed1de0aa263e2e5b58
Merged-In: I3a974700aa1d83cb285295ed1de0aa263e2e5b58
(cherry picked from commit 35782280a2adceec96b8e03c217788afa05894a0)
2020-05-12 20:33:42 +00:00
Cody Kesting
59827dcf92 Merge "Create TestApi for simulating a Data Stall on ConnectivityService." am: 727f0d1d44 am: 1d81e3c69e
Change-Id: I17839cd271d984f76c203889293cc51375bb8bcb
2020-05-12 17:27:09 +00:00
Cody Kesting
51edeeeb65 Merge "Set owner and administrator UIDs for test networks." am: eb44b7b1bb am: e4e48c22c5
Change-Id: I7af702ff5eafbd0f5bb2247e0debf975e51accd1
2020-05-12 17:26:44 +00:00
Cody Kesting
1d81e3c69e Merge "Create TestApi for simulating a Data Stall on ConnectivityService." am: 727f0d1d44
Change-Id: Ie14ab9cbcf8f7b291fb88f4b4abedab1b5978c3e
2020-05-12 17:10:10 +00:00
Cody Kesting
e4e48c22c5 Merge "Set owner and administrator UIDs for test networks." am: eb44b7b1bb
Change-Id: I3b1c29b30912c4dddc3524a9a28fb3ad8c3ac318
2020-05-12 17:09:14 +00:00
Cody Kesting
727f0d1d44 Merge "Create TestApi for simulating a Data Stall on ConnectivityService." 2020-05-12 16:52:35 +00:00
Cody Kesting
eb44b7b1bb Merge "Set owner and administrator UIDs for test networks." 2020-05-12 16:52:07 +00:00
Remi NGUYEN VAN
1b0c8e3945 Send full LinkProperties to NetworkMonitor
Set the parcelSensitiveFields bit when sending LinkProperties to
NetworkMonitor, so that the captive portal API URL is not lost.

Test: atest ConnectivityServiceIntegrationTest (see followup change)
Bug: 156062304
Original-Change: https://android-review.googlesource.com/1307833
Merged-In: Ifd4e9c02a6b9a2b2b8b254fc4da7bfb9e0a84550
Change-Id: Ifd4e9c02a6b9a2b2b8b254fc4da7bfb9e0a84550
2020-05-12 09:14:38 +00:00
Remi NGUYEN VAN
52fcc84889 Merge "Send full LinkProperties to NetworkMonitor" am: 7d8b7603ab am: 16192b71ae
Change-Id: I7e81f65e4b8f22a646dba191748133841a569d44
2020-05-12 08:53:53 +00:00
Remi NGUYEN VAN
16192b71ae Merge "Send full LinkProperties to NetworkMonitor" am: 7d8b7603ab
Change-Id: Ib33f33a1998b61b980315e7278162e57f8f56cf2
2020-05-12 08:37:41 +00:00
Remi NGUYEN VAN
7d8b7603ab Merge "Send full LinkProperties to NetworkMonitor" 2020-05-12 08:13:05 +00:00
Chalard Jean
986a8a1b76 Merge "Fix a bug where VPNs start out suspended on cellular" am: bd3a7f994d am: cbb9c78350
Change-Id: I368308ded731b221be7fae6ddf1723c587ae4d20
2020-05-11 04:59:35 +00:00
Chalard Jean
cbb9c78350 Merge "Fix a bug where VPNs start out suspended on cellular" am: bd3a7f994d
Change-Id: Ic28ed72f30d49da7bd137b4d4db125b895025ed0
2020-05-11 04:46:46 +00:00
Chalard Jean
1f9e9ce3d5 Address nit from aosp/1301317
Test: atest ConnectivityServiceTest#testVpnSetUnderlyingNetworks
Bug: 150570873
Change-Id: If5e5439b22f05e08a293fd83da4d54f6a4363ca5
2020-05-11 13:25:16 +09:00