summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-05-19 21:44:52 -0700
committerDianne Hackborn <hackbod@google.com>2011-05-19 21:44:52 -0700
commit161e67ff3ba26408eea09221734ad2e29a1eed11 (patch)
tree6e98ff836fb5f134e01a7e9ef420ec35a78ad5d2 /native
parent9e735541beed238d3b99d4bd284af1fc953c3775 (diff)
parent06a8ceacb0dc2713cb0bb2c93d2a750f2a58db68 (diff)
downloadframeworks_base-161e67ff3ba26408eea09221734ad2e29a1eed11.zip
frameworks_base-161e67ff3ba26408eea09221734ad2e29a1eed11.tar.gz
frameworks_base-161e67ff3ba26408eea09221734ad2e29a1eed11.tar.bz2
resolved conflicts for merge of 06a8ceac to master
Change-Id: Id51574c825affddfac14ad7214c5496d6a3d6e69
Diffstat (limited to 'native')
-rw-r--r--native/android/configuration.cpp24
-rw-r--r--native/include/android/configuration.h40
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.