diff --git a/android/app/Android.bp b/android/app/Android.bp
index f5c826f4076fee53aadc1e4c8d240c13851458c7..4976e19a429d16b287de0571b95908d86d141317 100644
--- a/android/app/Android.bp
+++ b/android/app/Android.bp
@@ -114,6 +114,7 @@ cc_library_shared {
         "libcrypto",
         "libfmq",
         "libnativehelper",
+        "libstatssocket",
         "libutils",
     ],
     sanitize: {
diff --git a/system/bta/Android.bp b/system/bta/Android.bp
index 8d013ac80c00af74e01aae45fe05280e31d1d638..47a0999c2291b1e2377ab9e13b6d5a0cbf620b70 100644
--- a/system/bta/Android.bp
+++ b/system/bta/Android.bp
@@ -272,6 +272,7 @@ cc_test {
         "libcrypto",
         "liblog",
         "libprotobuf-cpp-lite",
+        "libstatssocket",
     ],
     static_libs: [
         "crypto_toolbox_for_tests",
diff --git a/system/btif/Android.bp b/system/btif/Android.bp
index 3b4a003c968ea75612b1e17feb42315396e6c3d2..c0ebc63d9c095f73a60e413adafdff599a4eec5e 100644
--- a/system/btif/Android.bp
+++ b/system/btif/Android.bp
@@ -264,6 +264,7 @@ cc_test {
         "libcrypto",
         "libfmq",
         "libhidlbase",
+        "libstatssocket",
         "libutils",
     ],
     static_libs: [
@@ -412,6 +413,11 @@ cc_test {
         "libosi",
         "libosi-AllocationTestHarness",
     ],
+    target: {
+        android: {
+            shared_libs: ["libstatssocket"],
+        },
+    },
     cflags: ["-DBUILDCFG"],
     sanitize: {
         address: true,
@@ -611,6 +617,7 @@ cc_test {
             ],
             shared_libs: [
                 "libbinder_ndk",
+                "libstatssocket",
             ],
         },
     },
@@ -742,6 +749,7 @@ cc_test {
             ],
             shared_libs: [
                 "libbinder_ndk",
+                "libstatssocket",
             ],
         },
     },
diff --git a/system/build/Android.bp b/system/build/Android.bp
index 311907951d28a69336d3e674408d782114c03404..45c7dfacaf3634574ee4eddfa8e407e6d12c8663 100644
--- a/system/build/Android.bp
+++ b/system/build/Android.bp
@@ -139,9 +139,6 @@ cc_defaults {
             enabled: false,
         },
         android: {
-            shared_libs: [
-                "libstatssocket",
-            ],
             sanitize: {
                 misc_undefined: ["bounds"],
             },
diff --git a/system/common/Android.bp b/system/common/Android.bp
index fb435d95e5264e37292dc792b7eeb232d221e438..f807554a658cced8cc2584ec2b70540dda270013 100644
--- a/system/common/Android.bp
+++ b/system/common/Android.bp
@@ -75,6 +75,7 @@ cc_test {
     target: {
         android: {
             srcs: ["metrics_unittest.cc"],
+            shared_libs: ["libstatssocket"],
         },
     },
     shared_libs: [
diff --git a/system/main/Android.bp b/system/main/Android.bp
index 0586310c63e341e4fbe0204d0fb3ac6ca463a516..636069b1246f348a5b34f007de3972c3bd89572c 100644
--- a/system/main/Android.bp
+++ b/system/main/Android.bp
@@ -91,6 +91,13 @@ cc_library {
         "android.hardware.bluetooth@1.0",
         "android.hardware.bluetooth@1.1",
     ],
+    target: {
+        android: {
+            shared_libs: [
+                "libstatssocket",
+            ],
+        },
+    },
     // Shared library link options.
     // References to global symbols and functions should bind to the library
     // itself. This is to avoid issues with some of the unit/system tests
diff --git a/system/osi/Android.bp b/system/osi/Android.bp
index ab19f5c65a05b9add1f884bbbd0d24028b71f2d5..da4f9cf2e135d1846efe31fa3df74aa270cbdcdd 100644
--- a/system/osi/Android.bp
+++ b/system/osi/Android.bp
@@ -168,6 +168,13 @@ cc_test {
         "libosi",
         "libprotobuf-cpp-lite",
     ],
+    target: {
+        android: {
+            shared_libs: [
+                "libstatssocket",
+            ],
+        },
+    },
     cflags: [
         "-DLIB_OSI_INTERNAL",
     ],
diff --git a/system/osi/test/fuzzers/alarm/Android.bp b/system/osi/test/fuzzers/alarm/Android.bp
index 15a4710fe9bf215e7887ea6272159270c54b99be..4bcef92af9060bb3c182f29f24f1f5a2835f5b57 100644
--- a/system/osi/test/fuzzers/alarm/Android.bp
+++ b/system/osi/test/fuzzers/alarm/Android.bp
@@ -19,6 +19,7 @@ cc_fuzz {
         "libcutils",
         "liblog",
         "libprotobuf-cpp-lite",
+        "libstatssocket",
     ],
     static_libs: [
         "libbt-common",
diff --git a/system/stack/Android.bp b/system/stack/Android.bp
index 2fb36c9d6311099713b4cfa10da162b76a774175..e50f936e57a4842dac9aaa404da39af055aef396 100644
--- a/system/stack/Android.bp
+++ b/system/stack/Android.bp
@@ -328,6 +328,7 @@ cc_test {
         "libfmq",
         "libhidlbase",
         "liblog",
+        "libstatssocket",
         "libutils",
         "libz",
     ],
@@ -437,6 +438,13 @@ cc_test {
         "libosi",
         "libprotobuf-cpp-lite",
     ],
+    target: {
+        android: {
+            shared_libs: [
+                "libstatssocket",
+            ],
+        },
+    },
     sanitize: {
         cfi: false,
     },
@@ -663,6 +671,13 @@ cc_test {
         "libosi",
         "libosi-AllocationTestHarness",
     ],
+    target: {
+        android: {
+            shared_libs: [
+                "libstatssocket",
+            ],
+        },
+    },
     sanitize: {
         address: true,
         cfi: true,
@@ -721,6 +736,11 @@ cc_test {
         "libosi-AllocationTestHarness",
         "libprotobuf-cpp-lite",
     ],
+    target: {
+        android: {
+            shared_libs: ["libstatssocket"],
+        },
+    },
     sanitize: {
         address: true,
         cfi: true,
@@ -927,6 +947,11 @@ cc_test {
         "liblog",
         "libosi",
     ],
+    target: {
+        android: {
+            shared_libs: ["libstatssocket"],
+        },
+    },
 }
 
 // Iso manager unit tests
@@ -1030,6 +1055,11 @@ cc_test {
         "libosi",
         "libprotobuf-cpp-lite",
     ],
+    target: {
+        android: {
+            shared_libs: ["libstatssocket"],
+        },
+    },
     sanitize: {
         cfi: false,
     },
@@ -1247,6 +1277,11 @@ cc_test {
     shared_libs: [
         "libcrypto",
     ],
+    target: {
+        android: {
+            shared_libs: ["libstatssocket"],
+        },
+    },
     sanitize: {
         address: true,
         all_undefined: true,
@@ -1397,6 +1432,11 @@ cc_test {
         "libbinder_ndk",
         "libcrypto",
     ],
+    target: {
+        android: {
+            shared_libs: ["libstatssocket"],
+        },
+    },
     sanitize: {
         address: true,
         all_undefined: true,
@@ -1477,6 +1517,7 @@ cc_test {
         android: {
             shared_libs: [
                 "libPlatformProperties",
+                "libstatssocket",
             ],
         },
     },
@@ -1556,6 +1597,11 @@ cc_test {
         "libbinder_ndk",
         "libcrypto",
     ],
+    target: {
+        android: {
+            shared_libs: ["libstatssocket"],
+        },
+    },
     sanitize: {
         address: true,
         all_undefined: true,
diff --git a/system/stack/test/fuzzers/Android.bp b/system/stack/test/fuzzers/Android.bp
index 47c68eb3466efb6fe1f34aff5cfbc7da951f8a19..e7494bd186d5ef5ff5d2259de66e5f266309fcac 100644
--- a/system/stack/test/fuzzers/Android.bp
+++ b/system/stack/test/fuzzers/Android.bp
@@ -63,6 +63,7 @@ cc_defaults {
         "libhidlbase",
         "liblog",
         "libprotobuf-cpp-lite",
+        "libstatssocket",
         "libutils",
     ],
 }
diff --git a/system/test/headless/Android.bp b/system/test/headless/Android.bp
index e192c753ef5b46f011c3c30f1d0dcc638dd5ec64..aad71a9995c7571bfcc3c113c11645c846746b74 100644
--- a/system/test/headless/Android.bp
+++ b/system/test/headless/Android.bp
@@ -133,6 +133,7 @@ cc_binary {
         "libhidlbase",
         "libjsoncpp",
         "liblog", // __android_log_print
+        "libstatssocket",
         "libutils",
     ],
     ldflags: ["-rdynamic"],