Android lockNow() fails on HTC Desire

给你一囗甜甜゛ 提交于 2019-12-24 10:35:32

问题


I have created an app that can lock the phone with a pin code using DevicePolicyManager, resetPassword and lockNow(). It works perfectly on my Galaxy S and on all other phones but not on HTC Desire.

On a Desire the pin code screen appears but you can simply press the ok button without entering the pin code and the phone will still unlock.

A user says that the lock works if he does not use the phone for about 5 minutes. Does anyone have a hint of what could be wrong, or any suggestion of what to do?


回答1:


It sound like the password value is being cached, allowing him to bypass the entry code. After a few minutes, the app is removed from memory (clearing the cached credentials) and forces the user to re-enter the phone. A possible solution is to clear every field that handles the password after the user has entered the correct password.

This may not be the actual problem/solution but hopefully it helps.




回答2:


I consider this a bug on the Desire but I found a way around it by setting the lock timeout to 1 second, locking the device and then set the lock timeout back up again.



来源:https://stackoverflow.com/questions/6074091/android-locknow-fails-on-htc-desire

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!