summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-04-30 23:19:15 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-04-30 23:19:15 +0000
commitdd54c452d9885a6ebdde525dbb7d2bc0133e7ede (patch)
tree6b1f45e44413c4ea497aaa245d3efbec12a49d89
parentcf8a63dea6a08632548164172738b408f1c4d6c5 (diff)
parent069fb502290793fe374381ce4b96d73fc7fd09d0 (diff)
downloadUwb-sdk-release.tar.gz
Snap for 11785460 from 069fb502290793fe374381ce4b96d73fc7fd09d0 to sdk-releasesdk-release
Change-Id: I001e87f45108b1054d3426ef751eed5fe7a88238
-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/UwbSessionNotificationManager.java3
-rw-r--r--service/java/com/android/server/uwb/jni/NativeUwbManager.java5
-rw-r--r--service/tests/src/com/android/server/uwb/UwbServiceImplTest.java2
-rw-r--r--service/tests/src/com/android/server/uwb/UwbSessionNotificationManagerTest.java3
-rw-r--r--service/uci/jni/Android.bp16
-rw-r--r--service/uci/jni/src/uci_jni_android_new.rs4
9 files changed, 22 insertions, 21 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/UwbSessionNotificationManager.java b/service/java/com/android/server/uwb/UwbSessionNotificationManager.java
index d32d003c..0e8c487c 100644
--- a/service/java/com/android/server/uwb/UwbSessionNotificationManager.java
+++ b/service/java/com/android/server/uwb/UwbSessionNotificationManager.java
@@ -626,7 +626,8 @@ public class UwbSessionNotificationManager {
// TODO: Add radar specific @SystemApi
// Temporary workaround to avoid adding a new @SystemApi for the short-term.
uwbRangingCallbacks.onDataReceived(
- sessionHandle, null, radarDataBundle, new byte[] {});
+ sessionHandle, UwbAddress.fromBytes(new byte[] {0x0, 0x0}),
+ radarDataBundle, new byte[] {});
Log.i(TAG, "IUwbRangingCallbacks - onDataReceived with radar data");
} catch (Exception e) {
Log.e(TAG, "IUwbRangingCallbacks - onDataReceived with radar data: Failed");
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/tests/src/com/android/server/uwb/UwbServiceImplTest.java b/service/tests/src/com/android/server/uwb/UwbServiceImplTest.java
index 5734595d..84902d22 100644
--- a/service/tests/src/com/android/server/uwb/UwbServiceImplTest.java
+++ b/service/tests/src/com/android/server/uwb/UwbServiceImplTest.java
@@ -844,9 +844,9 @@ public class UwbServiceImplTest {
}
@Test
- @RequiresFlagsEnabled(Flags.FLAG_DATA_TRANSFER_PHASE_CONFIG)
public void testSetDataTransferPhaseConfig() throws Exception {
assumeTrue(SdkLevel.isAtLeastV()); // Test should only run on V+ devices.
+ when(mFeatureFlags.dataTransferPhaseConfig()).thenReturn(true);
final SessionHandle sessionHandle = mock(SessionHandle.class);
PersistableBundle bundle = new PersistableBundle();
mUwbServiceImpl.setDataTransferPhaseConfig(sessionHandle, bundle);
diff --git a/service/tests/src/com/android/server/uwb/UwbSessionNotificationManagerTest.java b/service/tests/src/com/android/server/uwb/UwbSessionNotificationManagerTest.java
index 06d78bd8..7f817099 100644
--- a/service/tests/src/com/android/server/uwb/UwbSessionNotificationManagerTest.java
+++ b/service/tests/src/com/android/server/uwb/UwbSessionNotificationManagerTest.java
@@ -54,6 +54,7 @@ import android.uwb.IUwbRangingCallbacks;
import android.uwb.RangingChangeReason;
import android.uwb.RangingReport;
import android.uwb.SessionHandle;
+import android.uwb.UwbAddress;
import androidx.test.runner.AndroidJUnit4;
@@ -756,7 +757,7 @@ public class UwbSessionNotificationManagerTest {
verify(mIUwbRangingCallbacks).onDataReceived(
eq(mSessionHandle),
- eq(null),
+ eq(UwbAddress.fromBytes(new byte[] {0x00, 0x00})),
argThat(p -> p.getInt("sweep_offset")
== testUwbRadarDataAndRadarData.second.getSweepOffset()),
eq(new byte[] {}));
diff --git a/service/uci/jni/Android.bp b/service/uci/jni/Android.bp
index 9e4827e8..648f452b 100644
--- a/service/uci/jni/Android.bp
+++ b/service/uci/jni/Android.bp
@@ -25,7 +25,6 @@ rust_defaults {
apex_available: [
"com.android.uwb",
],
- host_supported: true,
}
rust_ffi_shared {
@@ -52,21 +51,6 @@ rust_test {
],
test_config_template: "uwb_rust_test_config_template.xml",
},
- host: {
- test_suites: [
- "general-tests",
- ],
- data_libs: [
- "libandroid_runtime_lazy",
- "libbase",
- "libbinder",
- "libbinder_ndk",
- "libcutils",
- "liblog",
- "libutils",
- "libc++",
- ],
- },
},
test_options: {
unit_test: true,
diff --git a/service/uci/jni/src/uci_jni_android_new.rs b/service/uci/jni/src/uci_jni_android_new.rs
index 1fa37047..928513cd 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,
)
}