init: Let property_get return std::string.
Bug: 22654233
Change-Id: Id6091f58432f75e966b9871256049fbe17766c10
diff --git a/init/keychords.cpp b/init/keychords.cpp
index 10d9573..c4ebdf9 100644
--- a/init/keychords.cpp
+++ b/init/keychords.cpp
@@ -64,19 +64,18 @@
static void handle_keychord() {
struct service *svc;
- char adb_enabled[PROP_VALUE_MAX];
int ret;
__u16 id;
- // Only handle keychords if adb is enabled.
- property_get("init.svc.adbd", adb_enabled);
ret = read(keychord_fd, &id, sizeof(id));
if (ret != sizeof(id)) {
ERROR("could not read keychord id\n");
return;
}
- if (!strcmp(adb_enabled, "running")) {
+ // Only handle keychords if adb is enabled.
+ std::string adb_enabled = property_get("init.svc.adbd");
+ if (adb_enabled == "running") {
svc = service_find_by_keychord(id);
if (svc) {
INFO("Starting service %s from keychord\n", svc->name);