Start thread pool in skia_dm on Android.

Android media framework is expected to be run with the background
thread pool for handling binder RPC calls.

Test: skia_dm does not hang with heif files.
Bug: 65463215 Bug: 72869975
Change-Id: I2333d5a13d6145e9468464fa93807851e3a17bc8
Reviewed-on: https://skia-review.googlesource.com/108141
Reviewed-by: Chong Zhang <chz@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 1a72b22..f1c4a4c 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -60,6 +60,10 @@
     #include <unistd.h>
 #endif
 
+#if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) && defined(SK_HAS_HEIF_LIBRARY)
+#include <binder/IPCThreadState.h>
+#endif
+
 extern bool gSkForceRasterPipelineBlitter;
 
 DECLARE_bool(undefok);
@@ -1313,6 +1317,9 @@
 extern sk_sp<SkTypeface> (*gCreateTypefaceDelegate)(const char [], SkFontStyle );
 
 int main(int argc, char** argv) {
+#if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) && defined(SK_HAS_HEIF_LIBRARY)
+    android::ProcessState::self()->startThreadPool();
+#endif
     SkCommandLineFlags::Parse(argc, argv);
 
     if (!FLAGS_nativeFonts) {
diff --git a/gn/gn_to_bp.py b/gn/gn_to_bp.py
index e68a567..0dfada3 100644
--- a/gn/gn_to_bp.py
+++ b/gn/gn_to_bp.py
@@ -185,6 +185,11 @@
     srcs: [
         $dm_srcs
     ],
+
+    shared_libs: [
+        "libbinder",
+        "libutils",
+    ],
 }
 
 cc_test {