summaryrefslogtreecommitdiff
path: root/libs/androidfw/AttributeResolution.cpp
AgeCommit message (Collapse)Author
2020-12-08Revert^2 "Cache resolved theme values"Ryan Mitchell
6ca48473e533a8b89abac6294a0bb8130b8c8c89 Change-Id: Icb295186b85e1edcdcebc1d746f7ff0d6ef66829 Merged-In: Icb295186b85e1edcdcebc1d746f7ff0d6ef66829
2020-12-08Set resource id correctly when resolve failsRyan Mitchell
If for some reason the resource id cannot be resolved to a value (there is no configuration that matches the AssetManager configuration or some error occurs), set the resource id of the SelectedValue to the resource id that could not be resolved. This was the behavior before the AssetManager IncFs hardening refactor. Bug: 173203252 Test: atest com.google.android.config.pts.PreinstalledAppsTestCase Test: Chrome icon appears on launcher Change-Id: Iad1760c0e246da1a4bf64d1c2ec60bb08da32d06 Merged-In: Iad1760c0e246da1a4bf64d1c2ec60bb08da32d06
2020-12-08Revert^2 "libandroidfw hardening for IncFs"Ryan Mitchell
55ef6167a2c235bd88c7216238b2001b46795b79 Change-Id: I02d4890d181655dfd0a14c188468db512559d27b Merged-In: I02d4890d181655dfd0a14c188468db512559d27b
2019-03-07Clean up attribute apis based on api council feedback.Aurimas Liutikas
Bug: 127714248 Test: None Change-Id: I40596a88e7e446c6a25f2b9074bb88a0a417ed63
2019-01-31Update TypedArray and TypedValue to store source layouts.Aurimas Liutikas
In ag/5859897 we started tracking source styles for each TypedValue. It is also useful to keep track of source layouts if the attribute was resolved against a layout (attribute set in XML layout inside of <View> tag). Test: atest CtsContentTestCases:android.content.res.cts.TypedArrayTest Bug: 111439551 Change-Id: Ie6bc6ecd9a22b536a2f3288263b896f9cec67d38
2019-01-15Add source style for each TypedValue.Aurimas Liutikas
This API will be used by Android Studio layout inspector to query where a given resource attribute originated from to allow developers to have an easier way to find what needs to be changed to affect a given resource attribute. Test: CTS added in the topic Bug: 111439551 Change-Id: Ifbb52b39912ed0444030a86164290a1cd4155250
2019-01-14Merge "Fix/suppress androidfw google-explicit-constructor warnings" am: ↵Chih-Hung Hsieh
392f0052c2 am: 99a3d72b98 am: cd06f9ee04 Change-Id: I0340acdbd6530f9bd9f67333974bcc65ff97e0e5
2019-01-10Fix/suppress androidfw google-explicit-constructor warningsChih-Hung Hsieh
* Add explicit to conversion constructors/operators * Use NOLINT or NOLINTNEXTLINE to suppress warnings on intended converters Bug: 28341362 Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor Change-Id: Id02c36c24f5708584e317c035cef3ef2762b537e
2018-11-16Add style value to ResolvedBag in AssetManager2.Aurimas Liutikas
Bug: 117176857 Test: updated AssetManager2Test.MergesStylesWithParentFromSingleApkAssets Change-Id: I2b79eea8e43431a932756b267b91eb4423c968a5
2018-02-28Refactor AssetManagerAdam Lesinski
Bug: 64071469 Test: atest CtsContentTestCases Change-Id: Ia6856157e8813856268fba003e1e591d690cb26e
2018-02-09Revert "Replace AssetManager with AssetManager2 implementation"Adam Lesinski
This reverts commit 1187590da38457809dd368d4901c9c47ac5a6958. Bug: 73134570 Change-Id: I59b4d714e447478ea124f086356f127f42251fb7
2018-02-05Replace AssetManager with AssetManager2 implementationAdam Lesinski
Test: atest CtsContentTestCases:android.content.res.cts Test: make libandroidfw_tests Change-Id: I2bb6d7656d2516d371e83e541ed02f91405f6d94
2018-01-25Revert "Replace AssetManager with AssetManager2 implementation"Adam Lesinski
This reverts commit dcb3c6559b09ec89771858ec27a787027da9af50. Bug:72511998 Change-Id: I665966ca109f66f85d8665db388c71ea2303c3b8
2018-01-24Replace AssetManager with AssetManager2 implementationAdam Lesinski
Test: atest CtsContentTestCases:android.content.res.cts Test: make libandroidfw_tests Change-Id: I572eb13c6a4372c7f656f5912821cececd5bf3d4
2018-01-23Revert "Replace AssetManager with AssetManager2 implementation"Adam Lesinski
This reverts commit b20a0ce59f59cb5ec857748e056cc341dbd13b92.
2018-01-09Replace AssetManager with AssetManager2 implementationAdam Lesinski
Test: Existing CTS tests pass Test: make libandroidfw_tests Change-Id: I858f7e1d909c08273b096601136e3f28e15eb5d4
2017-05-11Fix support for @empty in style resolutionAdam Lesinski
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
2017-01-12Replace cutils/log.h and android/log.h with log/log.hMark Salyzyn
Test: compile Bug: 34250038 Change-Id: I42185a879beaa9bb244f53a968800392b854ac45
2017-01-06libandroidfw: Revert null check in ApplyStyleAdam Lesinski
The out parameter `out_indices` is expected to be non-null and so the extra null check adds a cost to performance and opens the door to misusing the API by not supplying `out_indices`. Test: make libandroidfw_tests Change-Id: Ie66fd837c5e24ec2838156e7b67f54c15cd27933
2016-12-05Make tests use APKs instead of exploded APKsAdam Lesinski
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
2016-12-02Clean up ApplyStyle JNIJohn Reck
Bug: 32573798 Mark input uint32_t[] as const. Use Read-only JNI array access for input as it's faster than critical access. Use non-movable arrays for TypedArray so that the address can be resolved and stored, avoiding the need to do JNI array access for the output. Indicies is always non-null, so remove the optional checks. Eliminate unused return value. Benchmark results: twelveKeyInflate 4963us -> 4713us simpleViewInflate 73us -> 60us Test: Device boots, benchmarks show faster Change-Id: Ic3bde5aee31407d8903913f97f2218daf074499a
2016-10-17Add tests for attribute resolutionAdam Lesinski
- 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
2016-10-12Move attribute resolution from core/jni to libandroidfwAdam Lesinski
Without the entire JNI environment, testing the attribute resolution code will be much easier and enable safer refactoring. Change-Id: I2815cc1e10a694a3b01bc37e191a0d5e9d0e6735 Test: Existing CTS tests pass