File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
aidl/io/github/sds100/keymapper/api
java/io/github/sds100/keymapper/inputmethod/latin Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,12 @@ interface IKeyEventRelayService {
1818 void registerCallback (IKeyEventRelayServiceCallback client );
1919
2020 /**
21- * Unregister a callback to receive key events from this relay service. The service
22- * checks the process uid of the caller to this method and only permits certain applications
23- * from connecting.
21+ * Unregister all the callbacks associated with the calling package from this relay service.
22+ */
23+ void unregisterAllCallbacks ();
24+
25+ /**
26+ * Unregister a callback to receive key events from this relay service.
2427 */
25- void unregisterCallback ();
28+ void unregisterCallback (IKeyEventRelayServiceCallback client );
2629}
Original file line number Diff line number Diff line change @@ -128,6 +128,9 @@ class KeyEventRelayServiceWrapperImpl(
128128 }
129129 } catch (e: SecurityException ) {
130130 Log .e(LatinIME .TAG , e.toString())
131+
132+ // Docs say to unbind if there is a security exception.
133+ ctx.unbindService(serviceConnection)
131134 }
132135 }
133136
@@ -138,7 +141,7 @@ class KeyEventRelayServiceWrapperImpl(
138141 // because the connection is already broken at that point and it
139142 // will fail.
140143 try {
141- keyEventRelayService?.unregisterCallback()
144+ keyEventRelayService?.unregisterCallback(callback )
142145 ctx.unbindService(serviceConnection)
143146 } catch (e: RemoteException ) {
144147 // do nothing
You can’t perform that action at this time.
0 commit comments