Merge "Enable mock-utils for Android build system"
diff --git a/src/Android.bp b/src/Android.bp
index f700fd5..5fc7630 100755
--- a/src/Android.bp
+++ b/src/Android.bp
@@ -111,6 +111,16 @@
     ],
 }
 
+// Builds uwb_core library with "mock-utils" enabled.
+// This enables mock methods to be used for testing external crates.
+rust_library {
+    name: "libuwb_core_with_mock",
+    defaults: ["libuwb_core_defaults"],
+    crate_name: "uwb_core",
+    features: ["mock-utils"],
+    host_supported: true,
+}
+
 rust_test {
     name: "libuwb_core_tests",
     defaults: ["libuwb_core_defaults"],
@@ -238,8 +248,8 @@
     },
 }
 
-rust_library {
-    name: "libuci_hal_android",
+rust_defaults {
+    name: "libuci_hal_android_defaults",
     crate_name: "uci_hal_android",
     lints: "android",
     clippy_lints: "android",
@@ -253,7 +263,6 @@
         "liblog_rust",
         "libthiserror",
         "libtokio",
-        "libuwb_core",
         "libuwb_uci_packets",
     ],
     target: {
@@ -276,6 +285,25 @@
     ],
 }
 
+rust_library {
+    name: "libuci_hal_android",
+    defaults: ["libuci_hal_android_defaults"],
+    rustlibs: [
+        "libuwb_core",
+    ],
+}
+
+// uci_hal_android built with uwb_core_with_mock.
+// Used to replace uci_hal_android in place where mock version of uwb_core is
+// used.
+rust_library {
+    name: "libuci_hal_android_with_mock",
+    defaults: ["libuci_hal_android_defaults"],
+    rustlibs: [
+        "libuwb_core_with_mock",
+    ],
+}
+
 // Generate the artifacts zip for uwb_core library and its dependencies.
 genrule {
     name: "uwb_core_artifacts",
diff --git a/src/rust/uwb_core/src/uci/mock_uci_manager.rs b/src/rust/uwb_core/src/uci/mock_uci_manager.rs
index 04d604d..f511551 100644
--- a/src/rust/uwb_core/src/uci/mock_uci_manager.rs
+++ b/src/rust/uwb_core/src/uci/mock_uci_manager.rs
@@ -12,6 +12,11 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+//! This module offers a mocked version of UciManager for testing.
+//!
+//! The mocked version of UciManager mimics the behavior of the UCI manager and
+//! stacks below it, such that tests can be run on a target without the UWB
+//! hardware.
 use std::collections::VecDeque;
 use std::sync::{Arc, Mutex};
 use std::time::Duration;