Skip to content

Commit

Permalink
adb: replace reboot service with exec of /system/bin/reboot.
Browse files Browse the repository at this point in the history
Test: adb reboot
Test: adb reboot fastboot
Change-Id: Ia4146dde7ef3ae00a782dbe68aff166d63eabdb9

Former-commit-id: 2c356bb91ebf146489913cef713392987c3e811b
  • Loading branch information
jmgao committed Oct 23, 2019
1 parent c3084c3 commit f55da7e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 116 deletions.
5 changes: 2 additions & 3 deletions adb/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,9 @@ cc_library {
"daemon/abb_service.cpp",
"daemon/framebuffer_service.cpp",
"daemon/mdns.cpp",
"daemon/reboot_service.cpp",
"daemon/restart_service.cpp",
],
shared_libs: [
"libbootloader_message",
"libmdnssd",
"libselinux",
],
Expand Down Expand Up @@ -511,13 +509,15 @@ phony {
name: "adbd_system_binaries",
required: [
"abb",
"reboot",
"set-verity-state",
]
}

phony {
name: "adbd_system_binaries_recovery",
required: [
"reboot.recovery",
],
}

Expand Down Expand Up @@ -616,7 +616,6 @@ cc_test {
static_libs: [
"libadbd",
"libbase",
"libbootloader_message",
"libcutils",
"libcrypto_utils",
"libcrypto_static",
Expand Down
84 changes: 0 additions & 84 deletions adb/daemon/reboot_service.cpp

This file was deleted.

25 changes: 0 additions & 25 deletions adb/daemon/reboot_service.h

This file was deleted.

7 changes: 3 additions & 4 deletions adb/daemon/services.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@

#include "daemon/file_sync_service.h"
#include "daemon/framebuffer_service.h"
#include "daemon/reboot_service.h"
#include "daemon/restart_service.h"
#include "daemon/shell_service.h"

Expand Down Expand Up @@ -253,9 +252,9 @@ unique_fd daemon_service_to_fd(std::string_view name, atransport* transport) {
cmd += name;
return StartSubprocess(cmd, nullptr, SubprocessType::kRaw, SubprocessProtocol::kNone);
} else if (android::base::ConsumePrefix(&name, "reboot:")) {
std::string arg(name);
return create_service_thread("reboot",
std::bind(reboot_service, std::placeholders::_1, arg));
std::string cmd = "/system/bin/reboot ";
cmd += name;
return StartSubprocess(cmd, nullptr, SubprocessType::kRaw, SubprocessProtocol::kNone);
} else if (name.starts_with("root:")) {
return create_service_thread("root", restart_root_service);
} else if (name.starts_with("unroot:")) {
Expand Down
1 change: 1 addition & 0 deletions reboot/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ cc_binary {
srcs: ["reboot.c"],
shared_libs: ["libcutils"],
cflags: ["-Werror"],
recovery_available: true,
}

0 comments on commit f55da7e

Please sign in to comment.