From 3905184aee392c2a9c119a7db8e933d8fd2d13f5 Mon Sep 17 00:00:00 2001 From: Julian Winkler Date: Sun, 6 Oct 2024 18:05:42 +0200 Subject: [PATCH] AssetManager.loadThemeAttributeValue(): don't return attributeId as resourceId If the value has no resourceId, it should be resourceId=0 instead of setting it to the attributeId. --- src/api-impl-jni/android_content_res_AssetManager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api-impl-jni/android_content_res_AssetManager.c b/src/api-impl-jni/android_content_res_AssetManager.c index cb4fc13d..ab1a342b 100644 --- a/src/api-impl-jni/android_content_res_AssetManager.c +++ b/src/api-impl-jni/android_content_res_AssetManager.c @@ -234,11 +234,11 @@ JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_loadThemeAttributeV struct AssetManager *asset_manager = _PTR(_GET_LONG_FIELD(this, "mObject")); const struct ResTable *res_table = AssetManager_getResources(asset_manager, true); struct Theme *theme = _PTR(theme_ptr); - uint32_t resId = ident; + uint32_t resId = 0; struct Res_value value; uint32_t outSpecFlags; struct ResTable_config outConfig; - int block = Theme_getAttribute(theme, resId, &value, &outSpecFlags); + int block = Theme_getAttribute(theme, ident, &value, &outSpecFlags); if (resolve) { block = Theme_resolveAttributeReference(theme, &value, block, &resId, &outSpecFlags, &outConfig); }