Commit Graph

8762 Commits

Author SHA1 Message Date
TreeHugger Robot
7bcd12e7d2 Merge changes from topic "revert-10338939-YCRBMILGZV"
* changes:
  Revert "[NS D03] Migrate the bad wifi avoidance policy"
  Revert "[NS D04] Implement a simple speed comparison between scores."
2020-02-21 08:51:09 +00:00
Chalard Jean
99ae3ad2e5 Remove useless thread checks
Because we liked to be really sure.

Test: ConnectivityServiceTests
Change-Id: I8d66257777d4c5b6ca097a5f2575d0872fae05dd
2020-02-21 17:00:49 +09:00
TreeHugger Robot
e60c52cb89 Merge changes from topic "revert-10343065-HRWTWGOFZV"
* changes:
  Revert "[NS D05] Rework how to tear down networks"
  Revert "[NS D06] Implement more policies"
  Revert "[NS D07] Use the unmodified legacy score"
2020-02-21 07:53:30 +00:00
Chalard Jean
7b6b7ecc19 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
6f677ac620 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
b3ce7501b7 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
751e5a1c37 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
b104cd7c12 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
Automerger Merge Worker
589d8b524e Merge "Sanitize owner UID iff owning app does not have location permissions." am: 4d95254cb3 am: aba23b3f43 am: a06f220d24
Change-Id: I9b8fb3ff8d907ecda918a8a926edb133b742c8f1
2020-02-20 05:59:35 +00:00
Automerger Merge Worker
a06f220d24 Merge "Sanitize owner UID iff owning app does not have location permissions." am: 4d95254cb3 am: aba23b3f43
Change-Id: Ib99af41b78dc9539f2a553231e13549d348b72db
2020-02-20 05:48:02 +00:00
Automerger Merge Worker
aba23b3f43 Merge "Sanitize owner UID iff owning app does not have location permissions." am: 4d95254cb3
Change-Id: Ie5876d063d7440aacc57d48cb4573798303910ea
2020-02-20 05:30:20 +00:00
Qingxi Li
4d95254cb3 Merge "Sanitize owner UID iff owning app does not have location permissions." 2020-02-20 05:20:27 +00:00
Automerger Merge Worker
c3c2ef4641 Merge "Update NetworkMonitor integration test constructor" am: 488af7c7d2 am: 3114fc2310 am: f737906f24
Change-Id: Ifc184f8262b33ddbbad1ccc7a1ef0b67259f2e55
2020-02-20 04:31:39 +00:00
Automerger Merge Worker
71c303b424 [automerger skipped] Merge "DO NOT MERGE: RELAND: NetworkRequest: Embed requestor uid & packageName" into stage-aosp-master am: be37378755 -s ours am: 074d8a34f3 -s ours
am skip reason: subject contains skip directive

Change-Id: Ifdd6d655de499c5e64f59e7ae0ca9ae2fad62e62
2020-02-20 04:31:25 +00:00
Automerger Merge Worker
52ef685d36 [automerger skipped] Merge "DO NOT MERGE: RELAND: NetworkRequest: Embed requestor uid & packageName" into qt-qpr1-dev-plus-aosp am: ab0a3ea5f6 -s ours
am skip reason: subject contains skip directive

Change-Id: I9fb0affe108fe4656d1fafad8b04bea4bdcd3cc2
2020-02-20 04:29:03 +00:00
Automerger Merge Worker
f737906f24 Merge "Update NetworkMonitor integration test constructor" am: 488af7c7d2 am: 3114fc2310
Change-Id: Ibd4c6ad05acf81513b54b41341b6ed0203480471
2020-02-20 01:38:04 +00:00
Automerger Merge Worker
3114fc2310 Merge "Update NetworkMonitor integration test constructor" am: 488af7c7d2
Change-Id: Idc27d7900d98eaa8ab3265d6ad6ad82b075197e5
2020-02-20 01:24:58 +00:00
Automerger Merge Worker
074d8a34f3 [automerger skipped] Merge "DO NOT MERGE: RELAND: NetworkRequest: Embed requestor uid & packageName" into stage-aosp-master am: be37378755 -s ours
am skip reason: Change-Id I207c446108afdac7ee2c25e6bbcbc37c4e3f6529 with SHA-1 d499517306 is in history

Change-Id: Iac17ca3df5826eb235fbc7ef02c0a5de4f06f44e
2020-02-20 01:19:31 +00:00
Chalard Jean
488af7c7d2 Merge "Update NetworkMonitor integration test constructor" 2020-02-20 01:13:05 +00:00
Qingxi Li
b274810c34 Sanitize owner UID iff owning app does not have location permissions.
This change adds permission checking to ensure that the following
conditions are enforced in order for apps to receive the owner UID:
1. The app must be the owner of the network
2. The app must hold the FINE_LOCATION permission/appop
3. The user must have their location toggle enabled.

Bug: 142072839
Test: atest FrameworksNetTests
Change-Id: I7a981a82f1219828ee89c8c96eb9d2efd153377f
2020-02-20 01:02:42 +00:00
Roshan Pius
bc7e37d0f4 DO NOT MERGE: RELAND: NetworkRequest: Embed requestor uid & packageName
Add the requestorUid & requestorPackageName fields to
NetworkCapabilities. This is populated by CS when
a new network request is received.
These 2 requestor fields are also optionally used for network
matching. All of the regular app initiated requests will have the
requestor uid and package name set by connectivity service. Network
agents can optionally set the requestorUid and requestorPackageName
to restrict the network created only to the app that requested the network.

This will help removing the necessity for the various specifiers to embed
the uid & package name info in the specifier for network matching.

Note: NetworkSpecifier.assertValidFromUid() is deprecated & removed in
favor of setting the uid/package name on the agent to restrict the
network to a certain app (useful for wifi peer to peer API & wifi aware).

Bug: 144102365
Test: Verified that wifi network request related CTS verifier tests
pass.
Test: Device boots up and connects to wifi networks
Merged-In: I207c446108afdac7ee2c25e6bbcbc37c4e3f6529

Change-Id: I58775e82aa7725aac5aa27ca9d2b5ee8f0be4242
2020-02-19 23:12:32 +00:00
Roshan Pius
246d8d6416 DO NOT MERGE: RELAND: NetworkRequest: Embed requestor uid & packageName
Add the requestorUid & requestorPackageName fields to
NetworkCapabilities. This is populated by CS when
a new network request is received.
These 2 requestor fields are also optionally used for network
matching. All of the regular app initiated requests will have the
requestor uid and package name set by connectivity service. Network
agents can optionally set the requestorUid and requestorPackageName
to restrict the network created only to the app that requested the network.

This will help removing the necessity for the various specifiers to embed
the uid & package name info in the specifier for network matching.

Note: NetworkSpecifier.assertValidFromUid() is deprecated & removed in
favor of setting the uid/package name on the agent to restrict the
network to a certain app (useful for wifi peer to peer API & wifi aware).

Bug: 144102365
Test: Verified that wifi network request related CTS verifier tests
pass.
Test: Device boots up and connects to wifi networks
Merged-In: I207c446108afdac7ee2c25e6bbcbc37c4e3f6529

Change-Id: I58775e82aa7725aac5aa27ca9d2b5ee8f0be4242
2020-02-19 23:12:28 +00:00
Automerger Merge Worker
85c9b4749b [automerger skipped] Merge "Use framework-tethering-stub instead of framework-tethering" am: 7fa9971ec6 am: e67473517a am: e457375dba -s ours
am skip reason: Change-Id I97ef83f7f9b4c1376f373713036f5256318f1050 with SHA-1 273a3e1c54 is in history

Change-Id: I1771917998eeda2d18abb1f576e5091828651ea0
2020-02-19 23:09:23 +00:00
Automerger Merge Worker
fbcdf41d67 Merge changes from topic "settings-vpn" am: 70f90282ef am: 1758c298d0 am: 3d6f91ed37
Change-Id: Idac6e83bab50b818e2776f28da380f08000e2a42
2020-02-19 23:08:32 +00:00
Automerger Merge Worker
81fe1b0e79 [automerger skipped] Add always-on VPN support for platform VPNs am: 16e0e33c71 am: 5c1e7a12c5 am: 45493c1a50 -s ours
am skip reason: Change-Id I5eda88e5b406a0e425eb7424665cf702e0979324 with SHA-1 fb68c52267 is in history

Change-Id: Id27267529b42f1b1be90613574f91e5fe7c780e4
2020-02-19 23:08:21 +00:00
Chalard Jean
4bb5b45830 [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
c736e76394 [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
822a150c03 [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
Automerger Merge Worker
e457375dba Merge "Use framework-tethering-stub instead of framework-tethering" am: 7fa9971ec6 am: e67473517a
Change-Id: I42e51c703c47bdb5e589747047b5a4ef77a9ed82
2020-02-19 10:10:15 +00:00
Automerger Merge Worker
e67473517a Merge "Use framework-tethering-stub instead of framework-tethering" am: 7fa9971ec6
Change-Id: I2caaa5f804a510bcc18822b784c129e9b058ea03
2020-02-19 09:54:51 +00:00
Mark Chien
7fa9971ec6 Merge "Use framework-tethering-stub instead of framework-tethering" 2020-02-19 09:46:24 +00:00
Automerger Merge Worker
3d6f91ed37 Merge changes from topic "settings-vpn" am: 70f90282ef am: 1758c298d0
Change-Id: I2e4fdab485b9a94e8b2f121b21269f374b21dcb9
2020-02-19 08:07:41 +00:00
Automerger Merge Worker
45493c1a50 Add always-on VPN support for platform VPNs am: 16e0e33c71 am: 5c1e7a12c5
Change-Id: I4b1d796a7af3a9e421a330fd8ff713556c55dc67
2020-02-19 08:07:38 +00:00
Automerger Merge Worker
1758c298d0 Merge changes from topic "settings-vpn" am: 70f90282ef
Change-Id: If7e8310306889b38527bfab65316a50807814372
2020-02-19 07:51:20 +00:00
Automerger Merge Worker
5c1e7a12c5 Add always-on VPN support for platform VPNs am: 16e0e33c71
Change-Id: I9f600a9ea2002bf9a1ee88137e3a29b2c90b22ac
2020-02-19 07:51:14 +00:00
markchien
2e6ba526c9 Use framework-tethering-stub instead of framework-tethering
The non-updatable part of the platform now is built with
framework-tethering-stub, which is a stub library of
framework-tethering.

Bug: 147200698
Test: m
Change-Id: I97ef83f7f9b4c1376f373713036f5256318f1050
Merged-In: I97ef83f7f9b4c1376f373713036f5256318f1050
2020-02-19 15:10:44 +08:00
Benedict Wong
94d31add64 Add support for starting IKEv2/IPsec VPNs from settings
This commit allows the startLegacyVpn() call to start Platform VPN
profiles, allowing Settings to use the IKEv2/IPsec VPN options

When using an aliased private key, the
Ikev2VpnProfile.KEYSTORE_ALIAS_PREFIX must be prepended to the front of
the alias. This will in turn result in the fromVpnProfile() function to
pull the key from the KeyStore, as opposed to the inline-key that the
VpnManager API uses.

Bug: 148991741
Test: FrameworksNetTests passing, new tests added in subsequent CL
Test: Manually tested
Change-Id: Icbca695c353b2e12e99305676404dbf1a4495949
2020-02-19 02:44:34 +00:00
Benedict Wong
16e0e33c71 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
Merged-In: I5eda88e5b406a0e425eb7424665cf702e0979324
2020-02-18 22:13:31 +00:00
Benedict Wong
fb68c52267 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
333ca0ceec 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
1355c8b255 [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
66f497c907 [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
ea18b70ca6 Merge changes Ide9daebc,Id47ada57 am: d07db8a8da am: 3dbd79190c am: 6ed815786c
Change-Id: Iaacfbe8b221d79e3d06d0d7ea81528db13e4611a
2020-02-18 06:35:06 +00:00
Chalard Jean
d2f82a2cc3 Merge "[NS D02] Mix in the ignore on wifi policy." 2020-02-18 05:46:33 +00:00
Benedict Wong
6ed815786c Merge changes Ide9daebc,Id47ada57 am: d07db8a8da am: 3dbd79190c
Change-Id: I712e6e42cc754db2513321b3498018b21b94161e
2020-02-17 22:23:15 +00:00
Benedict Wong
3dbd79190c Merge changes Ide9daebc,Id47ada57 am: d07db8a8da
Change-Id: Ied52fed05566a0d75e82007170210205db7832a8
2020-02-17 22:01:24 +00:00
Benedict Wong
d07db8a8da 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
ea93a0ff8a Merge changes from topics "capport_dhcpresults", "nm_cb_capport" am: e777d054f4 am: 816695b23c am: b9d201b003
Change-Id: Ie27e5dfd51b38194fa104cbd73f9bbe7c4395e0f
2020-02-17 14:20:04 +00:00
Chiachang Wang
4467aed179 Merge "Update state in NetworkInfo when network resumes" am: 9e3dd9a78f am: 3a59735669 am: b96514076d
Change-Id: I98e64e6197c5e79e6425f39053981f7bf389a895
2020-02-17 14:18:56 +00:00
Isabelle Taylor
918be71821 [automerger skipped] Merge "Revert "Remove framework code that has moved to frameworks/libs/net"" am: 50e2cbde28 am: a4474bd4d0 am: 6b81d3101c -s ours
am skip reason: skipped by user taylori

Change-Id: If1e7e8719516855f6ad77afdb472ed96c2d0703e
2020-02-17 11:37:15 +00:00