28 Commits

Author SHA1 Message Date
Chih-Hung Hsieh
e8abd06776 Allow implicit-fallthrough warnings locally.
It will be a global error by default.

Test: make checkbuild
Bug: 112564944
Change-Id: I26616fd50ccf3639fa7c01d850a14d079273ede7
Exempt-From-Owner-Approval: do not block on new warnings
2018-10-22 09:56:12 -07:00
Treehugger Robot
120b7fba93 Merge "libandroidfw: introduce ExecuteBinary (POSIX only)" 2018-10-09 21:43:38 +00:00
Mårten Kongstad
5c541f6e36 libandroidfw: move ConfigDescription from aapt2 to libandroidfw
This is to allow idmap2 to access ConfigDescription.

Test: libandroidfw_tests
Test: aapt2_tests
Change-Id: I54210bbbd8dad5903cb7100807df977efa394ad5
Merged-In: I54210bbbd8dad5903cb7100807df977efa394ad5
2018-10-08 09:56:09 -07:00
Mårten Kongstad
2503a49b96 libandroidfw: introduce ExecuteBinary (POSIX only)
Introduce a wrapper around fork and exec.

Test: make libandroidfw_tests
Change-Id: Iff0de5319bb6bb101a3fbef6413dfb4e77198f11
2018-10-04 03:45:32 +00:00
Dan Willemsen
d00c851e55 Merge "Convert to Soong" am: acbd94d76f
am: b1005a8a2a

Change-Id: If5cb26e0669f79240d8fee1d40aaa2162d8e611f
2018-05-15 15:06:19 -07:00
Dan Willemsen
4888b1f6f0 Convert to Soong
See build/soong/README.md for more information.

Test: m libframeworks_coretests_jni
Test: m FrameworkCoreTests_install
Test: m libshim_jni
Test: m CtsShimPrivUpgrade
Test: m libfilterfw
Test: m PMTest_Java_dual
Test: m libdefcontainer_jni
Test: m libperftestscore_jni
Test: m libpmtest32 libpmtest64
Test: m libprintspooler_jni
Test: m libsmartcamera_jni
Test: m idmap
Test: m libdrmframework_jni
Test: m libdvr_loader com.google.vr.platform com.google.vr.platform.xml
Test: m libfilterpack_imageproc libfilterpack_base
Test: m libwebviewchromium_loader
Test: m shared_mem_test
Test: m test-touchlag
Change-Id: I868561dd237fa28647896d59049ab9260373ada1
2018-05-14 16:47:02 -07:00
Adam Lesinski
bebfcc46a2 Refactor AssetManager
Bug: 64071469
Test: atest CtsContentTestCases
Change-Id: Ia6856157e8813856268fba003e1e591d690cb26e
2018-02-28 19:06:48 -08:00
Adam Lesinski
c9a9c1c1c3 Revert "libandroidfw: Add ApplyStyle and SetConfiguration benchmark"
This reverts commit 59f63bd801f10336c9f0499b7a0bc0bccb0fad2e.

Bug: 73134570
Change-Id: I6ace34b0d6545ff001664792b0bb1bbff5b5cbbe
2018-02-09 12:43:13 -08:00
Adam Lesinski
b8b3a26194 Revert "libandroidfw: Improve performance of AssetManager2"
This reverts commit 88c9959e5b417320bbc2484fab42ab4b12379533.

Bug: 73134570
Change-Id: I012643d2b4212cef5aef68feb4146add34f9ecfc
2018-02-09 12:43:10 -08:00
Adam Lesinski
88c9959e5b libandroidfw: Improve performance of AssetManager2
AssetManager2 relied on creating a list of configurations
present in the resource table so as to avoid copying and
converting ResTable_config's from the APK on every
resource retrieval.

ResTable, however, had a better optimization that pruned
the configurations that didn't match the currently set
configuration. This vastly reduced the number of ResTable_configs
to test.

In this CL, AssetManager2 follows suite with this optimization
and only maintains the filtered ResTable_configs, falling back
to the slow path when the configuration is overridden.

Test: mma frameworks/base/libs/androidfw
Test: adb sync system data
Test: adb shell /data/benchmarktest64/libandroidfw_benchmarks/libandroidfw_benchmarks
Change-Id: Ib57b75fbb32e1d310eec146e5a12dfc6de4385f9
2018-02-05 18:38:57 -08:00
Adam Lesinski
59f63bd801 libandroidfw: Add ApplyStyle and SetConfiguration benchmark
Test: mma frameworks/base/libs/androidfw
Test: adb sync system data
Test: adb shell /data/benchmarktest64/libandroidfw_benchmarks/libandroidfw_benchmarks
Change-Id: Ia0e868008a3b32dc8d1c69ed1f2c39f152bb7815
2018-02-05 18:38:57 -08:00
Adam Lesinski
646265cb2a Revert "libandroidfw: Add ApplyStyle and SetConfiguration benchmark"
This reverts commit d9c809c480e22ccced6762268efaa30bb9a6e491.

Bug:72511998
Change-Id: I3be2374e3662fc8397c00f1df1bce6de5f5a4549
2018-01-25 17:34:40 -08:00
Adam Lesinski
0dd369912a Revert "libandroidfw: Improve performance of AssetManager2"
This reverts commit 64ee69d0f1f412edee2eb7a0c846deebbfa37ef9.

Bug:72511998
Change-Id: Iab3ce449e60ec2451d391217543528d312089080
2018-01-25 17:34:39 -08:00
Adam Lesinski
64ee69d0f1 libandroidfw: Improve performance of AssetManager2
AssetManager2 relied on creating a list of configurations
present in the resource table so as to avoid copying and
converting ResTable_config's from the APK on every
resource retrieval.

ResTable, however, had a better optimization that pruned
the configurations that didn't match the currently set
configuration. This vastly reduced the number of ResTable_configs
to test.

In this CL, AssetManager2 follows suite with this optimization
and only maintains the filtered ResTable_configs, falling back
to the slow path when the configuration is overridden.

Test: mma frameworks/base/libs/androidfw
Test: adb sync system data
Test: adb shell /data/benchmarktest64/libandroidfw_benchmarks/libandroidfw_benchmarks
Change-Id: I5d46f8b005a37b72750d00bd75f090e7b5a36f60
2018-01-24 15:19:09 -08:00
Adam Lesinski
d9c809c480 libandroidfw: Add ApplyStyle and SetConfiguration benchmark
Test: mma frameworks/base/libs/androidfw
Test: adb sync system data
Test: adb shell /data/benchmarktest64/libandroidfw_benchmarks/libandroidfw_benchmarks
Change-Id: Ia6b441f186ccb455acbee15723f0d2d5657b09b5
2018-01-24 15:19:09 -08:00
Adam Lesinski
fae57eb4b8 Revert "libandroidfw: Add ApplyStyle and SetConfiguration benchmark"
This reverts commit 62f17129a0c519fe3e591be102b1863024cea3a4.
2018-01-23 03:16:33 -08:00
Adam Lesinski
50706b6ebc Revert "libandroidfw: Improve performance of AssetManager2"
This reverts commit 392132748416719e3df427e6ac8dc11af194342c.
2018-01-23 03:16:16 -08:00
Adam Lesinski
3921327484 libandroidfw: Improve performance of AssetManager2
AssetManager2 relied on creating a list of configurations
present in the resource table so as to avoid copying and
converting ResTable_config's from the APK on every
resource retrieval.

ResTable, however, had a better optimization that pruned
the configurations that didn't match the currently set
configuration. This vastly reduced the number of ResTable_configs
to test.

In this CL, AssetManager2 follows suite with this optimization
and only maintains the filtered ResTable_configs, falling back
to the slow path when the configuration is overridden.

Test: mma frameworks/base/libs/androidfw
Test: adb sync system data
Test: adb shell /data/benchmarktest64/libandroidfw_benchmarks/libandroidfw_benchmarks
Change-Id: I42d53f703623cf7c3f7cbcf194f5026ff540faf4
2018-01-18 10:40:10 -08:00
Adam Lesinski
62f17129a0 libandroidfw: Add ApplyStyle and SetConfiguration benchmark
Test: mma frameworks/base/libs/androidfw
Test: adb sync system data
Test: adb shell /data/benchmarktest64/libandroidfw_benchmarks/libandroidfw_benchmarks
Change-Id: I021bc53e85651dcf5fbd4ebaae72d82be1a03252
2018-01-18 10:40:10 -08:00
Ivan Lozano
6593d714b6 Disable sanitizer entirely in ResourceTypes.cpp
The unsigned integer overflow sanitizer catches an overflow on
Res_GETPACKAGE usages. This is used in a number of places in
ResourceTypes.cpp in a number of large functions. For now, lets disable
the sanitizer in this source file.

Test: Compiles and device boots without runtime errors.
Bug: 30969751
Change-Id: Id9e0776ef819c895a3194a32da5c85459f1af431
Merged-In: Id9e0776ef819c895a3194a32da5c85459f1af431
(cherry picked from commit 02828740da7481a48e7872b22213047025894525)
2017-12-28 09:14:42 -08:00
Ivan Lozano
02828740da Disable sanitizer entirely in ResourceTypes.cpp
The unsigned integer overflow sanitizer catches an overflow on
Res_GETPACKAGE usages. This is used in a number of places in
ResourceTypes.cpp in a number of large functions. For now, lets disable
the sanitizer in this source file.

Test: Compiles and device boots without runtime errors.
Bug: 30969751
Change-Id: Id9e0776ef819c895a3194a32da5c85459f1af431
2017-11-07 14:07:17 -08:00
Adam Lesinski
970bd8d283 AssetManager2: Implement IDMAP support
This enables RRO (runtime resource overlays) with AssetManager2

Test: make libandroidfw_tests
Test: out/host/<platform>/nativetest64/libandroidfw_tests/libandroidfw_tests --testdata=frameworks/base/libs/androidfw/tests/data
Change-Id: Id8079104faefbfaa3f4017d8f7ee1a8968f151a2
2017-10-13 10:23:34 -07:00
Adam Lesinski
873ef0e230 libandroidfw_tests: package test data correctly
- Convert to use soong, which allows bundling test data with benchmarks.
- Also separate libandroidfw_benchmarks so that it doesn't depend
on gtest.

Test: manual
Change-Id: I45bd222fafa87172c77b7f5bb2a7a89ddca72361
2017-10-12 16:02:00 -07:00
Dan Willemsen
a2902e38a4 Rename libz-host -> libz
Test: m host
Change-Id: I2806dde519602bc31b622ae3b3f55ab8b1287744
2017-09-27 16:20:31 -07:00
Adam Lesinski
929d6517df AssetManager2: Add GetResourceId
Add ability to lookup a resource by name.

Test: make libandroidfw_tests
Change-Id: I262ba5ce4c9892458226fbdb44cf21f9877fb92d
2017-02-08 06:04:52 -08:00
Adam Lesinski
da431a22da 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
2017-01-11 17:20:36 -08:00
Adam Lesinski
7ad1110ecd 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
2017-01-11 13:30:57 -08:00
Colin Cross
4f8d9e69eb Convert libandroidfw to Android.bp
See build/soong/README.md for more information.

Test: libandroidfw_tests
Change-Id: I4e575d62f724d5ffe43f12ff5642fb6799f7819e
2016-12-02 09:33:18 -08:00