Make change and version bump to OPD1.170816.012

Change-Id: Ie167bb2d8839636658f36390523cceb4e5b63215
diff --git a/core/build_id.mk b/core/build_id.mk
index 36bd0bd..3910090 100644
--- a/core/build_id.mk
+++ b/core/build_id.mk
@@ -18,4 +18,4 @@
 # (like "CRB01").  It must be a single word, and is
 # capitalized by convention.
 
-export BUILD_ID=OPD1.170816.011
+export BUILD_ID=OPD1.170816.012
diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py
index cf78d5e..a203fe0 100755
--- a/tools/releasetools/add_img_to_target_files.py
+++ b/tools/releasetools/add_img_to_target_files.py
@@ -502,7 +502,13 @@
       print("target_files appears to already contain images.")
       sys.exit(1)
 
-  has_vendor = os.path.isdir(os.path.join(OPTIONS.input_tmp, "VENDOR"))
+  # vendor.img is unlike system.img or system_other.img. Because it could be
+  # built from source, or dropped into target_files.zip as a prebuilt blob. We
+  # consider either of them as vendor.img being available, which could be used
+  # when generating vbmeta.img for AVB.
+  has_vendor = (os.path.isdir(os.path.join(OPTIONS.input_tmp, "VENDOR")) or
+                os.path.exists(os.path.join(OPTIONS.input_tmp, "IMAGES",
+                                            "vendor.img")))
   has_system_other = os.path.isdir(os.path.join(OPTIONS.input_tmp,
                                                 "SYSTEM_OTHER"))