It isn't enough to only dump the theme id and name because there is
no whole theme inheritance map. Developers need the map to figure out
why the attribute value is so strange.
A theme is a kind of style. This patch creates an API to retrieve the
parent id for any style. And, it dumps the whole inheritance between
themes until it can't find the parent style.
Test: manual test described in b/209708201#comment5
Bug: 209708201
Change-Id: I9de0e6e9aaeff7cb9fc89dc9b8a04925e84f975c
The native code that underlies `Resources#getIdentifier()` did not take
sparse encoding into account when calculating offsets, resulting in
either garbage or SEGV_MAPERR whenever a resource is first encountered
in a sparsely encoded configuration.
Bug: 197976367
Test: atest libandroidfw_tests --host
Change-Id: Ib7550fe2e05005550f59129a06be5712b74bc9c8
(cherry picked from commit 984e897303)
Need to have the same kind of data size check as in other
types parsing
Bug: 203938029
Test: manual
Change-Id: I9f5d2851ff59da90163ead6c0416f0bba3868cc4
Merged-In: I9f5d2851ff59da90163ead6c0416f0bba3868cc4
(cherry picked from commit 8002034e6b)
Need to have the same kind of data size check as in other
types parsing
Bug: 203938029
Test: manual
Change-Id: I9f5d2851ff59da90163ead6c0416f0bba3868cc4
Merged-In: I9f5d2851ff59da90163ead6c0416f0bba3868cc4
(cherry picked from commit 8002034e6b)
Need to have the same kind of data size check as in other
types parsing
Bug: 203938029
Test: manual
Change-Id: I9f5d2851ff59da90163ead6c0416f0bba3868cc4
This reverts commit 30715f3afc.
Reason for revert: roll forward with fix
Change-Id: I6d63e6fa508501f2d029eeb4647d4d70c152ceb3
Test: ran all previously failing tests locally
Fixes: 183136881
Revert "Update getDrawableForDensity test to allow either of the..."
Revert submission 16132603-183136881
Reason for revert: causes post submit failures
Reverted Changes:
I42ff7cdee:Revert "Revert "Always select the next higher dens...
Id4a93f857:Update getDrawableForDensity test to allow either ...
Change-Id: Idcc4c7b909256c65bc0f4e7815bb2d9093e66830
libandroidfw_test is not triggered when ag/15987448 modify
libandroidfw. After the experiments in b/180720568,
`cc_test { support_host: true}` should add back to TEST_MAPPING.
Test: atest --dry-run -p frameworks/base/libs/androidfw
Bug: 180720568
Bug: 178646865
Change-Id: I5c97c860670d57504f97ef10ad296fb57176fd5c
This reverts commit 932970c696.
Reason for revert: roll forward with fix
Change-Id: I42ff7cdee2ed84b55b25fbbaa68525fed43ebd9b
Test: updated and ran the failing test locally to confirm fix
Fixes: 183136881
Due to the output format changes, revise the PosixUtils_test to fix
the failures.
Fix: 203494455
Test: atest libandroidfw_tests
Change-Id: I6e84f8011031162f9e46aa89ddf8d3f3b9863251
Print the best matching configuration from the given resource while
looking up for better understanding why an overlay isn't taken.
Bug: 193701453
Test: atest AssetManager2Test libandroidfw_tests
Test: manually install a target package has values and values-en,
and an overlay package only has values. Then, use overlay
lookup command to check if the output shows related info.
Change-Id: I0cb415b9e932e1d4bfd0be2e1768adeb78e7b7d0
The native code that underlies `Resources#getIdentifier()` did not take
sparse encoding into account when calculating offsets, resulting in
either garbage or SEGV_MAPERR whenever a resource is first encountered
in a sparsely encoded configuration.
Bug: 197976367
Test: atest libandroidfw_tests --host
Change-Id: Ib7550fe2e05005550f59129a06be5712b74bc9c8
stdout and stderr are macros in musl, which causes build failures
when they are used as field names. Rename the fields to stdout_str
and stderr_str.
Test: builds
Merged-In: I04770d2d6e82ca8393308ab12a304838a80f0ae5
Change-Id: I04770d2d6e82ca8393308ab12a304838a80f0ae5
stdout and stderr are macros in musl, which causes build failures
when they are used as field names. Rename the fields to stdout_str
and stderr_str.
Test: builds
Change-Id: I04770d2d6e82ca8393308ab12a304838a80f0ae5
This change removes an unneeded debug log in CursorWindow that uses
0.37% of gms.persistent CPU.
Test: Build and flash
Bug: 184541591
Change-Id: I95683af27904db8d5ec61761dfda6d6d53ddbbef
Memory churn is high when swapping the ResourcesImpl of a Resources
object. Each time Resources#setImpl is invoked, all themes based on
that Resources object are assigned new ThemeImpl objects that are
created using the new ResourcesImpl.
ThemeImpls can only belong to one Theme object, so the old
implementation is discarded and the theme takes ownership of the new
ThemeImp.
This creates performance problems when framework overlays are toggled.
Toggling overlays targeting the framework causes all themes across all
processes to recreate and reallocate all of their themes. By rebasing
the ThemeImpl on the new ResourcesImpl without deallocating the native
theme memory, we reduce churn and produce less garbage that needs to
be garbage collected.
Bug: 141198925
Test: atest libandroidfw_tests
Test: atest ResourcesPerfWorkloads
Change-Id: I03fb31ee09c9cfdbd3c41bcf0b605607dab54ed7
Themes are represented in the native layer using an array where the
entry id of resource ids are used to index into the array. This causes
native allocation size of a theme to correlate with the largest
attribute resource id in the styles applied to the theme.
From manual testing, I determined that on average in 1P apps and
system_server only 10-20% of the space allocated for themes actually
hold theme attribute values and the rest is empty/unused space.
Using std::vector and std::lower_bound to create a sparse array
representation will reduce amount of memory allocated by themes while
having a minimal impact on the performance of querying the attributes
defined in a theme.
From testing with ResourcesPerfWorkloads, this increased time spent in
the resources synthetic benchmarks by ~1%.
Bug: 141198925
Test: atest libandroidfw_tests
Test: atest ResourcesPerfWorkloads
Change-Id: Iec512b31b0545b0898ff248cd23f074a20fff45d
ResourcesHardeningTest is not a test module name.
This is a partial revert of ag/14505818
Bug: 189953380
Test: none
Change-Id: Iebf50714918d64eb52183c1f140ac8dba38b2ae5
Rather than attempt to remove all users of Asset::getBuffer (which
includes AssetManager(1), aapt(1), and other places) and migrate them
to use Asset::getIncFsBuffer, verify the presence of all the data in
the buffer before returning a raw pointer to the buffer data to
guarantee callers will not unexpectedly get a SIGBUS due to incremental
installation.
Bug: 179254882
Test: builds
Change-Id: I24fd9036bc53a8c23166b5471862ee542630fb56
When an application is incrementally installed, and a resources
operation fails due to the resources not being fully present,
the app should crash instead of swallowing the error and
returning default values to not alter the experience of
using the application.
Disable IncFsFileMap protections on ApkAssets that are a part of the
application that is running (base and splits).
Bug: 187220960
Test: atest ResourcesHardeningTest
Change-Id: Ibc67aca688720f983c7c656f404593285a54999b