binder_parcel_fuzzer: split out random_parcel.h

This creates libbinder_random_parcel which can create a random libbinder
parcel, complete with random fds/random binder objects, for use in other
fuzzers.

Future considerations:
- also export NdkBinderParcelAdapter, for use fuzzing libbinder_ndk
  users
- implement similar functionality for libhwbinder

Bug: N/A
Test: binder_parcel_fuzzer
Change-Id: I4943c5e8b6662a8155dc42109eda245f35eedef8
diff --git a/libs/binder/parcel_fuzzer/Android.bp b/libs/binder/parcel_fuzzer/Android.bp
index 1a67898..c5b3d80 100644
--- a/libs/binder/parcel_fuzzer/Android.bp
+++ b/libs/binder/parcel_fuzzer/Android.bp
@@ -18,6 +18,7 @@
     ],
     static_libs: [
         "libbase",
+        "libbinder_random_parcel",
         "libcgrouprc",
         "libcgrouprc_format",
         "libcutils",
@@ -47,3 +48,20 @@
     // produced, you may find uncommenting the below line very useful.
     // cflags: ["-DENABLE_LOG_FUZZ"],
 }
+
+cc_library_static {
+    name: "libbinder_random_parcel",
+    host_supported: true,
+    srcs: [
+        "random_fd.cpp",
+        "random_parcel.cpp",
+    ],
+    shared_libs: [
+        "libbase",
+        "libbinder",
+        "libcutils",
+        "libutils",
+    ],
+    local_include_dirs: ["include_random_parcel"],
+    export_include_dirs: ["include_random_parcel"],
+}