574 Commits

Author SHA1 Message Date
Elliott Hughes
4b0ee78bfa resolved conflicts for merge of 56ca8219 to master
Change-Id: I62f5804a5c4404eedce09188cda2e3b1bb990b36
2014-04-18 16:07:41 -07:00
Elliott Hughes
56ca821912 resolved conflicts for merge of ec42199a to klp-modular-dev-plus-aosp
Change-Id: I9ecd5d51be4d073ab93dbb0bd60097735e76bf94
2014-04-18 15:56:46 -07:00
Anton Krumin
a2ef5c0d4f Pseudolocalizer improvements.
Fixes accented pseudolocalization and adds RTL pseudolocale.

This change contains following modifications in the pseudolocalization logic:
1) zz_ZZ pseudolocale was removed;
2) en_XA pseudolocale was added for pseudo-accented;
3) ar_XB pseudolocale was added for pseudo-rtl;
4) Pseudo RTL localization functionality was implemented;
5) Text expansion functionality was implemented;
6) Text bracketing was implemented;
7) Couple of issues of previous implementation were fixed.

Change-Id: I9f7f27bed717e39e82717d15c398decffc8bec3c
Signed-off-by: Anton Krumin <antkrumin@google.com>
2014-04-09 16:59:48 -07:00
John Spurlock
0a0454fdcc am 642421aa: am 5c31e487: Merge "Introduce new UI_MODE_TYPE_WATCH and qualifier." into klp-modular-dev
* commit '642421aa7f284817cc1a972a7f9c7a64696a0116':
  Introduce new UI_MODE_TYPE_WATCH and qualifier.
2014-04-04 19:34:11 +00:00
John Spurlock
642421aa7f am 5c31e487: Merge "Introduce new UI_MODE_TYPE_WATCH and qualifier." into klp-modular-dev
* commit '5c31e487c4577e1c47ee7c949325d6a13f0d462e':
  Introduce new UI_MODE_TYPE_WATCH and qualifier.
2014-04-04 19:28:09 +00:00
John Spurlock
6c191299a7 Introduce new UI_MODE_TYPE_WATCH and qualifier.
Default ui mode to watch if we have FEATURE_WATCH.

Bug:13395758
Change-Id: Ie5ff95de60e69e91ad3612c7d2f1fca7f49061bd
2014-04-04 15:21:53 -04:00
Adam Lesinski
587e420ea9 am 004ceaaa: am 55a65509: Merge "Reduce warning verbosity in aapt"
* commit '004ceaaa4d3ddfc66ba3f3635e987c2ddc7f2d09':
  Reduce warning verbosity in aapt
2014-03-27 21:05:06 +00:00
Adam Lesinski
de898ff429 Shared library resource support
Shared libraries can now export resources for applications
to use.

Exporting resources works the same way the framework exports
resources, by defining the public symbols in res/values/public.xml.

Building a shared library requires aapt to be invoked with the
--shared-lib option. Shared libraries will be assigned a package
ID of 0x00 at build-time. At runtime, all loaded shared libraries
will be assigned a new package ID.

Currently, shared libraries should not import other shared libraries,
as those dependencies will not be loaded at runtime.

At runtime, reflection is used to update the package ID of resource
symbols in the shared library's R class file. The package name of
the R class file is assumed to be the same as the shared library's
package name declared in its manifest. This will be customizable in
a future commit.

See /tests/SharedLibrary/ for examples of a shared library and its
client.

Bug:12724178
Change-Id: I60c0cb8ab87849f8f8a1a13431562fe8603020a7
2014-03-25 12:09:56 -07:00
Adam Lesinski
e119b22146 Reduce warning verbosity in aapt
- Attributed source of problems to the correct file.
- Only verify string localizations against valid
  locales.
Bug:13140015
Change-Id: I9dabc5efa0510649caee8af0c8ebb803d6f48269
2014-03-24 10:50:34 -07:00
Adam Lesinski
a01a9374fd Reduce warning verbosity in aapt
- Attributed source of problems to the correct file.
- Only verify string localizations against valid
  locales.
Bug:13140015
Change-Id: I9dabc5efa0510649caee8af0c8ebb803d6f48269
2014-03-20 18:14:48 -07:00
Narayan Kamath
b5c4e7fd38 resolved conflicts for merge of 92860a74 to master
Change-Id: I3036ef9f1251c756092dc5ee2c4fed8146855e1e
2014-03-10 10:57:05 +00:00
Narayan Kamath
8272c84cb5 am bbf82665: am 6e2fb587: Merge "LP64: Make 9 patches architecture agnostic."
* commit 'bbf826659e8e5d0be683b2459207c495303d53b6':
  LP64: Make 9 patches architecture agnostic.
2014-03-10 10:47:45 +00:00
Narayan Kamath
6381dd4ff2 LP64: Make 9 patches architecture agnostic.
The Res_png_9patch struct had several pointer members
whose size differed between 32 and 64 bit platforms.

These members have been replaced by uint32_t offsets
to serialized data. The serialized form for 9patches
places a Res_png_9patch object at the beginning of
serialized data, followed by int32_t arrays of xDivs,
yDivs and colors.

Note that these offsets are not strictly required,
since they can be computed from the values of numXDivs,
numYDivs & numColors, however they are called in tight
loops so having them computed once is a beneficial.

This change also removed the unused patch_equals function
from aapt's Image.cpp.

Change-Id: I3b9ac8ae5c05510d41377cae4dff1c69b40c2531
2014-03-10 10:00:02 +00:00
Tim Kilbourn
9eaaaf0fe3 resolved conflicts for merge of a81ee86b to master
Change-Id: I7be3a64261d2405eda55b43c02b47657f393c095
2014-03-07 23:04:03 -08:00
Ying Wang
0323098269 am 71364f8c: am f5f4d930: am 74bebf6f: Exclude the host aapt and aidl from PDK build.
* commit '71364f8c1e1bcc84375830dd5904dfe7cdfb5ed6':
  Exclude the host aapt and aidl from PDK build.
2014-03-08 05:46:48 +00:00
Tim Kilbourn
032305fbcf am b559b371: Merge "Dump leanback info in aapt dump badging." into klp-modular-dev
* commit 'b559b37150d24411f0b5ef102ced8d5acf858a0e':
  Dump leanback info in aapt dump badging.
2014-03-08 01:55:00 +00:00
Ying Wang
f5f4d93060 am 74bebf6f: Exclude the host aapt and aidl from PDK build.
* commit '74bebf6faed2d34814ffc3d46664330ea568f7b2':
  Exclude the host aapt and aidl from PDK build.
2014-03-08 01:54:52 +00:00
Tim Kilbourn
b559b37150 Merge "Dump leanback info in aapt dump badging." into klp-modular-dev 2014-03-08 00:55:48 +00:00
Tim Kilbourn
0a5a5d6996 Dump leanback info in aapt dump badging.
Leanback launcher activities are reported, including the banner.

Change-Id: Ifa496736ad3ba4239ec95e166768af895ff4dc53
2014-03-07 16:47:42 -08:00
Ying Wang
74bebf6fae Exclude the host aapt and aidl from PDK build.
Bug: 13028632
Change-Id: I0f774b19be77462d0fa271088a4a5a152729d13c
2014-03-07 15:56:14 -08:00
Jeff Davidson
df08d1c24d Add --replace-version flag to aapt.
Motivation: we'd like to programmatically specify the version
name/code (i.e. to include the build number from the build server).
However, this means that we cannot specify version info in the
AndroidManifest.xml file, as this takes precedence. Not doing so makes
IDE use more difficult, as the IDE gets version code 0 and won't
install over an existing non-IDE version unless you first force a
downgrade to an IDE build from the command line.

This flag allows us to specify a very high version code in the
AndroidManifest.xml file, making IDE builds take precedence, while
still allowing us to override this info when performing command-line
(official) builds.

Change-Id: I5d01048698af5c26bdf19066c6cd4eca1115112a
2014-02-25 13:42:12 -08:00
Narayan Kamath
8c1fc83445 am 28879bbf: am be57fca4: Merge "Extended locales in AAPT / AssetManager."
* commit '28879bbfe89dc4bf2067a7183975ecffb82f68e6':
  Extended locales in AAPT / AssetManager.
2014-02-17 11:06:38 +00:00
Narayan Kamath
788fa41482 Extended locales in AAPT / AssetManager.
Support 3 letter language codes, script codes &
variants. The bulk of the changes are related to
the implementation of command line filtering of
locales etc. The previous code assumed that the
value of each "axis" (locale, density, size etc.)
could be represented by a 4 byte type. This is
no longer the case.

This change introduces a new class, AaptLocaleValue
which holds a (normalized) locale parsed from a
directory name or a filter string. This class takes
responsibility for parsing locales as well as
writing them to ResTable_config structures, which is
their representation in the resource table.

This includes minor changes at the java / JNI level
for AssetManager. We now call locale.toLanguageTag()
to give the native layer a well formed BCP-47 tag.
I've removed some duplicated parsing code in
AssetManager.cpp and replaced them with functions on
ResTable_config. The native getLocales function has
been changed to return well formed BCP-47 locales as
well, so that the corresponding java function can use
Locale.forLanguageTag to construct a Locale object
out of it.

Finally, this change introduces default and copy
constructors for ResTable_config to prevent having
to memset() the associated memory to 0 on every
stack allocation.

(cherry-picked from commit 91447d88f2bdf9c2bf8d1a53570efef6172fba74)

Change-Id: I1b43086860661012f949fb8e5deb7df44519b854
2014-02-14 14:08:57 +00:00
Narayan Kamath
91447d88f2 Extended locales in AAPT / AssetManager.
Support 3 letter language codes, script codes &
variants. The bulk of the changes are related to
the implementation of command line filtering of
locales etc. The previous code assumed that the
value of each "axis" (locale, density, size etc.)
could be represented by a 4 byte type. This is
no longer the case.

This change introduces a new class, AaptLocaleValue
which holds a (normalized) locale parsed from a
directory name or a filter string. This class takes
responsibility for parsing locales as well as
writing them to ResTable_config structures, which is
their representation in the resource table.

This includes minor changes at the java / JNI level
for AssetManager. We now call locale.toLanguageTag()
to give the native layer a well formed BCP-47 tag.
I've removed some duplicated parsing code in
AssetManager.cpp and replaced them with functions on
ResTable_config. The native getLocales function has
been changed to return well formed BCP-47 locales as
well, so that the corresponding java function can use
Locale.forLanguageTag to construct a Locale object
out of it.

Finally, this change introduces default and copy
constructors for ResTable_config to prevent having
to memset() the associated memory to 0 on every
stack allocation.

Change-Id: I899a56a9a182ee6be52b9389d1ae59266f5482e9
2014-02-10 15:50:16 +00:00
Adam Lesinski
94c40a4cf9 resolved conflicts for merge of 1b5b60d6 to master
Change-Id: I2b713a55fcdf02c01afa99f175bf14248f210460
2014-02-04 11:00:03 -08:00
Adam Lesinski
1b5b60d696 am 203356a3: Merge "Add support for multiple asset dirs (-A)" into klp-modular-dev
* commit '203356a34a82bfc759be02dfa1caa4529dce0732':
  Add support for multiple asset dirs (-A)
2014-02-04 18:36:10 +00:00
Adam Lesinski
203356a34a Merge "Add support for multiple asset dirs (-A)" into klp-modular-dev 2014-02-04 18:31:23 +00:00
Narayan Kamath
7c4887f66b Change ResourceType cookies to int32_t.
Also change the order of parameters in ResTable constructors
to avoid ambiguity.

(cherry picked from commit 00b314436f4fdfada4bbf1e79ec12e9fa38aeaf1)

Change-Id: I874c5d03c134dc3c331fba423b5280366296287c
2014-01-31 13:47:27 +00:00
Narayan Kamath
00b314436f Change ResourceType cookies to int32_t.
Also change the order of parameters in ResTable constructors
to avoid ambiguity.

Change-Id: If7bfa1f640dddca39b9f26a3ce84081fa7b6e6e3
2014-01-28 16:27:52 +00:00
Narayan Kamath
f85e41f29a AssetManager cookies are now int32_t, not void*.
Change-Id: Id383e31922ca81c52dad52d422c5c1ab1a1365ce
2014-01-27 10:31:11 -08:00
Bryan Mawhinney
9ab9b93eae Filter unneeded assets from additional resource directories
This change ensures that assets that are not needed for the
preferred density are stripped from additional directories
specified by the -S flag

For simplicity, the logic for deciding which assets are not
needed is still applied per directory, rather than globally,
which may still result in some unneeded assets being included
in the final output.

Bug: 12604267
Change-Id: Ic1378570c2d9cd1c854c507e784233818c19efca
2014-01-27 10:31:10 -08:00
Narayan Kamath
9a9fa163c3 Don't pseudolocalize untranslatable strings.
bug: https://code.google.com/p/android/issues/detail?id=63004

(cherry picked from commit 7e1b8ff3e15b35b92978e572ccbfbc47cedce242)

Change-Id: I99ba1a915ae8fc61f70ce570b782108171d0fcaa
2014-01-27 10:31:10 -08:00
Narayan Kamath
9636071bdc Reimplement ZipFileRO in terms of libziparchive.
This lets us share zip archive processing code with both
the runtime (Art, dalvik) and critical java code
(StrictJarFile).

This change also moves several utility methods to ZipUtils
and dedups code across several zip inflation methods.

One of the side effects of this change is that several
processing loops are now O(n) instead of O(n^2).

bug: 10193060

(cherry picked from commit e9d380f9303692950166472b1dfab083e1af8133)

Change-Id: I53e7d0c0af266cb1fe4e293e1177b2590cc44224
2014-01-27 10:31:09 -08:00
Ying Wang
cd28bd37ea Add new aapt flag --error-on-missing-config-entry
It forces aapt to return an error if aapt fails to find an resource
entry for a configuration.

Bug: 11259444
Change-Id: Ie5674a29dff5d4455e7d7c94f6b25560fb1305b7
2014-01-27 10:31:09 -08:00
Adam Lesinski
58f1f3617c Dump maxSdk of uses-permission during badging
If the manifest specifies a maxSdkVersion for which to
stop granting a certain permission, output that value
when dumping badging.

bug:11630700
Change-Id: I922a3186340383828e1af3ce0815efb407d9d535
2014-01-27 10:31:09 -08:00
Elliott Hughes
b30296b5fd Re-apply several tools fixes lost by the directory rearrangement.
Leaks on error in tools/aapt/Images.cpp.
https://code.google.com/p/android/issues/detail?id=61552

Two missing fclose calls in tools/aapt/Resource.cpp.
https://code.google.com/p/android/issues/detail?id=61553

Missing fclose in tools/aidl/aidl.cpp.
https://code.google.com/p/android/issues/detail?id=61554

Change-Id: I56ce144958296961b77354815efc1a245564594b
2014-01-27 10:31:08 -08:00
Maurice Chu
2675f76967 Escape strings that are output by aapt dump badging
Also, changed getComponentName() to output a String8 object
instead of a const char * because the const char * is an internal
buffer of a String8 object which gets immediately destroyed
after returning from getComponentName().

Bug: 11329761
Change-Id: Ic459dec0ad3b20162c36de0ee492bcc022863b12
2014-01-27 10:31:08 -08:00
Adam Lesinski
8cf6184518 Prune unneeded density resources from APK
When a preferred density is specified, prune all but the
closest matching density when the exact density resource does not
exist.

If a preferred density resource does not exist and a higher density
resource exists, prune all but the resource with the next highest
density relative to the preferred density.

If a preferred density resource does not exist and there is no
higher density resource, prune all but the resource with the next
lowest density relative to the preferred density.

Manual merge of I99b3950fe3d8116a5625968ed383442315ae8526 from
frameworks/base/tools to frameworks/tools

bug:11224465
Change-Id: Idddf55dad27f114ffc429b61317c3a5b1435d808
2014-01-27 10:31:08 -08:00
Maurice Chu
76327314d2 Fix aapt when outputting meta-data tag values
This fixes outputting string as well as not crashing when the
<meta-data> element has an "android:resource" attribute instead
of an "android:value" attribute.

Bug: 11255844
Change-Id: Iadb62b5dcb18ea3db8dbd2ba3241f489606d535d
2014-01-27 10:31:07 -08:00
Adam Lesinski
8ff15b4cad AAPT emits error for res with no 'default' product
Rather than ignoring resources that do not match the specified
product, we keep track of the ignored ones and make sure that
some variant of the resource that matches the product was processed.

bug:10860838
Change-Id: I7a35f37fda2c9561634f75323bd4cb2b9047e29b
2014-01-27 10:31:07 -08:00
Adam Lesinski
94fc9124f5 resolved conflicts for merge of 0c923b7c to master
Change-Id: I4f314b48c7714706329509d931d2c53079f5e248
2014-01-27 10:31:06 -08:00
Adam Lesinski
a5018c900f resolved conflicts for merge of 5223a5ff to master
Change-Id: I6523e4b7df88f21fbe0ecd3ab8f493e5a9867305
2014-01-27 10:31:06 -08:00
Michael Wright
ec4fdec76f Add support for supports-input element to aapt
Change-Id: Ie8c8c44f126383c351f2ebb9ae7c3694fb0a9b16
2014-01-27 10:31:05 -08:00
John Reck
859e19f97d libpng usage tweaks
Bug: 10447005

 Call png_set_interlace_handling explicitly instead of relying on
 implicit handling that logs warnings

 Include filename when printing warnings

Change-Id: Ia343427f5522dc8ab1010f8d7017e86f389caf99
2014-01-27 10:31:05 -08:00
Chet Haase
7cce7bb5d8 Remove scenes from Resource.cpp
Part of the Transition API changes, except that the tools/ directory
got moved between klp and master, so re-making the same changes here.

Issue #10460684 KLP API Review: android.view.transition and android.animation

Change-Id: Icedca1dc689285b4b213f9376656b26f18c7f23e
2014-01-27 10:31:04 -08:00
Adam Lesinski
282e181b58 Revert "Move frameworks/base/tools/ to frameworks/tools/"
This reverts commit 9f6a119c8aa276432ece4fe2118bd8a3c9b1067e.
2014-01-27 10:31:04 -08:00
Narayan Kamath
745d4efc83 AssetManager cookies should be int32_t and not void*.
Cookies are really indices into vectors and arrays, so
they don't need to be void*. We choose int32_t instead
of size_t to allow their width to be well specified.

(cherry picked from commit ebfdd0f467e39c3af8d92cade78263935340acb7)
(cherry picked from commit a7fa2e592e2e579e5acdb903dba83fc074ebc215)
(cherry picked from commit a9d5701b034ed2d9771b3f0943e1add00741d7cd)

Change-Id: I2aed3db568b6fdc487bf99e2c5dd123206736fda
2014-01-27 11:20:24 +00:00
Adam Lesinski
09384303de Add support for multiple asset dirs (-A)
Bug: 12608034
Change-Id: I02c5a1a73b83498d799570428cca3dd914f8ac11
2014-01-23 12:43:42 -08:00
Narayan Kamath
3da645f307 Merge "Don't pseudolocalize untranslatable strings." 2013-12-18 12:46:41 +00:00
Narayan Kamath
d21752dff4 Merge "Reimplement ZipFileRO in terms of libziparchive." 2013-12-11 11:41:10 +00:00