dumpstate should not be restricted to phones only

Bug: 240530709
Test: adb bugreport
Change-Id: I77d9bc3e75879293802b8d1956bfffee1513e3d7
This commit is contained in:
Adam Shih 2023-02-16 10:51:58 +08:00
parent 5f802b7e13
commit 3d012b65dd

View file

@ -481,6 +481,7 @@ ndk::ScopedAStatus Dumpstate::dumpstateBoard(const std::vector<::ndk::ScopedFile
int64_t in_timeoutMillis) {
// Unused arguments.
(void) in_timeoutMillis;
(void) in_mode;
if (in_fds.size() < 1) {
ALOGE("no FDs\n");
@ -495,17 +496,6 @@ ndk::ScopedAStatus Dumpstate::dumpstateBoard(const std::vector<::ndk::ScopedFile
"Invalid file descriptor");
}
if (in_mode == IDumpstateDevice::DumpstateMode::WEAR) {
// We aren't a Wear device.
ALOGE("Unsupported mode: %d\n", in_mode);
return ndk::ScopedAStatus::fromServiceSpecificErrorWithMessage(ERROR_UNSUPPORTED_MODE,
"Unsupported mode");
} else if (in_mode < IDumpstateDevice::DumpstateMode::FULL || in_mode > IDumpstateDevice::DumpstateMode::PROTO) {
ALOGE("Invalid mode: %d\n", in_mode);
return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
"Invalid mode");
}
if (in_fds.size() < 2) {
ALOGE("no FD for dumpstate_board binary\n");
} else {