inazaruk [Sun, 22 May 2011 22:09:06 +0000 (15:09 -0700)]
Fix for issue 9656 - custom xml attributes in Android Libraries. do not merge.
Added support for predefined namespace http://schemas.android.com/apk/res/auto
that aapt tool recognizes and treats as namespace with package name
taken from current application's AndroidManifest.xml, //manifest/package attribute.
Mårten Kongstad [Wed, 8 Feb 2012 09:22:47 +0000 (10:22 +0100)]
Runtime resource overlay: clean-up.
This is a combination of three minor clean-up tasks:
- Generate correct idmap even if name lookup fails:
Any resources following a resource with a spec but no actual values
would receive an incorrect ID in the idmap due to an accumulating offset
error. To combat this, a dummy value is inserted in the idmap whenever
a resource with a spec but no values is encountered.
- Optimize pruning of padding zeroes in idmaps:
Earlier, trailing zeroes were iteratively popped from the end of each
type block of an idmap. This commit instead tracks where to make the
cut, and does so with a single function call.
- aapt: warn about resources which lack values:
The resource framework assumes every resource to have a value for
at least one valid configuration. However, if multiple resource
directories are used (several -S options to aapt), the list of
configurations is limited by dpi (-c option to aapt) and a resource
is only available in discarded dpi configurations, aapt will create
a resource entry where each configuration lack an actual value. This
commit lets aapt emit a warning whenever this has happened.
Mårten Kongstad [Tue, 7 Feb 2012 18:12:45 +0000 (19:12 +0100)]
Build overlay packages just like regular packages.
Previously, building overlay packages required passing aapt its -o flag.
This commit decouples the idmap generation code from the effects of the
-o flag.
Since this commit renders the -o flag obsolete, support for the flag was
removed from aapt as well.
Xavier Ducrohet [Fri, 3 Feb 2012 01:18:18 +0000 (17:18 -0800)]
Make aapt ignore tools-related data.
This patchset introduces a new standard namespace http://schemas.android.com/tools
which will be used for tools specific XML attributes.
Any attributes using this namespace will not be compiled into the binary XML file.
The namespace node is also not written at all, and its string is not collected
to ensure that there is no impact on the devices.
Xavier Ducrohet [Fri, 3 Feb 2012 01:18:18 +0000 (17:18 -0800)]
Make aapt ignore tools-related data.
This patchset introduces a new standard namespace http://schemas.android.com/tools
which will be used for tools specific XML attributes.
Any attributes using this namespace will not be compiled into the binary XML file.
The namespace node is also not written at all, and its string is not collected
to ensure that there is no impact on the devices.
Dianne Hackborn [Tue, 31 Jan 2012 19:27:43 +0000 (11:27 -0800)]
aapt now sorts the strings in the resource string pool.
In our current environment with very many translations, this can
save a lot of RAM -- for example over 200K in Gmail just by sorting
the strings in the Gmail .apk (not the framework).
Also add a new aapt command to print the contents of the resource
table string pool.
Joe Onorato [Thu, 15 Dec 2011 04:59:30 +0000 (20:59 -0800)]
Add a new ui mode for "appliance"
The idea is that this is a device which is more-or-less headless. It
might have some limited interaction capabilities, but it's not something
that you want to rely on having.
Joe Onorato [Thu, 15 Dec 2011 04:59:30 +0000 (20:59 -0800)]
Add a new ui mode for "appliance"
The idea is that this is a device which is more-or-less headless. It
might have some limited interaction capabilities, but it's not something
that you want to rely on having.
Eric Fischer [Tue, 27 Sep 2011 23:09:41 +0000 (16:09 -0700)]
Don't lose product variant strings that also vary between locales.
Localized strings with product variants were not being included in the APK,
apparently because the check to ensure that a different variation of the
string had not already been included in the APK was matching the version
of it from the default, untranslated configuration.
Now check to make sure that the string not only exists but also exists in
the correct configuration.
The arguments that ZipFile takes were apparently meant to be a typed
enum, but the name of the type was taken out because it creates invalid
conversion warnings in C++ since this is an invalid use of enum.
Just change the typedef enum to an anonymous enum so we get rid of the
compiler warnings. It will be implicitly converted to int instead.
Josiah Gaskin [Tue, 7 Jun 2011 00:00:35 +0000 (17:00 -0700)]
Added Caching for PreProcessed PNGs
Added a cache management system for pre-processed PNG files
along with unit tests. The cache system will be used if
the --no-crunch flag is passed to AAPT during the package
phase. The cache can be updated by a call to 'aapt crunch'
(see usage statement). Also put in benchmarking code.
Josiah Gaskin [Mon, 27 Jun 2011 23:26:02 +0000 (16:26 -0700)]
Add generation of dependency file for .ap_ package
Make Aapt generate a dependency file in the same directory as the
output ap_ file if the --generate-dependencies flag is set.
This dependency file can then be read by the ant exec loop task
to see whether to repackage resources.
Josiah Gaskin [Tue, 14 Jun 2011 20:57:09 +0000 (13:57 -0700)]
Add dependency generation to Aapt for R.java
Make Aapt generate a dependency file in the location specified
by RClassDir for R.java if the --generate-dependencies flag is set.
This dependency file is then read by the ant exec loop task
to see whether to recreate R.java.
Josiah Gaskin [Thu, 9 Jun 2011 02:31:40 +0000 (19:31 -0700)]
Copy once-created R.java into library projects
This change adds functionality in Aapt to allow specification of
library projects to copy the generated R.java file into rather
than regenerating the file for each library project.
Dianne Hackborn [Thu, 16 Jun 2011 18:11:23 +0000 (11:11 -0700)]
New orientation handling. Only impacts SDK (aapt dump badging).
This is a new way of determining whether an application requires
specific orientations, done by looking at any requirements in its
activity tags. Note that this won't catch all possible issues,
because applications can still force an orientation through Java
APIs, but the vast majority of applications that actually require
a specific orientation should be doing it this way because it the
easiest way and the only way to cleanly launch into the app from
a different orientation without doing some serious activity tricks.
Dianne Hackborn [Tue, 14 Jun 2011 02:33:22 +0000 (19:33 -0700)]
Add new landscape and portrait orientation features.
Updates aapt to know about these. Also updates aapt badging to:
- No longer crash due to the change to how we match unspecified
configuration resources.
- Report the new "smallest screen" supported screen configs.
- Infer old screen size buckets based on new smallest width attrs.
- Report all of the different labels and icons in an app.