我写了一个远程锁定安卓手机的应用程序。也就是说,当从服务器发送特殊代码时,应用程序会根据特殊代码锁定手机。这是我正在使用的代码。
if (!mDPM.isAdminActive(mDeviceAdminSample)) {
// try to become active – must happen here in this activity, to get result
Intent intent = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN,mDeviceAdminSample);
intent.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION,"Admin is added to do security operation.");
startActivityForResult(intent, 0);
} else {
// Already is a device administrator, can do security operations now.
mDPM.lockNow();
}
上面的代码正在工作,它正在锁定手机。
我可以通过从软键盘输入密码来解锁手机。有没有办法通过密码解锁?
我的问题是如何通过代码解锁手机。(此解锁应按照我解释的锁定方式远程完成)