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 |
isFeatureEnabled(@NonNull Context context, @NonNull String feature)Checks whether the system enables a given CarFeature. |
Constants
FEATURE_BACKGROUND_AUDIO_WHILE_DRIVING
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
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
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. |