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. Furthemore, you can also download Google Camera Port for your Xiaomi Mi A1 from below.
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.7.0 (March 2019)
- Xiaomi Mi A1 V10.0.5.0 (February 2019)
- Xiaomi Mi A1 V10.0.4.0 (January 2019)
- Xiaomi Mi A1 V10.0.3.0 (December 2018)
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.
Download Google Camera Port for Xiaomi Mi A1
XDA RD joeyhuab created a dedicated thread on the forums to share the latest working Google Camera Ports for Xiaomi Mi A1. Below are some of the GCam ports shared by different users on that thread. Note that each version may have bugs of there own. Rest assured, these are the most stable ports available for the device as confirmed by the XDA users who shared them.
- com.google.android.GoogleCamera-6.1.021.220943556.apk (By Ezequiel Kohan): Features like HDR+ and Night Mode are working. Also, there’s no green tint using the front camera. The only known issue is that Slow Motion video recording does not work.
- MGC_6.1.021_RN4X_A8.1+_V3_mido.apk (By Exmor97): Although it is for the Redmi Note 4X, the Google Camera Port works flawlessly on the Mi A1. This also doesn’t have the green tint on the front camera.
If you’re not satisfied with the provided ports, you can try and find the perfect one for you from here. Finding the perfect GCam Port for any device is hard. If you have found a better port, then please let us know in the comments. It would help other users who are looking for it.
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.