dpm set-device-owner不在redmi note 4中工作

时间:2018-02-08 19:26:59

标签: android device-policy-manager device-owner

我正在尝试创建一个应用程序设备管理员,因为我正在关注Developing a Device Administration Application 当我试图在命令下运行时 ./adb shell dpm set-device-owner com.example.app/.receiver.AdminReceiver

它给出了SecurityException

java.lang.SecurityException: Neither user 2000 nor current process has android.permission.MANAGE_DEVICE_ADMINS.
    at android.os.Parcel.readException(Parcel.java:1683)
    at android.os.Parcel.readException(Parcel.java:1636)
    at android.app.admin.IDevicePolicyManager$Stub$Proxy.setActiveAdmin(IDevicePolicyManager.java:4278)
    at com.android.commands.dpm.Dpm.runSetDeviceOwner(Dpm.java:145)
    at com.android.commands.dpm.Dpm.onRun(Dpm.java:96)
    at com.android.internal.os.BaseCommand.run(BaseCommand.java:51)
    at com.android.commands.dpm.Dpm.main(Dpm.java:41)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:343)

任何人都可以帮助摆脱这个问题,我已经从移动设备中删除了所有帐户。我正在使用redmi note 4 mobile

1 个答案:

答案 0 :(得分:0)

拥有有效帐户会导致不同的错误,所以情况并非如此。

请尝试输入收件人套餐的完整路径,例如: mouseout