CarFeatures


public final class CarFeatures


Class for checking for whether car related features are available on the system.

Summary

Constants

static final String
FEATURE_BACKGROUND_AUDIO_WHILE_DRIVING = "background_audio_while_driving"

Flag value to check whether or not audio is allowed to play while driving.

Public methods

static boolean

Checks whether the system enables a given CarFeature.

Constants

FEATURE_BACKGROUND_AUDIO_WHILE_DRIVING

Added in 1.7.0-beta01
public static final String FEATURE_BACKGROUND_AUDIO_WHILE_DRIVING = "background_audio_while_driving"

Flag value to check whether or not audio is allowed to play while driving.

Public methods

isFeatureEnabled

Added in 1.7.0-beta01
public static boolean isFeatureEnabled(@NonNull Context context, @NonNull String feature)

Checks whether the system enables a given CarFeature.

Parameters
@NonNull Context context

The context with which to query for the CarFeature.

@NonNull String feature

The CarFeature to query for.

Returns
boolean

Whether the system enables a given CarFeature.