android N之前的版本是可以通过设备管理器来管理锁屏密码的。但从N以后resetPassword方法有了些改变:
* <em>Note: This API has been limited as of {@link android.os.Build.VERSION_CODES#N} for
* device admins that are not device owner and not profile owner.
* The password can now only be changed if there is currently no password set. Device owner
* and profile owner can still do this when user is unlocked and does not have a managed
* profile.</em>
意思是说如果非device owner 或者profile owner的 设备管理器,在设备已经有了锁屏密码的情况下,将无法修改密码;但如果还没有锁屏密码,是可以设置一个,但后面再想修改,无法通过该方法来实现。
而将自己的应用设置device owner或者profileowner 是另一个话题了,目前的方法有两个:通过NFC的方式和Google账号的方式。有兴趣可以搜索相关资料查看。