summaryrefslogtreecommitdiff
path: root/tools/aapt/ResourceTable.h
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2014-11-19 17:49:26 -0800
committerAdam Lesinski <adamlesinski@google.com>2014-12-03 15:59:20 -0800
commit9b624c186cb6059dfb3ec24bfb6386a0fc17b88c (patch)
treee57516e076eddb75d4c657704522f43067153c2a /tools/aapt/ResourceTable.h
parent92ad4dd017a13364b4001bdb04911202932f81c2 (diff)
AAPT: Move private attrs to new type for framework
Private attributes are typically placed after public attributes in the resource table. Each time a new version of the Android framework is released, new public attributes take the place of the private attributes, and the private attributes are shifted after the new public ones. This means that any apps built against the newer SDK may inadvertently be using private attributes on older devices. This change moves all private attributes to a completely different type ID, so there will never be collisions across versions. These private attributes are automatically moved to a synthesized type only for the system resources. Bug:18263655 Change-Id: I7a850512953fadcc9f3524d509cea30249782db8
Diffstat (limited to 'tools/aapt/ResourceTable.h')
-rw-r--r--tools/aapt/ResourceTable.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/aapt/ResourceTable.h b/tools/aapt/ResourceTable.h
index db392c891bfc..81590bc961db 100644
--- a/tools/aapt/ResourceTable.h
+++ b/tools/aapt/ResourceTable.h
@@ -470,6 +470,14 @@ public:
bool overlay = false,
bool autoAddOverlay = false);
+ bool isPublic(const String16& entry) const {
+ return mPublic.indexOfKey(entry) >= 0;
+ }
+
+ sp<ConfigList> removeEntry(const String16& entry);
+
+ SortedVector<ConfigDescription> getUniqueConfigs() const;
+
const SourcePos& getFirstPublicSourcePos() const { return *mFirstPublicSourcePos; }
int32_t getPublicIndex() const { return mPublicIndex; }
@@ -479,19 +487,16 @@ public:
status_t applyPublicEntryOrder();
- const SortedVector<ConfigDescription>& getUniqueConfigs() const { return mUniqueConfigs; }
-
const DefaultKeyedVector<String16, sp<ConfigList> >& getConfigs() const { return mConfigs; }
const Vector<sp<ConfigList> >& getOrderedConfigs() const { return mOrderedConfigs; }
-
const SortedVector<String16>& getCanAddEntries() const { return mCanAddEntries; }
const SourcePos& getPos() const { return mPos; }
+
private:
String16 mName;
SourcePos* mFirstPublicSourcePos;
DefaultKeyedVector<String16, Public> mPublic;
- SortedVector<ConfigDescription> mUniqueConfigs;
DefaultKeyedVector<String16, sp<ConfigList> > mConfigs;
Vector<sp<ConfigList> > mOrderedConfigs;
SortedVector<String16> mCanAddEntries;
@@ -527,6 +532,8 @@ public:
const DefaultKeyedVector<String16, sp<Type> >& getTypes() const { return mTypes; }
const Vector<sp<Type> >& getOrderedTypes() const { return mOrderedTypes; }
+ void movePrivateAttrs();
+
private:
status_t setStrings(const sp<AaptFile>& data,
ResStringPool* strings,