buildbot-build.sh: Enable build of both host and target. am: fe1c7b4a5b am: c4251c8631 am: be2f405d00

Original change: https://android-review.googlesource.com/c/platform/art/+/1685634

Change-Id: Ibedf376677882958c047dfa0bb5c9b5999145273
diff --git a/build/apex/Android.bp b/build/apex/Android.bp
index 0f9a87f..091f5a1 100644
--- a/build/apex/Android.bp
+++ b/build/apex/Android.bp
@@ -87,6 +87,8 @@
 
 bionic_binaries_both = [
     "linker",
+    // To validate the zip file generated by cloud server.
+    "ziptool",
 ]
 
 // - Debug variants (binaries for which a 32-bit version is preferred on device, but for which
diff --git a/dex2oat/Android.bp b/dex2oat/Android.bp
index 5bd7f00..8b33b05 100644
--- a/dex2oat/Android.bp
+++ b/dex2oat/Android.bp
@@ -67,6 +67,7 @@
     shared_libs: [
         "libbase",
         "libcrypto", // For SHA-1 checksumming of build ID
+        "liblog",
         "liblz4",
         "libz",
     ],
@@ -78,6 +79,7 @@
     whole_static_libs: [
         "libbase",
         "libcrypto",
+        "liblog",
         "liblz4",
         "libz",
     ],
@@ -211,6 +213,7 @@
                 "libbase",
                 "libcrypto",
                 "liblz4", // libart(d)-dex2oat dependency; must be repeated here since it's a static lib.
+                "liblog",
                 "libsigchain",
                 "libz",
             ],
@@ -421,6 +424,7 @@
         "libartd-disassembler",
         "libbase",
         "liblz4", // libartd-dex2oat dependency; must be repeated here since it's a static lib.
+        "liblog",
     ],
     static_libs: [
         "libartd-dex2oat",
@@ -510,6 +514,7 @@
         "libbase",
         "libcrypto",
         "liblz4", // libartd-dex2oat dependency; must be repeated here since it's a static lib.
+        "liblog",
         "libprofiled",
         "libsigchain",
         "libziparchive",
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index cd87eb4..b2bcedc 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -24,6 +24,7 @@
 #include <fstream>
 #include <iostream>
 #include <limits>
+#include <log/log.h>
 #include <sstream>
 #include <string>
 #include <type_traits>
@@ -1348,6 +1349,7 @@
           } else {
             if (input_vdex_file_->HasDexSection()) {
               LOG(ERROR) << "The dex metadata is not allowed to contain dex files";
+              android_errorWriteLog(0x534e4554, "178055795");  // Report to SafetyNet.
               return false;
             }
             VLOG(verifier) << "Doing fast verification with vdex from DexMetadata archive";
diff --git a/libartservice/service/java/com/android/server/art/ArtManagerLocal.java b/libartservice/service/java/com/android/server/art/ArtManagerLocal.java
index aac4b25..04629cb 100644
--- a/libartservice/service/java/com/android/server/art/ArtManagerLocal.java
+++ b/libartservice/service/java/com/android/server/art/ArtManagerLocal.java
@@ -16,8 +16,6 @@
 
 package com.android.server.art;
 
-import libcore.api.CorePlatformApi;
-
 /**
  * This class provides a system API for functionality provided by the ART
  * module.