packages/services/Car/service/res/xml/car_ux_restrictions_map.xml

115 lines
7.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
This XML allows OEMs to configure a driving state to UX restrictions. There are 2 major classes
of configuration:
1. Restriction Mapping as defined by the <restrictionMapping> tag.
2. Restriction Parameters for restrictions that can be parametrized as defined by
<restrictionParameters> tag.
Note:
The tags and attributes are declared in
packages/services/Car/service/src/com/android/car/CarUxRestrictionsConfigurationXmlParser.java
Supported tags and attribute for each tag -
- UxRestrictions (Starting tag, defines the UX restrictions to be imposed for different
driving states of a vehicle)
- RestrictionMapping (Tag 1. UX restriction Mapping from a driving state of the vehicle)
- physicalPort (Attribute. Physical port that connects
to a display. Restrictions defined will apply to the display that connects to this
port. Only the lowest byte in the integer value is used. The value should be
represented as an signed int, namely the supported range is [-128, 127].
Optional field. Defaults to primary display. )
- DrivingState (Tag 1.a. Driving states supported)
- state (Attribute. The driving states defined there should align with driving states
(@CarDrivingState) defined in
packages/services/Car/car-lib/src/android/car/drivingstate/CarDrivingStateEvent.java
Supported driving states attribute values - "parked", "idling" and "moving"
- minSpeed (Attribute)
- maxSpeed (Attribute. Minimum and Maximum speed attributes
useful to provide different restrictions for different speed ranges)
- Restrictions (Tag 1.b. UX restriction types)
- requiresDistractionOptimization (Attribute. This corresponds to what
CarUxRestrictions#mRequiresDistractionOptimization needs to be set to. This means that
apps will have to follow the general baseline distraction optimization rules defined in
the Driver Distraction Guidelines.
- uxr (Attribute. These are the additional UX restrictions that OEMs can configure in
addition to the baseline restrictions defined in the above
requiresDistractionOptimization. The values here have to align with the UX
Restrictions defined in
packages/services/Car/car-lib/src/android/car/drivingstate/CarUxRestrictions.java.
Supported values are -"baseline", "no_dialpad", "no_filtering", "limit_string_length",
"no_keyboard", "no_video", "limit_content", "no_setup", "no_text_message",
"no_voice_transcription", "fully_restricted".
- mode (Attribute. Supported attribute for Restrictions. UX restrictions service
supports returning different sets of UX restrictions for the same driving state,
through configurations for each "mode". These modes can be specified by any string
name, for example, "passenger". "baseline" is the default value.
- RestrictionParameters (Tag 2. Some of UX restrictions can be parametrized)
- StringRestrictions (Tag 2.a. Parameters to express displayed String related restrictions)
- maxLength (Attribute. Max allowed length of general purpose strings when
limit_string_length is imposed)
- ContentRestrictions (Tag 2.b. Parameters to express content related restrictions)
- maxCumulativeItems (Attribute. Max number of cumulative content items allowed to be
displayed when (limit_content is imposed)
- maxDepth (Attribute. Maximum levels deep that the user can navigate to when
limit_content is imposed)
-->
<UxRestrictions xmlns:car="http://schemas.android.com/apk/res-auto">
<!-- Map the driving states to UX restrictions here -->
<!-- Note - The platform takes a fully restricted approach when there is no information or if
the information is malformed. As a result,
1. Default values for requiresDistractionOptimization is true, and uxr is fully_restricted.
2. If uxr != baseline, then requiresDistractionOptimization is automatically promoted to true,
even if it is declared as false. Because it doesn't make sense to have an non baseline UX
restriction without requiresDistractionOptimization set to true.
So if we don't want any restrictions, requiresDistractionOptimization should be explicitly
marked as false and uxr should be explicitly set to baseline. -->
<RestrictionMapping>
<DrivingState state="parked">
<Restrictions requiresDistractionOptimization="false" uxr="baseline"/>
</DrivingState>
<DrivingState state="idling">
<Restrictions requiresDistractionOptimization="false" uxr="baseline" mode="baseline"/>
</DrivingState>
<!-- This is to illustrate how to add multiple speed ranges. The restrictions here
are the same for both the speed ranges, but could be configured to be different.
NOTE:
1. The speed units is in meters per second to be in accordance with the
PERF_VEHICLE SPEED definition in hardware/interfaces/automotive/vehicle/2.0/types.hal
2. The speed ranges should be non overlapping, i.e one speed value cannot be in more
than one range. It is denoted in a left closed, right open interval [minSpeed, maxSpeed).
For ex: [0,5) indicates speed >= 0 && speed < 5.0m/s.
3. For a speed range with no high limit, maxSpeed is not filled. For ex., if the speed
range is anything >=5m/s, only the minSpeed is filled with a value of 5m/s. There cannot be
a range higher than this, which will violate the 2nd condition above.
4. If the above conditions are not met, mapping behavior is undefined. -->
<!-- This is restrictions for moving and speed [0,5m/s) -->
<DrivingState state="moving" minSpeed="0" maxSpeed="5.0">
<Restrictions requiresDistractionOptimization="true" uxr="no_dialpad|no_filtering|limit_string_length|no_keyboard|no_video|limit_content|no_setup|no_text_message"/>
</DrivingState>
<!-- Restrictions for speed >=5 -->
<DrivingState state="moving" minSpeed="5.0">
<Restrictions requiresDistractionOptimization="true" uxr="no_dialpad|no_filtering|limit_string_length|no_keyboard|no_video|limit_content|no_setup|no_text_message"/>
</DrivingState>
</RestrictionMapping>
<!-- Configure restriction parameters here-->
<RestrictionParameters>
<!-- Parameters to express displayed String related restrictions -->
<!-- Max allowed length of general purpose strings when limit_string_length is imposed-->
<StringRestrictions maxLength="120"/>
<!-- Parameters to express content related restrictions -->
<!-- Max number of cumulative content items allowed to be displayed when
limit_content is imposed. -->
<!-- Maximum levels deep that the user can navigate to when limit_content is imposed. -->
<ContentRestrictions maxCumulativeItems="21" maxDepth="3"/>
</RestrictionParameters>
</UxRestrictions>