Commit Graph

6527 Commits

Author SHA1 Message Date
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
Adrian Roos
0fa45f1e50 Merge "apilint: correctly parse enum_constant" 2019-01-22 10:41:53 +00: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
Ryan Mitchell
02d9c1e931 Remove RRO policy product_services
Since Q will no longer have a product_services partition, remove instances of
the product_services policy across aapt2, androidfw, and idmap2.

Bug:122745343
Test: aapt2_tests and libandroidfw_tests
Change-Id: I97c223a0bf5a2eab95811e5f738b44af6335e0ea
2019-01-16 11:47:33 -08:00
Ryan Mitchell
bf08b91174 Merge "Add android.hardware.fingerprint for pre-Q" 2019-01-16 19:18:59 +00:00
Nicholas Lativy
79f0396898 AAPT2: Add support for parsing codeNames with fingerprints.
In addition to supporting manifest declared codenames of the form
"[codename]", also support codenames of the form "[codename].[fingerprint]".

Matches the behaviour of PackageParser as of ag/6056697.

Test: ResourceUtils_test
Change-Id: I814330eba9d383e4549e35da791fcfa9bd0cdf57
2019-01-16 16:49:31 +00:00
Ryan Mitchell
cf9dd94323 Merge "Add encoding of name and actor overlayable fields" 2019-01-15 19:34:30 +00:00
Adrian Roos
c622379224 Merge "ApiLint: Add operator keyword and property parsing" 2019-01-15 15:37:37 +00:00
Mohamed Heikal
149b0d29c6 Merge "Resource Path Obfuscation" 2019-01-15 15:34:06 +00:00
Adrian Roos
403c8e35d8 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
2019-01-15 14:32:57 +01:00
Mathew Inwood
45942518a5 Add prod key for serverless config.
Integrate this into SignatureVerifier too.

Bug: 110509075
Test: atest CtsSignedConfigHostTestCases
Test: atest SignedConfigTest
Change-Id: I816598c3332f9577c802109053d0d0b9b1f2a699
2019-01-15 11:54:18 +00:00
Ryan Mitchell
ef5673a4c4 Add encoding of name and actor overlayable fields
Encode the actor and name attributes of <overlayable> elements in the
overlayable chunks. Two chunks cannot have the same name.

Bug: 110869880
Bug: 119390855
Test: aapt2_tests and libandroidfw_tests
Change-Id: I0ed95efef640b3927046b6155d1840f0d96030dd
2019-01-11 14:45:09 -08:00
Ryan Mitchell
e1de284ae9 Add android.hardware.fingerprint for pre-Q
Add "android.hardware.fingerprint" when
"android.hardware.biometric.fingerprint" is found, since the former is
deprecated in Q and the latter is not present pre-Q.

Bug: 115639644
Test: aapt2_tests
Change-Id: Id2b30e9fcc208759ee2e14a05d17c43db1e63db8
2019-01-11 14:36:20 -08:00
Ryan Mitchell
56ac01ebb4 Merge "Statically link libc++ into aapt2" 2019-01-11 22:35:25 +00:00
yaochen
213e8cf8af Merge "Add a struct wrapper for bytes fields in stats_log cpp APIs." 2019-01-11 19:02:29 +00:00
Chih-hung Hsieh
8940b940c1 Merge "Fix/suppress tools google-explicit-constructor warnings" am: 18f469b088 am: 0d2565a424
am: c7aeafd2db

Change-Id: I5fd12dc7ffdfc72da9dd1de7f67e23e7e05136df
2019-01-11 10:15:59 -08:00
Yao Chen
037ad04df7 Add a struct wrapper for bytes fields in stats_log cpp APIs.
To avoid conflict between statslog.write() function signatures for

Atom1 {
  Foo foo = 1 [logMode=bytes];
}

and

Atom2 {
  string bar = 1;
  int64 arg2 = 2;
}

Bug: 122571213
Test: manually tested with new atoms.

Change-Id: Ied0f0bd81cef8d0964f571e921f47022301157d9
Merged-In: Ied0f0bd81cef8d0964f571e921f47022301157d9
(cherry picked from Ied0f0bd81cef8d0964f571e921f47022301157d9)
2019-01-10 17:26:26 -08:00
Yao Chen
e89572cb94 Add a struct wrapper for bytes fields in stats_log cpp APIs.
To avoid conflict between statslog.write() function signatures for

Atom1 {
  Foo foo = 1 [logMode=bytes];
}

and

Atom2 {
  string bar = 1;
  int64 arg2 = 2;
}

Bug: 122571213
Test: manually tested with new atoms.
Change-Id: Ied0f0bd81cef8d0964f571e921f47022301157d9
2019-01-10 15:18:21 -08:00
Chih-Hung Hsieh
93561ab3b9 Fix/suppress tools google-explicit-constructor warnings
* Add explicit to conversion constructors/operators
* Remove redundant explicit of copy constructors

Bug: 28341362
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor
Change-Id: Ic11c22c59beb7aa32b878a23315b1036ca4e3c6a
2019-01-10 19:52:49 +00:00
Adrian Roos
6948154e70 Merge "118395019: Hide constants and methods in StatsLogInternal" am: 0a5f26376f am: d6393758a7
am: 9e9899720c

Change-Id: I7814e47f241fc433c5baa5d45b630088e5b8876b
2019-01-09 07:43:04 -08:00
Tor Norbye
0f2dc8d0f0 118395019: Hide constants and methods in StatsLogInternal
This CL updates the code generator which creates the
hidden StatsLogInternal class to explicitly hide
the generated constants and write methods as well.

The intent of this class was for everything to be hidden,
but it turns out that public methods and fields in
hidden classes which are extended by a public class also
ends up in the SDK, even though they don't appear in the
signature file. StringBuilder#setLength(int) is an
example of this.

Bug: 118395019
Test: make sdk
Change-Id: I97e510e8155ee50ade653f6abeb5479c7ca9029d
2019-01-08 14:20:31 -08:00
Adrian Roos
7884d6b909 ApiLint: Add Kotlin-style type support
Test: tools/apilint/apilint_sha.sh HEAD && python tools/apilint/apilint_test.py
Change-Id: Iac1fdabcbeffe57c8288d73b2359e8ce0b2bc3eb
2019-01-05 22:53:22 +01:00
Adrian Roos
7f8886a993 ApiLint: Performance improvements for verification
Test: tools/apilint/apilint_sha.sh HEAD
Test: python tools/apilint/apilint_test.py
Change-Id: I90f18181cd0d3c43f176d7c9d1b198f6f5172390
2019-01-05 20:09:38 +01:00
Adrian Roos
a30d062775 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
2019-01-05 14:02:38 +01:00
Adrian Roos
d170961b02 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
2019-01-05 14:02:38 +01:00
Ryan Mitchell
81bae2d158 Statically link libc++ into aapt2
Bug: 121280559
Change-Id: Ide6513d5cf51b832ad2c4a15676db050856728df
Test: ldd aapt2 and manual testing
2019-01-04 22:27:51 +00:00
Chih-Hung Hsieh
3b3be3f10f Merge "Fix/suppress aapt/aapt2 google-explicit-constructor warnings" am: cdf6be573f am: d42fe48c93
am: 0bf62f1309

Change-Id: Iffb7e4a145b172a35dd58b9450d4a5184d8b07f7
2019-01-04 12:20:01 -08:00
Chih-Hung Hsieh
1fc78e1814 Fix/suppress aapt/aapt2 google-explicit-constructor warnings
* Add explicit to conversion constructors/operators
* Use NOLINT or NOLINTNEXTLINE to suppress warnings on intended converters

Bug: 28341362
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor
Change-Id: Ie02101ea7c422e8add535c111a30a2f21ead0ace
2019-01-04 17:38:13 +00:00
Ryan Mitchell
a4ee276629 Merge "Remove raw values from proto APK" 2019-01-04 16:43:22 +00:00
Ryan Mitchell
479fa39d65 Remove raw values from proto APK
Raw attribute values are not included in xml files when building binary
APKs but they are when building proto APKs. Remove raw attribute values
and create a new convert flag that (--keep-raw-values) that allows raw
value to be kept.

Also added flag to link to keep raw attribute values.

Bug: 115915884
Bug: 116700688
Test: aapt2_tests
Change-Id: Id50136b775b3f43d159ca06181282f6a7b8eaf40
2019-01-03 16:19:04 -08:00
Ryan Mitchell
a695f1da1f Merge "Fix long file paths for Windows" 2019-01-03 23:38:21 +00:00
Chih-hung Hsieh
b708a7953d Merge "Fix/suppress incident* google-explicit-constructor warnings" am: 6af0e228f3 am: 78085ba0a3
am: ee844ad9a2

Change-Id: I53c2fd3886e565d824e2765671fb7965f07bd08d
2018-12-21 09:24:28 -08:00
Chih-hung Hsieh
6af0e228f3 Merge "Fix/suppress incident* google-explicit-constructor warnings" 2018-12-21 16:30:12 +00:00
Mohamed Heikal
c769403631 Resource Path Obfuscation
This CL allows aapt2 to obfuscate resource paths within the output apk
and move resources to shorter obfuscated paths. This reduces apk size
when there is a large number of resources since the path metadata exists
in 4 places in the apk.

This CL adds two arguments to aapt2, one to enable resource path
obfuscation and one to point to a path to output the path map to (for
later debugging).

Test: make aapt2_tests
Bug: b/75965637

Change-Id: I9cacafe1d17800d673566b2d61b0b88f3fb8d60c
2018-12-20 18:19:25 -05:00
Jack He
fe88a7d7f2 Merge "Statsd: Enable host_supported for libstatslog" am: 0d7970f4e9 am: 46efaea281
am: b60a7cdc07

Change-Id: I59c5e4c8e27d31ba38af827162e0adb50fc183b1
2018-12-20 15:04:34 -08:00
Treehugger Robot
0d7970f4e9 Merge "Statsd: Enable host_supported for libstatslog" 2018-12-20 22:05:58 +00:00
Chih-Hung Hsieh
7a88a938d2 Fix/suppress incident* google-explicit-constructor warnings
* Add explicit to conversion constructors/operators
* Remove redundant explicit of copy constructors

Bug: 28341362
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor
Change-Id: I26a11bb798d25605577269ed340e97afc8566960
2018-12-20 13:45:04 -08:00
TreeHugger Robot
b34e8528ca Merge "Use vector instead of VLA to avoid uninitialized values" 2018-12-20 14:39:20 +00:00
Adrian Roos
bdadd6cc4c Merge changes Ibe09f115,Ib015669e
* changes:
  apilint: Fix API lint issues 2/2
  apilint: Fix API lint issues
2018-12-20 14:31:47 +00:00