是否有 Android OS 2.1 API 可以查明是否设置了设备屏幕锁定密码?
有没有办法查明用户是否在 Android OS 2.1 上设置了设备锁定密码(即通过设置 -> 位置和安全 -> 更改屏幕锁定设置)?
我的应用程序希望在提供对其某些内容的访问权限之前检查是否存在最低安全级别。
这是我必须要做的:
DevicePolicyManager 提供一个 设置和检查设备的方法 密码策略,但仅限 API 出现在 OS 2.2 中。
我至少知道一些 OS 2.1 设备 允许您设置设备密码 锁定(即您必须输入数字 或字母而不是仅仅使用 刷卡锁)。
我见过各种论坛 帖子说 OS 2.1 强制执行 Exchange 电子邮件政策(这是一些 某种仅限内部的实现 DevicePolicyManager?)
我发现的最接近的是 设置.安全 LOCK_PATTERN_ENABLED。 显然这只会告诉你如果 设置了模式/滑动锁定,未设置 是否设置了密码。
我希望可能有某种 OS 2.1 方法来检查密码是否存在,而不必依赖 OS 2.2 API(即 操作起来相当复杂,同时仍然支持 OS 2.1设备)。
Is there a way to find out if the user has a device lock password setup on Android OS 2.1 (i.e. as set up through Settings -> Location & security -> Change screen lock
)?
My application wants to check this minimum level of security is present before providing access to some of its content.
Here's where I have got to:
DevicePolicyManager provides a
way to set and inspect the device
password policies, but that API only
appears in OS 2.2.I know at least some OS 2.1 devices
allow you to set a device password
lock (i.e. you have to enter numbers
or letters instead of just using a
swipe lock).I've seen various forum
posts saying that OS 2.1 enforces
Exchange e-mail policies (is this some
sort of internal only implementation
of DevicePolicyManager?)The closest I have found is
Settings.Secure
LOCK_PATTERN_ENABLED.
Apparently that will only tell you if
a pattern/swipe lock is set, not
whether a password is set though.
I was hoping that there might be some OS 2.1 way to inspect if a password is present, rather than having to rely on a OS 2.2 API (which is rather complicated to do whilst still supporting OS 2.1 devices).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不会强迫用户为整个设备设置密码,而是为您的应用程序创建类似密码保护的内容(例如“Dropbox”)。
为此,我将在“密码模式”下使用 EditText< /a>.
I wouldn't force the user to set a Password for the whole device, but instead make something like a Password-Protection for your app (Like in 'Dropbox').
For this, I'd use a EditText in 'Password mode'.