# CarOccupantZoneManager

Summary:[Nested Classes](https://developer.android.com/reference/android/car/CarOccupantZoneManager#nestedclasses)\|[Constants](https://developer.android.com/reference/android/car/CarOccupantZoneManager#constants)\|[Methods](https://developer.android.com/reference/android/car/CarOccupantZoneManager#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/car/CarOccupantZoneManager#inhmethods)  

# CarOccupantZoneManager

`
public


class
CarOccupantZoneManager
`  
`

extends Object


``


`

|---|------------------------------------|
| java.lang.Object                      ||
| ↳ | android.car.CarOccupantZoneManager |

<br />

*** ** * ** ***

API to get information on displays and users in the car.

From car version[CarVersion.VERSION_CODES.UPSIDE_DOWN_CAKE_0](https://developer.android.com/reference/android/car/CarVersion.VERSION_CODES#UPSIDE_DOWN_CAKE_0), system without the driver zone is allowed and the current user will not be the driver.

## Summary

|                                                                                                                ### Nested classes                                                                                                                ||
|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` interface` | [CarOccupantZoneManager.OccupantZoneConfigChangeListener](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneConfigChangeListener) Listener to monitor any Occupant Zone configuration change. |
| ` class`     | [CarOccupantZoneManager.OccupantZoneInfo](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneInfo) Represents an occupant zone in a car.                                                       |

|                                                                                                                                                 ### Constants                                                                                                                                                  ||
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [DISPLAY_TYPE_AUXILIARY](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_AUXILIARY) Auxiliary display which can provide additional screen for[DISPLAY_TYPE_MAIN](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_MAIN). |
| `int` | [DISPLAY_TYPE_HUD](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_HUD) Head Up Display.                                                                                                                                                                        |
| `int` | [DISPLAY_TYPE_INPUT](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_INPUT) Dedicated display for showing IME for[DISPLAY_TYPE_MAIN](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_MAIN)                              |
| `int` | [DISPLAY_TYPE_INSTRUMENT_CLUSTER](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_INSTRUMENT_CLUSTER) Instrument cluster display.                                                                                                                               |
| `int` | [DISPLAY_TYPE_MAIN](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_MAIN) Main display users are interacting with.                                                                                                                                              |
| `int` | [DISPLAY_TYPE_UNKNOWN](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_UNKNOWN) Display type is not known.                                                                                                                                                      |
| `int` | [INVALID_USER_ID](https://developer.android.com/reference/android/car/CarOccupantZoneManager#INVALID_USER_ID) Invalid user ID.                                                                                                                                                                          |
| `int` | [OCCUPANT_TYPE_DRIVER](https://developer.android.com/reference/android/car/CarOccupantZoneManager#OCCUPANT_TYPE_DRIVER) Represents the driver.                                                                                                                                                          |
| `int` | [OCCUPANT_TYPE_FRONT_PASSENGER](https://developer.android.com/reference/android/car/CarOccupantZoneManager#OCCUPANT_TYPE_FRONT_PASSENGER) Represents front passengers who sit in front side of car.                                                                                                     |
| `int` | [OCCUPANT_TYPE_REAR_PASSENGER](https://developer.android.com/reference/android/car/CarOccupantZoneManager#OCCUPANT_TYPE_REAR_PASSENGER) Represents passengers in rear seats.                                                                                                                            |
| `int` | [ZONE_CONFIG_CHANGE_FLAG_AUDIO](https://developer.android.com/reference/android/car/CarOccupantZoneManager#ZONE_CONFIG_CHANGE_FLAG_AUDIO) Zone config change caused by audio zone change.                                                                                                               |
| `int` | [ZONE_CONFIG_CHANGE_FLAG_DISPLAY](https://developer.android.com/reference/android/car/CarOccupantZoneManager#ZONE_CONFIG_CHANGE_FLAG_DISPLAY) Zone config change caused by display changes.                                                                                                             |
| `int` | [ZONE_CONFIG_CHANGE_FLAG_USER](https://developer.android.com/reference/android/car/CarOccupantZoneManager#ZONE_CONFIG_CHANGE_FLAG_USER) Zone config change caused by user change.                                                                                                                       |

|                                                                                                                                                                                                                                                                                                                ### Public methods                                                                                                                                                                                                                                                                                                                ||
|---------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` List<Display>`                                                                                                                                  | ` `[getAllDisplaysForOccupant](https://developer.android.com/reference/android/car/CarOccupantZoneManager#getAllDisplaysForOccupant(android.car.CarOccupantZoneManager.OccupantZoneInfo))`(`[CarOccupantZoneManager.OccupantZoneInfo](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneInfo)` occupantZone) ` Returns all displays assigned for the given occupant zone.                                                                                |
| ` List<`[CarOccupantZoneManager.OccupantZoneInfo](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneInfo)`>` | ` `[getAllOccupantZones](https://developer.android.com/reference/android/car/CarOccupantZoneManager#getAllOccupantZones())`() ` Returns all available occupants in the system.                                                                                                                                                                                                                                                                                                                |
| ` Display`                                                                                                                                        | ` `[getDisplayForOccupant](https://developer.android.com/reference/android/car/CarOccupantZoneManager#getDisplayForOccupant(android.car.CarOccupantZoneManager.OccupantZoneInfo,%20int))`(`[CarOccupantZoneManager.OccupantZoneInfo](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneInfo)` occupantZone, int displayType) ` Gets the display for the occupant for the specified display type, or returns`null`if no display matches the requirements. |
| ` int`                                                                                                                                            | ` `[getDisplayType](https://developer.android.com/reference/android/car/CarOccupantZoneManager#getDisplayType(android.view.Display))`(Display display) ` Returns assigned display type for the display.                                                                                                                                                                                                                                                                                       |
| ` `[CarOccupantZoneManager.OccupantZoneInfo](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneInfo)         | ` `[getMyOccupantZone](https://developer.android.com/reference/android/car/CarOccupantZoneManager#getMyOccupantZone())`() ` Returns[OccupantZoneInfo](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneInfo)for the calling process's android user.                                                                                                                                                                                                     |
| ` `[CarOccupantZoneManager.OccupantZoneInfo](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneInfo)         | ` `[getOccupantZone](https://developer.android.com/reference/android/car/CarOccupantZoneManager#getOccupantZone(int,%20int))`(int occupantType, int seat) ` Finds`OccupantZoneInfo`for the given occupant type and seat.                                                                                                                                                                                                                                                                      |
| ` `[CarOccupantZoneManager.OccupantZoneInfo](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneInfo)         | ` `[getOccupantZoneForUser](https://developer.android.com/reference/android/car/CarOccupantZoneManager#getOccupantZoneForUser(android.os.UserHandle))`(UserHandle user) ` Returns`OccupantZoneInfo`associated with the given`UserHandle`.                                                                                                                                                                                                                                                     |
| ` List<Integer>`                                                                                                                                  | ` `[getSupportedInputTypes](https://developer.android.com/reference/android/car/CarOccupantZoneManager#getSupportedInputTypes(android.car.CarOccupantZoneManager.OccupantZoneInfo,%20int))`(`[CarOccupantZoneManager.OccupantZoneInfo](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneInfo)` occupantZoneInfo, int displayType) ` Returns the supported input types for the occupant zone info and display type passed as the argument.               |
| ` int`                                                                                                                                            | ` `[getUserForDisplayId](https://developer.android.com/reference/android/car/CarOccupantZoneManager#getUserForDisplayId(int))`(int displayId) ` Returns assigned user id for the given display id.                                                                                                                                                                                                                                                                                            |
| ` int`                                                                                                                                            | ` `[getUserForOccupant](https://developer.android.com/reference/android/car/CarOccupantZoneManager#getUserForOccupant(android.car.CarOccupantZoneManager.OccupantZoneInfo))`(`[CarOccupantZoneManager.OccupantZoneInfo](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneInfo)` occupantZone) ` Returns android user id assigned for the given zone.                                                                                                    |
| ` boolean`                                                                                                                                        | ` `[hasDriverZone](https://developer.android.com/reference/android/car/CarOccupantZoneManager#hasDriverZone())`() ` Returns`true`if the system has a driver zone.                                                                                                                                                                                                                                                                                                                             |
| ` boolean`                                                                                                                                        | ` `[hasPassengerZones](https://developer.android.com/reference/android/car/CarOccupantZoneManager#hasPassengerZones())`() ` Returns`true`if the system has front or rear passenger zones.                                                                                                                                                                                                                                                                                                     |
| ` void`                                                                                                                                           | ` `[registerOccupantZoneConfigChangeListener](https://developer.android.com/reference/android/car/CarOccupantZoneManager#registerOccupantZoneConfigChangeListener(android.car.CarOccupantZoneManager.OccupantZoneConfigChangeListener))`(`[CarOccupantZoneManager.OccupantZoneConfigChangeListener](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneConfigChangeListener)` listener) ` Registers the listener for occupant zone config change.         |
| ` void`                                                                                                                                           | ` `[unregisterOccupantZoneConfigChangeListener](https://developer.android.com/reference/android/car/CarOccupantZoneManager#unregisterOccupantZoneConfigChangeListener(android.car.CarOccupantZoneManager.OccupantZoneConfigChangeListener))`(`[CarOccupantZoneManager.OccupantZoneConfigChangeListener](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneConfigChangeListener)` listener) ` Unregisters the listener.                                   |

| ### Inherited methods |
|-----------------------|---|
| From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Constants

### DISPLAY_TYPE_AUXILIARY

```
public static final int DISPLAY_TYPE_AUXILIARY
```

Auxiliary display which can provide additional screen for[DISPLAY_TYPE_MAIN](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_MAIN). Activity running in[DISPLAY_TYPE_MAIN](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_MAIN)may use[Presentation](https://developer.android.com/reference/android/app/Presentation)to show additional information.

<br />

Constant Value: 5 (0x00000005)  

### DISPLAY_TYPE_HUD

```
public static final int DISPLAY_TYPE_HUD
```

Head Up Display. This may exist only for driver.

<br />

Constant Value: 3 (0x00000003)  

### DISPLAY_TYPE_INPUT

```
public static final int DISPLAY_TYPE_INPUT
```

Dedicated display for showing IME for[DISPLAY_TYPE_MAIN](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_MAIN)

<br />

Constant Value: 4 (0x00000004)  

### DISPLAY_TYPE_INSTRUMENT_CLUSTER

```
public static final int DISPLAY_TYPE_INSTRUMENT_CLUSTER
```

Instrument cluster display. This may exist only for driver.

<br />

Constant Value: 2 (0x00000002)  

### DISPLAY_TYPE_MAIN

```
public static final int DISPLAY_TYPE_MAIN
```

Main display users are interacting with. UI for the user will be launched to this display by default.[Display.DEFAULT_DISPLAY](https://developer.android.com/reference/android/view/Display#DEFAULT_DISPLAY)will be always have this type. But there can be multiple of this type as each passenger can have their own main display.

<br />

Constant Value: 1 (0x00000001)  

### DISPLAY_TYPE_UNKNOWN

```
public static final int DISPLAY_TYPE_UNKNOWN
```

Display type is not known. In some system, some displays may be just public display without any additional information and such displays will be treated as unknown.

<br />

Constant Value: 0 (0x00000000)  

### INVALID_USER_ID

```
public static final int INVALID_USER_ID
```

Invalid user ID. Zone with this user ID has no allocated user. Should have the same value with[UserHandle.USER_NULL](https://developer.android.com/reference/android/os/UserHandle#USER_NULL).

<br />

Constant Value: -10000 (0xffffd8f0)  

### OCCUPANT_TYPE_DRIVER

```
public static final int OCCUPANT_TYPE_DRIVER
```

Represents the driver. There can be one or zero driver for the system. Zero driver situation can happen if the system is configured to support only passengers.

<br />

Constant Value: 0 (0x00000000)  

### OCCUPANT_TYPE_FRONT_PASSENGER

```
public static final int OCCUPANT_TYPE_FRONT_PASSENGER
```

Represents front passengers who sit in front side of car. Most cars will have only one passenger of this type but this can be multiple.

<br />

Constant Value: 1 (0x00000001)  

### OCCUPANT_TYPE_REAR_PASSENGER

```
public static final int OCCUPANT_TYPE_REAR_PASSENGER
```

Represents passengers in rear seats. There can be multiple passengers of this type.

<br />

Constant Value: 2 (0x00000002)  

### ZONE_CONFIG_CHANGE_FLAG_AUDIO

```
public static final int ZONE_CONFIG_CHANGE_FLAG_AUDIO
```

Zone config change caused by audio zone change. Assigned audio zone for passenger zones have changed.

<br />

Constant Value: 4 (0x00000004)  

### ZONE_CONFIG_CHANGE_FLAG_DISPLAY

```
public static final int ZONE_CONFIG_CHANGE_FLAG_DISPLAY
```

Zone config change caused by display changes. A display could have been added / removed. Besides change in display itself. this can lead into removal / addition of passenger zones.

<br />

Constant Value: 1 (0x00000001)  

### ZONE_CONFIG_CHANGE_FLAG_USER

```
public static final int ZONE_CONFIG_CHANGE_FLAG_USER
```

Zone config change caused by user change. Assigned user for passenger zones have changed.

<br />

Constant Value: 2 (0x00000002)

## Public methods

### getAllDisplaysForOccupant

```
public List<Display> getAllDisplaysForOccupant (CarOccupantZoneManager.OccupantZoneInfo occupantZone)
```

Returns all displays assigned for the given occupant zone. If no display is available for the passenger, it will return empty list.

<br />

|                            Parameters                            ||
|----------------|--------------------------------------------------|
| `occupantZone` | `CarOccupantZoneManager.OccupantZoneInfo` <br /> |

|         Returns         ||
|-----------------|--------|
| `List<Display>` | <br /> |

### getAllOccupantZones

```
public List<CarOccupantZoneManager.OccupantZoneInfo> getAllOccupantZones ()
```

Returns all available occupants in the system. If no occupant zone is defined in the system or none is available at the moment, it will return empty list.

<br />

|                                                                         Returns                                                                          ||
|--------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| `List<`[CarOccupantZoneManager.OccupantZoneInfo](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneInfo)`>` | <br /> |

### getDisplayForOccupant

```
public Display getDisplayForOccupant (CarOccupantZoneManager.OccupantZoneInfo occupantZone, 
                int displayType)
```

Gets the display for the occupant for the specified display type, or returns`null`if no display matches the requirements.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ||
|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `occupantZone` | `CarOccupantZoneManager.OccupantZoneInfo` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `displayType`  | `int`: This should be a valid display type and passing[DISPLAY_TYPE_UNKNOWN](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_UNKNOWN)will always lead into`null`return. Value is[DISPLAY_TYPE_UNKNOWN](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_UNKNOWN),[DISPLAY_TYPE_MAIN](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_MAIN),[DISPLAY_TYPE_INSTRUMENT_CLUSTER](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_INSTRUMENT_CLUSTER),[DISPLAY_TYPE_HUD](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_HUD),[DISPLAY_TYPE_INPUT](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_INPUT),[DISPLAY_TYPE_AUXILIARY](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_AUXILIARY), android.car.CarOccupantZoneManager.DISPLAY_TYPE_AUXILIARY_2, android.car.CarOccupantZoneManager.DISPLAY_TYPE_AUXILIARY_3, android.car.CarOccupantZoneManager.DISPLAY_TYPE_AUXILIARY_4, android.car.CarOccupantZoneManager.DISPLAY_TYPE_AUXILIARY_5, or android.car.CarOccupantZoneManager.DISPLAY_TYPE_DISPLAY_COMPATIBILITY <br /> |

|      Returns      ||
|-----------|--------|
| `Display` | <br /> |

### getDisplayType

```
public int getDisplayType (Display display)
```

Returns assigned display type for the display. It will return[DISPLAY_TYPE_UNKNOWN](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_UNKNOWN)if type is not specified or if display is no longer available.

<br />

|         Parameters          ||
|-----------|------------------|
| `display` | `Display` <br /> |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   Returns                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ||
|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Value is[DISPLAY_TYPE_UNKNOWN](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_UNKNOWN),[DISPLAY_TYPE_MAIN](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_MAIN),[DISPLAY_TYPE_INSTRUMENT_CLUSTER](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_INSTRUMENT_CLUSTER),[DISPLAY_TYPE_HUD](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_HUD),[DISPLAY_TYPE_INPUT](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_INPUT),[DISPLAY_TYPE_AUXILIARY](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_AUXILIARY), android.car.CarOccupantZoneManager.DISPLAY_TYPE_AUXILIARY_2, android.car.CarOccupantZoneManager.DISPLAY_TYPE_AUXILIARY_3, android.car.CarOccupantZoneManager.DISPLAY_TYPE_AUXILIARY_4, android.car.CarOccupantZoneManager.DISPLAY_TYPE_AUXILIARY_5, or android.car.CarOccupantZoneManager.DISPLAY_TYPE_DISPLAY_COMPATIBILITY <br /> |

### getMyOccupantZone

```
public CarOccupantZoneManager.OccupantZoneInfo getMyOccupantZone ()
```

Returns[OccupantZoneInfo](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneInfo)for the calling process's android user. It will return`null`if there is no occupant zone assigned for the user.

When there is no occupant zone allocated for the user, most likely the user is not allowed to run Activity or play audio, which are the main use cases to get the zone. So apps should not try such tasks when`null``OccupantZoneInfo`is returned. There can be an exception for system user running under[Headless System User Mode](https://developer.android.com/reference/android/os/UserManager#isHeadlessSystemUserMode()): The system user apps may show UI even if there is no zone allocated.

<br />

|                                                                    Returns                                                                     ||
|----------------------------------------------------------------------------------------------------------------------------------------|--------|
| [CarOccupantZoneManager.OccupantZoneInfo](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneInfo) | <br /> |

### getOccupantZone

```
public CarOccupantZoneManager.OccupantZoneInfo getOccupantZone (int occupantType, 
                int seat)
```

Finds`OccupantZoneInfo`for the given occupant type and seat.

For[OCCUPANT_TYPE_DRIVER](https://developer.android.com/reference/android/car/CarOccupantZoneManager#OCCUPANT_TYPE_DRIVER)and[OCCUPANT_TYPE_FRONT_PASSENGER](https://developer.android.com/reference/android/car/CarOccupantZoneManager#OCCUPANT_TYPE_FRONT_PASSENGER),`seat`argument will be ignored.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ||
|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `occupantType` | `int`: should be one of[OCCUPANT_TYPE_DRIVER](https://developer.android.com/reference/android/car/CarOccupantZoneManager#OCCUPANT_TYPE_DRIVER),[OCCUPANT_TYPE_FRONT_PASSENGER](https://developer.android.com/reference/android/car/CarOccupantZoneManager#OCCUPANT_TYPE_FRONT_PASSENGER),[OCCUPANT_TYPE_FRONT_PASSENGER](https://developer.android.com/reference/android/car/CarOccupantZoneManager#OCCUPANT_TYPE_FRONT_PASSENGER)Value is[OCCUPANT_TYPE_DRIVER](https://developer.android.com/reference/android/car/CarOccupantZoneManager#OCCUPANT_TYPE_DRIVER),[OCCUPANT_TYPE_FRONT_PASSENGER](https://developer.android.com/reference/android/car/CarOccupantZoneManager#OCCUPANT_TYPE_FRONT_PASSENGER), or[OCCUPANT_TYPE_REAR_PASSENGER](https://developer.android.com/reference/android/car/CarOccupantZoneManager#OCCUPANT_TYPE_REAR_PASSENGER) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `seat`         | `int`: Seat of the occupant. This is necessary for[OCCUPANT_TYPE_REAR_PASSENGER](https://developer.android.com/reference/android/car/CarOccupantZoneManager#OCCUPANT_TYPE_REAR_PASSENGER). Value is[VehicleAreaSeat.SEAT_UNKNOWN](https://developer.android.com/reference/android/car/VehicleAreaSeat#SEAT_UNKNOWN),[VehicleAreaSeat.SEAT_ROW_1_LEFT](https://developer.android.com/reference/android/car/VehicleAreaSeat#SEAT_ROW_1_LEFT),[VehicleAreaSeat.SEAT_ROW_1_CENTER](https://developer.android.com/reference/android/car/VehicleAreaSeat#SEAT_ROW_1_CENTER),[VehicleAreaSeat.SEAT_ROW_1_RIGHT](https://developer.android.com/reference/android/car/VehicleAreaSeat#SEAT_ROW_1_RIGHT),[VehicleAreaSeat.SEAT_ROW_2_LEFT](https://developer.android.com/reference/android/car/VehicleAreaSeat#SEAT_ROW_2_LEFT),[VehicleAreaSeat.SEAT_ROW_2_CENTER](https://developer.android.com/reference/android/car/VehicleAreaSeat#SEAT_ROW_2_CENTER),[VehicleAreaSeat.SEAT_ROW_2_RIGHT](https://developer.android.com/reference/android/car/VehicleAreaSeat#SEAT_ROW_2_RIGHT),[VehicleAreaSeat.SEAT_ROW_3_LEFT](https://developer.android.com/reference/android/car/VehicleAreaSeat#SEAT_ROW_3_LEFT),[VehicleAreaSeat.SEAT_ROW_3_CENTER](https://developer.android.com/reference/android/car/VehicleAreaSeat#SEAT_ROW_3_CENTER), or[VehicleAreaSeat.SEAT_ROW_3_RIGHT](https://developer.android.com/reference/android/car/VehicleAreaSeat#SEAT_ROW_3_RIGHT) <br /> |

|                                                                                                  Returns                                                                                                   ||
|----------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|
| [CarOccupantZoneManager.OccupantZoneInfo](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneInfo) | Matching occupant zone or`null`if such zone does not exist. <br /> |

### getOccupantZoneForUser

```
public CarOccupantZoneManager.OccupantZoneInfo getOccupantZoneForUser (UserHandle user)
```

Returns`OccupantZoneInfo`associated with the given`UserHandle`. In the case that the user is associated with multiple zones, this API returns the first matched zone.

<br />

|                   Parameters                   ||
|--------|----------------------------------------|
| `user` | `UserHandle`: The user to find. <br /> |

|                                                                                                                         Returns                                                                                                                          ||
|----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| [CarOccupantZoneManager.OccupantZoneInfo](https://developer.android.com/reference/android/car/CarOccupantZoneManager.OccupantZoneInfo) | Matching occupant zone or`null`if the user is not assigned or user has a userId of`UserHandle#USER_NULL`. <br /> |

### getSupportedInputTypes

```
public List<Integer> getSupportedInputTypes (CarOccupantZoneManager.OccupantZoneInfo occupantZoneInfo, 
                int displayType)
```

Returns the supported input types for the occupant zone info and display type passed as the argument.

It returns an empty list if the input type is unknown. Starting in Android[Build.VERSION_CODES.UPSIDE_DOWN_CAKE](https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE), all associated occupant zones and display types in`config_occupant_display_mapping`must define at least one input type.

If the display doesn't have any input type associated, then it should return a list containing[CarInputManager.INPUT_TYPE_NONE](https://developer.android.com/reference/android/car/input/CarInputManager#INPUT_TYPE_NONE)only.

This is the list of all available input types this method may return:

- [CarInputManager.INPUT_TYPE_ROTARY_NAVIGATION](https://developer.android.com/reference/android/car/input/CarInputManager#INPUT_TYPE_ROTARY_NAVIGATION)
- [CarInputManager.INPUT_TYPE_ROTARY_VOLUME](https://developer.android.com/reference/android/car/input/CarInputManager#INPUT_TYPE_ROTARY_VOLUME)
- [CarInputManager.INPUT_TYPE_DPAD_KEYS](https://developer.android.com/reference/android/car/input/CarInputManager#INPUT_TYPE_DPAD_KEYS)
- [CarInputManager.INPUT_TYPE_NAVIGATE_KEYS](https://developer.android.com/reference/android/car/input/CarInputManager#INPUT_TYPE_NAVIGATE_KEYS)
- [CarInputManager.INPUT_TYPE_SYSTEM_NAVIGATE_KEYS](https://developer.android.com/reference/android/car/input/CarInputManager#INPUT_TYPE_SYSTEM_NAVIGATE_KEYS)
- [CarInputManager.INPUT_TYPE_CUSTOM_INPUT_EVENT](https://developer.android.com/reference/android/car/input/CarInputManager#INPUT_TYPE_CUSTOM_INPUT_EVENT)
- [CarInputManager.INPUT_TYPE_TOUCH_SCREEN](https://developer.android.com/reference/android/car/input/CarInputManager#INPUT_TYPE_TOUCH_SCREEN)
- [CarInputManager.INPUT_TYPE_NONE](https://developer.android.com/reference/android/car/input/CarInputManager#INPUT_TYPE_NONE)

<br />

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ||
|--------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `occupantZoneInfo` | `CarOccupantZoneManager.OccupantZoneInfo`: the occupant zone info of the supported input types to find <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `displayType`      | `int`: the display type of the supported input types to find Value is[DISPLAY_TYPE_UNKNOWN](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_UNKNOWN),[DISPLAY_TYPE_MAIN](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_MAIN),[DISPLAY_TYPE_INSTRUMENT_CLUSTER](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_INSTRUMENT_CLUSTER),[DISPLAY_TYPE_HUD](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_HUD),[DISPLAY_TYPE_INPUT](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_INPUT),[DISPLAY_TYPE_AUXILIARY](https://developer.android.com/reference/android/car/CarOccupantZoneManager#DISPLAY_TYPE_AUXILIARY), android.car.CarOccupantZoneManager.DISPLAY_TYPE_AUXILIARY_2, android.car.CarOccupantZoneManager.DISPLAY_TYPE_AUXILIARY_3, android.car.CarOccupantZoneManager.DISPLAY_TYPE_AUXILIARY_4, android.car.CarOccupantZoneManager.DISPLAY_TYPE_AUXILIARY_5, or android.car.CarOccupantZoneManager.DISPLAY_TYPE_DISPLAY_COMPATIBILITY <br /> |

|                                                                                      Returns                                                                                      ||
|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `List<Integer>` | the supported input types for the occupant zone info and display type passed in as the argument (see the full list of supported input types in the above) <br /> |

### getUserForDisplayId

```
public int getUserForDisplayId (int displayId)
```

Returns assigned user id for the given display id.

<br />

|                                                                                                          Parameters                                                                                                          ||
|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `displayId` | `int`: Should be valid display id. Passing invalid display id will lead into getting[INVALID_USER_ID](https://developer.android.com/reference/android/car/CarOccupantZoneManager#INVALID_USER_ID)result. <br /> |

|                                                                                      Returns                                                                                       ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Valid user id or[INVALID_USER_ID](https://developer.android.com/reference/android/car/CarOccupantZoneManager#INVALID_USER_ID)if no user is assigned for the display. <br /> |

### getUserForOccupant

```
public int getUserForOccupant (CarOccupantZoneManager.OccupantZoneInfo occupantZone)
```

Returns android user id assigned for the given zone. It will return[INVALID_USER_ID](https://developer.android.com/reference/android/car/CarOccupantZoneManager#INVALID_USER_ID)if user is not assigned or if zone is not available.

<br />

|                            Parameters                            ||
|----------------|--------------------------------------------------|
| `occupantZone` | `CarOccupantZoneManager.OccupantZoneInfo` <br /> |

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### hasDriverZone

```
public boolean hasDriverZone ()
```

Returns`true`if the system has a driver zone. It will return false for system with only passenger zones.

Note that at least one zone must be present and following system configurations are possible:

- One driver zone only.
- One driver zone with at least one passenger zone.
- At least one passenger zone.

<br />

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### hasPassengerZones

```
public boolean hasPassengerZones ()
```

Returns`true`if the system has front or rear passenger zones. Check[hasDriverZone()](https://developer.android.com/reference/android/car/CarOccupantZoneManager#hasDriverZone())for possible system configurations.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### registerOccupantZoneConfigChangeListener

```
public void registerOccupantZoneConfigChangeListener (CarOccupantZoneManager.OccupantZoneConfigChangeListener listener)
```

Registers the listener for occupant zone config change. Registering multiple listeners are allowed.

<br />

|                                  Parameters                                  ||
|------------|------------------------------------------------------------------|
| `listener` | `CarOccupantZoneManager.OccupantZoneConfigChangeListener` <br /> |

### unregisterOccupantZoneConfigChangeListener

```
public void unregisterOccupantZoneConfigChangeListener (CarOccupantZoneManager.OccupantZoneConfigChangeListener listener)
```

Unregisters the listener. Listeners not registered before will be ignored.

<br />

|                                  Parameters                                  ||
|------------|------------------------------------------------------------------|
| `listener` | `CarOccupantZoneManager.OccupantZoneConfigChangeListener` <br /> |