summaryrefslogtreecommitdiffstats
path: root/init/keychords.c
diff options
context:
space:
mode:
Diffstat (limited to 'init/keychords.c')
-rw-r--r--init/keychords.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/init/keychords.c b/init/keychords.c
index aab0819..d18a6e4 100644
--- a/init/keychords.c
+++ b/init/keychords.c
@@ -95,24 +95,23 @@ void keychord_init()
void handle_keychord()
{
struct service *svc;
- const char* debuggable;
- const char* adb_enabled;
+ char debuggable[PROP_VALUE_MAX];
+ char adb_enabled[PROP_VALUE_MAX];
int ret;
__u16 id;
// only handle keychords if ro.debuggable is set or adb is enabled.
// the logic here is that bugreports should be enabled in userdebug or eng builds
// and on user builds for users that are developers.
- debuggable = property_get("ro.debuggable");
- adb_enabled = property_get("init.svc.adbd");
+ property_get("ro.debuggable", debuggable);
+ 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 ((debuggable && !strcmp(debuggable, "1")) ||
- (adb_enabled && !strcmp(adb_enabled, "running"))) {
+ if (!strcmp(debuggable, "1") || !strcmp(adb_enabled, "running")) {
svc = service_find_by_keychord(id);
if (svc) {
INFO("starting service %s from keychord\n", svc->name);