Commit Graph

6816 Commits

Author SHA1 Message Date
Artur Satayev
38deb176b0 Move UnsupportedAppUsageProcessor to tools/platform-compat
Test: diff unsupportedusage_index.csv
Bug: 145132366
Change-Id: I2e03788ba20f5801d6aa429e5daac927966c5bff
Merged-In: I2e03788ba20f5801d6aa429e5daac927966c5bff
2019-12-04 17:54:11 +00:00
Mathew Inwood
2867ddf511 Handle overrideSourcePosition in unsupportedappusageprocessor.
The property is currently set by the AIDL compiler to indicate the original
position of the annotation in the AIDL file. Use this position in
preference to the annotation position within Java code if it's present.

Also rework the tests to use the google compile-testing library rather than
my crufty javac library. This makes testing failure conditions much nicer.

Bug: 145120552
Test: atest unsupportedappusage-processor-test
Test: m framework-annotation-proc
Change-Id: Icaac9b40672dce028095b578c19950b688506c0d
2019-12-02 11:42:07 +00:00
Anton Hansson
79995a5673 Merge "Revert "Work around b/70221552"" 2019-11-19 12:38:28 +00:00
Mathew Inwood
d1219acf84 Merge "Fix SignatureBuilder." 2019-11-19 12:11:39 +00:00
Anton Hansson
d82b2f7e4a Revert "Work around b/70221552"
This reverts commit 159799d7c9.

Reason for revert: b/70221552 is fixed

Change-Id: Iaae0df6736a3141847376b9ab0115f1c7a31fdb1
2019-11-18 13:40:45 +00:00
Artur Satayev
44036a7689 Blacklist @TestApis by default.
If the signature has @UnsupportedAppUsage or @SystemApi annotation as well, those take precedence and the API would either be whitelisted or greylisted accordingly. All other, "pure" @TestApi signatures would be blacklisted and only allowed access in instrumented processes.

Test: manual
Bug: 133832325
Change-Id: I4684929caed8be7c42c91fed33ddd2a3b67ae19b
2019-11-15 16:54:14 +00:00
Mathew Inwood
4e2a44234e Fix SignatureBuilder.
It seems the compiler has started adding a top level MODULE which broke
assumptions made in here.

Also add some tests to verify this and other basic functionality, so that
future such breaks may be caught sooner.

Test: m framework-annotation-proc-index
Test: atest unsupportedappusage-processor-test
Bug: 144495446
Change-Id: I43efb25c1600af15809d48aa84498a6800f713b1
2019-11-15 15:13:03 +00: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
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
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
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
Adrian Roos
ab911951ae Merge "apilint: suppress certain nullability lints" 2019-10-10 13:41:16 +00:00
Ryan Mitchell
ac55e41f24 Fix memory leak in aapt2
Fix a memory leak in Main.cpp.

Bug: 141312058
Test: m -j aapt2 SANITIZE_TARGET=address
Change-Id: I54b61792ab75e2f59298dd38168653e496c84bff
2019-09-25 16:26:29 +00:00
Steven Moreland
2700afda04 aapt2: disable leak detection
When building with SANATIZE_HOST=address and ASAN_OPTIONS="" in order to
test that leaks are removed from AIDL, was hitting leaks here.
Explicitly setting ASAN_OPTIONS here so that we can detect leaks in
other host tools.

Bug: 141312058
Test: AIDL's runtests_asan.sh
Change-Id: Ibc599ab75bbf63eab1c7747d17952390a7967e87
2019-09-19 18:18:23 +00:00
Ian Kasprzak
fc005b8d7c Revert "[DO NOT MERGE] Disable com.android.preload.check.PreloadCheck#testBlackList"
This reverts commit 869b473388.

Reason for revert: Test is fixed.

Change-Id: I7f305f428a0f39a09e0d31512e4efa752e39b1bd
2019-08-29 04:12:55 +00:00
Ian Kasprzak
869b473388 [DO NOT MERGE] Disable com.android.preload.check.PreloadCheck#testBlackList
Disabling in preparation for merge to aosp-master (Q release).

Test: Forrest - go/forrest_run/L13300000358776692
BUG: 139540082
BUG: 139305203
Change-Id: I2da5daf011bfe44648aa6e3cc969db2689d79b76
2019-08-27 22:32:08 +00:00
Dan Shi
6bbd7c4cc6 Merge "Fix dependency on APK used by test"
am: 85d2ac2e12

Change-Id: I1ae6bff68d4aa4890fee47b5943e4d3420c32ed2
2019-08-05 14:19:06 -07:00
Treehugger Robot
85d2ac2e12 Merge "Fix dependency on APK used by test" 2019-08-05 21:04:28 +00:00
Oliver Nguyen
a1e96c644e Merge "Change coverage dump to specify the output file instead of directory."
am: f0723588de

Change-Id: Icc1b87d3fcb318adc1b10569d0a60180452f0a5b
2019-07-29 13:35:16 -07:00
Oliver Nguyen
f0723588de Merge "Change coverage dump to specify the output file instead of directory." 2019-07-29 17:37:30 +00:00
Dan Shi
bcef6ae6bc Fix dependency on APK used by test
Use data attribute to include the APK used for the test.

Bug: 138416078
Test: atest
Change-Id: Iffeca6c5f487c6a164acb9c880a5b6405eff424d
2019-07-26 14:16:43 -07:00
Paul Duffin
321ac12abe Merge "Remove preload2 as it is not used"
am: c9f969486c

Change-Id: Ib6021811cc9833d98fca15e6dc99b7d9b0dcd0a6
2019-07-25 08:13:49 -07:00
Paul Duffin
0dec38029b Remove preload2 as it is not used
Bug: 137634816
Test: m checkbuild
Change-Id: Ib182a53bc4b7509d725a8bc24a691b1cec90f726
2019-07-25 09:19:52 +01:00
Oliver Nguyen
05b1c06a91 Change coverage dump to specify the output file instead of directory.
Bug: 137857876
Test: manual
Change-Id: I2d835856d7a1b6b1ded561eca923f455b39317e4
2019-07-18 10:46:05 -07:00
Paul Duffin
83d403b80a Merge "Remove libnativehelper directories from include_dirs"
am: 0a79f4476a

Change-Id: I1909ab2777d790d62f16aa6d021fa8001188068b
2019-07-16 12:41:17 -07:00
Paul Duffin
f3b039f1b6 Remove libnativehelper directories from include_dirs
Uses libnativehelper_header_only library headers instead.

Needed as libnativehelper is part of the runtime module and so will not
be present in an unbundled build, instead its build targets will be
provided as prebuilts.

Bug: 134379140
Test: m checkbuild
Change-Id: I8becbda3a202ddaed52eaf861ac94fe4b08807c2
2019-07-16 16:08:12 +01:00
Paul Duffin
632d511a25 Merge "Convert preload2 from .mk to .bp"
am: 90453ff9d9

Change-Id: Id4efcf47ae705b827e65cbc0e33c4c455e6c81ed
2019-07-12 10:07:50 -07:00
Paul Duffin
c3613f452f Convert preload2 from .mk to .bp
Allows removal of dependency on apache-harmony-jdwp-tests-host.

Test: m preload2 preload-tool
Bug: 134379140
Change-Id: Idb75a7d4d4d27354511f9ff08194c2e738605f56
2019-07-11 13:57:47 +01:00
Kavi Gupta
c1a4da00c6 Merge "Add JVMTI agent to dump/reset JaCoCo coverage information" am: edf7470e0b
am: 7762c4aa6c

Change-Id: I717b3393095ae16b919aa77ace6104526ea8b17a
2019-06-28 16:16:52 -07:00
Treehugger Robot
edf7470e0b Merge "Add JVMTI agent to dump/reset JaCoCo coverage information" 2019-06-28 22:41:14 +00:00
Kavi Gupta
2d84ae7640 Add JVMTI agent to dump/reset JaCoCo coverage information
This agent can be attached to an arbitrary Android process with
arguments that cause it to either reset or dump the JaCoCo information
to a provided directory.

Test: manual, used examples in README to test whether it works on a
userdebug_coverage build on cuttlefish

Change-Id: If6cee20046f790676b8085e1ca84652c063295fa
2019-06-27 15:12:48 -07:00
Andreas Gampe
1e1d89d66c Merge "LockAgent: Refactor transformation code" am: e07c0cffe2
am: 14d72a73d9

Change-Id: I57d51ab8b0aac047006e03e18e0f681a6baa099d
2019-06-27 13:23:59 -07:00
Treehugger Robot
e07c0cffe2 Merge "LockAgent: Refactor transformation code" 2019-06-27 19:21:50 +00:00
Andreas Gampe
e4a6ca7231 Merge changes Ie70d0155,I0692a91d,I8c5041a4 am: 4507201da5
am: 70ad27cfb5

Change-Id: I7c11438bd295fd973f78302550e88833c84883b5
2019-06-21 13:52:40 -07:00
Andreas Gampe
f52b970c1c LockAgent: Add agent parameters to start_lock_agent script
Add parsing of "--agent-options" parameter to configure optional agent
features.

Sample: adb shell setprop wrap.system_server "start_with_lockagent --agent-options native_crash,java_crash"

Test: m
Test: manual
Change-Id: Ie70d0155096838782cb76f8111a42eba0c20e75d
2019-06-20 16:31:58 -07:00
Andreas Gampe
8695b40720 LockAgent: Add option to synthesize Java crash logging
Add the ability to dump a "crash" to logcat.

Test: m
Test: manual
Change-Id: I0692a91df995883e526a718fe95f0d3568ac9328
2019-06-20 16:31:58 -07:00
Andreas Gampe
5e2a8849c7 LockAgent: Add ability to generate a native crash
Use the crasher to create a tombstone with the violation as the abort
message.

Test: m
Test: manual
Change-Id: I8c5041a4fbffedb11b6b9c564ab1e214551896bf
2019-06-20 16:30:06 -07:00
Andreas Gampe
5b72cd1af6 Merge "LockAgent: Add crasher binary" am: a6874fccb6
am: 6c3f50dc6d

Change-Id: Ib65d7e5a6c02653eb9d815d4a0b1536d9fc6cbbe
2019-06-20 16:27:24 -07:00
Andreas Gampe
01e03da60a Merge "LockAgent: Refactor violation data" am: afb660cb49
am: bea5f08d86

Change-Id: Ib5a20d8b8aa81260883f4631a00390a819211d09
2019-06-20 14:09:37 -07:00
Andreas Gampe
3ffc019308 LockAgent: Add crasher binary
Add a helper that crashes with a given message.

Test: manual
Change-Id: I77e249484e65e7532045d0f8cc53ceb18d94bff5
2019-06-20 11:43:09 -07:00
Andreas Gampe
f9425d468b LockAgent: Refactor violation data
Start to make violation less opaque to improve more generic handling
in the future.

Test: m
Test: manual
Change-Id: Ic9780590301010798c7fe6df59526e609dc6f93a
2019-06-18 12:37:12 -07:00
Elliott Hughes
a65cae9e7f Move off ZipString and over to std::string/std::string_view as appropriate.
(Cherrypick to AOSP master, resolving merge conflicts.)

Bug: http://b/129068177
Test: treehugger
Change-Id: Ib46761d89772d3a3c655a39df573fd305c117d19
Merged-In: Ib46761d89772d3a3c655a39df573fd305c117d19
2019-06-17 16:05:19 -07:00
Elliott Hughes
78de4f999d Move off ZipString and over to std::string/std::string_view as appropriate.
Bug: http://b/129068177
Test: treehugger
Change-Id: Ib46761d89772d3a3c655a39df573fd305c117d19
2019-06-17 16:47:58 +00:00
Ryan Savitski
69b3390c9d Merge "userdebug: support perfetto traces as a section in incident reports" into qt-dev
am: cfff472c8e

Change-Id: I98dcfaf8b40f2715c881023d41234508e37db238
2019-06-13 16:50:58 -07:00