Commit Graph

6707 Commits

Author SHA1 Message Date
Ryan Savitski
cc7d9973c6 userdebug: support perfetto traces as a section in incident reports
This set of patches adds a way for the perfetto command line client to
save a trace to a hardcoded location,
/data/misc/perfetto-traces/incident-trace, and call into incidentd to
start a report, which will include said trace in a new section.

This is not a long-term solution, and is structured to minimize changes
to perfetto and incidentd. The latter is currently architected in a way
where it can only pull pre-defined information out of the system, so
we're resorting to persisting the intermediate results in a hardcoded
location.

This will introduce at most two more linked files at the same time.

Bug: 130543265
Tested: manually on crosshatch-userdebug
Merged-In: Iaaa312d2d9da73ca329807211227a8c7a049102c
Change-Id: Iaaa312d2d9da73ca329807211227a8c7a049102c
(cherry picked from commit 09a847902f)
2019-06-07 18:13:56 +01:00
Tej Singh
29ac601429 Blacklist truncated atoms instead of whitelistnig
We used a whitelist to determine which atoms should have their
timestamps truncated to the nearest 5 minutes. This changes the logic
to a blacklist so that we can get fine grained timestamps from vendor and
mainline atoms. Also reserves a range for atoms that need to be
truncated in the future.

Bug: 134574701
Test: inspected generated statslog.cpp file to make sure it had the
correct blacklist
Test: testdrive on ScreenStateChanged to ensure timestamps are preserved
when they should be
Test: testdrive on CallStateChanged to ensure timestamps are truncated
when they should be.

Change-Id: Id3468542c830cdf41395a94c77f7df0b46cd11b7
2019-06-05 18:10:12 -07:00
Joe Onorato
5dfe3dfeb8 Add command line utilites to set the reason field in incident report header
Bug: 132890298
Test: incident_report -t -r "\"Hello Joe\"" 3000
Change-Id: Ic7a2523d7e87ba88019c5ac9b23ff35387fbc498
2019-05-21 13:29:23 -07:00
Qingqing Deng
0b5f272162 Update fontchain_linter.py to support more flags.
Android Q will support all region flags in UNSUPPORTED_FLAGS list.
BL - Saint Barthélemy
BQ - Caribbean Netherlands
MQ - Martinique
RE - Réunion
TF - French Southern Territories

Bug: 127811703
Test: Verified on device.
Test: m fontchain_lint
Test: minikin_tests --gtest_filter=EmojiTest.cpp
Test: atest cts/tests/tests/text/src/android/text/cts/EmojiTest.java
Test: atest frameworks/base/core/tests/coretests/src/android/text/EmojiTest.java
Change-Id: Ice1fb10af35dc4e180735d9712167b71635920da
2019-05-15 17:17:34 -07:00
Ian Pedowitz
a326dfb1e5 Merge "Revert "Revert "Android Q is API 29""" into qt-dev 2019-05-15 16:28:54 +00:00
Ian Pedowitz
1912a57900 Revert "Revert "Android Q is API 29""
This reverts commit 60c71cee6e.

Reason for revert: Rolling forward for Q-Finalization

Bug: 131429032
Bug: 129975435
Change-Id: Idd812d93b767d8a672b9ada58c8bcc2441395847
2019-05-12 19:44:42 +00:00
Joe Onorato
dec99848ba Merge "Apilint updates" into qt-dev 2019-05-09 19:58:26 +00:00
Joe Onorato
680d4fcd84 Apilint updates
- Make apilint not print in color when added to file.
  - Make apilint able to filter for classes or packages
  - Add frameworks/base/tools/apilint/apilint script that
    has convenient commandline interface for the main
    common use cases.

Bug: 132198274
Test: apilint_test.py
Test: manual
Change-Id: I78341f42b0fdf4b73a724423b14545b1861a3293
2019-05-08 13:31:07 -07:00
TreeHugger Robot
cbe933a40f Merge "DO NOT MERGE: Fixed broken aapt2 tests" into qt-dev 2019-05-07 17:28:17 +00:00
TreeHugger Robot
274a7b2975 Merge "Build aapt2 statically on windows" into qt-dev 2019-05-07 00:26:40 +00:00
Ryan Mitchell
ac3bfcfc2a DO NOT MERGE: Fixed broken aapt2 tests
Some tests starting failing when
b435101ec8 was merged. It seems on qt-dev
aapt2_host_unit_tests does not run while it does on master.

Bug: 131762014
Bug: 129146717
Test: aapt2_tests
Change-Id: I701b275989c908acb78190be0930785712cb5686
2019-05-06 23:47:09 +00:00
Ryan Mitchell
319fc02cb8 Build aapt2 statically on windows
Prebuilt script is no longer updating libwinpthread-1.dll. Link the
windows executable statically so aapt2 will no longer require the
dependency on the dll.

Bug: 131883685
Test: manual test of aapt2.exe on windows without libwinpthread-1.dll
Change-Id: If78a8ec3030003862c18e3967e4d8333fde7928a
2019-05-06 19:07:58 +00:00
Ian Pedowitz
40a8e99740 Merge "Revert "RESTRICT AUTOMERGE Android Q is API 29"" into qt-dev 2019-05-02 00:59:09 +00:00
Ian Pedowitz
60c71cee6e Revert "RESTRICT AUTOMERGE Android Q is API 29"
This reverts commit 8a3d1f96e1.

Reason for revert: QT SDK Finalization. Will be merged again on/after May 13th

Bug: 131429032
Bug: 129975435
Change-Id: I7a48ef6a057a97ebd9903b7e934a7d95ec97f00e
2019-05-02 00:55:51 +00:00
Ian Pedowitz
917936172f Merge changes from topic "QT-SDK-Finalization" into qt-dev
* changes:
  RESTRICT AUTOMERGE Android Q is API 29
  RESTRICT AUTOMERGE Removing deprecated APIs added to Q
2019-05-02 00:53:29 +00:00
TreeHugger Robot
e587f53cb0 Merge "Make am instrument capture logcat during test run, and return it to the host." into qt-dev 2019-05-01 21:43:28 +00:00
Suprabh Shukla
8a3d1f96e1 RESTRICT AUTOMERGE Android Q is API 29
Time may be eternal, Captain, but our patience is not. It's time to put
an end to your trek through the stars.

Test: Builds, boots.

Bug: 131429032
Bug: 129975435
Change-Id: Ia2367124afb642dac0fb365e4fa096db1c648adb
2019-05-01 14:11:18 -07:00
Joe Onorato
50307d9792 Make am instrument capture logcat during test run, and return it to the host.
Also makes bit print that logcat, if available, instead of just the
stack trace.

This means that when you run a test you don't also have to run logcat in
some other window, and then scroll around forever looking for the one
test in question.

Test: bit -t GtsIncidentManagerTestCases:com.google.android.incident.gts.IncidentManagerTests\#testFail
Test: bit -t GtsIncidentManagerTestCases:com.google.android.incident.gts.IncidentManagerTests\#testDoesntExist
Bug: 129875642
Change-Id: I8940ff379c919482f4a545cb90d25bdbaa2b4f15
2019-05-01 13:02:25 -07:00
TreeHugger Robot
b0815a51e9 Merge "Handle removed classes when looking for deprecated at birth APIs." into qt-dev 2019-04-30 02:47:05 +00:00
Michael Wright
42dcfb8f57 Handle removed classes when looking for deprecated at birth APIs.
Removed APIs cause a KeyError when looking them up in the current API
surface. Instead, check if they're there first and if not just move on
since they no longer exist.

Bug: 129975435
Test: looked for new and deprecated system APIs
Change-Id: I46daa83ec8376190112418720f848afdf7cd7df2
2019-04-29 22:37:00 +01:00
Joe Onorato
a58591179b Merge changes I342cd7d0,I2c55831b into qt-dev
* changes:
  Get incidentd cts working again.
  Don't include restricted images in incident reports unless they're specifically mentioned in the IncidentReportArgs
2019-04-29 19:21:24 +00:00
TreeHugger Robot
dd76b346d4 Merge "Fix unknown resource type error message" into qt-dev 2019-04-29 14:48:53 +00:00
Ryan Mitchell
ac919fcfcc Merge changes from topic "aapt2-attr" into qt-dev
* changes:
  Add formats for declare-styleable attributes
  No new attributes in declare-styleables when format is not provided
2019-04-27 01:54:11 +00:00
Joe Onorato
e547205eec Get incidentd cts working again.
- The buffer size increased, and the CTS test that checked that
  was triggering.
- Privacy filtering wasn't working for the stack trace sections
- The incident command was not handling the default arguments correctly
- The throttler was throttling streaming reports, which made the
  test flaky.

Bug: 126253679
Test: atest CtsIncidentHostTestCases
Change-Id: I342cd7d0421ea8c22b7796fc99e779f21855af73
2019-04-26 17:44:10 -07:00
Ryan Mitchell
2e2c3b6220 Fix unknown resource type error message
Instead of printing the tag name, print the type name when the type was
unable to be recognized. The type name is initialized to the tag name
and changes when a type attribute is defined..

Bug: 37891551
Test: manual
Change-Id: I9b0e6a6f2d96a8c5af71fbca8e83c947a8e308bf
2019-04-26 01:16:52 -07:00
Ryan Mitchell
b435101ec8 DO NOT MERGE: Do not allow overlaying of attributes with conflicting formats
aapt(1) does not allow for attributes to be redefined with a different
format. Also, attributes declared with enums or flags are never allowed to be
redefined. This change will not allow attributes to be redefined with a
conflicting format in aapt2.

Bug: 129146717
Test: aapt2_tests
Change-Id: Idc43d6d689199ba2cdc672d009ede22eaa75a10c
2019-04-24 09:59:55 +00:00
Ryan Mitchell
acde95c3fc No new attributes in declare-styleables when format is not provided
AAPT does not allow for attributes declared in declare-styleables
that do not have a format to create new attribute resources. AAPT2
does and should not.

Bug: 131100106
Test: aapt2_tests
Change-Id: Id00884dc9ed939672df90f670a7915d4b6d232c1
2019-04-23 08:32:30 -07:00
Ryan Mitchell
743266643a Merge "Add build number to aapt2 version" into qt-dev 2019-04-18 19:04:40 +00:00
TreeHugger Robot
9c88c1e93e Merge "Add odm and oem policies" into qt-dev 2019-04-18 01:39:51 +00: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
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
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
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
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
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
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
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
Qingqing Deng
5e98771093 Modify fontchain_linter.py for Unicode 12.0 .
Bug:127811703
Test: m fontchain_lint

Change-Id: I36e5804388b70d98a507a719741cae6bc73b727f
2019-03-26 16:23:02 -07:00