Commit Graph

7943 Commits

Author SHA1 Message Date
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
3114fc2310 Merge "Update NetworkMonitor integration test constructor" am: 488af7c7d2
Change-Id: Idc27d7900d98eaa8ab3265d6ad6ad82b075197e5
2020-02-20 01:24:58 +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
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
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
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
816695b23c Merge changes from topics "capport_dhcpresults", "nm_cb_capport" am: e777d054f4
Change-Id: I22bbbb598aaca6ba6c73ab37d34e855ec0def48f
2020-02-15 17:36:37 +00:00
Lorenzo Colitti
e777d054f4 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
3a59735669 Merge "Update state in NetworkInfo when network resumes" am: 9e3dd9a78f
Change-Id: I26e4b318f7acacde38ee5cf0977fd63fc5567d79
2020-02-15 03:31:36 +00:00
Chiachang Wang
9e3dd9a78f Merge "Update state in NetworkInfo when network resumes" 2020-02-15 03:16:31 +00:00
Remi NGUYEN VAN
36f258eb33 Update NetworkMonitor integration test constructor
Add the service manager argument that is added for the notification
manager.

Test: atest FrameworksNetIntegrationTests
Bug: 139269711
Change-Id: Ie657687000a068b3892d04440b20b3408e875a00
2020-02-15 05:00:35 +09:00
Remi NGUYEN VAN
45e11181b4 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
Isabelle Taylor
a4474bd4d0 Merge "Revert "Remove framework code that has moved to frameworks/libs/net"" am: 50e2cbde28
Change-Id: I5e0b4e50352428ca5886a808b5667daffb4f2e4c
2020-02-14 13:51:45 +00:00
Isabelle Taylor
50e2cbde28 Merge "Revert "Remove framework code that has moved to frameworks/libs/net"" 2020-02-14 13:42:37 +00:00
Isabelle Taylor
175627fafb 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
2deb148476 Merge "Remove framework code that has moved to frameworks/libs/net" am: 0122cf102f
Change-Id: I20b8398f1fe410819f18a0afcd8646c75c594fb8
2020-02-14 09:53:36 +00:00
Aaron Huang
0122cf102f Merge "Remove framework code that has moved to frameworks/libs/net" 2020-02-14 09:42:49 +00:00
Chiachang Wang
aa88bca82b 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
0bd4bba07a 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
3d517a35aa [automerger skipped] Merge "RELAND: NetworkRequest: Embed requestor uid & packageName" am: 02d8578fc3 -s ours
am skip reason: Change-Id I207c446108afdac7ee2c25e6bbcbc37c4e3f6529 with SHA-1 d499517306 is in history

Change-Id: Ib90134e63ac00f6b377d27d1d8f2a125a247d724
2020-02-14 02:09:17 +00:00
Roshan Pius
02d8578fc3 Merge "RELAND: NetworkRequest: Embed requestor uid & packageName" 2020-02-14 01:57:49 +00:00
Benedict Wong
2af84b64bb Merge "Implement Ikev2VpnRunner" am: 02e9b56db8
Change-Id: I9b966b52f78fa54dca9d8c3032ec26ed853ad572
2020-02-13 21:31:28 +00:00
Benedict Wong
02e9b56db8 Merge "Implement Ikev2VpnRunner" 2020-02-13 21:15:24 +00:00
Benedict Wong
969d188edb 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
Automerger Merge Worker
ef5b92c7d2 Merge "Add Intdef annotation for eventId in logEvent" am: 2ed536a7b6
Change-Id: Ic9b5ea605164340d5c2461eb7a1a752bb5b36bad
2020-02-13 10:56:35 +00:00
Chiachang Wang
2ed536a7b6 Merge "Add Intdef annotation for eventId in logEvent" 2020-02-13 10:44:57 +00:00
Automerger Merge Worker
9dd19a4b83 Merge "Add permission check for CaptivePortal#reevaluateNetwork" am: d0f3cb625e
Change-Id: I2f9de2582025c8fc3782870b8c561ce2002abaf8
2020-02-13 06:54:50 +00:00
Chiachang Wang
d0f3cb625e Merge "Add permission check for CaptivePortal#reevaluateNetwork" 2020-02-13 06:41:53 +00:00
Chiachang Wang
2520c650cd Add Intdef annotation for eventId in logEvent
Follow API guide.

Bug: 148379628
Test: make test-api-stubs-docs-update-current-api \
      system-api-stubs-docs-update-current-api

Change-Id: I410ef06b2fa82d8ef35513086733b0fc2cf0fe06
2020-02-13 06:26:35 +00:00
Roshan Pius
08c94fb8a9 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-12 16:58:36 -08:00
Automerger Merge Worker
9e1c910fff Merge "Revert "NetworkRequest: Embed requestor uid & packageName"" am: 948f0f9878
Change-Id: I00dd341f699d2a22cc3d190b43314a49bee9062a
2020-02-12 23:55:00 +00:00
Roshan Pius
948f0f9878 Merge "Revert "NetworkRequest: Embed requestor uid & packageName"" 2020-02-12 23:36:13 +00:00
Roshan Pius
d85de75bfa Revert "NetworkRequest: Embed requestor uid & packageName"
This reverts commit d499517306.

Reason for revert: b/149425896
Bug: b/149425896

Change-Id: I9fe31509c040cc421ccb00ea60f15e6f199e8bc6
2020-02-12 23:33:43 +00:00
Automerger Merge Worker
e6f588ab90 Merge "NetworkRequest: Embed requestor uid & packageName" am: 7b59ec507c
Change-Id: Ic4f9247e18a9d1cc22b26500b47da1af2d9b011d
2020-02-12 18:51:59 +00:00
Qingxi Li
7b59ec507c Merge "NetworkRequest: Embed requestor uid & packageName" 2020-02-12 18:43:32 +00:00
Cody Kesting
d876b4ef76 Merge "Include NetworkCapabilities and LinkProperties in DataStallReport."
am: 287c4adbc9

Change-Id: If2157b0dd7d62560c77318b76e0d7d2a66c09644
2020-02-12 09:16:41 -08:00
Cody Kesting
287c4adbc9 Merge "Include NetworkCapabilities and LinkProperties in DataStallReport." 2020-02-12 16:38:38 +00:00
Automerger Merge Worker
518e36415a Merge changes from topic "NS-A44_lingerstate" am: 34587c19ce
Change-Id: Ibec8f280ad0b256d3d9b065a541063fc63d5a356
2020-02-12 15:29:30 +00:00
Chalard Jean
34587c19ce Merge changes from topic "NS-A44_lingerstate"
* changes:
  [NS B10] Cleanup : remove mRematchedNetworks
  [NS B09] Create NetworkRanker
  [NS B08] More simplification
  [NS B07] More simplification
  [NS B06] Simplification
  [NS B05] Remove old dead code
  [NS B04] Make the network selection request-major.
  [NS B03] Add debug log showing the reassignment
  [NS B02] Split out a function to apply a NetworkReassignment
  [NS B01] Move the computation loop to a separate function
  [NS A44 2/2] Apply requests after all networks rematching is computed
  [NS A44 1/2] Update linger state before processing listens
2020-02-12 15:13:10 +00:00
Chalard Jean
b10ab41350 [NS B10] Cleanup : remove mRematchedNetworks
This is better computed by the code that applies the change
than by the code that computes the reassignment

Test: FrameworksNetTests
Change-Id: I13e2764fd9b29145499085c3bb56de88a97d6c3c
2020-02-12 21:23:45 +09:00
Chalard Jean
96a4f4b8de [NS B09] Create NetworkRanker
Bug: 113554781
Test: FrameworksNetTests
Change-Id: Ia534247144f479fe896e1a6e05b906103cd10005
2020-02-12 20:57:45 +09:00