Android car service配置

商宏爽
2023-12-01

       配置路径:

       https://cs.android.com/android/platform/superproject/+/master:packages/services/Car/service/res/values/config.xml

  • config_occupant_zones

主要是配置车上的每个zone对应的是什么角色(occupantType),这个zone在车上的位置(seatRow + seatSide共同决定)

下面是配置项说明:

   <!--

        Lists all occupant (= driver + passenger) zones available in the car.

        Some examples are:

        <item>occupantZoneId=0,occupantType=DRIVER,seatRow=1,seatSide=driver</item>

        <item>occupantZoneId=1,occupantType=FRONT_PASSENGER,seatRow=1,seatSide=oppositeDriver</item>

        <item>occupantZoneId=2,occupantType=REAR_PASSENGER,seatRow=2,seatSide=left</item>

        <item>occupantZoneId=3,occupantType=REAR_PASSENGER,seatRow=2,seatSide=right</item>

        occupantZoneId:

含义:全局唯一的ID (Unique unsigned integer id to represent each passenger zone. Each zone

                        should have different id.)

        occupantType:

        含义:乘客类型 (Occupant type for the display. Use * part from

                       CarOccupantZoneManager.OCCUPANT_TYPE_* like DRIVER, FRONT_PASSENGER,

                       REAR_PASSENGER and etc.)

        seatRow: 乘客在那一排 Integer telling which row the seat is located. Row 1 is for front seats.)

        seatSide: 乘客在那边的座位 left/center/right for known side. Or can use driver/center/oppositeDriver to

                  handle both right-hand driving and left-hand driving in one place.

                  If car's RHD / LHD is not specified, LHD will be assumed and driver side becomes

                  left.)

    -->

    <string-arraytranslatable="false"name="config_occupant_zones">

        <item>occupantZoneId=0,occupantType=DRIVER,seatRow=1,seatSide=driver</item>

    </string-array>

 

  • config_occupant_display_mapping

定义物理屏幕displayPort)的作用(displayType),以及属于哪个Zone(occupantZoneId),Zoneid必须和

config_occupant_zones中的id相匹配。

displayType的取值和作用参考CarOccupantZoneManager代码中的注释。

 

   <!--

        Specifies configuration of displays in system telling its usage / type and assigned

        occupant. DEFAULT_DISPLAY, if assigned here, should be always assigned to the DRIVER zone.

        Some examples are:

        <item>displayPort=0,displayType=MAIN,occupantZoneId=0</item>

        <item>displayPort=1,displayType=INSTRUMENT_CLUSTER,occupantZoneId=0</item>

        <item>displayPort=2,displayType=MAIN,occupantZoneId=1</item>

        <item>displayPort=3,displayType=MAIN,occupantZoneId=2</item>

        <item>displayUniqueId=virtual:com.example:MainD,displayType=MAIN,occupantZoneId=3</item>

        NOTE: each item should have displayPort or displayUniqueId, if it has both, displayPort

          will be used.

        displayPort: Unique Port id for the physical display.

        displayUniqueId: Unique Id for the display.

            The unique id of the virtual display will be the form of 'virtual:<PACKAGE>:<ID>'.

        displayType: Display type for the display. Use * part from

                       CarOccupantZoneManager.DISPLAY_TYPE_* like MAIN, INSTRUMENT_CLUSTER and

                       etc.

        occupantZoneId: occupantZoneId specified from config_occupant_zones.

    -->

    <string-arraytranslatable="false"name="config_occupant_display_mapping">

    </string-array>

 

 

 

  • config_occupant_display_mapping
  • config_occupant_zones
  • Android car service相关的配置
 类似资料: