When Android Automotive apps follow the Driver Distraction Guidelines described below, the apps can run on the HU when a vehicle is moving. DDG consists of baseline recommendations provided by Google and are intended to reduce driver distraction.
Apps that meet the Driver Distraction Guidelines can be tagged as Distraction Optimized. This page details how apps must be tagged as Distraction Optimized so that the Android platform can enable the apps to run in the User Experience Restricted state. To learn more about:
- Car user experience restrictions, see Car User Experience Restrictions.
- Using car driving state, see Consuming Car Driving State and UX Restrictions.
Distraction Optimized apps
An app can tag a specific activity to be Distraction Optimized. For an entire app to be designated as Distraction Optimized, all its activities must adhere to the driver distraction guidelines. When the driving state of a vehicle changes to a state in which the UX restrictions are active:
- Current foreground activity can continue to run only when it is tagged as Distraction Optimized in the manifest.
- When launching a new activity, the new activity is permitted only when it is tagged as Distraction Optimized in the manifest.
The platform is responsible for checking the manifest and allowing only Distraction Optimized activities to run in a restricted state.
Note: The platform can't detect or enforce an app's actual adherence to the restrictions; it can only check an app's declaration in the manifest. Adherence to these driver distraction guidelines is enforced during the Google Play review process.
Not all app activities need be Distraction Optimized. An app can provide
different user experiences for an unrestricted state (for example, when the vehicle is parked)
versus a more restricted state. As a result, an app can tag a specific activity to be
Distraction Optimized by adding the following metadata to the <activity>
element
in the AndroidManifest.xml
file for the app:
<activity android:name=".DistractionOptimizedMainActivity"....> .... <meta-data android:name="distractionOptimized" android:value="true"/> </activity>
Apps that offer activities designed to run in a restricted state must declare that information in the manifest. The platform looks only at the declared information before determining if the activity can be permitted to run (or not) in the restricted state.