History log of /frameworks/base/tools/aapt/ResourceTable.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
99d36ee8a936d5f9d95305183241ed597bace8e8 18-Apr-2017 Adam Lesinski <adamlesinski@google.com> AAPT: Auto-alias application adaptive-icon

When a developer specifies an adaptive application icon,
and a non-adaptive round application icon, create an alias
from the round icon to the regular icon for v26 APIs and up.

We do this because certain devices prefer android:roundIcon over
android:icon regardless of the API levels of the drawables set for
either.

This auto-aliasing behaviour allows an app to prefer the
android:roundIcon on API 25 devices, and prefer the adaptive icon on
API 26 devices.

An app developer can override this behaviour by explicitly setting the
android:roundIcon to a drawable that has a v26 qualifier.

Bug: 34829129
Test: manual
Change-Id: Iaaaa5d8367e4f3f9e9f2e3b51c782d3be6a3bb71
/frameworks/base/tools/aapt/ResourceTable.h
cf1f1d9128853f0fa0cef657e2bbb7bf6904c732 17-Mar-2017 Adam Lesinski <adamlesinski@google.com> AAPT: Version <adaptive-icon> to v26

Bug: 35908647
Test: manual
Change-Id: Ic8f43efe34385192fbab18675eb5898ed80912a5
/frameworks/base/tools/aapt/ResourceTable.h
8c2df71739808d6f1aec4277fb47c191e7031164 21-Mar-2017 Guang Zhu <guangzhu@google.com> Revert "AAPT: Version <adaptive-icon> to v26"

Bug: 36462965
Bug: 35908647

This reverts commit c7614e5d1e8f9139cccf6ab9b78dda16b98f7656.

Change-Id: I25279e7c53823dad0703c7e2ea8ff91bdbc1a0f2
/frameworks/base/tools/aapt/ResourceTable.h
c7614e5d1e8f9139cccf6ab9b78dda16b98f7656 17-Mar-2017 Adam Lesinski <adamlesinski@google.com> AAPT: Version <adaptive-icon> to v26

Bug: 35908647
Change-Id: I307fb2f666cb8519adb9a7f676b87706dc6c683f
Test: manual
/frameworks/base/tools/aapt/ResourceTable.h
afc79be228596c56ea68c0d2fa22d0a8d733be47 22-Feb-2016 Adam Lesinski <adamlesinski@google.com> AAPT: Allow duplicate attribute definitions if identical

This allows libraries to coexist a bit easier, since a lot of them
declare the same attribute. When used together they cause errors.
Bug:27101533

Change-Id: I649cf17bc587c4814f849d5ac522daf74495adcf
/frameworks/base/tools/aapt/ResourceTable.h
525db2489d8bb1204225e697171d3f18b6fc9695 26-Feb-2016 Adam Lesinski <adamlesinski@google.com> Revert "AAPT: Allow duplicate attribute definitions if identical"

This reverts commit c25283b5e206ceae2aa6eb01877b79c3c1f0adfb.

Change-Id: I2f42a4360fa53c4333494afe0178dcec56d62d8e
/frameworks/base/tools/aapt/ResourceTable.h
c25283b5e206ceae2aa6eb01877b79c3c1f0adfb 22-Feb-2016 Adam Lesinski <adamlesinski@google.com> AAPT: Allow duplicate attribute definitions if identical

This allows libraries to coexist a bit easier, since a lot of them
declare the same attribute. When used together they cause errors.
Bug:27101533

Change-Id: I10327251636392e810637a79e7c9aa514f3f07a6
/frameworks/base/tools/aapt/ResourceTable.h
07dfd2d8642f8a3630ca6429f740865a0c0bfdf7 28-Oct-2015 Adam Lesinski <adamlesinski@google.com> Implement AAPT Bundle format

AAPT will scan XML files looking for the <aapt:attr> XML tag.

<!-- @layout/bundle.xml -->
<ImageView xmlns:aapt="http://schemas.android.com/aapt">
<aapt:attr name="android:src">
<vector android:pathData="..." ...>
</vector>
</aapt:attr>
</ImageView>

The SINGLE child element of the <aapt:attr> tag is extracted into its own top
level resource. It is given a generated name.

The parent element of <aapt:attr> is then given the resource attribute that was assigned
to the `name' attribute. The value is set to a reference to the generated resource.

<!-- @layout/bundle.xml -->
<ImageView android:src="@drawable/bundle_1.xml">
</ImageView>

<!-- @layout/bundle_1.xml -->
<vector android:pathData="..." ...>
</vector>

Bug:22627686
Change-Id: I8575fc4f739011402662fbf6b3db96df0012f598
/frameworks/base/tools/aapt/ResourceTable.h
5b9847ca3fbcd0bb2528dd2b4c0b789e2d501684 30-Nov-2015 Adam Lesinski <adamlesinski@google.com> Revert "Implement AAPT Bundle format"

This reverts commit 9d0f7d44d5cc5322415f52f7ce03cc37a478b350.

Caused a build breakage when parsing some attributes.

Change-Id: I89ca958b2f2e820d353648df8aadd90bbe8d8339
/frameworks/base/tools/aapt/ResourceTable.h
9d0f7d44d5cc5322415f52f7ce03cc37a478b350 28-Oct-2015 Adam Lesinski <adamlesinski@google.com> Implement AAPT Bundle format

AAPT will scan XML files looking for the <aapt:attr> XML tag.

<!-- @layout/bundle.xml -->
<ImageView xmlns:aapt="http://schemas.android.com/aapt">
<aapt:attr name="android:src">
<vector android:pathData="..." ...>
</vector>
</aapt:attr>
</ImageView>

The SINGLE child element of the <aapt:attr> tag is extracted into its own top
level resource. It is given a generated name.

The parent element of <aapt:attr> is then given the resource attribute that was assigned
to the `name' attribute. The value is set to a reference to the generated resource.

<!-- @layout/bundle.xml -->
<ImageView android:src="@drawable/bundle_1.xml">
</ImageView>

<!-- @layout/bundle_1.xml -->
<vector android:pathData="..." ...>
</vector>

Bug:22627686
Change-Id: I31bc96aae30d38bfd0b16508d0f585de5fd88a07
/frameworks/base/tools/aapt/ResourceTable.h
beb9e33bfb79847c25aac98e39f3ea620a953ef7 14-Aug-2015 Adam Lesinski <adamlesinski@google.com> AAPT: Fix regression in resource versioning

With a set of resources with the following configurations:

()
(land)

the regression caused any resources that needed to be versioned in configuration () to be lost.

Bug:23038206
Change-Id: I2f1b0313fb780ac241e7aaa487cb37dfb79c36aa
/frameworks/base/tools/aapt/ResourceTable.h
5892248580859620db90d5ef2e3c2f48531933fa 02-Jun-2015 Adrian Roos <roosa@google.com> aapt: add option for stricter symbol generation

Adds an option that prevents generating java symbols for string
resources that don't have a default localization.

Bug: 21537397
Change-Id: Ifafa942b24d5cdbed93651cde363e859be13d395
/frameworks/base/tools/aapt/ResourceTable.h
f8d6a4ba8739e16e13ae0014efa099ec564939a7 06-Mar-2015 Dan Albert <danalbert@google.com> resolved conflicts for merge of 701f9c2f to stage-aosp-master

Change-Id: I42e0411c0acef4b15137491ecaaed95d9b1cd0c1
030f536009b56dbcc23d284541e51562bd9a6ed3 04-Mar-2015 Dan Albert <danalbert@google.com> Stop using namespace std.

The pattern of #include and using namespace std here fails to build
with GCC. At first glance it's a GCC bug rather than libc++ doing
something wrong. Regardless, it can be worked around by just
specifying std:: where appropriate.

Bug: 19606303
Change-Id: I5652682eae7ca7559cf2a9307909859013440781
/frameworks/base/tools/aapt/ResourceTable.h
28994d8d181c286b39811441ce78399576c2d315 13-Jan-2015 Adam Lesinski <adamlesinski@google.com> AAPT: Handle all old unversioned attribute usage

All references to attributes defined in pre-LOLLIPOP_MR1 SDK
are moved to version qualified resource entries.

Bug:18221682
Change-Id: Ifd739530ebcf99e6bc7ddb3f10bc5e05f0726e62
/frameworks/base/tools/aapt/ResourceTable.h
9b624c186cb6059dfb3ec24bfb6386a0fc17b88c 20-Nov-2014 Adam Lesinski <adamlesinski@google.com> AAPT: Move private attrs to new type for framework

Private attributes are typically placed after public
attributes in the resource table. Each time a new version
of the Android framework is released, new public attributes
take the place of the private attributes, and the private
attributes are shifted after the new public ones.

This means that any apps built against the newer SDK
may inadvertently be using private attributes on older
devices.

This change moves all private attributes to a completely
different type ID, so there will never be collisions across
versions.

These private attributes are automatically moved to a synthesized
type only for the system resources.

Bug:18263655

Change-Id: I7a850512953fadcc9f3524d509cea30249782db8
/frameworks/base/tools/aapt/ResourceTable.h
de7de47fef1dcaa26d553665d89e4d3792325c3f 03-Nov-2014 Adam Lesinski <adamlesinski@google.com> Add error checking to aapt for split generation

Change-Id: Ica627db6a671f6a6c35f98bfd9c03598ffe103ce
/frameworks/base/tools/aapt/ResourceTable.h
978ab9d92934b79409638cf220de3002fea8d505 25-Sep-2014 Adam Lesinski <adamlesinski@google.com> AAPT: Fix issue with synthesized resource not actually showing up

AAPT keeps around a few pieces of state that are disjoint, so
simply adding to a collection won't add the resource to the final
flattened output. Instead, we create the resource from the top
and then copy over the values into the newly created resource.

Bug:17647890
Change-Id: I214263e84c18f9370c6e6a5aa53aa2d833fc842d
/frameworks/base/tools/aapt/ResourceTable.h
e572c011feabf6319ba836cf5bc4c3baa0ba6a85 20-Sep-2014 Adam Lesinski <adamlesinski@google.com> AAPT: Continuation of public/private attribute fix

XML files like layouts are now scanned and checked
for v21 attributes. If those kinds of attributes
are found, then we remove them in the original
version and synthesize a new xml file under the
v21 configuration.

Bug:17520380
Change-Id: Icf984cb96134180a2e35349c1dbf2cef9a8f0bda
/frameworks/base/tools/aapt/ResourceTable.h
82a2dd8efe48d3a4e04655f01329da857ace4b7d 18-Sep-2014 Adam Lesinski <adamlesinski@google.com> Fix backwards compat problem with AAPT public attrs

AAPT has traditionally assigned resource IDs to public attributes,
and then followed those public definitions with private attributes.

--- PUBLIC ---
| 0x01010234 | attr/color
| 0x01010235 | attr/background

--- PRIVATE ---
| 0x01010236 | attr/secret
| 0x01010237 | attr/shhh

Each release, when attributes are added, they take the place of the private
attributes and the private attributes are shifted down again.

--- PUBLIC ---
| 0x01010234 | attr/color
| 0x01010235 | attr/background
| 0x01010236 | attr/shinyNewAttr
| 0x01010237 | attr/highlyValuedFeature

--- PRIVATE ---
| 0x01010238 | attr/secret
| 0x01010239 | attr/shhh

Platform code may look for private attributes set in a theme. If an app
compiled against a newer version of the platform uses a new public
attribute that happens to have the same ID as the private attribute
the older platform is expecting, then the behavior is undefined.

We get around this by detecting any newly defined attributes (in L),
copy the resource into a -v21 qualified resource, and delete the
attribute from the original resource. This ensures that older platforms
don't see the new attribute, but when running on L+ platforms, the
attribute will be respected.

We still need to address this problem in the platform moving forward,
as this will only help us in the transition from pre L to L.

Bug:17520380
Change-Id: Ia2a985798b50006c21c7c3431d30d9598f27cd91
/frameworks/base/tools/aapt/ResourceTable.h
27f69f4e06961fdecd1078b2292d764a157e5e1c 21-Aug-2014 Adam Lesinski <adamlesinski@google.com> AAPT: mipmaps should not end up in Splits

Mipmaps are never filtered, and so they will always
end up in the base APK. Make sure they get omitted from
any split.

Change-Id: Id24b082bc9bd2d3f031a58bd0de4d30b4f0de7e0
/frameworks/base/tools/aapt/ResourceTable.h
833f3ccbc8f4dd1ec8abb9121988b99ff34ec4c1 19-Jun-2014 Adam Lesinski <adamlesinski@google.com> AAPT support for feature splits

This change allows the developer to add a base package for
which to build a feature split. The generated resource types
will begin after the base APK's defined types so as not
to collide or override resources.

Multiple features can be generated by first choosing an
arbitrary order for the features. Then for each feature,
the base APK and any preceding features are specified
with the --feature-of flags.

So with a base APK 'A' and features, 'B', and 'C',
'B' would be built with

aapt package [...] --feature-of A [...]

and 'C' would be built with

aapt package [...] --feature-of A --feature-of B [...]

Change-Id: I1be66e3f8df9a737b21c71f8a93685376c7e6780
/frameworks/base/tools/aapt/ResourceTable.h
fab50875b98e8274ac8ee44b38ba42521bbbf1f9 16-Apr-2014 Adam Lesinski <adamlesinski@google.com> Add support for building split APKs

Build multiple APKs, each containing a disjoint subset
of configurations. These can then be loaded into the device
AssetManager and should operate as if they were never split.

Use the idea of building multiple sets of files, where each
set represents an APK. An ApkBuilder can place files
in a set based on its configuration, but you can actually
add directly to a set, in the case of the resources.arsc and
generated AndroidManifest.xml for splits.

Change-Id: Ic65d3f0ac1bbd290185695b9971d425c85ab1de3
/frameworks/base/tools/aapt/ResourceTable.h
de898ff42912bd7ca1bfb099cd439562496765a4 30-Jan-2014 Adam Lesinski <adamlesinski@google.com> Shared library resource support

Shared libraries can now export resources for applications
to use.

Exporting resources works the same way the framework exports
resources, by defining the public symbols in res/values/public.xml.

Building a shared library requires aapt to be invoked with the
--shared-lib option. Shared libraries will be assigned a package
ID of 0x00 at build-time. At runtime, all loaded shared libraries
will be assigned a new package ID.

Currently, shared libraries should not import other shared libraries,
as those dependencies will not be loaded at runtime.

At runtime, reflection is used to update the package ID of resource
symbols in the shared library's R class file. The package name of
the R class file is assumed to be the same as the shared library's
package name declared in its manifest. This will be customizable in
a future commit.

See /tests/SharedLibrary/ for examples of a shared library and its
client.

Bug:12724178
Change-Id: I60c0cb8ab87849f8f8a1a13431562fe8603020a7
/frameworks/base/tools/aapt/ResourceTable.h
a01a9374fd386f3a8773528d7a49bc5315492dff 21-Mar-2014 Adam Lesinski <adamlesinski@google.com> Reduce warning verbosity in aapt

- Attributed source of problems to the correct file.
- Only verify string localizations against valid
locales.
Bug:13140015
Change-Id: I9dabc5efa0510649caee8af0c8ebb803d6f48269
/frameworks/base/tools/aapt/ResourceTable.h
282e181b58cf72b6ca770dc7ca5f91f135444502 24-Jan-2014 Adam Lesinski <adamlesinski@google.com> Revert "Move frameworks/base/tools/ to frameworks/tools/"

This reverts commit 9f6a119c8aa276432ece4fe2118bd8a3c9b1067e.
/frameworks/base/tools/aapt/ResourceTable.h
9f6a119c8aa276432ece4fe2118bd8a3c9b1067e 28-Aug-2013 Mike Lockwood <lockwood@google.com> Move frameworks/base/tools/ to frameworks/tools/

Change-Id: I3ffafdab27cc4aca256c3a5806b630795b75d5c8
/frameworks/base/tools/aapt/ResourceTable.h
6c997a9e880e08c354ffd809bd62df9e25e9c4d4 31-Jan-2012 Dianne Hackborn <hackbod@google.com> 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.

Change-Id: I1da037b3e2c377b890833ff57ab158965314ac48
/frameworks/base/tools/aapt/ResourceTable.h
e6b680364dd992907a8d2037685a2e500d188dfb 14-Oct-2011 Dianne Hackborn <hackbod@google.com> New aapt feature to do smarter filtering of configurations.

This adds a --preferred-configurations flag that specifies the
specific configurations you would like to have.

It is smarter than "-c" because it will avoid stripping a
configuration if that would result in there being no value
for the resource.

It is dumber than "-c" because it can't process as many kinds
of resources. It is really only intended for bitmaps and use
with density configs.

This required re-arranging AaptAssets to group files together
by config again, like they used to be. I think this hasn't
broken anything. Hopefully.

Change-Id: I4e9d12ff6e6dbd1abb8fd4cb1814c6674b19d0e5
/frameworks/base/tools/aapt/ResourceTable.h
914f7e683a01f15f8830810c49eaecc31bc554a6 28-Sep-2011 Eric Fischer <enf@google.com> 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.

Bug 5372711

Change-Id: I52975570b75e0f11827dc6bcf1cb4a987d0541aa
/frameworks/base/tools/aapt/ResourceTable.h
426431adcc220b6adfbe1d9530247f897e60fa36 09-Jun-2011 Dianne Hackborn <hackbod@google.com> Enforce public resource restriction on bag parents.

Need to put some more styles in the SDK to avoid breaking apps.

Also, welcome Android 3.2.

Change-Id: Ia31d07c9b1b91ad868d8630437fdc1b5ae24f37d
/frameworks/base/tools/aapt/ResourceTable.h
7c71023b7f5aafac09bd2f0425fccb5fe2d22b27 23-Nov-2010 Kenny Root <kroot@google.com> Add knowledge of mipmap to aapt

New mipmap drawable type that does not get filtered according to
configuration. Useful for things that get built as part of the system.

Change-Id: I556033d065e504079271dce79c23c90d3c387ce4
/frameworks/base/tools/aapt/ResourceTable.h
774562275fa76681933a0105ed61c672892b23bd 10-Mar-2010 Kenny Root <kroot@google.com> Revert "Dedupe resource config pointers"

This reverts commit 7b467d8b44c00d14590c021928b6a9ad5a36348e.
/frameworks/base/tools/aapt/ResourceTable.h
7b467d8b44c00d14590c021928b6a9ad5a36348e 10-Mar-2010 Kenny Root <kroot@google.com> 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.

Change-Id: I4d619942d35ddb477e2eabe4437b7f02697c24de
/frameworks/base/tools/aapt/ResourceTable.h
cf244ada58539ce857ec041d7288d0271204fbb6 10-Mar-2010 Dianne Hackborn <hackbod@google.com> 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).

Change-Id: I4da02f6a5196cb6a7dbcff9ac25403904c42c2c8
/frameworks/base/tools/aapt/ResourceTable.h
99080c7d9ad9e5ccfec70dd10e4c24468a960c45 05-Feb-2010 Xavier Ducrohet <xav@android.com> Add --auto-add-overlay option to aapt.

This option allows resources only present in overlays to be
added automatically instead of being declared through <add-resource>

Change-Id: Iff782311056f6a045193e57d204f7d3413e11b26
/frameworks/base/tools/aapt/ResourceTable.h
19138468caf7050d482dc15f35a344eab11bb756 04-Dec-2009 Kenny Root <kroot@google.com> 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.

Change-Id: I129483f8b3d3b1c5869dced05cb525e494a6c83a
/frameworks/base/tools/aapt/ResourceTable.h
58c27a0a03f573791935116fa35f6a7c8bf93896 13-Aug-2009 Dianne Hackborn <hackbod@google.com> Allow overlays to add resources.
/frameworks/base/tools/aapt/ResourceTable.h
f878e2d80c3a0afefe3b018d232df6066379e1d5 09-Jun-2009 Robert Greenwalt <robdroid@android.com> Make aapt Error out when an overlay adds a string.

Final added check (I think) for 1585775 - not letting overlays add
resources.

modified: ResourceTable.cpp
modified: ResourceTable.h
/frameworks/base/tools/aapt/ResourceTable.h
1aa8170e6a448afad86e5d62927d3b8ca4cd9707 06-Jun-2009 Robert Greenwalt <robdroid@android.com> Add per-named-item overlay ability in res xml.

Fixes 1899451.
Also errors out if you add a bag via an overlay (which would renumber
resources). Note that you can still add elements within the bag as they are
not issued resource IDs. So for example you can now modify the framework
themes.xml file without copying the entire file.

All bag types are now modifable except non-named bag types (how would you
address which element to replace?):
array
string_array
integer_array
/frameworks/base/tools/aapt/ResourceTable.h
a96cbb435d7b2197ab2b61fd98d14cbd6e0c5c3d 14-May-2009 Dianne Hackborn <hackbod@google.com> Implement compatibility support for WRITE_SDCARD permission.

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.
/frameworks/base/tools/aapt/ResourceTable.h
4b4f4a908895bc0ba63f929bfdc02eec22c0f6e5 03-Apr-2009 Robert Greenwalt <> AI 144342: Fix bag (string-array,etc) behavior with overlays.
We used to replace elements in the default with elements from
the overlay. This change causes us to empty the array first
so if the overlay array is smaller we don't end up with elements
from the default array showing through at the end of the array.
Ex: [A,B,C] and overlay [D] should give [D] but used to give
[D,B,C].
BUG=1754390

Automated import of CL 144342
/frameworks/base/tools/aapt/ResourceTable.h
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/tools/aapt/ResourceTable.h
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/tools/aapt/ResourceTable.h
9266c558bf1d21ff647525ff99f7dadbca417309 16-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@126645
/frameworks/base/tools/aapt/ResourceTable.h
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/tools/aapt/ResourceTable.h
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/tools/aapt/ResourceTable.h