diff options
author | 2024-10-25 20:33:46 -0700 | |
---|---|---|
committer | 2024-11-22 08:56:25 -0800 | |
commit | a73fdb6c935bc22d6c6c202ea9b479836394d2da (patch) | |
tree | e4ef9f721f3458d778af771f3da07daa2ee08b52 | |
parent | d799638a4c44afb38e5520999e5d647fdb6a6b00 (diff) |
Add UsdManager
Flag: android.net.wifi.flags.usd
Bug: 340878198
Test: atest FrameworksWifiApiTests
Change-Id: I4c7078aac27f86bf5d3ba10c263761c095a8a289
-rw-r--r-- | apex/Android.bp | 1 | ||||
-rw-r--r-- | framework/api/system-current.txt | 7 | ||||
-rw-r--r-- | framework/java/android/net/wifi/usd/IUsdManager.aidl | 24 | ||||
-rw-r--r-- | framework/java/android/net/wifi/usd/UsdManager.java | 62 |
4 files changed, 94 insertions, 0 deletions
diff --git a/apex/Android.bp b/apex/Android.bp index 699edc2f40..614777e5dd 100644 --- a/apex/Android.bp +++ b/apex/Android.bp @@ -131,6 +131,7 @@ bootclasspath_fragment { "android.net.wifi.p2p", "android.net.wifi.rtt", "android.net.wifi.twt", + "android.net.wifi.usd", "android.net.wifi.util", "com.android.wifi", ], diff --git a/framework/api/system-current.txt b/framework/api/system-current.txt index c5e9f261aa..34ca93a40a 100644 --- a/framework/api/system-current.txt +++ b/framework/api/system-current.txt @@ -1845,3 +1845,10 @@ package android.net.wifi.twt { } +package android.net.wifi.usd { + + @FlaggedApi("android.net.wifi.flags.usd") public class UsdManager { + } + +} + diff --git a/framework/java/android/net/wifi/usd/IUsdManager.aidl b/framework/java/android/net/wifi/usd/IUsdManager.aidl new file mode 100644 index 0000000000..54e38a2b57 --- /dev/null +++ b/framework/java/android/net/wifi/usd/IUsdManager.aidl @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.net.wifi.usd; + +/** + * Interface that UsdService implements + * + * {@hide} + */ +interface IUsdManager {} diff --git a/framework/java/android/net/wifi/usd/UsdManager.java b/framework/java/android/net/wifi/usd/UsdManager.java new file mode 100644 index 0000000000..6bbe6add2a --- /dev/null +++ b/framework/java/android/net/wifi/usd/UsdManager.java @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.net.wifi.usd; + +import android.annotation.FlaggedApi; +import android.annotation.NonNull; +import android.annotation.RequiresApi; +import android.annotation.SystemApi; +import android.annotation.SystemService; +import android.content.Context; +import android.net.wifi.flags.Flags; +import android.os.Build; + +/** + * This class provides the APIs for managing Unsynchronized Service Discovery (USD). USD is a + * mechanism that allows devices to discover services offered by other devices without requiring + * prior time and channel synchronization. This feature is especially useful for quickly finding + * services on new devices entering the range. + * + * <p>A publisher device makes its services discoverable, and a subscriber device actively + * or passively searches for those services. Publishers in USD operate continuously, switching + * between single and multiple channel states to advertise their services. When a subscriber + * device receives a relevant service advertisement, it sends a follow-up message to the + * publisher, temporarily pausing the publisher on its current channel to facilitate further + * communication. + * + * <p>Once the discovery of device and service is complete, the subscriber and publisher perform + * further service discovery in which they exchange follow-up messages. The follow-up messages + * carry the service specific information useful for device and service configuration. + * + * <p>Note: This implementation adhere with Wi-Fi Aware Specification Version 4.0. + * @hide + */ +@RequiresApi(Build.VERSION_CODES.BAKLAVA) +@SystemService(Context.WIFI_USD_SERVICE) +@SystemApi +@FlaggedApi(Flags.FLAG_USD) +public class UsdManager { + private final Context mContext; + private final IUsdManager mService; + private static final String TAG = UsdManager.class.getName(); + + /** @hide */ + public UsdManager(@NonNull Context context, @NonNull IUsdManager service) { + mContext = context; + mService = service; + } +} |