Hacker News new | past | comments | ask | show | jobs | submit login

Yes. Activity detection is performed by occasionally sampling the the accelerometer in android phones. IIRC, it is turned on for a few seconds every 60 seconds or so, and the samples are sent through a rather simple ML model that produces: {activity as one of: {biking, walking, running, driving, motorcycling, unknown, <a few i do not remember>}, confidence: float [0..1)} . Source: worked on this long ago at Google.



How does one turn this off?


On Android, if you go into Permissions, your Google Maps app will probably have 'Physical Activity' as an allowed permission. You can change it to 'Deny'. In fact you can do the same for 'Google Maps' and 'Google'.

Weather that permission denying actually blocks accelerometer access to the app or simply stops it being associated with your profile is beyond me.

At least on Pixel I cannot deny 'Google Play Services' from access Physical Activity so it seems like a feel good permission and they still grab whatever data they want.

Perhaps someone working in Maps can answer that?


The actual processing happens on a microcontroller, not on the main application core. In some cases it is a small hexagon core on the main CPU, in other cases an actually separate Cortex-M3 (or the like). Doing this sort of thing on the main CPU would cause too much power draw due to frequent wakes.

The microcontroller OS code lives here: https://android.googlesource.com/device/google/contexthub/+/... It supports loading binary "micro-apps" (with optional encryption and/or signing) and provides them an API to use to gain sensor data access. Sensor drivers are also loaded as micro-apps. As is the "communicate with the main android CPU" code. It is also a micro-app. The OS itself is little more than an event loop, some power management, timer provider, and the loader of micro-apps in a particular format.

Activity detection is one of such micro-apps and is, as far as I know, not itself open source.

Source: I was the TL for this project back in the day




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: