Commit Graph

8531 Commits

Author SHA1 Message Date
Chalard Jean
12dcdccc4f Revert "[NS D03] Migrate the bad wifi avoidance policy"
Revert submission 10338939

Reason for revert: The feature was punted out of R.
Reverted Changes:
I32c12702c:[NS D04] Implement a simple speed comparison betwe...
I688593cc0:[NS D03] Migrate the bad wifi avoidance policy

Change-Id: I640635a1ed94bed3b53466abe2a988caf0eca2b0
2020-02-21 06:47:35 +00:00
Chalard Jean
f892de96eb Revert "[NS D04] Implement a simple speed comparison between scores."
Revert submission 10338939

Reason for revert: The feature was punted out of R.
Reverted Changes:
I32c12702c:[NS D04] Implement a simple speed comparison betwe...
I688593cc0:[NS D03] Migrate the bad wifi avoidance policy

Change-Id: I28172721d3f3af82ac79ef2c8f61df39943d997b
2020-02-21 06:46:06 +00:00
Chalard Jean
0a32f7f818 Revert "[NS D05] Rework how to tear down networks"
Revert submission 10343065

Reason for revert: This is part of a feature that was punted out of R.
Reverted Changes:
Ic9a3d3363:[NS D05] Rework how to tear down networks
I7d815f873:[NS D06] Implement more policies
I561098476:[NS D07] Use the unmodified legacy score

Change-Id: I8d2696d15999265d79abfc9163e7e5ccad873cfe
2020-02-20 07:32:12 +00:00
Chalard Jean
47d3019bd4 Revert "[NS D06] Implement more policies"
Revert submission 10343065

Reason for revert: This is part of a feature that was punted out of R.
Reverted Changes:
Ic9a3d3363:[NS D05] Rework how to tear down networks
I7d815f873:[NS D06] Implement more policies
I561098476:[NS D07] Use the unmodified legacy score

Change-Id: I378449443f99eb0a7f01f31f53398b8f55ce87f1
2020-02-20 07:32:12 +00:00
Chalard Jean
2c34674c6a Revert "[NS D07] Use the unmodified legacy score"
Revert submission 10343065

Reason for revert: This is part of a feature that was punted out of R.
Reverted Changes:
Ic9a3d3363:[NS D05] Rework how to tear down networks
I7d815f873:[NS D06] Implement more policies
I561098476:[NS D07] Use the unmodified legacy score

Change-Id: I184817e3aa290afdbe6721a7c36332b940434d3a
2020-02-20 07:32:12 +00:00
Chalard Jean
a3fcb0d3e0 [NS D07] Use the unmodified legacy score
Ranking used to make use of the various adjustments in
ConnectivityService. These are now implemented in policy.

Test: ConnectivityServiceTest

Change-Id: I56109847678ea5cda1752511123ba652c0f4fe36
2020-02-19 22:17:13 +09:00
Chalard Jean
2adc561aa1 [NS D06] Implement more policies
Namely :
• Explicitly selected policy
• VPN policy
• Validated policy

These go together to avoid breaking any test, because multiple
tests rely on all of these working.

Test: ConnectivityServiceTest

Change-Id: I7d815f87320c2becbfc93a60a3c54346ff4f47c9
2020-02-19 22:17:12 +09:00
Chalard Jean
2a572e0a6d [NS D05] Rework how to tear down networks
Networks are torn down if they don't satisfy requests but only if
they are found unable to ever do so. This is important because
general-purpose networks typically turn up unvalidated, which
means they would get torn down immediately in the presence of
some worse network that is already validated.

Note that functionally it's the same as before for the existing
scores, except that
• An exiting network that doesn't satisfy any request is always
  torn down immediately – this is WAI
• An unmetered network is never torn down when compared to a
  metered network – this is a bugfix (previously the platform
  would tear down an unmetered cellular on grounds that it
  could not beat the performance of a metered Ethernet, but
  that's wrong ; the bug was never realized because Android
  always thinks Ethernet is unmetered)
• An unvalidated network will not be torn down if the current
  satisfier is also unvalidated, even if the satisfier is much
  faster. This is the reason for the change in the test. It's
  wrong to tear down in this case because even if much slower
  the slower network should win if it validates and the other
  doesn't.

Test: ConnectivityServiceTest
Change-Id: Ic9a3d336306a25d1272976ce467aa7c908af7bef
2020-02-19 21:27:22 +09:00
Benedict Wong
c13b9a30b6 Add always-on VPN support for platform VPNs
This commit allows Platform VPNs to be started as part of always-on
mode.

Test: FrameworksNetTests passing, new tests added in subsequent CL
Test: Manually tested.
Change-Id: I5eda88e5b406a0e425eb7424665cf702e0979324
2020-02-18 18:58:54 +00:00
Chalard Jean
d3267fd304 Merge changes I32c12702,I688593cc
* changes:
  [NS D04] Implement a simple speed comparison between scores.
  [NS D03] Migrate the bad wifi avoidance policy
2020-02-18 10:51:26 +00:00
Chalard Jean
9450bd6831 [NS D04] Implement a simple speed comparison between scores.
This is not used yet to avoid making the change too big to review,
but D05 will use this. Refer to D05 for how this is going to be
used.

Test: ConnectivityServiceTest
Change-Id: I32c12702c8bce959682b02f157946d3f37b12a0c
2020-02-18 16:15:22 +09:00
Chalard Jean
edf5386cf0 [NS D03] Migrate the bad wifi avoidance policy
Test: ConnectivityServiceTest
Bug: 113554781

Change-Id: I688593cc0379a0d2042e30fbe83e549dcb02723e
2020-02-18 16:06:10 +09:00
Benedict Wong
1297529bf9 Merge changes Ide9daebc,Id47ada57 am: 1609800ef9 am: 0cf192258c am: c95de7b476
Change-Id: Iaacfbe8b221d79e3d06d0d7ea81528db13e4611a
2020-02-18 06:35:06 +00:00
Chalard Jean
44d018295b Merge "[NS D02] Mix in the ignore on wifi policy." 2020-02-18 05:46:33 +00:00
Benedict Wong
c95de7b476 Merge changes Ide9daebc,Id47ada57 am: 1609800ef9 am: 0cf192258c
Change-Id: I712e6e42cc754db2513321b3498018b21b94161e
2020-02-17 22:23:15 +00:00
Benedict Wong
0cf192258c Merge changes Ide9daebc,Id47ada57 am: 1609800ef9
Change-Id: Ied52fed05566a0d75e82007170210205db7832a8
2020-02-17 22:01:24 +00:00
Benedict Wong
1609800ef9 Merge changes Ide9daebc,Id47ada57
* changes:
  Ensure all VPN runners clean up state when exiting
  Enforce restricted user, getConnectionOwnerUid checks
2020-02-17 21:30:35 +00:00
Lorenzo Colitti
5c8c6fc3d2 Merge changes from topics "capport_dhcpresults", "nm_cb_capport" am: 66b08c6e20 am: 7afcf10ca6 am: d45ab73281
Change-Id: Ie27e5dfd51b38194fa104cbd73f9bbe7c4395e0f
2020-02-17 14:20:04 +00:00
Chiachang Wang
cd0874d3cf Merge "Update state in NetworkInfo when network resumes" am: c27f541f1b am: 03bc93d50d am: 458d8ff0b1
Change-Id: I98e64e6197c5e79e6425f39053981f7bf389a895
2020-02-17 14:18:56 +00:00
Isabelle Taylor
f1b9ab205e [automerger skipped] Merge "Revert "Remove framework code that has moved to frameworks/libs/net"" am: 14c76eba82 am: 69075c2d1b am: 9c339214df -s ours
am skip reason: skipped by user taylori

Change-Id: If1e7e8719516855f6ad77afdb472ed96c2d0703e
2020-02-17 11:37:15 +00:00
Aaron Huang
6f0c100653 [automerger skipped] Merge "Remove framework code that has moved to frameworks/libs/net" am: 03d86d613c am: 840975d91d am: 9ad2ea5c61 -s ours
am skip reason: skipped by user huangaaron

Change-Id: I7f5c1c3a41a779512658008fafe108b1e99182ec
2020-02-17 11:31:07 +00:00
Chalard Jean
e45117e20d [NS D02] Mix in the ignore on wifi policy.
Ultimately ConnectivityService and its satellites should mix in
some measurements to NetworkScore, but in the immediate future
they'll just use this to mix in at the new format the policy it
used to managed in an ad-hoc way.

As a first mix-in, this adds mixing in the IGNORE_ON_WIFI policy,
which so far used to be handled in Connectivity as the avoidBadWifi
bit. Ultimately this should move to Telephony.

Bug: 113554781
Test: ConnectivityServiceTest
Change-Id: I4869d5eb9ea74679e57c087005ed3d9b8119fed2
2020-02-17 14:58:31 +09:00
Chalard Jean
fb8a184108 Merge "[NS D01] Remove candidates that don't satisfy the request." 2020-02-17 02:49:34 +00:00
Lorenzo Colitti
d45ab73281 Merge changes from topics "capport_dhcpresults", "nm_cb_capport" am: 66b08c6e20 am: 7afcf10ca6
Change-Id: Ife1b2c42dede9258e1f74d52583a63eb49a2e1a0
2020-02-15 17:51:12 +00:00
Lorenzo Colitti
7afcf10ca6 Merge changes from topics "capport_dhcpresults", "nm_cb_capport" am: 66b08c6e20
Change-Id: I22bbbb598aaca6ba6c73ab37d34e855ec0def48f
2020-02-15 17:36:37 +00:00
Lorenzo Colitti
66b08c6e20 Merge changes from topics "capport_dhcpresults", "nm_cb_capport"
* changes:
  Add CaptivePortalApiUrl to DhcpResults
  Send LinkProperties update on new capport data
2020-02-15 17:22:18 +00:00
Chiachang Wang
458d8ff0b1 Merge "Update state in NetworkInfo when network resumes" am: c27f541f1b am: 03bc93d50d
Change-Id: I12a729034e65d94f133cd3f3122064071cc6867e
2020-02-15 03:41:46 +00:00
Chiachang Wang
03bc93d50d Merge "Update state in NetworkInfo when network resumes" am: c27f541f1b
Change-Id: I26e4b318f7acacde38ee5cf0977fd63fc5567d79
2020-02-15 03:31:36 +00:00
Chiachang Wang
c27f541f1b Merge "Update state in NetworkInfo when network resumes" 2020-02-15 03:16:31 +00:00
Roshan Pius
7cabea934d [automerger skipped] Merge "RELAND: NetworkRequest: Embed requestor uid & packageName" am: 7fbddc35ba -s ours am: fe41d50efc am: 7a30367929
Change-Id: I499c41c4a635ed521094d45e817859298e6ee2c7
2020-02-14 20:19:30 +00:00
Benedict Wong
e503def284 [automerger skipped] Merge "Implement Ikev2VpnRunner" am: c71f8b35da am: 77053992e3 am: 32f1ad6d9f -s ours
am skip reason: skipped by user benedictwong

Change-Id: Ie1f6f8dbd10161342a7f14935def73820a68b057
2020-02-14 20:11:15 +00:00
Remi NGUYEN VAN
6cfa0140eb Send LinkProperties update on new capport data
When new CaptivePortalData is received from NetworkMonitor, send a
LinkProperties updated callback.
The updated LinkProperties only contain CaptivePortalData if the
receiver has NETWORK_SETTINGS or MAINLINE_NETWORK_STACK permissions, as
defined in the current callback code.

Test: atest FrameworksNetTests
Bug: 139269711

Change-Id: I68595a519171b31792259849efff5f58c43cacd4
2020-02-15 05:00:17 +09:00
Chalard Jean
1410bd9681 [NS D01] Remove candidates that don't satisfy the request.
This is exactly equivalent to the previous version (though a bit
more expensive) but is useful for followup changes. See [NS D03]
to see a sample of how this will be used.

Bug: 113554781
Test: FrameworksNetTests
Change-Id: I39f3c248bd2f23f7b22bd89d2e1e031653fe9ddb
2020-02-14 23:40:49 +09:00
Isabelle Taylor
9c339214df Merge "Revert "Remove framework code that has moved to frameworks/libs/net"" am: 14c76eba82 am: 69075c2d1b
Change-Id: I82f49f1256bd5f81049d8b6f224ef507e63a48fb
2020-02-14 14:00:39 +00:00
Isabelle Taylor
69075c2d1b Merge "Revert "Remove framework code that has moved to frameworks/libs/net"" am: 14c76eba82
Change-Id: I5e0b4e50352428ca5886a808b5667daffb4f2e4c
2020-02-14 13:51:45 +00:00
Isabelle Taylor
14c76eba82 Merge "Revert "Remove framework code that has moved to frameworks/libs/net"" 2020-02-14 13:42:37 +00:00
Isabelle Taylor
1b6eb64103 Revert "Remove framework code that has moved to frameworks/libs/net"
Revert "Use createRandomUnicastAddress from MacAddressUtils"

Revert "Add net-utils-framework-net to telephony-common"

Revert submission 1191997-net-utils-framework-net

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_qt-qpr1-dev-plus-aosp&target=aosp_taimen-userdebug&lkgb=6208131&lkbb=6208273&fkbb=6208273, bug b/149551544
Reverted Changes:
Ib1c807d64:Use createRandomUnicastAddress from MacAddressUtil...
I9e0f297e0:Add net-utils-framework-net to telephony-common
Ieb8927f9a:Remove framework code that has moved to frameworks...

Change-Id: I2824f781babd9f7e0bb9df524dadf6b8397dcaa1
2020-02-14 13:09:16 +00:00
Aaron Huang
9ad2ea5c61 Merge "Remove framework code that has moved to frameworks/libs/net" am: 03d86d613c am: 840975d91d
Change-Id: Ic03b259e256f935c2c625f294bea497b82b6317e
2020-02-14 10:20:07 +00:00
Aaron Huang
840975d91d Merge "Remove framework code that has moved to frameworks/libs/net" am: 03d86d613c
Change-Id: I20b8398f1fe410819f18a0afcd8646c75c594fb8
2020-02-14 09:53:36 +00:00
Aaron Huang
03d86d613c Merge "Remove framework code that has moved to frameworks/libs/net" 2020-02-14 09:42:49 +00:00
Chiachang Wang
59f5d1168c Update state in NetworkInfo when network resumes
State override is only handled when state is changed from
CONNECTED to SUSPENDED but not reverse path. Handle both ways
for SUSPENDED state.

Bug: 148678431
Test: FrameworkNetTests
Change-Id: I9333f865d61bbf008fdb8ca162ad17dfdffd1d67
2020-02-14 16:41:33 +08:00
Benedict Wong
8974a1c43a Enforce restricted user, getConnectionOwnerUid checks
This CL adds checks to ensure restricted users cannot change or
start/stop platform VPNs. In addition, this also adds checks to the
ConnectivityManager#getConnectionOwnerUid() to ensure that only
VpnService based VPNs can identify connections

Bug: 148040659
Test: FrameworksNetTests run
Change-Id: Id47ada5766036bfc84f3ba47f66f2d2683af916d
2020-02-14 00:09:47 -08:00
Roshan Pius
7a30367929 [automerger skipped] Merge "RELAND: NetworkRequest: Embed requestor uid & packageName" am: 7fbddc35ba -s ours am: fe41d50efc
Change-Id: I810f30663bfe7be230b99da7d546a552c3ef078b
2020-02-14 02:25:02 +00:00
Roshan Pius
fe41d50efc [automerger skipped] Merge "RELAND: NetworkRequest: Embed requestor uid & packageName" am: 7fbddc35ba -s ours
am skip reason: Change-Id I207c446108afdac7ee2c25e6bbcbc37c4e3f6529 with SHA-1 31f7152793 is in history

Change-Id: Ib90134e63ac00f6b377d27d1d8f2a125a247d724
2020-02-14 02:09:17 +00:00
Roshan Pius
7fbddc35ba Merge "RELAND: NetworkRequest: Embed requestor uid & packageName" 2020-02-14 01:57:49 +00:00
Benedict Wong
32f1ad6d9f Merge "Implement Ikev2VpnRunner" am: c71f8b35da am: 77053992e3
Change-Id: I0048c33ac9b5b60d2f64a90d7c5d9e5e829cf24d
2020-02-13 21:46:13 +00:00
Benedict Wong
77053992e3 Merge "Implement Ikev2VpnRunner" am: c71f8b35da
Change-Id: I9b966b52f78fa54dca9d8c3032ec26ed853ad572
2020-02-13 21:31:28 +00:00
Benedict Wong
c71f8b35da Merge "Implement Ikev2VpnRunner" 2020-02-13 21:15:24 +00:00
Benedict Wong
5245afdcb8 Implement Ikev2VpnRunner
This change adds the implementation for IKEv2/IPsec VPNs.

Bug: 144246767
Test: Manually tested
Change-Id: I5ccec756cec49ccf57ccc4d5ad800eeb5d595a76
Merged-In: I5ccec756cec49ccf57ccc4d5ad800eeb5d595a76
2020-02-13 18:37:06 +00:00
Benedict Wong
0928459c2a Merge "Implement Ikev2VpnRunner" 2020-02-13 18:36:49 +00:00