Add knowledge about <fragment class="..."> for layout files
and update to reflect the change of the header tag from Header.
Change-Id: I91e2a5f204a8e222367985383c1721030c7954d8
- Fixes casting problems with stricter compilers
- Adds a couple of missing ifdef guards
This is a first step toward being able to generate APKs on the fly on the device.
Bug: 2766918
Change-Id: Icaaee5a4032afa313256add321b447443861dd85
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
Change-Id: I15e8161e094f17412680d25d3b7b810474eb4a31
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.
Change-Id: Ia81f6b21047043ebb711eb24c2c3718534979ef6
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).
Change-Id: I4da02f6a5196cb6a7dbcff9ac25403904c42c2c8
If an overlay has a type of resources that's not defined in
the main res pool, then aapt would crash.
This dynamically create new ResourceTypeSet when needed
when processing the overlays
Change-Id: I67bc3622281bde73cf42f37a0983798d3f658ce2
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.
Fix bug where applications defining a minSdkVersion were experiencing
transient errors from memory corruption in aapt.
Change-Id: I839d5eda7388baac6133e735fa59f9799ca2822d
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.
Change-Id: I8f45d47ea886915da6a4770f6e111e6085d61bee
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:
IActivityManager am = ActivityManagerNative.getDefault();
Configuration config = am.getConfiguration();
config.uiMode = Configuration.UI_MODE_TYPE_CAR | Configuration.UI_MODE_NIGHT_ANY;
am.updateConfiguration(config);
To allow users to disable the car mode and set the night mode the IUiModeManager
interface is used.
The automatic night mode switching will be added in a separate change.
It allows you to force override the manifest
package listed in the AndroidManifest.xml when
creating an APK file.
Change-Id: I7eac7943c4e56610b65728ae54773a273634fd9d
Merge commit '3c05f1fbac2ce35483f61dbd5d5bfb6341da6d9c'
* commit '3c05f1fbac2ce35483f61dbd5d5bfb6341da6d9c':
Add instrumentation as a source tag for proguard keep options.
Merge commit 'b4f41119044e5ec7f7b76ed4ac02b5cfbaeb474d'
* commit 'b4f41119044e5ec7f7b76ed4ac02b5cfbaeb474d':
Only output proguard keep for nonempty attribute name in the AndroidManifest.xml.
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.
Change-Id: If5d1ee5e48fbaf31798816b068ac44b14a93121b
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.
Change-Id: I129483f8b3d3b1c5869dced05cb525e494a6c83a
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.
bug: 2090015
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).
Bug: 2055485
Merge commit 'fa5c7e1dfede7e26260789dd2de5175497e9659b'
* commit 'fa5c7e1dfede7e26260789dd2de5175497e9659b':
Catch when a file resource (non values) added in an overlay.
File resources are assigned resource id's and if an overlay adds one
it renumbers things and breaks compatability. Used to segfault
if you tried before, but now catches it and lets you know what file
caused the problem.
Now old applications will automatically be granted it. Also renamed it from
SDCARD_WRITE to WRITE_SDCARD to be consistent with our other permissions,
and re-arranged how we do targetSdkVersion to actually be usuable for this
kind of stuff.
Note that right now this results in basically all apps being given the
WRITE_SDCARD permission, because their targetSdkVersion is not set. I will
be dealing with that in a future change.
Now old applications will automatically be granted it. Also renamed it from
SDCARD_WRITE to WRITE_SDCARD to be consistent with our other permissions,
and re-arranged how we do targetSdkVersion to actually be usuable for this
kind of stuff.
Note that right now this results in basically all apps being given the
WRITE_SDCARD permission, because their targetSdkVersion is not set. I will
be dealing with that in a future change.