A few weeks ago (suddenly) all the sensors on my smartphone stopped working, (proximity, accelerometer, gyroscope, etc).
Look everywhere, I followed many guides and I could not make it work.
While searching I saw that several oneplus had problems with the sensors and the only solution they gave was to do a factory reset, hit the phone until it works or return it to the factory and wait for a replacement.
So I decided to check all the folders of the system and found the solution.
This .zip delete the sensor settings without wiping the data partition and also eliminates settings that aren't deleted with a full wipe (in persist folder).
The system will create these files again and the sensors will work again.
And here I leave them in the form of .zip flasheable.
I hope they solve the problem as I do. :P
Reboot in TWRP (Make a full backup) and flash the .zip
Downloads in attached files