mirror of
https://github.com/PenumbraOS/sdk.git
synced 2026-02-03 17:26:48 -06:00
Properly drop Binder connections on death on some providers
This commit is contained in:
parent
8dc079a926
commit
f64f5b13c5
@ -1,5 +1,6 @@
|
||||
package com.penumbraos.bridge_system.provider
|
||||
|
||||
import android.os.IBinder
|
||||
import android.os.Looper
|
||||
import android.util.Log
|
||||
import android.view.InputChannel
|
||||
@ -81,6 +82,12 @@ class HandGestureProvider(private val looper: Looper) : IHandGestureProvider.Stu
|
||||
}
|
||||
|
||||
override fun registerCallback(callback: IHandGestureCallback) {
|
||||
callback.asBinder().linkToDeath(object : IBinder.DeathRecipient {
|
||||
override fun binderDied() {
|
||||
deregisterCallback(callback)
|
||||
}
|
||||
}, 0)
|
||||
|
||||
callbacks.add(callback)
|
||||
registerListenerIfNecessary()
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.penumbraos.bridge_system.provider
|
||||
|
||||
import android.os.IBinder
|
||||
import android.os.Looper
|
||||
import android.util.Log
|
||||
import android.view.InputChannel
|
||||
@ -37,6 +38,12 @@ class TouchpadProvider(private val looper: Looper) :
|
||||
}
|
||||
|
||||
override fun registerCallback(callback: ITouchpadCallback) {
|
||||
callback.asBinder().linkToDeath(object : IBinder.DeathRecipient {
|
||||
override fun binderDied() {
|
||||
deregisterCallback(callback)
|
||||
}
|
||||
}, 0)
|
||||
|
||||
callbacks.add(callback)
|
||||
registerListenerIfNecessary()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user