Configuration

#include <configuration.h>

Summary

Enumerations

Anonymous Enum 24{
  ACONFIGURATION_ORIENTATION_ANY = 0x0000,
  ACONFIGURATION_ORIENTATION_PORT = 0x0001,
  ACONFIGURATION_ORIENTATION_LAND = 0x0002,
  ACONFIGURATION_ORIENTATION_SQUARE = 0x0003,
  ACONFIGURATION_TOUCHSCREEN_ANY = 0x0000,
  ACONFIGURATION_TOUCHSCREEN_NOTOUCH = 0x0001,
  ACONFIGURATION_TOUCHSCREEN_STYLUS = 0x0002,
  ACONFIGURATION_TOUCHSCREEN_FINGER = 0x0003,
  ACONFIGURATION_DENSITY_DEFAULT = 0,
  ACONFIGURATION_DENSITY_LOW = 120,
  ACONFIGURATION_DENSITY_MEDIUM = 160,
  ACONFIGURATION_DENSITY_TV = 213,
  ACONFIGURATION_DENSITY_HIGH = 240,
  ACONFIGURATION_DENSITY_XHIGH = 320,
  ACONFIGURATION_DENSITY_XXHIGH = 480,
  ACONFIGURATION_DENSITY_XXXHIGH = 640,
  ACONFIGURATION_DENSITY_ANY = 0xfffe,
  ACONFIGURATION_DENSITY_NONE = 0xffff,
  ACONFIGURATION_KEYBOARD_ANY = 0x0000,
  ACONFIGURATION_KEYBOARD_NOKEYS = 0x0001,
  ACONFIGURATION_KEYBOARD_QWERTY = 0x0002,
  ACONFIGURATION_KEYBOARD_12KEY = 0x0003,
  ACONFIGURATION_NAVIGATION_ANY = 0x0000,
  ACONFIGURATION_NAVIGATION_NONAV = 0x0001,
  ACONFIGURATION_NAVIGATION_DPAD = 0x0002,
  ACONFIGURATION_NAVIGATION_TRACKBALL = 0x0003,
  ACONFIGURATION_NAVIGATION_WHEEL = 0x0004,
  ACONFIGURATION_KEYSHIDDEN_ANY = 0x0000,
  ACONFIGURATION_KEYSHIDDEN_NO = 0x0001,
  ACONFIGURATION_KEYSHIDDEN_YES = 0x0002,
  ACONFIGURATION_KEYSHIDDEN_SOFT = 0x0003,
  ACONFIGURATION_NAVHIDDEN_ANY = 0x0000,
  ACONFIGURATION_NAVHIDDEN_NO = 0x0001,
  ACONFIGURATION_NAVHIDDEN_YES = 0x0002,
  ACONFIGURATION_SCREENSIZE_ANY = 0x00,
  ACONFIGURATION_SCREENSIZE_SMALL = 0x01,
  ACONFIGURATION_SCREENSIZE_NORMAL = 0x02,
  ACONFIGURATION_SCREENSIZE_LARGE = 0x03,
  ACONFIGURATION_SCREENSIZE_XLARGE = 0x04,
  ACONFIGURATION_SCREENLONG_ANY = 0x00,
  ACONFIGURATION_SCREENLONG_NO = 0x1,
  ACONFIGURATION_SCREENLONG_YES = 0x2,
  ACONFIGURATION_SCREENROUND_ANY = 0x00,
  ACONFIGURATION_SCREENROUND_NO = 0x1,
  ACONFIGURATION_SCREENROUND_YES = 0x2,
  ACONFIGURATION_WIDE_COLOR_GAMUT_ANY = 0x00,
  ACONFIGURATION_WIDE_COLOR_GAMUT_NO = 0x1,
  ACONFIGURATION_WIDE_COLOR_GAMUT_YES = 0x2,
  ACONFIGURATION_HDR_ANY = 0x00,
  ACONFIGURATION_HDR_NO = 0x1,
  ACONFIGURATION_HDR_YES = 0x2,
  ACONFIGURATION_UI_MODE_TYPE_ANY = 0x00,
  ACONFIGURATION_UI_MODE_TYPE_NORMAL = 0x01,
  ACONFIGURATION_UI_MODE_TYPE_DESK = 0x02,
  ACONFIGURATION_UI_MODE_TYPE_CAR = 0x03,
  ACONFIGURATION_UI_MODE_TYPE_TELEVISION = 0x04,
  ACONFIGURATION_UI_MODE_TYPE_APPLIANCE = 0x05,
  ACONFIGURATION_UI_MODE_TYPE_WATCH = 0x06,
  ACONFIGURATION_UI_MODE_TYPE_VR_HEADSET = 0x07,
  ACONFIGURATION_UI_MODE_NIGHT_ANY = 0x00,
  ACONFIGURATION_UI_MODE_NIGHT_NO = 0x1,
  ACONFIGURATION_UI_MODE_NIGHT_YES = 0x2,
  ACONFIGURATION_SCREEN_WIDTH_DP_ANY = 0x0000,
  ACONFIGURATION_SCREEN_HEIGHT_DP_ANY = 0x0000,
  ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY = 0x0000,
  ACONFIGURATION_LAYOUTDIR_ANY = 0x00,
  ACONFIGURATION_LAYOUTDIR_LTR = 0x01,
  ACONFIGURATION_LAYOUTDIR_RTL = 0x02,
  ACONFIGURATION_MCC = 0x0001,
  ACONFIGURATION_MNC = 0x0002,
  ACONFIGURATION_LOCALE = 0x0004,
  ACONFIGURATION_TOUCHSCREEN = 0x0008,
  ACONFIGURATION_KEYBOARD = 0x0010,
  ACONFIGURATION_KEYBOARD_HIDDEN = 0x0020,
  ACONFIGURATION_NAVIGATION = 0x0040,
  ACONFIGURATION_ORIENTATION = 0x0080,
  ACONFIGURATION_DENSITY = 0x0100,
  ACONFIGURATION_SCREEN_SIZE = 0x0200,
  ACONFIGURATION_VERSION = 0x0400,
  ACONFIGURATION_SCREEN_LAYOUT = 0x0800,
  ACONFIGURATION_UI_MODE = 0x1000,
  ACONFIGURATION_SMALLEST_SCREEN_SIZE = 0x2000,
  ACONFIGURATION_LAYOUTDIR = 0x4000,
  ACONFIGURATION_SCREEN_ROUND = 0x8000,
  ACONFIGURATION_COLOR_MODE = 0x10000,
  ACONFIGURATION_GRAMMATICAL_GENDER = 0x20000,
  ACONFIGURATION_MNC_ZERO = 0xffff,
  ACONFIGURATION_GRAMMATICAL_GENDER_ANY = 0,
  ACONFIGURATION_GRAMMATICAL_GENDER_NEUTER = 1,
  ACONFIGURATION_GRAMMATICAL_GENDER_FEMININE = 2,
  ACONFIGURATION_GRAMMATICAL_GENDER_MASCULINE = 3
}
enum
Define flags and constants for various subsystem configurations.

Typedefs

AConfiguration typedef
AConfiguration is an opaque type used to get and set various subsystem configurations.

Functions

AConfiguration_copy(AConfiguration *dest, AConfiguration *src)
void
Copy the contents of 'src' to 'dest'.
AConfiguration_delete(AConfiguration *config)
void
Free an AConfiguration that was previously created with AConfiguration_new().
AConfiguration_diff(AConfiguration *config1, AConfiguration *config2)
int32_t
Perform a diff between two configurations.
AConfiguration_fromAssetManager(AConfiguration *out, AAssetManager *am)
void
Create and return a new AConfiguration based on the current configuration in use in the given AAssetManager.
AConfiguration_getCountry(AConfiguration *config, char *outCountry)
void
Return the current country code set in the configuration.
AConfiguration_getDensity(AConfiguration *config)
int32_t
Return the current ACONFIGURATION_DENSITY_* set in the configuration.
AConfiguration_getGrammaticalGender(AConfiguration *config)
int32_t
Return the configuration's grammatical gender, or ACONFIGURATION_GRAMMATICAL_GENDER_ANY if not set.
AConfiguration_getKeyboard(AConfiguration *config)
int32_t
Return the current ACONFIGURATION_KEYBOARD_* set in the configuration.
AConfiguration_getKeysHidden(AConfiguration *config)
int32_t
Return the current ACONFIGURATION_KEYSHIDDEN_* set in the configuration.
AConfiguration_getLanguage(AConfiguration *config, char *outLanguage)
void
Return the current language code set in the configuration.
AConfiguration_getLayoutDirection(AConfiguration *config)
int32_t
Return the configuration's layout direction, or ACONFIGURATION_LAYOUTDIR_ANY if not set.
AConfiguration_getMcc(AConfiguration *config)
int32_t
Return the current MCC set in the configuration.
AConfiguration_getMnc(AConfiguration *config)
int32_t
Return the current MNC set in the configuration.
AConfiguration_getNavHidden(AConfiguration *config)
int32_t
Return the current ACONFIGURATION_NAVHIDDEN_* set in the configuration.
AConfiguration_getNavigation(AConfiguration *config)
int32_t
Return the current ACONFIGURATION_NAVIGATION_* set in the configuration.
AConfiguration_getOrientation(AConfiguration *config)
int32_t
Return the current ACONFIGURATION_ORIENTATION_* set in the configuration.
AConfiguration_getScreenHeightDp(AConfiguration *config)
int32_t
Return the current configuration screen height in dp units, or ACONFIGURATION_SCREEN_HEIGHT_DP_ANY if not set.
AConfiguration_getScreenLong(AConfiguration *config)
int32_t
Return the current ACONFIGURATION_SCREENLONG_* set in the configuration.
AConfiguration_getScreenRound(AConfiguration *config)
int32_t
Return the current ACONFIGURATION_SCREENROUND_* set in the configuration.
AConfiguration_getScreenSize(AConfiguration *config)
int32_t
Return the current ACONFIGURATION_SCREENSIZE_* set in the configuration.
AConfiguration_getScreenWidthDp(AConfiguration *config)
int32_t
Return the current configuration screen width in dp units, or ACONFIGURATION_SCREEN_WIDTH_DP_ANY if not set.
AConfiguration_getSdkVersion(AConfiguration *config)
int32_t
Return the current SDK (API) version set in the configuration.
AConfiguration_getSmallestScreenWidthDp(AConfiguration *config)
int32_t
Return the configuration's smallest screen width in dp units, or ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY if not set.
AConfiguration_getTouchscreen(AConfiguration *config)
int32_t
Return the current ACONFIGURATION_TOUCHSCREEN_* set in the configuration.
AConfiguration_getUiModeNight(AConfiguration *config)
int32_t
Return the current ACONFIGURATION_UI_MODE_NIGHT_* set in the configuration.
AConfiguration_getUiModeType(AConfiguration *config)
int32_t
Return the current ACONFIGURATION_UI_MODE_TYPE_* set in the configuration.
AConfiguration_isBetterThan(AConfiguration *base, AConfiguration *test, AConfiguration *requested)
int32_t
Determine whether the configuration in 'test' is better than the existing configuration in 'base'.
AConfiguration_match(AConfiguration *base, AConfiguration *requested)
int32_t
Determine whether 'base' is a valid configuration for use within the environment 'requested'.
AConfiguration_new()
Create a new AConfiguration, initialized with no values set.
AConfiguration_setCountry(AConfiguration *config, const char *country)
void
Set the current country code in the configuration, from the first two characters in the string.
AConfiguration_setDensity(AConfiguration *config, int32_t density)
void
Set the current density in the configuration.
AConfiguration_setGrammaticalGender(AConfiguration *config, int32_t value)
void
Set the configuration's grammatical gender to one of the ACONFIGURATION_GRAMMATICAL_GENDER_* constants.
AConfiguration_setKeyboard(AConfiguration *config, int32_t keyboard)
void
Set the current keyboard in the configuration.
AConfiguration_setKeysHidden(AConfiguration *config, int32_t keysHidden)
void
Set the current keys hidden in the configuration.
AConfiguration_setLanguage(AConfiguration *config, const char *language)
void
Set the current language code in the configuration, from the first two characters in the string.
AConfiguration_setLayoutDirection(AConfiguration *config, int32_t value)
void
Set the configuration's layout direction.
AConfiguration_setMcc(AConfiguration *config, int32_t mcc)
void
Set the current MCC in the configuration.
AConfiguration_setMnc(AConfiguration *config, int32_t mnc)
void
Set the current MNC in the configuration.
AConfiguration_setNavHidden(AConfiguration *config, int32_t navHidden)
void
Set the current nav hidden in the configuration.
AConfiguration_setNavigation(AConfiguration *config, int32_t navigation)
void
Set the current navigation in the configuration.
AConfiguration_setOrientation(AConfiguration *config, int32_t orientation)
void
Set the current orientation in the configuration.
AConfiguration_setScreenHeightDp(AConfiguration *config, int32_t value)
void
Set the configuration's current screen width in dp units.
AConfiguration_setScreenLong(AConfiguration *config, int32_t screenLong)
void
Set the current screen long in the configuration.
AConfiguration_setScreenRound(AConfiguration *config, int32_t screenRound)
void
Set the current screen round in the configuration.
AConfiguration_setScreenSize(AConfiguration *config, int32_t screenSize)
void
Set the current screen size in the configuration.
AConfiguration_setScreenWidthDp(AConfiguration *config, int32_t value)
void
Set the configuration's current screen width in dp units.
AConfiguration_setSdkVersion(AConfiguration *config, int32_t sdkVersion)
void
Set the current SDK version in the configuration.
AConfiguration_setSmallestScreenWidthDp(AConfiguration *config, int32_t value)
void
Set the configuration's smallest screen width in dp units.
AConfiguration_setTouchscreen(AConfiguration *config, int32_t touchscreen)
void
Set the current touchscreen in the configuration.
AConfiguration_setUiModeNight(AConfiguration *config, int32_t uiModeNight)
void
Set the current UI mode night in the configuration.
AConfiguration_setUiModeType(AConfiguration *config, int32_t uiModeType)
void
Set the current UI mode type in the configuration.

Enumerations

Anonymous Enum 24

 Anonymous Enum 24

Define flags and constants for various subsystem configurations.

Properties
ACONFIGURATION_COLOR_MODE

Bit mask for wide color gamut and HDR configurations.

ACONFIGURATION_DENSITY

Bit mask for density configuration.

ACONFIGURATION_DENSITY_ANY

Density: any density.

ACONFIGURATION_DENSITY_DEFAULT

Density: default density.

ACONFIGURATION_DENSITY_HIGH

Density: value corresponding to the hdpi resource qualifier.

ACONFIGURATION_DENSITY_LOW

Density: value corresponding to the ldpi resource qualifier.

ACONFIGURATION_DENSITY_MEDIUM

Density: value corresponding to the mdpi resource qualifier.

ACONFIGURATION_DENSITY_NONE

Density: no density specified.

ACONFIGURATION_DENSITY_TV

Density: value corresponding to the tvdpi resource qualifier.

ACONFIGURATION_DENSITY_XHIGH

Density: value corresponding to the xhdpi resource qualifier.

ACONFIGURATION_DENSITY_XXHIGH

Density: value corresponding to the xxhdpi resource qualifier.

ACONFIGURATION_DENSITY_XXXHIGH

Density: value corresponding to the xxxhdpi resource qualifier.

ACONFIGURATION_GRAMMATICAL_GENDER

Bit mask for grammatical gender configuration.

ACONFIGURATION_GRAMMATICAL_GENDER_ANY

Grammatical gender: not specified.

ACONFIGURATION_GRAMMATICAL_GENDER_FEMININE

Grammatical gender: feminine.

ACONFIGURATION_GRAMMATICAL_GENDER_MASCULINE

Grammatical gender: masculine.

ACONFIGURATION_GRAMMATICAL_GENDER_NEUTER

Grammatical gender: neuter.

ACONFIGURATION_HDR_ANY

HDR: not specified.

ACONFIGURATION_HDR_NO

HDR: value that corresponds to lowdr resource qualifier specified.

ACONFIGURATION_HDR_YES

HDR: value that corresponds to highdr resource qualifier specified.

ACONFIGURATION_KEYBOARD

Bit mask for keyboard configuration.

ACONFIGURATION_KEYBOARD_12KEY

Keyboard: value corresponding to the 12key resource qualifier.

ACONFIGURATION_KEYBOARD_ANY

Keyboard: not specified.

ACONFIGURATION_KEYBOARD_HIDDEN

Bit mask for keyboardHidden configuration.

ACONFIGURATION_KEYBOARD_NOKEYS

Keyboard: value corresponding to the nokeys resource qualifier.

ACONFIGURATION_KEYBOARD_QWERTY

Keyboard: value corresponding to the qwerty resource qualifier.

ACONFIGURATION_KEYSHIDDEN_ANY

Keyboard availability: not specified.

ACONFIGURATION_KEYSHIDDEN_NO

Keyboard availability: value corresponding to the keysexposed resource qualifier.

ACONFIGURATION_KEYSHIDDEN_SOFT

Keyboard availability: value corresponding to the keyssoft resource qualifier.

ACONFIGURATION_KEYSHIDDEN_YES

Keyboard availability: value corresponding to the keyshidden resource qualifier.

ACONFIGURATION_LAYOUTDIR

Bit mask for layout direction configuration.

ACONFIGURATION_LAYOUTDIR_ANY

Layout direction: not specified.

ACONFIGURATION_LAYOUTDIR_LTR

Layout direction: value that corresponds to ldltr resource qualifier specified.

ACONFIGURATION_LAYOUTDIR_RTL

Layout direction: value that corresponds to ldrtl resource qualifier specified.

ACONFIGURATION_LOCALE

Bit mask for locale configuration.

ACONFIGURATION_MCC

Bit mask for mcc configuration.

ACONFIGURATION_MNC

Bit mask for mnc configuration.

ACONFIGURATION_MNC_ZERO

Constant used to to represent MNC (Mobile Network Code) zero.

0 cannot be used, since it is used to represent an undefined MNC.

ACONFIGURATION_NAVHIDDEN_ANY

Navigation availability: not specified.

ACONFIGURATION_NAVHIDDEN_NO

Navigation availability: value corresponding to the navexposed resource qualifier.

ACONFIGURATION_NAVHIDDEN_YES

Navigation availability: value corresponding to the navhidden resource qualifier.

ACONFIGURATION_NAVIGATION

Bit mask for navigation configuration.

ACONFIGURATION_NAVIGATION_ANY

Navigation: not specified.

ACONFIGURATION_NAVIGATION_DPAD

Navigation: value corresponding to the dpad resource qualifier.

ACONFIGURATION_NAVIGATION_NONAV

Navigation: value corresponding to the nonav resource qualifier.

ACONFIGURATION_NAVIGATION_TRACKBALL

Navigation: value corresponding to the trackball resource qualifier.

ACONFIGURATION_NAVIGATION_WHEEL

Navigation: value corresponding to the wheel resource qualifier.

ACONFIGURATION_ORIENTATION

Bit mask for orientation configuration.

ACONFIGURATION_ORIENTATION_ANY

Orientation: not specified.

ACONFIGURATION_ORIENTATION_LAND

Orientation: value corresponding to the land resource qualifier.

ACONFIGURATION_ORIENTATION_PORT

Orientation: value corresponding to the port resource qualifier.

ACONFIGURATION_ORIENTATION_SQUARE

Deprecated. Not currently supported or used.

ACONFIGURATION_SCREENLONG_ANY

Screen layout: not specified.

ACONFIGURATION_SCREENLONG_NO

Screen layout: value that corresponds to the notlong resource qualifier.

ACONFIGURATION_SCREENLONG_YES

Screen layout: value that corresponds to the long resource qualifier.

ACONFIGURATION_SCREENROUND_ANY
ACONFIGURATION_SCREENROUND_NO
ACONFIGURATION_SCREENROUND_YES
ACONFIGURATION_SCREENSIZE_ANY

Screen size: not specified.

ACONFIGURATION_SCREENSIZE_LARGE

Screen size: value indicating the screen is at least approximately 480x640 dp units, corresponding to the large resource qualifier.

ACONFIGURATION_SCREENSIZE_NORMAL

Screen size: value indicating the screen is at least approximately 320x470 dp units, corresponding to the normal resource qualifier.

ACONFIGURATION_SCREENSIZE_SMALL

Screen size: value indicating the screen is at least approximately 320x426 dp units, corresponding to the small resource qualifier.

ACONFIGURATION_SCREENSIZE_XLARGE

Screen size: value indicating the screen is at least approximately 720x960 dp units, corresponding to the xlarge resource qualifier.

ACONFIGURATION_SCREEN_HEIGHT_DP_ANY

Screen height DPI: not specified.

ACONFIGURATION_SCREEN_LAYOUT

Bit mask for screen layout configuration.

ACONFIGURATION_SCREEN_ROUND
ACONFIGURATION_SCREEN_SIZE

Bit mask for screen size configuration.

ACONFIGURATION_SCREEN_WIDTH_DP_ANY

Screen width DPI: not specified.

ACONFIGURATION_SMALLEST_SCREEN_SIZE

Bit mask for smallest screen width configuration.

ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY

Smallest screen width DPI: not specified.

ACONFIGURATION_TOUCHSCREEN

Bit mask for touchscreen configuration.

ACONFIGURATION_TOUCHSCREEN_ANY

Touchscreen: not specified.

ACONFIGURATION_TOUCHSCREEN_FINGER

Touchscreen: value corresponding to the finger resource qualifier.

ACONFIGURATION_TOUCHSCREEN_NOTOUCH

Touchscreen: value corresponding to the notouch resource qualifier.

ACONFIGURATION_TOUCHSCREEN_STYLUS

Deprecated. Not currently supported or used.

ACONFIGURATION_UI_MODE

Bit mask for ui mode configuration.

ACONFIGURATION_UI_MODE_NIGHT_ANY

UI night mode: not specified.

ACONFIGURATION_UI_MODE_NIGHT_NO

UI night mode: value that corresponds to notnight resource qualifier specified.

ACONFIGURATION_UI_MODE_NIGHT_YES

UI night mode: value that corresponds to night resource qualifier specified.

ACONFIGURATION_UI_MODE_TYPE_ANY

UI mode: not specified.

ACONFIGURATION_UI_MODE_TYPE_APPLIANCE

UI mode: value that corresponds to appliance resource qualifier specified.

ACONFIGURATION_UI_MODE_TYPE_CAR

UI mode: value that corresponds to car resource qualifier specified.

ACONFIGURATION_UI_MODE_TYPE_DESK

UI mode: value that corresponds to desk resource qualifier specified.

ACONFIGURATION_UI_MODE_TYPE_NORMAL

UI mode: value that corresponds to no UI mode type resource qualifier specified.

ACONFIGURATION_UI_MODE_TYPE_TELEVISION

UI mode: value that corresponds to television resource qualifier specified.

ACONFIGURATION_UI_MODE_TYPE_VR_HEADSET

UI mode: value that corresponds to vr resource qualifier specified.

ACONFIGURATION_UI_MODE_TYPE_WATCH

UI mode: value that corresponds to watch resource qualifier specified.

ACONFIGURATION_VERSION

Bit mask for platform version configuration.

ACONFIGURATION_WIDE_COLOR_GAMUT_ANY

Wide color gamut: not specified.

ACONFIGURATION_WIDE_COLOR_GAMUT_NO

Wide color gamut: value that corresponds to no nowidecg resource qualifier specified.

ACONFIGURATION_WIDE_COLOR_GAMUT_YES

Wide color gamut: value that corresponds to widecg resource qualifier specified.

Typedefs

AConfiguration

struct AConfiguration AConfiguration

AConfiguration is an opaque type used to get and set various subsystem configurations.

A AConfiguration pointer can be obtained using:

Functions

AConfiguration_copy

void AConfiguration_copy(
  AConfiguration *dest,
  AConfiguration *src
)

Copy the contents of 'src' to 'dest'.

AConfiguration_delete

void AConfiguration_delete(
  AConfiguration *config
)

Free an AConfiguration that was previously created with AConfiguration_new().

AConfiguration_diff

int32_t AConfiguration_diff(
  AConfiguration *config1,
  AConfiguration *config2
)

Perform a diff between two configurations.

Returns a bit mask of ACONFIGURATION_* constants, each bit set meaning that configuration element is different between them.

AConfiguration_fromAssetManager

void AConfiguration_fromAssetManager(
  AConfiguration *out,
  AAssetManager *am
)

Create and return a new AConfiguration based on the current configuration in use in the given AAssetManager.

AConfiguration_getCountry

void AConfiguration_getCountry(
  AConfiguration *config,
  char *outCountry
)

Return the current country code set in the configuration.

The output will be filled with an array of two characters. They are not 0-terminated. If a country is not set, they will be 0.

AConfiguration_getDensity

int32_t AConfiguration_getDensity(
  AConfiguration *config
)

Return the current ACONFIGURATION_DENSITY_* set in the configuration.

AConfiguration_getGrammaticalGender

int32_t AConfiguration_getGrammaticalGender(
  AConfiguration *config
)

Return the configuration's grammatical gender, or ACONFIGURATION_GRAMMATICAL_GENDER_ANY if not set.

Available since API level 34.

AConfiguration_getKeyboard

int32_t AConfiguration_getKeyboard(
  AConfiguration *config
)

Return the current ACONFIGURATION_KEYBOARD_* set in the configuration.

AConfiguration_getKeysHidden

int32_t AConfiguration_getKeysHidden(
  AConfiguration *config
)

Return the current ACONFIGURATION_KEYSHIDDEN_* set in the configuration.

AConfiguration_getLanguage

void AConfiguration_getLanguage(
  AConfiguration *config,
  char *outLanguage
)

Return the current language code set in the configuration.

The output will be filled with an array of two characters. They are not 0-terminated. If a language is not set, they will be 0.

AConfiguration_getLayoutDirection

int32_t AConfiguration_getLayoutDirection(
  AConfiguration *config
)

Return the configuration's layout direction, or ACONFIGURATION_LAYOUTDIR_ANY if not set.

Available since API level 17.

AConfiguration_getMcc

int32_t AConfiguration_getMcc(
  AConfiguration *config
)

Return the current MCC set in the configuration.

0 if not set.

AConfiguration_getMnc

int32_t AConfiguration_getMnc(
  AConfiguration *config
)

Return the current MNC set in the configuration.

0 if not set.

AConfiguration_getNavHidden

int32_t AConfiguration_getNavHidden(
  AConfiguration *config
)

Return the current ACONFIGURATION_NAVHIDDEN_* set in the configuration.

AConfiguration_getNavigation

int32_t AConfiguration_getNavigation(
  AConfiguration *config
)

Return the current ACONFIGURATION_NAVIGATION_* set in the configuration.

AConfiguration_getOrientation

int32_t AConfiguration_getOrientation(
  AConfiguration *config
)

Return the current ACONFIGURATION_ORIENTATION_* set in the configuration.

AConfiguration_getScreenHeightDp

int32_t AConfiguration_getScreenHeightDp(
  AConfiguration *config
)

Return the current configuration screen height in dp units, or ACONFIGURATION_SCREEN_HEIGHT_DP_ANY if not set.

AConfiguration_getScreenLong

int32_t AConfiguration_getScreenLong(
  AConfiguration *config
)

Return the current ACONFIGURATION_SCREENLONG_* set in the configuration.

AConfiguration_getScreenRound

int32_t AConfiguration_getScreenRound(
  AConfiguration *config
)

Return the current ACONFIGURATION_SCREENROUND_* set in the configuration.

Available since API level 30.

AConfiguration_getScreenSize

int32_t AConfiguration_getScreenSize(
  AConfiguration *config
)

Return the current ACONFIGURATION_SCREENSIZE_* set in the configuration.

AConfiguration_getScreenWidthDp

int32_t AConfiguration_getScreenWidthDp(
  AConfiguration *config
)

Return the current configuration screen width in dp units, or ACONFIGURATION_SCREEN_WIDTH_DP_ANY if not set.

AConfiguration_getSdkVersion

int32_t AConfiguration_getSdkVersion(
  AConfiguration *config
)

Return the current SDK (API) version set in the configuration.

AConfiguration_getSmallestScreenWidthDp

int32_t AConfiguration_getSmallestScreenWidthDp(
  AConfiguration *config
)

Return the configuration's smallest screen width in dp units, or ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY if not set.

AConfiguration_getTouchscreen

int32_t AConfiguration_getTouchscreen(
  AConfiguration *config
)

Return the current ACONFIGURATION_TOUCHSCREEN_* set in the configuration.

AConfiguration_getUiModeNight

int32_t AConfiguration_getUiModeNight(
  AConfiguration *config
)

Return the current ACONFIGURATION_UI_MODE_NIGHT_* set in the configuration.

AConfiguration_getUiModeType

int32_t AConfiguration_getUiModeType(
  AConfiguration *config
)

Return the current ACONFIGURATION_UI_MODE_TYPE_* set in the configuration.

AConfiguration_isBetterThan

int32_t AConfiguration_isBetterThan(
  AConfiguration *base,
  AConfiguration *test,
  AConfiguration *requested
)

Determine whether the configuration in 'test' is better than the existing configuration in 'base'.

If 'requested' is non-NULL, this decision is based on the overall configuration given there. If it is NULL, this decision is simply based on which configuration is more specific. Returns non-0 if 'test' is better than 'base'.

This assumes you have already filtered the configurations with AConfiguration_match().

AConfiguration_match

int32_t AConfiguration_match(
  AConfiguration *base,
  AConfiguration *requested
)

Determine whether 'base' is a valid configuration for use within the environment 'requested'.

Returns 0 if there are any values in 'base' that conflict with 'requested'. Returns 1 if it does not conflict.

AConfiguration_new

AConfiguration * AConfiguration_new()

Create a new AConfiguration, initialized with no values set.

AConfiguration_setCountry

void AConfiguration_setCountry(
  AConfiguration *config,
  const char *country
)

Set the current country code in the configuration, from the first two characters in the string.

AConfiguration_setDensity

void AConfiguration_setDensity(
  AConfiguration *config,
  int32_t density
)

Set the current density in the configuration.

AConfiguration_setGrammaticalGender

void AConfiguration_setGrammaticalGender(
  AConfiguration *config,
  int32_t value
)

Set the configuration's grammatical gender to one of the ACONFIGURATION_GRAMMATICAL_GENDER_* constants.

Available since API level 34.

AConfiguration_setKeyboard

void AConfiguration_setKeyboard(
  AConfiguration *config,
  int32_t keyboard
)

Set the current keyboard in the configuration.

AConfiguration_setKeysHidden

void AConfiguration_setKeysHidden(
  AConfiguration *config,
  int32_t keysHidden
)

Set the current keys hidden in the configuration.

AConfiguration_setLanguage

void AConfiguration_setLanguage(
  AConfiguration *config,
  const char *language
)

Set the current language code in the configuration, from the first two characters in the string.

AConfiguration_setLayoutDirection

void AConfiguration_setLayoutDirection(
  AConfiguration *config,
  int32_t value
)

Set the configuration's layout direction.

Available since API level 17.

AConfiguration_setMcc

void AConfiguration_setMcc(
  AConfiguration *config,
  int32_t mcc
)

Set the current MCC in the configuration.

0 to clear.

AConfiguration_setMnc

void AConfiguration_setMnc(
  AConfiguration *config,
  int32_t mnc
)

Set the current MNC in the configuration.

0 to clear.

AConfiguration_setNavHidden

void AConfiguration_setNavHidden(
  AConfiguration *config,
  int32_t navHidden
)

Set the current nav hidden in the configuration.

AConfiguration_setNavigation

void AConfiguration_setNavigation(
  AConfiguration *config,
  int32_t navigation
)

Set the current navigation in the configuration.

AConfiguration_setOrientation

void AConfiguration_setOrientation(
  AConfiguration *config,
  int32_t orientation
)

Set the current orientation in the configuration.

AConfiguration_setScreenHeightDp

void AConfiguration_setScreenHeightDp(
  AConfiguration *config,
  int32_t value
)

Set the configuration's current screen width in dp units.

AConfiguration_setScreenLong

void AConfiguration_setScreenLong(
  AConfiguration *config,
  int32_t screenLong
)

Set the current screen long in the configuration.

AConfiguration_setScreenRound

void AConfiguration_setScreenRound(
  AConfiguration *config,
  int32_t screenRound
)

Set the current screen round in the configuration.

AConfiguration_setScreenSize

void AConfiguration_setScreenSize(
  AConfiguration *config,
  int32_t screenSize
)

Set the current screen size in the configuration.

AConfiguration_setScreenWidthDp

void AConfiguration_setScreenWidthDp(
  AConfiguration *config,
  int32_t value
)

Set the configuration's current screen width in dp units.

AConfiguration_setSdkVersion

void AConfiguration_setSdkVersion(
  AConfiguration *config,
  int32_t sdkVersion
)

Set the current SDK version in the configuration.

AConfiguration_setSmallestScreenWidthDp

void AConfiguration_setSmallestScreenWidthDp(
  AConfiguration *config,
  int32_t value
)

Set the configuration's smallest screen width in dp units.

AConfiguration_setTouchscreen

void AConfiguration_setTouchscreen(
  AConfiguration *config,
  int32_t touchscreen
)

Set the current touchscreen in the configuration.

AConfiguration_setUiModeNight

void AConfiguration_setUiModeNight(
  AConfiguration *config,
  int32_t uiModeNight
)

Set the current UI mode night in the configuration.

AConfiguration_setUiModeType

void AConfiguration_setUiModeType(
  AConfiguration *config,
  int32_t uiModeType
)

Set the current UI mode type in the configuration.