OnlyMe
OnlyMe
Events:
- AdminDisabled
- AdminEnabled
- LockTaskModeEntering
- LockTaskModeExiting
Methods:
- EnableLockTaskMode
Allows this application to enter the lock task mode. In this mode, the app can be pinned without displaying a confirmation dialog and the user has no mean to exit.
This function does nothing if the app is not a device owner.
- Initialize (EvtPrefix As String)
- IsDeviceAdmin As Boolean
Returns whether this application is registered with the system as a device administrator.
- IsDeviceOwner As Boolean
Returns whether this application is registered with the system as a device owner. A device owner app is a special device admin that cannot be deactivated by the user once activated as a device admin and cannot be uninstalled.
- IsLockTaskPermitted As Boolean
Returns whether this application is allowed to start the lock task mode. Returns False if the mode was not enabled with EnableLockTaskMode.
- IsLocked As Boolean
- Lock
Pins the current activity and thus prevents the user from launching other apps, going to settings, or reaching the home screen.
If the lock task mode is not enabled (IsLockTaskPermitted returns False), a dialog will ask the user to confirm the pinning and the user will be able to exit by holding the Home and Recents buttons.
- OpenAdminDialog
Opens the dialog asking the user to add this application to the system as a device administrator.
- RemoveThisDeviceAdmin
Removes this application as a device administrator.
- RemoveThisDeviceOwner
Removes this application as a device owner.
- SetThisDeviceOwner As Boolean
Sets this application as a device owner app on a rooted device. A device owner app is a special device admin that cannot be deactivated by the user once activated as a device admin and cannot be uninstalled.
Returns whether the command succeeded.
On an unrooted device, you have to run this command: adb shell dpm set-device-owner <your package name>/flm.b4a.onlyme.AdminReceiver
- Unlock
Author: F. Leneuf-Magaud/Informatix