Android Pie update for Xiaomi Mi A1 was released a while back and our users have asked us if they can enable Camera2 API on their Mi A1 after upgrading. To answer the question, today, we will show you how to easily enable Camera2 API on Xiaomi Mi A1 running Android Pie without root.
The Xiaomi Mi A1 is the company’s first smartphone featuring the Android One program. Being a part of the program means that the device offers guaranteed updates. Be it a major Android version release or monthly security patches. Talking about the software, the phone incorporates the stock AOSP firmware which is free from the majority of OEM bloatware. If you try installing the Google Camera Port on your Mi A1, you will probably fail due to the lack of Camera2 API support. Despite being based on stock Android, the Mi A1 still doesn’t offer direct support for Camera2API on Android Pie or Oreo.
If you have rooted your Mi A1, you can easily enable the API by making a few build.prop edits. But if you want to do it without root, then it’s still quite easy to enable Camera2 API on Xiaomi Mi A1 running Android Pie.
The process we have listed below will first require you to boot a Magisk Patched Boot Image to gain temporary root. Once booted into the OS, you can simply use a Terminal Emulator and change the required device properties to enable Camera2 API. You will still be able to take OTA updates after following this method, so stay out of worries.
Below are the download links for Android Pie patched boot images for Xiaomi Mi A1. We have also provided the stock boot image for the corresponding firmware. It shall help you unroot your phone in case you mistakenly flash the patched boot permanently. Huge thanks to XDA Senior Member paolocorpo for the V10.0.3.0 boot images.
- Xiaomi Mi A1 V10.0.4.0 Patched Boot Image: Download link
- Xiaomi Mi A1 V10.0.3.0 Patched Boot Image: Download link
- Xiaomi Mi A1 V10.0.4.0 Stock Boot Image: Download link
- Xiaomi Mi A1 V10.0.3.0 Stock Boot Image: Download link
How to Enable Camera2API on Xiaomi Mi A1 running Android Pie?
In order to temporarily boot the patched boot image on your Mi A1, you must first install Android platform-tools on your PC. I have personally tested this method on a Xiaomi Mi A1 running Android Pie v10.0.4.0 firmware. Although, it should work on the previous V release too.
- Download Android Pie patched boot image for your Mi A1
- Copy the downloaded image file to the folder where the ADB/Fastboot binaries are present (e.g. C:/username/platform-tools)
- Hold the SHIFT key and right-click on an empty space inside the folder
- Select the ‘Open PowerShell window here’ option
- Power off your Xiaomi Mi A1 completely
- Now hold the Volume Down and Power buttons together to enter Fastboot Mode
- Connect your phone to the PC using the USB cable
- Enter the following command to temporarily boot the Magisk patched boot image on your Mi A1:
fastboot boot boot-image-filename.img
- Make sure to replace ‘boot-image-filename.img‘ with the actual filename. For example, if you’re on V10.0.4.0, the command should be:
fastboot boot patched_boot_V10.0.4.0.PDHMIXM.img
- Just as the command is entered, your Mi A1 should boot into the OS with temporary root
- Now, download and install Termux (Terminal Emulator) on your phone
- Once installed, launch Termux and enter the following command:
- Grant superuser permissions to Termux when prompted
- Finally, enable Camera2 API on Xiaomi Mi A1 running Android Pie by entering the following command:
setprop persist.camera.HAL3.enabled 1
setprop persist.vendor.camera.HAL3.enabled 1
setprop persist.camera.stats.test 5
setprop persist.vendor.camera.stats.test 5
Once the command executes without any errors, close Termux and reboot your phone. When your phone reboots, Magisk Manager should vanish and your Mi A1 should be unrooted. For further confirmation, you can also check Camera2 API support using an app. So, go ahead and install Google Camera Port on your Mi A1 without rooting.
You have just succeeded to enable Camera2 API on Xiaomi Mi A1 after upgrading to Android Pie without root. If you have any questions regarding the method listed above, please feel free to leave a comment.