summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSergey Ten <sergey.ten6@t-mobile.com>2009-09-07 10:33:56 -0700
committerSergey Ten <sergey.ten6@t-mobile.com>2009-09-23 08:15:59 -0700
commitfd2649b1b6f5c7750c9cb0f13a6cc80522d09678 (patch)
treea9327a292b69ac78f2bd1d7459fe7ba9db847abb /include
parent3aa0e5063251d5f33c5f1b496f26b7d7fe7f9fb7 (diff)
downloadframeworks_base-fd2649b1b6f5c7750c9cb0f13a6cc80522d09678.zip
frameworks_base-fd2649b1b6f5c7750c9cb0f13a6cc80522d09678.tar.gz
frameworks_base-fd2649b1b6f5c7750c9cb0f13a6cc80522d09678.tar.bz2
Add support for modifying ResTable on fly.
This change allows to either delete or add asset path after a ResTable object has been created for a given AssetManager. In past, the lack of such support forced us to implement update configuration functionality suboptimally, by recreating new AssetManager object from scratch on theme change. With this change, we can simply remove the "old" theme asset path and add the new asset path. We also need to make sure the Resources object nukes internal caches. CR:JoshG.
Diffstat (limited to 'include')
-rw-r--r--include/utils/AssetManager.h17
-rw-r--r--include/utils/ResourceTypes.h3
2 files changed, 12 insertions, 8 deletions
diff --git a/include/utils/AssetManager.h b/include/utils/AssetManager.h
index ab1b260..6f2c375 100644
--- a/include/utils/AssetManager.h
+++ b/include/utils/AssetManager.h
@@ -186,15 +186,15 @@ public:
void getLocales(Vector<String8>* locales) const;
/*
- * Mark asset path "stack" to support un-install from the mAssetPaths.
- */
- int markAssetPathStack();
-
- /*
- * Restore asset path "stack" by un-installing from the mAssetPaths
- * all assets installed after restoreIndex.
+ * Remove existing source for assets. It can be either a directory (for
+ * deleting assets as raw files on the disk) or a ZIP file.
+ * Also, updates the ResTable object to reflect the change.
+ *
+ * Returns "true" on success, "false" on failure.
*/
- void restoreAssetPathStack(int restoreIndex);
+ bool removeAssetPath(const String8 &packageName, const String8 &assetPath);
+ bool updateWithAssetPath(const String8& path, void** cookie);
+ void dumpRes();
private:
struct asset_path
@@ -203,6 +203,7 @@ private:
FileType type;
};
+ void updateResTableFromAssetPath(ResTable *rt, const asset_path& ap, void *cookie) const;
Asset* openInPathLocked(const char* fileName, AccessMode mode,
const asset_path& path);
Asset* openNonAssetInPathLocked(const char* fileName, AccessMode mode,
diff --git a/include/utils/ResourceTypes.h b/include/utils/ResourceTypes.h
index e580755..d193550 100644
--- a/include/utils/ResourceTypes.h
+++ b/include/utils/ResourceTypes.h
@@ -1676,9 +1676,12 @@ public:
void getLocales(Vector<String8>* locales) const;
+ void removeAssetsByCookie(const String8 &packageName, void* cookie);
+
#ifndef HAVE_ANDROID_OS
void print() const;
#endif
+ void dump() const;
private:
struct Header;