Loading init/init.c +22 −15 Original line number Diff line number Diff line Loading @@ -767,9 +767,18 @@ int open_keychord() void handle_keychord(int fd) { struct service *svc; char* debuggable; char* adb_enabled; 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"); if ((debuggable && !strcmp(debuggable, "1")) || (adb_enabled && !strcmp(adb_enabled, "running"))) { ret = read(fd, &id, sizeof(id)); if (ret != sizeof(id)) { ERROR("could not read keychord id\n"); Loading @@ -784,6 +793,7 @@ void handle_keychord(int fd) ERROR("service for keychord %d not found\n", id); } } } int main(int argc, char **argv) { Loading Loading @@ -853,10 +863,7 @@ int main(int argc, char **argv) property_init(); // only listen for keychords if ro.debuggable is true debuggable = property_get("ro.debuggable"); if (debuggable && !strcmp(debuggable, "1")) { keychord_fd = open_keychord(); } if (console[0]) { snprintf(tmp, sizeof(tmp), "/dev/%s", console); Loading Loading
init/init.c +22 −15 Original line number Diff line number Diff line Loading @@ -767,9 +767,18 @@ int open_keychord() void handle_keychord(int fd) { struct service *svc; char* debuggable; char* adb_enabled; 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"); if ((debuggable && !strcmp(debuggable, "1")) || (adb_enabled && !strcmp(adb_enabled, "running"))) { ret = read(fd, &id, sizeof(id)); if (ret != sizeof(id)) { ERROR("could not read keychord id\n"); Loading @@ -784,6 +793,7 @@ void handle_keychord(int fd) ERROR("service for keychord %d not found\n", id); } } } int main(int argc, char **argv) { Loading Loading @@ -853,10 +863,7 @@ int main(int argc, char **argv) property_init(); // only listen for keychords if ro.debuggable is true debuggable = property_get("ro.debuggable"); if (debuggable && !strcmp(debuggable, "1")) { keychord_fd = open_keychord(); } if (console[0]) { snprintf(tmp, sizeof(tmp), "/dev/%s", console); Loading