./update-makefiles.sh, for union changes/memory

Many more types can be used in Java.

Also, here, update-makefiles.sh has been switched to the standard style
that will find all of the interfaces in the directory, rather than
needing to list them explicitly.

Bug: 143566068
Test: N/A
Change-Id: I3b7d36ff465b9050e1105ed483c5cc46e15e0337
diff --git a/transport/memory/block/1.0/Android.bp b/transport/memory/block/1.0/Android.bp
index 0bb8a27..f26a6d3 100644
--- a/transport/memory/block/1.0/Android.bp
+++ b/transport/memory/block/1.0/Android.bp
@@ -10,7 +10,8 @@
         "types.hal",
     ],
     interfaces: [
+        "[email protected]",
         "[email protected]",
     ],
-    gen_java: false,
+    gen_java: true,
 }
diff --git a/transport/memory/token/1.0/Android.bp b/transport/memory/token/1.0/Android.bp
index e6797d4..937e086 100644
--- a/transport/memory/token/1.0/Android.bp
+++ b/transport/memory/token/1.0/Android.bp
@@ -13,6 +13,5 @@
     interfaces: [
         "[email protected]",
     ],
-    gen_java: false,
+    gen_java: true,
 }
-
diff --git a/update-makefiles.sh b/update-makefiles.sh
index cf13c83..ef39487 100755
--- a/update-makefiles.sh
+++ b/update-makefiles.sh
@@ -1,17 +1,14 @@
 #!/bin/bash
+# Script to update Android make-files for HAL modules.
 
-packages=(
-    [email protected]
-    [email protected]
-    [email protected]
-    [email protected]
-    [email protected]
-    [email protected]
-    [email protected]
-    [email protected]
-)
+set -e
 
-for package in "${packages[@]}"; do
-    echo "Updating $package."
-    hidl-gen -Landroidbp -r android.hidl:system/libhidl/transport $package
-done
+if [ -z "$ANDROID_BUILD_TOP" ]; then
+    echo "Missing ANDROID_BUILD_TOP env variable. Run 'lunch' first."
+    exit 1
+fi
+
+source $ANDROID_BUILD_TOP/system/tools/hidl/update-makefiles-helper.sh
+
+do_makefiles_update \
+  "android.hidl:system/libhidl/transport"