History log of /frameworks/base/libs/androidfw/tests/Theme_test.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
929d6517dfd338f0d481dbe6587643d5aef27ec6 17-Jan-2017 Adam Lesinski <adamlesinski@google.com> AssetManager2: Add GetResourceId

Add ability to lookup a resource by name.

Test: make libandroidfw_tests
Change-Id: I262ba5ce4c9892458226fbdb44cf21f9877fb92d
/frameworks/base/libs/androidfw/tests/Theme_test.cpp
0c40524953f3d36a880f91183302a2ea5c722930 14-Jan-2017 Adam Lesinski <adamlesinski@google.com> AssetManager2: Add other support methods

- Add GetResourceConfigurations()
- Add GetResourceLocales()
- Add ResolveReference()
- Add stub for GetResourceId()
- Change LoadedArsc and ApkAssets factory method to return const

Test: make libandroidfw_tests
Change-Id: Ia797dc9381a523b1a3e7029048a413e544730379
/frameworks/base/libs/androidfw/tests/Theme_test.cpp
da431a22da38f9c4085b5d71ed9a9c6122c6a5a6 29-Dec-2016 Adam Lesinski <adamlesinski@google.com> libandroidfw: Add new support for shared libraries

This adds support for shared resource libraries in the new
ResTable/AssetManager implementation.

The dynamic package map encoded in resources.arsc is parsed
and stored with LoadedArsc, and combined to form a resolved table
in AssetManager2.

Benchmarks show that this implementation is an order of magnitude
faster on angler-userdebug (make libandroidfw_benchmarks).

Test: libandroidfw_tests
Change-Id: I57c80248728b63b162bf8269ac9495b53c3e7fa0
/frameworks/base/libs/androidfw/tests/Theme_test.cpp
7ad1110ecd6a840fcd2895c62668828a1ca029c6 29-Oct-2016 Adam Lesinski <adamlesinski@google.com> New implementation of AssetManager/ResTable

The multiwindow model and Resources-per-activity
model that came in N puts greater demands on AssetManagers.
They are created whenever window dimensions change, which
can be frequently. There is a need to be able to cheaply
create a new AssetManager for each Activity, which shares
a lot of underlying state.

In order to make the creation of AssetManagers cheap,
we need a new implementation of the native AssetManager
and ResTable to support immutable representations of
APKs. This new data structure/class is ApkAssets.

ApkAssets have the same functionality of an AssetManager, except
that they operate on a single APK, and they do not do any caching.
Once loaded, they are immutable.

ApkAssets will be exposed as a Java object, with its implementation in
native code. The existing Java StringBlock will be owned by ApkAssets,
which means that Strings can be shared across AssetManagers.

ApkAssets can be cached by the ResourcesManager. Creating an AssetManager
requires only a list of ApkAssets and a configuration.

AssetManager2 (named with the suffix '2' for now while transitioning
to the new implementation) caches bags that are accessed.

Since ApkAssets are expected to be kept around longer, they do more validation
of the resource table, which cause slower load times. Measured on an angler-userdebug,
loading the framework assets takes 11ms with ApkAssets, and 2ms with the old
AssetManager implementation.

The tradeoff is that there does not need to be any security checks once an ApkAssets
is loaded, and regular resource retrieval is faster. Measured on an angler-userdebug,
accessing resource (android:string/ok) with many locales takes 18us with AssetManager2,
and 19us with AssetManager (this is per resource, so these add up).

Test: make libandroidfw_tests
Change-Id: Id0e57ee828f17008891fe3741935a9be8830b01d
/frameworks/base/libs/androidfw/tests/Theme_test.cpp
4c67a475a334e4f65238d439a3339195e03c03be 11-Nov-2016 Adam Lesinski <adamlesinski@google.com> Make tests use APKs instead of exploded APKs

Tests would expect parts of the APK to be unzipped and
maintained. Instead, we now decompress the required files
from the test APKs on test setup. This simplifies
test maintenance substantially.

Test: make libandroidfw_tests && libandroidfw_tests --testdata=frameworks/base/libs/androidfw/tests/data
Change-Id: I3d2100af22df913e02401dedcf9842cdb32b2a3b
/frameworks/base/libs/androidfw/tests/Theme_test.cpp
9d9cc6233c7035c32d3b8622aa5dc7d413193dc7 29-Aug-2014 Adam Lesinski <adamlesinski@google.com> Add test to ensure themes get copied from separate resource tables

Change-Id: I94e9966cf1e9d0e7e6c7daa0606a87bb0f67705e
/frameworks/base/libs/androidfw/tests/Theme_test.cpp