1

I want to completely disable the three on-screen buttons (Back, Home, Recents) and any other hardware button. I am aware that I cannot do this from the application since that would be a major security flaw. How would I do this to a device assuming that I have the device on hand? Gain root access and then how would this go?

Ps: What I am trying to do is to have the app run on my tablet on a kiosk and I do not want the users to pressing any buttons.

3

Full!screen has a (paid-for) feature where you can automatically hide system bars in certain apps and unhide them in other apps, but there is a free version without the automation.

Alternatively, you can hide them completely over ADB (source) with:

adb shell
su
pm disable com.android.systemui

Or (if you're writing your own app) you can use this code (source):

private void hideNavigationBar(){
        try {
            Process process = Runtime.getRuntime().exec("su");
            DataOutputStream os = new DataOutputStream(process.getOutputStream());
            os.writeBytes("pm disable com.android.systemui\n");
            os.flush();
            os.writeBytes("exit\n");
            os.flush();
            process.waitFor();
            //////////////////////////////////////
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

Kiosk Browser Lockdown also has a feature where you can disable all system dialogs (volume, long-press power etc.)

1

Using the Xposed Framework and Xposed Additions you can remap any button to any action, and in your case the 'No action'.

Combining this to disable all your hardware buttons with this answer, and you would achieve what you want.

Open the app and follow these steps:

  1. Click on Buttons
  2. Click Add new Key
  3. Press the key you want to disable
  4. Press OK
  5. Click the key in the list and for every condition assign the Disabled action

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.