Commit Graph

6708 Commits

Author SHA1 Message Date
Colin Cross
c441b4646e Merge "locked_region_code_injection: copy jar timestamp to output" am: 69db849f7c
am: 538193abed

Change-Id: I5dcbb0aa806bede7e76caa06b75a11c2269299f8
2019-04-18 19:25:52 -07:00
Treehugger Robot
69db849f7c Merge "locked_region_code_injection: copy jar timestamp to output" 2019-04-19 01:57:28 +00:00
Colin Cross
00b6e025fb locked_region_code_injection: copy jar timestamp to output
Copy the input jar's timestamps to the output jar to ensure
deterministic results.

Test: m checkbuild
Change-Id: Ifdd3ddc36c35429a0396b968dd3dd20b8cc57793
2019-04-18 12:47:08 -07:00
Ryan Mitchell
2e6bb9db6a Merge "Add build number to aapt2 version" into qt-dev
am: 743266643a

Change-Id: I464776e52e7d5d010221beb42c046c497aafb02a
2019-04-18 12:39:15 -07:00
Ryan Mitchell
743266643a Merge "Add build number to aapt2 version" into qt-dev 2019-04-18 19:04:40 +00:00
Tej Singh
37b9742b58 Java code for mainline modules to log to statsd.
Adds support for generating app code to allow java mainline modules to
call the StatsLog.writeRaw public API. Supports primitives, enums,
attribution chains, MODE_BYTES. Does not support key value pairs,
worksource methods (because worksource uses hidden apis in the
worksource object).

Test: manually tested atom logging from DocumentsUI
Test: existing autogenerated code is not modified
Test: cts will follow
Bug: 126134616

Change-Id: Ia321cf2d9952e3875ed0c7a28db1f4113711513f
Merged-In: I97ac1890fda2262e343acafbbb8822e1de5f6515
2019-04-18 03:45:14 +00:00
Ryan Mitchell
8ea093e88d Merge "Add odm and oem policies" into qt-dev
am: 9c88c1e93e

Change-Id: I61a3f83f395f2befa4fc4b6e96a4cde962b29875
2019-04-17 18:59:01 -07:00
TreeHugger Robot
9c88c1e93e Merge "Add odm and oem policies" into qt-dev 2019-04-18 01:39:51 +00:00
Chiachang Wang
e1556e9096 Merge "Public StatsLog API for generic mainline logging." 2019-04-18 01:14:58 +00:00
Andreas Gampe
0e9ea51cc1 Merge "PreloadCheck: Add some comments" am: a1759a9bd8
am: 7a095e3d87

Change-Id: Ia2f0f16ba3cf3ab22728c3d280d53bed9392473a
2019-04-17 16:33:25 -07:00
Ryan Mitchell
939df096be Add odm and oem policies
This change adds parsing, encoding, and validating of odm and oem
overlayable policies to aapt2, libandroidfw, and idmap2.

Bug: 121033532
Test: aapt2_tests, idmap2_tests
Change-Id: Ifc0d4b6c9f9c37e06b2988abade69dbb277c50c2
2019-04-17 16:07:57 -07:00
Andreas Gampe
faecc4f67d Merge "PreloadCheck: Reset UncaughtExceptionHandler" am: 73b25f4fcc
am: 5e84a4588e

Change-Id: I0a1e9392a9cbd18e8f10367577a8cd02ecbf71d4
2019-04-17 15:41:41 -07:00
Andreas Gampe
22a594b1fc Merge "PreloadCheck: Add support for regex checking" am: d46ae2ca5b
am: 69371803d5

Change-Id: I47922d6382b48f5e40182181b204c77e07d39634
2019-04-17 15:36:00 -07:00
Ryan Mitchell
34039b26f5 Add build number to aapt2 version
This changes adds the build id to the version printed by "aapt2
version". This change also adds a field to the ResourceTable proto that
specifies the fingerprints of tools used to build the table.

Bug: 123663089
Test: manual
Change-Id: Ifaf33c1e506b68e9f1d921fdbeddf36485e65790
2019-04-17 10:59:38 -07:00
Andreas Gampe
1e8c3995c6 PreloadCheck: Add some comments
Test: m
Change-Id: I61039d4fc64f0958bc3f81a49f3a78620c86e34c
2019-04-17 09:46:47 -07:00
Ryan Mitchell
acbf1c7668 Merge "Check value in dump before printing" into qt-dev
am: d8ec9971cb

Change-Id: I0cb6c1bec55e8490681e161100ef8522aebd91e3
2019-04-16 17:34:41 -07:00
Andreas Gampe
c771bfebe1 PreloadCheck: Reset UncaughtExceptionHandler
Do not use the framework's exception handler. Rather use the default
behavior and print the exception to stdout, so that it appears in the
test failure.

Test: atest --test-mapping frameworks/base/tools/preload-check
Test: manual
Change-Id: I3563392408a72c97788452f467c027112f52f193
2019-04-16 14:52:14 -07:00
Andreas Gampe
bb621f2df4 PreloadCheck: Add support for regex checking
Add some reflection hackery to retrieve boot classpath dex files. This
requires unstripped jars. Then use DexFile APIs to retrieve all classes,
and run a check if the given regular exception matches.

Use the new infrastructure to check that NoPreloadHolder classes are
not initialized.

Test: atest --test-mapping frameworks/base/tools/preload-check
Change-Id: Ic19e950647e5827d3c3ec4a7109553f39be7f43a
2019-04-16 14:52:14 -07:00
Ryan Mitchell
0c0cedff00 Check value in dump before printing
For applications that remove the names of resources from the string
pool, check that the attribute has a name before attempting to print it.

Test: manual
Bug: 130553900
Change-Id: I05e5d59f01b2c02c8a024d06fd896074d6bf465b
2019-04-16 12:00:30 -07:00
Andreas Gampe
c712c03e98 Merge "PreloadCheck: Add preloaded-classes-blacklist" am: 4e572b596f
am: 1e57c5aad0

Change-Id: Ia1ea432304db039bd68c90339f4f9e674a3df645
2019-04-16 11:03:56 -07:00
Chiachang Wang
a3d942b43f Public StatsLog API for generic mainline logging.
This is a cherry pick to aosp.

Sets up a public api for logging atoms to statsd. The API excepts a
buffer which is already encoded in the proper format for the socket, as
well as the number of bytes of the buffer to write. It performs a JNI
call to perform the socket write. Autogenerated app code will be built
for each mainline module that needs to use this API to log.

Test: builds
Test: existing logs flow properly
Bug: 126134616
Change-Id: I8a9a91e638d730e3ff69cb9345692e49e0db3c96
Merged-In: I8a9a91e638d730e3ff69cb9345692e49e0db3c96
2019-04-16 10:22:38 +08:00
Ryan Mitchell
9202886cbf Merge "qt-dev-plus-aosp designated for R. Update MAX_PLATFORM_VERSION, etc." into qt-dev-plus-aosp 2019-04-15 19:07:10 +00:00
Andreas Gampe
1130892ec7 PreloadCheck: Add preloaded-classes-blacklist
Embed the preloaded-classes-blacklist file and check all classes
in it.

Test: atest --test-mapping frameworks/base/tools/preload-check
Change-Id: I4292cae1eb24eafe1f63e914143433b57cc74751
2019-04-15 10:27:28 -07:00
Andreas Gampe
f9d0eb8f79 Merge "Framework: Lock inversion checker" am: 33ee4a5536
am: a2415fbb01

Change-Id: I73e1861532857e0a4fb724e7969ccea32205410e
2019-04-12 16:33:17 -07:00
Andreas Gampe
33ee4a5536 Merge "Framework: Lock inversion checker" 2019-04-12 22:17:15 +00:00
Andreas Gampe
248f90bd59 Merge "Preload: Add a simple test for the state of classes" am: fe1c4420c5
am: 9cef297dcf

Change-Id: Ia2c93d57151f67038b7227e509934c9ff40efbdc
2019-04-12 11:09:40 -07:00
Andreas Gampe
72ede720e2 Framework: Lock inversion checker
Add an agent-based lock inversion checker. The agent will dynamically
rewrite bytecode to inject calls to LockHook, which runs a checker
on these.

Implement a simple on-thread checker that keeps a per-thread stack
of locks and a global map of lock ordering. As-is, transitivity of
checks is not guaranteed, but should be captured in most practical
cases.

To run a process with the lock checker, start the process with the
agent. The helper script start_with_lockagent.sh can be used for this:

  adb shell setprop wrap.pkg-name script start_with_lockagent

(cherry picked from commit aeb6fce5b3)

Bug: 124744938
Test: manual
Merged-In: Idd9a7066a5b8cb8c0de2e995f08759c98d9473e1
Change-Id: Idd9a7066a5b8cb8c0de2e995f08759c98d9473e1
2019-04-12 10:46:04 -07:00
Andreas Gampe
8710df5fae Preload: Add a simple test for the state of classes
Use app_process and reflection to find the class state.

This is expected to break when internals change, so include a test
for expectations.

Bug: 130206915
Test: atest PreloadCheck
Change-Id: I7ecdb88a19efcfcfa1c7aa5c7e67d1990306166e
2019-04-11 16:26:14 -07:00
Ryan Mitchell
48002f6313 qt-dev-plus-aosp designated for R. Update MAX_PLATFORM_VERSION, etc.
Test: aapt2_tests
Bug: 128934651
Change-Id: I179f7b92dcf65e77f039e6cd42d91bf5b1461e35
2019-04-11 14:29:25 -07:00
Greg Kaiser
242c20ef39 stats_log_api_gen: Minor printf format fix
We use "%zu" for a size_t argumet.

Test: TreeHugger
Bug: 126134616
Change-Id: I02916829dfb71a63f78eda0d45129b4dc0732a82
Merged-In: I02916829dfb71a63f78eda0d45129b4dc0732a82
(cherry picked from commit f87e93835a)
2019-04-09 21:01:12 +00:00
Treehugger Robot
fe3ebab0b3 Merge "Mainline logging to statsd: native static libs" 2019-04-09 05:42:12 +00:00
TreeHugger Robot
636f9ae0c2 Merge "Allow merging of resources with the same overlayable" into qt-dev 2019-04-08 21:06:32 +00:00
Tej Singh
2910d5aa16 Java code for mainline modules to log to statsd.
Adds support for generating app code to allow java mainline modules to
call the StatsLog.writeRaw public API. Supports primitives, enums,
attribution chains, MODE_BYTES. Does not support key value pairs,
worksource methods (because worksource uses hidden apis in the
worksource object).

Test: manually tested atom logging from DocumentsUI
Test: existing autogenerated code is not modified
Test: cts will follow
Bug: 126134616

Change-Id: Ia321cf2d9952e3875ed0c7a28db1f4113711513f
2019-04-06 01:26:12 +00:00
Ryan Mitchell
ced9a5c108 Allow merging of resources with the same overlayable
If a resource is redefined with the same overlayable name, actor, and
policies, do not error.

Bug: 128843658
Test: m -j Launcher3 && aapt2_tests
Change-Id: I2c79f7d9fa7ff16b38ec41cec7e9804d39b372d5
2019-04-05 10:44:16 -07:00
Chris Craik
335b565eb6 Support profileable application action
Fixes: 129358330
Test: make -j16 aapt2_run_host_unit_tests && cat out/target/product/walleye/obj/PACKAGING/aapt2_run_host_unit_tests_intermediates/result.xml | grep "failure message"
Change-Id: Id9ec59447a99a5f6e0bfe47c0b8ce3553bf751c7
2019-04-04 13:25:55 -07:00
Colin Cross
179e132823 Merge "Convert frameworks/base/cmds/* to Android.bp" 2019-04-02 16:39:04 +00:00
Andrei-Valentin Onea
9b5b3eaa84 Merge "Automatically greylist code in 3P packages" am: 1f80714c2d am: 8b1745650b
am: 4f0fdf2d43

Change-Id: Iaa456ba488b37b87b1b65e312074a60c9b43a9a2
2019-04-02 06:54:25 -07:00
TreeHugger Robot
73ad61f652 Merge "AAPT2: Delete dead code" 2019-04-02 00:13:19 +00:00
Mihai Niță
551a76e26e Merge "Fix aapt2 pseudo-translating donottranslate* files" 2019-04-01 18:04:15 +00:00
Andrei Onea
a6e09b4273 Automatically greylist code in 3P packages
generate_hidden_api_lists now receives a file containing package names
which need to be greylisted (although it could be made to work with any
api list required).
Also took the opportunity to clean up the tests to reflect the more
strict code.

Bug: 129387816
Test: m appcompat
Test: frameworks/base/tools/hiddenapi/generate_hiddenapi_lists_test.py
Change-Id: I619f8581d166aa48eda572bc0053d8739d6420eb
2019-04-01 15:32:36 +01:00
Mihai Nita
d1a6521cc3 Fix aapt2 pseudo-translating donottranslate* files
Bug: 126423638

Test: After building android doing this in the 'out' folder:
Test:
Test: ./soong/host/linux-x86/bin/aapt d --values resources \
Test:     ./target/product/sailfish/system/product/priv-app/SystemUIGoogle/SystemUIGoogle.apk \
Test:     | less
Test:
Test: search for `system_ui_aod_date_pattern` in the output, found this:
Test:           (string8) "[éééḾḾḾð one two]"
Test:           (string8) "<U+200F><U+202E>eeeMMMd<U+202C><U+200F>"
Test: (the en-XA and ar-XB pseudo-translated versions of the string)
Test:
Test: After the fix and rebuild the dump only finds the original English string ("eeeMMMd")
Test: Also flashed the image, switched to en-XA, and left the phone around for more than 24 hours.
Change-Id: I2fb7c5b5ee7d3d3200410593346682ed16559056
2019-03-29 17:15:18 -07:00
Colin Cross
45c0d71e77 Convert frameworks/base/cmds/* to Android.bp
See build/soong/README.md for more information.

Also converts the rest of frameworks/base/tools/streaming_proto.

Bug: 122332340
Test: m checkbuild
Change-Id: I87c500c5464fb1722b4b518d89065f5e1ee29a97
Merged-In: Ieb54feb3902bddfd5a571369fbf50161ae646647
2019-03-29 16:35:06 -07:00
TreeHugger Robot
b8e80e0dc0 Merge "Fix aapt2 badging return codes" 2019-03-29 17:28:26 +00:00
Ryan Mitchell
28c88801e7 Fix aapt2 badging return codes
aapt2 was returning the inverse return code when duumping badging.

Bug: 129476626
Test: aapt2 dump badging [APK] && echo $?
Change-Id: Icd236e5fad3284c8bc4a0e2d7e9fb7cfb3262b6c
2019-03-28 11:28:54 -07:00
Tej Singh
1f431f31e0 Mainline logging to statsd: native static libs
This is a cherry pick to aosp.

Creates an annotation to specify if an atom needs to be logged from a
specific mainline module. Creates options in stats-log-api-gen so that
if the same module name is passed in, cpp/h files will be generated with
only those atoms that are specified. These files can be used to create a
static library per mainline module to log to statsd.

Test: builds
Test: atest stats-log-api-gen-test
Test: does not affect existing shared libstatslog
Test: manually created a static lib for netd and used it to log to
statsd. Used testdrive to validate the data was properly flowing.
Bug: 126134616
Change-Id: I78064f81fb4971eede8e97dacce5424e3eefd8bb
Merged-In: I78064f81fb4971eede8e97dacce5424e3eefd8bb
2019-03-28 14:25:45 +08:00
Joe Onorato
37c66e5e50 Merge "incidentd sections for userdebug and eng are compiled out" 2019-03-27 16:27:34 +00:00
Yao Chen
d68ac8003c Merge "Report the last atom tag, uid in the case of log loss." 2019-03-27 16:21:15 +00:00
Joe Onorato
fe7bbf410c incidentd sections for userdebug and eng are compiled out
Previously, the decision to include or not include them was
done at runtime. This changes them to be behind a compile
time flag. It's just safer, because the code just isn't there
instead of being dependent on a system property.

Test: bit GtsIncidentManagerTestCases:*
Bug: 123543706
Change-Id: If4e611914a7b0acd399ae27e55af8f718aee3ec8
2019-03-27 00:23:20 -07:00
Joe Onorato
1c33a64705 Merge "incidentd can now handle multiple callers asking it for incident reports" 2019-03-27 04:06:06 +00:00
TreeHugger Robot
f1e402ecaf Merge "Modify fontchain_linter.py for Unicode 12.0 ." 2019-03-27 03:31:25 +00:00