@@ -27,6 +27,7 @@ import io.nekohasekai.sfa.constant.Status
2727import io.nekohasekai.sfa.database.ProfileManager
2828import io.nekohasekai.sfa.database.Settings
2929import io.nekohasekai.sfa.ktx.hasPermission
30+ import kotlinx.coroutines.DelicateCoroutinesApi
3031import kotlinx.coroutines.Dispatchers
3132import kotlinx.coroutines.GlobalScope
3233import kotlinx.coroutines.delay
@@ -243,6 +244,7 @@ class BoxService(
243244 }
244245 }
245246
247+ @OptIn(DelicateCoroutinesApi ::class )
246248 private fun stopService () {
247249 if (status.value != Status .Started ) return
248250 status.value = Status .Stopping
@@ -298,7 +300,9 @@ class BoxService(
298300 }
299301 }
300302
301- fun onStartCommand (intent : Intent ? , flags : Int , startId : Int ): Int {
303+ @OptIn(DelicateCoroutinesApi ::class )
304+ @Suppress(" SameReturnValue" )
305+ internal fun onStartCommand (): Int {
302306 if (status.value != Status .Stopped ) return Service .START_NOT_STICKY
303307 status.value = Status .Starting
304308
@@ -327,19 +331,19 @@ class BoxService(
327331 return Service .START_NOT_STICKY
328332 }
329333
330- fun onBind (intent : Intent ): IBinder {
334+ internal fun onBind (): IBinder {
331335 return binder
332336 }
333337
334- fun onDestroy () {
338+ internal fun onDestroy () {
335339 binder.close()
336340 }
337341
338- fun onRevoke () {
342+ internal fun onRevoke () {
339343 stopService()
340344 }
341345
342- fun writeLog (message : String ) {
346+ internal fun writeLog (message : String ) {
343347 binder.broadcast {
344348 it.onServiceWriteLog(message)
345349 }
0 commit comments