[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] -+BB+-:
There's a pocket mode like all other ROMs, it' s in ambient display section, but I don't know if will work for your case, as DTTW works in conjuction with power HAL, not ambient display. This is the default implementation for basically all custom ROMs for Grus. BTW it's strange, DTTW should not work when the phone is in your pocket

Thanks, really <3

No time wasted, don't worry, I've also picked some useful stuffs from your branches for my Gemini and Grus, but if you need me ping me on GitHub, this discussion is for PE ROM, but I have no problem at all on Git if I can help :)

Yes

Hi, do you have a link for MIUI and ANX camera? I will take a look at them (at least to see why it doesn't install properly). Regarding HDR processing on GCAM i'm aware of that and I agree with you, I had to take some photos at work in these days and I wanted to launch the phone on the wall a couple of times. I probably understood what's wrong in GCAM, but there's nothing i can do on device side to fix/mitigate that, here's a quote of my message some days ago in Gemini thread:

Additionally, I don't know what QCOM/Xiaomi did on sdm710 dsp, but while all other devices I'm using (msm8996, msm8998, sm6150) has the same identical behaviour [try to load the lib --> signature check fail --> fallback to CPU processing] sdm710 do something different, which is the root cause of our issue [try to load the lib --> signature check fail --> dsp tries again and again to load the lib and obviously fails everytime --> after a random number of failed attempts fallback to CPU processing] This behaviour it's causing the delay in HDR processing, I've tested with Shamim GCAM and disabling hexagon processing from options fixes it.

NOTE: there's a small possibility that we can succesfully use dsp for HDR processing, if libhalide_hexagon_host.so and libhalide_hexagon_remote_skel.so provided by Google on their Pixel has been signed by QCOM then MAY work for our device too (or at least we should be able to pass signature check), i can take a look at them, will require some SEPolicy changes but with selinux permissive add the libs and expose them in public.libraries.txt should be enough, the problem is that modded GCAMs must use them instead the prebuilt version provided with the apk. I can test the libs with QCOM examples, but will probably won't work with GCAM, we need an updatd version that use the ROM libs

That's absolutely a legit question, and no, you did not offend me :) Talking about security, I'm shipping a ROM with sources updated to latest AOSP tag, and I've also merged CVE fixes on kernel side, the device is updated like official Pixel phones. There are some compromises on SELinux policy and other parts of the ROM, because this is a legacy device, we don't have updated proprietary blobs, and some stuffs needs legacy code removed from AOSP sources or works in a totally different way than recent phones, but we are running SELinux in enforcing mode (QCOM provide sepolicy rules for legacy devices too), we have a good security level. Regarding the trojan in firmware/dsp as far as i know this is something that only an OEM can do, I don't have QCOM/Xiaomi signing key, if I put something on dsp it will be rejected (basically the same issue we have with Hexagon processing on GCAM), and I'm not shipping the modem firmware with the ROM, you use the stock firmware provided by Xiaomi.

It would be possible to embed a trojan/malware on ROM side, but for this reason the code is 100% public, you are totally free to review it and compile it by yourself, it's pretty simple, you only need a linux distro, 600 Gb free on an ssd, at least 18/20 Gb of RAM (or add a swap space to reach at least 18/20 Gb of RAM+Swap), and some hours for compiling (depends on your CPU), it's rather easy, just replace PE audio/video/media repos in hardware/qcom-caf/sdm845 with LOS version because PE repos are broken for sdm710 and build fails. hardware/xiaomi repo must be manually downloaded at the moment, but i will add the dependency to dt so it will be downloaded automatically. You can build both stock/plus version with my repos, links are in the OP

PS: if you are interested, i was reading some days ago an analysis made by Check Point Research on DSP vulnerabilities, there is a great explanation about how QCOM DSP works and the security implications