[Miscellaneous Android Development] rkcbernard:
Hey just wanted to help out and let you guys know a few things. If you ever end up trying to restore to stock, go to your extracted stock firmware and replace the stock recovery.img with the twrp.img you download from this thread before doing any flashing. That'll prevent you from bricking as you'll always have access to twrp. Use xiaomiflash if qfil doesn't work for you. Had a few partial flashes and couldn't figure it out, and switching to xiaomiflash fixed that. I also had issues until I removed the entries concerning userdata and ddr from rawprogram0.xml, as mentioned somewhere in the return to stock thread. Instead of flashing the userdata, just do a factory reset from recovery if need be. To get service, you have to use the apns-conf.xml found here (chmod 644 in /system/etc/). On android 10 treble roms, that was moved to /system/product/etc. If you take the recent stock pie update for the r2, twrp doesn't boot anymore, but you can restore to the b10 firmware found in the return to stock thread, and twrp will work again.

EDIT:

I figured out voLTE so calls, text, and data work properly for Visible on a treble rom. Unlimited hotspot and everything seems to be working just fine. I never verified that voLTE calls work on android 10, but data definitely does. If anyone gets voLTE working on 10, please let us know how. Here are the steps I followed for 9 on Visible:

1. I downloaded the latest phh treble 9.0 rom.

2. Some gapps but that's optional (I used opengapps, just google it if you need it)

3. Backup your apns-conf.xml in /system/etc

4. Follow the steps in the op and after you have twrp and encryption disabled, flash the patched boot image

5. Wipe all partitions except for vendor and backup your vendor/EFS partitions (keep your EFS backup safe)

6. Flash the phh image to system and gapps if you want them

7. Move your apns-conf.xml back to /system/etc for android 9 or /system/product/etc/ for android 10 and chmod 644

8. Boot system, after setup your data should be working. If not, reset network and apn settings. If you have a verizon apn, then you didn't setup apns-conf.xml properly.

9. I went ahead and installed magisk at this point but I don't believe that's relevant. Calls didn't work yet but texts and data did

10. I followed the steps in the ZTE Axon 7 voLTE thread including installing the ims.apk and the zip attached to the op

11. That caused a bootloop so wipe your vendor partition again and restore your backup to fix that (I'm pretty sure this results in just ims.apk installed as a system app)

12. After that, install enableVoLTE-twrp.zip in this HavocOS Treble thread near the bottom

13. At this point, rebooting instantly registered on IMS with voLTE available. You can check this by dialing *#*#4636#*#* in the phone app

14. If you don't have voLTE, then:

a) turn airplane mode on/off a couple times

b) check for enhanced LTE mode in your network settings and make sure it is on, also set network to LTE/CDMA (try turning them on/off too)

c) make sure voLTE provisioning is on in *#*#4636#*#*

Good luck. I know these steps are amateurish and could probably be made much simpler. I beat all the way around the bush to achieve a simple job but I don't know what I'm doing and I can say this works for Visible. My data works just fine. I have my VPN and private DNS setup with Magisk and the hotspot limitations are gone. I hope this helps and please share anything you find. You can't beat unlimited everything with unlimited hotspot for 25$ a month through Verizon on a 20$ phone that's basically a nexus.

EDIT2:

After a few days of use, I've noticed that occasionally the data does drop and airplane mode doesn't fix it. A reboot usually fixes it, if not a second reboot will. If anyone knows anything or has anything to share that'd be great because I have no idea how to fix it