android 7.0 DevicePolicyManager的修改

     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账号的方式。有兴趣可以搜索相关资料查看。

可以参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值