当前用户禁用了托管令牌

时间:2019-05-10 08:51:18

标签: android

当我在Android 8.0设备上使用方法“ setResetPasswordToken”时。 它抛出此错误 Caused by: java.lang.SecurityException: Escrow token is disabled on the current user at android.os.Parcel.readException(Parcel.java:1945) at android.os.Parcel.readException(Parcel.java:1891) at android.app.admin.IDevicePolicyManager$Stub$Proxy.setResetPasswordToken(IDevicePolicyManager.java:8856) at android.app.admin.DevicePolicyManager.setResetPasswordToken(DevicePolicyManager.java:2797)

我该如何解决?

1 个答案:

答案 0 :(得分:0)

通过注册用于在设备所有者模式下通过QR码https://developers.google.com/android/work/play/emm-api/prov-devices#create_a_qr_code重设密码的DPC应用程序(而不是通过ADB设置DO)来解决该问题。

请注意,不建议使用清除方法https://developer.android.com/reference/android/app/admin/DevicePolicyManager#clearDeviceOwnerApp(java.lang.String)