4
我的腳本創建密碼並鎖定手機,但如果我嘗試將密碼更改爲
爲空,則會失敗。如何以編程方式禁用屏幕鎖定密碼。
我鎖定腳本:
DevicePolicyManager deviceManager = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE);
ComponentName compName = new ComponentName(MessageService.this, LockAdmin.class);
boolean active = deviceManager.isAdminActive(compName);
if (active) {
deviceManager.setPasswordQuality(compName,DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED);
deviceManager.setPasswordMinimumLength(compName, 5);
boolean result = deviceManager.resetPassword("blablabla", DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY);
}
所以我的問題是,我怎麼能更改密碼設置爲空或如何能更改鎖定模式爲「無」?
不適用於牛軋糖設備,拋出安全異常和崩潰 –