Prevent uninstall and factory reset android

805 views Asked by At

I have tried to search for it but couldn't find a proper solution. So Posting question here to seek help.

Our essential requirement is that child cannot uninstall the app or cannot perform a factory reset on the device without admin permission. Basically similar to the Family Link app.

We are unsure how to make this possible and looking for an expert to help us out with this.

1

There are 1 answers

1
arjun On

Use of Device Admin have been deprecated and Android provides very limited functionality starting from Android 10. Application management permissions are part of Device Owner and Profile Owner deployment models in Android. You need to set your app as Device Owner, use below API :

For blocking Application uninstallation: https://developer.android.com/reference/android/app/admin/DevicePolicyManager#setUninstallBlocked(android.content.ComponentName,%20java.lang.String,%20boolean)

To prevent Factory Reset : https://developer.android.com/reference/android/os/UserManager#DISALLOW_FACTORY_RESET