summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yifei Zhang <yfz@google.com> 2024-12-17 13:43:13 -0800
committer Yifei Zhang <yfz@google.com> 2024-12-17 13:55:15 -0800
commit7e2817f641c93c86f358b04a1a102eddb5a2285e (patch)
treeba0712115ec565ec7591b1086dd7afce661aec07
parent8de4fa32384df900d129f4b84b216e0822e64823 (diff)
contexthub: add @ServiceFormat to getter & doc fix
Test: build Flag: EXEMPT, no behavior change Bug: 383759460 Change-Id: Ic78c2c3046693dfa01c7eda5cf2b07429903746b
-rw-r--r--core/java/android/hardware/contexthub/HubServiceInfo.java4
-rw-r--r--core/java/android/hardware/location/ContextHubManager.java14
2 files changed, 16 insertions, 2 deletions
diff --git a/core/java/android/hardware/contexthub/HubServiceInfo.java b/core/java/android/hardware/contexthub/HubServiceInfo.java
index 2f33e8f8872b..651be3b17c33 100644
--- a/core/java/android/hardware/contexthub/HubServiceInfo.java
+++ b/core/java/android/hardware/contexthub/HubServiceInfo.java
@@ -112,6 +112,7 @@ public final class HubServiceInfo implements Parcelable {
* <p>The value can be one of {@link HubServiceInfo#FORMAT_CUSTOM}, {@link
* HubServiceInfo#FORMAT_AIDL} or {@link HubServiceInfo#FORMAT_PW_RPC_PROTOBUF}.
*/
+ @ServiceFormat
public int getFormat() {
return mFormat;
}
@@ -178,7 +179,8 @@ public final class HubServiceInfo implements Parcelable {
* <li>Pigweed RPC with Protobuf: com.example.proto.ExampleService
* </ol>
*
- * @param serviceDescriptor The service descriptor.
+ * @param serviceDescriptor The service descriptor for the interface, provided by the
+ * vendor.
* @param format One of {@link HubServiceInfo#FORMAT_CUSTOM}, {@link
* HubServiceInfo#FORMAT_AIDL} or {@link HubServiceInfo#FORMAT_PW_RPC_PROTOBUF}.
* @param majorVersion Breaking changes should be a major version bump.
diff --git a/core/java/android/hardware/location/ContextHubManager.java b/core/java/android/hardware/location/ContextHubManager.java
index 1e0cc94612dd..b74644d42ebf 100644
--- a/core/java/android/hardware/location/ContextHubManager.java
+++ b/core/java/android/hardware/location/ContextHubManager.java
@@ -718,7 +718,19 @@ public final class ContextHubManager {
/**
* Find a list of endpoints that provides a specific service.
*
- * @param serviceDescriptor Statically generated ID for an endpoint.
+ * <p>Service descriptor should uniquely identify the interface (scoped to type). Convention of
+ * the descriptor depend on interface type.
+ *
+ * <p>Examples:
+ *
+ * <ol>
+ * <li>AOSP-defined AIDL: android.hardware.something.IFoo/default
+ * <li>Vendor-defined AIDL: com.example.something.IBar/default
+ * <li>Pigweed RPC with Protobuf: com.example.proto.ExampleService
+ * </ol>
+ *
+ * @param serviceDescriptor The service descriptor for a service provided by the hub. The value
+ * cannot be null or empty.
* @return A list of {@link HubDiscoveryInfo} objects that represents the result of discovery.
* @throws IllegalArgumentException if the serviceDescriptor is empty/null.
*/