diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-05-19 18:13:32 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2011-05-19 18:23:29 -0700 |
commit | 69cb87576ba163b61bb0e6477a3b7c57a9b11d40 (patch) | |
tree | a44be0af3d008409403be133358bdcd628741c01 /native | |
parent | b9537db8d9ee27efb4a98415ad2d6b50c1806e5d (diff) | |
download | frameworks_base-69cb87576ba163b61bb0e6477a3b7c57a9b11d40.zip frameworks_base-69cb87576ba163b61bb0e6477a3b7c57a9b11d40.tar.gz frameworks_base-69cb87576ba163b61bb0e6477a3b7c57a9b11d40.tar.bz2 |
Add new "-swNNNdp" resource qualifier.
Change-Id: I0101e88ca9d8d44138bdcaf571f24b0352f4f6ce
Diffstat (limited to 'native')
-rw-r--r-- | native/android/configuration.cpp | 24 | ||||
-rw-r--r-- | native/include/android/configuration.h | 40 |
2 files changed, 64 insertions, 0 deletions
diff --git a/native/android/configuration.cpp b/native/android/configuration.cpp index d76164f..687924b 100644 --- a/native/android/configuration.cpp +++ b/native/android/configuration.cpp @@ -111,6 +111,18 @@ int32_t AConfiguration_getUiModeNight(AConfiguration* config) { } +int32_t AConfiguration_getScreenWidthDp(AConfiguration* config) { + return config->screenWidthDp; +} + +int32_t AConfiguration_getScreenHeightDp(AConfiguration* config) { + return config->screenHeightDp; +} + +int32_t AConfiguration_getSmallestScreenWidthDp(AConfiguration* config) { + return config->smallestScreenWidthDp; +} + // ---------------------------------------------------------------------- void AConfiguration_setMcc(AConfiguration* config, int32_t mcc) { @@ -186,6 +198,18 @@ void AConfiguration_setUiModeNight(AConfiguration* config, int32_t uiModeNight) } +void AConfiguration_setScreenWidthDp(AConfiguration* config, int32_t value) { + config->screenWidthDp = value; +} + +void AConfiguration_setScreenHeightDp(AConfiguration* config, int32_t value) { + config->screenHeightDp = value; +} + +void AConfiguration_setSmallestScreenWidthDp(AConfiguration* config, int32_t value) { + config->smallestScreenWidthDp = value; +} + // ---------------------------------------------------------------------- int32_t AConfiguration_diff(AConfiguration* config1, AConfiguration* config2) { diff --git a/native/include/android/configuration.h b/native/include/android/configuration.h index 99e8f97..91533c8 100644 --- a/native/include/android/configuration.h +++ b/native/include/android/configuration.h @@ -82,6 +82,12 @@ enum { 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_MCC = 0x0001, ACONFIGURATION_MNC = 0x0002, ACONFIGURATION_LOCALE = 0x0004, @@ -95,6 +101,7 @@ enum { ACONFIGURATION_VERSION = 0x0400, ACONFIGURATION_SCREEN_LAYOUT = 0x0800, ACONFIGURATION_UI_MODE = 0x1000, + ACONFIGURATION_SMALLEST_SCREEN_SIZE = 0x2000, }; /** @@ -286,6 +293,39 @@ int32_t AConfiguration_getUiModeNight(AConfiguration* config); void AConfiguration_setUiModeNight(AConfiguration* config, int32_t uiModeNight); /** + * Return the current configuration screen width in dp units, or + * ACONFIGURATION_SCREEN_WIDTH_DP_ANY if not set. + */ +int32_t AConfiguration_getScreenWidthDp(AConfiguration* config); + +/** + * Set the configuration's current screen width in dp units. + */ +void AConfiguration_setScreenWidthDp(AConfiguration* config, int32_t value); + +/** + * Return the current configuration screen height in dp units, or + * ACONFIGURATION_SCREEN_HEIGHT_DP_ANY if not set. + */ +int32_t AConfiguration_getScreenHeightDp(AConfiguration* config); + +/** + * Set the configuration's current screen width in dp units. + */ +void AConfiguration_setScreenHeightDp(AConfiguration* config, int32_t value); + +/** + * Return the configuration's smallest screen width in dp units, or + * ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY if not set. + */ +int32_t AConfiguration_getSmallestScreenWidthDp(AConfiguration* config); + +/** + * Set the configuration's smallest screen width in dp units. + */ +void AConfiguration_setSmallestScreenWidthDp(AConfiguration* config, int32_t value); + +/** * Perform a diff between two configurations. Returns a bit mask of * ACONFIGURATION_* constants, each bit set meaning that configuration element * is different between them. |