Search code examples
androidlauncher

Android keep my launcher as default


I am developing an android app for a company. Their employees must not use any other apps but the company-app,the preinstalled phone-app to make calls and the settings. So I created a custom launcher and registered it as default. The launcher shows only the allowed apps. But the employees could open the settings and set the normal android launcher as default (and then use the internet for doing unallowed things or download malware) or uninstall my launcher. Is there any possibility to prevent this without rooting? If I register the laucher as device administrator they could open the settings and disabling it.

Note: I have full access to the devices before they were delivered.

Best regards


Solution

  • I found a solution 1. I registered my app as boot-receiver 2. I created a service which tests which activity is in foreground (if it is from the whitelist: OK, otherwise: my app comes to foreground, blocks the foreground-activity and shows the user a warning "don't do this")

    The next problem was: the user should be able to use the settings (for wifi), so he could uninstall my app. 3. Register my app as device admin (the user is unable to uninstall or force-stop my app until he unregister it as device-admin)

    1. While testing which activity is in foreground, the service tests if the app is still device-admin. If it isn't device-admin, all apps were blocked until the app is device-admin again (the dialog pops up).