Commit Graph

4674 Commits

Author SHA1 Message Date
Adam Lesinski
71965e898e AAPT2: Fix fully qualified java class verification
Proguard rules would be ignored for components defined
in AndroidManifest.xml for android:name attributes if
they didn't start with '.'.

Change-Id: I029b5a2f224f4daf155b73a2a4dcd940dd43372e
2016-07-07 17:17:55 -07:00
TreeHugger Robot
45d8f8e463 Merge "AAPT2: Encode empty attribute string values" 2016-07-01 23:33:29 +00:00
Adam Lesinski
e1fda9aec4 AAPT2: Encode empty attribute string values
Due to another bug, empty strings in XML files
were encoded as NULLs. This was only needed for
encoding missing namespace URIs. Attribute
values should remain empty strings.

Bug:29939875
Bug:29462255
Change-Id: I3897661d85865c88bb2b7cf1495da16c30f7272e
2016-07-01 14:51:51 -07:00
Robert Carr
8942204d93 Merge changes I38cff63b,Id3739bbc,If052cd8c into nyc-mr1-dev am: 30efa24b11
am: 0dbe6db014

Change-Id: I3f0fd113bf9dc063f3bc60301f9a7ddf7d16581d
2016-07-01 19:41:33 +00:00
Robert Carr
0dbe6db014 Merge changes I38cff63b,Id3739bbc,If052cd8c into nyc-mr1-dev
am: 30efa24b11

Change-Id: I9ed6ae1f45221ff702162a1608bb8db7059058f5
2016-07-01 19:38:49 +00:00
Robert Carr
fd10cd1989 Force CROSSFADE rotation when launching from double tap gesture.
When activity transition triggers a rotation change, the starting
window will normally be the top window at the time we try
to select the window animation. However, these layout params won't
have the apps rotation animation set (as the client code will set that
on the real window, not the starting window). Eventually we would
like to add API to specify rotation animation via manifest to solve
this problem cleanly. In the mean time, we can force a specific rotation
animation from the double tap gesture, and clean up some camera
ugliness. We accomplish this by attaching an animation hint to
ActivityOptions.

Bug: 28838855
Change-Id: If052cd8cbae76651da43f3b4c590cd9dcc1afc0f
2016-07-01 11:05:40 -07:00
Diego Perez
f63ff008d5 Merge "Remove inspection_tool from inspectionProfiles" 2016-06-30 19:55:57 +00:00
Diego Perez
7d53410710 Merge "Updating unit tests so they match the expected output" 2016-06-30 19:55:40 +00:00
Adam Lesinski
5e8fa3a248 AAPT2: Improve diff command
Change-Id: Ia1e2f8482c7192ef50126b61bed7975297332767
2016-06-29 21:56:58 -07:00
Adam Lesinski
fb6312fe93 AAPT2: Add version collapsing
When an app specifies (or imports) resources with various
configurations for different SDK versions, specifying
a minSdk will make many of those resources unreachable.

Version collapsing will prune out the resources specified
for SDK versions less than the minSdk.

If, however, there is no exact matching resource for the
minSdk version, the next smallest SDK version is kept.

Change-Id: Ic7bcab6c59d65c97c67c8767358abb57cdec60a4
2016-06-29 17:02:19 -07:00
Jerome Gaillard
c796a98a60 Use a HashSet to store delegate references in layoutlib
More efficient than an ArrayList since we do a lot of remove operations.

Change-Id: Ic4c89df4560066f1a3ab0e71a3b180a9734f9cd6
(cherry picked from commit 12754d621b20e6a925999096ab6f21c4cbfe594a)
2016-06-29 14:57:15 +00:00
Diego Perez
3c4aed26e6 Remove inspection_tool from inspectionProfiles
Change-Id: I8aae3c2d6d46340fa3b4b27c9f217a7f1266d37d
(cherry picked from commit c5c7beca5292bfa248340059401f05e9d687bb2e)
2016-06-27 18:31:31 +00:00
Diego Perez
245e1be94b Updating unit tests so they match the expected output
Change-Id: Id9af601c00fc87f861adeed9f5aa99a3dc55b17e
(cherry picked from commit 768e4c952f335a825cd45b102556d5948ed09d0c)
2016-06-27 18:31:07 +00:00
Roozbeh Pournader
60b64a19f6 Merge "Remove LocaleValue::toDirName() from AAPT2" 2016-06-27 18:18:37 +00:00
Diego Perez
a540344b0a Merge "Avoid calling deepCopyNodes on null array" 2016-06-27 16:10:36 +00:00
Diego Perez
581fa36a13 Merge "Add support for AppCompat widgets" 2016-06-27 15:02:39 +00:00
Diego Perez
52053c9354 Merge "Add warning when RTL is used but not supported/enabled" 2016-06-27 10:40:56 +00:00
Diego Perez
d508639a58 Merge "Update layoutlib following platform change in VectorDrawable" 2016-06-27 10:40:32 +00:00
Diego Perez
e174f1431c Merge "Add tools attributes to set extreme values for NumberPicker" 2016-06-27 10:40:20 +00:00
Diego Perez
95842c887b Merge "Fix NPE when using "view" tag without class attribute" 2016-06-27 10:40:08 +00:00
Diego Perez
2292214a6a Merge "Always calculate default property values" 2016-06-27 10:39:56 +00:00
Diego Perez
721ca186f1 Merge "Fix Path_Delegate reset" 2016-06-27 10:39:41 +00:00
Roozbeh Pournader
112373006f Remove LocaleValue::toDirName() from AAPT2
There was no user, and the code was incorrect too.

Bug: 25599046
Change-Id: I50d14f58995ac611385a6fb17661a357bf473687
2016-06-24 17:01:07 -07:00
Adam Lesinski
96d1db9416 Merge "AAPT2: accept argument file list for -R" 2016-06-24 22:02:41 +00:00
Adam Lesinski
1e21ff00b0 AAPT2: accept argument file list for -R
Bug:29462255
Change-Id: Ia83919a3e7de7fe2056a3f7613621972cccd49cb
2016-06-24 14:57:58 -07:00
Diego Perez
0cf6c930b2 Merge "Do not set default encoding to UTF-8 in KXmlParser" 2016-06-24 16:46:32 +00:00
Adam Lesinski
1f6cab321e Merge "AAPT2: Allow <meta-data> in <application> tag" 2016-06-23 22:13:20 +00:00
TreeHugger Robot
6c05d724da Merge "Fix pseudolocalizer at end of string" 2016-06-23 21:54:12 +00:00
Adam Lesinski
5d84ad5487 AAPT2: Allow <meta-data> in <application> tag
Change-Id: Ica3e7d5c1ce587eba58d8171e0f8d5cdb598e7b3
2016-06-23 13:18:16 -07:00
Adam Lesinski
b2106687e1 Fix pseudolocalizer at end of string
The accent pseudolocalizer would incorrectly process
the byte after the end of the string, which would end
up inserting null characters into the resulting
output.

Change-Id: I5cdabd6b0272d94073f06e180b8cbe7abafa3888
2016-06-23 13:03:15 -07:00
Yohei Yukawa
bf055ba658 Merge \\"Add InputMethodService#exposeContent()\\" into nyc-mr1-dev am: dc42d7dd13
am: d02470f5a8

Change-Id: Id551d53ae3d7c34157ddf166aa44bdef67d46853
2016-06-23 01:37:10 +00:00
Yohei Yukawa
d02470f5a8 Merge \"Add InputMethodService#exposeContent()\" into nyc-mr1-dev
am: dc42d7dd13

Change-Id: Icf3ca0403c7dee26a3083ca98ca1239887d471bc
2016-06-23 01:29:58 +00:00
Yohei Yukawa
dc42d7dd13 Merge "Add InputMethodService#exposeContent()" into nyc-mr1-dev 2016-06-23 01:25:39 +00:00
Yohei Yukawa
25e0813e6e Add InputMethodService#exposeContent()
This is a follow up CL to my previous CLs [1][2] that introduced
InputConnection#commitContent(InputContentInfo, Bundle) API to enable
IMEs to send a content to the target application.

With this CL, IME developers are able to temporarily expose
InputContentInfo object to the target package without permanently
granting URI permission.  Although calling IMS#exposeContent() is
allowed only for the IME that is currently selected, the client is able
to request a temporary read-only access even after the current IME is
switched to any other IME as long as the client keeps InputContentInfo
object.

Here is a sample code snippet about how to use this mechanism.

  [IME]
  InputContentInfo contentInfo = new InputContentInfo(
          contentUri,
          new ClipDescription(description, new String[]{mimeType}),
          linkUrl);
  exposeContent(contentInfo, getCurrentInputEditorInfo());
  getCurrentInputConnection().commitContent(inputContentInfo, null);

  [App]
  try {
      contentInfo.requestPermission();
      // Load inputContentInfo.getContentUri() here.
  } finally {
      contentInfo.releasePermission();
  }

 [1]: Iaadf934a997ffcd6000a516cc3c1873db56e60ad
      152944f490
 [2]: Ica1ba3154795c1bf44e140dfe639b299f83cd8af
      adebb52588

Bug: 29450031
Change-Id: I2772889ca01f2ecb2cdeed4e04a9319bdf7bc5a6
2016-06-22 16:31:41 -07:00
Adam Lesinski
d06b1695e0 Merge \\\"Fix build due to missing abstract method impl\\\" into nyc-dev am: aeef7c4748 am: e0dc709ac8
am: c8aa7f98c1

Change-Id: Id3b9a1e0797f26d34415938dee0a032541be2a6c
2016-06-22 22:54:06 +00:00
Adam Lesinski
c8aa7f98c1 Merge \\"Fix build due to missing abstract method impl\\" into nyc-dev am: aeef7c4748
am: e0dc709ac8

Change-Id: I2360c6d049352c4e32f33096d3f659d636941417
2016-06-22 22:47:39 +00:00
Adam Lesinski
e0dc709ac8 Merge \"Fix build due to missing abstract method impl\" into nyc-dev
am: aeef7c4748

Change-Id: I38fc7c88e9c4ea5abf50a0bec5f2302c4622605f
2016-06-22 22:41:38 +00:00
Roozbeh Pournader
f69d5146bd Merge \\"Don\\'t match locales with different scripts in ResourceFilter\\" into nyc-mr1-dev am: 9d2a3188fa
am: 8a24cfb055

Change-Id: I0c3e03c508680edd7db133b5cc93dbab1383b960
2016-06-22 21:36:56 +00:00
Roozbeh Pournader
8a24cfb055 Merge \"Don\'t match locales with different scripts in ResourceFilter\" into nyc-mr1-dev
am: 9d2a3188fa

Change-Id: I9874c4a5d880407ed7b38e63f2c551defedbf8e5
2016-06-22 21:26:29 +00:00
Adam Lesinski
0f5caab576 Fix build due to missing abstract method impl
getDisplay() was added to Context, which needs to be implemented
for BridgeContext.

Bug:28388969
Change-Id: I7b0ffcbbe252403e35f08d3fa40d6b0e4dbf0daa
2016-06-22 13:11:40 -07:00
Jerome Gaillard
b4e074b159 JUnit-4.11 does not accept static rules
Change-Id: I9a2b986c2a88731d67919449a3ca69d2e73879d1
(cherry picked from commit 588d93eb54e48daabed31f98b100824f1355d8ec)
2016-06-22 11:28:55 +00:00
Diego Perez
35d07d99e0 Merge "Use a mock file to make testGetResourceNameVariants work in jar files" 2016-06-22 11:25:17 +00:00
Diego Perez
53aac79f96 Merge "Incorporate alpha attribute when painting VectorDrawable" 2016-06-22 11:23:19 +00:00
Roozbeh Pournader
3f32c27ccf Don't match locales with different scripts in ResourceFilter
Previously, AAPT would match locales even if they had different
explicit scripts if the requested locale was just a languages. Now
we require explicit listing of the languages with different explicit
scripts in order for the locale to be included.

Bug: 29412034
Change-Id: Ia118a5a7f9aec49f6c3c53b9195a0ae1a57f53fd
2016-06-21 15:03:51 -07:00
Diego Perez
cde8bb13b5 Add warning when RTL is used but not supported/enabled
Change-Id: Ic01a3b276ff0ecf87ee34e164e494698ec37c1f4
2016-06-21 14:55:14 +00:00
Diego Perez
1fa7f02085 Use a mock file to make testGetResourceNameVariants work in jar files
Change-Id: Ic77f8bb2cef3dabeddd3ba530b0eda23e70c9017
(cherry picked from commit 616433e8ba0119b8ce79f76f41e8489030aea2a0)
2016-06-21 14:49:28 +00:00
Diego Perez
db8601fa6a Avoid calling deepCopyNodes on null array
Bug: http://b.android.com/212694
Change-Id: Ib7e0f62352c1ef6106e62667c9369a9bc69b62cd
(cherry picked from commit 0b4ffd3e9ac1698ed9dfa080515d517b6d971868)
2016-06-21 14:49:06 +00:00
Jerome Gaillard
cf2000020e Update layoutlib following platform change in VectorDrawable
Commit 028029730b copies tree properties when mutating a vector
drawable. Layoutlib does the same.

Bug: 28974071
Change-Id: I5075b35e517df4ce32a91e2926d9caa02a0c2606
(cherry picked from commit 5ee73b3466090828acdc87fffd95247b6ace6440)
2016-06-21 14:49:00 +00:00
Jerome Gaillard
1d8b0bb6cc Add tools attributes to set extreme values for NumberPicker
tools:minValue and tools:maxValue can now be used to specify
the min and max values of a NumberPicker in the layout editor.

Bug: http://b.android.com/205084
Change-Id: I10037726346c82ca3cf84d255727b84a12ac0349
(cherry picked from commit 3c2b1c65c907fa4f2cae102507688fd0bffd1b24)
2016-06-21 14:48:54 +00:00
Diego Perez
e852d199d2 Fix NPE when using "view" tag without class attribute
Bug: http://b.android.com/209830
Change-Id: I0c2a10501ae82588623bfba049155f4956f9907f
(cherry picked from commit 9ab38b560cc781536c1d0863cfa7fa8f7ec74cae)
2016-06-21 14:48:46 +00:00