Commit graph android_packages_modules_Co.../framework
Message SHA1
add TRANSPORT_SATELLITE to NetworkCapabilities
This commit also updates to use V14 dnsresolver APIs which was V13.

Bug: 320514105
Test: m & atest FrameworksNetTests
Change-Id: I6e92f4d99e0eba3b5d1d5e45bf11e5e945ea43f1

Nagendra Prasad Nagarle Basavaraju   commited 2024-02-07 16:07:39 +00:00
1fa6f09019
Support bringing up restricted wifi
This CL allows the Carrier Config app to request restricted WiFi nework
by setting the correspoding subscription ID in the network request.

Bug: 315835605
Test: atest android.net.cts.NetworkRequestTest
      atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.CarrierPrivilegeAuthenticatorTest
      atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.ConnectivityServiceTest

Change-Id: I237e692d092ff5f969ce4b7962f6d58099a6f3a9

Ying Xu   commited 2024-02-07 04:24:38 -08:00
7cabd32bc5
Merge "Expose NET_CAPABILITY_LOCAL_NETWORK as public API" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-02-07 12:19:07 +00:00
54aaccc1c9
Expose NET_CAPABILITY_LOCAL_NETWORK as public API
Apps that target an SDK before {@link Build.VERSION_CODES.VANILLA_ICE_CREAM}
will not see networks with this capability unless they explicitly set the
NET_CAPABILITY_LOCAL_NETWORK in their NetworkRequests.

In this way, `NET_CAPABILITY_LOCAL_NETWORK` should be public.

Bug: 313000440
Test: None
Change-Id: I44d9cf3ecf5da471a627696f3d2680f35d4b122d

Handa Wang   authored and   Motomu Utsumi   commited 2024-02-07 17:23:42 +09:00
21005edfdf
Merge "Remove strict_updatability_linting: true" into main
Cole Faust   authored and   Gerrit Code Review   commited 2024-02-02 18:21:10 +00:00
1042c175a0
[DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
<add g3 doc link>

Bug: 304529413
Test: N/A
Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5

Aditya Choudhary   commited 2024-01-31 12:34:50 +00:00
01b5ede2b2
Merge changes from topic "mdns-subtype-discovery" into main
* changes:
  [mdns] add service-side impl for subtypes discovery
  [mdns] add API for discovery with subtype

Kangping Dong   authored and   Gerrit Code Review   commited 2024-01-26 04:48:24 +00:00
61fba508f8
Bpf: open code PRE_T - too complex for errorprone linter
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1ad2d0dd288882e84925f0b59961dcd33612f3f7

Maciej Żenczykowski   commited 2024-01-25 16:09:11 -08:00
0d450d3e4d
Remove strict_updatability_linting: true
strict_updatability_linting has been disabled for a while now, due to
an expansion in scope of the NewApi check. We're going to re-enable
it now, but doing so requires removing it from all modules that have
baselined NewApi issues.

Bug: 320698986
Test: Presubmits
Change-Id: Id6c9202c236f33ad89615e4d5fa5a6364147841a
Merged-In: Id6c9202c236f33ad89615e4d5fa5a6364147841a

Cole Faust   commited 2024-01-25 09:38:25 -08:00
ee56c432e0
[mdns] add API for discovery with subtype
This commit adds support of discovering services with explicit subtype.

With this change, a service can be discovered with subtype with:
```
nsdManager.discoverServices(
        new DiscoveryRequest.Builder("_http._tcp", PROTOCOL_DNS_SD)
	        .setSubtype("_printer").build(),
	executor, listener);
```

Bug: 265095929
Test: atest CtsNetTestCases FrameworksNetTests
Change-Id: Iba76283a003cf2d52a8c26e1de872c3e8e433350

Kangping Dong   commited 2024-01-25 20:15:21 +08:00
97d6aeb3a2
Baseline NewApi issues
NewApi is a lint check that you don't call framework methods that were
introduced in versions later than your min_sdk_version. We want to
make this an error, so we're baselineing all existing issues.

This cl was generated automatically, by taking all the NewApi issues
from the reference baselines, and all the non-NewApi issues from the
existing checked in baselines.

Bug: 268261262
Test: Presubmits
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4ecdedda379e4e9040eb87b01dc3d8efb89be810)
Merged-In: I0393f24f101876abc458ca139eefdb279dcb2b03
Change-Id: I0393f24f101876abc458ca139eefdb279dcb2b03

Cole Faust   authored and   Android Build Cherrypicker Worker   commited 2024-01-25 02:41:58 +00:00
be30b3e96e
Merge "Support multicast routing" into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-01-22 00:55:10 +00:00
bcc245d5bf
Support multicast routing
Added support to apply multicast routing config between network
interfaces in MulticastRoutingCoordinatorService.

Bug: 281217735

Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.connectivity.MulticastRoutingCoordinatorServiceTest

Change-Id: If608b79d4e62a20d2e01755a83a901f6e274d9a2

Yang Sun   commited 2024-01-20 21:32:11 +08:00
baa50fa478
Support checking kernel bitness via JNI
Bug: 319532485
Test: Verified the return value on husky(64-bit kernel)
      and mokey_go32 (32-bit kernel)
Test: NetworkUtilsTest#testIsKernel64Bit
Change-Id: I929ce23932698b44a72ce4f35e2bd5a41ba472ee

Yan Yan   commited 2024-01-18 01:10:59 +00:00
287258dfb7
Merge "Add more context in javadoc of setDataSaverEnabled" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2024-01-15 06:43:48 +00:00
9c8111dd3a
Add more context in javadoc of setDataSaverEnabled
This addresses API council review feedback at b/307695368

Test: TH
Fix: 307695368
Change-Id: Ifc8cb890ff73be423d38e06a516853da4b9ee97f

Junyu Lai   commited 2024-01-15 11:40:59 +08:00
f304823023
Merge "Introduce NsdManager API for in-place service updates without re-announcement." into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2023-12-27 08:26:54 +00:00
8c22b9a37c
implement Thread Border Router e2e integration test
This implements a basic border routing test case (ping) and demonstrates a
valid test environment for Thread Border Router test cases.

Later we can add more packet verifications and more test cases.

Bug: 295843010
Test: atest android.net.ThreadBorderRouterTest

Change-Id: Ifb9b6d45539143a227c2bc0ed69b5c3167ef9acd

Handa Wang   commited 2023-12-26 15:24:54 +08:00
806f5a1bec
Introduce NsdManager API for in-place service updates without re-announcement.
This commit builds upon CL aosp/2817455 by adding a new NsdManager API to
update registered services directly, eliminating the need for exit and
re-announcement messages. This preserves compatibility with existing
apps without requiring an API bump. If an app registers a service with
the same listener and NsdServiceInfo, it's treated as an update request.

Bug: 309372239
Test: TH
Change-Id: Ib84ddf0d92e757eaef225f3e32f5223bc50c8fd6

Yuyang Huang   authored and   Remi NGUYEN VAN   commited 2023-12-26 13:09:00 +09:00
86d083f3a4
Merge "List baseline_filename on modules that are implititly using it" into main
Cole Faust   authored and   Gerrit Code Review   commited 2023-12-21 21:33:01 +00:00
2e7920c075
List baseline_filename on modules that are implititly using it
lintable modules currently pick up files named "lint-baseline.xml" to use as the
lint baseline implicitly. This is confusing because you could end up using the
baseline files in more modules than intended. Lint also has a feature where it
requests you remove unnecessary findings from the baseline file, so something
could be necessary for one module, but unnecessary for another that accidentally
picked up the baseline.

We're removing the implicit detection of the baseline file, which requires
all modules using it to list the baseline file explicitly.

Bug: 272769514
Test: Presubmits
Change-Id: If873a4ea20d73bb6268d83589c4fb3ebe54af664

Cole Faust   commited 2023-12-20 11:57:07 -08:00
a52ecf0c5c
Remove sdk level check when calling getDataSaverEnabled
Follow-up from aosp/2856948, the data saver status value is
filled by ConnectivityService before Android V. Thus, calling
BpfNetMapsReader#getDataSaverEnabled() is a legit use case, which
should not trigger log.wtf.

Remove the check accordingly.

Test: TH
Bug: 314858283
Fix: 316839561
Change-Id: I90c85ab98fbefd1f99ec799a4eec8d1d0cfd47b0

Junyu Lai   commited 2023-12-18 16:26:24 +08:00
8df4b700dd
Don't add LOCAL_NETWORK as forbidden capability
This causes the module to crash on rollback because the current
production code does not consider LOCAL_NETWORK to be a valid
capability.

Change-Id: Idf57d72c384b41b483098c4c302738072ebf7f90
Test: TH
Fix: 313030307

Lorenzo Colitti   authored and   Remi NGUYEN VAN   commited 2023-12-13 11:24:25 +09:00
22941b38f7
[BR14] Tracker Data Saver status in ConnectivityService
BYPASS_INCLUSIVE_LANGUAGE_REASON=Using public API
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.CSBpfNetMapsTest
      (on U and V devices respectively)
Bug: 297836825
Fix: 314858283

Change-Id: Ibeac8cd3a33468c6539234255328affc6b3f8ffe

Junyu Lai   commited 2023-12-08 13:54:29 +08:00
38c7503ab5
Merge "Remove workaround to remove FlaggedAPI in ump" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-12-06 01:17:43 +00:00
dc7a325a55
Merge "Add support for setsockoptBytes" into main
Yang Sun   authored and   Gerrit Code Review   commited 2023-12-05 07:35:02 +00:00
38795d6f89
Remove workaround to remove FlaggedAPI in ump
Test: TH
Change-Id: Icd3c87a7da9b45e5341a1a2ead68f0a9809591bb

Motomu Utsumi   commited 2023-12-04 08:59:43 +00:00
88410c6fd6
Add support for setsockoptBytes
Test: atest FrameworksNetTests:android.net.connectivity.android.net.NetworkUtilsTest
Change-Id: I3d94172fa8a42e2ab8ba4caf80d5caaa11fac703

Yang Sun   commited 2023-12-04 09:02:45 +08:00
f2987b8bf8
Merge "Revert^2 "Update NetworkAgent#register to compatible with old NetworkAgentTest"" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-12-01 12:24:04 +00:00
dda4052e54
Revert^2 "Update NetworkAgent#register to compatible with old NetworkAgentTest"
This reverts commit db884c9a93.

Reason for revert: reason of aosp/2849874 revert is solved by aosp/2854408

Change-Id: Ic5ffddf2f811c0d2c359f292c3b44b833bae5eaa

Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-12-01 06:31:19 +00:00
3c5891764c
Merge "Revert "Update NetworkAgent#register to compatible with old NetworkAgentTest"" into main
Nick Wille   authored and   Gerrit Code Review   commited 2023-11-30 23:06:23 +00:00
3139f9794c
Revert "Update NetworkAgent#register to compatible with old NetworkAgentTest"
This reverts commit 1e7c4a494d.

This change is a suspect for causing test breakages, it may or may not be reverted.

Bug: 314087796

Reason for revert: 314087796

Change-Id: If0a1c1e2d0e260319cf64b2d00828638abebb7fe

Nick Wille   commited 2023-11-30 22:07:14 +00:00
db884c9a93
Merge "Update NetworkAgent#register to compatible with old NetworkAgentTest" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-11-30 08:59:50 +00:00
f73d80b61c
Update NetworkAgent#register to compatible with old NetworkAgentTest
aosp/2792436 updated NetworkAgent and NetworkAgentTest.
But the NetworkAgent change was not compatible with the old
NetworkAgentTest.
This CL makes NetworkAgent change to compatible with the old
NetworkAgentTest.

aosp/2851330 will update NetworkAgentTest to support NetworkAgent change
done in aosp/2792436.
Once the old cts is EOL, workaround in NetworkAgentTest and NetworkAgent
can be removed.

Bug: 310124646
Test: atest NetworkAgentTest
Change-Id: Ic99b0ab72526a9ba22653f5bb132214ef0814440

Motomu Utsumi   commited 2023-11-30 06:19:40 +00:00
1e7c4a494d
Merge "Remove --show-annotation FlaggedApi from flagged-apis-droidstubs" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-11-22 14:22:04 +00:00
d3d41ac7a4
Remove --show-annotation FlaggedApi from flagged-apis-droidstubs
framework-connectivity-flagged-apis-droidstubs is used by
jarjar-rules-generator to avoid jarjaring flagged apis.
But, this usage of --show-annotation FlaggedApi in the flag is not
supported.
So this CL removes --show-annotation FlaggedApi.
As far as framework-connectivity-flagged-apis-droidstubs contains
flagged APIs, it's fine that this droidstubs also contains non-flagged
APIs.

Test: TH
Bug: 312408311
Change-Id: I2f1f5624d98873420c0c36ac6e31386102211045

Motomu Utsumi   commited 2023-11-22 19:05:48 +09:00
ba5dde84f1
Merge "Explicitly select mdns_aidl_interface-V1-java" into main
Ken Chen   authored and   Gerrit Code Review   commited 2023-11-21 09:02:35 +00:00
e5c9138ead
Explicitly select mdns_aidl_interface-V1-java
The only version of mdns_aidl_interface supported by Netd is V1. After
that, the entire interface has been deprecated (which is the V2). The
latest stable version is no longer meaningful because no one is supposed
to use V2.

Bug: 298594687
Test: m
Change-Id: I9ac8199312cdc5d829889ea562979cad7d3bf054

Ken Chen   commited 2023-11-21 01:58:13 +00:00
7da858ca1a
Merge "Add more powerful CTS for allowedUids" into main
Jean Chalard   authored and   Gerrit Code Review   commited 2023-11-20 04:44:22 +00:00
51c80a72d8
Add more powerful CTS for allowedUids
This tests that the network providers are subject to appropriate
limitations as to what they can set as allowedUids – both in the
positive (can do) case, and the negative (can't do) case.

Test: this
Change-Id: I115e2a4bc02ddcd03ecf2f35130fcb0378da22bd

Chalard Jean   commited 2023-11-20 12:16:39 +09:00
5301778ad8
Merge "Fix FlaggedAPI droidstubs to includes non flagged SystemApi" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-11-17 02:03:12 +00:00
110d5f54fc
Merge "[BR11] Read data saver status from bpf" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2023-11-16 02:57:55 +00:00
d3447a1d52
[BR11] Read data saver status from bpf
Writing data saver status to bpf is supported on Android V or
later devices. Thus, read that from bpf if available.

Test: atest FrameworksNetTests:android.net.connectivity.android.net.BpfNetMapsReaderTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.android.net.ConnectivityManagerTest
Fix: 310801259
Change-Id: Ibd2616328d83f72ee6d2665239c3a44379d1ebf5

Junyu Lai   commited 2023-11-15 12:26:40 +08:00
9e88052fe7
Fix typedef retention
Typedef annotations are meant to have SOURCE retention, as they're
only analyzed by metalava to produce a separate file that's actually
consumed by the tools. Update typedefs as such.

Bug: 309971481
Test: m checkapi
Change-Id: Ic603db350af0825c87f4d99cff2ca4f4b7e57215

Anton Hansson   commited 2023-11-10 13:28:07 +00:00
f5fa3c6c72
Add equals, hashCode to MulticastRoutingConfig
Add helper functions to help compare if MulticastRoutingConfig
has changed.

Test: atest MulticastRoutingConfigTest
Change-Id: I30ed4796efbaafbcf1a273c12a9231ec02bc36f0

Yang Sun   commited 2023-11-10 13:06:22 +08:00
d25444ffce
Merge "Prepare exposing LocalNetworkConfig and its satellites" into main
Jean Chalard   authored and   Gerrit Code Review   commited 2023-11-10 03:08:07 +00:00
8a5055a3e9
Merge "Add overriding method of a default method to signature files" into main
Jihoon Kang   authored and   Gerrit Code Review   commited 2023-11-09 17:00:53 +00:00
be43ef41bc
Merge "Baseline issues that were previously suppressed" into main
Anton Hansson   authored and   Gerrit Code Review   commited 2023-11-09 10:03:23 +00:00
879946d1c9
Add overriding method of a default method to signature files
Currently, the signature file elides overrides of a default method,
as they are not essential for the compilation of the stubs.
However, in some scenarios, the overrides of a default method may be
essential for the compilation of the reverse dependency of the stubs.
In the scenario seen below:
```
// API
interface ApiInterface {
    public default void bar() {};
}
class ApiClass implements AnotherParentInterface{
    public void bar() {}
}

// App depending on the API
interface AppInterface {
    public void bar();
}
public class AppClass extends ApiClass implements AppInterface {
}
```
Removal of `ApiClass.bar()` will lead to not overriding an abstract method
`AppInterface.bar()` compilation error in `AppClass`.
Therefore, this change adds the overrides of a default method to the
signature files.

Test: checkapi
Bug: 299366704
Change-Id: Ie11dbeafc39efec06f605e306c92155e834a6685

Jihoon Kang   commited 2023-11-09 09:40:27 +00:00
9c5c9b0a94
Fix FlaggedAPI droidstubs to includes non flagged SystemApi
FlaggedAPI annotated SystemAPI/ModuleAPI should be able to reference
the SystemAPI/ModuleAPI without FlaggedAPI annotation.
framework-connectivity-flagged-apis-droidstubs was failing to build in
this case. This CL fixes this issue.

After this CL, flagged apis droidstubs build even if the
FlaggedAPI annotated SystemAPI references the public API.
But this is caught by other targets and this should not be the issue.

Test: m framework-connectivity-flagged-apis-droidstubs
Change-Id: I0e0b5213c8e9b757e1b25c2a40b15b2c820ddd59

Motomu Utsumi   commited 2023-11-09 17:45:52 +09:00
2f2aa21419