3

我能够以编程方式实现屏幕锁定的锁定和解锁。但我想知道是否有可能以编程方式将屏幕锁定模式从“幻灯片”更改为“模式”或“密码”。

我在网上搜索但找不到任何东西,所有结果都是关于我已经完成的通常的锁定和解锁。

任何人都可以告诉我是否可能吗?如果是,那么我将如何实现它。

任何帮助将不胜感激:)提前感谢:)

4

1 回答 1

4

You can use Device Administration API. And DeviceAdminSample is a good start.

There are following types you can set using setPasswordQuality()

        DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED,
        DevicePolicyManager.PASSWORD_QUALITY_SOMETHING,
        DevicePolicyManager.PASSWORD_QUALITY_NUMERIC,
        DevicePolicyManager.PASSWORD_QUALITY_ALPHABETIC,
        DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC,
        DevicePolicyManager.PASSWORD_QUALITY_COMPLEX

There are several answers on SO

于 2014-03-27T11:56:41.757 回答