问题
I have been trying to get device owner, inspired by google sample code
Using adb, I am able to get device owner on nexus 4,5,7,9 and micromax. However in LG G Pad (LG-V400) and LG G3 (LG G3 855) I get an error.
java.lang.SecurityException: Neither user 2000 nor current process has android.permission.BIND_DEVICE_ADMIN.
I noticed that the device admin is enabled on these devices, but not the device owner. I was able to capture the bug report from the device found here.
I have tried contacting LG but havent heard back anything.
Any help is greatly appreciated.
回答1:
After discussions and help from Kash, we realized that my original answer was only a portion of what needed to be done to change the device owner. The steps to set the owner are as follows:
- Root the LG device. Here is the tool I used: http://forum.xda-developers.com/lg-g3/general/guide-root-lg-firmwares-kitkat-lollipop-t3056951
- Use the command: "set Settings.Secure.USER_SETUP_COMPLETE=0" as root
- Install your device owner app
- Create xml file as per this: How to make my app a device owner?
Reboot the device and it should now work. If you have any questions feel free to send me a message.
来源:https://stackoverflow.com/questions/30163964/device-owner-issue-using-adb-method-with-lg-devices-only