Wednesday, 14 April 2021

How to Access android.hardware.SensorPrivacyManager in Android Studio?

I am trying to make an Android app that creates a Quick Settings Tile to toggle on & off all sensors. In essence, I am trying to recreate the 'Sensors Off' tile available in Developer Settings. (Because developer settings, & hence the tile, is only available to the main profile, not other user profiles--I am on GrapheneOS.)

According to the documentation for Sensors Off at https://source.android.com/devices/sensors/sensors-off , the tile is implemented using android.hardware.SensorPrivacyManager. However, in the Android SDK (30) in Android Studio, there is no android.hardware.SensorPrivacyManager available. There appears to be very little documentation of this. How can I access this manager in my app?



from How to Access android.hardware.SensorPrivacyManager in Android Studio?

No comments:

Post a Comment