How to use Android-L preview Task Locking?

前端 未结 2 411
走了就别回头了
走了就别回头了 2020-12-15 11:20

Has anyone got task locking working in Android L? Could they share some details on how it works? I have seen the instructions below, but struggling to understand this.

2条回答
  •  遥遥无期
    2020-12-15 11:50

    Taking Below Snip from Task Locking API

    enter image description here

    It is clear that startLockTask() api will be hv effect if device_owner.xml is present .

    How do i check if my app is device owner ?

    When you app is device owner , you app is Device Administrator option will be checked and checkbox will be gray out hence will not allow u to untick the checkbox.

    enter image description here

    You need to give system right while pushing device_owner.xml

    Follow below steps :

    1. Create device_owner.xml [make sure the app will be present before u push device_owner.xml ]
    2. Navigate to path in terminal where device_owner is present
    3. adb push device_owner.xml /sdcard/
    4. adb shell
    5. su
    6. cp /sdcard/device_owner.xml /data/system/
    7. cd /data/system/
    8. chown system:system device_owner.xml
    9. reboot

提交回复
热议问题