@ -220,11 +220,8 @@ class App : Application(), libtailscale.AppContext {
}
}
fun setTileReady ( ready : Boolean ) {
fun setTileReady ( ready : Boolean ) {
if ( Build . VERSION . SDK _INT < Build . VERSION_CODES . N ) {
return
}
QuickToggleService . setReady ( this , ready )
QuickToggleService . setReady ( this , ready )
Log . d ( " App " , " Set Tile Ready: $ready $autoConnect " )
Log . d ( " App " , " Set Tile Ready: ready= $ready , autoConnect= $autoConnect " )
vpnReady = ready
vpnReady = ready
if ( ready && autoConnect ) {
if ( ready && autoConnect ) {
startVPN ( )
startVPN ( )
@ -232,9 +229,6 @@ class App : Application(), libtailscale.AppContext {
}
}
fun setTileStatus ( status : Boolean ) {
fun setTileStatus ( status : Boolean ) {
if ( Build . VERSION . SDK _INT < Build . VERSION_CODES . N ) {
return
}
QuickToggleService . setStatus ( this , status )
QuickToggleService . setStatus ( this , status )
}
}
@ -363,9 +357,6 @@ class App : Application(), libtailscale.AppContext {
}
}
fun createNotificationChannel ( id : String ? , name : String ? , importance : Int ) {
fun createNotificationChannel ( id : String ? , name : String ? , importance : Int ) {
if ( Build . VERSION . SDK _INT < Build . VERSION_CODES . O ) {
return
}
val channel = NotificationChannel ( id , name , importance )
val channel = NotificationChannel ( id , name , importance )
val nm : NotificationManagerCompat = NotificationManagerCompat . from ( this )
val nm : NotificationManagerCompat = NotificationManagerCompat . from ( this )
nm . createNotificationChannel ( channel )
nm . createNotificationChannel ( channel )