Commit Graph

5543 Commits

Author SHA1 Message Date
Alan Leung
94e68505c4 Merge "Merge "ASM Priority Boost Tool" am: 8ff8dd16cc am: 8ac18ceb8a" into oc-dev-plus-aosp
am: 643275b838

Change-Id: Idb669d7b381f8291fb44dcc5a4d1824d118319d9
2017-06-22 22:50:42 +00:00
Alan Leung
578e39fe04 Merge "ASM Priority Boost Tool" am: 8ff8dd16cc
am: 8ac18ceb8a

Change-Id: I68f86f307368de6870a7d649118d1a0f8c744a88
2017-06-22 22:34:29 +00:00
Alan Leung
ed36ba52bf ASM Priority Boost Tool
This tool is a replacement for the Jack plugin that allows injection
of static method calls before lock enter and exit.

A common use case would be to boost a thread's priority as soon as
it acquires a heavily contented lock and resetting the priority upon
release.

This tool is meant to be optionally invoked from /build/core/ rules
during the build process.

Test: JUnit Tests / resulting image on a bullhead.

Change-Id: If400414a0bf50f03768a1de2ebee42086a9d701f
Merged-In: If400414a0bf50f03768a1de2ebee42086a9d701f
(cherry picked from commit 93db63059a)
2017-06-22 14:00:04 -07:00
Adam Lesinski
b9f0548341 AAPT2: Do not interpret %n as a format specifier in string resources
%n is a special value marking a platform independent newline and is
not to be considered a format argument.

Bug: 37132275
Test: make aapt2_tests
Change-Id: I806521e44afe20004344dee9f18ecee6cc7086ea
2017-06-06 20:02:38 +00:00
Adam Lesinski
7a917a27ef AAPT2: Allow <layout> in <activity> tag in AndroidManifest.xml
Bug: 62189611
Test: make AaptTestAppOne
Change-Id: Ic090e4a002b24f2289f47dfba7439638e5848062
2017-06-06 18:14:48 +00:00
Adam Lesinski
54376bbd4b Merge "DO NOT MERGE: AAPT2: Allow undefined resources (placeholders)" into oc-dev
am: 2f84c4715d

Change-Id: I266b8648e9aa292befa02c4e7dc0ce54f0b26e21
2017-06-05 17:54:37 +00:00
Adam Lesinski
90919978e7 DO NOT MERGE: AAPT2: Allow undefined resources (placeholders)
A resource defined like so:

<item type="drawable" name="foo" />

should be assigned the value @null.

The only exception is for <string> resources, which are given the
empty string value (since <string></string> is ambiguous). The decision
to use "" is based off the fact that old AAPT used to assign "" to all
undefined resources, even non-string ones.

Bug: 38425050
Test: make aapt2_tests
Change-Id: Ib3e0f6f83d16ddd8b279c9fd44a07a37867b85e9
2017-06-02 16:51:59 -07:00
Adam Lesinski
bab4ef56d7 AAPT2: Allow undefined resources (placeholders)
A resource defined like so:

<item type="drawable" name="foo" />

should be assigned the value @null.

The only exception is for <string> resources, which are given the
empty string value (since <string></string> is ambiguous). The decision
to use "" is based off the fact that old AAPT used to assign "" to all
undefined resources, even non-string ones.

Bug: 38425050
Test: make aapt2_tests
Change-Id: Ib3e0f6f83d16ddd8b279c9fd44a07a37867b85e9
2017-06-02 16:48:38 -07:00
Adam Lesinski
127f10037b Merge "AAPT2: Allow any value type for <item> without format attr" into oc-dev am: 1ac325e4d5
am: 3c860ed41d

Change-Id: I44719ae4d742b518f59c9c9bbc226ec9773ce365
2017-06-02 03:04:42 +00:00
Adam Lesinski
3c860ed41d Merge "AAPT2: Allow any value type for <item> without format attr" into oc-dev
am: 1ac325e4d5

Change-Id: I1b1180f2b33a077b2c46a8466c58d83ed618576e
2017-06-02 02:35:07 +00:00
Adam Lesinski
e597d68d33 AAPT2: Allow any value type for <item> without format attr
TO bring AAPT2 behavior in-line with AAPT, <item> has a default
format of "any", and only becomes restricted with an explicit format
attribute.

Bug: 62260121
Test: make aapt2_tests
Change-Id: Ife416f520e6c2710bb30e3ba3f2d4463794bfa06
2017-06-01 17:16:44 -07:00
TreeHugger Robot
95cad98ad5 Merge "AAPT2: XML configuration file parser." 2017-06-01 07:20:59 +00:00
Shane Farmer
74cdea34cd AAPT2: XML configuration file parser.
The XML file is parsed with the aapt::xml::XmlDom parser and actions are
used for the elements we are interested in. This means that there are
cases where a user could add aditional tags/elements to the document
that are technically invalid (acording to the schema) but are ignored by
the parser. This allows us to be more lenient which probably isn't a bad
thing.

Documents have the namespace stripped before processing as the
XmlActionExecutor ignores any elements with a namespace. The namespace
is validated before being removed.

The test cases are all based off the previous example XML file.

Test: Unit tests

Change-Id: I86d7e0dc6347ace3eaa60c1842d59f3cd0d4f749
2017-05-31 16:18:31 -07:00
Shane Farmer
7eded65454 AAPT2: XML schema and an example configuraiton
The current iteration of the schema allows for both Split and Optimize
commands running off the same file. A split command is multiple optimize
command, and an optimize is a split with only a single artifact. To
combine the two, a single file with one or more artifacts can be passed
to either command. If multiple artifiacts are used for an optimize
command, the required artifact can be specified on the command line. A
configuration with only a single artifact can be used with either
command to get the same result.

Change-Id: Ie48eda6e2f9f8bf25d75ef7bcc3b3401a2d3e8eb
Bugs: 37847908
Test: xmllint --noout --schema aapt2.xsd example/config.xml
2017-05-31 16:05:07 -07:00
Adam Lesinski
7a5b406805 Merge "AAPT2: Update --no-version-vector list" into oc-dev am: f296105e22
am: ad227a8086

Change-Id: Ie60160136d6bbca607ce98cd675ffed984b2debc
2017-05-31 21:26:17 +00:00
Adam Lesinski
eac0410e5d Merge "AAPT2: Allow merging of Style attributes from overlays" into oc-dev am: f42c86660d
am: b5cdbdfcf8

Change-Id: Ifabd2f220f96f9dc4942c2cc65b24da6f2d90b13
2017-05-31 21:23:46 +00:00
Adam Lesinski
ad227a8086 Merge "AAPT2: Update --no-version-vector list" into oc-dev
am: f296105e22

Change-Id: I0cde63dfd73b50debdc56f549f7adb1318f05309
2017-05-31 21:15:32 +00:00
Adam Lesinski
b5cdbdfcf8 Merge "AAPT2: Allow merging of Style attributes from overlays" into oc-dev
am: f42c86660d

Change-Id: I4a52a16fff3d544d8d7d63d8a482ba7e2111d01a
2017-05-31 21:12:58 +00:00
TreeHugger Robot
f296105e22 Merge "AAPT2: Update --no-version-vector list" into oc-dev 2017-05-31 20:49:02 +00:00
Adam Lesinski
f42c86660d Merge "AAPT2: Allow merging of Style attributes from overlays" into oc-dev 2017-05-31 20:48:06 +00:00
Winson Chung
b3419d76a6 Merge changes from topic 'hw_bitmap' into oc-dev
am: 4e73123c52

Change-Id: Ic202387c7fddcf6cc87024812c112e5ce3a4ab7b
2017-05-31 18:56:50 +00:00
Winson Chung
4e73123c52 Merge changes from topic 'hw_bitmap' into oc-dev
* changes:
  DO NOT MERGE Updating AnimationSpec and related internal APIs to use GraphicBuffer.
  Update code to draw into hardware bitmaps.
2017-05-31 18:46:59 +00:00
Adam Lesinski
41ea44f63d AAPT2: Update --no-version-vector list
Keep in sync with AAPT. Since gradle is moving to use AAPT2
by default, updates to AAPT will no longer be necessary and
this will be the authoritative list until a more programmatic
solution presents itself.

Bug: 62211148
Test: manual
Change-Id: Id9232c9fb730c50e4850887fa0f5da82574ca900
2017-05-31 10:23:58 -07:00
Adam Lesinski
5924d8c9ab AAPT2: Allow merging of Style attributes from overlays
Previously style overlays would completely override an existing style.
To be compatible with AAPT, styles now merge with the overlay, allowing
the overlay's attributes and parent to take precedence.

Bug: 38355988
Test: make aapt2_tests
Change-Id: Id25c7240050a43e6a4a177c6e3d51e048d0cceb5
2017-05-31 10:09:06 -07:00
Winson Chung
aa7fa01353 DO NOT MERGE Updating AnimationSpec and related internal APIs to use GraphicBuffer.
- This reduces the copy of the hardware bitmap when it is
  parceled/unparceled.

Bug: 38507414
Bug: 62021436
Test: Launch Overview to/from app, ensure that the header bar shows
Test: go/wm-smoke

Change-Id: I85a9a59a0a3699d1642158061d10fddef34393c3
Signed-off-by: Winson Chung <winsonc@google.com>
2017-05-31 16:23:24 +00:00
TreeHugger Robot
49449579d2 Merge "Create fonts.xml module for adding fonts.xml to system/etc" 2017-05-31 01:29:01 +00:00
Andrew Sapperstein
7459bc49b0 Create fonts.xml module for adding fonts.xml to system/etc
Previously, we used PRODUCT_COPY_FILES. However, that does not allow
overriding the file to use a different one on a per-device basis.
This change migrates the logic to using a BUILD_PREBUILT module
called fonts.xml.
To add additional fonts, the add_additional_fonts.py script has been
added. If ADDITIONAL_FONTS_FILE is defined, add_additional_fonts.py
is run and generates a new version of fonts.xml that contains the
content of ADDITIONAL_FONTS_FILE added where
"<!-- fallback fonts -->" is added.

Bug: 36855735
Bug: 37997769
Test: manual. built multiple devices and verified that the correct
versions of fonts.xml were showing.

Change-Id: I8308f0cb3068274bca5ebd25a38cc023babbd69d
2017-05-30 16:49:14 -07:00
Adam Lesinski
ab7d501ad8 Merge "AAPT2: Fix <add-resource> tag for overlays" into oc-dev am: 8255ced3f5
am: ce1e415d55

Change-Id: I13ae82041b4b94a0226aa4506b59f8bbcce971be
2017-05-30 21:05:22 +00:00
Adam Lesinski
ce1e415d55 Merge "AAPT2: Fix <add-resource> tag for overlays" into oc-dev
am: 8255ced3f5

Change-Id: Icc420eea48a8379723c0bc84a5f30c03ac2a2492
2017-05-30 20:53:38 +00:00
TreeHugger Robot
2e0283a717 Merge "Check CJK punctuation in early non-CJK fonts" 2017-05-30 20:06:02 +00:00
Adam Lesinski
e3d684a86a Merge "AAPT2: Follow symlinks when compiling" into oc-dev am: 6ea61f9c6d
am: c69611fd86

Change-Id: Idd8ebb98c04fcfd061c36c2e5dcd678d88c5a267
2017-05-30 13:58:24 +00:00
Adam Lesinski
c69611fd86 Merge "AAPT2: Follow symlinks when compiling" into oc-dev
am: 6ea61f9c6d

Change-Id: I18dc95b8adf503e0bf72e5b48036945dc95312de
2017-05-27 01:51:55 +00:00
Adam Lesinski
4488f1c74a AAPT2: Fix <add-resource> tag for overlays
Bug: 38355988
Test: make aapt2_tests
Change-Id: Iea8887f55f8ceb2c15bd963405fd132916173c0c
2017-05-26 17:38:34 -07:00
Adam Lesinski
2354b56837 AAPT2: Follow symlinks when compiling
Bug: 62144459
Test: make AaptSymlinkTest
Change-Id: Idb3ab1ece17c52bb4fd174ec4c08a9e173289e55
2017-05-26 16:56:34 -07:00
Adam Lesinski
06169ed6b3 Merge "AAPT2: Implement attribute compat versioning" into oc-dev am: e229113d46
am: 138d2a65b3

Change-Id: Ie3502e99aefa46ee9fe62a0e821e55cb160b7142
2017-05-26 18:55:01 +00:00
Adam Lesinski
138d2a65b3 Merge "AAPT2: Implement attribute compat versioning" into oc-dev
am: e229113d46

Change-Id: I0200771f675cdfa69c458c374d3c16b0d91c5756
2017-05-26 18:49:11 +00:00
Adam Lesinski
c744ae8aca AAPT2: Implement attribute compat versioning
This change defines some hardcoded rules to degrade
attributes in newer SDKs to specific older attributes.

An attribute with a degrade rule will generate a new XML for the API
in which the attribute resulting from the degradation was introduced.

Since API 22 (Lollipop MR1), attributes are correctly ignored and do
not need to be versioned. In XML files defined for APIs 22+, the
original and degraded attributes coexist in the same XML file.

One such example is paddingHorizontal, introduced in API 26.
paddingHorizontal degrades to paddingLeft and paddingRight, which
were both introduced in API 1.

Bug: 35763493
Test: make aapt2_tests
Change-Id: I4aa8755a9ee2c0cc5afdc55c3d30093fd3a47f3d
2017-05-24 15:14:29 -07:00
Adam Lesinski
60d9c2fd55 AAPT2: improve some error messages
Test: manual
Change-Id: I11c96f8c825ffd43b7f68cb24f2c0746d75845f5
2017-05-23 19:57:33 +00:00
Roozbeh Pournader
63d4d0d358 Check CJK punctuation in early non-CJK fonts
Added tests check that CJK punctuation marks do not appear in
non-CJK fonts that appear earlier than CJK fonts.

This should prevent bugs like those fixed by
Ic2cbc79cecf9539ace8a432f373685eeff81e106 and
Ieeb4c04ca785e07a5db94006a6da31ad040b7e7a to appear again.

Change-Id: I622dccd2a619b2366987a81d1c7f8f49334f5638
Fixes: 38182099
Bug: 19355391
Test: make -j fontchain_lint
2017-05-18 18:38:36 -07:00
Adam Lesinski
ed52cefd94 Merge "AAPT2: Ignore trailing data after IEND chunk in PNG" into oc-dev am: 2d885e942d
am: 0196460f27

Change-Id: I8bff9b440b5a1f75d75e3601b654aa8825cf9523
2017-05-18 17:56:15 +00:00
Adam Lesinski
0196460f27 Merge "AAPT2: Ignore trailing data after IEND chunk in PNG" into oc-dev
am: 2d885e942d

Change-Id: Ic1c24dd55a4d6258533e57cea957a775e03013df
2017-05-18 17:42:44 +00:00
TreeHugger Robot
2d885e942d Merge "AAPT2: Ignore trailing data after IEND chunk in PNG" into oc-dev 2017-05-18 17:30:26 +00:00
Adam Lesinski
9541078397 Merge "AAPT2: Respect format attr in <array> resource" into oc-dev am: dc6da8b4df
am: e768ad3708

Change-Id: Idc3e83275630f73b5859a86e5101afa982241cbd
2017-05-17 23:22:27 +00:00
Adam Lesinski
e768ad3708 Merge "AAPT2: Respect format attr in <array> resource" into oc-dev
am: dc6da8b4df

Change-Id: Ic7aa094d3d663d98fa4bc20eaf436f1f453da5d7
2017-05-17 23:11:04 +00:00
Adam Lesinski
dc6da8b4df Merge "AAPT2: Respect format attr in <array> resource" into oc-dev 2017-05-17 22:52:25 +00:00
Adam Lesinski
6ff052a556 Merge "AAPT2: Update locale script filtering logic" into oc-dev am: 3cd6e0bee5
am: 9d6a0d73e6

Change-Id: I0275456778a39ebf3627f0aa848065e8fc9e0db2
2017-05-17 20:02:29 +00:00
Adam Lesinski
9d6a0d73e6 Merge "AAPT2: Update locale script filtering logic" into oc-dev
am: 3cd6e0bee5

Change-Id: Ie5377066de50d828f9f0a183c9dab4ee41f433eb
2017-05-17 19:28:43 +00:00
Adam Lesinski
13308bcdf6 AAPT2: Update locale script filtering logic
AAPT got an update to its locale script filtering logic that
dealt with enabling the removal of specific locales like
b+sr+Latn. Update AAPT2 to do the same.

Bug: 28055669
Bug: 29412034
Test: aapt2_tests
Change-Id: I3315c0814796cff05dfa1032d66d0306fe2b12bc
2017-05-16 15:28:36 -07:00
Adam Lesinski
d5fd76a2ff AAPT2: Respect format attr in <array> resource
Bug: 38152130
Test: make aapt2_tests
Change-Id: I84f352afb1a8fd2f329354f789aaa36c5ef88e47
2017-05-16 12:18:53 -07:00
Adam Lesinski
cc73e990e5 AAPT2: Ignore trailing data after IEND chunk in PNG
libpng seems to do the same, so our chunk filter should not care what
comes after.

Bug: 38169876
Test: manual
Change-Id: I020ddfe29ac3eb4d5ef9ace5611c6f6497de443d
2017-05-15 13:07:32 -07:00