Last year, Google detailed how the Pixel 2’s Driving Do-Not-Disturb mode can intelligently silence incoming notifications when you’re in a moving vehicle. This feature is powered by the Activity Recognition Transition API that is now available to all developers and apps.

Android’s Activity Recognition API works by processing a device’s sensor data through machine learning models without draining resources or battery life. The Transition API is specifically focussed on detecting when users start or stop an activity.

Google notes that this is not a simple problem, especially in the case of driving:

How can you tell if stillness means the user parked their car and ended a drive or simply stopped at a traffic light and will continue on? Should you trust a spike in a non-driving activity or is it a momentary classification error?

To arrive at this point, the company trained machine learning models and used algorithmic filtering “to confidently detect these changes in user activity.” Available to all developers, it can detect when users are not moving, walking, running, on a bicycle, or in a vehicle. It takes care of all the processing work and simply informs apps when a user’s activity has changed.

With this API, Google hopes that developers will no longer have to rely on bespoke solutions that are not as battery efficient and require time and effort to develop. In the future, Google will add more context aware features like differentiating between road and rail vehicles.

Check out 9to5Google on YouTube for more news:

FTC: We use income earning auto affiliate links. More.

Check out 9to5Google on YouTube for more news:

You’re reading 9to5Google — experts who break news about Google and its surrounding ecosystem, day after day. Be sure to check out our homepage for all the latest news, and follow 9to5Google on Twitter, Facebook, and LinkedIn to stay in the loop. Don’t know where to start? Check out our exclusive stories, reviews, how-tos, and subscribe to our YouTube channel

About the Author

Abner Li

Editor-in-chief. Interested in the minutiae of Google and Alphabet. Tips/talk: abner@9to5g.com