Commit Graph

6563 Commits

Author SHA1 Message Date
TreeHugger Robot
1ebc40339a Merge "Revert "Add android.hardware.fingerprint for pre-Q"" 2019-01-29 22:23:21 +00:00
Ashley Rose
b47ddd4a1d Run inspector annotation processor on framework
Test: m
Bug: 117616612
Change-Id: Ifb013cf576e57818493a52aefec9729ecca4ac08
2019-01-29 13:34:31 -05:00
Adrian Roos
fcbec265e6 Merge "apilint: Allow parsing 3.0 signature files" am: 34b11c92b3 am: f9cd2cb759
am: ea23830f1b

Change-Id: Ifaf2deff0451455d26a3301354753b751c3b464d
2019-01-29 08:43:16 -08:00
Adrian Roos
34b11c92b3 Merge "apilint: Allow parsing 3.0 signature files" 2019-01-29 16:05:21 +00:00
Adrian Roos
cf82e04400 apilint: Allow parsing 3.0 signature files
Test: python apilint_test.py
Change-Id: I59df950229c05329afde93f94efc13adb4640ad7
2019-01-29 15:01:28 +01:00
Treehugger Robot
171c9cdc6a Merge "clang-format ManifestFixer_test.cpp" 2019-01-28 22:15:35 +00:00
Ashley Rose
0b671da4b1 Annotation processing for int enum and flag mapping
Bug: 117616612
Test: atest --host view-inspector-annotation-processor-test
Change-Id: I791ffd8ce6bf6ec3ba408bb2a781fd91871b0ed6
2019-01-28 18:21:30 +00:00
Joe Onorato
70edfa8c31 [bit] Use aapt2 instead of aapt, and don't also adb install apps on the system partition
Test: bit services
Change-Id: I7d44ffbb2745b1a6265bbc77f24f885e5f1d3981
2019-01-26 09:48:40 -08:00
Joe Onorato
ce0bd06d17 [bit] Cache the build variables so we don't have to run make to figure them out unless the environment has changed.
Test: bit GooglePermissionControllerTest:*
Change-Id: Ie79226026477df22115ed1146875b82c2255bdef
2019-01-26 09:48:25 -08:00
TreeHugger Robot
ced0b0c90c Merge "De-duplicate entries written with AAPT2 convert" 2019-01-25 22:03:49 +00:00
Colin Cross
3288553623 clang-format ManifestFixer_test.cpp
Fix formatting errors introduced by Iee2bd9a3981c7d4681509f18b735c6e9e6c1a336.

Test: m checkbuild
Change-Id: I5d9a4cec277e31f4124bff281bf7a52cc97f73e3
Merged-In: I10b27abb8fa8a99a41976c42c4d684b99978b4f9
2019-01-25 21:33:02 +00:00
Winson
f54c9a1d72 De-duplicate entries written with AAPT2 convert
There was no check for whether we had already written a specific file path to the APK when using the convert command.

If the resources table points 2 resource IDs at the same file on disk, the convert command would write the file twice, creating two entries.

This holds a set of file paths already written and ignores duplicates.

Bug: 123271593

Test: Ran convert on linked bug's weird.apk
Test: aapt2_tests case for duplicate entries

Change-Id: Ia22515bf8e8297624aaadbf6a9e47159026c63e5
2019-01-24 16:10:16 -08:00
Colin Cross
9237af7080 Merge "Replace annotation_processors with plugins" 2019-01-24 17:57:17 +00:00
TreeHugger Robot
591aacaf62 Merge "Replace debug key." 2019-01-24 13:47:11 +00:00
Mathew Inwood
b55d7a0a9d Replace debug key.
This gives better consistency with the release key. Also improve the
debug_sign script to use base64, to eliminate issues with escaping and
newlines.

Bug: 110509075
Test: atest CtsSignedConfigHostTestCases
Change-Id: Id8d7b6b5bee3340803d30d3a4a34c7e62f565a93
2019-01-24 10:02:00 +00:00
TreeHugger Robot
636da777af Merge "Hold data pointer reference to AAPT2 test file" 2019-01-24 07:50:24 +00:00
Colin Cross
a3b22bfd14 Replace annotation_processors with plugins
The annotation_processors property is deprecated, replace it with
plugins, and use java_plugin for modules that provide annotation
processors.

Bug: 77284273
Test: m checkbuild
Change-Id: I467b899e0c8f2c8fa74a9bfbe6e952ad0f7aa009
2019-01-23 15:54:30 -08:00
Colin Cross
5d4bd49013 Merge "Replace annotation_processors with plugins" am: bc40469e19 am: f30fba0a60
am: 4262bd19ad

Change-Id: I0b417cccddebdccc8613d82d93ff9f0658be8217
2019-01-23 13:03:29 -08:00
Colin Cross
bc40469e19 Merge "Replace annotation_processors with plugins" 2019-01-23 20:18:02 +00:00
Winson
b7be7934b0 Hold data pointer reference to AAPT2 test file
To try and solve test flakiness, hold the unique_ptr in the method scope to make sure it's cleaned up after we assert on it.

Bug: 123079798

Test: gonna merge and check for failures, since it passes locally

Change-Id: Id348d1112832cbb82f605a84ef675c25a7488b11
2019-01-23 11:11:12 -08:00
Ryan Mitchell
f67808b78d Optimize aapt2 compile for pngs
Do not copy the png data when compiling pngs.

Bug: 122950060
Test: aapt2 compile -o . BaseAppPhoto1_copy.png

Change-Id: I78fbdaa9a40ada406d7b07cf072d6cd76124168e
2019-01-22 16:16:13 -08:00
Colin Cross
a1f8e1ab3d Replace annotation_processors with plugins
The annotation_processors property is deprecated, replace it with
plugins, and use java_plugin for modules that provide annotation
processors.

Bug: 77284273
Test: m checkbuild
Change-Id: I14ed4d81e097510866cbb9a27c72be4426117885
2019-01-22 11:09:51 -08:00
Kevin Chyn
06f2c9fc73 Revert "Add android.hardware.fingerprint for pre-Q"
This reverts commit e1de284ae9.

Reason for revert: b/115639644 comment #27

Change-Id: Icf1f067b4d8f6b83be86128f07a89608112cebeb
2019-01-22 18:19:26 +00:00
Adrian Roos
258c572d5e apilint: correctly parse enum_constant
Change-Id: I1a243caa3a01837ff989d21926478f20d70372ae
Fixes: 120132045
Test: python apilint_test.py
(cherry picked from commit 373df11baa)
2019-01-22 11:42:39 +01:00
Adrian Roos
0fa45f1e50 Merge "apilint: correctly parse enum_constant" 2019-01-22 10:41:53 +00:00
Adrian Roos
d1e3892119 ApiLint: Add operator keyword and property parsing
Also fix up some issues with expression parsing, type use annotations, etc.

Test: python tools/apilint/apilint_test.py
Change-Id: I38145a51470ce6c3e5813a546d681489fd87fc19
(cherry picked from commit 403c8e35d8)
2019-01-22 11:36:38 +01:00
Adrian Roos
5cdfb69429 ApiLint: Add Kotlin-style type support
Test: tools/apilint/apilint_sha.sh HEAD && python tools/apilint/apilint_test.py
Change-Id: Iac1fdabcbeffe57c8288d73b2359e8ce0b2bc3eb
(cherry picked from commit 7884d6b909)
2019-01-22 11:36:37 +01:00
Adrian Roos
1f1b6a8464 ApiLint: Performance improvements for verification
Test: tools/apilint/apilint_sha.sh HEAD
Test: python tools/apilint/apilint_test.py
Change-Id: I90f18181cd0d3c43f176d7c9d1b198f6f5172390
(cherry picked from commit 7f8886a993)
2019-01-22 11:36:37 +01:00
Adrian Roos
e5eeae7c23 ApiLint: Performance improvements for 2.0 signature format parsing
Test: tools/apilint/apilint_sha.sh HEAD
Test: python tools/apilint/apilint_test.py
Change-Id: I76b979dd81702afce6468ac377230e589a25e08f
(cherry picked from commit a30d062775)
2019-01-22 11:36:37 +01:00
Adrian Roos
b787c183a2 ApiLint: Allow parsing 2.0 API signature files
Test: tools/apilint/apilint_sha.sh HEAD
Test: python tools/apilint/apilint_test.py
Change-Id: Id2e1792392b3626746f1ec99f481d0cb27e523a1
(cherry picked from commit d170961b02)
2019-01-22 11:36:37 +01:00
Adrian Roos
038a02992a apilint: Fix API lint issues 2/2
Fixes false positives that occur when a class in current.txt is faulty, and an
entry for that class is then added to system-current.txt.

This was so because when parsing the previous revison's system-current.txt, we
did not know about the class and thus didn't look for it in current.txt, and
thus never recorded that the error is preexisting.

To avoid that, we track all classes in system-current.txt with a matching entry
in current.txt in the current revision, and later use that to look up all classes we
may have missed when examining the previous revision.

Test: python tools/apilint/apilint_test.py
Change-Id: Ibe09f1159e351e56b35b8816ce0db760de4ef791
(cherry picked from commit 61e3730bc0)
2019-01-22 11:36:36 +01:00
Adrian Roos
5ed42b6a2e apilint: Fix API lint issues
Fixes a bug where only the name instead of the fully qualified name was
considered when looking for a class, which lead to faulty results for inner
classes.

Test: python tools/apilint/apilint_test.py
Change-Id: Ib015669ed3faef21d2bdd16f1e27bc55c8669d70
(cherry picked from commit 2c5cacfd36)
2019-01-22 11:36:36 +01:00
Adrian Roos
6eb57b0f4a API Lint: Add support for base current.txt
Allows specifying a base current.txt and previous.txt file when linting
system-current.txt and test-current.txt to avoid false positive error
messages due to public API members not being duplicated in the respective
non-public APIs

Test: python tools/apilint/apilint.py --base-current=api/current.txt api/system-current.txt
Change-Id: I306a99b1423584ef3fcdc9272a83cb5eacc37227
(cherry picked from commit 7690d0d4ee)
2019-01-22 11:36:36 +01:00
Jeff Sharkey
a8e5df06a0 Guide towards Context.createPackageContextAsUser().
It's a better alternative that should be used instead of adding
new "ForUser" or "AsUser" methods.

Bug: 115654727
Test: manual
Change-Id: I8742c2ef42d743ef69f8f7a91378f498fdc81e43
(cherry picked from commit 86445841ac)
2019-01-22 11:36:36 +01:00
Jeff Sharkey
eff9e228c1 Moar lint rulez!
Bug: 37534642, 116675691, 116798271, 72059458, 111790177
Test: manual
Change-Id: Ib079ae580a827f225be08f90dbdddeee7d341c48
(cherry picked from commit daac37f229)
2019-01-22 11:36:35 +01:00
Siyamed Sinir
0a2e15dd6e Update lint rules for graphics/text package layering
Test: N/A
Bug: 77347886
Change-Id: I907d99b4a1dee0c69b914e55a033d3d9c4eebe56
(cherry picked from commit e23aeb8024)
2019-01-22 11:36:35 +01:00
Jeff Sharkey
40d67f4b6d Handle new current.txt format.
We're starting to see "@interface" show up, so handle them like any
other interface.  We're also seeing more details argument lists
with names and annotations; ignore them for now, since all our
existing lint checks work on the "real" data type.

Verified that it handles new support library current.txt files
without causing any regressions against existing framework
current.txt files.

Test: manual inspection
Bug: 111555356
Change-Id: Id11c3561edd317e4ba1a9b43993fd96d8243e00d
(cherry picked from commit bd26119169)
2019-01-22 11:36:34 +01:00
Jeff Sharkey
fe5ee6e74b Extend lint script to emit API statistics.
Bug: 77588754
Test: manual
Change-Id: I240dba5fae1a8635a4265a1af903517f00dec54c
(cherry picked from commit daa7cf3a36)
2019-01-22 11:36:34 +01:00
David Brazdil
c3457450d9 Merge changes from topics "coreapi-flag", "coreapi-stubs-csv" am: 4620039dc5 am: e5aa99f45c
am: ed9f1140d1

Change-Id: I860b4e8953af55382c875a6c62951bb5c0da70e3
2019-01-21 12:21:52 -08:00
David Brazdil
ea26641aa8 hiddenapi: Expect public/private API as CSV am: 17d16e84da am: 046c140ff3
am: 20d06a0166

Change-Id: I3982dc2b0ed6ef0771522acbfe97a8002195b2ea
2019-01-21 12:14:55 -08:00
Adrian Roos
373df11baa apilint: correctly parse enum_constant
Change-Id: I1a243caa3a01837ff989d21926478f20d70372ae
Fixes: 120132045
Test: python apilint_test.py
2019-01-21 16:01:51 +01:00
David Brazdil
17d16e84da hiddenapi: Expect public/private API as CSV
Refactor of `hiddenapi` changed the output format of public/private API
lists to a single CSV file. Change API list generation accordingly.

In order to avoid special-casing this CSV file, it is treated the same
as the CSV files produced by `class2greylist`. The merging rules are
relaxed so that signatures in CSV files are not checked against
a pre-initialized set of all signatures (previously generated from the
public/private API files). This should not lead to build errors as the
CSV files are always auto-generated, and a missing/extra signature will
be caught by `hiddenapi`.

API lists in frameworks/base/config are processed later and checked
that they are a subset of the signatures in CSV.

Bug: 119068555
Test: compiles, hiddenapi-flags.csv unchanged
Change-Id: I33f2cbaa15f2d423a75e6ca64abe1c5b0c40c86f
2019-01-19 15:57:36 +00:00
David Brazdil
439d3496ed hiddenapi: Support 'core-platform-api' flag
Libcore class members annotated with @CorePlatformApi now generate
a new hiddenapi flag. This is the first of "domain API" flags which
can be used in conjunction with API list flags. Therefore modify
the 'generate_hiddenapi_lists.py' logic to treat them differently.
Specifically, the script marks otherwise unassigned class members
blacklisted. A class member with 'core-platform-api' may still not
be assigned an API list and should be blacklisted.

Bug: 119068555
Test: m appcompat
Change-Id: I2b67e7a619677e853c87bc2da934410458ce4d14
2019-01-19 15:57:36 +00:00
Ashley Rose
c1a4decb39 Annotation processing for @InspectableProperty
Test: atest --host view-inspector-annotation-processor-test
Bug: 117616612
Change-Id: Ia9641b4efae5f6945084849309f81f2d31faf2ec
2019-01-18 16:47:29 -05:00
Aurimas Liutikas
feccee99fa Merge "Remove old private constant from ResourceId." 2019-01-18 16:53:46 +00:00
TreeHugger Robot
0857c584ae Merge "AAPT2: always say which file failed to compile" 2019-01-18 10:59:42 +00:00
Ryan Mitchell
a117526b4a Merge "Remove RRO policy product_services" 2019-01-18 00:41:31 +00:00
Aurimas Liutikas
d8ebfefcee Remove old private constant from ResourceId.
Bug: 122967079
Test: make -j builds
Change-Id: I3e999044df02549e84208d38bb77d2ce1d1bd73b
2019-01-17 12:51:58 -08:00
Izabela Orlowska
a3ab21f04a AAPT2: always say which file failed to compile
Sometimes AAPT2 doesn't include the path of the file in the error
message, or just outputs a warning where an error should be printed
(but the overall build still fails without an error message). Let's
always include the file path to make it easier for the users to find out
the source of the failure.

Fixes: 122856772
Test: manual
Change-Id: Ibbbfd21b372792e5eaa40278186eb64cdfb0f60e
2019-01-17 12:12:25 +00:00
TreeHugger Robot
54938a0534 Merge "AAPT2: Add support for parsing codeNames with fingerprints." 2019-01-16 23:24:10 +00:00