ConstraintManager

public class ConstraintManager
extends Object implements Manager

java.lang.Object
   ↳ androidx.car.app.constraints.ConstraintManager


Manages various constraints on the library as enforced by the host.

Depending on the host the app is connected to, there could be different various limits that apply, such as the number of items that could be in a list in different templates. An app can use this manager to query for these limits at runtime and react accordingly.

Summary

Constants

int CONTENT_LIMIT_TYPE_GRID

Represents the limit for contents to be shown in a grid format.

int CONTENT_LIMIT_TYPE_LIST

Represents the limit for generic, uniform list contents.

int CONTENT_LIMIT_TYPE_PANE

Represents the limit for contents to be shown in a pane format.

int CONTENT_LIMIT_TYPE_PLACE_LIST

Represents the limit for list contents that are associated with points of interest.

int CONTENT_LIMIT_TYPE_ROUTE_LIST

Represents the limit for list contents that are associated with navigation routes.

Public methods

int getContentLimit(int contentLimitType)

Requests for the limit associated with the contentLimitType.

Inherited methods

Constants

CONTENT_LIMIT_TYPE_GRID

public static final int CONTENT_LIMIT_TYPE_GRID

Represents the limit for contents to be shown in a grid format.

The limit of this type should be no smaller than the values defined in R.integer.content_limit_grid, but the host may support a larger limit.

Constant Value: 1 (0x00000001)

CONTENT_LIMIT_TYPE_LIST

public static final int CONTENT_LIMIT_TYPE_LIST

Represents the limit for generic, uniform list contents.

The limit of this type should be no smaller than the values defined in R.integer.content_limit_list, but the host may support a larger limit.

Constant Value: 0 (0x00000000)

CONTENT_LIMIT_TYPE_PANE

public static final int CONTENT_LIMIT_TYPE_PANE

Represents the limit for contents to be shown in a pane format.

The limit of this type should be no smaller than the values defined in R.integer.content_limit_pane, but the host may support a larger limit.

Constant Value: 4 (0x00000004)

CONTENT_LIMIT_TYPE_PLACE_LIST

public static final int CONTENT_LIMIT_TYPE_PLACE_LIST

Represents the limit for list contents that are associated with points of interest.

The limit of this type should be no smaller than the values defined in R.integer.content_limit_place_list, but the host may support a larger limit.

Constant Value: 2 (0x00000002)

CONTENT_LIMIT_TYPE_ROUTE_LIST

public static final int CONTENT_LIMIT_TYPE_ROUTE_LIST

Represents the limit for list contents that are associated with navigation routes.

The limit of this type should be no smaller than the values defined in R.integer.content_limit_route_list, but the host may support a larger limit.

Constant Value: 3 (0x00000003)

Public methods

getContentLimit

public int getContentLimit (int contentLimitType)

Requests for the limit associated with the contentLimitType.

Parameters
contentLimitType int

Returns
int

Throws
HostException if the remote call fails