Commit graph android_packages_modules_Co.../framework
Message SHA1
Merge changes from topic "QosCallbackException"
* changes:
  CTS test for QosCallbackException
  Expose constructor of Exceptions.

Sewook Seo   authored and   Gerrit Code Review   commited 2022-03-19 00:35:28 +00:00
7a4fcf4ed1
Expose constructor of Exceptions.
Exposing constructor of Exceptions for test purpose.

CTS-Coverage-Bug: 224059548
BUG: 215240597
BUG: 216368595
Test: build
Change-Id: I20af104a891e94873715ab46ecabc3e775638c8c

sewookseo   commited 2022-03-17 18:05:56 +00:00
e7c481452e
Add a method to create a TAP interface without bringing it up.
In S, the behaviour of createTunInterface and createTapInterface
changed so that they bring up the interface before returning it.
This makes it difficult to test code that brings interfaces up
itself, such as IpClient or EthernetManager, because the tests
cannot predict whether that code will see the interface up
or not. This leads to flaky tests and can even make it impossible
to reliably test some behaviour.

Add a method that allows the caller to specify whether to bring
up the interface or not.

Test: new codepath tested by other CL in topic
Test: existing codepaths already well-covered
Change-Id: I0f7698f4dad132f201db4203e65a78c6af564ab2

Lorenzo Colitti   authored and   Xiao Ma   commited 2022-03-17 13:42:34 +00:00
333d5e52f5
Rename setAccessUids to setAllowedUids
Bug: 217725769
Test: ConnectivityServiceTest CtsNetTestCases
Change-Id: Ic8a3f91553d1462b7f54259c467fb90a950bdd59
Merged-In: I8860fbb353eedf5d01e9dc248e4d765046bd562c

Chalard Jean   authored and   Sooraj Sasindran   commited 2022-03-16 17:58:20 +00:00
de665266cd
Merge "Use int array for included and excluded uids"
Sooraj Sasindran   authored and   Gerrit Code Review   commited 2022-03-16 17:56:08 +00:00
2ccbfe9d8f
Merge changes from topic "ethernet_mainline"
* changes:
  Fix the NPE thrown when starting Ethernet service in OS lower than T.
  Remove the stub ethernet service from Connectivity module.
  Update hidden API files for EthernetManager API move.
  Provide a stub ethernet service to build in sc-mainline-prod.
  Build ethernet framework source into framework-connectivity-tiramisu

Patrick Rohr   authored and   Gerrit Code Review   commited 2022-03-16 16:03:30 +00:00
6dde8ac532
Use int array for included and excluded uids
Use int array for included and excluded uids so that uses
same data type as in PreferentialNetworkServiceConfig

Bug: 217365439
Test: ran connectivity service unit tests
Change-Id: I9ac7e6498df2fd20b8397b2c110296e019c7389e

Sooraj Sasindran   commited 2022-03-16 07:19:11 +00:00
4904176454
Merge "API review: Additional comment for QosSession."
Sewook Seo   authored and   Gerrit Code Review   commited 2022-03-15 10:10:27 +00:00
c8fadc5cde
Merge "Add a NetworkAgent API to indicate that a network will be replaced."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-03-15 04:44:16 +00:00
9f6e6c4e27
Build ethernet framework source into framework-connectivity-tiramisu
- move ethernet APIs, build it into framework-connectivity-tiramisu
- start ethernet service from ConnectivityServiceInitializer
- fix EthernetManager dependnecy in Tethering module
- fix EthernetNetworkSpecifier dependency in framework-connectivity
- fix the ethernet related config resource

Bug: 210586283
Test: m
Test: atest FrameworksNetTests EthernetServiceTests
Change-Id: I54857b8517649048a343c72797668394d5225766
Merged-In: I54857b8517649048a343c72797668394d5225766

Xiao Ma   commited 2022-03-14 14:06:35 +00:00
0a171c006c
Add a NetworkAgent API to indicate that a network will be replaced.
This is useful for link layers that disconnect but know they will
reconnect to a similar network soon, and do not want the device
to switch to another network until the reconnect happens. An
example is wifi switching to another network that is on a
different subnet without the device switching to cellular data.

This works by immediately destroying the network, so the link
layer can reuse the same interface name for the new network. It
would be possible to delay destroying the network until the new
network connects, but in practice this does not seem useful,
because the if the link layer reuses the interface, then the
interface will be undergoing reconfiguration, and will likely
not be usable for app traffic.

This CL also moves the call to onNetworkDestroyed into
destroyNativeNetwork. This is needed to ensure that the new
API calls onNetworkDestroyed even though most teardown
operations have not happened. This causes onNetworkDestroyed to
happen before the netId is marked free, but that shouldn't cause
any behavioural changes because netId allocation is an
implementation detail of ConnectivityService and is not
observable by apps or system components.

Bug: 216567577
Test: builds, boots
Test: atest FrameworksNetTests FrameworksNetIntegrationTests
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Test: atest CtsNetTestCases:android.net.cts.NetworkAgentTest#testDestroyAndAwaitReplacement
Change-Id: I9f9e022fef66b31a29cce560413321075e992756

Lorenzo Colitti   commited 2022-03-14 21:52:37 +09:00
ffa2ed3d1c
Merge "Rename redactNetworkCapabilitiesForPackage and update its javadoc"
Lucas Lin   authored and   Gerrit Code Review   commited 2022-03-14 08:05:08 +00:00
ba61dca57c
API review: Additional comment for QosSession.
Additional comment on getSessionId in QosSession.

Bug: 216368595
Test: build
Change-Id: I0575253ef490e3d456e69816d52075c2d10813f0

sewookseo   authored and   Sewook Seo   commited 2022-03-10 22:28:15 +00:00
5f703feca1
Merge "Split updateMeteredNetwork{Allow, Deny}List into add and remove"
Mark Chien   authored and   Gerrit Code Review   commited 2022-03-09 05:00:58 +00:00
cc29690fc1
Split updateMeteredNetwork{Allow, Deny}List into add and remove
Split the updateXXX methods into an addXXX and removeXXX instead of using
a boolean parameter to indicate whether the uid should be added or removed

Bug: 218494748
Test: atest FrameworksNetTests
Change-Id: I868cf35c8f51b25d8719e618c6c48a5cd642da7f

markchien   commited 2022-03-09 11:17:27 +08:00
e46042b833
Merge "Remove ConnectivityManager swapActiveStatsMap API"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-03-08 06:31:23 +00:00
5635d505e0
Merge "API review: Addional documentation for QosFilter"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-03-07 09:45:13 +00:00
3b45bca306
API review: Addional documentation for QosFilter
Improve API document for matchecLocalAddress & matchesRemoteAddress

Bug: 188798655
Test: Build
Change-Id: Ic74e34469677364d3b1aa1fbf802f12c66b22461

sewookseo   authored and   Sewook Seo   commited 2022-03-07 06:56:11 +00:00
4aac074872
Remove ConnectivityManager swapActiveStatsMap API
swapActiveStatsMap is temporary added for the NetworkStatsFactory to
call BpfNetMaps#swapActiveStatsMap in tethering mainline module. Now
NetworkStatsFactory already be mainlined, calling BpfNetMaps#swapActiveStatsMap
directly.

Bug: 218494448
Test: atest ConnectivityCoverageTests
      atest FrameworksNetTests
Change-Id: I3358e4ac5fb7ed0964273afdbccd1b4128ca7645

markchien   commited 2022-03-07 12:25:47 +08:00
49e944cc1c
Merge "Rename getVpnRequiresValidation to isVpnValidationRequired"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-03-03 00:10:54 +00:00
978370cb9c
Rename redactNetworkCapabilitiesForPackage and update its javadoc
The API won't modify the passed NetworkCapabilities and
LinkProperties, but redactNetworkCapabilitiesForPackage and
redactLinkPropertiesForPackage sound like they will. To reduce
the confusion, rename the API with prefix "getRedacted".
Also modify the javadoc to describe more about what the API will
do if the given UID doesn't have location permission.

Bug: 220367512
Test: atest CtsNetTestCases
Change-Id: I964f1062da1ae96df9b369b911486da1379b8a19

lucaslin   commited 2022-03-02 10:56:57 +08:00
d2b0613814
Rename getVpnRequiresValidation to isVpnValidationRequired
Update API name from getVpnRequiresValidation to
isVpnValidationRequired according to API review feedback.

Test: atest FrameworksNetTests
Bug: 220129160
Change-Id: I1025f4c35b320c14e872eaffd7ed82658a5f3d0c

Chiachang Wang   commited 2022-03-02 01:02:45 +00:00
7ec6ae74c8
Rename framework-connectivity-tiramisu to framework-connectivity-t
Bug: 215434166
Test: build, flash, device boot to home.
Merged-In: I9ebedf8813cbfa30d979bc35a3b2306715be682b
Change-Id: I9ebedf8813cbfa30d979bc35a3b2306715be682b

paulhu   commited 2022-03-01 09:44:21 +08:00
537f72061a
Merge changes from topic "ms52-movenetstats"
* changes:
  Update API files to unhide MATCH_PROXY.
  Update tests for NetworkStats code move.
  Add setPollForce to module API
  Add JNI stats libraries to apex Android.bp
  Add JNI stats libraries to connectivity
  [MS62.2] Add NetworkStatsService into service initializer
  [MS54.8] Add hiddenapi-unsupported-t.txt to apex Android.bp
  [MS54.3] Move NetworkStats to updatable sources

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-02-28 05:32:23 +00:00
cebdfba1bb
[MS54.3] Move NetworkStats to updatable sources
This CL builds NetworkStats related codes with the
connectivity module instead of platform.

Test: TH
Bug: 197717846
Change-Id: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
Merged-In: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c

Junyu Lai   commited 2022-02-28 03:24:19 +00:00
eb6f4bef96
Fix rate limit API review comments
Follow up to aosp/1955583 to fix some review comments.

Test: builds
Bug: 219739904
Change-Id: Ie85dc72eb3bb6eda26b655a64eae0d7c0d8bf143

Patrick Rohr   commited 2022-02-18 09:47:49 +00:00
ca7e578f7e
Merge "Add KeepalivePacketData toString()"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-15 10:54:37 +00:00
c05d86b850
Merge "Allow test+other networks to have specifiers"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-02-14 05:31:20 +00:00
106569b856
Merge "Add new methods to redact NetworkCapabilities & LinkProperties"
Jean Chalard   authored and   Gerrit Code Review   commited 2022-02-12 11:56:36 +00:00
d537aa42e1
Add new methods to redact NetworkCapabilities & LinkProperties
Some system components like VPN need to know how to redact
NetworkCapabilities & LinkProperties that they received from
the system but need to send to third-party applications with
less privilege than themselves. To make sure the redaction is
consistent, expose system API methods to do it that are wired
to the same redaction code used by ConnectivityService.

Bug: 191413541
Test: atest CtsNetTestCases, which includes new CTS for these
Change-Id: Ia3ae4755b5192884c147d6828f96cedac000a25b

lucaslin   authored and   Chalard Jean   commited 2022-02-12 15:21:13 +09:00
c582d50b8e
Add KeepalivePacketData toString()
Test: build
Bug: 218569712
Change-Id: I24c0e7ab94212ddf71812ebcc81a5fa69abfa860

Ling Ma   commited 2022-02-11 19:17:10 +00:00
4d782d6d74
Merge "Add @SupressLint to get around incorrect warning."
James Mattis   authored and   Gerrit Code Review   commited 2022-02-10 22:26:06 +00:00
38872800dd
Merge "Add visibility for core tests"
Junyu Lai   authored and   Gerrit Code Review   commited 2022-02-10 09:23:57 +00:00
d54fcc49a7
Merge "[MS55.2] Move NetworkStateSnapshot into module folder"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-10 05:02:45 +00:00
a8ae24410d
Merge "Change naming of excludeLocalRoutes"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-02-10 00:50:30 +00:00
84ad04f768
Add @SupressLint to get around incorrect warning.
EthernetNetworkSpecifier is being moved from being @SystemApi to public.
This is causing the linter to incorrectly throw errors when building on
erro prone. Add @SupressLint to the method causing the errors prevents
the incorrect warning from causing build failures.

Tracking bug b/193460475 - TODO to remove once fixed.

cherry pick of http://ag/16822701

Bug: 210485380
Test: build errorprone
Change-Id: Id297e739a2288ccc232c6b989ec7fee41837a910
Merged-In: Id297e739a2288ccc232c6b989ec7fee41837a910

James Mattis   commited 2022-02-09 11:22:11 -08:00
d8afb66b11
Merge changes from topic "bandwidth-limiting"
* changes:
  Add bandwidth limiting to CS
  Add setting that controls network rate limit

Patrick Rohr   authored and   Gerrit Code Review   commited 2022-02-09 18:00:04 +00:00
6b5b7b40d8
Merge "Mark NetworkAgentConfig fit for inclusion in stable AIDL"
Jean Chalard   authored and   Gerrit Code Review   commited 2022-02-09 16:55:44 +00:00
66fbc7df52
Add visibility for core tests
Allow core tests to use hidden connectivity APIs. Benchmark tests in
particular cannot be run without these.

Ignore-AOSP-First: Avoiding merge conflicts, cherry-pick will follow
Bug: 197717846
Test: m
  (cherry-picked from ag/16772124)
Change-Id: Ia01f24317d14b063f9a7e24c3ada11b140641c50
Merged-In: Ia01f24317d14b063f9a7e24c3ada11b140641c50

Remi NGUYEN VAN   authored and   junyulai   commited 2022-02-09 23:08:37 +08:00
85a4e07826
Add setting that controls network rate limit
The INGRESS_RATE_LIMIT_BYTES_PER_SECOND setting controls the rate limit
for internet networks. If set to -1, no rate limit applies.  There is
one global rate limit that will be applied to all networks with
NET_CAPABILITY_INTERNET.

Test: atest ConnectivitySettingsManagerTest
Bug: 157552970
Change-Id: Ia82aa867686d484ce46734f76d4a48bf864eff84

Patrick Rohr   commited 2022-02-09 14:46:26 +01:00
a20843638f
[MS55.2] Move NetworkStateSnapshot into module folder
framework-connectivity need to see the aidl files when
compiling IConnectivityManager.aidl, and it can only
include the files by specifying aidl include_dirs.
Thus, move the file into the module since the one outside
of the module is going to be deleted soon.

Ignore-AOSP-First: Avoiding conflicts; cherry-pick will follow
Test: TH
Bug: 197717846
Change-Id: Ide7431d0c98aebd389bee86d13ff44f5ef8b8283
Merged-In: Ide7431d0c98aebd389bee86d13ff44f5ef8b8283

Junyu Lai   commited 2022-02-09 10:51:37 +00:00
dc0d521f63
Merge "Have connectivity targets be visible to Frameworks[Vcn|Ike]Tests"
Aaron Huang   authored and   Gerrit Code Review   commited 2022-02-09 10:48:45 +00:00
e25900bbbf
Change naming of excludeLocalRoutes
Address API review feedback to change naming of
setExcludedLocalRoutesVpn and getter.

Bug: 217742354
Test: atest FrameworksNetTests
Change-Id: I57bbf55c7aba1c86ec8687d2431a50b37e63c6d0

Chiachang Wang   commited 2022-02-09 15:50:06 +08:00
f890874970
Mark NetworkAgentConfig fit for inclusion in stable AIDL
Test: m together with its topic
Change-Id: I897a2081fb48a614f28d9ec3965f99cca9f8ec62

Chalard Jean   commited 2022-02-09 15:19:38 +09:00
3068ce7378
Merge "Add and implement API for VpnManagers to request validation"
Jean Chalard   authored and   Gerrit Code Review   commited 2022-02-09 06:03:45 +00:00
4b66d4e244
Have connectivity targets be visible to Frameworks[Vcn|Ike]Tests
(cherry picked from commit 7174ac3d86)
Bug: 204153604
Ignore-AOSP-First: part of large topic that only builds internally
Test: build, FrameworksVcnTests, FrameworksIkeTests
Change-Id: I40740200fe4a7476a21bb5330429a11c97e38fb8
Merged-In: I40740200fe4a7476a21bb5330429a11c97e38fb8

Aaron Huang   commited 2022-02-08 14:31:27 +00:00
720ad7c026
Add and implement API for VpnManagers to request validation
This adds a new API that lets VPN apps using VpnManager request
that the platform run its basic validation check on the resulting
network.

Bug: 184750836
Test: atest FrameworksNetTests
Change-Id: I00092eee857d3e33529b19461cfd5dd060a0fe20

Chiachang Wang   authored and   Chalard Jean   commited 2022-02-08 22:47:26 +09:00
865511a8c4
Merge "Address API review comments for DhcpOption object"
Mingguang Xu   authored and   Gerrit Code Review   commited 2022-02-08 07:30:45 +00:00
446c376434
Address API review comments for DhcpOption object
Add a link to javadoc for the allowed types and use the lint annotation
to suppress compilation errors instead of modifying the baseline file.

Bug: 213240318

Test: atest FrameworksNetTests
Test: atest NetworkStackTests

Signed-off-by: Mingguang Xu <mingguangxu@google.com>
Change-Id: I2a83cc19baa25068326517b30a9afdea19536af9

Mingguang Xu   commited 2022-02-07 19:42:40 -08:00
6914a16c95
Expose public APIs for IP & static IP configuration
Create public API for IP and static IP configuration.

Bug: 209840828
Test: atest android.net.cts.IpConfigurationTest
Test: atest android.net.cts.StaticIpConfigurationTest
Test: atest android.net.dhcp.DhcpResultsParcelableUtilTest
Change-Id: I720f168d1023806970919ca5dd44239a276826b6

Etan Cohen   commited 2022-02-07 19:57:07 +00:00
1e86b3af26