summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorziyiw <ziyiw@google.com>2024-04-17 21:36:59 +0000
committerziyiw <ziyiw@google.com>2024-04-17 21:38:29 +0000
commit26a2c78dac593a8a7445922efa56a692048772b0 (patch)
tree275a62b789fd786645750901dfef07fd703445bb
parent47f3805d8cc2a50b6906af8926db32b43eb5f7ad (diff)
downloadUwb-26a2c78dac593a8a7445922efa56a692048772b0.tar.gz
[jni] Add an overlay to indicate whether multicast ntf v2 is supported.
Bug: 333989564 Test: atest CtsUwbTestCases Test: atest libuwb_core_tests Change-Id: Iea33e590368ee42a74de83bbbbd330ede7bef60b
-rw-r--r--service/ServiceUwbResources/res/values/config.xml4
-rw-r--r--service/ServiceUwbResources/res/values/overlayable.xml1
-rw-r--r--service/java/com/android/server/uwb/UwbInjector.java5
-rw-r--r--service/java/com/android/server/uwb/jni/NativeUwbManager.java5
-rw-r--r--service/uci/jni/src/uci_jni_android_new.rs4
5 files changed, 17 insertions, 2 deletions
diff --git a/service/ServiceUwbResources/res/values/config.xml b/service/ServiceUwbResources/res/values/config.xml
index b8148503..d57f85d8 100644
--- a/service/ServiceUwbResources/res/values/config.xml
+++ b/service/ServiceUwbResources/res/values/config.xml
@@ -214,4 +214,8 @@
If enabled, some clients must explicitly request UWB to be enabled on top of user setting.
-->
<bool name = "hw_idle_turn_off_enabled">false</bool>
+
+ <!-- Whether multicast list update notification v2 is supported or not.
+ If enabled, the notification will be parsed into version 2 if uci major version is 2.0. -->
+ <bool name = "is_multicast_list_update_ntf_v2_supported">false</bool>
</resources>
diff --git a/service/ServiceUwbResources/res/values/overlayable.xml b/service/ServiceUwbResources/res/values/overlayable.xml
index 93a187c0..aeed1389 100644
--- a/service/ServiceUwbResources/res/values/overlayable.xml
+++ b/service/ServiceUwbResources/res/values/overlayable.xml
@@ -53,6 +53,7 @@
<item name="ccc_supported_range_data_ntf_config" type="bool" />
<item name="persistent_cache_use_for_country_code_enabled" type="bool" />
<item name="hw_idle_turn_off_enabled" type="bool" />
+ <item name="is_multicast_list_update_ntf_v2_supported" type="bool" />
<!-- Params from config.xml that can be overlaid -->
<!-- Params from strings.xml that can be overlaid -->
diff --git a/service/java/com/android/server/uwb/UwbInjector.java b/service/java/com/android/server/uwb/UwbInjector.java
index a4381444..0fcd7da9 100644
--- a/service/java/com/android/server/uwb/UwbInjector.java
+++ b/service/java/com/android/server/uwb/UwbInjector.java
@@ -500,6 +500,11 @@ public class UwbInjector {
}
}
+ public boolean isMulticastListNtfV2Supported() {
+ return mContext.getResources().getBoolean(
+ com.android.uwb.resources.R.bool.is_multicast_list_update_ntf_v2_supported);
+ }
+
/**
* Gets the configured pose source, which is reference counted. If there are no references
* to the pose source, one will be created based on the device configuration. This may
diff --git a/service/java/com/android/server/uwb/jni/NativeUwbManager.java b/service/java/com/android/server/uwb/jni/NativeUwbManager.java
index a8bcd034..c23c5c2a 100644
--- a/service/java/com/android/server/uwb/jni/NativeUwbManager.java
+++ b/service/java/com/android/server/uwb/jni/NativeUwbManager.java
@@ -367,7 +367,8 @@ public class NativeUwbManager {
String chipId) {
synchronized (mNativeLock) {
return nativeControllerMulticastListUpdate(sessionId, (byte) action,
- (byte) noOfControlee, addresses, subSessionIds, subSessionKeyList, chipId);
+ (byte) noOfControlee, addresses, subSessionIds, subSessionKeyList, chipId,
+ mUwbInjector.isMulticastListNtfV2Supported());
}
}
@@ -598,7 +599,7 @@ public class NativeUwbManager {
private native byte nativeControllerMulticastListUpdate(int sessionId, byte action,
byte noOfControlee, byte[] address, int[] subSessionId, byte[] subSessionKeyList,
- String chipId);
+ String chipId, boolean isMulticastListNtfV2Supported);
private native byte nativeSetCountryCode(byte[] countryCode, String chipId);
diff --git a/service/uci/jni/src/uci_jni_android_new.rs b/service/uci/jni/src/uci_jni_android_new.rs
index ad59b139..aea3a15b 100644
--- a/service/uci/jni/src/uci_jni_android_new.rs
+++ b/service/uci/jni/src/uci_jni_android_new.rs
@@ -860,6 +860,7 @@ pub extern "system" fn Java_com_android_server_uwb_jni_NativeUwbManager_nativeCo
sub_session_ids: jintArray,
sub_session_keys: jbyteArray,
chip_id: JString,
+ is_multicast_list_ntf_v2_supported: jboolean,
) -> jbyte {
debug!("{}: enter", function_name!());
byte_result_helper(
@@ -873,6 +874,7 @@ pub extern "system" fn Java_com_android_server_uwb_jni_NativeUwbManager_nativeCo
sub_session_ids,
sub_session_keys,
chip_id,
+ is_multicast_list_ntf_v2_supported,
),
function_name!(),
)
@@ -890,6 +892,7 @@ fn native_controller_multicast_list_update(
sub_session_ids: jintArray,
sub_session_keys: jbyteArray,
chip_id: JString,
+ is_multicast_list_ntf_v2_supported: jboolean,
) -> Result<()> {
let uci_manager = Dispatcher::get_uci_manager(env, obj, chip_id)?;
@@ -980,6 +983,7 @@ fn native_controller_multicast_list_update(
session_id as u32,
UpdateMulticastListAction::try_from(action as u8).map_err(|_| Error::BadParameters)?,
controlee_list,
+ is_multicast_list_ntf_v2_supported != 0,
)
}