summaryrefslogtreecommitdiffstats
path: root/tools/aapt
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2014-09-16 14:43:29 -0700
committerAdam Lesinski <adamlesinski@google.com>2014-10-23 10:39:31 -0700
commit40e8eefbedcafc51948945647d746daaee092f16 (patch)
treeeb14bacf3510fc8865145a1c68b4dcb8fc802904 /tools/aapt
parent74af6700196ed55a0aa39c7777293e735e7b4d73 (diff)
downloadframeworks_base-40e8eefbedcafc51948945647d746daaee092f16.zip
frameworks_base-40e8eefbedcafc51948945647d746daaee092f16.tar.gz
frameworks_base-40e8eefbedcafc51948945647d746daaee092f16.tar.bz2
First commit of split-select tool
This tool emits a set of rules as JSON for when a Split APK should match a target device. Change-Id: I8bfbdfbdb51efcfc645889dd03e1961f16e39645
Diffstat (limited to 'tools/aapt')
-rw-r--r--tools/aapt/AaptAssets.cpp5
-rw-r--r--tools/aapt/AaptAssets.h3
-rw-r--r--tools/aapt/ConfigDescription.h3
-rw-r--r--tools/aapt/ResourceIdCache.cpp6
4 files changed, 10 insertions, 7 deletions
diff --git a/tools/aapt/AaptAssets.cpp b/tools/aapt/AaptAssets.cpp
index 117fc24..b7f64f6 100644
--- a/tools/aapt/AaptAssets.cpp
+++ b/tools/aapt/AaptAssets.cpp
@@ -1141,9 +1141,10 @@ bail:
ssize_t AaptAssets::slurpFullTree(Bundle* bundle, const String8& srcDir,
const AaptGroupEntry& kind,
const String8& resType,
- sp<FilePathStore>& fullResPaths)
+ sp<FilePathStore>& fullResPaths,
+ const bool overwrite)
{
- ssize_t res = AaptDir::slurpFullTree(bundle, srcDir, kind, resType, fullResPaths);
+ ssize_t res = AaptDir::slurpFullTree(bundle, srcDir, kind, resType, fullResPaths, overwrite);
if (res > 0) {
mGroupEntries.add(kind);
}
diff --git a/tools/aapt/AaptAssets.h b/tools/aapt/AaptAssets.h
index d809c5b..7ae5368 100644
--- a/tools/aapt/AaptAssets.h
+++ b/tools/aapt/AaptAssets.h
@@ -591,7 +591,8 @@ private:
const String8& srcDir,
const AaptGroupEntry& kind,
const String8& resType,
- sp<FilePathStore>& fullResPaths);
+ sp<FilePathStore>& fullResPaths,
+ const bool overwrite=false);
ssize_t slurpResourceTree(Bundle* bundle, const String8& srcDir);
ssize_t slurpResourceZip(Bundle* bundle, const char* filename);
diff --git a/tools/aapt/ConfigDescription.h b/tools/aapt/ConfigDescription.h
index 779c423..4f999a2 100644
--- a/tools/aapt/ConfigDescription.h
+++ b/tools/aapt/ConfigDescription.h
@@ -28,10 +28,12 @@ struct ConfigDescription : public android::ResTable_config {
memset(this, 0, sizeof(*this));
size = sizeof(android::ResTable_config);
}
+
ConfigDescription(const android::ResTable_config&o) {
*static_cast<android::ResTable_config*>(this) = o;
size = sizeof(android::ResTable_config);
}
+
ConfigDescription(const ConfigDescription&o) {
*static_cast<android::ResTable_config*>(this) = o;
}
@@ -41,6 +43,7 @@ struct ConfigDescription : public android::ResTable_config {
size = sizeof(android::ResTable_config);
return *this;
}
+
ConfigDescription& operator=(const ConfigDescription& o) {
*static_cast<android::ResTable_config*>(this) = o;
return *this;
diff --git a/tools/aapt/ResourceIdCache.cpp b/tools/aapt/ResourceIdCache.cpp
index d60a07f..8835fb0 100644
--- a/tools/aapt/ResourceIdCache.cpp
+++ b/tools/aapt/ResourceIdCache.cpp
@@ -9,8 +9,6 @@
#include <utils/Log.h>
#include "ResourceIdCache.h"
#include <map>
-using namespace std;
-
static size_t mHits = 0;
static size_t mMisses = 0;
@@ -29,7 +27,7 @@ struct CacheEntry {
CacheEntry(const android::String16& name, uint32_t resId) : hashedName(name), id(resId) { }
};
-static map< uint32_t, CacheEntry > mIdMap;
+static std::map< uint32_t, CacheEntry > mIdMap;
// djb2; reasonable choice for strings when collisions aren't particularly important
@@ -63,7 +61,7 @@ uint32_t ResourceIdCache::lookup(const android::String16& package,
bool onlyPublic) {
const String16 hashedName = makeHashableName(package, type, name, onlyPublic);
const uint32_t hashcode = hash(hashedName);
- map<uint32_t, CacheEntry>::iterator item = mIdMap.find(hashcode);
+ std::map<uint32_t, CacheEntry>::iterator item = mIdMap.find(hashcode);
if (item == mIdMap.end()) {
// cache miss
mMisses++;