简体   繁体   English

dpm set-device-owner在Redmi注意事项4中不起作用

[英]dpm set-device-owner not working in redmi note 4

I am trying to make an application device-admin, for that I'm following Developing a Device Administration Application 我正在尝试使应用程序成为设备管理员,因为我正在开发设备管理应用程序
And when I try to run below command 当我尝试在命令下运行时
./adb shell dpm set-device-owner com.example.app/.receiver.AdminReceiver

it gives SecurityException 它给出了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)

Can anybody please help to get out of this problem, I have removed all the accounts from mobile. 任何人都可以帮助摆脱这个问题,我已经从移动设备中删除了所有帐户。 I'm using redmi note 4 mobile 我正在使用Redmi Note 4 Mobile

Having active accounts would result in different error, so it's not the case. 拥有活动帐户会导致不同的错误,所以情况并非如此。

Please try to type in full path to receiver's package, eg com.example.app/com.example.app.receiver.AdminReceiver 请尝试输入收件人资料包的完整路径,例如com.example.app/com.example.app.receiver.AdminReceiver

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM