resolve merge conflicts of 61799ba to nyc-dev-plus-aosp
am: 0c39203

* commit '0c39203698b904e165237f67d6bd013debd6dc47':
  uncrypt: remove --read-bcb option.

Change-Id: Ic84b20a7736d6c0cd5f4e3ff07a02cbd64e285aa
diff --git a/uncrypt/uncrypt.cpp b/uncrypt/uncrypt.cpp
index 2986606..f569bce 100644
--- a/uncrypt/uncrypt.cpp
+++ b/uncrypt/uncrypt.cpp
@@ -423,24 +423,6 @@
     return "";
 }
 
-static int read_bootloader_message(bootloader_message* out) {
-    std::string misc_blk_device = get_misc_blk_device();
-    if (misc_blk_device.empty()) {
-        ALOGE("failed to find /misc partition.");
-        return -1;
-    }
-    android::base::unique_fd fd(open(misc_blk_device.c_str(), O_RDONLY));
-    if (fd == -1) {
-        ALOGE("failed to open %s: %s", misc_blk_device.c_str(), strerror(errno));
-        return -1;
-    }
-    if (!android::base::ReadFully(fd, out, sizeof(*out))) {
-        ALOGE("failed to read %s: %s", misc_blk_device.c_str(), strerror(errno));
-        return -1;
-    }
-    return 0;
-}
-
 static int write_bootloader_message(const bootloader_message* in) {
     std::string misc_blk_device = get_misc_blk_device();
     if (misc_blk_device.empty()) {
@@ -568,23 +550,11 @@
     return true;
 }
 
-static int read_bcb() {
-    bootloader_message boot;
-    if (read_bootloader_message(&boot) != 0) {
-        ALOGE("failed to get bootloader message");
-        return 1;
-    }
-    printf("bcb command: %s\n", boot.command);
-    printf("bcb recovery:\n%s\n", boot.recovery);
-    return 0;
-}
-
 static void usage(const char* exename) {
     fprintf(stderr, "Usage of %s:\n", exename);
     fprintf(stderr, "%s [<package_path> <map_file>]  Uncrypt ota package.\n", exename);
     fprintf(stderr, "%s --clear-bcb  Clear BCB data in misc partition.\n", exename);
     fprintf(stderr, "%s --setup-bcb  Setup BCB data by command file.\n", exename);
-    fprintf(stderr, "%s --read-bcb   Read BCB data from misc partition.\n", exename);
 }
 
 int main(int argc, char** argv) {
@@ -596,8 +566,6 @@
         action = CLEAR_BCB;
     } else if (argc == 2 && strcmp(argv[1], "--setup-bcb") == 0) {
         action = SETUP_BCB;
-    } else if (argc ==2 && strcmp(argv[1], "--read-bcb") == 0) {
-        return read_bcb();
     } else if (argc == 1) {
         action = UNCRYPT;
     } else if (argc == 3) {