OSDN Git Service

Support multiple resource tables with same package
authorAdam Lesinski <adamlesinski@google.com>
Fri, 6 Jun 2014 21:27:00 +0000 (14:27 -0700)
committerAdam Lesinski <adamlesinski@google.com>
Wed, 18 Jun 2014 19:20:08 +0000 (19:20 +0000)
commitf90f2f8dc36e7243b85e0b6a7fd5a590893c827e
treeb2fb1fc49961c7c5f5c1712872ce2ffcfe550a89
parentc802c8cda234129c1ce3c7a939bd68a1d5813ce6
Support multiple resource tables with same package

In order to support APK split features, the resource
table needs to support loading multiple resource
tables with the same package but potentially new set
of type IDs.

This adds some complexity as the type ID space changes
from dense and ordered to potentially sparse.

A ByteBucketArray is used to store the type IDs in
a memory efficient way that allows for fast retrieval.

In addition, the IDMAP format has changed. We no longer
need random access to the type data, since we store the
types differently. However, random access to entries of
a given type is still required.

Change-Id: If6f5be680b405b368941d9c1f2b5d2ddca964160
32 files changed:
cmds/idmap/create.cpp
cmds/idmap/idmap.cpp
cmds/idmap/inspect.cpp
include/androidfw/ByteBucketArray.h [new file with mode: 0644]
include/androidfw/ResourceTypes.h
include/androidfw/TypeWrappers.h [new file with mode: 0644]
libs/androidfw/Android.mk
libs/androidfw/AssetManager.cpp
libs/androidfw/ResourceTypes.cpp
libs/androidfw/TypeWrappers.cpp [new file with mode: 0644]
libs/androidfw/tests/Android.mk
libs/androidfw/tests/ByteBucketArray_test.cpp [new file with mode: 0644]
libs/androidfw/tests/Idmap_test.cpp [new file with mode: 0644]
libs/androidfw/tests/ResTable_test.cpp [new file with mode: 0644]
libs/androidfw/tests/ResourceTypes_test.cpp
libs/androidfw/tests/Split_test.cpp [new file with mode: 0644]
libs/androidfw/tests/TestHelpers.h [new file with mode: 0644]
libs/androidfw/tests/TypeWrappers_test.cpp [new file with mode: 0644]
libs/androidfw/tests/data/.gitignore [new file with mode: 0644]
libs/androidfw/tests/data/basic/AndroidManifest.xml [new file with mode: 0644]
libs/androidfw/tests/data/basic/basic_arsc.h [new file with mode: 0644]
libs/androidfw/tests/data/basic/build [new file with mode: 0755]
libs/androidfw/tests/data/basic/res/values-sv/values.xml [new file with mode: 0644]
libs/androidfw/tests/data/basic/res/values/values.xml [new file with mode: 0644]
libs/androidfw/tests/data/overlay/AndroidManifest.xml [new file with mode: 0644]
libs/androidfw/tests/data/overlay/build [new file with mode: 0755]
libs/androidfw/tests/data/overlay/overlay_arsc.h [new file with mode: 0644]
libs/androidfw/tests/data/overlay/res/values/values.xml [new file with mode: 0644]
libs/androidfw/tests/data/split_base_arsc.h [new file with mode: 0644]
libs/androidfw/tests/data/split_de_fr_arsc.h [new file with mode: 0644]
tools/aapt/Resource.cpp
tools/aapt/ResourceTable.cpp