Skip to content

Commit

Permalink
wip: move away from deprecated context receivers
Browse files Browse the repository at this point in the history
Signed-off-by: Patryk Miś <[email protected]>
  • Loading branch information
PatrykMis committed Aug 30, 2024
1 parent 2a8dfbf commit 4776941
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SpeakTouchService : AccessibilityService() {
override fun onCreate() {
super.onCreate()

Controllers.install()
Controllers.install(this)
}

override fun onServiceConnected() {
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/java/com/neo/speaktouch/utils/Installable.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ abstract class Installable<T : Any> {
protected var instance = WeakReference<T>(null)
private set

context (T)
fun install() {
instance = WeakReference(this@T)
fun install(context: T) {
instance = WeakReference(context)
}

fun uninstall() {
Expand Down

0 comments on commit 4776941

Please sign in to comment.