I would start here:
https://gitlab.com/ubports/community-ports/android9/xiaomi-mi-a2/xiaomi-jasmine_sprout