[Redmi K20 Pro / Xiaomi Mi 9T Pro ROMs, Kernels, Re] hopeisaprison:
I build telegram and found native camera code issues.

2021-11-20 21:03:11.387 1311-31627/? E/Camera2-Parameters: Error finding static metadata entry 'android.distortionCorrection.availableModes' (1b0001)
2021-11-20 21:03:11.391 810-810/? E/CamX: [ERROR][HAL ] camxhaldevice.cpp:1361 DumpFrameworkRequests() +----------------------------------------------+
2021-11-20 21:03:11.398 810-810/? E/CHIUSECASE: [ERROR ] chxperf.cpp:1093 AcquirePerfLock() Acquire perflock failed
2021-11-20 21:03:11.398 810-810/? E/CHIUSECASE: [ERROR ] chxperf.cpp:834 AcquirePerfLock() Failed to acquire perflock type: 1
2021-11-20 21:03:11.398 810-810/? E/CHIUSECASE: [ERROR ] chxextensionmodule.cpp:2111 ModifySettings() Skip Modify Setting pExtend->numTokens=8 Val=0
2021-11-20 21:03:11.398 810-810/? E/CamX: [ERROR][HAL ] camxhaldevice.cpp:1361 DumpFrameworkRequests() +----------------------------------------------+
2021-11-20 21:03:11.398 810-810/? E/CamX: [ERROR][HAL ] camxhal3module.cpp:147 ReleaseTorchForCamera() Facing = 0.
2021-11-20 21:03:11.398 810-810/? E/CamX: [ERROR][HAL ] camxhal3module.cpp:153 ReleaseTorchForCamera() sensor: 0, logicalCameraId: 0, facing: 0
2021-11-20 21:03:11.398 810-810/? E/CamX: [ERROR][HAL ] camxhal3module.cpp:153 ReleaseTorchForCamera() sensor: 1, logicalCameraId: 0, facing: 1
2021-11-20 21:03:11.398 810-810/? E/CamX: [ERROR][HAL ] camxhal3module.cpp:153 ReleaseTorchForCamera() sensor: 2, logicalCameraId: 0, facing: 0
2021-11-20 21:03:11.398 810-810/? E/CamX: [ERROR][HAL ] camxhal3module.cpp:153 ReleaseTorchForCamera() sensor: 3, logicalCameraId: 0, facing: 0
2021-11-20 21:03:11.399 810-810/? E/CamX: [ERROR][HAL ] camxhal3module.cpp:153 ReleaseTorchForCamera() sensor: 4, logicalCameraId: 0, facing: 0
2021-11-20 21:03:11.399 810-810/? E/CamX: [ERROR][HAL ] camxhal3module.cpp:153 ReleaseTorchForCamera() sensor: 5, logicalCameraId: 0, facing: 0
2021-11-20 21:03:11.399 810-810/? E/CamX: [ERROR][HAL ] camxhal3module.cpp:153 ReleaseTorchForCamera() sensor: 6, logicalCameraId: 0, facing: 0
2021-11-20 21:03:11.399 810-810/? E/CamX: [ERROR][HAL ] camxhal3module.cpp:153 ReleaseTorchForCamera() sensor: 7, logicalCameraId: 0, facing: 0
2021-11-20 21:03:11.399 810-810/? E/CamX: [ERROR][HAL ] camxhal3module.cpp:153 ReleaseTorchForCamera() sensor: 8, logicalCameraId: 0, facing: 0
2021-11-20 21:03:11.399 810-810/? E/CamX: [ERROR][HAL ] camxhal3module.cpp:153 ReleaseTorchForCamera() sensor: 9, logicalCameraId: 0, facing: 0
2021-11-20 21:03:11.399 810-810/? E/CamX: [ERROR][HAL ] camxhal3module.cpp:153 ReleaseTorchForCamera() sensor: 10, logicalCameraId: 0, facing: 1
2021-11-20 21:03:11.399 810-810/? E/CamX: [ERROR][HAL ] camxhaldevice.cpp:1155 CloseCachedSensorHandles() pSensorDeviceCache=NULL for Logical CameraID=0, PhysicalID=0
2021-11-20 21:03:11.404 810-810/? E/CamX: [ERROR][HAL ] camxhal3module.cpp:121 ReserveTorchForCamera() Facing = 1.
2021-11-20 21:03:11.404 1311-31627/? E/CameraService: onTorchStatusChangedLocked: cannot get torch status of camera 1: No such file or directory (-2)
2021-11-20 21:03:11.404 1311-31627/? E/CameraService: onTorchStatusChangedLocked: cannot get torch status of camera 10: No such file or directory (-2)