749 Commits

Author SHA1 Message Date
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
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
The Android Automerger
1ec2fd72ce stephenli@ manually merge many commits up to '032dcff'
* commit '032dcff': (22 commits)
  Remove outdated google services links.
  Fix misc-macro-parentheses warnings in services jni.
  Fix misc-macro-parentheses warnings in hwui and graphic jni.
  Fix misc-macro-parentheses warnings in aapt and androidfw.
  docs: Update to column widths for Complications table
  Fix a11y crash when window layer isn't unique.
  Never set resized while not drag resizing for pinned stack.
  While turning OFF do not honor ON requests.
  Fix GATT autoConnect race condition
  Fix GATT autoConnect race condition
  Fix RTL issue in delete dialog.
  Incorporate feedback on new wallpaper-related APIs
  Mapping up/down of legacy Gps vs. Gnss Status
  Fixed a bug where the chronometer was invisible
  Fixed a bug where the chronometer wasn't updating the time
  Update BlockedNumberContract javadocs.
  [RenderScript] Fix ScriptIntrinsicBlur documentation.
  Update documentation about copyTo and copyFrom.
  DO NOT MERGE Cherry pick libpng usage fixes
  Start the Wear Time System Service with SystemServer
  ...
2016-05-19 23:51:32 +00:00
Adam Lesinski
d5bb8487d5 Merge "Fix misc-macro-parentheses warnings in aapt and androidfw." am: 6f4b566169
am: f55c9f7aa6

* commit 'f55c9f7aa64660712242705d4e5e89e2191bbf69':
  Fix misc-macro-parentheses warnings in aapt and androidfw.

Change-Id: I23f28430cf242be3f77926016626ea3e5705d4ec
2016-05-19 23:34:58 +00:00
Chih-Hung Hsieh
e819d01e3e Fix misc-macro-parentheses warnings in aapt and androidfw.
Bug: 28705665
Change-Id: Iac353e66718aadad384183cf300330695df25909
2016-05-19 15:19:22 -07:00
Michael Wright
0935d0132b Merge "Stop emitting javadoc for @removed attributes." into nyc-dev am: c4033e7c66 am: 1d10d94396
am: fab894efde

* commit 'fab894efdece38ec9f3df1adedf79eb148bc6bda':
  Stop emitting javadoc for @removed attributes.

Change-Id: Icbaa4eb19326d2ec41be78016665553a1b7beef0
2016-05-16 13:33:17 +00:00
Michael Wright
feaf99fa1b Stop emitting javadoc for @removed attributes.
We need the attributes to remain public because people might still be
linking against them, but we don't want them showing up in the
documentation any more. Them showing up in the documentation also had
the side effect that it would accidentally mark the parent class of
attributes as @removed, which was not intended.

Bug: 28663748

Change-Id: I2f6eb09455fddf1086e6b24bc3bea5292e8e32b7
2016-05-09 14:51:41 +01:00
Chih-Hung Hsieh
d53e3bed1c Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: I080090d50f1a368a4e7c1a0732297bb6a295e34f
2016-05-03 10:02:51 -07:00
Rohit Agrawal
682583c890 AAPT: ProGuard config for components in main dex.
Create an analogue of "aapt -G" which outputs a proguard configuration
that keeps only components which need to be in the main dex.

Bug: 27383099
Bug: 28425556

Change-Id: Ic18c8c563794ff27a5598a214111d1b446a005f1
(cherry picked from commit 86229cb622fccde8ab8cbe85eead91a34313a708)
2016-04-27 19:50:55 +00:00
Rohit Agrawal
6ba873faec AAPT: ProGuard config for components in main dex.
Create an analogue of "aapt -G" which outputs a proguard configuration
that keeps only components which need to be in the main dex.

BUG: 27383099

Change-Id: Ic18c8c563794ff27a5598a214111d1b446a005f1
(cherry picked from commit 86229cb622fccde8ab8cbe85eead91a34313a708)
2016-04-27 11:26:55 -07:00
Rohit Agrawal
86229cb622 AAPT: ProGuard config for components in main dex.
Create an analogue of "aapt -G" which outputs a proguard configuration
that keeps only components which need to be in the main dex.

BUG: 27383099

Change-Id: Ic18c8c563794ff27a5598a214111d1b446a005f1
2016-04-21 18:00:53 -07:00
Adam Lesinski
694d0a7dfd AAPT: Dump uses-feature version in dump badging
Bug:27162500
Change-Id: I4f82cdd8ef1801c92d4ea6b4bb982c6e7d91edb5
2016-04-06 16:40:23 -07:00
Wonsik Kim
6e452f9e8a Don't try to compress .mkv resources
Bug: 27987970
Change-Id: I58e920e81d1e79b7fbba479d8fb34afb3911f97d
2016-04-04 15:39:40 +09:00
Andrew Johnson
08a3fa7dea Merge "Removing assignments to localeScriptWasComputed in aapt." into nyc-dev 2016-03-31 13:52:10 +00:00
Andrew Johnson
299e488ee2 Removing assignments to localeScriptWasComputed in aapt.
On certain devices running Android M with unknown vendor
modifications. Setting the localeScriptWasComputed bit in
the resource parameters struct causes the translations
for many languages to fail to load. The app then
defaults to English.

This has been reported on the following devices:
Motorola XT1086, XT1096, and XT1586, HTC One, and Huawei
MediaPad 10 LINK.

This change works around the issue by never setting
localeScriptWasComputed in aapt and instead always
writing the default value of false.

Bug: 27872476
Change-Id: Id638d1d0e5f9dcb1c02e65d67667d76174c69b9e
2016-03-30 20:24:48 -04:00
Matt Sarett
d126b1ed5d Merge "Work-around paletted image decoding bug in SDK_JELLYBEAN" into nyc-dev 2016-03-21 18:26:19 +00:00
Matt Sarett
48efde4fb1 Work-around paletted image decoding bug in SDK_JELLYBEAN
Because there is a bug decoding paletted images in SDK_JELLYBEAN,
we need to avoid encoding paletted images for apps that support
SDK_JELLYBEAN and earlier.

BUG=27643907

Change-Id: Ib7d51ed87435cd36507915d62b0057c06f18b2b6
2016-03-16 18:36:06 -04:00
Roozbeh Pournader
7960898f6f Fix script-related parts of locale resource matching
Previously, a bit was kept to find if the script of a locale was
explicitly "provided" in a resource. This was not backward
compatible, and failed in some edge cases when the package was
created with older versions of AAPT that did not set the bit.

The cases would happen when the old resource had an explicit script
specified in its locale, but since the "provided" bit was not set in
the package, we would assume that the script was computed by us.

This CL replaces the "provided" bit with a "computed" bit, so the
default value of the bit (set to "false" for old packages) would be
correct.

Bug: 27156990
Change-Id: I99e7f1ad8f70c90e25ab3640ed34cc1a6f8d1d64
2016-03-03 15:19:37 -08:00
Adam Lesinski
afc79be228 AAPT: Allow duplicate attribute definitions if identical
This allows libraries to coexist a bit easier, since a lot of them
declare the same attribute. When used together they cause errors.
Bug:27101533

Change-Id: I649cf17bc587c4814f849d5ac522daf74495adcf
2016-02-26 15:57:59 -08:00
Adam Lesinski
525db2489d Revert "AAPT: Allow duplicate attribute definitions if identical"
This reverts commit c25283b5e206ceae2aa6eb01877b79c3c1f0adfb.

Change-Id: I2f42a4360fa53c4333494afe0178dcec56d62d8e
2016-02-25 23:13:08 +00:00
Adam Lesinski
c25283b5e2 AAPT: Allow duplicate attribute definitions if identical
This allows libraries to coexist a bit easier, since a lot of them
declare the same attribute. When used together they cause errors.
Bug:27101533

Change-Id: I10327251636392e810637a79e7c9aa514f3f07a6
2016-02-22 09:25:06 -08:00
Adam Lesinski
9e1923d02f AAPT: Remove warnings for public resources without comments
There are so many public resources that do not warrant comments
that having a warning that no one cares about is just producing
log spam.

Bug:21495023
Change-Id: I84e3b39c7139ee67fb5cb711d5ab466d8f4ef2e0
2016-02-11 14:17:25 -08:00
Matt Sarett
37a866e9a6 Merge "Encode paletted PNGs more efficiently (part 2)" 2016-02-01 15:22:42 +00:00
Matt Sarett
33fcd11bc2 Encode paletted PNGs more efficiently (part 2)
Many PNGs have multiple distinct pixels with zero alpha.  This
CL allows us to treat all of those pixels as a single zero pixel.

This saves space in the color palette and also may help save
memory pages when we skip writing zeros.

There is also a potential disadvantage: if someone intended to decode
this image as unpremultiplied with particular transfer modes where
their color components have an effect even though alpha is zero,
this will prevent that.  At the moment, we do not support unpremul as
a source, so this won't affect anyone trying to draw with the view
system.

This change originated in:
https://googleplex-android-review.git.corp.google.com/#/c/854580/

Change-Id: I702c7bd22d431cc7c775ed29bbd73c930f945ca3
2016-02-01 14:15:35 +00:00
Matt Sarett
2a84e23399 Encode paletted PNGs more efficiently
Saves about 2 MB of encoded size across affected assets.

Also will enable more efficient decoding.

Specifically, encoded palette values are assumed to be opaque unless
alpha values are provided in a tRNS chunk.  Before this change, we
would wastefully store many opaque alpha values in tRNS chunk.
Additionally, the decoder used to need to premultiply all of these
opaque colors, because the encoded data indicated that they had alpha.

Change-Id: Id21b3b31850c9db6149ced6d20ed5e0ce2d71c5b
2016-02-01 09:03:34 -05:00
Matt Sarett
3c7235d386 Encode paletted PNGs more efficiently
Saves about 2 MB of encoded size across affected assets.

Also will enable more efficient decoding.

Specifically, encoded palette values are assumed to be opaque unless
alpha values are provided in a tRNS chunk.  Before this change, we
would wastefully store many opaque alpha values in tRNS chunk.
Additionally, the decoder used to need to premultiply all of these
opaque colors, because the encoded data indicated that they had alpha.

Change-Id: I1d5400f71a0e3cb800fd0fc68a04c8c4069da8ef
2016-01-29 22:56:45 +00:00
Roozbeh Pournader
b927c559e1 Implement smarter locale resource selection
* Add support for determining script from language and region.
* Add support for determining special parents of locales.
* Add support for smart comparison of locales with only a difference
  in region, using the locale parentage tree.
* Fix LocaleData.matchScore() to not fallback to old locale matching
  behavior if we can't determine a script.
* Allow four-character variant codes. (Previously, only five- to
  eight-character variant codes were allowed.)

Bug: 7296673
Bug: 26589793
Change-Id: Ibde0a48c0564ff383b41068095a5cbacfe7b94bc
2016-01-21 13:47:22 -08:00
Dan Albert
46736ec81c Merge "Make the appropriate cast to protect from mingw." am: dbf8c17bd2
am: 2edfa8c9b0

* commit '2edfa8c9b00cd0c0bd18738f75e0928394b99c76':
  Make the appropriate cast to protect from mingw.
2016-01-16 02:25:22 +00:00
Dan Albert
2edfa8c9b0 Merge "Make the appropriate cast to protect from mingw."
am: dbf8c17bd2

* commit 'dbf8c17bd20c3c5b4ba99242afa8b714841914d1':
  Make the appropriate cast to protect from mingw.
2016-01-15 21:02:29 +00:00
Dan Albert
ed811eeaea Make the appropriate cast to protect from mingw.
As the comment at the top of the file says:

    STATUST: mingw does seem to redefine UNKNOWN_ERROR from our enum
    value, so a cast is necessary.

Bug: http://b/26523949
Change-Id: I9d86cafdc47bbb9ce0e967cdde9315babc083432
2016-01-15 12:16:06 -08:00
Matt Sarett
3b1b68d6c7 Allow ninepatches to be encoded using non-RGBA modes
The original intention for forcing ninepatches to be encoded as
RGBA (with alpha) was to avoid the possibility of the decoder
producing 565 output.

565 output is bad for ninepatches because dithering tiny images
that we intend to scale later leads to bad results.  I would
argue that, since the new BitmapFactory does not dither, we might
now be ok to allow 565 decodes for ninepatches.  However, we
will maintain the old behavior by disabling 565 decodes for
ninepatch.

There are two changes to PNG encodings:
(1) Allows ninepatch images to be encoded in any mode.  Forcing
    them to RGBA makes things awkward for the decoder.  Currently,
    BitmapFactory's png decoder checks every pixel for alpha.
    That way, RGBA images that are actually opaque can be marked
    as opaque, in order to optimize drawing.  We want to remove
    this complexity from the decoder.
(2) Make sure ninepatch chunks are stored in the png header.  That
    way we know immediately that the png is a ninepatch, and can
    refuse to decode to 565 (if we feel this is best).

Change-Id: I724f5dbefb1be7b412f9b362dff83cbc0603f0bf
2016-01-07 18:17:33 +00:00
Adam Lesinski
087e0fcba6 DO NOT MERGE: AAPT: Dump uses-permission-sdk-23 am: b2c5155638 am: 40d1ab91d2 am: 8c9209183f am: 7f5ad22330
am: 1f7a36b8e6

* commit '1f7a36b8e6aa55dcb22a63c250fb318260ac349f':
  DO NOT MERGE: AAPT: Dump uses-permission-sdk-23
2015-12-16 23:44:25 +00:00
Adam Lesinski
b2c5155638 DO NOT MERGE: AAPT: Dump uses-permission-sdk-23
Include <uses-permission-sdk-23> permissions in dump badging and dump permissions.

This will also add implied features for that permission, marked as -sdk-23 features.

Ex:

uses-permission: name='android.permission.ACCESS_FINE_LOCATION'
uses-permission-sdk-23: name='android.permission.CAMERA'

feature-group: label=''
  uses-feature: name='android.hardware.location'
  uses-implied-feature: name='android.hardware.location' reason='...'
  uses-feature-sdk-23: name='android.hardware.camera'
  uses-implied-feature-sdk-23: name='android.hardware.camera' reason='...'

Bug:24939655
Change-Id: Ifb374696ed4760b0ba2f1cc3516f3bf08e6cb6a3
(cherry picked from commit 5f3b2ecb3e9d27e77bd59c7b9006a6239b773944)
2015-12-16 22:43:07 +00:00
Adam Lesinski
5f3b2ecb3e AAPT: Dump uses-permission-sdk-23
Include <uses-permission-sdk-23> permissions in dump badging and dump permissions.

This will also add implied features for that permission, marked as -sdk-23 features.

Ex:

uses-permission: name='android.permission.ACCESS_FINE_LOCATION'
uses-permission-sdk-23: name='android.permission.CAMERA'

feature-group: label=''
  uses-feature: name='android.hardware.location'
  uses-implied-feature: name='android.hardware.location' reason='...'
  uses-feature-sdk-23: name='android.hardware.camera'
  uses-implied-feature-sdk-23: name='android.hardware.camera' reason='...'

Bug:24939655
Change-Id: Ifb374696ed4760b0ba2f1cc3516f3bf08e6cb6a3
2015-12-10 14:17:52 -08:00
Adam Lesinski
78713998f9 Specify private resource package in Android.mk
Private resource package shouldn't be buried in some resource file.
It can now be specified on the command line via the Android.mk file.

Change-Id: I9e3cb0bf54830d6b021077af271913306c024701
2015-12-07 14:52:53 -08:00
Elliott Hughes
43aecc85e8 Merge "Track rename from base/ to android-base/." am: 9f6a2ae67c am: 8aa8fe2c64
am: 7e7047ea0a

* commit '7e7047ea0aba2099408fba70937a758a91cebbca':
  Track rename from base/ to android-base/.
2015-12-04 17:51:41 -08:00
Elliott Hughes
be5474da4b Track rename from base/ to android-base/.
Change-Id: I31be831de812052d1c0d4c0781178d0756124bcf
2015-12-04 15:33:35 -08:00
Marco Nelissen
90d5052bd7 Don't try to compress .webm resources
Bug: 25822610
Change-Id: I40a93c9daac258a8e9a41668c0040353e44ed5bb
2015-12-01 18:37:12 +00:00
Adam Lesinski
07dfd2d864 Implement AAPT Bundle format
AAPT will scan XML files looking for the <aapt:attr> XML tag.

<!-- @layout/bundle.xml -->
<ImageView xmlns:aapt="http://schemas.android.com/aapt">
  <aapt:attr name="android:src">
    <vector android:pathData="..." ...>
    </vector>
  </aapt:attr>
</ImageView>

The SINGLE child element of the <aapt:attr> tag is extracted into its own top
level resource. It is given a generated name.

The parent element of <aapt:attr> is then given the resource attribute that was assigned
to the `name' attribute. The value is set to a reference to the generated resource.

<!-- @layout/bundle.xml -->
<ImageView android:src="@drawable/bundle_1.xml">
</ImageView>

<!-- @layout/bundle_1.xml -->
<vector android:pathData="..." ...>
</vector>

Bug:22627686
Change-Id: I8575fc4f739011402662fbf6b3db96df0012f598
2015-11-30 14:43:43 -08:00
Adam Lesinski
5b9847ca3f Revert "Implement AAPT Bundle format"
This reverts commit 9d0f7d44d5cc5322415f52f7ce03cc37a478b350.

Caused a build breakage when parsing some attributes.

Change-Id: I89ca958b2f2e820d353648df8aadd90bbe8d8339
2015-11-30 21:07:44 +00:00
Adam Lesinski
9d0f7d44d5 Implement AAPT Bundle format
AAPT will scan XML files looking for the <aapt:attr> XML tag.

<!-- @layout/bundle.xml -->
<ImageView xmlns:aapt="http://schemas.android.com/aapt">
  <aapt:attr name="android:src">
    <vector android:pathData="..." ...>
    </vector>
  </aapt:attr>
</ImageView>

The SINGLE child element of the <aapt:attr> tag is extracted into its own top
level resource. It is given a generated name.

The parent element of <aapt:attr> is then given the resource attribute that was assigned
to the `name' attribute. The value is set to a reference to the generated resource.

<!-- @layout/bundle.xml -->
<ImageView android:src="@drawable/bundle_1.xml">
</ImageView>

<!-- @layout/bundle_1.xml -->
<vector android:pathData="..." ...>
</vector>

Bug:22627686
Change-Id: I31bc96aae30d38bfd0b16508d0f585de5fd88a07
2015-11-24 15:38:40 -08:00
Tor Norbye
b3559643b9 Don't set modification times in aapt zip entries
Use a modification timestamp of 0 for all files
inside the zip archive to make the build repeatable.

Change-Id: Ie6e57329469b99c6f93cb0a6083e0c402be99815
2015-10-30 20:00:13 -07:00
Adam Lesinski
09ffc62fdb Merge "AAPT: Don't try to rewrite String constants when loading shared lib" 2015-09-11 01:48:05 +00:00
Adam Lesinski
eed585821a AAPT: Don't try to rewrite String constants when loading shared lib
Bug:20138255
Change-Id: Ieb6a31ee9afe0de3d1c99b21f78aa48fe07015c6
2015-09-10 18:43:34 -07:00
Tao Bai
ab5bca1519 Merge "Load app resource as shared library." 2015-09-09 16:08:12 +00:00
Tao Bai
a6d7e3fb9c Load app resource as shared library.
- Added aapt command line flag --app-as-shared-lib to build app resources
  that could be loaded as shared lib at runtime.
- Added new method AssetManager.addAssetPathAsSharedLibrary() to load an
  app resource as shared library.

Bug 22487604

Change-Id: Ib9b33c35f9c2b7129f3ba205de03d4564623ea39
2015-09-08 18:48:42 -07:00
Dan Willemsen
13786e281e am 60dd5d59: Merge "Remove USE_MINGW, whitelist windows modules"
* commit '60dd5d5966ebe993f5a81c46d9dea62c207abfd3':
  Remove USE_MINGW, whitelist windows modules
2015-09-01 16:37:10 +00:00
Dan Willemsen
4aa679ff96 Remove USE_MINGW, whitelist windows modules
Bug: 23566667
Change-Id: Ie6b8c51e2b6d6273f99f4e361c440136d7c6915c
2015-08-28 15:28:26 -07:00
Elliott Hughes
84d4917c75 am 12cf0f9c: am eba23aaa: Merge "Replace HAVE_MS_C_RUNTIME with _WIN32 in frameworks/base/tools."
* commit '12cf0f9c4cf8e6aed738da7349f556bd716ec09e':
  Replace HAVE_MS_C_RUNTIME with _WIN32 in frameworks/base/tools.
2015-08-17 21:15:40 +00:00