uwb(service): Return default FIRA specification params
Since the vendors have not yet added support for the GET_CAPS_INFO_CMD,
return a default FiraSpecificationParams object to help with testing.
Bug: 216104681
Test: adb shell cmd uwb get-specification-info
Change-Id: Ib712e7af959441313714702c7183f21fc03714e0
diff --git a/service/java/com/android/server/uwb/UwbServiceCore.java b/service/java/com/android/server/uwb/UwbServiceCore.java
index 092bb88..a88db63 100644
--- a/service/java/com/android/server/uwb/UwbServiceCore.java
+++ b/service/java/com/android/server/uwb/UwbServiceCore.java
@@ -48,6 +48,7 @@
import com.google.uwb.support.fira.FiraParams;
import com.google.uwb.support.fira.FiraSpecificationParams;
+import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
@@ -238,13 +239,13 @@
mConfigurationManager.getCapsInfo(
FiraParams.PROTOCOL_NAME, FiraSpecificationParams.class);
if (firaSpecificationParams.first != UwbUciConstants.STATUS_CODE_OK) {
- Log.e(TAG, "Failed to retrieve FIRA specifications");
+ Log.e(TAG, "Failed to retrieve FIRA specification params");
}
Pair<Integer, CccSpecificationParams> cccSpecificationParams =
mConfigurationManager.getCapsInfo(
CccParams.PROTOCOL_NAME, CccSpecificationParams.class);
if (cccSpecificationParams.first != UwbUciConstants.STATUS_CODE_OK) {
- Log.e(TAG, "Failed to retrieve CCC specifications");
+ Log.e(TAG, "Failed to retrieve CCC specification params");
}
// If neither of the capabilities are fetched correctly, don't cache anything.
if (firaSpecificationParams.first == UwbUciConstants.STATUS_CODE_OK
@@ -254,6 +255,17 @@
FiraParams.PROTOCOL_NAME, firaSpecificationParams.second.toBundle());
mUwbSpecificationInfo.putPersistableBundle(
CccParams.PROTOCOL_NAME, cccSpecificationParams.second.toBundle());
+ } else {
+ Log.w(TAG, "Sending default FIRA specification params");
+ // TODO(b/216104681): Send a default set of params since the vendors have not yet
+ // added support for this query. The channel list here is specific to US, this
+ // needs to be removed before T release.
+ mUwbSpecificationInfo.clear();
+ mUwbSpecificationInfo.putPersistableBundle(
+ FiraParams.PROTOCOL_NAME, new FiraSpecificationParams.Builder()
+ .setSupportedChannels(List.of(5))
+ .build()
+ .toBundle());
}
}