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 = "com.android.car.background_audio_while_driving"

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

static final String
FEATURE_CAR_APP_LIBRARY_MEDIA = "android.software.car.templates_host.media"

Flag value to check whether the system supports apps that use the CarAppLibrary Media category

Public methods

static boolean

Checks whether the system enables a given CarFeature.

Constants

FEATURE_BACKGROUND_AUDIO_WHILE_DRIVING

Added in 1.7.0
public static final String FEATURE_BACKGROUND_AUDIO_WHILE_DRIVING = "com.android.car.background_audio_while_driving"

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

FEATURE_CAR_APP_LIBRARY_MEDIA

Added in 1.8.0-alpha01
public static final String FEATURE_CAR_APP_LIBRARY_MEDIA = "android.software.car.templates_host.media"

Flag value to check whether the system supports apps that use the CarAppLibrary Media category

Public methods

isFeatureEnabled

Added in 1.7.0
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.