Commit 39a0a61d authored by Mygod's avatar Mygod

Allow using TileService in direct boot mode

parent cf118a1b
...@@ -30,6 +30,7 @@ import com.github.shadowsocks.R ...@@ -30,6 +30,7 @@ import com.github.shadowsocks.R
import com.github.shadowsocks.ShadowsocksConnection import com.github.shadowsocks.ShadowsocksConnection
import com.github.shadowsocks.aidl.IShadowsocksService import com.github.shadowsocks.aidl.IShadowsocksService
import com.github.shadowsocks.aidl.IShadowsocksServiceCallback import com.github.shadowsocks.aidl.IShadowsocksServiceCallback
import com.github.shadowsocks.preference.DataStore
import android.service.quicksettings.TileService as BaseTileService import android.service.quicksettings.TileService as BaseTileService
@RequiresApi(24) @RequiresApi(24)
...@@ -81,7 +82,7 @@ class TileService : BaseTileService(), ShadowsocksConnection.Interface { ...@@ -81,7 +82,7 @@ class TileService : BaseTileService(), ShadowsocksConnection.Interface {
} }
override fun onClick() { override fun onClick() {
if (isLocked) unlockAndRun(this::toggle) else toggle() if (isLocked && !DataStore.directBootAware) unlockAndRun(this::toggle) else toggle()
} }
private fun toggle() { private fun toggle() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment