Motorola Moto G4 Play (motorola-harpia)

The Moto G4 Play is a 2016 budget smartphone by Motorola. It is the lower cost and smaller sibling to the Moto G4. The back panel (called "shell" by motorola) can be lifted off by pulling at the notch on the bottom-right corner of the phone. This exposes the removable battery, microSD and Micro-SIM slots, note that SIM cards can only be added or removed with the battery removed. It comes with a 2800mAh battery and uses the same form-factor as the Motorola Moto G5 (motorola-cedric) for replacement.

Contributors

 * Sorixelle

How to enter flash mode
Hold down +  while booting to enter Flash Mode.

Things you need to do in android

 * in the developer settings of your android installation, you need to enable "OEM unlocking". This step is necessary to enable the bootloader to be unlocked. Here is a guide that describes how you would do that: https://www.getdroidtips.com/unlock-bootloader-moto-g4-play-harpia/
 * To unlock your bootloader, you need to have a motorola account (there is no way to avoid that). The reason is, the motorola website needs to generate your OEM unlock key based on the fastboot device ID you need to enter.

Do to that, follow the instructions on the Motorola Support page.

Basically, these are the steps:
 * execute fastboot oem get_unlock_data
 * merge this result into one large string (remove "(bootloader)" and whitespace
 * paste this into the form field on the above website.
 * retrieve your oem unlock key from the email the motorola website has sent you. That is the input in the next step
 * execute fastboot oem unlock YOUR_OEM_UNLOCK_KEY

Other Preparations
Install the lk2nd bootloader, as it is required to handle some quirks with msm8916 devices on mainline kernels. Flash the  image to the boot partition with. lk2nd also provides a fastboot interface that allows for flashing kernels without overwriting lk2nd itself. To enter it, power on the device, then hold down Vol Down as soon as you see the boot splash. You should be presented with a menu that looks like the following:



If you're seeing a "Permission denied", you're not yet within the l2knd bootloader as shown in the photo, wait for the warning splash to occur first, then press buttons as instructed.

When you have lk2nd installed and running, follow Qualcomm_Snapdragon_410/412_(MSM8916).

Modem
Follow the directions on this wiki page to use the modem. If you have a device model other than what is listed here, please edit the list below with the results of modem functionality testing.


 * XT1602: Modem working, can send and receive text messages. Can initiate and answer phone calls. Mobile data does work only when using the modem files contained on the modem partition.
 * XT1603: Modem partially working, can receive text messages. Can initiate with old simcards, always starts on 2G, you can manually change to 3g and 4g, but on newer cards(3g,4g only I suppose) modem do not initiate even with mmcli commands(modem not detected). Sound starts 0db then after a moment it comes to normal.
 * XT1604: Modem working, can send but not receive text messages. Can make phone calls and receive. The Modem doesn't always start on boot, you need to run mmcli -S for it to start working.
 * XT1607: Modem working, can send text messages. Earpiece and Mic1 work with phone calls. Had to manually load RETUS_6.0.1 NON-HLOS firmware, will document and maybe package alternate firmware.

Note
In some very rare cases the modem may crash at boot, forcing to deal with manual services restarts (like modemmanager), and also creating problems with audio. Such situation was dealt with successfuly in issue #1973, and here's a quick recap of the problem with a fix for it: https://gitlab.com/postmarketOS/pmaports/-/issues/1973#note_1309848521

Touchscreen
synaptics s3203b: works ; others: unknown

WiFi
There used to be issues on various devices where Wi-Fi didn't work properly with certain Wi-Fi channels or the 80.211n mode, but this should no longer happen on pmOS v23.06+ (and edge). For older versions, see https://gitlab.com/postmarketOS/pmaports/-/issues/1085#note_1220953940 for a possible workaround.

Hardware / sensor details
Output from : hwtest

Output from  (lm-sensors package): sensors

For reference, the results from  (v1.8, f-droid). The sensor suite seems sparse, typical of "play" variant. sensorssandbox