From 6f2be4009704a0b7b1c4f8ac768e1013cc1a8187 Mon Sep 17 00:00:00 2001
From: Chris Manton <cmanton@google.com>
Date: Fri, 17 Nov 2023 14:09:59 -0800
Subject: [PATCH] btif_hh_test: Link with OsiCompatSources

Bug: 311714808
Test: atest net_test_btif_hh

Change-Id: If882fbb7fdec1086431ee8f9f863fe14300fc8e9
---
 system/btif/Android.bp           |  1 +
 system/btif/test/btif_hh_test.cc | 26 --------------------------
 2 files changed, 1 insertion(+), 26 deletions(-)

diff --git a/system/btif/Android.bp b/system/btif/Android.bp
index 64be7a1f207..3de9908ec36 100644
--- a/system/btif/Android.bp
+++ b/system/btif/Android.bp
@@ -579,6 +579,7 @@ cc_test {
     srcs: [
         ":BtaDmSources",
         ":LibBluetoothSources",
+        ":OsiCompatSources",
         ":TestCommonCoreInterface",
         ":TestCommonMainHandler",
         ":TestCommonMockFunctions",
diff --git a/system/btif/test/btif_hh_test.cc b/system/btif/test/btif_hh_test.cc
index 791c2b6bc07..a4eb9b36935 100644
--- a/system/btif/test/btif_hh_test.cc
+++ b/system/btif/test/btif_hh_test.cc
@@ -67,32 +67,6 @@ extern bool bluetooth_shim_is_gd_stack_started_up;
 }
 }  // namespace test
 
-#if __GLIBC__
-size_t strlcpy(char* dst, const char* src, size_t siz) {
-  char* d = dst;
-  const char* s = src;
-  size_t n = siz;
-
-  /* Copy as many bytes as will fit */
-  if (n != 0) {
-    while (--n != 0) {
-      if ((*d++ = *s++) == '\0') break;
-    }
-  }
-
-  /* Not enough room in dst, add NUL and traverse rest of src */
-  if (n == 0) {
-    if (siz != 0) *d = '\0'; /* NUL-terminate dst */
-    while (*s++)
-      ;
-  }
-
-  return (s - src - 1); /* count does not include NUL */
-}
-
-pid_t gettid(void) throw() { return syscall(SYS_gettid); }
-#endif
-
 namespace {
 std::array<uint8_t, 32> data32 = {
     0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
-- 
GitLab