1<?xml version="1.0" encoding="utf-8"?> 2 3<!-- 4This XML allows OEMs to configure a driving state to UX restrictions. There are 2 major classes 5of configuration: 61. Restriction Mapping as defined by the <restrictionMapping> tag. 72. Restriction Parameters for restrictions that can be parametrized as defined by 8 <restrictionParameters> tag. 9 10Note: 11 The tags and attributes are declared in 12 packages/services/Car/service/src/com/android/car/CarUxRestrictionsConfigurationXmlParser.java 13 Supported tags and attribute for each tag - 14 - UxRestrictions (Starting tag, defines the UX restrictions to be imposed for different 15 driving states of a vehicle) 16 - RestrictionMapping (Tag 1. UX restriction Mapping from a driving state of the vehicle) 17 - physicalPort (Attribute. Physical port that connects 18 to a display. Restrictions defined will apply to the display that connects to this 19 port. Only the lowest byte in the integer value is used. The value should be 20 interpreted as an signed int, namely the supported range is [-128, 127]. 21 Optional field. 'physicalPort' is one way of specifying a display in the context of 22 UX restrictions. The combination of 'occupantZoneId' and 'displayType' is another way 23 of identifying a display. When 'physicalPort' is specified, 'occupantZoneId and 24 'displayType' should not be specified. If neither 'physicalPort' nor the combination 25 of 'occupantZoneId' and 'displayType' is specified, it defaults to the driver main 26 display. ) 27 - occupantZoneId (Attribute. The id of the car occupant zone this display is in. 28 Optional field. The combination of 'occupantZoneId and 'displayType' is another way of 29 identifying a display. When 'occupantZoneId' is specified, 'displayType' should also 30 be specified while 'physicalPort' should not be specified. ) 31 - displayType (Attribute. The type of the display in the occupant zone specified by 32 'occupantZoneId'. The integer values are defined in 33 packages/services/Car/car-lib/src/android/car/CarOccupantZoneManager.java. 34 Optional field. The combination of 'occupantZoneId and 'displayType' is another way of 35 identifying a display. When 'displayType' is specified, 'occupantZoneId' should also 36 be specified while 'physicalPort' should not be specified. ) 37 - DrivingState (Tag 1.a. Driving states supported) 38 - state (Attribute. The driving states defined there should align with driving states 39 (@CarDrivingState) defined in 40 packages/services/Car/car-lib/src/android/car/drivingstate/CarDrivingStateEvent.java 41 Supported driving states attribute values - "parked", "idling" and "moving" 42 - minSpeed (Attribute) 43 - maxSpeed (Attribute. Minimum and Maximum speed attributes 44 useful to provide different restrictions for different speed ranges) 45 - Restrictions (Tag 1.b. UX restriction types) 46 - requiresDistractionOptimization (Attribute. This corresponds to what 47 CarUxRestrictions#mRequiresDistractionOptimization needs to be set to. This means that 48 apps will have to follow the general baseline distraction optimization rules defined in 49 the Driver Distraction Guidelines. ) 50 - uxr (Attribute. These are the additional UX restrictions that OEMs can configure in 51 addition to the baseline restrictions defined in the above 52 requiresDistractionOptimization. The values here have to align with the UX 53 Restrictions defined in 54 packages/services/Car/car-lib/src/android/car/drivingstate/CarUxRestrictions.java. 55 Supported values are -"baseline", "no_dialpad", "no_filtering", "limit_string_length", 56 "no_keyboard", "no_video", "limit_content", "no_setup", "no_text_message", 57 "no_voice_transcription", "fully_restricted". ) 58 - mode (Attribute. Supported attribute for Restrictions. UX restrictions service 59 supports returning different sets of UX restrictions for the same driving state, 60 through configurations for each "mode". These modes can be specified by any string 61 name, for example, "passenger". "baseline" is the default value. Note: "passenger" 62 mode can be generically supported by specifying UxR for passenger displays using 63 'physicalPort' or the combination of 'occupantZoneId' and 'displayType'. 64 - RestrictionParameters (Tag 2. Some of UX restrictions can be parametrized) 65 - StringRestrictions (Tag 2.a. Parameters to express displayed String related restrictions) 66 - maxLength (Attribute. Max allowed length of general purpose strings when 67 limit_string_length is imposed) 68 - ContentRestrictions (Tag 2.b. Parameters to express content related restrictions) 69 - maxCumulativeItems (Attribute. Max number of cumulative content items allowed to be 70 displayed when (limit_content is imposed) 71 - maxDepth (Attribute. Maximum levels deep that the user can navigate to when 72 limit_content is imposed) 73--> 74 75<UxRestrictions xmlns:car="http://schemas.android.com/apk/res-auto"> 76 <!-- Map the driving states to UX restrictions here --> 77 <!-- Note - The platform takes a fully restricted approach when there is no information or if 78 the information is malformed. As a result, 79 1. Default values for requiresDistractionOptimization is true, and uxr is fully_restricted. 80 2. If uxr != baseline, then requiresDistractionOptimization is automatically promoted to true, 81 even if it is declared as false. Because it doesn't make sense to have an non baseline UX 82 restriction without requiresDistractionOptimization set to true. 83 So if we don't want any restrictions, requiresDistractionOptimization should be explicitly 84 marked as false and uxr should be explicitly set to baseline. --> 85 86 <RestrictionMapping> 87 <DrivingState state="parked"> 88 <Restrictions requiresDistractionOptimization="false" uxr="baseline"/> 89 </DrivingState> 90 91 <DrivingState state="idling"> 92 <Restrictions requiresDistractionOptimization="false" uxr="baseline" mode="baseline"/> 93 </DrivingState> 94 95 <!-- This is to illustrate how to add multiple speed ranges. The restrictions here 96 are the same for both the speed ranges, but could be configured to be different. 97 NOTE: 98 1. The speed units is in meters per second to be in accordance with the 99 PERF_VEHICLE SPEED definition in hardware/interfaces/automotive/vehicle/2.0/types.hal 100 2. The speed ranges should be non overlapping, i.e one speed value cannot be in more 101 than one range. It is denoted in a left closed, right open interval [minSpeed, maxSpeed). 102 For ex: [0,5) indicates speed >= 0 && speed < 5.0m/s. 103 3. For a speed range with no high limit, maxSpeed is not filled. For ex., if the speed 104 range is anything >=5m/s, only the minSpeed is filled with a value of 5m/s. There cannot be 105 a range higher than this, which will violate the 2nd condition above. 106 4. If the above conditions are not met, mapping behavior is undefined. --> 107 <!-- This is restrictions for moving and speed [0,5m/s) --> 108 <DrivingState state="moving" minSpeed="0" maxSpeed="5.0"> 109 <Restrictions requiresDistractionOptimization="true" uxr="no_dialpad|no_filtering|limit_string_length|no_keyboard|no_video|limit_content|no_setup|no_text_message"/> 110 </DrivingState> 111 112 <!-- Restrictions for speed >=5 --> 113 <DrivingState state="moving" minSpeed="5.0"> 114 <Restrictions requiresDistractionOptimization="true" uxr="no_dialpad|no_filtering|limit_string_length|no_keyboard|no_video|limit_content|no_setup|no_text_message"/> 115 </DrivingState> 116 117 </RestrictionMapping> 118 119 <!-- Configure restriction parameters here--> 120 <RestrictionParameters> 121 <!-- Parameters to express displayed String related restrictions --> 122 <!-- Max allowed length of general purpose strings when limit_string_length is imposed--> 123 <StringRestrictions maxLength="120"/> 124 <!-- Parameters to express content related restrictions --> 125 <!-- Max number of cumulative content items allowed to be displayed when 126 limit_content is imposed. --> 127 <!-- Maximum levels deep that the user can navigate to when limit_content is imposed. --> 128 <ContentRestrictions maxCumulativeItems="21" maxDepth="3"/> 129 </RestrictionParameters> 130 131</UxRestrictions> 132