Commit Graph

6518 Commits

Author SHA1 Message Date
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
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
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
Jack He
34a892d2f5 Statsd: Enable host_supported for libstatslog
* libutils must be used as a static library when compiled on host
* Host does not have Android system properties and hence we cannot
  use <cutils/properties.h>. In fact, properties.cpp is not even
  compiled on host for libcutils. Therefore, this CL adds a check
  for __ANDROID__ macro before including <sys/propoerties.h> and
  before calling properties_get_bool()
* On host, statsd logging will be disabled since host does not
  use statsd for anything

Fixes: 121294178
Test: test drive statsd
Change-Id: I838ff02468c650c5f7d85e68fa5008b98f08ce8c
2018-12-20 00:56:15 -08:00
Mathew Inwood
cfc7952cc8 Include annotation property values in output.
When editing annotations, we want the ability *not* to overwrite any
existing annotation properties already in place. Include any properties
set on the annotation in the output, so that the edit_annotations script
can know that they're there.

The annotation properties are encoded like URL query parameters for
convenience; it makes them easy to encode here & subsequently decode on
the other side (in Python).

Test: m framework-annotation-proc & inspect output.

(cherry picked from commit bd7077065c)

Merged-In: I71fb1215ad2790751be336b4955c163bb323a4a6
Change-Id: I0b33e2b379076346ce258d93a9225a9143b7d91a
2018-12-20 07:47:29 +00:00
Colin Cross
b9e195546e Use vector instead of VLA to avoid uninitialized values
I502b34f23d61a7346d79ff0dc378add8461d2d27 added a continue before
skip[i] was set, which left it uninitialized and caused
non-deterministic output of incident-section-gen incidentd and a
non-deterministic incidentd binary.  Use a vector instead of a
variable length array for skip so that it is always initialized.

Test: valgrind incident-section-gen incidentd
Change-Id: Iac9778dc8bbf4ec5540e5e2ffdaa8e2dd852d6cc
2018-12-19 23:04:42 -08:00
Ryan Mitchell
2c8fc86694 Fix long file paths for Windows
Allows specifying which arguments into aapt2 are file paths.
If the path exceeds the maximum path length for Windows, encode the path using
the extended-length prefix.

Bug: 120853927
Test: aapt2_tests.exe

Change-Id: Ibe5c1cc79a70c33c302157f2ffd54525439a910f
2018-12-19 14:07:43 -08:00
Ryan Mitchell
ed2af4df00 Merge "Add actor and name parsing for overlayable" 2018-12-19 17:31:50 +00:00
Adrian Roos
61e3730bc0 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
2018-12-19 17:27:12 +01:00
Adrian Roos
2c5cacfd36 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
2018-12-19 17:27:12 +01:00
Anton Hansson
d4dcb41863 Merge "Make aapt2 dump badging print overlay info" 2018-12-19 10:36:08 +00:00
Chih-Hung Hsieh
2491af24a8 Merge "Fix performance-for-range-copy warnings" am: bc29242288 am: 7adb73f332
am: 2296036a40

Change-Id: Ia99ea6c9633986e68340bc88983d06baa7a1c597
2018-12-17 14:31:14 -08:00