Stop access to all other apps in Android Device except launcher app

392 views Asked by At

I've created a launcher app, by adding following to the activity in manifest:

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
            <category android:name="android.intent.category.HOME" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>

Now, my app is a launcher app, whenever I press back/home/menu buttons, it does ask me for switching launchers.

Also, I still can open other apps by choosing home launcher, and I can still access settings and everything else.

What I need to achieve is, I need a complete cut-off for user to anything else in the device, the only way other apps are accessed, will be a programmatic call from launcher app.

Please suggest how to achieve the same.

1

There are 1 answers

1
Gabe Sechan On

The only way to do this is with the DeviceManager API. First, you have to become device owner. Then you can use the DeviceManager API to set yourself as the default launcher app.

Using that, you can make yourself the launcher and prevent other launchers from being started. However they can still use the status bar to launch settings, and get into other stuff through there. You can prevent the status bar from expanding if you use the StatusbarManager API, but that requires you to use reflection to use private APIs and you'll need to be a system app (it uses system permissions). It will also disallow any access to notifications. If you need that, you'll probably need to make a custom Android OS image.