Commit Graph

6670 Commits

Author SHA1 Message Date
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
Yao Chen
49d7dd7aaa Report the last atom tag, uid in the case of log loss.
Test: manually tested and existing statsd_test
Change-Id: I8cea9e09c4c069ec234fc0d989d550886605449b
2019-03-26 15:50:47 -07:00
Joe Onorato
99598ee6ee incidentd can now handle multiple callers asking it for incident reports
Test: bit incident_test:* GtsIncidentManagerTestCases:*
Bug: 123543706
Change-Id: I9f671dd5d8b2ad139f952a23e575c2be16120459
2019-03-26 11:20:48 -07:00
Jeff Sharkey
b4e3d691d1 Also need to filter second pass.
Bug: 116802409
Test: manual
Change-Id: I874cea7987684a8f7dca5c4d03d226568f355d8d
2019-03-26 09:59:52 -06:00
Joe Onorato
871cf3ec0e Fix bit crash
Change-Id: Ie9314b3d52b9262ac6f964ab833bb36eefb4278f
2019-03-25 14:31:06 -07:00
Ryan Mitchell
95d2c302d5 Merge "Compile all files in res/xml as xml" 2019-03-25 15:49:14 +00:00
Joe Onorato
1f9256fa73 Merge "Add bit --refresh which updates module-info.json" 2019-03-24 01:14:23 +00:00
Joe Onorato
7acae74e9e Add bit --refresh which updates module-info.json
Change-Id: Iacd760442fa45d1e23ce249d51c45f2313d6467c
2019-03-23 16:13:29 -07:00
TreeHugger Robot
d67b569eec Merge "Mainline logging to statsd: native static libs" 2019-03-23 05:03:04 +00:00
Tej Singh
e5f5a10478 Merge "Public StatsLog API for generic mainline logging." 2019-03-23 05:00:52 +00:00
TreeHugger Robot
7177077bb5 Merge "Remove unused @InspectableNodeName" 2019-03-21 12:31:30 +00:00
Colin Cross
a8edeaa4ec Merge "Dist aapt2 protos" am: b602193169 am: 0783f2d300
am: 0fc50310f3

Change-Id: Ifd9668f3931ec4d276b79a6e5ece576860271de7
2019-03-20 17:59:14 -07:00
Tej Singh
be0482b421 Public StatsLog API for generic mainline logging.
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
2019-03-20 17:44:53 -07:00
Ashley Rose
b948bcd44d Remove unused @InspectableNodeName
Change-Id: Ib5a2688e7b25c4c8ba43dc4aeb80e17a12427f9c
Fix: 128997046
Test: atest --host view-inspector-annotation-processor-test
2019-03-20 15:24:28 -04:00
TreeHugger Robot
ade947448e Merge "AAPT2: Delete unused method parameter" 2019-03-20 18:33:06 +00:00
TreeHugger Robot
9812bc26af Merge "AAPT2: Add missing description for dump command" 2019-03-19 18:48:53 +00:00
Fabien Sanglard
2369f5407a AAPT2: Delete unused method parameter
Bug: None
Test: None
Change-Id: Ib5d78df9c8e341d9d6559f90f33b1fbd5f711e99
2019-03-19 08:32:46 -07:00
Colin Cross
0b28a92440 Dist aapt2 protos
Create aapt2-protos.zip containing the aapt2 proto interface and
dist it for SDK builds.

Bug: 128878015
Test: m PRODUCT-sdk_phone_armv7-win_sdk sdk_repo dist
Change-Id: I13c774c8a2262464dcc4731c999497f6d0dc9095
2019-03-18 22:19:46 -07:00
Ashley Rose
73abdd3c59 Rename @EnumEntry and @FlagEntry
Test: atest CtsViewInspectorAnnotationProcessorTestCases
Bug: 127531820
Exempt-From-Owner-Approval: Annotation-only change
Change-Id: Id293e2b2ac9cf7bf2aaeb28645471ea227bb587b
2019-03-18 16:05:55 -04:00
TreeHugger Robot
0fb1f1e011 Merge "Use IntFunction for inspector flag and enum mapping" 2019-03-16 03:03:26 +00:00
Tej Singh
810eeb3eed Mainline logging to statsd: native static libs
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
2019-03-15 18:54:02 -07:00
Ashley Rose
83bac9f33a Use IntFunction for inspector flag and enum mapping
+ Remove IntEnumMapping class, (use a bound lambda of
  SparseArray#get(int) instead).
+ Remove IntFlagMapping.Builder, and make IntFlagMapping mutable. The
  immuability guarantees are provided by using a lambda of
  IntFlagMapping#get(int).
+ Change PropertyMapper#mapIntEnum(String, int, IntFunction<String>)
  and #mapIntFlag(String, int, IntFunction<Set<String>>) to take
  IntFunctions instead of semantic types.
+ Changes to the annotation processor to support code generation for the
  lambdas and additional internal cleanups.

Bug: 124448834
Test: atest --host view-inspector-annotation-processor-test
Change-Id: I3e7ccac63d50caa6ff49be1e78732831886e7f6e
2019-03-15 15:47:53 -04:00
Fabien Sanglard
362da826af AAPT2: Add missing description for dump command
Test: None
Bug: None
Change-Id: Id9d6a38ad292dc2647bdb4ad9f7a0015120fa776
2019-03-14 11:39:39 -07:00
Fabien Sanglard
5e904c3d01 AAPT2: Delete dead code
Test: None
Bug: None
Change-Id: Ie8e32e47883ce5e4014e9e902c22aed68af450c4
2019-03-13 15:09:46 -07:00
TreeHugger Robot
22652e9048 Merge "Do not convert whitespace chars above max char to regular space" 2019-03-11 23:45:02 +00:00
Ashley Rose
0a6dc75371 Merge "InspectionCompanions as nested classes" 2019-03-11 22:12:53 +00:00
Ryan Mitchell
62b68341e8 Compile all files in res/xml as xml
AAPT(1) compiled all files in res/xml as xml. Continue to do the same to
prevent regressions.

Bug: 122321161
Test: manual
Change-Id: I99c80da6d304c13ce911cd5258fd561f3c9e91b4
2019-03-11 13:28:02 -07:00
Ryan Mitchell
0f32675909 Do not convert whitespace chars above max char to regular space
Using isspace and iswspace on characters above the maximum char value is
undefined. This change makes aapt2 use isspace like aapt and only trims
whitespace characters at or below the maximum char value like aapt2.

Bug: 121017795
Test: aapt2_tests
Change-Id: I015e4b77f0ff53e409e880fcf9ae104ba3444d1a
2019-03-11 11:00:25 -07:00
Andrei-Valentin Onea
f73c5a0b45 Merge "Add extra hidden api related tags" am: cfd72b9386 am: d63ef04944
am: b270bc89cf

Change-Id: I1c949ca80ca5312780906522f5a0af9a5319cfc0
2019-03-09 06:17:39 -08:00
Ashley Rose
fdb5af22aa InspectionCompanions as nested classes
+ Generate inspection companions as MyClass$InspectionCompanion instead
  of MyClass$$InspectionCompanion. This allows the discovery of custom
  inspection companions written as nested classes.
+ Rename GeneratedInspectionCompanionProvider to
  StaticInspectionCompanionProvider to more clearly articulate how it
  function in the new world.
+ StaticInspectionCompanionProvider now explicitly checks if a class it
  discovered implements InspectionCompanion, and returns null instead of
  throwing a ClassCastException.
+ The annotation processor checks for the existence of a nested class
  named InspectionCompanion, and fails the build if a class has both a
  custom InspectionCompanion and @InspectableProperty annotations.

Test: atest --host view-inspector-annotation-processor-test
Bug: 126913705
Change-Id: Ic0d2100ec22420e36f9db44e56c66fe9146eeb0c
2019-03-08 18:27:51 -05:00
Andrei-Valentin Onea
cfd72b9386 Merge "Add extra hidden api related tags" 2019-03-08 16:22:11 +00:00
TreeHugger Robot
b496d6150c Merge "Add --trace_folder to aapt2" 2019-03-07 16:40:03 +00:00
TreeHugger Robot
835d528dba Merge "Make sure Proguard keeps zygote preload class." 2019-03-07 13:56:21 +00:00
Andrei Onea
80a5660238 Add extra hidden api related tags
@SystemApi and @TestApi entries in the whitelist can now be
differentiated from the rest of the apis. @TestApi methods
are implicitly greylisted.

Test: m test-art-host-gtest-hiddenapi_test
Change-Id: Id739f04550842f7b3160685e1635ba20efb223cc
2019-03-07 10:40:52 +00:00
TreeHugger Robot
b32c31d1a9 Merge "Fix aapt2 whitespace diffs from aapt(1)" 2019-03-07 01:42:21 +00:00
Ryan Mitchell
1d358ff5bb Fix aapt2 whitespace diffs from aapt(1)
CDATA blocks were being processed differently in aapt2 so this change
fixes aapt2 to not treat cdata blocks differently and still trime
whitespace.

Also, aapt did not process escapes when compiling xml files. This
change removes over-processing of xml text nodes.

All test strings are what aapt(1) would output.

Test: aapt2_tests
Bug: 124470332
Change-Id: I90ee0c1e5e9208f8a5c60cee93e3ba02712c9b2c
2019-03-06 15:06:49 -08:00
Martijn Coenen
6c83e0c5c9 Make sure Proguard keeps zygote preload class.
Bug: 127262679
Test: atest ProguardRulesTest
Change-Id: Ib082404e08d98b25fcecbf680afb4af37fe2786b
2019-03-06 15:06:17 +01:00
Adrian Roos
084e471703 Merge "apilint: Lint unhidden @IntDef and @LongDef" am: 4435924104 am: cec0f35fcc
am: 748ed1ad44

Change-Id: Iccbb4042411822a0c489a8f7622747a8dd23df4e
2019-03-06 05:16:17 -08:00