32e7501a27f0f19bccdf9e91f9b87869c093f695 |
10-May-2017 |
Adam Lesinski <adamlesinski@google.com> |
Fix support for @empty in style resolution If @empty is encountered in XML, do not fallback to searching through the theme. Bug: 36891052 Test: make aapt2_tests Test: bit CtsContentTestCases:android.content.res.cts.TypedArrayTest Change-Id: Ie3bf7b70af9c7913513a1092afd95d26bec5e635
.h
uild
es/layout/layout.xml
es/values/styles.xml
tyles.apk
|
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
.h
es/values/styles.xml
tyles.apk
|
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
.h
uild
uild.sh
ayout.xml
esources.arsc
tyles.apk
|
7a37b74d37ff79e805c9e97d977e07bfec753c5a |
12-Oct-2016 |
Adam Lesinski <adamlesinski@google.com> |
Add tests for attribute resolution - Adds unit tests for attribute resolution. These include some test data resource tables and compiled XML files. - Convert touched files to Google style guide. Test: make libandroidfw_tests Change-Id: Ib3a36061dc874de5f6a266b4e82c0a12ef435f23
ndroidManifest.xml
.h
uild.sh
ayout.xml
es/layout/layout.xml
es/values/styles.xml
esources.arsc
|