diff --git a/misc_writer/Android.bp b/misc_writer/Android.bp
deleted file mode 100644
index 73c44d2..0000000
--- a/misc_writer/Android.bp
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-// Copyright (C) 2019 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-cc_defaults {
-    name: "misc_writer_defaults",
-    vendor: true,
-    cpp_std: "experimental",
-
-    cflags: [
-        "-Wall",
-        "-Werror",
-    ],
-
-    shared_libs: [
-        "libbase",
-    ],
-
-    static_libs: [
-        "libbootloader_message_vendor",
-        "libfstab",
-    ],
-}
-
-// TODO(xunchang) Remove duplicates after we convert the device specific librecovery_ui to recovery
-// module. Then libmisc_writer can build as a vendor module available in recovery.
-cc_library_static {
-    name: "libmisc_writer",
-    cpp_std: "experimental",
-
-    cflags: [
-        "-Wall",
-        "-Werror",
-    ],
-
-    shared_libs: [
-        "libbase",
-    ],
-
-    static_libs: [
-        "libbootloader_message",
-        "libfstab",
-    ],
-
-    srcs: [
-        "misc_writer.cpp",
-    ],
-
-    export_include_dirs: [
-        "include",
-    ],
-}
-
-cc_library_static {
-    name: "libmisc_writer_vendor",
-    defaults: [
-        "misc_writer_defaults",
-    ],
-
-    srcs: [
-        "misc_writer.cpp",
-    ],
-
-    export_include_dirs: [
-        "include",
-    ],
-}
-
-cc_binary {
-    name: "misc_writer",
-    defaults: [
-        "misc_writer_defaults",
-    ],
-
-    srcs: [
-        "misc_writer_main.cpp",
-    ],
-
-    static_libs: [
-        "libmisc_writer_vendor",
-    ]
-}
-
-cc_test {
-    name: "misc_writer_test",
-    defaults: [
-        "misc_writer_defaults",
-    ],
-
-    srcs: [
-        "misc_writer_test.cpp",
-    ],
-    test_suites: ["device-tests"],
-
-    static_libs: [
-        "libmisc_writer_vendor",
-    ]
-}
diff --git a/misc_writer/include/misc_writer/misc_writer.h b/misc_writer/include/misc_writer/misc_writer.h
deleted file mode 100644
index 6a32ffe..0000000
--- a/misc_writer/include/misc_writer/misc_writer.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include <optional>
-#include <string>
-
-namespace android {
-namespace hardware {
-namespace google {
-namespace pixel {
-
-enum class MiscWriterActions : int32_t {
-  kSetDarkThemeFlag = 0,
-  kClearDarkThemeFlag,
-  kSetSotaFlag,
-  kClearSotaFlag,
-
-  kUnset = -1,
-};
-
-class MiscWriter {
- public:
-  static constexpr uint32_t kThemeFlagOffsetInVendorSpace = 0;
-  static constexpr char kDarkThemeFlag[] = "theme-dark";
-  static constexpr uint32_t kSotaFlagOffsetInVendorSpace = 32;
-  static constexpr char kSotaFlag[] = "enable-sota";
-
-  // Returns true of |size| bytes data starting from |offset| is fully inside the vendor space.
-  static bool OffsetAndSizeInVendorSpace(size_t offset, size_t size);
-  // Writes the given data to the vendor space in /misc partition, at the given offset. Note that
-  // offset is in relative to the start of the vendor space.
-  static bool WriteMiscPartitionVendorSpace(const void* data, size_t size, size_t offset,
-                                            std::string* err);
-
-  explicit MiscWriter(const MiscWriterActions& action) : action_(action) {}
-
-  // Performs the stored MiscWriterActions. If |override_offset| is set, writes to the input offset
-  // in the vendor space of /misc instead of the default offset.
-  bool PerformAction(std::optional<size_t> override_offset = std::nullopt);
-
- private:
-  MiscWriterActions action_{ MiscWriterActions::kUnset };
-};
-
-}  // namespace pixel
-}  // namespace google
-}  // namespace hardware
-}  // namespace android
diff --git a/misc_writer/misc_writer.cpp b/misc_writer/misc_writer.cpp
deleted file mode 100644
index bf589d3..0000000
--- a/misc_writer/misc_writer.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "misc_writer/misc_writer.h"
-
-#include <string.h>
-
-#include <android-base/file.h>
-#include <android-base/logging.h>
-#include <android-base/stringprintf.h>
-#include <bootloader_message/bootloader_message.h>
-
-namespace android {
-namespace hardware {
-namespace google {
-namespace pixel {
-
-bool MiscWriter::OffsetAndSizeInVendorSpace(size_t offset, size_t size) {
-  auto total_size = WIPE_PACKAGE_OFFSET_IN_MISC - VENDOR_SPACE_OFFSET_IN_MISC;
-  return size <= total_size && offset <= total_size - size;
-}
-
-bool MiscWriter::WriteMiscPartitionVendorSpace(const void* data, size_t size, size_t offset,
-                                               std::string* err) {
-  if (!OffsetAndSizeInVendorSpace(offset, size)) {
-    *err = android::base::StringPrintf("Out of bound write (offset %zu size %zu)", offset, size);
-    return false;
-  }
-  auto misc_blk_device = get_misc_blk_device(err);
-  if (misc_blk_device.empty()) {
-    return false;
-  }
-  return write_misc_partition(data, size, misc_blk_device, VENDOR_SPACE_OFFSET_IN_MISC + offset,
-                              err);
-}
-
-bool MiscWriter::PerformAction(std::optional<size_t> override_offset) {
-  size_t offset = 0;
-  std::string content;
-  switch (action_) {
-    case MiscWriterActions::kSetDarkThemeFlag:
-    case MiscWriterActions::kClearDarkThemeFlag:
-      offset = override_offset.value_or(kThemeFlagOffsetInVendorSpace);
-      content = (action_ == MiscWriterActions::kSetDarkThemeFlag)
-                    ? kDarkThemeFlag
-                    : std::string(strlen(kDarkThemeFlag), 0);
-      break;
-    case MiscWriterActions::kSetSotaFlag:
-    case MiscWriterActions::kClearSotaFlag:
-      offset = override_offset.value_or(kSotaFlagOffsetInVendorSpace);
-      content = (action_ == MiscWriterActions::kSetSotaFlag) ? kSotaFlag
-                                                             : std::string(strlen(kSotaFlag), 0);
-      break;
-    case MiscWriterActions::kUnset:
-      LOG(ERROR) << "The misc writer action must be set";
-      return false;
-  }
-
-  if (std::string err;
-      !WriteMiscPartitionVendorSpace(content.data(), content.size(), offset, &err)) {
-    LOG(ERROR) << "Failed to write " << content << " at offset " << offset << " : " << err;
-    return false;
-  }
-  return true;
-}
-
-}  // namespace pixel
-}  // namespace google
-}  // namespace hardware
-}  // namespace android
diff --git a/misc_writer/misc_writer_main.cpp b/misc_writer/misc_writer_main.cpp
deleted file mode 100644
index 69a9fe3..0000000
--- a/misc_writer/misc_writer_main.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2019 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <getopt.h>
-#include <stdint.h>
-#include <stdlib.h>
-
-#include <iostream>
-#include <map>
-#include <memory>
-#include <optional>
-#include <string>
-#include <string_view>
-
-#include <android-base/logging.h>
-#include <android-base/parseint.h>
-
-#include "misc_writer/misc_writer.h"
-
-using namespace std::string_literals;
-using android::hardware::google::pixel::MiscWriter;
-using android::hardware::google::pixel::MiscWriterActions;
-
-static int Usage(std::string_view name) {
-  std::cerr << name << " usage:\n";
-  std::cerr << name << " [--override-vendor-space-offset <offset>] --<misc_writer_action>\n";
-  std::cerr << "Supported misc_writer_action is one of: \n";
-  std::cerr << "  --set-dark-theme     Write the dark theme flag\n";
-  std::cerr << "  --clear-dark-theme   Clear the dark theme flag\n";
-  std::cerr << "  --set-sota           Write the silent OTA flag\n";
-  std::cerr << "  --clear-sota         Clear the silent OTA flag\n";
-  std::cerr << "Writes the given hex string to the specified offset in vendor space in /misc "
-               "partition.\nDefault offset is used for each action unless "
-               "--override-vendor-space-offset is specified.\n";
-  return EXIT_FAILURE;
-}
-
-// misc_writer is a vendor tool that writes data to the vendor space in /misc.
-int main(int argc, char** argv) {
-  constexpr struct option OPTIONS[] = {
-    { "set-dark-theme", no_argument, nullptr, 0 },
-    { "clear-dark-theme", no_argument, nullptr, 0 },
-    { "set-sota", no_argument, nullptr, 0 },
-    { "clear-sota", no_argument, nullptr, 0 },
-    { "override-vendor-space-offset", required_argument, nullptr, 0 },
-    { nullptr, 0, nullptr, 0 },
-  };
-
-  std::map<std::string, MiscWriterActions> action_map{
-    { "set-dark-theme", MiscWriterActions::kSetDarkThemeFlag },
-    { "clear-dark-theme", MiscWriterActions::kClearDarkThemeFlag },
-    { "set-sota", MiscWriterActions::kSetSotaFlag },
-    { "clear-sota", MiscWriterActions::kClearSotaFlag },
-  };
-
-  std::unique_ptr<MiscWriter> misc_writer;
-  std::optional<size_t> override_offset;
-
-  int arg;
-  int option_index = 0;
-  while ((arg = getopt_long(argc, argv, "", OPTIONS, &option_index)) != -1) {
-    if (arg != 0) {
-      LOG(ERROR) << "Invalid command argument";
-      return Usage(argv[0]);
-    }
-    auto option_name = OPTIONS[option_index].name;
-    if (option_name == "override-vendor-space-offset"s) {
-      LOG(WARNING) << "Overriding the vendor space offset in misc partition to " << optarg;
-      size_t offset;
-      if (!android::base::ParseUint(optarg, &offset)) {
-        LOG(ERROR) << "Failed to parse the offset: " << optarg;
-        return Usage(argv[0]);
-      }
-      override_offset = offset;
-    } else if (auto iter = action_map.find(option_name); iter != action_map.end()) {
-      if (misc_writer) {
-        LOG(ERROR) << "Misc writer action has already been set";
-        return Usage(argv[0]);
-      }
-      misc_writer = std::make_unique<MiscWriter>(iter->second);
-    } else {
-      LOG(FATAL) << "Unreachable path, option_name: " << option_name;
-    }
-  }
-
-  if (!misc_writer) {
-    LOG(ERROR) << "An action must be specified for misc writer";
-    return Usage(argv[0]);
-  }
-
-  if (!misc_writer->PerformAction(override_offset)) {
-    return EXIT_FAILURE;
-  }
-
-  return EXIT_SUCCESS;
-}
diff --git a/misc_writer/misc_writer_test.cpp b/misc_writer/misc_writer_test.cpp
deleted file mode 100644
index e8b207a..0000000
--- a/misc_writer/misc_writer_test.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <memory>
-#include <string>
-#include <string_view>
-#include <vector>
-
-#include <android-base/file.h>
-#include <bootloader_message/bootloader_message.h>
-#include <gtest/gtest.h>
-
-#include "misc_writer/misc_writer.h"
-
-using namespace std::string_literals;
-
-namespace android {
-namespace hardware {
-namespace google {
-namespace pixel {
-
-class MiscWriterTest : public ::testing::Test {
- protected:
-  void TearDown() override {
-    // Clear the vendor space.
-    auto zeros = std::string(WIPE_PACKAGE_OFFSET_IN_MISC - VENDOR_SPACE_OFFSET_IN_MISC, 0);
-    std::string err;
-    ASSERT_TRUE(MiscWriter::WriteMiscPartitionVendorSpace(zeros.data(), zeros.size(), 0, &err))
-        << err;
-  }
-
-  void CheckMiscPartitionVendorSpaceContent(size_t offset, const std::string& expected);
-
-  std::unique_ptr<MiscWriter> misc_writer_;
-};
-
-void MiscWriterTest::CheckMiscPartitionVendorSpaceContent(size_t offset,
-                                                          const std::string& expected) {
-  ASSERT_TRUE(MiscWriter::OffsetAndSizeInVendorSpace(offset, expected.size()));
-  std::string err;
-  auto misc_blk_device = get_misc_blk_device(&err);
-  ASSERT_FALSE(misc_blk_device.empty());
-  android::base::unique_fd fd(open(misc_blk_device.c_str(), O_RDONLY));
-  ASSERT_NE(-1, fd);
-
-  std::string content(expected.size(), 0);
-  ASSERT_TRUE(android::base::ReadFullyAtOffset(fd, content.data(), content.size(),
-                                               VENDOR_SPACE_OFFSET_IN_MISC + offset));
-  ASSERT_EQ(expected, content);
-}
-
-TEST_F(MiscWriterTest, SetClearDarkTheme) {
-  misc_writer_ = std::make_unique<MiscWriter>(MiscWriterActions::kSetDarkThemeFlag);
-  ASSERT_TRUE(misc_writer_);
-  ASSERT_TRUE(misc_writer_->PerformAction());
-  std::string expected = "theme-dark";
-  CheckMiscPartitionVendorSpaceContent(0, expected);
-
-  misc_writer_ = std::make_unique<MiscWriter>(MiscWriterActions::kClearDarkThemeFlag);
-  ASSERT_TRUE(misc_writer_->PerformAction());
-  std::string zeros(expected.size(), 0);
-  CheckMiscPartitionVendorSpaceContent(0, zeros);
-}
-
-TEST_F(MiscWriterTest, SetClearDarkTheme_OffsetOverride) {
-  misc_writer_ = std::make_unique<MiscWriter>(MiscWriterActions::kSetDarkThemeFlag);
-  size_t offset = 12360;
-  ASSERT_TRUE(misc_writer_->PerformAction(offset));
-  std::string expected = "theme-dark";
-  CheckMiscPartitionVendorSpaceContent(offset, expected);
-
-  misc_writer_ = std::make_unique<MiscWriter>(MiscWriterActions::kClearDarkThemeFlag);
-  ASSERT_TRUE(misc_writer_->PerformAction(offset));
-  std::string zeros(expected.size(), 0);
-  CheckMiscPartitionVendorSpaceContent(offset, zeros);
-}
-
-TEST_F(MiscWriterTest, SetClearSota) {
-  misc_writer_ = std::make_unique<MiscWriter>(MiscWriterActions::kSetSotaFlag);
-  ASSERT_TRUE(misc_writer_);
-  ASSERT_TRUE(misc_writer_->PerformAction());
-  std::string expected = "enable-sota";
-  CheckMiscPartitionVendorSpaceContent(32, expected);
-
-  // Test we can write to the override offset.
-  size_t override_offset = 12360;
-  ASSERT_FALSE(misc_writer_->PerformAction(override_offset));
-  CheckMiscPartitionVendorSpaceContent(override_offset, expected);
-
-  misc_writer_ = std::make_unique<MiscWriter>(MiscWriterActions::kClearSotaFlag);
-  ASSERT_TRUE(misc_writer_->PerformAction());
-  std::string zeros(expected.size(), 0);
-  CheckMiscPartitionVendorSpaceContent(32, zeros);
-}
-
-TEST_F(MiscWriterTest, WriteMiscPartitionVendorSpace) {
-  std::string kTestMessage = "kTestMessage";
-  std::string err;
-  ASSERT_TRUE(
-      MiscWriter::WriteMiscPartitionVendorSpace(kTestMessage.data(), kTestMessage.size(), 0, &err));
-
-  CheckMiscPartitionVendorSpaceContent(0, kTestMessage);
-
-  // Write with an offset.
-  ASSERT_TRUE(MiscWriter::WriteMiscPartitionVendorSpace("\x00\x00", 2, 5, &err));
-  CheckMiscPartitionVendorSpaceContent(0, "kTest\x00\x00ssage"s);
-
-  // Write with the right size.
-  auto start_offset =
-      WIPE_PACKAGE_OFFSET_IN_MISC - VENDOR_SPACE_OFFSET_IN_MISC - kTestMessage.size();
-  ASSERT_TRUE(MiscWriter::WriteMiscPartitionVendorSpace(kTestMessage.data(), kTestMessage.size(),
-                                                        start_offset, &err));
-
-  // Out-of-bound write.
-  ASSERT_FALSE(MiscWriter::WriteMiscPartitionVendorSpace(kTestMessage.data(), kTestMessage.size(),
-                                                         start_offset + 1, &err));
-
-  // Message won't fit.
-  std::string long_message(WIPE_PACKAGE_OFFSET_IN_MISC - VENDOR_SPACE_OFFSET_IN_MISC + 1, 'a');
-  ASSERT_FALSE(
-      MiscWriter::WriteMiscPartitionVendorSpace(long_message.data(), long_message.size(), 0, &err));
-}
-
-}  // namespace pixel
-}  // namespace google
-}  // namespace hardware
-}  // namespace android
