diff options
-rw-r--r-- | core/java/android/content/res/AssetManager.java | 1 | ||||
-rw-r--r-- | core/java/android/content/res/Resources.java | 51 | ||||
-rw-r--r-- | core/jni/android_util_AssetManager.cpp | 12 | ||||
-rw-r--r-- | include/utils/ResourceTypes.h | 1 | ||||
-rw-r--r-- | libs/utils/ResourceTypes.cpp | 23 |
5 files changed, 19 insertions, 69 deletions
diff --git a/core/java/android/content/res/AssetManager.java b/core/java/android/content/res/AssetManager.java index b18e7fc..3d937d8 100644 --- a/core/java/android/content/res/AssetManager.java +++ b/core/java/android/content/res/AssetManager.java @@ -760,7 +760,6 @@ public final class AssetManager { private native final int newTheme(); private native final void deleteTheme(int theme); /*package*/ native static final void applyThemeStyle(int theme, int styleRes, boolean force); - /*package*/ native static final void setAttributeValue(int theme, int attr, int color); /*package*/ native static final void copyTheme(int dest, int source); /*package*/ native static final int loadThemeAttributeValue(int theme, int ident, TypedValue outValue, diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java index 40e3703..5467055 100644 --- a/core/java/android/content/res/Resources.java +++ b/core/java/android/content/res/Resources.java @@ -580,7 +580,7 @@ public class Resources { return loadDrawable(value, id); } } - + /** * Return a movie object associated with the particular resource ID. * @param id The desired resource identifier, as generated by the aapt @@ -959,11 +959,6 @@ public class Resources { AssetManager.applyThemeStyle(mTheme, resid, force); } - /** @hide */ - public void setAttributeValue(int attr, int color) { - AssetManager.setAttributeValue(mTheme, attr, color); - } - /** * Set this theme to hold the same contents as the theme * <var>other</var>. If both of these themes are from the same @@ -1128,40 +1123,33 @@ public class Resources { array.mRsrcs = attrs; array.mXml = parser; - boolean foo = false; - if (foo) { + if (false) { int[] data = array.mData; System.out.println("Attributes:"); String s = " Attrs:"; int i; - if(set != null){ - for (i=0; i<set.getAttributeCount(); i++) { - s = s + " " + set.getAttributeName(i); - int id = set.getAttributeNameResource(i); - if (id != 0) { - s = s + "(0x" + Integer.toHexString(id) + ")"; - } - s = s + "=" + set.getAttributeValue(i); + for (i=0; i<set.getAttributeCount(); i++) { + s = s + " " + set.getAttributeName(i); + int id = set.getAttributeNameResource(i); + if (id != 0) { + s = s + "(0x" + Integer.toHexString(id) + ")"; } + s = s + "=" + set.getAttributeValue(i); } - System.out.println(s); - - if(true){ - s = " Found:"; - TypedValue value = new TypedValue(); - for (i=0; i<attrs.length; i++) { - int d = i*AssetManager.STYLE_NUM_ENTRIES; - value.type = data[d+AssetManager.STYLE_TYPE]; - value.data = data[d+AssetManager.STYLE_DATA]; - value.assetCookie = data[d+AssetManager.STYLE_ASSET_COOKIE]; - value.resourceId = data[d+AssetManager.STYLE_RESOURCE_ID]; - s = s + " 0x" + Integer.toHexString(attrs[i]) - + "=" + value; - } - System.out.println(s); + s = " Found:"; + TypedValue value = new TypedValue(); + for (i=0; i<attrs.length; i++) { + int d = i*AssetManager.STYLE_NUM_ENTRIES; + value.type = data[d+AssetManager.STYLE_TYPE]; + value.data = data[d+AssetManager.STYLE_DATA]; + value.assetCookie = data[d+AssetManager.STYLE_ASSET_COOKIE]; + value.resourceId = data[d+AssetManager.STYLE_RESOURCE_ID]; + s = s + " 0x" + Integer.toHexString(attrs[i]) + + "=" + value; } + System.out.println(s); } return array; @@ -1258,7 +1246,6 @@ public class Resources { array.mRsrcs = attrs; array.mXml = parser; - return array; } diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp index bc646d5..f716174 100644 --- a/core/jni/android_util_AssetManager.cpp +++ b/core/jni/android_util_AssetManager.cpp @@ -831,16 +831,6 @@ static void android_content_AssetManager_applyThemeStyle(JNIEnv* env, jobject cl theme->applyStyle(styleRes, force ? true : false); } -static void android_content_AssetManager_setAttributeValue(JNIEnv* env, jobject clazz, - jint themeInt, - jint attribute, - jint value) -{ - ResTable::Theme* theme = (ResTable::Theme*)themeInt; - theme->setAttributeValue(attribute, value); -} - - static void android_content_AssetManager_copyTheme(JNIEnv* env, jobject clazz, jint destInt, jint srcInt) { @@ -1802,8 +1792,6 @@ static JNINativeMethod gAssetManagerMethods[] = { (void*) android_content_AssetManager_getArraySize }, { "retrieveArray","(I[I)I", (void*) android_content_AssetManager_retrieveArray }, - { "setAttributeValue", "(III)V", - (void*) android_content_AssetManager_setAttributeValue }, // XML files. { "openXmlAssetNative", "(ILjava/lang/String;)I", diff --git a/include/utils/ResourceTypes.h b/include/utils/ResourceTypes.h index a9dddaa..bcc0d85 100644 --- a/include/utils/ResourceTypes.h +++ b/include/utils/ResourceTypes.h @@ -1733,7 +1733,6 @@ public: status_t applyStyle(uint32_t resID, bool force=false); status_t setTo(const Theme& other); - void setAttributeValue(uint32_t attribute, uint32_t value); /** * Retrieve a value in the theme. If the theme defines this diff --git a/libs/utils/ResourceTypes.cpp b/libs/utils/ResourceTypes.cpp index 697db9f..b2ec19b 100644 --- a/libs/utils/ResourceTypes.cpp +++ b/libs/utils/ResourceTypes.cpp @@ -1307,29 +1307,6 @@ ResTable::Theme::package_info* ResTable::Theme::copy_package(package_info* pi) return newpi; } -void ResTable::Theme::setAttributeValue(uint32_t attrID, uint32_t value) -{ - const ssize_t p = mTable.getResourcePackageIndex(attrID); - const uint32_t t = Res_GETTYPE(attrID); - const uint32_t e = Res_GETENTRY(attrID); - - TABLE_NOISY(LOGV("Looking up attr 0x%08x in theme %p", attrID, this)); - - if (p >= 0) { - const package_info* const pi = mPackages[p]; - if (pi != NULL) { - if (t < pi->numTypes) { - const type_info& ti = pi->types[t]; - if (e < ti.numEntries) { - theme_entry& te = ti.entries[e]; - te.value.data = value; - te.value.dataType = Res_value::TYPE_FIRST_INT; - } - } - } - } -} - status_t ResTable::Theme::applyStyle(uint32_t resID, bool force) { const bag_entry* bag; |