Support showing connected device in repeater tile
This commit is contained in:
@@ -2,7 +2,9 @@ package be.mygod.vpnhotspot.util
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.content.ServiceConnection
|
||||
import android.os.Build
|
||||
import android.os.IBinder
|
||||
import android.service.quicksettings.Tile
|
||||
import android.service.quicksettings.TileService
|
||||
import androidx.annotation.RequiresApi
|
||||
|
||||
@@ -10,6 +12,13 @@ import androidx.annotation.RequiresApi
|
||||
abstract class KillableTileService : TileService(), ServiceConnection {
|
||||
protected var tapPending = false
|
||||
|
||||
/**
|
||||
* Compat helper for setSubtitle.
|
||||
*/
|
||||
protected fun Tile.subtitle(value: CharSequence?) {
|
||||
if (Build.VERSION.SDK_INT >= 29) subtitle = value
|
||||
}
|
||||
|
||||
override fun onServiceConnected(name: ComponentName?, service: IBinder?) {
|
||||
if (tapPending) {
|
||||
tapPending = false
|
||||
|
||||
Reference in New Issue
Block a user