./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/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=(
-    android.hidl.allocator@1.0
-    android.hidl.base@1.0
-    android.hidl.manager@1.0
-    android.hidl.manager@1.1
-    android.hidl.manager@1.2
-    android.hidl.memory@1.0
-    android.hidl.safe_union@1.0
-    android.hidl.token@1.0
-)
+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"