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.
Tobias Haamel [Tue, 9 Feb 2010 22:09:17 +0000 (23:09 +0100)]
Introduce special UI modes for night and car usage.
The device mode is now called ui mode. Furthermore is the order of
precedence for the resources now in such a way that the ui mode needs
to be specified after the orientation and before the density.
The ui mode can be set, like it is done for the locale, as follows:
* commit '0af0449301e72a52beeed8f26021e5460004d67a':
android-2.1_r1 snapshot
Use 128p map tiles for high dpi devices.
Throttle nitz updates as the are too numerous on cdma.
don't request a sync when temp providers are created
Increase light sensor delay from one to two seconds.
Revert jparks code from IPCThreadState.
Add a warning when we leave threads in the binder thread pool in the background scheduling group.
PowerManagerService: Ensure that recent changes do not effect the hardware ALS case.
* commit '31bfdf695ef741f64066ef605bd6a7e23df88714':
android-2.1_r1 snapshot
Use 128p map tiles for high dpi devices.
Throttle nitz updates as the are too numerous on cdma.
don't request a sync when temp providers are created
Increase light sensor delay from one to two seconds.
Revert jparks code from IPCThreadState.
Add a warning when we leave threads in the binder thread pool in the background scheduling group.
PowerManagerService: Ensure that recent changes do not effect the hardware ALS case.
Fix regression.
Fix broken build.
Bluetooth A2DP suspend/resume functionality
EventLog when a database file is deleted due to corruption.
Don't forget to clear "backup in progress" state when finishing a pass
Fix issue #2148939: Sholes slow to wake up in landscape mode
Fix Cdma re-start of default connection.
Merge change 26821 into eclair
Not all WebView's host have permission to read the history.
Merge change 26908 into eclair
Kenny Root [Fri, 11 Dec 2009 16:15:16 +0000 (08:15 -0800)]
Revise aapt options for UTF8/16 encoding
Remove option to force UTF-8 encoding which could corrupt packages meant
for systems before API level 7. Added switch to allow encoding for UTF-16
which will allow API 7 and later to encode resources in UTF-16.
Kenny Root [Thu, 10 Dec 2009 21:52:53 +0000 (13:52 -0800)]
Default to UTF8 resources when packaging with aapt
This change makes it so with API level 7 and above all resources will be
packaged in UTF-8 format. Any minSdkVersion level that is named will also
have resources packaged in UTF-8, because it is assumed that previous
releases will only be rebuilt with their proper integer number and only
future releases will temporarily have names.
Kenny Root [Fri, 4 Dec 2009 17:38:48 +0000 (09:38 -0800)]
Optional use of UTF-8 strings in resource bundles
Allows the use of UTF-8 for packing resources instead of the
default of UTF-16 for Java. When strings are extracted from the
ResStringPool, they are converted to UTF-16 and the result is
cached for subsequent calls.
When using aapt to package, add in the "-8" switch to pack the
resources using UTF-8. This will result in the value, key, and
type strings as well as the compiled XML string values taking
significantly less space in the final application package in
most scenarios.
Kenny Root [Fri, 21 Aug 2009 20:23:45 +0000 (15:23 -0500)]
Fix bitmask in aapt's StringPool length construction
The StringPool indicates the length of a string with a 16-bit
integer. If the length of the string is greater than 0x7FFF,
it splits it into two 16-bit integers with the first one
having the high bit set.
The length calculation has a small bug that masks off the
19 bits instead of the first 15 bits as intended.
Doug Zongker [Tue, 20 Oct 2009 00:04:21 +0000 (17:04 -0700)]
add "junk path" -k option to aapt (DO NOT MERGE)
Adds a "junk path" option to aapt so that you can do:
aapt add -k archive.zip path/to/some.file
and have the file stored in the zip under the name "some.file"
(without the path). Needed so that we can use 'aapt add' in place of
'zip -j' when building jar files, which will lead to smaller
incremental OTAs.
(This is a cherry-pick of a change already submitted to eclair-mr2;
the change was approved for mr1.)
Doug Zongker [Fri, 9 Oct 2009 18:24:51 +0000 (11:24 -0700)]
add "junk path" -k option to aapt
Adds a "junk path" option to aapt so that you can do:
aapt add -k archive.zip path/to/some.file
and have the file stored in the zip under the name "some.file"
(without the path). Needed so that we can use 'aapt add' in place of
'zip -j' when building jar files, which will lead to smaller
incremental OTAs.
Fix issue with printing gles version in aapt dump badging option
If the name attribute for uses-feature or uses-permission is empty
the error value is still empty indicating error and preventing the
else part from being checked as it should be.
Implement issue #1780928: Need support hiding nav keys.
This implements support for devices whose hardware can hide
their navigation keys. It works much like the existing keyboardHidden
configuration, and for compatibility uses the same configuration
change bit.
Also add FLAG_TURN_ON_SCREEN for windows, which has the system
cause the screen to be turned on when the window is displayed.
Great fun when used with FLAG_SHOW_WHEN_LOCKED!
When trying to print an xmltree or xmlstrings from aapt, the error
message if the resource didn't exist erroneously printed a pointer
instead of a string.
Eric Fischer [Tue, 1 Sep 2009 22:20:30 +0000 (15:20 -0700)]
Make it an error to use a bare apostrophe in aapt, and adjust warnings/errors.
In practice, no one ever writes an apostrophe in an aapt string with the
intent of using it to quote whitespace -- they always mean to include a
literal apostrophe in the string and then are surprised when they find
the apostrophe missing. Make this an error so that it is discovered
right away instead of waiting until late in QA or after the strings have
already been sent for translation. (And fix a recently-introduced string
that has exactly this problem.)
Silence the warning about an empty span in a string, since this seems to
annoy people instead of finding any real problems.
Make the error about having a translated string with no base string into
a warning, since this is a big pain when making changes to an application
that has already had some translations done, and the dead translations
should be removed by a later translation import anyway.
Robert Greenwalt [Mon, 31 Aug 2009 21:48:20 +0000 (14:48 -0700)]
Fix replacement-after-add of resource files in overlay.
Aapt was adding/removing elements from a list an continuing to use a stale copy for future indexes.
This could cause incorrect subsequent processing. Add an en resource and modify an es, for example.
Adding the en would cause the base fileset's es version to be moved in the list. Using the old index
we'd then attempt to remove the old es version with the wrong index and then add the new es version
generating a "duplicate file" error.
Dianne Hackborn [Fri, 28 Aug 2009 03:08:01 +0000 (20:08 -0700)]
Add platform infrastructure for features.
This introduces a new mechanism to define features associated with
a platform, query the current device for the available features,
and enforce that apps requiring features that aren't available can't
be installed.
Also now allows uses-library to specify that a library is optional,
so the lack of such a library will not prevent the app from being
installed (but if it does exist it will be correctly linked into
the app).
Dianne Hackborn [Thu, 27 Aug 2009 23:28:44 +0000 (16:28 -0700)]
Fix issue #2084148: Define the format for the auto focus preview for barcode scanning
Add new manifest/aapt support for specifying device features an application
requires. The aapt badging now returns these (as well as uses-permission since
I need to look for those anyway); if an app doesn't explicitly request the
camera feature but does request the permission, then aapt will say that it has
requested both the basic camera feature as well as the autofocus feature.
Here's what you put in your manifest to say you need a camera but don't need
autofocus:
Kenny Root [Fri, 21 Aug 2009 20:23:45 +0000 (15:23 -0500)]
Fix bitmask in aapt's StringPool length construction
The StringPool indicates the length of a string with a 16-bit
integer. If the length of the string is greater than 0x7FFF,
it splits it into two 16-bit integers with the first one
having the high bit set.
The length calculation has a small bug that masks off the
19 bits instead of the first 15 bits as intended.
Add aapt extensions to dump badging to print more info about activities, receivers and services
Fix issue with checking end tags. Earlier some boolean variables were being set once a new
tag is detected at the same level which causes some incorrect values to be overwritten.
we should be doing this when we detect the end tag.
Daniel Sandler [Fri, 14 Aug 2009 20:47:30 +0000 (13:47 -0700)]
aapt now attempts to process all assets even if some are malformed.
Previously aapt would bail out on the first broken image, making it difficult to compile a comprehensive list of broken images. Now it will pre- and post-process all of them and report any and all errors (before exiting with an error code if any errors were encountered).