Auto hardware/interfaces/Android.bp

Bug: 31909444
Test: make various interfaces, mma -j
Change-Id: Ie2de39572e482415b5279110586a0cb7e5220c8e
diff --git a/update-makefiles.sh b/update-makefiles.sh
index 567877e..939a9c7 100755
--- a/update-makefiles.sh
+++ b/update-makefiles.sh
@@ -17,3 +17,18 @@
   hidl-gen -Lmakefile -r android.hardware:hardware/interfaces $p;
   hidl-gen -Landroidbp -r android.hardware:hardware/interfaces $p;
 done
+
+bp="hardware/interfaces/Android.bp"
+androidbps=$(find hardware/interfaces/*/      \
+             -name "Android.bp"               \
+             -exec dirname {} \;              \
+             | sort)
+
+echo "Updating $bp"
+
+echo "// This is an autogenerated file, do not edit." > $bp;
+echo "subdirs = [" >> $bp;
+for a in $androidbps; do
+  echo "    \"${a#*hardware/interfaces/}\"," >> $bp;
+done
+echo "]" >> $bp;
\ No newline at end of file