replace our implementation of applyStyle with a native function that calls into libandroidfw

also change a few things to work with latest libandroidfw, since we are now using
it's helper functions that need to agree on e.g STYLE_NUM_ENTRIES with the Java
code.
This commit is contained in:
Mis012
2025-02-27 22:21:14 +01:00
parent d97c3ee048
commit f0fcd47c80
6 changed files with 139 additions and 202 deletions

View File

@@ -20,7 +20,7 @@ extern "C" {
#undef android_content_res_AssetManager_DEBUG_REFS
#define android_content_res_AssetManager_DEBUG_REFS 0L
#undef android_content_res_AssetManager_STYLE_NUM_ENTRIES
#define android_content_res_AssetManager_STYLE_NUM_ENTRIES 6L
#define android_content_res_AssetManager_STYLE_NUM_ENTRIES 7L
#undef android_content_res_AssetManager_STYLE_TYPE
#define android_content_res_AssetManager_STYLE_TYPE 0L
#undef android_content_res_AssetManager_STYLE_DATA
@@ -33,6 +33,8 @@ extern "C" {
#define android_content_res_AssetManager_STYLE_CHANGING_CONFIGURATIONS 4L
#undef android_content_res_AssetManager_STYLE_DENSITY
#define android_content_res_AssetManager_STYLE_DENSITY 5L
#undef android_content_res_AssetManager_STYLE_SOURCE_RESOURCE_ID
#define android_content_res_AssetManager_STYLE_SOURCE_RESOURCE_ID 6L
/*
* Class: android_content_res_AssetManager
* Method: getPooledString
@@ -209,6 +211,14 @@ JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_loadResourceValue
JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_loadResourceBagValue
(JNIEnv *, jobject, jint, jint, jobject, jboolean);
/*
* Class: android_content_res_AssetManager
* Method: applyStyle
* Signature: (JJII[IIJJ)V
*/
JNIEXPORT void JNICALL Java_android_content_res_AssetManager_applyStyle
(JNIEnv *, jclass, jlong, jlong, jint, jint, jintArray, jint, jlong, jlong);
/*
* Class: android_content_res_AssetManager
* Method: resolveAttrs
@@ -217,6 +227,14 @@ JNIEXPORT jint JNICALL Java_android_content_res_AssetManager_loadResourceBagValu
JNIEXPORT jboolean JNICALL Java_android_content_res_AssetManager_resolveAttrs
(JNIEnv *, jclass, jlong, jint, jint, jintArray, jintArray, jintArray, jintArray);
/*
* Class: android_content_res_AssetManager
* Method: retrieveAttributes
* Signature: (J[IIJJ)Z
*/
JNIEXPORT jboolean JNICALL Java_android_content_res_AssetManager_retrieveAttributes
(JNIEnv *, jobject, jlong, jintArray, jint, jlong, jlong);
/*
* Class: android_content_res_AssetManager
* Method: getArraySize