Android 2.2 屏幕锁定安全

发布于 2024-09-09 00:03:57 字数 140 浏览 3 评论 0原文

有没有办法查明用户是否设置了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

飘过的浮云 2024-09-16 00:03:57

在 OS 2.2 上,您可以使用 DevicePolicyManager getPasswordQuality(null)。它将返回一个 PASSWORD_QUALITY_* 常量,指示有效的最低安全级别,例如

PASSWORD_QUALITY_UNSPECIFIED
PASSWORD_QUALITY_SOMETHING 
PASSWORD_QUALITY_NUMERIC        
PASSWORD_QUALITY_ALPHABETIC
PASSWORD_QUALITY_ALPHANUMERIC
PASSWORD_QUALITY_COMPLEX

不幸的是,我认为这不会告诉您用户当前拥有的密码保护质量,即它只会告诉您是否碰巧存在安全 < 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.

PASSWORD_QUALITY_UNSPECIFIED
PASSWORD_QUALITY_SOMETHING 
PASSWORD_QUALITY_NUMERIC        
PASSWORD_QUALITY_ALPHABETIC
PASSWORD_QUALITY_ALPHANUMERIC
PASSWORD_QUALITY_COMPLEX

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!

哽咽笑 2024-09-16 00:03:57

这就是我所做的:

mDevicePolicyManager.setPasswordMinimumLength(component, 6);

然后使用:

mDevicePolicyManager.isActivePasswordSufficient())

Here's what I did:

mDevicePolicyManager.setPasswordMinimumLength(component, 6);

then use:

mDevicePolicyManager.isActivePasswordSufficient())
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文