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.
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:
Key 115 VOLUME_UP WAKE_DROPPED
Key 114 VOLUME_DOWN WAKE_DROPPED
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.
I hope you find this post useful. if you like the post, share this with your friends.