I am writing an app that has some notifications. I want the notifications to be postponed if the phone is in Android Auto driving mode, because the driver wouldn't be able to take any actions anyways. And further more, if it's in the middle of a navigation, I want to postpone until the ETA of the current route.
In my imagination, it is implemented like this:
void onAlarm() {
if (AndroidAutoAPI.isInDrivingMode())
snoozeUntil(AndroidAutoAPI.getCurrentETA());
else
getSystemService(NotificationManager.class).notify(...);
}
But I couldn't find any documentation on any APIs as such. Are they available at all?