Commit graph

7,981 commits

Message SHA1
Remove framework code that has moved to frameworks/libs/net
Add srcs to framework and change import path.
Remove the codes which are moved to frameworks/libs/net.

Bug: 139268426
Bug: 135998869
Bug: 138306002
Bug: 143925787
Test: atest FrameworksNetTests
      atest FrameworksTelephonyTests
      ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh

Change-Id: I44e0a8361637c2d43be2e5d033d405b22e1a149c
Merged-In: I067cdc404e5a63947c19cb75069a39ae42faa3c8
Merged-In: Ieb8927f9af7f87a5ae038bd6c7daeb3d70117fef

Aaron Huang   commited 2020-03-05 13:53:39 +08:00
adfebb8b5c
Merge changes I794a24d0,Iab32b2db am: 22d91b660a
Change-Id: I03f6b9e521793b92f83a21583a2e53fb1d31fba1

Automerger Merge Worker   commited 2020-03-04 13:26:51 +00:00
62e64ad839
Merge changes I794a24d0,Iab32b2db
* changes:
  Remove setHandler in NetworkStatsService
  Remove the need of accessing handler in NSS unit test

Junyu Lai   authored and   Gerrit Code Review   commited 2020-03-04 13:07:49 +00:00
22d91b660a
Merge "Accept MAINLINE_NETWORK_STACK permission on register/unregister network provider" am: 9f1fa12186
Change-Id: I1ab6d47c17992f8630d9aba892bcef29dcb66bfa

Automerger Merge Worker   commited 2020-03-04 10:32:09 +00:00
3c77725b74
Merge "Accept MAINLINE_NETWORK_STACK permission on register/unregister network provider"
Paul Hu   authored and   Gerrit Code Review   commited 2020-03-04 10:15:41 +00:00
9f1fa12186
Remove setHandler in NetworkStatsService
Currently, internal handler is set by setHandler after
constructing NSS object. This was introduced in ag/866187 to
access the handler in the unit test.

However, the design put NSS in a bad situation where all classes
that need handler or executor could not be final and need to be
dynamically allocated in order to get a valid handler.

Thus, since the usage of handler is removed in previous patch,
this change eliminate setHandler by initializing the handler in
the constructor.

Test: atest FrameworksNetTests
Bug: 150664039

Change-Id: I794a24d00b0ca9fdc78091e7b9ab7307e0f034b7

junyulai   commited 2020-03-04 16:01:21 +08:00
c05d1359b4
Merge "Add more assertions to testStackedLinkProperties." am: bb77aa9ddd
Change-Id: I6987dc9c80b8d48c8354f654f21b056d2bd896c5

Automerger Merge Worker   commited 2020-03-04 04:36:38 +00:00
d778ebc099
Merge "Add more assertions to testStackedLinkProperties."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-03-04 04:24:34 +00:00
bb77aa9ddd
Accept MAINLINE_NETWORK_STACK permission on register/unregister network provider
Registering/Unregistering network provider needs NETWORK_FACTORY
which is signature only permission. But mainline modules can't
grant this permission because it's not signed with platform key.
Hence, these APIs should also accept MAINLINE_NETWORK_STACK
permission that allow mainline module to register/unregister
network provider.

Bug: 150733435
Test: atest FrameworksNetTests
Change-Id: Id22113aa0db01244817b4b008f5573c5e7b317f0

paulhu   commited 2020-03-04 09:43:41 +08:00
b6ba8e84f4
Add more assertions to testStackedLinkProperties.
Check all routes that are added and removed instead of just some
of them. This is in preparation of an upcoming change that
switches to adding and creating routes by issuing direct calls to
netd.

Also rename the misleading ipv4Default route variable to
ipv4Subnet, which is what it actually is.

Bug: 142892223
Test: test-only change
Change-Id: I7d111382be215a926a7d7d4701bd3c3e94372b99

Lorenzo Colitti   commited 2020-03-03 21:48:18 +09:00
2e6a35ef5e
Merge "Update NetworkInfo public API." am: a159122013
Change-Id: I6658d79bd9bda22ed6b8acac90ba94c9ef18c488

Automerger Merge Worker   commited 2020-03-03 09:40:07 +00:00
f500dafbdb
Merge "Update NetworkInfo public API."
Aaron Huang   authored and   Gerrit Code Review   commited 2020-03-03 09:16:55 +00:00
a159122013
Remove the need of accessing handler in NSS unit test
Currently, to wait for handler becomes idle, specific message
is used and the test would wait for condition variable to be
open when the message is processed.

However, this is already done in the HandlerUtils. Thus,
there is no need to post such message manually in the handler.

Test: atest FrameworksNetTests
Bug: 150664039

Change-Id: Iab32b2dbab01634ca159dcb90fc9f929d1fed1a2

junyulai   commited 2020-03-03 16:27:03 +08:00
3123092fd5
Merge changes from topic "del-factory-and-networkagent-wifi" am: ea4d07c802
Change-Id: I8b8e4add020ec8011bc1d41fc6537f750c309754

Automerger Merge Worker   commited 2020-03-03 03:54:02 +00:00
999c531e90
New NetworkAgentConfig API to replace NetworkInfo WiFi stuff. am: cd457ea5ec
Change-Id: I94e3b25aa202e75338115f82c6db0dd0e41deb48

Automerger Merge Worker   commited 2020-03-03 03:53:58 +00:00
6bef08258f
Merge "Move NetworkAgent#register to a new method." am: 5d61bc285d
Change-Id: I4ca48f4232ad4733da5ce7f265fc911f5ff1a713

Automerger Merge Worker   commited 2020-03-03 03:52:17 +00:00
7c9677256c
Merge changes from topic "del-factory-and-networkagent-wifi"
* changes:
  Delete NetworkFactory from frameworks/base/core.
  New NetworkAgentConfig API to replace NetworkInfo WiFi stuff.

Aaron Huang   authored and   Gerrit Code Review   commited 2020-03-03 03:47:31 +00:00
ea4d07c802
Merge "Move NetworkAgent#register to a new method."
Aaron Huang   authored and   Gerrit Code Review   commited 2020-03-03 03:37:07 +00:00
5d61bc285d
[automerger skipped] Merge "Remove framework code that has moved to frameworks/libs/net" am: fcca217a94 -s ours
am skip reason: Change-Id Ieb8927f9af7f87a5ae038bd6c7daeb3d70117fef with SHA-1 5ff8baa340 is in history

Change-Id: Ia18edfd8fed3ec197fcacd086c4b7fe2f4b5f47d

Automerger Merge Worker   commited 2020-03-02 10:12:36 +00:00
7f812a02cf
Merge "Remove framework code that has moved to frameworks/libs/net"
Aaron Huang   authored and   Gerrit Code Review   commited 2020-03-02 06:23:44 +00:00
fcca217a94
Merge "Always set NetworkInfo objects to available." am: e8a5275bc9
Change-Id: I89b53d1a254ca43566286b1309ce88b8a1518c4a

Automerger Merge Worker   commited 2020-03-02 05:10:35 +00:00
9b08eb340a
Merge "Always set NetworkInfo objects to available."
Aaron Huang   authored and   Gerrit Code Review   commited 2020-03-02 04:53:10 +00:00
e8a5275bc9
Merge "Add methods to send connected/disconnected state." am: 40dba07dc3
Change-Id: If69bd650e129dc9f058e47832d48651b9243a3bb

Automerger Merge Worker   commited 2020-02-27 03:23:48 +00:00
f0de11d057
Merge "Add methods to send connected/disconnected state."
Aaron Huang   authored and   Gerrit Code Review   commited 2020-02-27 03:21:14 +00:00
40dba07dc3
Merge "test: ConnectivityService: Validate Route Add/Del" am: 08c82181ad
Change-Id: I020c5cf1da94de7a68ec70cc1a38ea70aaf703d0

Automerger Merge Worker   commited 2020-02-27 01:06:34 +00:00
bbc8c579c4
Merge "test: ConnectivityService: Validate Route Add/Del"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-02-27 01:00:58 +00:00
08c82181ad
test: ConnectivityService: Validate Route Add/Del
Validate route addition and deletion after linkProperties are
changed.

Test: atest ConnectivityServiceTest#testStackedLinkProperties
Change-Id: I18296b933e856a0f8a4c1dbd75bd35024853bfbb

Tyler Wear   commited 2020-02-24 17:23:02 -08:00
5668f7198b
Merge "test: LinkProperties: Unique Route Destinations" am: c3f8d41d4d
Change-Id: I9261a5e5f6b18390aac34cd25337f211b19a7641

Automerger Merge Worker   commited 2020-02-25 00:46:25 +00:00
fb5ed4b678
Merge "test: LinkProperties: Unique Route Destinations"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-02-25 00:34:07 +00:00
c3f8d41d4d
Update NetworkInfo public API.
Wifi needs to create these objects so it can include them
in the broadcasts.

Bug: 135998869
Test: FrameworksWifiTests
Change-Id: Ic50d9b5c65e8771708620badc3bc242a8ffbb5cc
Merged-In: Ic50d9b5c65e8771708620badc3bc242a8ffbb5cc

Chalard Jean   authored and   Aaron Huang   commited 2020-02-24 21:07:08 +08:00
4d5537853a
Merge "Remove useless thread checks" am: 269d32a0fa
Change-Id: I1dc9ce4e5ef5ca2012264fdb736606a36f20c8a3

Automerger Merge Worker   commited 2020-02-21 09:37:21 +00:00
bb87d5aeb5
New NetworkAgentConfig API to replace NetworkInfo WiFi stuff.
Bug: 139268426
Test: FrameworkWifiTests
Change-Id: Id13fcf41e05fd1eb26c86717e2684c724b94e401
Merged-In: Id13fcf41e05fd1eb26c86717e2684c724b94e401

Chalard Jean   authored and   Aaron Huang   commited 2020-02-21 16:08:17 +08:00
cd457ea5ec
Remove useless thread checks
Because we liked to be really sure.

Test: ConnectivityServiceTests
Change-Id: I8d66257777d4c5b6ca097a5f2575d0872fae05dd

Chalard Jean   commited 2020-02-21 17:00:49 +09:00
99ae3ad2e5
Move NetworkAgent#register to a new method.
Calling IPC in a constructor is unusual and confusing, and can be
considered bad form. There are multiple reasons for this :
• Users can't obtain an instance of the class without calling the
  constructor, but they can't always afford an IPC where they need
  this, forcing them to know about the implementation detail and
  sometimes design around it.
• On a related but generalized note, constructors should usually
  be fast for the same range of reasons.
• Having a separate method to register the agent simply gives more
  flexibility to the app.
• It's also a lot easier to test.
But also we can't fix it without an update to the API, so here it is.

Another reason for doing this is consistency with the NetworkProvider
API.

Bug: 138306002
Bug: 139268426
Test: atest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
Change-Id: I1ee5c7b1353d581e487c8a8a159009bebd781643
Merged-In: I1ee5c7b1353d581e487c8a8a159009bebd781643
(clean cherry-pick from internal branch)

Chalard Jean   authored and   Aaron Huang   commited 2020-02-21 14:54:18 +08:00
5863a71547
Add methods to send connected/disconnected state.
Also add methods to set the legacy subtype and the APN name.
These have to be added together because they have to be used
together.

Bug: 138306002
Bug: 139268426
Test: atest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
Change-Id: Ie90b8d290eab490061d5cb066744b67d597b9469
Merged-In: Ie90b8d290eab490061d5cb066744b67d597b9469
(clean cherry-pick from internal branch)

Chalard Jean   authored and   Aaron Huang   commited 2020-02-20 19:37:16 +08:00
3946b0ac1e
Merge "Sanitize owner UID iff owning app does not have location permissions." am: 4d95254cb3
Change-Id: Ie5876d063d7440aacc57d48cb4573798303910ea

Automerger Merge Worker   commited 2020-02-20 05:30:20 +00:00
aba23b3f43
Merge "Sanitize owner UID iff owning app does not have location permissions."
Qingxi Li   authored and   Gerrit Code Review   commited 2020-02-20 05:20:27 +00:00
4d95254cb3
Merge "Update NetworkMonitor integration test constructor" am: 488af7c7d2
Change-Id: Idc27d7900d98eaa8ab3265d6ad6ad82b075197e5

Automerger Merge Worker   commited 2020-02-20 01:24:58 +00:00
3114fc2310
Merge "Update NetworkMonitor integration test constructor"
Chalard Jean   authored and   Gerrit Code Review   commited 2020-02-20 01:13:05 +00:00
488af7c7d2
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

Qingxi Li   commited 2020-02-20 01:02:42 +00:00
b274810c34
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

Roshan Pius   authored and   Benedict Wong   commited 2020-02-19 23:12:32 +00:00
bc7e37d0f4
Always set NetworkInfo objects to available.
For all networks, NetworkInfo.isAvailble has basically always
been true for all connected networks. The new NetworkAgent API
sets it to false, and this causes application breakage. Always
set it to true.

Bug: 148126438
Test: builds, boots, searching in maps works again
Change-Id: Ia9876b0ce7f02120bd05cab526346cad22cf62b3
Merged-In: Ia9876b0ce7f02120bd05cab526346cad22cf62b3
(clean cherry-pick from internal branch)

Lorenzo Colitti   authored and   Aaron Huang   commited 2020-02-19 12:23:49 +00:00
23d813be73
Merge "Use framework-tethering-stub instead of framework-tethering" am: 7fa9971ec6
Change-Id: I2caaa5f804a510bcc18822b784c129e9b058ea03

Automerger Merge Worker   commited 2020-02-19 09:54:51 +00:00
e67473517a
Merge "Use framework-tethering-stub instead of framework-tethering"
Mark Chien   authored and   Gerrit Code Review   commited 2020-02-19 09:46:24 +00:00
7fa9971ec6
Merge changes from topic "settings-vpn" am: 70f90282ef
Change-Id: If7e8310306889b38527bfab65316a50807814372

Automerger Merge Worker   commited 2020-02-19 07:51:20 +00:00
1758c298d0
Add always-on VPN support for platform VPNs am: 16e0e33c71
Change-Id: I9f600a9ea2002bf9a1ee88137e3a29b2c90b22ac

Automerger Merge Worker   commited 2020-02-19 07:51:14 +00:00
5c1e7a12c5
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

markchien   commited 2020-02-19 15:10:44 +08:00
2e6ba526c9
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

Benedict Wong   commited 2020-02-19 02:44:34 +00:00
94d31add64
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

Benedict Wong   commited 2020-02-18 22:13:31 +00:00
16e0e33c71
test: LinkProperties: Unique Route Destinations
Routes will always have unique destinations. Update tests
to use unique destinations when adding multiple routes.

Test: treehugger
Change-Id: I238899b0643407a1be29eb66d28728ca5d5dbc80

Tyler Wear   commited 2020-02-18 11:12:17 -08:00
44999a7247