From 9e4f52b2e5c76791edc885397389771692c0de8a Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Thu, 19 Sep 2019 12:15:52 -0700 Subject: Parse and abstract resource mapping This change introduces idmap parsing of tags. The tag allows one to explicitly map resources in the target to either a resource in the overlay or an inline attribute value. Use the android:resourcesMap atttribute on the tag in the android manifest to specify a file to provide the resource mapping. Bug: 135943783 Bug: 135051420 Test: idmap2_tests Change-Id: I1740dcdc01849c43b1f2cb8c6645d666dbb05dba --- libs/androidfw/ResourceTypes.cpp | 5 +++++ libs/androidfw/include/androidfw/ResourceTypes.h | 2 ++ 2 files changed, 7 insertions(+) (limited to 'libs') diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp index 535386920265..3fe2c5b0e21a 100644 --- a/libs/androidfw/ResourceTypes.cpp +++ b/libs/androidfw/ResourceTypes.cpp @@ -1063,6 +1063,11 @@ size_t ResStringPool::bytes() const return (mError == NO_ERROR) ? mHeader->header.size : 0; } +const void* ResStringPool::data() const +{ + return mHeader; +} + bool ResStringPool::isSorted() const { return (mHeader->flags&ResStringPool_header::SORTED_FLAG)!=0; diff --git a/libs/androidfw/include/androidfw/ResourceTypes.h b/libs/androidfw/include/androidfw/ResourceTypes.h index fc635aaeb0d8..c8ace90e6515 100644 --- a/libs/androidfw/include/androidfw/ResourceTypes.h +++ b/libs/androidfw/include/androidfw/ResourceTypes.h @@ -523,6 +523,8 @@ public: size_t size() const; size_t styleCount() const; size_t bytes() const; + const void* data() const; + bool isSorted() const; bool isUTF8() const; -- cgit v1.2.3-59-g8ed1b