1163 Commits

Author SHA1 Message Date
Xavier Ducrohet
5de9603529 am 31820a35: Merge "Add --output-text-symbols option to aapt."
* commit '31820a35b2cf864a8dcb71d43e6fd21d54f49a2d':
  Add --output-text-symbols option to aapt.
2012-09-17 12:03:19 -07:00
Xavier Ducrohet
cc9747ed45 am d7252571: Merge "Add --error-on-failed-insert option to aapt."
* commit 'd72525718ea7ef3e1f97cf557365b143c8919a5b':
  Add --error-on-failed-insert option to aapt.
2012-09-17 12:03:12 -07:00
Xavier Ducrohet
f5de650ff1 Add --output-text-symbols option to aapt.
Library projects in the SDK are built using --non-constant-id
to generate a temporary R.java class.
When the library is packaged with the application to generate an
apk, the R class is recreated with the proper IDs due to all the
resources coming from the app and all the libraries.

However for large apps with many libraries (each with their own
R class in their package), this means a lot of unnecessary IDs:
all R classes contains all the IDs including for resources from
by projects they don't have access through the dependency graph.

For really large apps (X,000 resources), with lots of libraries
(10+), this can generate tens of thousands of resources, which
can trigger dalvik's limit of 65K fields and methods per dex
files.

This changes lets aapt generate not only the R class but a simple
text file containing the list of all those IDs so that it is
easier to parse back. The SDK build system will not ask aapt
to generate the R class of the libraries (through the
--extra-packages option), instead it will then read this
file to know what IDs are needed for each library and generate
a much smaller R class for each library (using the same text
file output from compiling all the resources to get the final
integer value).

Change-Id: I4db959fec372cf3ead9950e4b2b82fa1ae7eed2d
2012-09-11 18:19:00 -07:00
Xavier Ducrohet
7714a2429b Add --error-on-failed-insert option to aapt.
The new SDK build system give the ability to insert
versionCode/Name and min/targetSdkVersion in the manifest
but aapt won't replace those if they already exist.

The main problem is that aapt doesn't actually fail when
it doesn't replace them, making the output not what the
developer wanted.

This patch set adds an option to aapt to make it return
an error if the insert failed because the attribute
already existed.

Change-Id: I8938ec1238da407a8562c974e9598db39001ffd9
2012-09-11 18:17:22 -07:00
Elliott Hughes
3150feef0b am bfe1ab82: Merge "Fix aapt to get expat header files from the approved location."
* commit 'bfe1ab825731d365fef169deab646d7ceeafc998':
  Fix aapt to get expat header files from the approved location.
2012-09-09 16:09:15 -07:00
Elliott Hughes
ee15e15475 Fix aapt to get expat header files from the approved location.
Change-Id: Ic7c796e048cfe98ee355c18b3708fee5ea716e2e
2012-09-09 14:45:32 -07:00
Jean-Baptiste Queru
c1c55afb47 am e67f8c8c: Merge "Normalize output from aapt d xmltree"
* commit 'e67f8c8c279e20fff5f426eccd062b709e6280ed':
  Normalize output from aapt d xmltree
2012-08-08 12:01:35 -07:00
Jean-Baptiste Queru
e67f8c8c27 Merge "Normalize output from aapt d xmltree" 2012-08-08 11:21:29 -07:00
Elliott Hughes
4b4b44381b am 33c5670b: Merge "Fewer warnings in aidl generated code."
* commit '33c5670b315810f1f3dc66fe8cd38f7b3e05f3ac':
  Fewer warnings in aidl generated code.
2012-08-07 13:18:53 -07:00
Elliott Hughes
b327c41e12 Fewer warnings in aidl generated code.
Bug: http://code.google.com/p/android/issues/detail?id=19196
Change-Id: If054e60c19dc73fe32f55d0fa1054309565a6de6
2012-08-07 10:34:02 -07:00
Xavier Ducrohet
be92501720 am b71393bd: Merge "Fix aapt -G to properly support class attr in fragment." into jb-dev
* commit 'b71393bd34a48eeb622292e78f43b99e374a5e3a':
  Fix aapt -G to properly support class attr in fragment.
2012-07-19 14:30:39 -07:00
Xavier Ducrohet
095cd2e2d1 Fix aapt -G to properly support class attr in fragment.
The code added attributes android:name and class to a
KeyedVector under the same key (fragment) so the 2nd
add (android:name) removed class with was never checked.

This replace the value type in the KeyedVector to be
Vector<NamespaceAttributePair> instead of just
NamespaceAttributePair.

Change-Id: I009b8a8cca878191661c2a63bb14c967d230498d
2012-07-19 09:06:03 -07:00
Xavier Ducrohet
54059cd38d am 15c15eaa: Merge "Replace LruCache implementation for layoutlib. do not merge." into jb-dev
* commit '15c15eaac51c0c375d18fb70cd1bd066d87b034e':
  Replace LruCache implementation for layoutlib. do not merge.
2012-07-10 18:38:21 -07:00
Xavier Ducrohet
54a18ef7ad Replace LruCache implementation for layoutlib. do not merge.
The android version depends on a custom version of LinkedHashMap
which is not present on desktop VMs. This new implementation is done
in a way that minimizes the difference between the two.

Also some minor fixes.

(cherry picked from commit 01b6c755dbcf24e71192dc44757e2eea2a426091)

Change-Id: Idc7bca820e472e281a3024a5b610fd55606cf428
2012-07-10 12:51:30 -07:00
Shachar Shemesh
429dad687b Normalize output from aapt d xmltree
When using aapt dump xmltree to dump an XML which has a content element with newlines, the output contains a
newline. This makes it very difficult, sometimes impossible, to understand what is part of the content, and
what is the meta-data.

We now pass XML content through the same normalizer used for other tags.

Change-Id: I327321520fac563eb32aecaf796f2473866697fc
2012-07-08 06:37:48 +03:00
Jean-Baptiste Queru
cc6cf51b80 am 8c71784e: Merge "Initialize mJunkPath to false"
* commit '8c71784e9e83e914135e996591aa7903edd2fd96':
  Initialize mJunkPath to false
2012-06-22 14:34:54 -07:00
Haitao Feng
dbcfed9e2c Initialize mJunkPath to false
Change-Id: Ib48bb1d91736d27f055528c3ba275237ff5ada07
2012-06-22 09:20:26 +08:00
Xavier Ducrohet
58a8d8d2d4 am 0e302bc8: Merge "Disable debug output in SDK layoutlib." into jb-dev
* commit '0e302bc884fa4b25eb391d625f2fb0eddc25d9b7':
  Disable debug output in SDK layoutlib.
2012-06-19 18:06:37 -07:00
Xavier Ducrohet
4d7f301f94 Disable debug output in SDK layoutlib.
Bug: 6697442

Change-Id: I9741761342ea220c158aa124089430b0db80bf7e
2012-06-19 18:02:21 -07:00
Raphael Moll
bce1011dd2 resolved conflicts for merge of 8cf489c1 to jb-dev-plus-aosp
Change-Id: I06608e3c122b8f321429d457c51aa2213dd238b4
2012-06-14 14:14:45 -07:00
Raphael Moll
8cf489c1f5 am 0f160c95: Merge "Layoutlib Create: Find dependencies."
* commit '0f160c95122276c40ca84afe6fcd2b9cd800e35c':
  Layoutlib Create: Find dependencies.
2012-06-14 11:34:31 -07:00
Raphael Moll
4306096a43 Layoutlib Create: Find dependencies.
Usage: layoutlib_create --list-deps /path/to/layoutlib.jar

Prints:
- all classes found in the Jar and the types they use (the dependencies).
- all the dependencies missing from the Jar and what uses them.

Change-Id: I8b2674df127e1494feed7a653282e88e4d2f5494
2012-06-13 15:44:54 -07:00
Dianne Hackborn
6892f1ec96 am 0f6471ac: Merge "Fix issue #6641368: can\'t launch gallery" into jb-dev
* commit '0f6471ace77387560988964ed0679f843bba6f1f':
  Fix issue #6641368: can't launch gallery
2012-06-12 12:41:36 -07:00
Dianne Hackborn
2bd8d0403b Fix issue #6641368: can't launch gallery
This is a revert of 1db36528b12395b9ed9bf8a1005a6d4ace737627,
but with comments added so I don't make this mistake again. :)

Change-Id: I053216279e3721f08f32f561bb989736ef619f82
2012-06-11 12:27:05 -07:00
Jean-Baptiste Queru
f22eb96301 am c9fe6568: am 9e22d9c5: Merge "Fix "Too many open files" error for aapt built with Mac OS X SDK 10.6."
* commit 'c9fe6568f3e7e4d9dc6da072afc929b9a81001ed':
  Fix "Too many open files" error for aapt built with Mac OS X SDK 10.6.
2012-06-05 18:48:00 -07:00
Jean-Baptiste Queru
c9fe6568f3 am 9e22d9c5: Merge "Fix "Too many open files" error for aapt built with Mac OS X SDK 10.6."
* commit '9e22d9c514457c4b163d03b9241e4e28b1698368':
  Fix "Too many open files" error for aapt built with Mac OS X SDK 10.6.
2012-06-05 18:43:49 -07:00
Ying Wang
41bdb03ffb Fix "Too many open files" error for aapt built with Mac OS X SDK 10.6.
With SDK 10.6 without _DARWIN_UNLIMITED_STREAMS aapt sometimes fails
right away with the error "Too many open files" when calling fopen().

Change-Id: Ifa7bd8a9530d706aa47f98be8186f1aefe943d76
2012-06-05 14:30:39 -07:00
Tor Norbye
9f374b9de5 am 44ff9b8f: am 36ac43ba: Merge "Tweak default ignore-assets path"
* commit '44ff9b8f9294e015031fc9293974604771e5efdd':
  Tweak default ignore-assets path
2012-06-05 08:45:20 -07:00
Tor Norbye
44ff9b8f92 am 36ac43ba: Merge "Tweak default ignore-assets path"
* commit '36ac43ba9982a78b4a047c8970776505a3fab4da':
  Tweak default ignore-assets path
2012-06-05 08:41:16 -07:00
Dianne Hackborn
fcd738240a am dd251cab: Merge "Fix build." into jb-dev
* commit 'dd251cab5b6e5b590cc0aeae8be8f885a7794e72':
  Fix build.
2012-06-04 11:09:00 -07:00
Dianne Hackborn
bb47cf66ec Fix build.
Change-Id: I41415fed99d98406bc033289428bde59475c2917
2012-06-04 10:51:17 -07:00
Tor Norbye
e0219c8baa Tweak default ignore-assets path
Add .DS_Store to the list of ignored files that are silently
ignored (other dot-files are ignored but aapt emits a "(skipping <x>)"
message.)

Also, add a "!" prefix to the *~ pattern for Emacs/Vim/Gedit backup
files.

Finally, move the !*.scc pattern up in front of the .* pattern, such
that it doesn't match the earlier .* pattern (which is verbose, unlike
!*.scc).

Change-Id: Id3e96490f1802486aea8c58366d43e9d413971b8
2012-06-04 10:41:38 -07:00
Jean-Baptiste Queru
3df4e1a2f1 am 0748a569: Merge "aapt: Remove terminal pointer incrementaion"
* commit '0748a5698776d1a9693a5449ffc983af26cc533b':
  aapt: Remove terminal pointer incrementaion
2012-06-02 09:56:45 -07:00
Jean-Baptiste Queru
0748a56987 Merge "aapt: Remove terminal pointer incrementaion" 2012-06-02 09:21:37 -07:00
Dianne Hackborn
f3b4c93e0d am ae5811c7: Merge "Fix (mostly) issue #5109947: Race condition between retrieving a..." into jb-dev
* commit 'ae5811c71405878b09eace395ec2b28e54eeb427':
  Fix (mostly) issue #5109947: Race condition between retrieving a...
2012-05-29 15:53:38 -07:00
Dianne Hackborn
6ae8d18218 Fix (mostly) issue #5109947: Race condition between retrieving a...
...content provider and updating its oom adj

This introduces the concept of an "unstable" reference on a content
provider.  When holding such a reference (and no normal stable ref),
the content provider dying will not cause the client process to be
killed.

This is used in ContentResolver.query(), .openAssetFileDescriptor(),
and .openTypedAssetFileDescriptor() to first access the provider
with an unstable reference, and if at the point of calling into the
provider we find it is dead then acquiring a new stable reference
and doing the operation again.  Thus if the provider process dies
at any point until we get the result back, our own process will not
be killed and we can safely retry the operation.

Arguably there is still the potential for a race -- if somehow the
provider is killed way late by the OOM killer after the query or
open has returned -- but this should now be *extremely* unlikely.
We also continue to have the issue with the other calls, but these
are much less critical, and the same model can't be used there (we
wouldn't want to execute two insert operations for example).

The implementation of this required some significant changes to the
underlying plumbing of content providers, now keeping track of the
two different reference counts, and managing them appropriately.  To
facilitate this, the activity manager now has a formal connection
object for a client reference on a content provider, which hands to
the application when opening the provider.

These changes have allowed a lot of the code to be cleaned up and
subtle issues closed.  For example, when a process is crashing, we
now have a much better idea of the state of content provider clients
(olding a stable ref, unstable ref, or waiting for it to launch), so
that we can correctly handle each of these.

The client side code is also a fair amount cleaner, though in the
future there is more than should be done.  In particular, the two
ProviderClientRecord and ProviderRefCount classes should be combined
into one, part of which is exposed to the ContentResolver internal
API as a reference on a content provider with methods for updating
reference counts and such.  Some day we'll do that.

Change-Id: I87b10d1b67573ab899e09ca428f1b556fd669c8c
2012-05-29 13:33:09 -07:00
Ying Wang
98a0607a31 Merge "Fix length of pattern." DO NOT MERGE.
After skipping * with "token++", the length should decrease by 1 as
well.

(merged from 996b073e813ba1a22a13282ccdebb664f14ba898)

Change-Id: Ie6232ef603bb31e25e03b926e6c1bb92ac34902d
2012-05-24 11:07:14 -07:00
Ying Wang
ac9f50573d am 996b073e: Fix length of pattern.
* commit '996b073e813ba1a22a13282ccdebb664f14ba898':
  Fix length of pattern.
2012-05-22 11:43:14 -07:00
Ying Wang
996b073e81 Fix length of pattern.
After skipping * with "token++", the length should decrease by 1 as
well.

Change-Id: I132eb7d12bb756f2f713c607e92741ca834aef81
2012-05-22 11:35:22 -07:00
Raphael Moll
9c06ac09c3 Merge "Merge "AAPT: support a new --ignore-assets flag."" into jb-dev 2012-05-21 13:09:29 -07:00
Raphael Moll
6c255a3a37 Merge "AAPT: support a new --ignore-assets flag."
AAPT has a fixed built-in list of files and directories
to ignore when parsing resource files. Over the years we
always had developers requiring specific patterns.

Added a command-line option for it:
  aapt di --ignore-assets "foo*:*.blah"

If the env var ANDROID_AAPT_IGNORE is set, it is parsed
to find which file/directory patterns to ignore.

Otherwise a default is used that matches the current behavior.

SDK Bug: 5343 24067

(cherry-pick from AOSP 90897ed87bce639bf6bb2ccf15fbabb59b131bab)

Change-Id: Ia4caa2a8188c8c1df143f884e459b8182645995f
2012-05-18 20:34:44 -07:00
Dianne Hackborn
72669b5f46 am 13a0271c: Merge "Add aapt support for generating proguard rules for onClick methods." into jb-dev
* commit '13a0271cb81d497edbf93f3d6ecf4b9b8da4ee69':
  Add aapt support for generating proguard rules for onClick methods.
2012-05-18 19:41:10 -07:00
Dianne Hackborn
9275197d35 Add aapt support for generating proguard rules for onClick methods.
Also fix Activity menu inflater when using the dark on light
theme wrapper to still be able to find onClick listeners.

Change-Id: Ie206db26d1df96041bc477804e476b02ad99dc9d
2012-05-18 19:23:19 -07:00
Raphael Moll
f67f834a9c am 8748399f: am 61394501: Merge "Support a new ANDROID_AAPT_IGNORE env var."
* commit '8748399f6f999d21eef9226baadb20f71dfb61ea':
  Support a new ANDROID_AAPT_IGNORE env var.
2012-05-18 16:33:14 -07:00
Jean-Baptiste Queru
38e34874a8 am 2a9b85d7: am c0f17383: Merge "Move kxml2 to prebuilts/misc"
* commit '2a9b85d7ccdd3b8e6be90454cdcb4be3b032cd64':
  Move kxml2 to prebuilts/misc
2012-05-18 16:33:10 -07:00
Elliott Hughes
a4cae2847e am 4b51e293: Merge "Fix the preloaded-classes tool for JellyBean." into jb-dev
* commit '4b51e293d86d60dc651c409ae0e25078a2170740':
  Fix the preloaded-classes tool for JellyBean.
2012-05-18 15:59:41 -07:00
Raphael Moll
613945011e Merge "Support a new ANDROID_AAPT_IGNORE env var." 2012-05-18 13:00:31 -07:00
Jean-Baptiste Queru
c0f1738357 Merge "Move kxml2 to prebuilts/misc" 2012-05-18 09:51:04 -07:00
Elliott Hughes
98e00add55 Fix the preloaded-classes tool for JellyBean.
Bug: 5213043
Change-Id: I8178ca04da0bd72a90244983be5e8ecfbc1b0573
2012-05-17 17:03:51 -07:00
Dianne Hackborn
095c2d315d am 4286d6d1: Fix build.
* commit '4286d6d115385391b75db8e6c4e397008ef9b3db':
  Fix build.
2012-05-14 19:32:43 -07:00