Home | History | Annotate | Download | only in xml
      1 <?xml version="1.0" encoding="utf-8"?>
      2 
      3 <!--
      4 This XML allows OEMs to configure a driving state to UX restrictions.  There are 2 major classes
      5 of configuration:
      6 1. Restriction Mapping as defined by the <restrictionMapping> tag.
      7 2. Restriction Parameters for restrictions that can be parametrized as defined by
      8    <restrictionParameters> tag.
      9 
     10 Note:
     11    1. The tags and attributes are declared in packages/services/Car/service/res/attrs.xml.
     12    2. The driving states defined there should align with driving states (@CarDrivingState) defined in
     13    packages/services/Car/car-lib/src/android/car/drivingstate/CarDrivingStateEvent.java
     14    3. Similarly the UX restrictions should align with
     15    packages/services/Car/car-lib/src/android/car/drivingstate/CarUxRestrictions.java
     16 -->
     17 
     18 <UxRestrictions xmlns:car="http://schemas.android.com/apk/res-auto">
     19     <!-- Map the driving states to UX restrictions here -->
     20     <!-- Note - The platform takes a fully restricted approach when there is no information or if
     21     the information is malformed.  As a result,
     22     1. Default values for requiresDistractionOptimization is true, and uxr is fully_restricted.
     23     2. If uxr != baseline, then requiresDistractionOptimization is automatically promoted to true,
     24     even if it is declared as false.  Because it doesn't make sense to have an non baseline UX
     25     restriction without requiresDistractionOptimization set to true.
     26     So if we don't want any restrictions, requiresDistractionOptimization should be explicitly
     27     marked as false and uxr should be explicitly set to baseline. -->
     28     <RestrictionMapping>
     29         <DrivingState car:state="parked">
     30             <Restrictions car:requiresDistractionOptimization="false" car:uxr="baseline"/>
     31         </DrivingState>
     32 
     33         <DrivingState car:state="idling">
     34             <Restrictions car:requiresDistractionOptimization="false" car:uxr="baseline"/>
     35         </DrivingState>
     36 
     37         <!-- This is to illustrate how to add multiple speed ranges.  The restrictions here
     38         are the same for both the speed ranges, but could be configured to be different.
     39         NOTE:
     40         1. The speed units is in meters per second to be in accordance with the
     41         PERF_VEHICLE SPEED definition in hardware/interfaces/automotive/vehicle/2.0/types.hal
     42         2. The speed ranges should be non overlapping, i.e one speed value cannot be in more
     43         than one range.  It is denoted in a left closed, right open interval [minSpeed, maxSpeed).
     44         For ex: [0,5) indicates speed >= 0 && speed < 5.0m/s.
     45         3. For a speed range with no high limit, maxSpeed is not filled.  For ex., if the speed
     46         range is anything >=5m/s, only the minSpeed is filled with a value of 5m/s.  There cannot be
     47         a range higher than this, which will violate the 2nd condition above.
     48         4. If the above conditions are not met, mapping behavior is undefined. -->
     49         <!-- This is restrictions for moving and speed [0,5m/s) -->
     50         <DrivingState car:state="moving" car:minSpeed="0" car:maxSpeed="5.0">
     51             <Restrictions car:requiresDistractionOptimization="true" car:uxr="fully_restricted"/>
     52         </DrivingState>
     53 
     54         <!-- Restrictions for speed >=5 -->
     55         <DrivingState car:state="moving" car:minSpeed="5.0">
     56             <Restrictions car:requiresDistractionOptimization="true" car:uxr="fully_restricted"/>
     57         </DrivingState>
     58 
     59     </RestrictionMapping>
     60 
     61     <!-- Configure restriction parameters here-->
     62     <RestrictionParameters>
     63         <!-- Parameters to express displayed String related restrictions -->
     64         <StringRestrictions car:maxLength="120"/>
     65         <!-- Parameters to express content related restrictions -->
     66         <ContentRestrictions car:maxCumulativeItems="21" car:maxDepth="3"/>
     67     </RestrictionParameters>
     68 
     69 </UxRestrictions>