I am wondering if there is an exposed SDK or way to read from android framework/kernel to read number of sensor requests per application or given an UID or PID.
Asked
Active
Viewed 27 times
1 Answers
0
If you're talking about sensors like accelerator for example, there is no way to do it (and it would be a security concern if there was) without modifying AOSP code and burning your own ROM with this feature enabled (check out ssize_t SensorDevice::poll(sensors_event_t* buffer, size_t count)
and related methods in frameworks/native/services/sensorservice
).
There may be some way to do it with root privileges, but I couldn't find one due to HAL abstraction in the AOSP platform (root user can access the low level driver and monitor access to it, but it will have no way of telling which application used it because it is abstracted).

Ishay Peled
- 2,783
- 1
- 23
- 37