Android 2.2 屏幕锁定安全
有没有办法查明用户是否设置了 PIN 锁或密码锁屏安全?
我知道您可以检查 Settings.Secure.PATTERN_LOCK_ENABLED
来读取模式是否已设置。即使是显示是否设置了任何安全性的读取值也会有所帮助。
Is there a way to find out if a user has the PIN lock or password lock screen security set?
I know that you can check Settings.Secure.PATTERN_LOCK_ENABLED
to read if the pattern is set. Even a value to read that shows if ANY security is set would be helpful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 OS 2.2 上,您可以使用 DevicePolicyManager getPasswordQuality(null)。它将返回一个 PASSWORD_QUALITY_* 常量,指示有效的最低安全级别,例如
不幸的是,我认为这不会告诉您用户当前拥有的密码保护质量,即它只会告诉您是否碰巧存在安全 < em>策略到位(除非所有用户都通过实施安全策略的 Exchange 服务器发送电子邮件,否则这种情况不会那么常见)。
您可以随时调用 不过,在您的应用中设置PasswordQuality以强制执行最低设备密码。
如果您找到适用于 OS 2.1 的这个问题的答案,我将有兴趣听到它!
On OS 2.2 you can find out if there is a minimum security policy in place using DevicePolicyManager getPasswordQuality(null). It will return a PASSWORD_QUALITY_* constant indicating the minimum level of security in force, e.g.
Unfortunately I don't think that will tell you what quality of password protection the user currently has, i.e it only tells you if there happens to be a security policy in place (which won't be that common unless all your users have e-mail through an Exchange server which implements a security policy).
You can always call setPasswordQuality in your app to enforce a minimum device password though.
If you find an answer for this question that works on OS 2.1 I would be interested to hear it!
这就是我所做的:
然后使用:
Here's what I did:
then use: