Commit graph android_packages_modules_Co.../framework-t/api
Message SHA1
[API] make ThreadNetworkSpecifier @SystemApi
This class can be used with ConnectivityManager#requestNetwork to
request connecting to a specific Thread network from system apps.

Bug: 377258309
Flag: com.android.net.thread.flags.thread_mobile_enabled
Change-Id: I80cb992380236b045e4e331b9861274d8cd10cfd

Kangping Dong   commited 2025-06-30 17:08:51 +08:00
c4d212c5d4
Expose NetworkTemplate get/set transport type APIs
This is needed for counter-part modules to query data usage
with specified transport type.

Flag: com.android.net.flags.netstats_transport_type
Test: atest ConnectivityCoverageTests --test-filter \
'NetworkTemplate*' --update-device
Bug: 419123367
Bug: 420531377

Change-Id: I7778de815bec947be3e6abbd6269e1727de5c550

Junyu Lai   commited 2025-06-08 23:14:07 -07:00
19ff6a1025
Make NsdManager.registerService() public API
This commit makes the NsdManager.registerService() API public. This
change will enable developers to implement more customizable mDNS
advertising behavior in their applications.

Bug: 373270045
Test: atest CtsNetTestCases:NsdManagerTest
Flag: com.android.net.flags.mdns_advertising_improvement
API-Coverage-Bug: 415202964
Change-Id: I32359f7265b3597defd57123ecff0deaef0011f8

Yuyang Huang   commited 2025-05-02 15:23:14 +09:00
9e74d41f3d
Add API for FLAG_SKIP_PROBING
The flag, used in the newly exposed AdvertisingRequest, allows
skipping the probing step when the service name is known to be unique
already.

This allows implementing RFC 6762 section 8.1 that specifies probing
SHOULD be skipped if it is known via other means that the record set
is unique.

Bug: 384841047
Test: atest CtsNetTestCases:NsdManagerTest
Change-Id: I19d67ff2863af631bd9c2f518b004f1688ac5f87

Remi NGUYEN VAN   commited 2024-12-24 16:00:53 +09:00
7a3423b65b
Expose NsdServiceInfo#getHostname
This allows obtaining the hostname that is pointing to the address
records, which were already available though #getHostAddresses.

This is covered by existing CTS tests, for example the
servicesWithCustomHost_customHostAddressesFound test in NsdManagerTest.

Test: atest CtsNetTestCases:NsdManagerTest
API-Coverage-Bug: 384841047
Change-Id: Ib939c1977a76d8d98c9b4f79da6a1a6b0acf6a87

Remi NGUYEN VAN   commited 2024-12-23 09:40:02 +09:00
265216ba40
[Thread] Mark ThreadConfiguration#isDhcpv6PdEnabled() as @hide
This CL marks ThreadConfiguration#isDhcpv6PdEnabled() as @hide because
there's no way yet to set it as enabled. When PD is implemented, we'll
expose this API as System API.

Bug: 342519412

Change-Id: I6b8f7b83bd01c0ba045c777e6f613bc4a74d9dfb

Handa Wang   commited 2024-10-22 07:33:00 +00:00
7616fdd777
[Thread] make ThreadNetworkController#setConfiguration a system API
This CL turns setConfiguration into a system API, including the
ThreadConfiguration#Builder
and the #setNat64Enabled method.

Bug: 368456504

Change-Id: I0ff2ed81271dcceea295d169a46a02f05aeda5d6

Handa Wang   commited 2024-10-10 05:36:11 +00:00
651bfdaaf7
[Thread][API] add API for ephemeral key.
This CL adds the API for starting/stopping the ephemeral key mode, and
subscribing to the ephemeral key state changes.

Ephemeral key mode is started with a limit amount of time to allow
Thread credential sharing.

Bug: 348323500
Test: atest CtsThreadNetworkTestCases
Change-Id: I540c88ec4668291358fbe87a678d8f9d31a67e54

Yang Sun   commited 2024-09-29 02:35:44 +00:00
b8aa8bb47f
changes the API setChannelMaxPowers from hide API to system API
This CL changes the hiden API `setChannelMaxPowers` to system API
to allow the privilege app to set the max power of each Thread channel.

Bug: b/346686506
Test: atest CtsThreadNetworkTestCases
Change-Id: I1089a4a315971c3bca8ec688a02143ddec93d039

Zhanglong Xia   commited 2024-08-26 10:07:36 +08:00
5bbfd91b04
Support NetworkStats#addEntries API
Currently, NetworkStats#addEntry creates a new instance
containing the requested result instead of mutating the
original object. This creates a heavy memory footprint
when the caller invokes it in a loop because a new NetworkStats
instance is created whenever an addEntry is called.

This change introduces a new API that allows callers to
add a set of entries to a NetworkStats instance. This new
API will clone the instance only once, return the newly
created (and modified) instance, and ensure that the original
instance remains immutable.

Additionally, the change adopts config libraries for flagging
the API and corresponding CTS tests, since Android U-based
branches are no longer downstream of current development branches.

Test: atest FrameworksNetTests:android.net.connectivity.android.net.netstats.NetworkStatsApiTest
Test: atest CtsNetTestCases:NetworkStatsApiTest
Bug: 335680025
Fix: 357772271
API-Coverage-Bug: 357772271
Change-Id: I58513844e681c0621a6107ec4b198cd3957f289d

Junyu Lai   commited 2024-08-09 14:19:38 +08:00
d0e049455c
[Thread] Make ThreadConfiguraiton a system API
This CL adds 3 things as @SystemApi:
- The ThreadConfiguration class except the Builder nested class.
- The ThreadNetworkController#registerConfigurationCallback method.
- The ThreadNetworkController#unregisterConfigurationCallback method.

Bug: 342519412
Test: CtsThreadNetworkTestCases

Change-Id: I8d3e48b73d471af1515f251451a1259a4bde69af

Handa Wang   commited 2024-07-29 08:07:17 +00:00
5fc74b9fd8
Merge "IpSecTransformState: Rename API methods and improve docs" into main
Yan Yan   authored and   Gerrit Code Review   commited 2024-02-16 01:12:21 +00:00
69171c6ca5
IpSecTransformState: Rename API methods and improve docs
Rename API methods and update API docs as per API
council feedbacks

Bug: 316603231
Test: make update-api && make
Change-Id: Ibb1f58792d2e40ef1084c2b532e999a516a87b37

Yan Yan   commited 2024-02-15 20:17:30 +00:00
1db3feeed7
Merge changes I57b37ea7,I00772535 into main
* changes:
  Introduce Powered Off Finding API
  Add Powered Off Finding operations to NearbyService

Yahav Nussbaum   authored and   Gerrit Code Review   commited 2024-02-13 14:34:22 +00:00
c412fd3987
Introduce Powered Off Finding API
Bug: 307898240
Test: atest CtsNearbyFastPairTestCases
Test: atest NearbyIntegrationPrivilegedTests
Test: atest NearbyIntegrationUntrustedTests
Change-Id: I57b37ea796c0791d72fec931f731a0143e816dac

Yahav Nussbaum   commited 2024-02-13 09:23:00 +00:00
c712a571dc
Merge changes from topic "set-thread-enabled" into main
* changes:
  Add service implementation for ThreadNetworkController#setEnabled
  Add setEnabled API

Yang Sun   authored and   Gerrit Code Review   commited 2024-01-26 11:22:37 +00:00
8f9544539b
Add setEnabled API
setEnabled API is added to ThreadNetworkController, this
can be used by applications with privileged permission to set
Thread to enable/disabled state.

The Thread enabled state can be subscribed with
ThreadNetworkController#registerStateCallback.

When Thread is disabled, the join/scheduleMigration APIs will
fail with ERROR_THREAD_DISABLED.

When Thread is disabling, all commands will fail with ERROR_BUSY.

Bug: 299243765

Test: atest CtsThreadNetworkTestCases:android.net.thread.cts.ThreadNetworkControllerTest

Change-Id: Ifa7845bf1d5664ecd31ce74e24b3a839f92bba13

Yang Sun   commited 2024-01-26 15:53:33 +08:00
0797d9d501
[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
[Thread] add error code ERROR_UNKNOWN for forward compatibility
This is per the go/android-api-guidelines#return-error:
```
Make sure your chosen error handling option gives you the
flexibility to introduce new error types in the future. For
@IntDef, that means including an OTHER or UNKNOWN value - when
returning a new code, you can check the caller's targetSdkVersion
to avoid returning an error code the application doesn't know
about. For exceptions, have a common superclass that your
exceptions implement, so that any code that handles that type will
also catch and handle subtypes.
```

Bug: 320403080
Change-Id: I2ee663b75107dac6d84fa697f449fa0424128fde

Kangping Dong   commited 2024-01-16 16:07:53 +08:00
2c83e2fcc9
Merge changes from topic "mdns-subtypes" into main
* changes:
  [mdns] add service-side impl for subtypes advertising
  [mdns] add support for advertising subtypes

Kangping Dong   authored and   Gerrit Code Review   commited 2023-12-18 08:49:44 +00:00
19d055514c
[mdns] add support for advertising subtypes
This commit adds support of advertising and discovering services
with subtypes.

With this change, client can publish a new service with subtypes with
code:
```
NsdServiceInfo info = new NsdServiceInfo();
info.setServiceName("My Service");
info.setServiceType("_meshcop._udp");
info.setSubtypes(Set.of("_abc"));

nsdManager.registerService(info, PROTOCOL_DNS_SD, listener);
```

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

Kangping Dong   commited 2023-12-18 10:03:16 +08:00
6d618d77fe
Expose APIs to query the state of an IpSecTransform
Bug: 308011229
Test: make update-api
Change-Id: I5ca6278305f814dbce6a7c41a4f4e491b1389b31

Yan Yan   commited 2023-12-12 22:20:53 +00:00
3976e49e40
Add FlaggedAPI annotation to NSD offload APIs
These APIs were released via SDK extension but they need to have
FlaggedAPI annotation to avoid being released by quarterly release.

Note that this CL does not contain udc-extended-api change.
Once com.android.net.flags.register_nsd_offload_engine_api is marked as
released API, APIs with this annotations should be visible in
udc-mainline-prod API .txt files.

Bug: 301713539
Test: TH
Change-Id: I32b58ec64c1f599f48bc89b189ed24ac1717a1d7

Motomu Utsumi   commited 2023-11-28 17:50:14 +09:00
ce23d8467e
[Thread] add @RequiresPermissions for unregisterXxxCallback APIs
Per API council review suggestions in b/309952666, add the same
permission requirements for the unregister APIs.

Bug: 309952666
Test: atest CtsThreadNetworkTestCases
Change-Id: Idc481c7676ddc5d748fe7803f74dd63981186c09

Kangping Dong   commited 2023-11-13 17:29:07 +08:00
8e44412f7c
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
Merge "Add Thread team to owners of the API files" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-11-09 02:47:24 +00:00
0fce55c7fb
[Thread] move createRandomDataset to ThreadNetworkController
This commit renames `createRandomDataset` to `createRandomizedDataset`
and moves this method to ThreadNetworkController class.

The reason for moving this method is that we rely on the service side to
know which channels are currently supported by this device and there is
no safe way for ActiveOperationalDataset to created a randomized full
dataset by its own. Moving this method to ThreadNetworkController also
allows us to support future platform-dependend configurations.

Bug: 308117328
Bug: 307939803
Change-Id: I0b0b7b727c3b326ab59bb1299ace15df1ff1ad5e

Kangping Dong   commited 2023-11-08 22:39:33 +08:00
af4f1f576c
Add Thread team to owners of the API files
Similar to the Neary and RemoteAuth team, the Thread team will need to update the API files.

Change-Id: I488aae7610e337f14df01f1c6f51f042f11bd450

Kangping Dong   commited 2023-11-08 12:43:05 +00:00
310b801b6e
[Thread] add ThreadNetworkController APIs
The ThreadNetworkController class provides APIs for managing the Thread
network, for example, attach to a specific network, form a network with
given dataset or update/migrate an existing network.

Bug: 262683651
Test: atest CtsThreadNetworkTestCases
Change-Id: Ib3c267d2c81a8c3c7772ed3c9cd2092487cc941a

Kangping Dong   commited 2023-11-08 17:56:16 +08:00
b1c75dbe8c
Baseline issues that were previously suppressed
java_sdk_library has previously internally disabled a few legitimate
issues. As this is being un-done for modules, add baselines for the
pre-existing issues.

Bug: 306806877
Test: m checkapi
Merged-In: Ie764d33196675e1482f30ecfd3d6d22b7fa25c27
Change-Id: Ie764d33196675e1482f30ecfd3d6d22b7fa25c27

Anton Hansson   commited 2023-11-07 08:40:36 +00:00
d8e40b3204
Connectivity: enforce FlaggedApi
Bug: 297362755
Test: m checkapi
Merged-In: I25ad2cb4472e52297a455256b5749a90f31ca6b9
Change-Id: I25ad2cb4472e52297a455256b5749a90f31ca6b9

Adrian Roos   authored and   Anton Hansson   commited 2023-11-07 08:39:55 +00:00
4126d9b793
[Thread] make the Manager and Controller class 'final'
Per the API review council, the classes should be "final" by default

Bug: 301076593
Test: build && atest CtsThreadNetworkTestCases
Change-Id: I85f0b4fabe5b1bcec2be052620b38a07c58181d7

Kangping Dong   commited 2023-10-25 22:03:11 +08:00
5e1d430d33
[Thread] add Thread Operational Dataset API
Design doc: go/thread-android-api
Android FR: b/235016403

Bug: 262683651
Change-Id: Icbd4ee4150e3fd78df627c2e726c259e7ee50871

Kangping Dong   commited 2023-10-25 18:13:07 +08:00
7fea5fa6a2
[Thread] flagging Android Thread APIs
This commit declares the initial "thread_enabled" feature flag and use
this to flag all existing and future Thread system APIs with @FlaggedApi

Bug: 301473012
Test: build
Change-Id: I43f64ce38f7fd0806733b21c4f393e4563e6a467

Kangping Dong   commited 2023-10-24 19:45:04 +08:00
75aa485604
Add additional overriding methods to signature files
This change adds overriding methods that are essential to compile the
stubs generated from the signature files.

More information and the background for this change is available at
go/add-overriding-one-pager.

Test: m checkapi
Bug: 299366704
Change-Id: Idba307148fd9afa87bfb7e0c89e00d9bd97ec204

Paul Duffin   commited 2023-10-12 19:21:07 +01:00
b3c3f2e9d0
Prepare for keeping concrete overrides of abstract methods
Currently, metalava will discard concrete overrides of abstract methods
from the API signature files which causes problems when attempting to
generate stubs from those files and also discards information that may
be important in API reviews. This change is the first step in the
process of changing that behavior.

This change hard codes the current behavior for discarding the concrete
overrides (`add-additional-overrides=no`) into those signature files
that will (or are likely) to be affected by the change in behavior.
That allows the default behavior to be changed for all the other files
without affecting these.

Follow up changes will remove the hard coding from the signature files
and will update the contents which will include the concrete overrides
of the abstract methods.

More information and the background for this change is available at
go/add-overriding-one-pager.

Test: m checkapi
Bug: 299366704
Change-Id: I52c5bbe2e3bbd36019fe44fcb0b2d19876a5a869

Paul Duffin   commited 2023-10-10 17:11:25 +01:00
7bd2d108ea
OWNERS: master -> main am: a1ab4aaeb5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2765545

Change-Id: Ia9cedb7d9937c0d45fa8421e36ed865bc3aece62
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Maciej Żenczykowski   authored and   Automerger Merge Worker   commited 2023-09-27 20:45:24 +00:00
13e2ff7717
OWNERS: master -> main
Change-Id: Iad7d1818d1959024d5fd1fc8810d2b7ce0f06e40

Maciej Żenczykowski   commited 2023-09-27 19:29:09 +00:00
a1ab4aaeb5
Merge "[Thread] initial Thread network service" into main am: 01e6dadd1f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2721333

Change-Id: I5b1dad9c40dcade78c352265164da0992a3fcb0d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Kangping Dong   authored and   Automerger Merge Worker   commited 2023-09-19 11:29:17 +00:00
e5f1122ec9
[Thread] initial Thread network service
This commit sets up the initial Thread network service for the
Android Thread feature which allows an Android device to create
a Thread network and being a Border Router.

See https://www.threadgroup.org/What-is-Thread for background of
Thread.

See b/235016403 for the Android Thread feature request.

Test: lunch aosp_cf_x86_64_tv-userdebug
      m && launch_cvd
      atest CtsThreadNetworkTestCases
Bug: 262683651
Change-Id: Ie1bb23084531f67165ec068ea3ca39592dbc01d1

Kangping Dong   commited 2023-09-12 21:48:57 +08:00
1cec48f3c0
Merge "Removing SystemApi added in aosp/2685327" into main am: e423ae1076
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2733765

Change-Id: I78bc441c765538098017916007b443671cb95fd6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Igor Zaslavsky   authored and   Automerger Merge Worker   commited 2023-08-31 10:07:08 +00:00
378d54c4d5
Removing SystemApi added in aosp/2685327
Removing all SystemApi added in aosp/2685327 until M-2023-11 train  release
Apis will be placed back after that

Test: built successfully.
Bug: 290092977
API-Coverage-Bug: 294934095
Change-Id: I12e8b21e6d21541930acdd14322156ad75b27be5

Igor Zaslavsky   commited 2023-08-30 21:17:28 +00:00
edb12a4234
Merge Android U (ab/10368041)
Bug: 291102124
Merged-In: Iff29b090c0b41d0103997a80788f09c2602df074
Change-Id: I5b03523defc88ffbc3aeab9ac8a29b4ca5a11f57

Xin Li   commited 2023-08-25 13:52:17 -07:00
4a6c653160
Add RemoteAuthService
Add RemoteAuthService APIs and Stubs (hide) for Settings of D2DA

This CL introduces new SystemApi allow user to discover remote devices
compatible to be registered as remote authenticators via RemoteAuthManager

Design doc: go/remote-auth-manager-fishfood-design

Test: built successfully.
Bug: 290092977
API-Coverage-Bug: 294934095
Change-Id: Iaaae1126065fdc3db469eeb8d85ac654b8199a12

Igor Zaslavsky   commited 2023-08-24 17:50:11 +00:00
ec344f4c18
Merge "Add remoteauth to API owners" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2023-08-15 01:55:11 +00:00
0a49f9619f
Add remoteauth to API owners
Similarly to Nearby, remoteauth is expected to regularly need to change
the API files.

Import the existing owners file for that purpose.

Test: m
Change-Id: I4b900481df3bf505a8209e5370dc4bc4c928dbee

Remi NGUYEN VAN   commited 2023-08-14 20:06:03 +09:00
a2009eaeec
Enable service offload API
API-Coverage-Bug: 282618639
Bug: 269240366
Test: atest CtsNetTestCases
Change-Id: I7ac72b675ff3715891f31bc03c453e14b1264e40

Yuyang Huang   commited 2023-08-04 19:24:01 +09:00
00cf7eda31
Revert "Add back getFastPairScanEnabled and setFastPairScanEnabled System API"
This reverts commit 4af0e0f784.

Reason for revert: not support the feature anymore

Test: -m
Change-Id: I26c1f1dd5f36ecb6c1386ccf6ec84118fd93017d

Xinyi Zhou   commited 2023-02-14 20:16:56 +00:00
960d69d821
Revert "Revert "Remove Fast Pair system APIs.""
This reverts commit f6f8c64989.

Reason for revert: not pass PWG review

Change-Id: Ie6c7536c45d53cc4da31811a19fff6ee23852eef
Bug: 239750900

Chun Zhang   commited 2023-02-14 16:24:37 +00:00
4aad023afb
[API] Add “ERROR_” prefix for consistency with others
Test: -m
Fix: 268195420
Ignore-AOSP-First: nearby_not_in_aosp_yet
Change-Id: Ia9b58c8d134669de36094254270547629a92192a

Xinyi Zhou   commited 2023-02-12 06:22:51 +00:00
75200b1999