6136 Commits

Author SHA1 Message Date
Colin Cross
fdbe7d1ca9 Don't put android.os.Parcelable in framework.aidl
Parcelable shouldn't be in the list of parcelables in framework.aidl.
Remove it to fix warning when running aidl:
framework.aidl:287 attempt to redefine built in class android.os.Parcelable

Also make the dependency on sdk_parcelables not be order-only so
framework.aidl gets rebuilt when sdk_parcelables changes.

Bug: 73135791
Test: ParcelableDetectorTest
Test: out/target/common/obj/framework.aidl does not contain android.os.Parcelable
Change-Id: If5222879be9ec1e5fa08810adc624ec526ddc0ec
2018-02-09 11:29:15 -08:00
Nick Butcher
e78a816966 Prevent AAPT from versioning <animated-selector> tags.
Bug: 69359529
Test: Manually tested with ag/3178054
Change-Id: I10ae4d96c2a31a0a7c363d7a9292ecdfd3bb526a
2018-02-09 11:36:27 +00:00
Mohamed Heikal
1084432e1e AAPT2: Fix silent failure when ContainerReader fails during Link
Currently in the link step ContainerReader is used to read files but the
reader is not checked for errors prior to the read. This can lead to
silent failure when reading invalid resource files.

Change-Id: I6420699ad30b5b84b0b2c696af8eb5a6cbd4111e
2018-02-08 14:50:14 -05:00
Colin Cross
83b3cb4830 Merge "Add missing copyright messages" am: 872f386f6b am: 32a1dc5075
am: cf4d62fdd3

Change-Id: I75f2c81a9e7c7ec0175e50b3bb58cedc8c36a2be
2018-02-07 02:13:05 +00:00
Colin Cross
cf4d62fdd3 Merge "Add missing copyright messages" am: 872f386f6b
am: 32a1dc5075

Change-Id: I9602e1c9dda5e842fd71c9f48cf354aea4650d74
2018-02-06 23:06:08 +00:00
Colin Cross
1b27440abc Add missing copyright messages
Bug: 72993971
Test: m sdkparcelables
Change-Id: I9fa422160c29ce3054748b2b8d1e26541a697a90
2018-02-06 11:10:25 -08:00
Shane Farmer
11cdc1cf7a AAPT2: Add order attribute to groups
Require explicit ordering of groups in the configuration file to ensure
that the correct version code is set. Ordering based on a single ABI is
straight forward to ensure Play Store delivers the correct APK, but when
an APK needs more than one ABI things get messy quickly. This also goes
for screen density etc. The only thing that is easily sorted without
this attribute is android-sdk since an artifact can only reference a
single SDK.

Test: unit tests
Test: manually split an APK with update config.xml
Change-Id: I37a2b8b8a8409d6d6ff27c7142d4c8c8065a7a51
2018-02-02 12:11:18 -08:00
Dave Ingram
22ed4122e7 AAPT2: Fix typo in BinaryPrimitives oneofs
Follow-up to ag/3449569

Bug: 69587794
Test: aapt2_tests
Change-Id: I95d2ba600c00bda2a8420794e43501f9bfca01df
2018-01-30 21:15:36 -08:00
Yi Jin
b8344dc72f Fix command line tool to set the right privacy enum.
Test: manual
Change-Id: I3f0845ea32b46f1a028f8b6d3d4180a90a47beb5
2018-01-24 18:25:33 -08:00
TreeHugger Robot
adb4fc73b0 Merge "Avoid processing log event when there is no uid field." 2018-01-24 18:18:24 +00:00
Benoit Lamarche
ae992b6392 Merge "Fail when there is an ASM error" am: 4152497b4b am: 05bb83c87d
am: 5fb872e787

Change-Id: I63222e0f376184649f8634932edc6ee296418b91
2018-01-24 12:45:48 +00:00
Benoit Lamarche
5fb872e787 Merge "Fail when there is an ASM error" am: 4152497b4b
am: 05bb83c87d

Change-Id: I27be59afd9f021c2933d10b6becb0f7542162a37
2018-01-24 12:36:26 +00:00
Yangster-mac
68985805f2 Avoid processing log event when there is no uid field.
Test: all statsd unit test passed

Change-Id: Id434d86586950a485b30a244f3c030e8202c1c6d
2018-01-23 16:43:07 +00:00
Benoit Lamarche
9f17dfcba6 Fail when there is an ASM error
Otherwise during a build, Locked Region Code Injection may encounter an
ASM Analyzer exception, and the build will not fail, even though
injection won't have succeeded.

Test: make
Change-Id: Iee69f1a78fde735db62c7f73405b8cec4e410793
2018-01-22 17:42:21 +01:00
TreeHugger Robot
e5b3296316 Merge "Allow <adopt-permissions> tag in manifest" 2018-01-19 17:10:29 +00:00
David Chaloupka
cfd1b4b263 Merge "Handle multiple packages of same name in 'aapt2 convert'" 2018-01-19 10:57:53 +00:00
TreeHugger Robot
e528516731 Merge "Ignore missing font in fontchain_linter.py" 2018-01-19 03:37:25 +00:00
Seigo Nonaka
1403ff2b0b Ignore missing font in fontchain_linter.py
It is totally valid if the font is missing even if the font is listed in
fonts.xml. Android Watch has less fonts and OEM vendor may reduce the
font files.

Bug: 72159040
Test: m fontchain_lint
Change-Id: I22bdf7bfeb6d80a2a338ebf7536c8eaf193b03c5
2018-01-18 17:24:31 -08:00
TreeHugger Robot
8f2fffd809 Merge "AAPT2: Store BinaryPrimatives in protos as oneofs" 2018-01-19 01:00:00 +00:00
David Chaloupka
e3c1a4a9d2 Handle multiple packages of same name in 'aapt2 convert'
aapt2 currently looks-up packages only by package name and then verifies
whether the package ID has the expected value. For pre-L we need to be able
to handle resource tables having packages of same package name but
different IDs.

Note that this CL fixes only proto->binary conversion but many other aapt2
commands are still affected. This is because many transformations still
consider package name as sufficient identifier of a package.

Bug: 72143207
Test: Manual
Change-Id: Id8a920d6cd15bec747d3124270f5bcb7f48924cf
2018-01-18 19:20:01 +00:00
David Chaloupka
415689bb1c Merge "Adjust file reference type in 'aapt2 convert'" 2018-01-18 10:06:01 +00:00
Michael Wachenschwanz
d06f1f38a9 AAPT2: Store BinaryPrimatives in protos as oneofs
Fixes: 69587794
Test: aapt2_tests

Change-Id: Idf5526f6b1b720b6e476bcdf8c2155e13a6ecc0f
2018-01-17 16:58:43 -08:00
TreeHugger Robot
bd56951c5b Merge "aapt2: Fix issue with Manifest duplicate handling" 2018-01-17 20:20:29 +00:00
David Chaloupka
b66db4ec4c Adjust file reference type in 'aapt2 convert'
When converting between binary and proto APKs in either direction, the
'aapt2 convert' command did not adjust FileReference type for entries
inside the resource table. This fix makes in-place changes of the resource
table passed to ConvertApk, which is safe since the resource table is
thrown away after the conversion.

Bug: 71854843
Test: Manual
Change-Id: Ide6e141269392db15b399db3566f18175f5133d5
2018-01-17 11:07:44 +00:00
Adam Lesinski
a4fb17bbbb aapt2: Fix issue with Manifest duplicate handling
Fixed a memory-corruption issue that led to multiple duplicate
permission entries being generated for Manifest.java.

Bug: 71641288
Test: make aapt2_tests
Change-Id: I8cd37929c4883aaba2beebbf874c7ee3234d51d8
2018-01-16 17:06:33 -08:00
Yangster-mac
ba5b9e44bb Stats log interface for single node attribution chain.
Usually the input parameters for attribution chain is list of int64/string.
The new c++interface takes one int64 and one string as input and write
as a single node into logd.

This will help avoid allocating temp objects in battery stats java code.

Test: all statsd unit test passed.
Change-Id: Ia0f7f26b71a570bd3628c42726a5afb0a500d073
2018-01-15 16:41:29 -08:00
TreeHugger Robot
db947de10f Merge "Add another pass of commont lint rules." 2018-01-12 20:57:05 +00:00
Jeff Sharkey
336dd0bf63 Add another pass of commont lint rules.
-- Parcelables should be inflated through CREATOR
-- Methods with no arguments should throw ISE
-- Examine constructors for Executors
-- Listeners should always be last for lambdas
-- Verify naming of UserHandle methods
-- Verify naming of Params objects
-- Verify naming of Context service constants
-- Verify tense of enabled methods

Better exception tracking.

Test: manual inspection
Bug: 37784434, 37749454, 37705832
Bug: 37705176, 37536230, 37533040, 71866617
Change-Id: If2f19784c46a4d99f54577a7365babfd357ca3f7
2018-01-12 12:12:29 -07:00
Izabela Orlowska
3c3f9b5d07 AAPT2: always compile 9patch files
Test: existing tests
Bug: 70578281
Change-Id: I7ffcbdd664108348182e71d01b1680e2399ec37c
2018-01-12 14:26:31 +00:00
TreeHugger Robot
4f9ba20690 Merge "AAPT2: Allow compatible duplicate Attributes" 2018-01-12 02:37:13 +00:00
Adam Lesinski
73bff1e851 AAPT2: Allow compatible duplicate Attributes
If a resource XML file defines two compatible Attributes, they should
be merged without throwing an error. Ex:

<declare-styleable>
  <attr name="conflict" format="string" />
</declare-styleable>

<declare-styleable>
  <attr name="conflict" format="string|reference" />
</declare-styleable>

In this case, string|reference and string are the same, so these should
merge correctly.

Bug: 65699599
Test: make aapt2_tests
Test: make AaptBasicTest
Change-Id: I7b0f956d2332f7f0b458acd59ca0a606b2cfdf95
2018-01-11 13:54:11 -08:00
Yi Kong
0556f3382b Add virtual dtor for virtual classes
Delete called on non-final virtual classes but non-virtual destructor.

Fixes -Wdelete-non-virtual-dtor warning.

Test: m checkbuild
Change-Id: Ia84c118db1a53f1ac846354a6023726e394a87ed
2018-01-10 19:59:58 -08:00
Nick Butcher
f55db8c364 Prevent AAPT from versioning <animated-selector> tags.
Bug: 69359529
Test: Manually tested with ag/3178054
Change-Id: I10ae4d96c2a31a0a7c363d7a9292ecdfd3bb526a
2018-01-09 15:24:21 +00:00
Yangster-mac
20ac944ea0 Handle null string in jni and c++ stats-log-api interfaces.
Test: statsd unit test passed.
Change-Id: I4a475d6fcc0b4a0293450bc0ccdd718b362c498b
2018-01-08 14:54:48 -08:00
Yi Kong
95820bc4df Merge "Add virtual dtor for virtual classes" am: 27f61a94d6 am: 2d7813a4a7
am: 2807036b09

Change-Id: I3723483c2aac5580a7db3256a39eca278a3ee9fb
2018-01-08 21:22:21 +00:00
Yi Kong
2807036b09 Merge "Add virtual dtor for virtual classes" am: 27f61a94d6
am: 2d7813a4a7

Change-Id: I8787ff83ec93f5a8ae2e08e1af573d13750d9aa5
2018-01-08 21:07:09 +00:00
Yi Jin
3c034c987e Implement a new type of section which reads from logd and dumps proto.
And implement a file section which reads from event-log-tags for
decoding binary logs.

Bug: 70936599
Test: atest incidentd_test && atest incident_helper_test and flush on
device and test log sections and event_log_tag_map
Change-Id: Ib3d35e317f355de69f01ded012482486e9a43da6
2018-01-06 20:33:14 -08:00
Treehugger Robot
27f61a94d6 Merge "Add virtual dtor for virtual classes" 2018-01-05 23:27:33 +00:00
Alan Viverette
cf5326fae1 Allow <adopt-permissions> tag in manifest
Change-Id: Ib595ab84da3a68e6a72f203ee51e3c86c7a3a3d1
Fixes: 71640901
Test: migrate GoogleServicesFramework to AAPT2, build
2018-01-05 16:04:33 -05:00
Yi Jin
e058f1a952 Merge "Dump Proto to a csv" 2018-01-04 21:09:39 +00:00
Yi Jin
0f2599fbf0 Dump Proto to a csv
Bug: 69427323
Test: N/A
Change-Id: I1b89898afc30d5a0df6355ee1f6477df8d271f98
2018-01-04 11:03:31 -08:00
Colin Cross
e9727164cb Merge changes I9de0ffe9,Idc804896 am: 153fb1c6e0 am: 99161bc1c7
am: 52d4011195

Change-Id: Ia3b7f49d4dbd38660570c7c84991a69f86bf24e4
2018-01-04 01:17:42 +00:00
Colin Cross
52d4011195 Merge changes I9de0ffe9,Idc804896 am: 153fb1c6e0
am: 99161bc1c7

Change-Id: Id831c5ab771fa59ac9906d473ffeb7720fbbdf54
2018-01-04 01:10:47 +00:00
Yi Kong
6dbd3d7a59 Add virtual dtor for virtual classes
delete called on non-final virtual classes but non-virtual destructor.

Fixes -Wdelete-non-virtual-dtor warning.

Test: m checkbuild
Change-Id: I142a2f70286a28722e462df4c160cb7aa3753c2a
2018-01-03 11:41:12 -08:00
Yangster-mac
2087716f2b 1/ Support nested message and repeated fields in statsd.
2/ Filter gauge fields by FieldMatcher.
3/ Wire up wakelock attribution chain.
4/ e2e test: wakelock duration metric with aggregated predicate dimensions.
5/ e2e test: count metric with multiple metric condition links for 2 predicates and 1 non-sliced predicate.

Test: statsd unit test passed.

Change-Id: I89db31cb068184a54e0a892fad710966d3127bc9
2018-01-01 10:01:36 -08:00
Adam Lesinski
fca5e427e2 AAPT2: <uses-library /> and <library /> don't need to be Java packages
- Also fixes issue where a failure checking the Java package of an attribute
would yield no error message.

Bug: 70722199
Test: make aapt2_tests
Change-Id: I417d5ffe18c8d4ba2f1638f9fb9ba29278ec8e94
2017-12-28 08:17:51 -08:00
Adam Lesinski
e6aa6d1421 AAPT2: Keep file enumeration consistent across platforms
Filesystem directory enumeration is platform dependent, so
sort the files lexicographically according to source path before
consuming them in the compile command.

Bug: 70680618
Test: manual
Change-Id: I6706dea2eb40cbaff8a586994dd1013976e4ced4
2017-12-28 08:17:43 -08:00
TreeHugger Robot
d14c826c82 Merge changes I0face862,If2d091e5,I4e18e63f
* changes:
  AAPT2: Sort artifacts based on the Play Store rules.
  AAPT2: Allow empty group definitions
  AAPT2: Get list of multi-APK artifacts without APK file
2017-12-20 18:05:53 +00:00
TreeHugger Robot
54839e0d30 Merge "AAPT2: Add flag to compile command for outputting symbols" 2017-12-20 15:27:19 +00:00
Izabela Orlowska
ad9e1324ff AAPT2: treat manifest validation errors as warnings when asked
Bug: 65670329
Test: updated
Change-Id: Ic554cc20134fce66aa9ddf8d16ddffe0131c50e9
2017-12-20 13:25:59 +00:00