Almost two years ago, the ‘Do Not Disturb’ feature was deleted from Android 6.0.1 Marshmallow. That’s one helpful feature but we had no idea why it was removed. It appears to be back as the DND mode when we noted how the Pixel 2 seems to know when you are driving. It makes more sense for a device to switch to DND mode but there may be apps that need to still work while you are moving and driving.
There are driving or navigational apps that have to function. To make sure apps are working properly and Android devices are responding correctly, Google has introduced a Driving Do-Not-Disturb API.
We first encountered this Driving Do-Not-Disturb on the Pixel 2 phones. What the feature does is to silence any incoming calls, messages, or notifications. This makes driving safer for most people. What’s good about this is that you can receive calls, hear voice interactions, and listen to navigation directions over Bluetooth. Distraction is limited while driving but navigation is still made efficient.
Making all these possible is Activity Recognition that knows when a user is driving. It uses low power signals from WiFi, Bluetooth, and multiple sensors. It takes advantage of the Android Sensor Hub that ensures low latency, low power and accurate driving detection as described. In the coming year, Google will also be launching the Activity Recognition Transition API to allow more efficiency among apps and devices, enabling distraction-free driving all the time.
SOURCE: Android Developers Blog