How to turn off the power button camera on Xiaomi Mi A1: 3 proven ways

The Xiaomi Mi A1 is a iconic smartphone with pure Android that is still used by many users today, and one of its features is to double-press the power button, which is convenient for quick shooting, but often works by accident: in your pocket, when you carry your phone, or even while you're on a call. If you're tired of spontaneous photos of a black screen or battery discharge because of a flashlight that goes on with the camera, this is the instruction for you.

Unlike other Xiaomi models, where disabling this feature is hidden in the depths of settings, the Mi A1 with its β€œnaked” Android process has nuances. We will consider all working methods, from standard options to editing system files via ADB. Important: some methods require the rights of a superuser (root) or unlocked bootloader – we will warn you about this in advance.

So we're going to deactivate the uncomfortable feature, start with the simplest one, and end with radical measures for power users.

Why the camera is triggered by the power button and whether it can be turned off

The dual tap to Wake feature was introduced by Xiaomi as part of the MIUI shell. However, the Mi A1 ran on pure Android One, where it wasn't originally available. The manufacturer added it at the core level, so there's no standard switch in the settings.

Reasons why users want to disable this feature:

  • πŸ“Έ Spontaneous positives in the pocket (up to 50% of cases according to surveys of owners).
  • πŸ”‹ Fast battery discharge due to flashlight or image processing.
  • 🚫 Conflict with other gestures (e.g., double tap to wake up the screen).
  • πŸ”’ The risk of accidentally capturing confidential moments.

On the Xiaomi Mi A1, the power button camera launch function is hardcoded in /system/usr/keylayout/Generic.kl and has no GUI to turn off, which means that without superuser rights or tools like ADB, it is impossible to deactivate it, but there are workarounds to deactivate it.

πŸ“Š You accidentally run the camera with a power button on the Mi A1?
Yeah, all the time.
Yeah, but rarely.
No, never.
I have a different model.

Method 1: Disconnect via settings (without root)

While there is no full-fledged switch to deactivate the feature, some Mi A1 firmware can trick the system by changing the power button action, a technique that works on Android 9 Pie stock firmware and some custom builds.

Instructions:

  1. Open the settings β†’ System β†’ Gestures.
  2. Find the "Double Press Power button" section (some firmware may call it "Quick Launch").
  3. Select the action "No" or "Disable".
  4. Reset the device.

If this is not the case, try an alternative route:

  • πŸ”§ Go to Settings. β†’ Annexes and notifications β†’ Additionally. β†’ Special access β†’ Optimizing the battery.
  • πŸ“± Find the Camera app and disable Optimization for it".
  • πŸ”„ Reboot the phone.

This method doesn't guarantee 100% results, because it depends on the firmware version. If it doesn't work, move on to the next method.

Turn off password/pattern lock (may interfere with ADB)

Connect your phone to your PC and enable debugging over USB

Make sure that the Android version is not lower than 7.1.2

Make a backup copy of important data-->

Method 2: Use ADB (without root but with PC)

If the standard settings don’t work, the next step is to use Android Debug Bridge (ADB). This method does not require superuser rights, but requires a computer and a computer. USB-cable.

Step-by-step:

  1. Download and install Google’s Platform Tools (includes ADB).
  2. Turn it on on the phone: πŸ”Œ Settings β†’ The phone. β†’ Build number (tap 7 times to activate developer mode). πŸ”§ Settings β†’ System system β†’ For developers β†’ Debugging by USB.

Mi A1

adb devices

(Series numbered device should appear. If not, install Xiaomi drivers.)

adb shell settings put global camera_double_click_power_key 0

This command turns off the double-press response. To return the function back, replace 0 with 1.

If the command fails (it gives an error "not found"), try the alternative:

adb shell am broadcast -a android.intent.action.CAMERA_BUTTON -n com.android.camera/.CameraLauncher --ez long_press false

πŸ’‘

If the function still works after executing the commands, check if a third-party application (for example, Double tap to wake up) blocks it. Disable all such utilities before trying again.

Method 3: Editing system files (root required)

For power users with unlocked bootloaders and root rights, there is a radical method, editing the Generic.kl file, which is responsible for assigning buttons, which is 100% effective, but requires caution.

What you need:

  • πŸ“± Unlocked bootloader and root access (for example, via Magisk).
  • πŸ’» PC fitted ADB and text editor (e.g. Notepad)++).
  • πŸ”„ Backup of the system (required!).

Instructions:

  1. Connect your phone to your PC and do:
adb pull /system/usr/keylayout/Generic.kl

(The file is copied to the current folder on the PC.)

  1. Open Generic.kl in the text editor and find the line:
key 116   POWER               WAKE_DROPPED


key 116   POWER               WAKE

Replace her with:

key 116   POWER               WAKE_DROPPED


#key 116   POWER               WAKE

  1. Save the file and send it back to your phone:
adb push Generic.kl /system/usr/keylayout/


adb shell chmod 644 /system/usr/keylayout/Generic.kl

  1. Reset the device.

If the phone doesn't turn on after you restart, it means the file is not edited correctly. Restore it from a backup via TWRP.

What if the phone doesn’t turn on after editing?
If the screen is still black, plug the phone into your PC and do: 1. Boot into TWRP (press Power + Volume Up). 2. Connect to ADB and restore the original Generic.kl: adb push backup/Generic.kl /system/usr/keylayout/adb shell chmod 644 /system/usr/keylayout/Generic.kl 3. Reboot. If TWRP is not, run the stock firmware through Fastboot.

Alternative solutions: if nothing has worked

If none of these methods worked, consider alternatives:

MethodDescriptionPlusesCons
Installation of custom firmwareFirmware like LineageOS or Pixel Experience doesn’t have this feature.Complete removal of the feature, fresh Android.It's hard for beginners to risk "bricking."
Blocking applicationsUtility like Button Mapper or Tasker can intercept clicks.It does not require root, flexible settings.It's unstable, battery power.
Shutting down the camera altogetherThrough Settings β†’ Applications β†’ Camera β†’ Disable.Easy and fast.You can't use the camera at all.

The most reliable option is custom firmware, such as LineageOS 18.1 for the Mi A1 completely removes the dual-press feature, while adding support for modern versions of Android.

πŸ’‘

Blocker apps (such as Button Mapper) can conflict with system services, and if the phone starts to brake or overheat after installing them, remove the utility and clear the cache.

Frequent Mistakes and How to Avoid Them

When you turn off the feature, users often face typical problems, and here are the most common ways to solve them:

1. ADB team is not working ("setting not found")

Reason: In your firmware parameter camera_double_click_power_key It's called something else:

adb shell settings list global | grep camera

Look for lines from power_key or double_click.

2. After editing Generic.kl, the phone does not turn on

Reason: Incorrect file access rights or a syntax error: Restore the original file via TWRP or reflash the system.

3.The function went off but returned after a while

Reason: System update resets. Block updates or re-apply ADB command.

4.Blocking applications are not working

Reason: Conflict with other utilities or energy saving. Add the app to battery exceptions and check Accessibility Service rights.

⚠️ Note: If you are using the Mi A1 With an unlocked bootloader, never upgrade "over the air" (OTA). This can lock the device. All updates are manually installed through the device. TWRP.

Can I turn off the function without a computer?
Yes, but only if you have root access. Install a root-enabled file manager (like Root Explorer) and manually edit /system/usr/keylayout/Generic.kl as described in Method 3. Without root and PC, you can't turn off the function.
Why does the camera still start after the shutdown?
You probably have a third-party app on your phone that intercepts double taps (like Nova Launcher or Gesture Control). Check the list of installed utilities and turn them off one by one to find the culprit. Also make sure you execute ADB correctly - sometimes you need to reboot.
Will this work on other Xiaomi models?
No, the Mi A1 is unique because of its pure Android. On MIUI devices (like the Redmi Note 4 or Mi 8), the feature is disabled via Settings β†’ Lock and Protection β†’ Double-press the power button. Use different instructions for them.
Can I return the function after disconnecting?
Yes, if you used it. ADB, Run the same command with the parameter 1 instead 0: adb shell settings put global camera_double_click_power_key 1 If you edited Generic.kl, restore the original line and restart the phone.
Will disabling the function affect the operation of other buttons?
Not if you followed the instructions. ADB commands and Generic.kl edits only address the response to double-pressing. Single-press (on/off screen) and retention (power menu) will remain unchanged.

If your question is not covered in the FAQ, check the comments below the article - perhaps someone has already encountered a similar problem. For difficult cases (for example, after unsuccessful editing of system files), we recommend you to contact profile forums such as 4PDA or XDA Developers, where experienced users of Xiaomi Mi A1 gather.

⚠️ Note: Some of the Mi's firmware A1 (for example, Android 10 from the community) the double-click function can be linked to another file β€” /vendor/usr/keylayout/Generic.kl. If the standard methods don’t work, check this way.