I have developed a small application which can recognize when device get lock and unlock using
BroadcastReceiver
, plus filter.addAction(Intent.ACTION_SCREEN_OFF)
and filter.addAction(Intent.ACTION_USER_PRESENT)
.
This work well and log properly when scree开发者_如何学Gon Lock & Unlock, but it is not giving me the attempt result of unlock, means I want to track each attempt and log that, if unlocking pattern is correct or not and log "Unlock Success" OR "Unlock Fail" at each attempt made to unlock device. Any help?
Use Device Administration APIs of android do achieve this.
You need BIND_DEVICE_ADMIN permission to track that.
精彩评论