Skip to content

Commit

Permalink
actions: better bluetooth (fixes #1878) (#1922)
Browse files Browse the repository at this point in the history
  • Loading branch information
Okuro3499 authored Feb 15, 2024
1 parent c214241 commit 6e0c17c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.*
import androidx.annotation.RequiresApi
import androidx.preference.PreferenceManager
import io.treehouses.remote.Constants
import io.treehouses.remote.bases.BaseBluetoothChatService
Expand Down Expand Up @@ -101,11 +102,12 @@ class BluetoothChatService @JvmOverloads constructor(handler: Handler? = null, a
return START_NOT_STICKY
}

@RequiresApi(Build.VERSION_CODES.TIRAMISU)
override fun onCreate() {
super.onCreate()
val i = IntentFilter()
i.addAction(DISCONNECT_ACTION)
registerReceiver(receiver, i)
registerReceiver(receiver, i, RECEIVER_NOT_EXPORTED)
}

override fun onDestroy() {
Expand Down

0 comments on commit 6e0c17c

Please sign in to comment.