Snap for 7083521 from 164369e95d5be30d6887b60bf893ecc7845354e0 to sc-d1-release

Change-Id: I521588092bcb53ce0c781c714e2a414e14321d24
diff --git a/applypatch/Android.bp b/applypatch/Android.bp
index 13a9625..80d8041 100644
--- a/applypatch/Android.bp
+++ b/applypatch/Android.bp
@@ -54,7 +54,7 @@
         "libbz",
         "libedify",
         "libotautil",
-        "libz",
+        "libz_stable",
     ],
 
     shared_libs: [
@@ -71,6 +71,7 @@
 cc_library_static {
     name: "libapplypatch_modes",
     vendor_available: true,
+    host_supported: true,
 
     defaults: [
         "applypatch_defaults",
@@ -95,6 +96,7 @@
 cc_binary {
     name: "applypatch",
     vendor: true,
+    host_supported: true,
 
     defaults: [
         "applypatch_defaults",
@@ -120,7 +122,7 @@
         "libbase",
         "libcrypto",
         "liblog",
-        "libz",
+        "libz_stable",
         "libziparchive",
     ],
 
@@ -129,9 +131,9 @@
     ],
 }
 
-cc_library_host_static {
+cc_library_static {
     name: "libimgdiff",
-
+    host_supported: true,
     defaults: [
         "applypatch_defaults",
     ],
@@ -152,14 +154,13 @@
         "liblog",
         "libotautil",
         "libutils",
-        "libz",
+        "libz_stable",
         "libziparchive",
     ],
 }
 
 cc_binary_host {
     name: "imgdiff",
-
     srcs: [
         "imgdiff_main.cpp",
     ],
@@ -180,6 +181,6 @@
         "liblog",
         "libbrotli",
         "libbz",
-        "libz",
+        "libz_stable",
     ],
 }
diff --git a/tests/Android.bp b/tests/Android.bp
index 19f2a6c..d2179e4 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -31,7 +31,6 @@
         "libpng",
         "libprocessgroup",
         "libselinux",
-        "libz",
         "libziparchive",
     ],
 
@@ -65,7 +64,7 @@
     "libbase",
     "libbrotli",
     "libbz",
-    "libz",
+    "libz_stable",
     "libziparchive",
 ]
 
diff --git a/tests/testdata/recovery-from-boot.p b/tests/testdata/recovery-from-boot.p
index 06f6c29..81738ed 100644
--- a/tests/testdata/recovery-from-boot.p
+++ b/tests/testdata/recovery-from-boot.p
Binary files differ
diff --git a/tests/unit/applypatch_modes_test.cpp b/tests/unit/applypatch_modes_test.cpp
index 9e97979..08414b7 100644
--- a/tests/unit/applypatch_modes_test.cpp
+++ b/tests/unit/applypatch_modes_test.cpp
@@ -100,7 +100,7 @@
   ASSERT_EQ(2, InvokeApplyPatchModes({ "applypatch", "-x" }));
 }
 
-TEST_F(ApplyPatchModesTest, DISABLED_PatchModeEmmcTarget) {
+TEST_F(ApplyPatchModesTest, PatchModeEmmcTarget) {
   std::vector<std::string> args{
     "applypatch",
     "--bonus",
@@ -118,7 +118,7 @@
 
 // Tests patching an eMMC target without a separate bonus file (i.e. recovery-from-boot patch has
 // everything).
-TEST_F(ApplyPatchModesTest, DISABLED_PatchModeEmmcTargetWithoutBonusFile) {
+TEST_F(ApplyPatchModesTest, PatchModeEmmcTargetWithoutBonusFile) {
   std::vector<std::string> args{
     "applypatch", "--patch", from_testdata_base("recovery-from-boot-with-bonus.p"),
     "--target",   target,    "--source",
diff --git a/tests/unit/applypatch_test.cpp b/tests/unit/applypatch_test.cpp
index 4b80dce..218a224 100644
--- a/tests/unit/applypatch_test.cpp
+++ b/tests/unit/applypatch_test.cpp
@@ -132,7 +132,7 @@
       PatchPartitionCheck(target_partition, Partition(target_file, source_size, source_sha1)));
 }
 
-TEST_F(ApplyPatchTest, DISABLED_PatchPartition) {
+TEST_F(ApplyPatchTest, PatchPartition) {
   FileContents patch_fc;
   ASSERT_TRUE(LoadFileContents(from_testdata_base("recovery-from-boot.p"), &patch_fc));
   Value patch(Value::Type::BLOB, std::string(patch_fc.data.cbegin(), patch_fc.data.cend()));
@@ -146,7 +146,7 @@
 
 // Tests patching an eMMC target without a separate bonus file (i.e. recovery-from-boot patch has
 // everything).
-TEST_F(ApplyPatchTest, DISABLED_PatchPartitionWithoutBonusFile) {
+TEST_F(ApplyPatchTest, PatchPartitionWithoutBonusFile) {
   FileContents patch_fc;
   ASSERT_TRUE(LoadFileContents(from_testdata_base("recovery-from-boot-with-bonus.p"), &patch_fc));
   Value patch(Value::Type::BLOB, std::string(patch_fc.data.cbegin(), patch_fc.data.cend()));