Add new "-swNNNdp" resource qualifier.
Change-Id: I0101e88ca9d8d44138bdcaf571f24b0352f4f6ce
diff --git a/core/jni/android_content_res_Configuration.cpp b/core/jni/android_content_res_Configuration.cpp
index 28a43ab..5e09b38 100644
--- a/core/jni/android_content_res_Configuration.cpp
+++ b/core/jni/android_content_res_Configuration.cpp
@@ -40,6 +40,9 @@
jfieldID navigationHidden;
jfieldID orientation;
jfieldID uiMode;
+ jfieldID screenWidthDp;
+ jfieldID screenHeightDp;
+ jfieldID smallestScreenWidthDp;
} gConfigurationClassInfo;
void android_Configuration_getFromJava(
@@ -62,6 +65,11 @@
out->orientation = env->GetIntField(clazz, gConfigurationClassInfo.orientation);
out->uiMode = env->GetIntField(clazz, gConfigurationClassInfo.uiMode);
+
+ out->screenWidthDp = env->GetIntField(clazz, gConfigurationClassInfo.screenWidthDp);
+ out->screenHeightDp = env->GetIntField(clazz, gConfigurationClassInfo.screenHeightDp);
+ out->smallestScreenWidthDp = env->GetIntField(clazz,
+ gConfigurationClassInfo.smallestScreenWidthDp);
}
/*
@@ -110,6 +118,12 @@
"orientation", "I");
GET_FIELD_ID(gConfigurationClassInfo.uiMode, gConfigurationClassInfo.clazz,
"uiMode", "I");
+ GET_FIELD_ID(gConfigurationClassInfo.screenWidthDp, gConfigurationClassInfo.clazz,
+ "screenWidthDp", "I");
+ GET_FIELD_ID(gConfigurationClassInfo.screenHeightDp, gConfigurationClassInfo.clazz,
+ "screenHeightDp", "I");
+ GET_FIELD_ID(gConfigurationClassInfo.smallestScreenWidthDp, gConfigurationClassInfo.clazz,
+ "smallestScreenWidthDp", "I");
return AndroidRuntime::registerNativeMethods(env, "android/content/res/Configuration", gMethods,
NELEM(gMethods));
diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp
index 7a2d020..636d257 100644
--- a/core/jni/android_util_AssetManager.cpp
+++ b/core/jni/android_util_AssetManager.cpp
@@ -532,6 +532,7 @@
jint keyboard, jint keyboardHidden,
jint navigation,
jint screenWidth, jint screenHeight,
+ jint smallestScreenWidthDp,
jint screenWidthDp, jint screenHeightDp,
jint screenLayout, jint uiMode,
jint sdkVersion)
@@ -556,6 +557,7 @@
config.navigation = (uint8_t)navigation;
config.screenWidth = (uint16_t)screenWidth;
config.screenHeight = (uint16_t)screenHeight;
+ config.smallestScreenWidthDp = (uint16_t)smallestScreenWidthDp;
config.screenWidthDp = (uint16_t)screenWidthDp;
config.screenHeightDp = (uint16_t)screenHeightDp;
config.screenLayout = (uint8_t)screenLayout;
@@ -1696,7 +1698,7 @@
(void*) android_content_AssetManager_setLocale },
{ "getLocales", "()[Ljava/lang/String;",
(void*) android_content_AssetManager_getLocales },
- { "setConfiguration", "(IILjava/lang/String;IIIIIIIIIIIII)V",
+ { "setConfiguration", "(IILjava/lang/String;IIIIIIIIIIIIII)V",
(void*) android_content_AssetManager_setConfiguration },
{ "getResourceIdentifier","(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I",
(void*) android_content_AssetManager_getResourceIdentifier },