pw_build_android: Make Common Backends static

List the Android common backends as static_libs instead of
whole_static_libs to avoid duplicate symbols when two libraries depend
on the same backends.

Bug: 331458726
Test: Tested in Android main and fixed projects with missing symbols

Change-Id: I1bc3f36877b3994f233a4ff16258156a3e828dc4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/202090
Reviewed-by: Cindy Liu <hcindyl@google.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Carlos Chinchilla <cachinchilla@google.com>
diff --git a/pw_build_android/Android.bp b/pw_build_android/Android.bp
index fb387fb..6fa4d1d 100644
--- a/pw_build_android/Android.bp
+++ b/pw_build_android/Android.bp
@@ -26,26 +26,14 @@
     // Note for maintainers:
     // Update the common backends list in the documentation when updating this
     // list.
-    whole_static_libs: [
+    static_libs: [
         "pw_assert_log",
         "pw_chrono_stl",
         "pw_log_android",
         "pw_sync_stl",
         "pw_thread_stl",
     ],
-    shared_libs: [
-        "liblog",
-    ],
-}
-
-// Temporary list of common Android backends included as static libraries to avoid
-// duplicate symbols when multiple libraries depend these backends.
-// TODO: b/331458726 - Investigate how to avoid duplicate symbols, or stop including
-// the backends as whole_static.
-cc_defaults {
-    name: "pw_android_common_backends_no_whole_libs",
-    cpp_std: "c++20",
-    static_libs: [
+    export_static_lib_headers: [
         "pw_assert_log",
         "pw_chrono_stl",
         "pw_log_android",
diff --git a/pw_result/Android.bp b/pw_result/Android.bp
index d22b07c..864d28c 100644
--- a/pw_result/Android.bp
+++ b/pw_result/Android.bp
@@ -25,8 +25,7 @@
         "public",
     ],
     defaults: [
-        // TODO: b/331458726 - List common backends as static_libs.
-        "pw_android_common_backends_no_whole_libs",
+        "pw_android_common_backends",
     ],
     header_libs: [
         "pw_assert",
diff --git a/pw_tokenizer/Android.bp b/pw_tokenizer/Android.bp
index ad96b12..5e87f5a 100644
--- a/pw_tokenizer/Android.bp
+++ b/pw_tokenizer/Android.bp
@@ -109,6 +109,9 @@
     host_supported: true,
     vendor_available: true,
     export_include_dirs: ["public"],
+    defaults: [
+        "pw_android_common_backends",
+    ],
     srcs: [
         "base64.cc",
     ],