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.
Make the output from aapt dump xmltree normalized, so that it is unambigously
displayed regardless of the content of the strings. Previous patch left out
handling of XML element content.
Mårten Kongstad [Thu, 17 Mar 2011 13:13:41 +0000 (14:13 +0100)]
Runtime resource overlay, iteration 1.
Runtime resource overlay allows unmodified applications to appear
as if they had been compiled with additional resources defined. See
libs/utils/README for more information.
This commit is the first iteration of runtime resource overlay. It
provides the actual overlay modifications and loading of trusted overlay
packages (ie residing in /vendor) targeting framework-res.apk.
This commit loads exactly one overlay package. The overlay,
if present, must target framework-res.apk and be located at
/vendor/overlay/framework/framework-res.apk.
Xavier Ducrohet [Mon, 28 Feb 2011 17:16:38 +0000 (09:16 -0800)]
am dff6b8e7: Merge "Add --non-constant-id to aapt."
* commit 'dff6b8e71dda9f5d841fa26408714aec2aef1505':
GpsLocationProvider: Clean up HAL initialization/cleanup sequence
Fixed GSM encoded network initiated position request
Ensuring thread-safe usage of DateFormat.
Fixing infinite loop for zero duration.
Fix for an infinite loop while scrolling lists.
WAPPushManager, WAP Push over SMS message handler
Add --non-constant-id to aapt.
Xavier Ducrohet [Tue, 15 Feb 2011 00:58:00 +0000 (16:58 -0800)]
Add --non-constant-id to aapt.
This option enbables creating resource constant in the R class
that are not actual constant, but simply static fields.
The goal is to build library projects with these types of
IDs so that the constant does not get inlined in the library
code, since the ID for the library resources only are not
the final values.
The final resource IDs, generated from the main project and
its library(ies), will have proper constant with the final
values.
This allows us to generate binary library bundle (a jar file
and associated resources) that can be distributed. Additionally,
this will let us make the library project support in Eclipse
much more robust and a better user experience overall.
Josh Stone [Tue, 18 Jan 2011 02:34:11 +0000 (18:34 -0800)]
aapt: Allow raw "%" in unformatted string-arrays
Commit 15fe2cb added format checking for translatable strings, enforcing
the use of positional args. This check can be disabled on <string>
values with translatable="false" or formatted="false". But they didn't
check for those attributes on <string-array>, so some of CM's strings
fail when they're not really format strings, just because they contain
percent signs. (e.g. brightness widget's "Auto/Dim/40%/100%")
So now the formatted/translatable attributes are checked in string-array
too, and we can restore our proper percent signs.
Shachar Shemesh [Mon, 20 Dec 2010 15:38:33 +0000 (17:38 +0200)]
Normalize output from aapt d
Make the output from aapt dump --values resources and aapt dump xmltree normalized, so that it is unambigously displayed
regardless of the content of the strings.
Dan Morrill [Tue, 14 Dec 2010 19:28:50 +0000 (11:28 -0800)]
am 5441a9ff: Merge "GL texture filtering changed from AND to OR, so rename tag name to match. (<uses-foo> == AND, <supports-foo> == OR, e.g. uses-feature vs. supports-screen)." into gingerbread
* commit '5441a9ff2128cf2c5088974c74b79d2d1734f755':
GL texture filtering changed from AND to OR, so rename tag name to match. (<uses-foo> == AND, <supports-foo> == OR, e.g. uses-feature vs. supports-screen).
Dan Morrill [Tue, 14 Dec 2010 00:25:54 +0000 (16:25 -0800)]
GL texture filtering changed from AND to OR, so rename tag name to match.
(<uses-foo> == AND, <supports-foo> == OR, e.g. uses-feature vs.
supports-screen).
Dan Morrill [Wed, 13 Oct 2010 22:23:27 +0000 (15:23 -0700)]
am 5c62ab0a: Merge "Adding a new <uses-gl-texture/> tag, to be used to enable apps to specify filtering based on support for OpenGL ES texture and texture compression formats." into gingerbread
Dan Morrill [Wed, 13 Oct 2010 21:33:43 +0000 (14:33 -0700)]
Adding a new <uses-gl-texture/> tag, to be used to enable apps to specify
filtering based on support for OpenGL ES texture and texture compression
formats.
Dianne Hackborn [Mon, 4 Oct 2010 18:31:17 +0000 (11:31 -0700)]
Add new API to find out whether external storage is removable.
This is implemented based on whether we are using the "nosdcard"
product. Needed to tweak aapt to allow use of the product attribute
with other resource definition tags besides strings.
Eric Fischer [Wed, 15 Sep 2010 22:59:21 +0000 (15:59 -0700)]
Add an aapt option to allow string variations for different devices.
The --product option to aapt is a comma-separated list of characteristics
of the device being built for. For example, --product nosdcard,grayscale
for a device with no SD card and a grayscale screen.
Strings can specify a product="characteristic" option to cause that version
of the string to be used only for that type of device. All such strings
should also specify, at the end of the block, product="default", which
will be used if none of the variations match. For example:
<string name="choose" product="bw">Choose black or white</string>
<string name="choose" product="grayscale">Choose a shade of gray</string>
<string name="choose" product="default">Choose a color</string>
The default characteristic will also be used when no --product option
is specified.
Xavier Ducrohet [Tue, 31 Aug 2010 17:45:31 +0000 (10:45 -0700)]
Add a --debug-mode option to aapt.
When passed (with no needed parameters) to the aapt command line,
aapt will insert debuggable=true in the application node of the manifest
automatically.
This is to be used by the SDK tools to make true "debug" builds
that require no code/file change.
Xavier Ducrohet [Tue, 31 Aug 2010 17:45:31 +0000 (10:45 -0700)]
Add a --debug-mode option to aapt.
When passed (with no needed parameters) to the aapt command line,
aapt will insert debuggable=true in the application node of the manifest
automatically.
This is to be used by the SDK tools to make true "debug" builds
that require no code/file change.
Kenny Root [Wed, 25 Aug 2010 14:36:31 +0000 (07:36 -0700)]
Add LFH offset to verbose list of APK
The Local File Header (LFH) offset is printed in debugging cases when
the platform is inspecting APKs. This adds the LFH offset field to the
list of contents of an APK, so that it can be checked easily against the
Central Directory (CD).
Package overlays makes it possible for vendors to tweak the look of
the platform and the applications without touching any platform or
application code directly. This makes package overlays an important
mechanism in the Android build system.
There is currently a limitation that forbids changing the parent of a
style. If vendors could change the parent of e.g. ‘CalendarTheme’
from Android’s vanilla ‘Theme’ to ‘VendorTheme’, then vendor
specific adjustments could be done without changing any code directly.
From looking at the code it can be seen that the parent value of a
style is stored temporarily in ResourceTable::Entry::mParent while
overlays are gone through in buildResources(), and processed (in
ResourceTable::Entry::assignResourceIds()) at first after all overlays
have been handled, so there aren’t any obvious reasons why changing
parent in an overlay should be forbidden.
aapt will ignore any versioned resource directories over the
specified version (if used). e.g. --max-res-version=6 will
cause layout-land-v7 to be ignored.
aapt will ignore any versioned resource directories over the
specified version (if used). e.g. --max-res-version=6 will
cause layout-land-v7 to be ignored.
Dan Morrill [Thu, 17 Jun 2010 19:36:17 +0000 (12:36 -0700)]
am 6b22d81a: As Donut (API=4) devices and earlier do not have a Bluetooth API, .apk files that have minSdkLevel (or targetSdkLevel) set to 4 or lower should not be presumed to require Bluetooth just because they take the permission.
Dan Morrill [Wed, 16 Jun 2010 04:41:42 +0000 (21:41 -0700)]
As Donut (API=4) devices and earlier do not have a Bluetooth API, .apk files
that have minSdkLevel (or targetSdkLevel) set to 4 or lower should not be
presumed to require Bluetooth just because they take the permission.
Dan Morrill [Wed, 16 Jun 2010 04:41:42 +0000 (21:41 -0700)]
As Donut (API=4) devices and earlier do not have a Bluetooth API, .apk files
that have minSdkLevel (or targetSdkLevel) set to 4 or lower should not be
presumed to require Bluetooth just because they take the permission.
Kenny Root [Fri, 28 May 2010 22:44:32 +0000 (15:44 -0700)]
Add error checking for translatable strings
Translatable strings that have multiple substitutions should use
positional String.format() substitutions. This change makes it an error
not to use that format on translatable strings that have more than one
substitution in its text.
Dan Morrill [Tue, 4 May 2010 19:45:49 +0000 (12:45 -0700)]
am f7ebcfec: am e17b4e71: Merge "Adding the backward-compatible filtering heuristics for the new device features definitions added in FroYo." into froyo
Not complete, only for experimentation at this point.
This includes a reworking of how screen size configurations are matched,
so that if you are on a larger screen we can select configurations for
smaller screens if there aren't any exactly matching the current screen.
The screen size at which we switch to xlarge has been arbitrarily
chosen; the compatibility behavior has not yet been defined.
Kenny Root [Thu, 18 Mar 2010 21:14:49 +0000 (14:14 -0700)]
Make aapt warning concise
The previous warning made it seem like it could be using the value
specified on the command line, but, in fact, it would ignore the command
line value if it were already specified in the AndroidManifest.xml
Kenny Root [Thu, 18 Mar 2010 19:12:11 +0000 (12:12 -0700)]
Fix minSdkVersion scanning to not throw warnings
For the UTF8/UTF16 switch code, we needed to know what was the
minSdkVersion specified as early as possible. Unfortunately, this threw
warnings when the SDK was compiling since we always set this field in
the Bundle.
This splits out the field used by the initial AndroidManifest.xml scan
to a separate one that we won't attempt to re-insert into the
AndroidManifest.xml This also switches the logic to better reflect the
preference of UTF-8 over UTF-16; previously UTF-16 was the default.
Kenny Root [Fri, 12 Mar 2010 22:12:14 +0000 (14:12 -0800)]
Give an 9-patch error on too many rows and columns
When you have too many rows and columns, there are not enough colors in
the 9-patch private metadata to represent them. Instead of crashing
aapt, this change gives the user an error message telling them why it's
invalid.
Kenny Root [Wed, 10 Mar 2010 00:55:23 +0000 (16:55 -0800)]
Dedupe resource config pointers
When there are two configs in a StringPool that would match a string ID
only keep the more generic entry to save some space. This means that if
you have both "es" and "es_US" translations that have the same
translation, the string entry would be removed from the "es_US" config.
Dianne Hackborn [Tue, 9 Mar 2010 23:00:30 +0000 (15:00 -0800)]
Add ability for some manifest attributes to reference resources.
This loosens our restriction on many manifest attributes requiring
literal string values, to allow various ones to use values from
resources. This is only allowed if the resource value does not change
from configuration changes, and the restriction is still in place
for attributes that are core to security (requesting permissions) or
market operation (used libraries and features etc).
Ed Heyl [Fri, 5 Mar 2010 19:59:58 +0000 (11:59 -0800)]
Merge "Change an aapt "warning" from "*** " to "**** " (from three to four stars). "*** " (three stars and a space) is the 'magic make error string'; so this change makes it easier to find the real issues/errors in build logs. Besides, other aapt messages are "**** "."
Ed Heyl [Fri, 5 Mar 2010 19:08:58 +0000 (11:08 -0800)]
Change an aapt "warning" from "*** " to "**** " (from three to four stars).
"*** " (three stars and a space) is the 'magic make error string'; so this change makes it
easier to find the real issues/errors in build logs. Besides, other aapt messages are "**** ".
Dianne Hackborn [Fri, 5 Mar 2010 02:41:49 +0000 (18:41 -0800)]
Refactor car mode.
Extract all UI behavior from dock observer and ACTION_DOCK_EVENT.
Also introduce a desk type to go along with the car type all through
the resource system, since we now need to have corresponding high-level
broadcasts for desk dock mode. As part of that I also reworked some
of the logic for switching modes to all funnel through a single
update() call that looks all of the current state to decide what to
do next, and fixed various locking issues.
In addition I found there were bugs in the configuration change
handling causing us to only switch into the car mode config and
then never get out of it. Unfortunately now that we are actually
changing the configuration for each mode change, the transitions
between them are really crummy as we restart all kinds of
activities. :(
Dianne Hackborn [Tue, 2 Mar 2010 01:43:39 +0000 (17:43 -0800)]
Fix issue #2448075: aapt doesn't fix up activity-alias android:targetActivity links
And related:
- The aapt tool now sets a resource configurations sdk level to match any configs
that have been set (for example if you specify density your sdk level will be
at least 4).
- New option to modify the targetPackage attribute of instrumentation.
- Clean up of aapt options help.
- Fix of UI type values to leave 0 for "unspecified".
- Make the UI mode config APIs public.
Kenny Root [Thu, 25 Feb 2010 04:00:03 +0000 (20:00 -0800)]
Scan for android namespace in manifest
android:minSdkVersion wasn't being correctly scanned because the
namespace was incorrect. This fixes that problem so packages aren't
generated as UTF-8 when minSdkVersion is less than 7.
Kenny Root [Tue, 23 Feb 2010 06:36:26 +0000 (22:36 -0800)]
Use UTF-8 strings to avoid duplicate caching, part 1
StringBlock instances containing UTF-8 strings use a cache to convert
into UTF-16, but using that cache and then using a JNI call to NewString
causes the UTF-8 string as well as two copies of the UTF-16 string to
be held in memory. Getting the UTF-8 string directly from the StringPool
eliminates one copy of the UTF-16 string being held in memory.
This is part 1. Part 2 will include ResXMLParser optimizations.
Kenny Root [Thu, 18 Feb 2010 16:54:47 +0000 (08:54 -0800)]
Fix enum reference
Was using argument that is set default to NULL as a shortcut to an
enum's value. Change it to reference to class directly to avoid a null
pointer dereference.