Commit Graph

6960 Commits

Author SHA1 Message Date
TreeHugger Robot
d34013b779 Merge "Include ResourcesInternal.proto in aapt2-protos.zip" 2019-11-14 18:20:11 +00:00
Brian Duff
a950d5b4a6 Merge "Speed up WriteKeepSet when generate_conditional_proguard_rules is off." am: a9ee3aaa5f am: 1f44c03058
am: 65e3a342c4

Change-Id: Ifc50ebb69bb6e89fb74c147328eca3c90df7acbf
2019-11-12 16:21:35 -08:00
Brian Duff
2f7e4d1a82 Speed up WriteKeepSet when generate_conditional_proguard_rules is off.
The results of CollectLocations() are only used if the --proguard-conditional-keep-rules option is set, but the function is always called when the --proguard option is set.

Since this function can be slow on particularly large resource sets, avoid calling it unless --proguard-conditional-keep-rules is set.

Change-Id: If259d41cdab16abad8ca62f30d8beb5ebf33575a
Bug: 144236322
Test: aapt2_tests
2019-11-11 09:47:18 -08:00
Donald Chai
6e914e8baf Merge "Fix computation of 'entry_length' in AAPT2 container format" 2019-11-08 06:13:54 +00:00
Donald Chai
6f613875a1 Fix computation of 'entry_length' in AAPT2 container format
When the protobuf header (or data payload) size are a multiple of 4,
"entry_length" (called "aligned size" in the code) would have counted bytes that
are never actually written.

Bug: 139418052
Change-Id: Ia688a82a67f3807f7feb0be03670bf2827b1d6a1
(cherry picked from commit b99e50922b)
2019-11-08 05:15:38 +00:00
Donald Chai
34ebc8f435 [aapt2] Fix infinite loop in proguard::CollectLocations
std::set only works correctly when the < comparator is a strict weak
ordering, while UsageLocation::operator< was actually implementing !=.

Bug: 134190468
Change-Id: Icb9407e9c8451f9fcb4eb9b2cea310e3bcaf159e
Tested: aapt2_tests, and b/134190468#comment1
(cherry picked from commit 44fa342eb9)
2019-11-08 05:13:53 +00:00
Treehugger Robot
a5e26c955b Merge "[aapt2] Pseudolocalize <plurals> values." 2019-11-07 22:59:41 +00:00
Donald Chai
98c6138c70 [aapt2] Pseudolocalize <plurals> values.
(.won slaer roF)

Bug: 134190774
Test: aapt2_tests
Change-Id: If307af4adfb1d556c41d7cb08590d1c25287f992
(cherry picked from commit 4c3da0f8a4)
2019-11-07 10:32:09 -08:00
Izabela Orlowska
f53b67cecf Include ResourcesInternal.proto in aapt2-protos.zip
Bug: 144080617
Test: N/A
Change-Id: I71e9cacb9ba7e82024278f888ee6b6a18b43ca64
2019-11-07 11:59:18 +00:00
Adrian Roos
be6c7b4671 Merge "Merge "API Lint: remove obsolete python linter" am: d5ef2d61d1 am: 5d587aeb3f" into qt-qpr1-dev-plus-aosp
am: bf8a7f3b51

Change-Id: I4fac51ae512a7f29c1e499b15e2517922331d25c
2019-11-06 14:34:27 -08:00
Eugene Susla
c5c636a5ea Fix codegen ArrayMap fields
Fixes: 143112074
Test: . frameworks/base/tests/Codegen/runTest.sh
Change-Id: Iec0fa89a91955f8b4e4b5b8d4dd9d7f0b30c608f
2019-11-05 18:14:24 -08:00
Eugene Susla
89cc836c2e Merge "[codegen] Fix generation for files without end markers" 2019-11-04 18:04:57 +00:00
Eugene Susla
7daee0bba4 [codegen] Fix generation for files without end markers
This fixes a bug where cedegen fails for files that were generated before
end of generated code section markers were introduced.

Test: . master/frameworks/base/tests/Codegen/runTest.sh
Change-Id: Ia68e8124fcbdeeb2052067ba8731e68e42007529
2019-11-01 17:56:08 -07:00
Wenjie Zhou
0c1dd67d50 Merge "Add last logcat data to incident report" 2019-11-01 23:05:05 +00:00
TreeHugger Robot
184d14428a Merge "[codegen] Support nested classes" 2019-11-01 20:52:39 +00:00
zhouwenjie
c3bf8040a3 Add last logcat data to incident report
Bug: 142721354
Test: adb sehll incident -p EXPLICIT 1109
Change-Id: Iaee370310e36998e161955e0f12d98ac8cd8eb90
2019-11-01 11:24:44 -07:00
Eugene Susla
322e8b1772 [codegen] Support nested classes
Adds support for arbitrarily-nested @DataClasses
Only static ones are supported for now

See FileInfo for the main implementation piece

Fixes: 139833958
Test: . frameworks/base/tests/Codegen/runTest.sh
Change-Id: I31cd16969788c47003a7a15a3573a4bf623ab960
2019-11-01 17:53:56 +00:00
Adrian Roos
7bf3cd9de8 API Lint: remove obsolete python linter
Linting is performed by metalava as part of the build now.

Test: n/a
Change-Id: I6223549657912fdf305a17f66f55b97561f7f7ac
2019-11-01 08:56:27 +01:00
Adrian Roos
a8685a3772 ProtoLog: Add end-to-end test
Adds a test that verifies we compute the correct hash end-to-end, i.e. including
the actual path logic, which previously caused a divergence between the viewer config
and the generated code.

Test: atest protologtool-tests
Change-Id: Ia2a414322aa6ccdaedda7f9754d903ec984902d6
2019-10-31 18:04:00 +00:00
Adrian Roos
6599f2dea4 ProtoLog: Fix broken hash computation
Fixes a bug caused by inconsistent paths - when transforming sources, we took the
path of the file, while when generating the viewer json, we used the path relative
to the root package.

Test: enable protolog, verify winscope can parse it.
Change-Id: Ib636515d70ca5b66da687542a84107465e51053d
2019-10-31 14:23:22 +01:00
TreeHugger Robot
4218fd8ffa Merge "Add CDM API to filter by BSSID bitmask" 2019-10-29 05:36:35 +00:00
Eugene Susla
f51f6c0d91 Add CDM API to filter by BSSID bitmask
Per recommendation from wifi team, this is an important filter to provide

Test: manual
Fixes: 143313206
Change-Id: Ifcad0f6ce5134854114aa9df97b2c44ece858a30
2019-10-24 23:45:02 +00:00
Mitch Phillips
82c4c5b507 Merge "Make libstatslog static-linkage compatible." am: 871d5592ff am: 33f59669ff am: 1c8ca2b2cc
am: 4de16c7cee

Change-Id: I2369b099598ae467cdd5a9ec5df244b9476076aa
2019-10-24 15:23:18 -07:00
Joe Onorato
fc17f8bf62 Merge "[bit] tests live in testcases directory now, not /data" 2019-10-24 00:00:08 +00:00
Joe Onorato
b42201bbd4 [bit] tests live in testcases directory now, not /data
Change-Id: I805ec5b6e239bc4044b7f058443639f806b577bd
2019-10-23 12:52:41 -07:00
Donald Chai
9a73a38d52 Merge "Fix computation of 'entry_length' in AAPT2 container format" 2019-10-22 01:08:26 +00:00
Donald Chai
b99e50922b Fix computation of 'entry_length' in AAPT2 container format
When the protobuf header (or data payload) size are a multiple of 4,
"entry_length" (called "aligned size" in the code) would have counted bytes that
are never actually written.

Bug: 139418052
Change-Id: Ia688a82a67f3807f7feb0be03670bf2827b1d6a1
2019-10-21 15:14:05 -07:00
Mitch Phillips
6bbc91b375 Make libstatslog static-linkage compatible.
libstatslog is a blocker for some fuzzing. Our continuous fuzzing
infrastructure requires a statically-linked binary, and things depend on
libstatslog down the chain. We should allow libstatslog to be linked
statically.

Bug: N/A
Test: m libstatslog
Change-Id: Ic742a90daf6cbb5d197784416626256bfb6182b7
2019-10-21 13:32:14 -07:00
Adrian Roos
2ca5d8601c ProtoLog: Cache the result of ProtoLogImpl.isEnabled(ProtoLogGroup)
We introduce a generated class ProtoLog$Cache, which contains a field
for each ProtoLogGroup to cache whether it is enabled or not.

This both makes lookup faster, and reduces code size.

Test: make droid
Change-Id: I581c87849c875918b182eff85996b6d19a6755ec
2019-10-18 18:22:30 +02:00
Adrian Roos
e301ccf8cf Merge "protolog: improve build time of frameworks/base/services" 2019-10-18 14:57:49 +00:00
Adrian Roos
fbcd32e552 protolog: improve build time of frameworks/base/services
Improves build time by speeding up the protolog source transformation
tool:
- parallelize the transformation to use all available cores
- remove dependency on lexicographically preserving printer
- disable comment attribution and language level validation

Speeds up the build step from ~30s to ~4s.

Test: atest protologtool-tests
Test: make services.core.protologsrc && edit file in fw/base/services/core && time make services.core.protologsrc
Change-Id: I052e9eb3cc791edf60c555c6fcf59f2e59f0ba68
2019-10-18 12:34:28 +02:00
Ryan Mitchell
63f7f98ebb Merge changes Ie349c56d,I5d5344cd
* changes:
  Allow for RRO internal referencing
  Idmap format changes for bidirectional lookup
2019-10-17 22:07:47 +00:00
Ryan Mitchell
8a891d86ab Allow for RRO internal referencing
This change allows RROs to reference their own internal resources as
expected.

Overlays are loaded as shared libraries so they can have their own
resource id space that does not conflict with the resource id space of
the target or other overlays.

References to overlay resources that override target resources now
appear as references to the target resources.

Overlay values that are inlined into the xml file specified using
android:overlayResources are now able to be used at runtime.

See go/rro-references for more information.

Bug: 135943783
Test: idmap2_tests
Test: libandroidfw_tests
Change-Id: Ie349c56d7fd3f7d94b7d595ed6d01dc6b59b6178
2019-10-17 13:09:33 -07:00
Eugene Susla
1bfb5e7097 Add @NonNull to some generated methods' args
Test: . frameworks/base/tests/Codegen/runTest.sh
Fixes: 142783758
Change-Id: I7303d420efd59389c324b3e399fcb3532b5d6c37
2019-10-16 14:29:58 -07:00
TreeHugger Robot
e84f360457 Merge "Few minor codegen fixes" 2019-10-16 01:37:43 +00:00
Ryan Mitchell
b44570bc62 Merge "Allow protoc-gen-javastream to build statically" am: 6afb115dea am: 8e0b67272d am: 5e3a1ba15f
am: e44d96ec5c

Change-Id: I69a10e583c8671288316bd0e8c7a6b5184a8ec7d
2019-10-14 17:37:40 -07:00
Treehugger Robot
6afb115dea Merge "Allow protoc-gen-javastream to build statically" 2019-10-14 23:42:23 +00:00
Ryan Mitchell
055e6189f9 Allow protoc-gen-javastream to build statically
protoc-gen-javastream is failing to build for the static_sdk_tools
build target. This is because libprotoc is included as a shared
library in the protoc-gen-javastream target. Link libprotoc statically
to allow for the sdk tools to build.

Bug: 142536936
Test: m -j protoc-gen-javastream BUILD_HOST_static=1
Change-Id: I53e1263c774530f36ff16ab8dada3e0e715e63e0
2019-10-14 10:06:26 -07:00
Eugene Susla
f821caa266 Few minor codegen fixes
- (partially) fix annotations with array arg trigger stale false positive
 - support boxed primitives parcelling
 - support excluding generated code from Intellij auto-formatting

Fixes: 142086873, 142149372
Bug: 142132310
Test: . frameworks/base/tests/Codegen/runTest.sh
+ manually test auto-formatting
Change-Id: Ib6a44dee59f840cc11066aa9ff3517d957d1d010
2019-10-11 14:16:47 -07:00
Adrian Roos
20990ad6d3 Merge "apilint: suppress certain nullability lints" am: ab911951ae am: a0ea746c9a am: e028b90b92
am: 9d57018248

Change-Id: Ic94df95eaeabf887a5d98af13ef65dc8c450b98d
2019-10-10 07:21:01 -07:00
Adrian Roos
ab911951ae Merge "apilint: suppress certain nullability lints" 2019-10-10 13:41:16 +00:00
Eugene Susla
05ef53ed1c Fix some stale dataclass detector false positives
Test: . frameworks/base/tests/Codegen/runTest.sh
Change-Id: I562bb4f238bdb28af49804e77c956e41a7bd198d
2019-10-08 16:16:30 -07:00
TreeHugger Robot
68e5e264e7 Merge "Add inheritance support for parcelable dataclasses" 2019-10-05 06:51:40 +00:00
TreeHugger Robot
e10e901b7f Merge "Add helpful links to codegen --help" 2019-10-05 02:11:56 +00:00
Eugene Susla
8cb1a41714 Add inheritance support for parcelable dataclasses
We don't want to recommend this, but some legacy framework classes use
inheritance, and it's easy enough to support

Fixes: 142081378
Test: . frameworks/base/tests/Codegen/runTest.sh
Change-Id: Ifb7f34abf1dfb871ac01b9a9a38dfee144e5f49a
2019-10-04 16:18:48 -07:00
Eugene Susla
d0a6401ed3 Add helpful links to codegen --help
Test: ensure links/email are clickable in terminal
Change-Id: I2d9461e98497b8a2af21b0a48ae05c5c110c8484
2019-10-04 01:57:09 +00:00
Eugene Susla
20b6e646e5 Fix a few corner-cases with parcelling SparseArrays and Maps
Also added a test for some similar parcelling corner cases

Test: . frameworks/base/tests/Codegen/runTest.sh
Fixes: 141877655
Change-Id: Iad5c3b0a8489206754f6ebe6acb8b56ba9ca174a
2019-10-03 15:05:26 -07:00
Adrian Roos
fafb6cf312 Merge "ProtoLog: Better behavior when parsing fails" 2019-10-03 15:21:18 +00:00
Adrian Roos
125b839889 ProtoLog: Better behavior when parsing fails
Improves behavior when parsing fails; now, ProtoLog skips the offending files, and
relies on the subsequent compilation step to catch the error.

Additionally, the build no longer fails when the canonical protolog.json file contains
obsolete entries.

Test: Introduce syntax error in services/core/ file, make and verify error messaging is sound
Change-Id: Ic23dec4a14489316ecb0e46bbabe246ddae29655
2019-10-02 19:03:34 +02:00
Eugene Susla
c49e8eece4 Fix codegen adding random /
Fixes: 141934335
Test: . frameworks/base/tests/Codegen/runTest.sh
Change-Id: Ic72d141ed58e332079e7edb7134e02d1447ff643
2019-10-01 11:53:44 -07:00