If you want to disable volume buttons on your Android device for some reason, then you can do it in two different ways. Let’s get started.
Disable Volume Buttons on Android
Rooted and Non-Rooted Android Devices
In this first method, I have talked about two third-party apps which can do this task on both the rooted and non-rooted devices.
Install and open “Button remapper (no root)” app.
Tap the “Switch” to enable accessibility service.
Tap “Continue” on the popup.
Now we can see the accessibility services. Tap “Remap buttons” and enable the switch. Tap the back button twice to come back to the app.
Tap the “+” icon at the bottom.
Choose “Short and long press” option.
Choose the “Volume Up” key from the “Key” drop-down list.
From the “Actions” drop-down list, choose the “Do nothing” option.
Tap OK option.
Now hit the “+” icon again and then select “Short and long press” option.
Choose “Volume Down” from the “Key” drop-down list and choose “Do nothing” from the “Actions” drop-down list.
That’s all. Both the volume buttons are disabled now.
You can enable both the buttons by deleting both the actions. Just long press the action and choose “Delete”.
Set your device volumes as per your wish.
Install and open “Volume Lock & Mute” app.
Tap “Accessibility Service” option.
Tap “Accessibility service enabled” option and enable the Accessibility permissions for the app.
If you enable the switch between “Volume Lock” (first option), then the app will be enabled, changed the ringtones volume to zero and block the volume keys.
If you want the ringtones volume to be zero, then it’s good.
But if you don’t want the app to make the ringtones volume to zero, then you have to enable “Lock volume at the current level” option first and then you have to enable “Volume Lock” switch.
This will lock the ringtones volume at the current level and block the volume keys from changing it.
If you want to disable changes to the media volume, then you have to enable “Lock media volume” option (While I tried this option, it is not working properly; So try this option by yourself once).
If you wish, you can lock the call volume by tapping the “Lock voice call volume”.
“Allow decrease volume” allows the volume keys to decrease the volume.
If you want to disable volume lock, open Notification bar and tap “Disable Volume Lock”.
Rooted Android Devices Only
Our second and final method needs two requirements and here are they:
Rooted Android device
Install and open ES File Explorer app.
Tap Hamburger icon (three vertical lines) and select Local.
Go to the following location: Device > system > usr > keylayout
Here is an important thing you need to know: If you have a MediaTek device, you need to edit the mtk-kpd.kl file. If you have a non-MediaTek device, you need to edit the Generic.kl file. Take a backup of the file before making any changes.
Wondering your device is MediaTek or not, check this guide to find it out.
In this instance, I’m using MediaTek device. So I’m opening mtk-kpd.kl file (Tap the file > select Text > select ES Note Editor).
Tap Overflow menu (three vertical dots) and then “Edit” option.
Find these lines of code:
Key 115 VOLUME_UP WAKE_DROPPED
Key 114 VOLUME_DOWN WAKE_DROPPED
Just add Pound sign (#) before the above lines of code (see screenshot):
Tap the Back button and tap Yes on the confirmation popup.
Reboot your phone.
That’s it. All done.
From now on, volume up and down keys won’t work.
Keep in mind that the above steps disabled volume keys functionality, not the entire device volume functionality; it means that you can still control your device’s volume using on-screen app.
In case if above steps won’t work on the files that I’ve mentioned above, then I suggest you to do the same above steps on the other files in this location (Device / > System > Usr > Keylayout) which have volume_up and volume_down in it. Make sure to take a backup of the file before making any changes.
If you want to enable volume keys, just remove the # before both the lines and reboot the device.
Both the ways can disable volume keys. So pick the one you want.