From 39a0a61da20d219cae80a841f357758a6a158345 Mon Sep 17 00:00:00 2001 From: Mygod Date: Thu, 22 Feb 2018 11:56:15 -0800 Subject: [PATCH] Allow using TileService in direct boot mode --- mobile/src/main/java/com/github/shadowsocks/bg/TileService.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mobile/src/main/java/com/github/shadowsocks/bg/TileService.kt b/mobile/src/main/java/com/github/shadowsocks/bg/TileService.kt index d19e6fe4..55cdb4dd 100644 --- a/mobile/src/main/java/com/github/shadowsocks/bg/TileService.kt +++ b/mobile/src/main/java/com/github/shadowsocks/bg/TileService.kt @@ -30,6 +30,7 @@ import com.github.shadowsocks.R import com.github.shadowsocks.ShadowsocksConnection import com.github.shadowsocks.aidl.IShadowsocksService import com.github.shadowsocks.aidl.IShadowsocksServiceCallback +import com.github.shadowsocks.preference.DataStore import android.service.quicksettings.TileService as BaseTileService @RequiresApi(24) @@ -81,7 +82,7 @@ class TileService : BaseTileService(), ShadowsocksConnection.Interface { } override fun onClick() { - if (isLocked) unlockAndRun(this::toggle) else toggle() + if (isLocked && !DataStore.directBootAware) unlockAndRun(this::toggle) else toggle() } private fun toggle() {