Commit 72da0540 authored by Mygod's avatar Mygod

Fix deprecation

parent 952491c5
......@@ -48,7 +48,7 @@ class VpnRequestActivity : AppCompatActivity(), ShadowsocksConnection.Interface
finish()
return
}
if (systemService<KeyguardManager>().inKeyguardRestrictedInputMode()) {
if (systemService<KeyguardManager>().isKeyguardLocked) {
receiver = broadcastReceiver { _, _ -> connection.connect() }
registerReceiver(receiver, IntentFilter(Intent.ACTION_USER_PRESENT))
} else connection.connect()
......
......@@ -100,7 +100,7 @@ class ServiceNotification(private val service: BaseService.Interface, profileNam
unregisterCallback() // unregister callback to save battery
}
Intent.ACTION_SCREEN_ON -> {
setVisible(visible && !keyGuard.inKeyguardRestrictedInputMode(), forceShow)
setVisible(visible && !keyGuard.isKeyguardLocked, forceShow)
service.data.binder.registerCallback(callback)
service.data.binder.startListeningForBandwidth(callback)
callbackRegistered = true
......
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