diff --git a/gear/dumpstate/Android.bp b/gear/dumpstate/Android.bp
deleted file mode 100644
index 590ba10..0000000
--- a/gear/dumpstate/Android.bp
+++ /dev/null
@@ -1,29 +0,0 @@
-package {
-    default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-cc_binary {
-    name: "android.hardware.dumpstate-service",
-    srcs: [
-        "Dumpstate.cpp",
-        "service.cpp",
-    ],
-    init_rc: ["android.hardware.dumpstate-service.rc"],
-    vintf_fragments: ["android.hardware.dumpstate-service.xml"],
-    cflags: [
-        "-Wall",
-        "-Werror",
-    ],
-    shared_libs: [
-        "libbase",
-        "libbinder_ndk",
-        "libcutils",
-        "libdumpstateutil",
-        "liblog",
-        "libutils",
-	"libdump",
-        "android.hardware.dumpstate-V1-ndk",
-    ],
-    vendor: true,
-    relative_install_path: "hw",
-}
diff --git a/gear/dumpstate/Dumpstate.cpp b/gear/dumpstate/Dumpstate.cpp
deleted file mode 100644
index 4597c6a..0000000
--- a/gear/dumpstate/Dumpstate.cpp
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright 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.
- */
-
-#define LOG_TAG "dumpstate_device"
-
-#include <inttypes.h>
-
-#include <android-base/file.h>
-#include <android-base/stringprintf.h>
-#include <android-base/properties.h>
-#include <android-base/unique_fd.h>
-#include <log/log.h>
-#include <sys/stat.h>
-#include <dump/pixel_dump.h>
-#include "Dumpstate.h"
-
-#include "DumpstateUtil.h"
-
-#define HW_REVISION "ro.boot.hardware.revision"
-
-using android::os::dumpstate::CommandOptions;
-using android::os::dumpstate::DumpFileToFd;
-using android::os::dumpstate::PropertiesHelper;
-using android::os::dumpstate::RunCommandToFd;
-
-namespace aidl {
-namespace android {
-namespace hardware {
-namespace dumpstate {
-
-typedef std::chrono::time_point<std::chrono::steady_clock> timepoint_t;
-
-const char kVerboseLoggingProperty[] = "persist.vendor.verbose_logging_enabled";
-
-timepoint_t startSection(int fd, const std::string &sectionName) {
-    ::android::base::WriteStringToFd(
-            "\n"
-            "------ Section start: " + sectionName + " ------\n"
-            "\n", fd);
-    return std::chrono::steady_clock::now();
-}
-
-void endSection(int fd, const std::string &sectionName, timepoint_t startTime) {
-    auto endTime = std::chrono::steady_clock::now();
-    auto elapsedMsec = std::chrono::duration_cast<std::chrono::milliseconds>
-            (endTime - startTime).count();
-
-    ::android::base::WriteStringToFd(
-            "\n"
-            "------ Section end: " + sectionName + " ------\n"
-            "Elapsed msec: " + std::to_string(elapsedMsec) + "\n"
-            "\n", fd);
-}
-
-// Dump data requested by an argument to the "dump" interface, or help info
-// if the specified section is not supported.
-void Dumpstate::dumpTextSection(int fd, const std::string &sectionName) {
-    bool dumpAll = (sectionName == kAllSections);
-    std::string dumpFiles;
-
-    // Execute all or designated programs under vendor/bin/dump/
-    std::unique_ptr<DIR, decltype(&closedir)> dir(opendir("/vendor/bin/dump"), closedir);
-    if (!dir) {
-        ALOGE("Fail To Open Dir vendor/bin/dump/");
-        ::android::base::WriteStringToFd("Fail To Open Dir vendor/bin/dump/\n", fd);
-        return;
-    }
-    dirent *entry;
-    while ((entry = readdir(dir.get())) != nullptr) {
-        // Skip '.', '..'
-        if (entry->d_name[0] == '.') {
-            continue;
-        }
-        std::string bin(entry->d_name);
-        dumpFiles = dumpFiles + " " + bin;
-        if (dumpAll || sectionName == bin) {
-            auto startTime = startSection(fd, bin);
-            RunCommandToFd(fd, "/vendor/bin/dump/"+bin, {"/vendor/bin/dump/"+bin}, CommandOptions::WithTimeout(15).Build());
-            endSection(fd, bin, startTime);
-            if (!dumpAll) {
-                return;
-            }
-        }
-    }
-
-    if (dumpAll) {
-        RunCommandToFd(fd, "VENDOR PROPERTIES", {"/vendor/bin/getprop"});
-        return;
-    }
-
-    // An unsupported section was requested on the command line
-    ::android::base::WriteStringToFd("Unrecognized text section: " + sectionName + "\n", fd);
-    ::android::base::WriteStringToFd("Try \"" + kAllSections + "\" or one of the following:", fd);
-    ::android::base::WriteStringToFd(dumpFiles, fd);
-    ::android::base::WriteStringToFd("\nNote: sections with attachments (e.g. dump_soc) are"
-                                   "not available from the command line.\n", fd);
-}
-
-void Dumpstate::dumpLogSection(int fd, int fd_bin)
-{
-    std::string logDir = MODEM_LOG_DIRECTORY;
-    const std::string logCombined = logDir + "/combined_logs.tar";
-    const std::string logAllDir = logDir + "/all_logs";
-
-    RunCommandToFd(fd, "MKDIR LOG", {"/vendor/bin/mkdir", "-p", logAllDir.c_str()}, CommandOptions::WithTimeout(2).Build());
-
-    dumpTextSection(fd, kAllSections);
-
-    RunCommandToFd(fd, "TAR LOG", {"/vendor/bin/tar", "cvf", logCombined.c_str(), "-C", logAllDir.c_str(), "."}, CommandOptions::WithTimeout(20).Build());
-    RunCommandToFd(fd, "CHG PERM", {"/vendor/bin/chmod", "a+w", logCombined.c_str()}, CommandOptions::WithTimeout(2).Build());
-
-    std::vector<uint8_t> buffer(65536);
-    ::android::base::unique_fd fdLog(TEMP_FAILURE_RETRY(open(logCombined.c_str(), O_RDONLY | O_CLOEXEC | O_NONBLOCK)));
-
-    if (fdLog >= 0) {
-        while (1) {
-            ssize_t bytes_read = TEMP_FAILURE_RETRY(read(fdLog, buffer.data(), buffer.size()));
-
-            if (bytes_read == 0) {
-                break;
-            } else if (bytes_read < 0) {
-                ALOGD("read(%s): %s\n", logCombined.c_str(), strerror(errno));
-                break;
-            }
-
-            ssize_t result = TEMP_FAILURE_RETRY(write(fd_bin, buffer.data(), bytes_read));
-
-            if (result != bytes_read) {
-                ALOGD("Failed to write %ld bytes, actually written: %ld", bytes_read, result);
-                break;
-            }
-        }
-    }
-
-    RunCommandToFd(fd, "RM LOG DIR", { "/vendor/bin/rm", "-r", logAllDir.c_str()}, CommandOptions::WithTimeout(2).Build());
-    RunCommandToFd(fd, "RM LOG", { "/vendor/bin/rm", logCombined.c_str()}, CommandOptions::WithTimeout(2).Build());
-}
-
-ndk::ScopedAStatus Dumpstate::dumpstateBoard(const std::vector<::ndk::ScopedFileDescriptor>& in_fds,
-                                             IDumpstateDevice::DumpstateMode in_mode,
-                                             int64_t in_timeoutMillis) {
-    // Unused arguments.
-    (void) in_timeoutMillis;
-    (void) in_mode;
-
-    if (in_fds.size() < 1) {
-        ALOGE("no FDs\n");
-        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
-                                                                "No file descriptor");
-    }
-
-    int fd = in_fds[0].get();
-    if (fd < 0) {
-        ALOGE("invalid FD: %d\n", fd);
-        return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
-                                                                "Invalid file descriptor");
-    }
-
-    if (in_fds.size() < 2) {
-          ALOGE("no FD for dumpstate_board binary\n");
-    } else {
-          int fd_bin = in_fds[1].get();
-          dumpLogSection(fd, fd_bin);
-    }
-
-    return ndk::ScopedAStatus::ok();
-}
-
-ndk::ScopedAStatus Dumpstate::setVerboseLoggingEnabled(bool in_enable) {
-    ::android::base::SetProperty(kVerboseLoggingProperty, in_enable ? "true" : "false");
-    return ndk::ScopedAStatus::ok();
-}
-
-ndk::ScopedAStatus Dumpstate::getVerboseLoggingEnabled(bool* _aidl_return) {
-    *_aidl_return = ::android::base::GetBoolProperty(kVerboseLoggingProperty, false);
-    return ndk::ScopedAStatus::ok();
-}
-
-// Since AIDLs that support the dump() interface are automatically invoked during
-// bugreport generation and we don't want to generate a second copy of the same
-// data that will go into dumpstate_board.txt, this function will only do
-// something if it is called with an option, e.g.
-//   dumpsys android.hardware.dumpstate.IDumpstateDevice/default all
-//
-// Also, note that sections which generate attachments and/or binary data when
-// included in a bugreport are not available through the dump() interface.
-binder_status_t Dumpstate::dump(int fd, const char** args, uint32_t numArgs) {
-
-    if (numArgs != 1) {
-        return STATUS_OK;
-    }
-
-    dumpTextSection(fd, static_cast<std::string>(args[0]));
-
-    fsync(fd);
-    return STATUS_OK;
-}
-
-}  // namespace dumpstate
-}  // namespace hardware
-}  // namespace android
-}  // namespace aidl
diff --git a/gear/dumpstate/Dumpstate.h b/gear/dumpstate/Dumpstate.h
deleted file mode 100644
index 787b774..0000000
--- a/gear/dumpstate/Dumpstate.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2022 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 <aidl/android/hardware/dumpstate/BnDumpstateDevice.h>
-#include <aidl/android/hardware/dumpstate/IDumpstateDevice.h>
-#include <android/binder_status.h>
-
-namespace aidl {
-namespace android {
-namespace hardware {
-namespace dumpstate {
-
-class Dumpstate : public BnDumpstateDevice {
-  public:
-    ::ndk::ScopedAStatus dumpstateBoard(const std::vector<::ndk::ScopedFileDescriptor>& in_fds,
-                                        IDumpstateDevice::DumpstateMode in_mode,
-                                        int64_t in_timeoutMillis) override;
-
-    ::ndk::ScopedAStatus getVerboseLoggingEnabled(bool* _aidl_return) override;
-
-    ::ndk::ScopedAStatus setVerboseLoggingEnabled(bool in_enable) override;
-
-    binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
-
-  private:
-    const std::string kAllSections = "all";
-
-    void dumpTextSection(int fd, std::string const& sectionName);
-    void dumpLogSection(int fd, int fdModem);
-
-    //bool getVerboseLoggingEnabledImpl();
-    //::ndk::ScopedAStatus dumpstateBoardImpl(const int fd, const bool full);
-};
-
-}  // namespace dumpstate
-}  // namespace hardware
-}  // namespace android
-}  // namespace aidl
diff --git a/gear/dumpstate/aidl.mk b/gear/dumpstate/aidl.mk
deleted file mode 100644
index 0df64e9..0000000
--- a/gear/dumpstate/aidl.mk
+++ /dev/null
@@ -1,3 +0,0 @@
-PRODUCT_PACKAGES += android.hardware.dumpstate-service
-BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/gear/dumpstate/sepolicy
-
diff --git a/gear/dumpstate/android.hardware.dumpstate-service.rc b/gear/dumpstate/android.hardware.dumpstate-service.rc
deleted file mode 100644
index ee69a68..0000000
--- a/gear/dumpstate/android.hardware.dumpstate-service.rc
+++ /dev/null
@@ -1,5 +0,0 @@
-service vendor.dumpstate-default /vendor/bin/hw/android.hardware.dumpstate-service
-    class hal
-    user system
-    group system shell
-    interface aidl android.hardware.dumpstate.IDumpstateDevice/default
diff --git a/gear/dumpstate/android.hardware.dumpstate-service.xml b/gear/dumpstate/android.hardware.dumpstate-service.xml
deleted file mode 100644
index 5e51b28..0000000
--- a/gear/dumpstate/android.hardware.dumpstate-service.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<manifest version="1.0" type="device">
-    <hal format="aidl">
-        <name>android.hardware.dumpstate</name>
-        <interface>
-            <name>IDumpstateDevice</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-</manifest>
diff --git a/gear/dumpstate/sepolicy/file.te b/gear/dumpstate/sepolicy/file.te
deleted file mode 100644
index 6c686a0..0000000
--- a/gear/dumpstate/sepolicy/file.te
+++ /dev/null
@@ -1,5 +0,0 @@
-type radio_vendor_data_file, file_type, data_file_type;
-userdebug_or_eng(`
-  typeattribute radio_vendor_data_file mlstrustedobject;
-')
-
diff --git a/gear/dumpstate/sepolicy/file_contexts b/gear/dumpstate/sepolicy/file_contexts
deleted file mode 100644
index 5c65e43..0000000
--- a/gear/dumpstate/sepolicy/file_contexts
+++ /dev/null
@@ -1,4 +0,0 @@
-/vendor/bin/hw/android\.hardware\.dumpstate-service        u:object_r:hal_dumpstate_default_exec:s0
-
-/data/vendor/radio(/.*)?                                   u:object_r:radio_vendor_data_file:s0
-
diff --git a/gear/dumpstate/sepolicy/hal_dumpstate_default.te b/gear/dumpstate/sepolicy/hal_dumpstate_default.te
deleted file mode 100644
index 3e4db45..0000000
--- a/gear/dumpstate/sepolicy/hal_dumpstate_default.te
+++ /dev/null
@@ -1,5 +0,0 @@
-allow hal_dumpstate_default vendor_toolbox_exec:file execute_no_trans;
-allow hal_dumpstate_default radio_vendor_data_file:dir create_dir_perms;
-allow hal_dumpstate_default radio_vendor_data_file:file create_file_perms;
-allow hal_dumpstate_default shell_data_file:file getattr;
-
diff --git a/gear/dumpstate/service.cpp b/gear/dumpstate/service.cpp
deleted file mode 100644
index 848bddd..0000000
--- a/gear/dumpstate/service.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2022 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.
- */
-#define LOG_TAG "android.hardware.dumpstate-service"
-
-#include "Dumpstate.h"
-
-#include <android-base/logging.h>
-#include <android/binder_manager.h>
-#include <android/binder_process.h>
-
-using aidl::android::hardware::dumpstate::Dumpstate;
-
-int main() {
-    ABinderProcess_setThreadPoolMaxThreadCount(0);
-    std::shared_ptr<Dumpstate> dumpstate = ndk::SharedRefBase::make<Dumpstate>();
-
-    const std::string instance = std::string() + Dumpstate::descriptor + "/default";
-    binder_status_t status =
-            AServiceManager_addService(dumpstate->asBinder().get(), instance.c_str());
-    CHECK_EQ(status, STATUS_OK);
-
-    ABinderProcess_joinThreadPool();
-    return EXIT_FAILURE;  // Unreachable
-}
