Apps can collect a lot of data. Even if they don't have permission to access your GPS or camera, they can still read other sensors and learn a lot more than you'd think. Your gyroscope could be used as a keylogger. The light sensor could read your visited links. But if you're on Android 10, you don't need to worry about this.
Now, there's a hidden Quick Settings tile that will disable all of these extraneous sensors in a single tap. When you activate it, the proximity sensor, ambient light sensor, gyroscope, magnetometer, and all other sensors will stop recording data. Combine this with the existing toggles for Wi-Fi, Bluetooth, GPS, and others, and you can put an end to even the most creative digital spying techniques.
First, open the Settings app and select "About phone," then tap the "Build number" entry 7 times. When you do this, a message will pop up saying you are a developer. Type in your PIN when prompted and you will have unlocked an extra settings menu called "Developer options."
Now tap on "System" from within the Settings app, then choose "Advanced" and select "Developer options." Scroll down a tiny bit and select "Quick settings developer tiles." From there, enable the toggle next to "Sensors Off," then you'll immediately see a new toggle in your Quick Settings when you swipe down from the top of any page.
If you tap this "Sensors Off" button, it will turn off your compass, proximity sensor, accelerometer, gyroscope, and any other sensors. Bluetooth, Wi-Fi, and GPS are not affected since they have their own toggles. While your sensors are turned off, note that features that rely on them will be broken.