summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Sharkey2013-04-04 12:44:41 -0500
committerJeff Sharkey2013-04-04 12:46:33 -0500
commitb4d52a437e97489710182ebc6a8a3e00d6fbd6f0 (patch)
tree77b5d711005a89d82c40f9eaab7d9a65c9e9aa3e
parentc1e47294c9ca69f32bae24036eb0f19db3af7b2e (diff)
downloadplatform-system-core-b4d52a437e97489710182ebc6a8a3e00d6fbd6f0.tar.gz
platform-system-core-b4d52a437e97489710182ebc6a8a3e00d6fbd6f0.tar.xz
platform-system-core-b4d52a437e97489710182ebc6a8a3e00d6fbd6f0.zip
Only handle keycodes when adb is enabled.
This prevents accidental bugreports on userdebug/eng devices. Bug: 8541006 Change-Id: Iefd15826090fd91434403f197cfd166e64400224
-rw-r--r--init/keychords.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/init/keychords.c b/init/keychords.c
index aab08195e..061d15701 100644
--- a/init/keychords.c
+++ b/init/keychords.c
@@ -100,10 +100,7 @@ void handle_keychord()
100 int ret; 100 int ret;
101 __u16 id; 101 __u16 id;
102 102
103 // only handle keychords if ro.debuggable is set or adb is enabled. 103 // Only handle keychords if adb is enabled.
104 // the logic here is that bugreports should be enabled in userdebug or eng builds
105 // and on user builds for users that are developers.
106 debuggable = property_get("ro.debuggable");
107 adb_enabled = property_get("init.svc.adbd"); 104 adb_enabled = property_get("init.svc.adbd");
108 ret = read(keychord_fd, &id, sizeof(id)); 105 ret = read(keychord_fd, &id, sizeof(id));
109 if (ret != sizeof(id)) { 106 if (ret != sizeof(id)) {
@@ -111,8 +108,7 @@ void handle_keychord()
111 return; 108 return;
112 } 109 }
113 110
114 if ((debuggable && !strcmp(debuggable, "1")) || 111 if ((adb_enabled && !strcmp(adb_enabled, "running"))) {
115 (adb_enabled && !strcmp(adb_enabled, "running"))) {
116 svc = service_find_by_keychord(id); 112 svc = service_find_by_keychord(id);
117 if (svc) { 113 if (svc) {
118 INFO("starting service %s from keychord\n", svc->name); 114 INFO("starting service %s from keychord\n", svc->name);