Commit Graph

6588 Commits

Author SHA1 Message Date
Siarhei Vishniakou
457b1601e1 Update VirtualKeyMap usage
Since the VirtualKeyMap has been refactored, updated the
validation tool to use the new signature.

Bug: 113575658
Test: atest libinput_tests inputflinger_tests

Change-Id: Ifb0eb5b2913020f1e1402dcb6a36c9038c345807
2019-02-20 16:26:12 -06:00
Izabela Orlowska
a1dea5f915 Merge "AAPT2: allow regexes for extensions to not compress" 2019-02-20 12:55:58 +00:00
Izabela Orlowska
0faba5fdfa AAPT2: allow regexes for extensions to not compress
Change-Id: I09d2ad1d1466643ca7628c6480224e16b9002ee5
Fixes: 67575899
Test: added + manual
2019-02-20 10:36:43 +00:00
Sasha Smundak
2f2e353f79 Merge "Convert Android.mk file to Android.bp" am: a81d64e940 am: efa1d26538
am: 8e0d9d8473

Change-Id: Ic6d75ff8e072f9f3eb6ca472bea0122ac220075a
2019-02-19 10:57:08 -08:00
Ryan Mitchell
975c6e2d26 Merge "Fix seg faul when parsing invalid <plurals>" 2019-02-19 18:09:56 +00:00
TreeHugger Robot
03f311cb75 Merge "Revert "Fix loaded apk string pool order"" 2019-02-16 00:46:04 +00:00
Ryan Mitchell
2f9077dfbb Fix seg faul when parsing invalid <plurals>
If the inner element of a <plurals> tag fails to parse, aapt2 will seg
fault. Don't do that.

Bug: 123423125
Test: manual
Change-Id: Iff39fa84073da62d85279683ac3d03b7309bc5e3
2019-02-15 16:04:37 -08:00
TreeHugger Robot
6d9fc1c8de Merge "Prevent AAPT2 from versioning <set> tags" 2019-02-15 23:26:25 +00:00
TreeHugger Robot
ed6c556145 Merge "Do not derive source from binary APK" 2019-02-15 22:57:17 +00:00
Ryan Mitchell
90b7a08aaf Revert "Fix loaded apk string pool order"
This reverts commit 4e9a922ede.

Reason for revert: <b/122518436>

Change-Id: I3650b2c6c9bdfa69a3034f9ca49e95a9698c3cdd
2019-02-15 14:37:45 -08:00
Sasha Smundak
a0994a80d1 Convert Android.mk file to Android.bp
See build/soong/README.md for more information.

Bug: 122332340
Test: treehugger
Change-Id: I89cb31814f1442c91c31e5b867501d768679230e
2019-02-15 10:52:57 -08:00
Winson
b2d7f5343d Signature policy for overlayable items
Add encoding/decoding of new policy for overlays. Signature enforces
that an overlay package is signed with the same key as the actor of
the target resource, so that an overlay can be installed by the user
as a normal app but restricted to those built by the author of the
actor (which can be the same as the target).

This also enforces that a valid policy is specified.

This doesn't implement the actors nor the signature check.

Bug: 119402606

Test: ResourceParserTest ParseOverlayablePolicy
Test: ProtoSerializerTest SerializeAndDeserializeOverlayable
Test: aapt2_tests

Change-Id: I8495ad790c2ebd51759bc6eba81149680c209475
2019-02-14 10:07:13 -08:00
TreeHugger Robot
15c8c26efb Merge "aapt2: Add signature policy to Resources.proto" 2019-02-13 20:05:10 +00:00
Winson
6bee425591 aapt2: Add signature policy to Resources.proto
Adds the new enum values for none and the new signature policy.
None is needed to ensure we don't accidentally deserialize public,
as protobuf uses the first or 0 value enum as the default.

Test: aapt2_tests pass

Change-Id: Ibcb6b961abaa7e5c048e80c4a3eaf1b6d1d421b5
2019-02-13 07:59:55 -08:00
Ryan Mitchell
aada89ce19 Correctly insert platformBuildVersionCode/Name
AAPT(1) encodes platformBuildVersionCode and
platformBuildVersionName into the manifest along with
compileSdkVersion and compileSdkVersionCodename. AAPT2 was extracting
the platform attributes from the app being created rather than the
framework.

This change inserts the correct platform attributes.

Bug: 124227171
Test: aapt2_tests
Change-Id: I4bc7986d25f065cecf01b9e988de4d37283ef7de
2019-02-12 08:16:03 -08:00
Sasha Smundak
0f167a214a Merge "Convert Android.mk file to Android.bp" am: 190ff7457c am: 4bb2c54698
am: 8d838a3ced

Change-Id: I2c2c5ccb7da321ee7896e01131f84090797eb6db
2019-02-11 18:05:30 -08:00
Sasha Smundak
31754eb5df Convert Android.mk file to Android.bp
See build/soong/README.md for more information.

Bug: 122332340
Test: treehugger
Change-Id: I52416790e1e4493dd4fe57404095351b8d37ea22
2019-02-11 14:58:20 -08:00
Muhammad Qureshi
10357ba767 Merge "Generate constants for enum values in cpp header" 2019-02-09 01:44:43 +00:00
Ryan Mitchell
b5b162bfe6 Do not derive source from binary APK
When loading the binary APK, do not set the paths of Source structs to
the path of the binary APK. This causes the merge_zips step of the build
system to fail.

Bug: 124082573
Test: vendor/google/build/build_mainline_modules.sh
Change-Id: I84b8d43c5b6a5835e7ff6bd579c4eb744e02c20f
2019-02-07 20:28:26 -08:00
Muhammad Qureshi
dc132af790 Generate constants for enum values in cpp header
This is the C++ counterpart of the enum generation for Java done in
ag/I1ad19b86e28d0df0f8c15d4c995d101423cff4c2

Bug: 120990429
Test: builds successfully, logged one of atoms with an enum in C++ code and verified statsd logcat

Change-Id: I2c1452c0590aecdef0dbede6d88014c748e6509e
2019-02-06 23:17:21 +00:00
Andrei Onea
da01ea5b1c Add whitelist atom field option
Whitelisted atoms can be triggered from any source
Test: stats-log-api-gen-test
Bug: 119217680
Change-Id: Ia5faed04d696b59ba4ffaab13f5046f943d8a8b7
2019-02-06 18:55:06 +00:00
TreeHugger Robot
275c3ec658 Merge "Option to exclude configs from AAPT2 Link" 2019-02-01 02:13:08 +00:00
Aurimas Liutikas
ab364fc3b6 Suppress -Wimplicit-fallthrough in aapt code
AaptAsssets intentinally falls through in a switch statement.
This change adds [[fallthrough]]; to suppress this implicit fallthrough.

frameworks/base/tools/aapt/AaptAssets.cpp:305:17: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
                case 5:
                ^
frameworks/base/tools/aapt/AaptAssets.cpp:305:17: note: insert '[[fallthrough]];' to silence this warning
                case 5:
                ^
                [[fallthrough]];
frameworks/base/tools/aapt/AaptAssets.cpp:305:17: note: insert 'break;' to avoid fall-through
                case 5:
                ^
                break;

Test: make -j aapt
Change-Id: Ia9d2ca3b59eb804e20c6295791f6a19f0f5f63ab
2019-01-30 08:32:57 -08:00
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
Winson
3c918b8cee Option to exclude configs from AAPT2 Link
Adds --exclude-configs to remove matching configs from resulting APK. This matches on explicitness, so if the resource contains all the flags set by the option exactly, it will be removed, but not the other way around.

"--exclude-configs fr" with fr-land resource will remove.
"--exclude-configs fr-land" with fr resource will not remove.

Bug: 119678846

Test: aapt2_tests ResourceExcluder_test
Test: manually ran link on a test set of res

Change-Id: Ieccdecde4aea1fa0502abfd092dffa7da8f929ea
2019-01-28 11:06:33 -08: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
Winson
a00d969c9c Prevent AAPT2 from versioning <set> tags
In AAPT, if --no-version-vectors is added and an XML file is a vector, it prevents the entire XML's contents, including children attributes, from being split by version for compat.

In AAPT2, each element is checked individually, and so "set" has to be ignored manually.

Bug: 111056281

Test: Compiled avd_progress_indeterminate_horizontal.xml linked in bug

Change-Id: I20a7888f36cf5923b6dd8e3b701243c74f8d421b
2019-01-24 15:59: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