Commit graph

7,986 commits

Message SHA1
Ignore NetworkAgentConfigTest on Q
NetworkAgentConfig did not exist on Q.

Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkAgentConfigTest
          on Q and R devices
Bug: 150918852
Change-Id: I5414d7767c39327ff41673ff13ccd34982e10742

Remi NGUYEN VAN   commited 2020-03-09 12:04:39 +09:00
bcef708445
Skip LinkAddress tests that are R-specific on Q
Address lifetime was added in R so tests for it should not be run on Q.

Test: CtsNetTestCasesLatestSdk:android.net.LinkAddressTest on both
          devices
Bug: 150918852
Change-Id: I98b14727eabcf569829eee8df34afc057eba6f93

Remi NGUYEN VAN   commited 2020-03-09 10:42:53 +09:00
6b54308152
Ignore testReevaluateNetwork until Q
The method did not exist until Q, so the test is not relevant on such
devices.

Test: atest CtsNetTestCasesLatestSdk:android.net.CaptivePortalTest on Q
          and R devices
Bug: 150918852
Change-Id: I913b6eaa61bfd4f1964b324dcb4dd272aa8cc583

Remi NGUYEN VAN   commited 2020-03-06 18:21:45 +09:00
8966d31126
Merge "Remove polling of TetheringManager in ConnectivityManager."
Amos Bianchi   authored and   Gerrit Code Review   commited 2020-03-05 18:34:59 +00:00
ca0b6c5205
Remove polling of TetheringManager in ConnectivityManager.
Test: manual

Bug: 144742179

Change-Id: I196b320788be96c120f771d2fcdf032a73e26b5f

Amos Bianchi   commited 2020-03-05 18:34:14 +00:00
ddadca41a9
Merge "Merge stage-aosp-master to aosp-master - DO NOT MERGE"
Bill Yi   authored and   Gerrit Code Review   commited 2020-03-05 18:27:30 +00:00
04373073c6
Merge changes I794a24d0,Iab32b2db am: fb8591f9d7
Change-Id: I03f6b9e521793b92f83a21583a2e53fb1d31fba1

Automerger Merge Worker   commited 2020-03-04 13:26:51 +00:00
fffaf84a2b
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
fb8591f9d7
Merge "Accept MAINLINE_NETWORK_STACK permission on register/unregister network provider" am: 2fb2b2614c
Change-Id: I1ab6d47c17992f8630d9aba892bcef29dcb66bfa

Automerger Merge Worker   commited 2020-03-04 10:32:09 +00:00
1ce46dd2cb
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
2fb2b2614c
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
2ff245114f
Merge "Add more assertions to testStackedLinkProperties." am: fa83fdcab5
Change-Id: I6987dc9c80b8d48c8354f654f21b056d2bd896c5

Automerger Merge Worker   commited 2020-03-04 04:36:38 +00:00
6c67746c09
Merge "Add more assertions to testStackedLinkProperties."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-03-04 04:24:34 +00:00
fa83fdcab5
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
4493983bbd
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
f82f8533e7
Merge "Update NetworkInfo public API." am: a6a1df873b
Change-Id: I6658d79bd9bda22ed6b8acac90ba94c9ef18c488

Automerger Merge Worker   commited 2020-03-03 09:40:07 +00:00
2211fb37f8
Merge "Update NetworkInfo public API."
Aaron Huang   authored and   Gerrit Code Review   commited 2020-03-03 09:16:55 +00:00
a6a1df873b
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
52a97fa1b0
Merge changes from topic "del-factory-and-networkagent-wifi" am: 928a3a7216
Change-Id: I8b8e4add020ec8011bc1d41fc6537f750c309754

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

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

Automerger Merge Worker   commited 2020-03-03 03:52:17 +00:00
bd020ca7ac
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
928a3a7216
Merge "Move NetworkAgent#register to a new method."
Aaron Huang   authored and   Gerrit Code Review   commited 2020-03-03 03:37:07 +00:00
6b685976fc
[automerger skipped] Merge "Remove framework code that has moved to frameworks/libs/net" am: 00b5ec5d3d -s ours
am skip reason: Change-Id Ieb8927f9af7f87a5ae038bd6c7daeb3d70117fef with SHA-1 7dc006a340 is in history

Change-Id: Ia18edfd8fed3ec197fcacd086c4b7fe2f4b5f47d

Automerger Merge Worker   commited 2020-03-02 10:12:36 +00:00
1a249136a1
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
00b5ec5d3d
Merge "Always set NetworkInfo objects to available." am: 335ed0793b
Change-Id: I89b53d1a254ca43566286b1309ce88b8a1518c4a

Automerger Merge Worker   commited 2020-03-02 05:10:35 +00:00
418242683e
Merge "Always set NetworkInfo objects to available."
Aaron Huang   authored and   Gerrit Code Review   commited 2020-03-02 04:53:10 +00:00
335ed0793b
Merge "Add methods to send connected/disconnected state." am: 8680ec1193
Change-Id: If69bd650e129dc9f058e47832d48651b9243a3bb

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

Automerger Merge Worker   commited 2020-02-27 01:06:34 +00:00
e7c5073fd8
Merge "test: ConnectivityService: Validate Route Add/Del"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-02-27 01:00:58 +00:00
e40996b60f
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
8fac43038f
Merge "test: LinkProperties: Unique Route Destinations" am: 06774364e9
Change-Id: I9261a5e5f6b18390aac34cd25337f211b19a7641

Automerger Merge Worker   commited 2020-02-25 00:46:25 +00:00
ac66f4d150
Merge "test: LinkProperties: Unique Route Destinations"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-02-25 00:34:07 +00:00
06774364e9
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
f2db5c4e90
Merge "Remove useless thread checks" am: 269d32a0fa
Change-Id: I1dc9ce4e5ef5ca2012264fdb736606a36f20c8a3

Automerger Merge Worker   commited 2020-02-21 09:37:21 +00:00
457b79de20
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
5915b47708
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
d2297e8175
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
8d3fc4ba00
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
f76231b2b2
Merge "Sanitize owner UID iff owning app does not have location permissions." am: 90b14db3b2
Change-Id: Ie5876d063d7440aacc57d48cb4573798303910ea

Automerger Merge Worker   commited 2020-02-20 05:30:20 +00:00
69e9dd54d5
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
90b14db3b2
Merge "Update NetworkMonitor integration test constructor" am: 31b2039968
Change-Id: Idc27d7900d98eaa8ab3265d6ad6ad82b075197e5

Automerger Merge Worker   commited 2020-02-20 01:24:58 +00:00
eea9755ef2
Merge "Update NetworkMonitor integration test constructor"
Chalard Jean   authored and   Gerrit Code Review   commited 2020-02-20 01:13:05 +00:00
31b2039968
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
bf6bf08a7e
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
34dc4beda4
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
4189b8cd9b
Merge "Use framework-tethering-stub instead of framework-tethering" am: 7392615bbf
Change-Id: I2caaa5f804a510bcc18822b784c129e9b058ea03

Automerger Merge Worker   commited 2020-02-19 09:54:51 +00:00
e191e902b7
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
7392615bbf
Merge changes from topic "settings-vpn" am: 70f90282ef
Change-Id: If7e8310306889b38527bfab65316a50807814372

Automerger Merge Worker   commited 2020-02-19 07:51:20 +00:00
db9074340f