Accidentally pressing the power button on a Xiaomi smartphone can interrupt an important process, turn off the device at the most inopportune moment, or even cause a reset. This is especially true for users who often carry a phone in their pocket, exercise or work in vibration. Fortunately, MIUI firmware has several ways to limit the functionality of a physical button, from standard settings to hidden capabilities for power users.
In this article, we will discuss 5 proven methods to disable or modify the behavior of the off button on Xiaomi, Redmi and POCO smartphones (including models on MIUI 12-14 and HyperOS). You will learn how to completely block the button, reassign its functions or restrict access to the power menu without root rights. Important: some methods require activation of the developer mode or connection to the PC โ we will describe each step in detail.
Why do you need to turn off the off button?
At first glance, the idea of blocking the power button seems strange, but in practice it solves a few real problems:
- ๐ Accidental taps in your pocket or bag leading to your phone rebooting or turning off.
- ๐ถ Protect against children who may accidentally turn off the device or start resetting.
- ๐ง Interrupting critical processes: software updates, video recordings, file transfers.
- ๐ก๏ธ Security: Blocking access to the recovery menu (Fastboot/Recovery) on a stolen phone.
- ๐ฎ Game mode: preventing exit from the game by pressing the side buttons.
According to service centers, up to 15% of calls with โnon-includedโ Xiaomi smartphones are associated with an accidental reset via the power menu. Especially vulnerable models with sensitive mechanical buttons: Redmi Note 10 Pro, POCO X3 Pro or Xiaomi 11T. At the same time, the manufacturer does not provide a built-in option to completely disable the button โ it needs to be adjusted manually.
โ ๏ธ Warning: Turning off the power button does not block the ability to turn off the phone via the software menu or adb shell reboot command -p. This only protects against physical pressure.
Method 1: Use the Safe Button mode (MIUI 12โ14)
The easiest method is to activate the hidden โSafe buttonโ function, which blocks short-press reactions, which is available on most Xiaomi devices without root rights, but must be enabled beforehand through the developer settings.
Instructions:
- Activate Developer Mode: Go to Settings โ About Phone. 7 times click on the MIUI version (you will be notified "You became a developer").
- Open the settings โ Additional โ for developers.
- Find the option Safe Power Button (or Safe Power Button in English firmware).
- Activate the switch and select the delay (recommended 3 seconds).
- Save the changes and test the button.
Limitations of the method:
- It does not block long-term retention (the shutdown menu remains available).
- On some models (POCO F3, Redmi K40) the power button reassignment option may not be available.
๐ก
If the menu doesnโt have the power button reassignment option, try upgrading MIUI to the latest version or install an alternative launcher (like Nova Launcher) that supports gesture management.
Method 3: Blocking through ADB (no root rights)
For advanced users ready to connect the phone to a PC, there is a way to turn off the power button response via Android Debug Bridge (ADB).This method does not require root rights, but requires installing drivers and enabling debugging over USB.
Step-by-step:
- Preparation: Download ADB Tools for Windows/macOS/Linux. Enable USB Debugging on your phone in Settings โ Developer. Connect your phone to your PC and confirm debugging permission.
adb shell
settings put global power_button_behavior 0Where 0 is a complete shutdown of the reaction to the button (alternative values: 1 is only a short press lock, 2 is a double press lock).
adb rebootTo return the standard button behavior, do:
adb shell settings put global power_button_behavior nullโ ๏ธ Note: Some HyperOS firmware (e.g., Xiaomi) 13/14) This command may not work because of the system's changed architecture, and you'll need to use Shizuku or root access.
| The importance of the team | The effect | Applicable to |
|---|---|---|
| 0 | Complete disregard for pressing | MIUI 12โ13, Android 10โ12 |
| 1 | Short press locking | All versions of MIUI |
| 2 | Double-press locking | MIUI 14, HyperOS |
| null | Return of Standard Behavior | Any firmware. |
Method 4: Using blocking applications (without root)
If previous methods donโt work, you can use third-party apps that intercept button clicks.The best options for Xiaomi are:
- ๐ Button Remapper โ allows you to reassign the actions of the buttons, including power lock. ADB Shizuku.
- ๐ก๏ธ Power Button Lock โ a special application for blocking the shutdown button (requires permission) SYSTEM_ALERT_WINDOW).
- ๐๏ธ MacroDroid โ creates macros that ignore button presses in certain conditions (e.g. during games).
Example of the configuration in Button Remapper:
- Install the app from Google Play.
- Provide access through ADB: adb shell pm grant com.flar2.homebutton flar2.homebutton.permission.WRITE_SECURE_SETTINGS
- Select Power Button โ Disable from the app.
Cons of the method:
- Applications may conflict with MIUI system services.
- After updating the firmware settings may reset.
- Some apps require the purchase of a Pro version for full functionality.
What to do if the application does not work?
Method 5: Completely disable the button via TWRP (for advanced)
If you need to permanently disable the power button (for example, to protect against resetting settings on a stolen phone), you can edit system files through custom recovery TWRP. This method requires an unlocked bootloader and a TWRP installed.
Instructions:
- Install TWRP for your model (instructions are available on XDA Developers).
- Download the file. power_button_disabler.zip (Available in thematic telegram channels on Xiaomi).
- Go to TWRP โ Install and select the downloaded file.
- Sweat zip and run the Wipe cache.
- Reboot the phone.
This method completely removes the power button handler at the kernel level, so to return functionality, you need to flash the original boot.img or repeat the procedure with the cancel file.
โ ๏ธ Attention: Incorrect actions in TWRP You can make a phone "brick" before you back up the boot and system partition. TWRP โ Backup.
๐ก
Use the TWRP method only if you are confident in your actions. For most users, 1-3 methods are sufficient (without the risk of system damage).
Frequent problems and solutions
When you turn off the power button, you may encounter the following difficulties:
| Problem. | Reason. | Decision |
|---|---|---|
| The button is not blocked through ADB. | Limitations of HyperOS or the new version of MIUI | Use Shizuku instead of ADB or retrace to MIUI 13 |
| The phone doesnโt turn off even through the menu. | Conflict with the blocking application | Disable the app or run adb shell reboot -p |
| After the update, the settings were reset. | Systemic reset of global parameters | Repeat settings via ADB or use MacroDroid with auto-run |
| Double pressing for the camera does not work | Conflict with button reassignment | Enable the option in Settings โ Display โ Button and gestures |
If none of the methods worked, check:
- Firmware Version: On HyperOS (e.g. Xiaomi 14), some features can be blocked.
- Root rights: Some applications require Magisk to work full time.
- Google Services Activity: On some devices, Google Play Services override button settings.