This commit is contained in:
lucky 2022-01-12 14:36:59 +03:00
parent 74533a60c3
commit 07b3d10949
1 changed files with 1 additions and 1 deletions

View File

@ -34,6 +34,7 @@ class UnlockService : Service() {
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
receiver = UnlockReceiver() receiver = UnlockReceiver()
registerReceiver(receiver, IntentFilter(Intent.ACTION_USER_PRESENT))
} }
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
@ -46,7 +47,6 @@ class UnlockService : Service() {
.setPriority(NotificationCompat.PRIORITY_LOW) .setPriority(NotificationCompat.PRIORITY_LOW)
.build() .build()
) )
registerReceiver(receiver, IntentFilter(Intent.ACTION_USER_PRESENT))
return START_STICKY return START_STICKY
} }