From 7c4367934b1376026d6cdfdb65b56e6b51a4469c Mon Sep 17 00:00:00 2001 From: Seth Schroeder Date: Tue, 25 Jun 2024 17:07:42 +0200 Subject: [PATCH] docs: add comment explaining why the key event relay service is needed --- .../io/github/sds100/keymapper/api/KeyEventReceiver.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/github/sds100/keymapper/api/KeyEventReceiver.kt b/app/src/main/java/io/github/sds100/keymapper/api/KeyEventReceiver.kt index e5d7c38143..29074422f8 100644 --- a/app/src/main/java/io/github/sds100/keymapper/api/KeyEventReceiver.kt +++ b/app/src/main/java/io/github/sds100/keymapper/api/KeyEventReceiver.kt @@ -7,7 +7,15 @@ import android.view.KeyEvent import timber.log.Timber /** - * Created by sds100 on 30/01/2022. + * This service is used as a relay between the accessibility service and input method service to pass + * key events back and forth. A separate service has to be used because you can't bind to an + * accessibility service. The input method service sends key events to this service by calling + * onKeyEvent(), and the accessibility service registers with the callback to receive the + * key events being sent. + * + * This was implemented in issue #850 for the action to answer phone calls because Android doesn't + * pass volume down key events to the accessibility service when the phone is ringing or it is + * in a phone call. */ class KeyEventReceiver : Service() {