Commit 72da0540 authored by Mygod's avatar Mygod

Fix deprecation

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