Commit Graph

1670 Commits

Author SHA1 Message Date
Paul Hu
1c2606742d Merge "Remove Settings.Global.TCP_DEFAULT_INIT_RWND on CS" am: 3d136c56ca am: f3ba1620ea am: afa9f0f918
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1635043

Change-Id: I2a83ab615ae2b40304a65f7ea8e40c6a93fc122a
2021-03-17 22:20:36 +00:00
Remi NGUYEN VAN
4417837f49 Merge "Remove usage of networkAttributes" am: 5ccc21eb9b am: 5498465192 am: 9df643d6b6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1623260

Change-Id: I84aa41ee98535b3b258e52cb67b8f7964d63851b
2021-03-17 22:18:55 +00:00
Chalard Jean
63d9588dca Merge changes I335e82e2,I84ba363d,I8f18083b,I854a952d,I00e23441 am: bf97a3ab5e am: ba22df4f9d am: 2d82b40262
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1622621

Change-Id: I5fa8e7b8bf35a5464868fdca4d115b3f9132c65f
2021-03-17 22:13:06 +00:00
Junyu Lai
2ac4e6eee4 Merge "[VCN13] Implement tracking best matching network" am: f98037abb3 am: 4377c5d40c am: b56ee13b44
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1633519

Change-Id: Ie252014cd9047c27fad3e451b80047493935dc3d
2021-03-17 16:08:50 +00:00
Chalard Jean
1cda30b0a2 Merge "[NS01] Add NetworkScore" am: 98de10a7a1 am: 18294fcbb3 am: a73e64726f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556099

Change-Id: I953a773f8914152578a98d71b43d0a2e30a51aba
2021-03-17 16:04:22 +00:00
Paul Hu
3d136c56ca Merge "Remove Settings.Global.TCP_DEFAULT_INIT_RWND on CS" 2021-03-17 14:44:17 +00:00
Remi NGUYEN VAN
5ccc21eb9b Merge "Remove usage of networkAttributes" 2021-03-17 11:24:28 +00:00
paulhu
0620c858ae Remove Settings.Global.TCP_DEFAULT_INIT_RWND on CS
TCP_DEFAULT_INIT_RWND setting has never been set before, CS
always read the tcp receive window size from
net.tcp.default_init_rwnd then set to net.tcp_def_init_rwnd.
Thus, remove the unnecessary setting from CS, and the property
doesn't need to set either. Because aosp/1639922 migrate the
properties, the default value has been set to kernel already.

Bug: 182538166
Test: atest FrameworksNetTests
Change-Id: I13e175ab4dea72446af7df4a25e307e5934fa813
2021-03-17 11:14:35 +00:00
Lucas Lin
8d638d9434 Merge "Change the parameter type from ContentResolver to Context" 2021-03-17 06:35:21 +00:00
Chalard Jean
bf97a3ab5e Merge changes I335e82e2,I84ba363d,I8f18083b,I854a952d,I00e23441
* changes:
  Remove per-user preference when the user is removed
  Expose the enterprise per-profile networking API.
  Implement setNetworkPreferenceForUser.
  Public API for per-profile network preference.
  Add tests for setNetworkPreferenceForUser
2021-03-17 05:48:18 +00:00
junyulai
8cae3c748f [VCN13] Implement tracking best matching network
This is done by:
  1. In requestNetwork, provide a basic permission check.
  2. rematchNetworksAndRequests: no change, since non listen
     requests will be automatically processed to track
     best satisfying network.
  3. applyNetworkReassignment: no change, since non-request
     will not be sent to factories.

Test: atest ConnectivityServiceTest#testRegisterBestMatchingNetworkCallback_noIssueToFactory
Test: atest ConnectivityServiceTest#testRegisterBestMatchingNetworkCallback_trackBestNetwork
Bug: 175662146
Change-Id: I8cf4ab334df6812d84cdda160e9b72b6f54062af
2021-03-16 21:30:55 +08:00
Chalard Jean
6bb468c476 Remove per-user preference when the user is removed
Test: new test for this
Change-Id: I335e82e29ec8f4c8da9def8b40153858cfd5bacb
2021-03-16 12:14:12 +00:00
Chalard Jean
38a4e7fb76 Add tests for setNetworkPreferenceForUser
Test: this
Change-Id: I00e2344118408da307439a0a993eb67cb17bf777
2021-03-16 12:11:27 +00:00
lucaslin
1162662032 Change the parameter type from ContentResolver to Context
Context is more useful than ContentResolver, it can provide more
information if we want to change the behavior in the future.

Bug: 172183305
Test: atest FrameworksNetTests
Change-Id: I5702c7d74b862a76558b94f1abe2c6df9eb7f097
Merged-In: I5702c7d74b862a76558b94f1abe2c6df9eb7f097
2021-03-16 09:26:57 +00:00
lucaslin
acd3ded007 Change the parameter type from ContentResolver to Context
Context is more useful than ContentResolver, it can provide more
information if we want to change the behavior in the future.

Bug: 172183305
Test: atest FrameworksNetTests
Change-Id: I5702c7d74b862a76558b94f1abe2c6df9eb7f097
2021-03-16 17:25:28 +08:00
Remi NGUYEN VAN
9f9922813f Remove usage of networkAttributes
networkAttributes is a legacy configuration that is now only used to
configure which legacy type networks are supported, and what the restore
timer is for that network type, for the deprecated
startUsingNetworkFeature API.

Use a dedicated resource for the restore timers, and build supported
legacy network types using hasSystemFeature for wifi, wifi p2p,
bluetooth, proxy types, and TelephonyManager.isDataCapable for the
mobile types.

Bug: 146206136
Test: atest FrameworksNetTests
Change-Id: I3a771d3de6c5e912f18d2834e3a50af797ac4991
2021-03-16 16:01:40 +09:00
Chalard Jean
98de10a7a1 Merge "[NS01] Add NetworkScore" 2021-03-16 06:36:07 +00:00
Remi NGUYEN VAN
eb46aa1c58 Merge "Create ServiceConnectivityResources" 2021-03-16 02:29:31 +00:00
Chalard Jean
dd75352682 [NS01] Add NetworkScore
As attested by numerous TODOs in the code, a new way of
representing network quality and policy is needed instead
of an int.

An int representing the quality of the network requires
all parties using it to know how all other parties are
using it, and implementation details about the decision
algorithm. For all intents and purposes, the selection
is left to individual network factories who try to
achieve a desired result while piecing together all
possible states of the system.

As the number of such cases and desires increases, this
becomes both intractable and unmaintainable. Indeed, at
this time in the codebase nobody can really predict exactly
how a given change in score will affect selection across
the board, and it is essentially impossible to figure out
the behavior of network selection by inspecting the code
because the moving parts are scattered throughout the
entire codebase.

Having an object encapsulating policy and quality values
will let us centralize the selection and make it again
possible to maintain without knowledge of all behaviors
of all network factories. It will also provide better
guarantees of respecting policy, and allow bugfixes that
were not possible before because they'd touch too many
parts of the code.

Test: FrameworksNetTests FrameworksWifiTests NetworkStackTests
Change-Id: I3185a6412b9b659798faf0c6882699e9c63cc115
2021-03-15 09:49:47 +00:00
Roshan Pius
99cac41819 Merge "ConnectivityManager: Provide API's to include location sensitive info" am: f72f1d9e28 am: 312bcb6871 am: 6519ca6217
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1595396

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icf60935623b62e29cb2ba52b4de554c7f0d78ef1
2021-03-12 07:12:03 +00:00
Paul Hu
e6a477a7d6 Merge "Stop using PackageManagerInternal in PermissionMonitor" am: 2269d7e3fa am: d5eb1fad4d am: cad9f72e91
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620879

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icc75ae78a6a09fac22cd2ae9ddc04138c4ba02d3
2021-03-12 07:11:35 +00:00
Roshan Pius
f72f1d9e28 Merge "ConnectivityManager: Provide API's to include location sensitive info" 2021-03-12 05:56:29 +00:00
Paul Hu
2269d7e3fa Merge "Stop using PackageManagerInternal in PermissionMonitor" 2021-03-12 05:23:05 +00:00
Lucas Lin
3f6f8215c3 Merge changes Ib80f814f,Ic605e489 am: 3bde652e41 am: 3912538c41 am: 9038eeece3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1626209

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I47862eeec4f74a0901b8b866dd6ffa906bd9e62f
2021-03-12 04:58:40 +00:00
Lucas Lin
3bde652e41 Merge changes Ib80f814f,Ic605e489
* changes:
  Use new API - getIpSecNetIdRange() in IpSecService
  Add a new API to get the network ID range of IPSec tunnel interface
2021-03-12 03:30:32 +00:00
Remi NGUYEN VAN
46bcf55264 Create ServiceConnectivityResources
Create the ServiceConnectivityResources package, which contains
resources Connectivity unbundled from platform resources.

Migrate the first few resources from ConnectivityService that have no
RRO in AOSP. To avoid boot time impact, avoid loading the resources in
the ConnectivityService constructor.

Bug: 182125649
Test: atest FrameworksNetTests
Merged-In: I77ac6f4303c54acc96f16e18ef02add30298ff3d
Change-Id: I77ac6f4303c54acc96f16e18ef02add30298ff3d
2021-03-12 12:09:13 +09:00
Roshan Pius
7992afdcc3 ConnectivityManager: Provide API's to include location sensitive info
Existing NetworkCallback users will get NetworkCapabilities with
location sensitive data removed (except for ownerUid which will be
added for existing apps for backwards compatibility). Apps
have to opt-in to receive location sensitive data.

Note: This was chosen because WifiInfo is the only TransportInfo tha
has location sensitive info & that was added only in Android 12. If we
choose to default to true, all existings apps retrieving
NetworkCapabilities for wifi networks will be blamed for location access
unnecessarily.

Changes:
i) Add a flag in NetworkCallback creation to retrieve
NetworkCapabilities with location sensitive info in their callback.
(More flags are being planned for NetworkCallback for throttling
callback frequency, etc)
ii) For NetworkCapabilities.getOwnerUid(), we will continue to send the
data for apps targeting older SDK (since this is an existing field and
the new flag defaults location sensitive data to off).

Bug: 156867433
Test: atest android.net
Test: atest com.android.server
Change-Id: If70b5ea6f5c8885f0c353c8df08a826d55fe7f7a
2021-03-11 18:27:18 -08:00
Remi NGUYEN VAN
f98e84932b Merge "Create ServiceConnectivityResources" into sc-dev 2021-03-12 02:10:20 +00:00
Treehugger Robot
5237f54a95 Merge changes Iac9487e8,Ifa411c7b am: 999506022f am: 007256389e am: 431f25a9da
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1622675

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If1b3f0447705f910467a52d2504ba1aaef850a80
2021-03-12 00:49:24 +00:00
Remi NGUYEN VAN
92e9f17915 Merge changes from topic "ethernet_specifier"
* changes:
  Fix common tests on Q and R
  Add Ethernet, TestNetworkSpecifier API
2021-03-11 23:51:49 +00:00
lucaslin
1a6095c4cf Add a new API to get the network ID range of IPSec tunnel interface
- Add a new API to get the network ID range of IPSec tunnel
interface.
- Use the new API in IpSecServiceTest to make sure the result is
the same. Follow-up commit will change the logic in
IpSecService#reserveNetId(), the modified test can ensure the
correctness of the new change.

Bug: 172183305
Test: atest FrameworksNetTests:IpSecServiceTest
Change-Id: Ic605e48941fc9d6482cdcd01a8adcdc9b6d586a6
2021-03-12 00:46:33 +08:00
Remi NGUYEN VAN
7f11b46a43 Add Ethernet, TestNetworkSpecifier API
Rename StringNetworkSpecifier to EthernetNetworkSpecifier (its only
production user), and make it module-lib API.
The original StringNetworkSpecifier file is actually kept to satisfy
some invalid dependencies; it will be removed separately.

This allows specifying an Ethernet interface with a non-deprecated API:
until this change the only way to do so would be to use
NetworkRequest#setSpecifier(String), which is deprecated.

Similarly, add the TestNetworkSpecifier API for TestNetworkManager, to
replace previous usage of StringNetworkSpecifier. TestNetworkManager is
module API, so TestNetworkSpecifier should be module API too. This
allows tests to request the test interface specifically, without using
the deprecated NetworkRequest#setSpecifier(String).

Bug: 179329291
Test: m
Merged-In: Iee569f5c8bbdc4bc979610e1191308281f3d4620

Change-Id: Iee569f5c8bbdc4bc979610e1191308281f3d4620
2021-03-11 23:02:02 +08:00
junyulai
f4bc12fe28 [VCN11] Make requestBackgroundNetwork requires handler
Test: atest FrameworksNetTests android.net.cts.ConnectivityManagerTest
Bug: 175662146
Change-Id: Iac9487e8de8bfdd87fc7a0153b228ae2a7ba4e19
2021-03-11 21:05:27 +08:00
junyulai
6b0a6a22a3 [VCN10] Add new API to listen for highest score network
Test: atest ConnectivityServiceTest#testRegisterBestMatchingNetworkCallback
Bug: 175662146
Change-Id: Ifa411c7b53da789c74fff7e1a95f9c9ebf5bd05c
2021-03-11 21:04:06 +08:00
Lorenzo Colitti
f9dc7cb085 Merge "Don't start clatd if disabled by vendor property." am: 91fccfe42f am: 6abc4bec40 am: 5d6c73b585
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1625702

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6989361f1dae72cb94d6e6cf6144ae61cb80c328
2021-03-11 13:02:29 +00:00
Lorenzo Colitti
91fccfe42f Merge "Don't start clatd if disabled by vendor property." 2021-03-11 12:22:34 +00:00
Lorenzo Colitti
5896890ede Merge "Unbreak extraInfo values returned to apps." am: 877ef7634f am: a035f85997 am: 61aec97dc9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1624040

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5e50ac962959387ec42ee644376e1c10df0dc677
2021-03-11 10:09:42 +00:00
Lorenzo Colitti
877ef7634f Merge "Unbreak extraInfo values returned to apps." 2021-03-11 08:06:03 +00:00
paulhu
e84e5fa270 Stop using PackageManagerInternal in PermissionMonitor
- Replace the PackageManagerInternal#getPackageList() with
receiving PACKAGE_{ADDED|REMOVED} intent.
- Also remove the onPackageChanged method because the traffaic
permissions(INTERNET, UPDATE_DEVICE_STATS) are not changed after
package changed(Disable or enable package).

Bug: 176788468
Test: atest FrameworksNetTests
Change-Id: I5505d1c77db66a7e65fc336ea0e99846e78c6b36
2021-03-11 07:16:11 +00:00
Lorenzo Colitti
35432c1375 Merge "Set extraInfo on cellular TestNetworkAgents." am: ab2f3d3cb5 am: c612271990 am: 3732b76a96
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1624039

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I41e016fa2cf4907905e3c4f9ab4dbc3d7c0ad418
2021-03-11 05:17:45 +00:00
Lorenzo Colitti
ab2f3d3cb5 Merge "Set extraInfo on cellular TestNetworkAgents." 2021-03-11 03:31:49 +00:00
Aaron Huang
0c39920728 Merge "Remove IBatteryStats from ConnectivityService module" am: f3827cf444 am: 433b9738b3 am: a100290e51
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1623262

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I58a89eee64c57fbf04e21ee0996eff435584f709
2021-03-11 03:08:13 +00:00
Aaron Huang
f3827cf444 Merge "Remove IBatteryStats from ConnectivityService module" 2021-03-11 02:04:41 +00:00
Lorenzo Colitti
4c9e202a44 Don't start clatd if disabled by vendor property.
Fix: 182333299
Test: new unit tests
Change-Id: Ic15dc4fff6a13aa916e3d2dc6203829e96ddeda4
2021-03-11 00:59:14 +09:00
Lorenzo Colitti
386f9a3662 Unbreak extraInfo values returned to apps.
These were broken by aosp/1553463, which made filterNetworkInfo
unconditionally call setDetailedState with a reason of "" and an
extraInfo of null.

Fix both synchronous getter APIs (e.g., getNetworkInfo) and
CONNECTIVITY_ACTION broadcasts by calling a new
filterForLegacyLockdown method that behaves similarly to how the
now-deleted LockdownVpnTracker#augmentNetworkInfo used to behave.

While I'm at it, move back to private a method that was public
only because LockdownVpnTracker used it.

Fix: 181855958
Test: new unit test coverage
Change-Id: I2c7b88fcec9dd36b45cb51db8d19b3ee8bad44a6
2021-03-11 00:59:14 +09:00
Lorenzo Colitti
ad4e8837af Set extraInfo on cellular TestNetworkAgents.
This makes the test more realistic, since telephony always puts
the APN name in the extraInfo field. It also makes it easy to
test that various APIs properly return the extra info without
plumbing a new parameter through TestNetworkAgentWrapper,
NetworkAgentWrapper, and InstrumentedNetworkAgent.

Also make the extraInfo and the legacyType available to tests.
This will be used in future tests that assert the contents of
extraInfo.

Bug: 181855958
Test: test-only change
Change-Id: If4eddb6cd9e70bb33e10d72aceebaea843244246
2021-03-10 23:33:08 +09:00
Chalard Jean
26453b1683 Merge "Fix a bug where listen callbacks would not be called" am: 3b50ce7a6f am: d7e0f35a90 am: 5962bf322b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1620900

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I216167c2809ddc12e4a92faedf3bb4dc5c1a56cb
2021-03-10 02:37:36 +00:00
Chalard Jean
3b50ce7a6f Merge "Fix a bug where listen callbacks would not be called" 2021-03-10 00:32:58 +00:00
Remi NGUYEN VAN
579c8c0126 Merge "Add Ethernet, TestNetworkSpecifier API" into sc-dev 2021-03-09 22:43:46 +00:00
Aaron Huang
c3f79207ef Remove IBatteryStats from ConnectivityService module
Currently ConnectivityService calls the methods in
BatteryStatsService through BatteryStatsManager so
IBatteryStats can be removed from ConnectivityService.

Bug: 171686421
Test: FrameworksNetTests
Change-Id: I559369c9900e8100cdae187bc9cec603ed85a131
2021-03-09 21:39:17 +08:00