History log of /frameworks/base/tools/aapt/ResourceTable.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
0a3a474e46e41803fb7dd18d5653ce052916e5ca 14-Oct-2017 ztenghui <ztenghui@google.com> AAPT leave <gradient> alone for VDC

bug: 62421666
Test: Tested with changes for Gradient of VDC.

Change-Id: I07b39721aeaaafd888416a0f71f6cbd5fce97732
(cherry picked from commit ab2a38c03d54fad1ed0873ac091959ee38823cd6)
(cherry picked from commit f49cce3aa6f625cfc7288886c044992e1580dbbc)
/frameworks/base/tools/aapt/ResourceTable.cpp
54b58ba5cc2c341b39355e265f760fe0654f77a7 15-Apr-2017 Adam Lesinski <adamlesinski@google.com> Fix issue with unresolved IDs in adaptive icons

Adaptive icons were versioned correctly, but skipped the compilation
/ resource ID assignment phase. This CL fixes the glitch.

Bug: 34829129
Test: manual
Change-Id: I93739a8b10fac53a048d95b330edf381684a807c
/frameworks/base/tools/aapt/ResourceTable.cpp
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.cpp
205548561c67a3c05163d17057a1fc76a338ec15 22-Mar-2017 ztenghui <ztenghui@google.com> disable versioning for objectAnimator to support path motion

bug:33527757

Test: replace the AAPT in local SDK, and make sure the propertyX/YName
still works within ObjectAnimator.

Change-Id: Ic9bb14cd228dcf7e4d250bd0f6cb5f0c31a14183
/frameworks/base/tools/aapt/ResourceTable.cpp
010df88f90a40f8c521ccde8d6a541e70a044fb7 08-Mar-2017 ztenghui <ztenghui@google.com> Disable versioning for pathInterpolator when no-version-vectors is on.

Test: manually build demo app for support lib, and works!
bug:33527757

Change-Id: I3badea18b2eb8cddea94f7e44f9129bb55ed9649
/frameworks/base/tools/aapt/ResourceTable.cpp
af463961bc44c53fe35fe184a93b55d07273a676 08-Feb-2017 Adam Lesinski <adamlesinski@google.com> Merge "AAPT: Fix --feature-of to allow non-public symbol visibility"
fa1e9d7ad0e3f5b7fce37dbdc3f5ad889274ee43 25-Jan-2017 Adam Lesinski <adamlesinski@google.com> AAPT: Fix --feature-of to allow non-public symbol visibility

Test: manual
Change-Id: Iada18b201c6463011002f96285a64c64565a6e1c
/frameworks/base/tools/aapt/ResourceTable.cpp
4d35cca96ce55eb29d1948086214f91ae94e9adb 18-Jan-2017 Yuichi Araki <yaraki@google.com> AAPT: Add --no-version-transitions flag

Add a new flag to disable versioning of Transition related XMLs.
Transition support library will use this to handle these XMLs on older
API levels.

Test: make libaapt_tests AaptTestAppOne
Bug: 34427868
Change-Id: I66e81cca049e71ef6704177b2ca21c9cdeaff78f
/frameworks/base/tools/aapt/ResourceTable.cpp
081d1b4cf602fdd7302b597e6bf902cb415bc3a8 16-Aug-2016 Adam Lesinski <adamlesinski@google.com> AAPT: Handle gaps in resources when building splits

Due to public ID assignment, gaps in resource type and entry
IDs can occur. This can lead to null pointer dereferencing
if not careful. This happened in ResourceTable::getDensityVaryingResources()
which is called when building Splits.

Bug:30879690
Change-Id: I588e4dcd2e042fccfcb2e87967b5cbd0d23b4497
/frameworks/base/tools/aapt/ResourceTable.cpp
9b8528fee4eed35b8e887ded0851d08eb2b10db6 10-Aug-2016 Chih-Hung Hsieh <chh@google.com> Fix clang-tidy warnings in aapt and aapt2.

* Add explicit keyword to conversion constructors.
* Add NOLINT(implicit) comments for implicit conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
* Use const reference type to avoid unnecessary copy.
Bug: 30413862
Test: build with WITH_TIDY=1

Change-Id: Id6d21961f313a1ad92b15a37fdaa5be9e8ab48e1
/frameworks/base/tools/aapt/ResourceTable.cpp
4d219da3c43f12ff000e685ae069374b618b30fc 04-Aug-2016 Adam Lesinski <adamlesinski@google.com> AAPT: Fix feature split generation of ID resources

ID resources that get generated on demand with the
notation @+id/name were previously not given the
appropriate type ID offset when being built as feature
splits.

This change declares an ID type ahead of time so that
the type ID offset is applied before IDs can be generated.

Bug:30607637
Change-Id: I122a9133cb01b35e9892103ec52fc228dc65bf1a
/frameworks/base/tools/aapt/ResourceTable.cpp
526d73be4a3a2714fa6112769e16fb6cd0194451 19-Jul-2016 Adam Lesinski <adamlesinski@google.com> AAPT: Don't keep processing files that failed to be added

AAPT will continue ahead without reporting an error if a file
failed to be added to the ResourceTable. This would cause crashes
later when the file was assumed to be present.

Bug:30200166
Change-Id: Ieb2daf97ccf0345153b6f4598d130a38d108c937
/frameworks/base/tools/aapt/ResourceTable.cpp
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.cpp
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.cpp
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.cpp
78713998f94a2cc2562aa0ae7761bbc563d8eafa 07-Dec-2015 Adam Lesinski <adamlesinski@google.com> Specify private resource package in Android.mk

Private resource package shouldn't be buried in some resource file.
It can now be specified on the command line via the Android.mk file.

Change-Id: I9e3cb0bf54830d6b021077af271913306c024701
/frameworks/base/tools/aapt/ResourceTable.cpp
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.cpp
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.cpp
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.cpp
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.cpp
f45d2fad2ecd3cb3c4aeee3014763e01b59eab09 28-Jul-2015 Adam Lesinski <adamlesinski@google.com> AAPT: Fix resource versioning

Resource generation was greedy, so when an attribute with sdk level 21 was used in a resource
with v1, and a different attribute with sdk level 21 was used in a resource with v11,
a v21 resource would be synthesized, but it would contain the attribute from v1 instead of v11.

This change fixes the issue, having the higher versioned resource take precedence.

Bug:22793816
Change-Id: Ia687f56b0d9969e424111477d55d9804255b22e9
/frameworks/base/tools/aapt/ResourceTable.cpp
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.cpp
6e46056abc1c2803ed7f195bab169bbb1cacec6b 21-Apr-2015 Adam Lesinski <adamlesinski@google.com> AAPT: Add flag to disable versioning of vector related XML

AAPT automatically versions XML files according to the SDK level
in which their attributes were introduced. Support libraries
know how to handle resources built against newer SDKs, so offer
the option to disable some of the automatic versioning, namely
vectors.

Bug:19336994
Change-Id: I9f9d0ae8f2a0c28404f82e27de416f80e38493c9
/frameworks/base/tools/aapt/ResourceTable.cpp
1be312dfb02e86731da6ac54a39956db791f4978 09-Apr-2015 Colin Cross <ccross@android.com> Merge "Re-enable -Wall and -Werror that were lost in a merge"
01f185633c1c12017731336e7f926fe398c69781 09-Apr-2015 Colin Cross <ccross@android.com> Re-enable -Wall and -Werror that were lost in a merge

-Wall and -Werror were lost during a merge when they were added to
aaptCFLAGS instead of aaptCFlags. Fix the typo, and the warnings
that crept in while it was disabled.

Change-Id: Ib944b8d6149278e4f3861c1acac277bcd95cc7c2
/frameworks/base/tools/aapt/ResourceTable.cpp
b12f2410c7bdbf90bd8a77b897846ee2763e3037 03-Apr-2015 Elliott Hughes <enh@google.com> Only Windows doesn't have %zd.

Change-Id: I0e4b0fdc61641c5ecb724fd096bd2315dcf8ed4a
/frameworks/base/tools/aapt/ResourceTable.cpp
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.cpp
5c61dfc25fed75a436dc32b0fb18854bde0c4cea 14-Jan-2015 Adam Lesinski <adamlesinski@google.com> am e488ce86: am 94e30215: Merge "AAPT: Handle all old unversioned attribute usage" into lmp-mr1-dev

* commit 'e488ce8668538b45c586eba21f5bca288d749686':
AAPT: Handle all old unversioned attribute usage
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.cpp
22bfb75ebb949ff05d34ad22fbcc888582aaaaa4 16-Dec-2014 Adam Lesinski <adamlesinski@google.com> am 0f0e85a6: Merge "AAPT: attributes showing up after v21 attributes would be removed for pre-21 devices" into lmp-mr1-dev
automerge: 465d123

* commit '465d123464eadf180b618164b2ed23702bca3d86':
AAPT: attributes showing up after v21 attributes would be removed for pre-21 devices
ea4e5ecc27793b5c1dd2eda291f752b3f900ee6c 11-Dec-2014 Adam Lesinski <adamlesinski@google.com> AAPT: attributes showing up after v21 attributes would be removed for pre-21 devices

There was an inconsistency in the indexing when removing attributes
in layouts. Now we account for that shift that happens when you delete
an attribute.

Bug:18707321
Change-Id: I656eee3fb614168fa8ceeff379e8594708961dad
/frameworks/base/tools/aapt/ResourceTable.cpp
e97908d32ee8ea80138d085260a0eac93841c722 05-Dec-2014 Adam Lesinski <adamlesinski@google.com> Merge commit '0953ab27' into manualmerge

Change-Id: I36dea45f7571096136ea7bda5e2680bd85a0df32
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.cpp
d660e05c84c7412336ca5510ff9514357e9ba074 11-Nov-2014 Adam Lesinski <adamlesinski@google.com> am 8aa93764: Merge "Fixing NULL pointer access causing segmentation fault in aapt"

* commit '8aa93764ea025b1c20f96b366ae6efb17e4f2d67':
Fixing NULL pointer access causing segmentation fault in aapt
4d29c6693090cb9a0be209f9cfd0aef307fe52ed 10-Nov-2014 Adam Lesinski <adamlesinski@google.com> Merge commit 'fa31eb2c' into manualmerge

Conflicts:
tools/split-select/RuleGenerator_test.cpp

Change-Id: I0d1261301d433f32e857cf1b0d75a861205f7625
da44fe0e1f7c177cd65b7c5c80b35ec8fb3bc1c2 24-Mar-2011 Jörgen Ekström <jorgen.ekstrom@sonyericsson.com> Fixing NULL pointer access causing segmentation fault in aapt

In cases where resource packages are generated which does
not have public resources for all resource types - NULL
pointers sneaks into the mOrderedConfigs vector causing
the aapt tool to crash. The solution in this fix simply
ignores the NULL elements when later processing the sorted
vector.

The NULL elements are inserted during applyPublicEntryOrder
function call

Change-Id: I8b7135932e2d235018da2e2f7e09f0d22f1b2f59
/frameworks/base/tools/aapt/ResourceTable.cpp
dcdfe9fef4b07ee53d312c3fbecc74cb215ace6f 06-Nov-2014 Adam Lesinski <adamlesinski@google.com> split-select: Fix rules generated for anydpi density

Change-Id: I9de569ca9a76eb22df4d0e178df847ba1c7d0b01
/frameworks/base/tools/aapt/ResourceTable.cpp
685d363d7a3e8833edc9368a3c59b69755e0ba29 05-Nov-2014 Adam Lesinski <adamlesinski@google.com> Merge commit 'fb96e54' into manualmerge

Conflicts:
tools/aapt/Resource.cpp

Change-Id: I4147c3550e9426f3429146eaeb16f10ba76b5b15
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.cpp
4bf58108d442b37ab4adf5ce3a4ecd63472ce254 03-Nov-2014 Adam Lesinski <adamlesinski@google.com> Fix issues that will be present in C++11

- char16_t is a distinct type, so stay consistent
with it throughout the code base.
- char16_t is defined as minimum size of 16 bits.
Since we mmap and cast data structures onto raw memory,
we need a precise definition (uint16_t), so we cast between
that (and static_assert that they are the same size).

Change-Id: I869c32637543bbcfb39d2643e7d9df10d33acd3c
/frameworks/base/tools/aapt/ResourceTable.cpp
217b17a915849ac50f01f9097e0e35e2b21e6235 20-Oct-2014 Adam Lesinski <adamlesinski@google.com> am d3969d92: am 6dfe03ae: am 73a8c596: am 3f8c7dec: Merge "AAPT: Fix path for final generated resources on Windows" into lmp-dev

* commit 'd3969d927eef2f04ec097244c5f2bff5e7c0689e':
AAPT: Fix path for final generated resources on Windows
3986e52cf994ea7960dabffb8d6015e400ce3b63 20-Oct-2014 Adam Lesinski <adamlesinski@google.com> am 3f8c7dec: Merge "AAPT: Fix path for final generated resources on Windows" into lmp-dev

* commit '3f8c7dec6b3fd4ac7fc99fe4e41cd0fa1b97bcad':
AAPT: Fix path for final generated resources on Windows
aff7c2447df1ddfe094628317b6d22121cd657f8 20-Oct-2014 Adam Lesinski <adamlesinski@google.com> AAPT: Fix path for final generated resources on Windows

Change-Id: Id11ac79b281b51747c73f90406ebd60023c54f92
/frameworks/base/tools/aapt/ResourceTable.cpp
5787920f5bbac1c7cf296b5c042daf0108dbdacc 04-Oct-2014 Adam Lesinski <adamlesinski@google.com> am 85035d90: am b2b166a5: am 397001b2: am a80aba70: Merge "AAPT: Gate v21 resource synthesizing logging behind -v flag" into lmp-dev

* commit '85035d90257beedd54641385674ce2dfb29ae241':
AAPT: Gate v21 resource synthesizing logging behind -v flag
865acc74395a56287ab7bec58947327b5790aa70 04-Oct-2014 Adam Lesinski <adamlesinski@google.com> am a80aba70: Merge "AAPT: Gate v21 resource synthesizing logging behind -v flag" into lmp-dev

* commit 'a80aba70728c2843df94474dbd7829dadb77855f':
AAPT: Gate v21 resource synthesizing logging behind -v flag
f15de2e2151ae48338afd27f3ebd33fce5009103 03-Oct-2014 Adam Lesinski <adamlesinski@google.com> AAPT: Gate v21 resource synthesizing logging behind -v flag

This is verbose information and should be hidden behind the -v flag.

Bug:17822471
Change-Id: I36e2c6beb54669a31cde73416427477a80ded8a6
/frameworks/base/tools/aapt/ResourceTable.cpp
8daabceb2efddebe2e7c0b2425ad9f8ef62c0a5c 02-Oct-2014 Andreas Gampe <agampe@google.com> resolved conflicts for merge of 1dcc75b2 to lmp-dev-plus-aosp

Change-Id: I8e1c6ee2025b6acd90803545fb95ab1b98560d92
87332a7109610d02ac7f5db6af99d3a11813d5c1 02-Oct-2014 Andreas Gampe <agampe@google.com> resolved conflicts for merge of 1dcc75b2 to lmp-mr1-dev-plus-aosp

Change-Id: I8f7cbd971beae3ab134195e612d705860665142f
2412f84064c26b643c722ce914a97c4ec7776c69 01-Oct-2014 Andreas Gampe <agampe@google.com> Frameworks/base: Fix AAPT warnings

Turn on -Wall -Werror. Fix warnings.

Change-Id: I287fb3c1e851c654479bcf9ea8c73bd354a6b2a1
/frameworks/base/tools/aapt/ResourceTable.cpp
61b8bfa5d303645d95a7bff52d19a3d6ec297bb8 26-Sep-2014 Adam Lesinski <adamlesinski@google.com> am a196e203: am 98e858b1: am 581dfee1: am 0a6c5ea4: Merge "AAPT: Fix issue with synthesized resource not actually showing up" into lmp-dev

* commit 'a196e203076cb810a21a702b41f6a1d82d029318':
AAPT: Fix issue with synthesized resource not actually showing up
86641af81dc7e7216ac035a7e78bc39ff1f1244d 26-Sep-2014 Adam Lesinski <adamlesinski@google.com> am 0a6c5ea4: Merge "AAPT: Fix issue with synthesized resource not actually showing up" into lmp-dev

* commit '0a6c5ea412bc1e49aa1e98a6a3fe268081883d4a':
AAPT: Fix issue with synthesized resource not actually showing up
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.cpp
dc03c9f292a93806a30a3a32009ff75ff8d419cc 22-Sep-2014 Adam Lesinski <adamlesinski@google.com> am d4e5b601: am 37e3df38: am 1aa4db07: am 81745c51: Merge "AAPT: Continuation of public/private attribute fix" into lmp-dev

* commit 'd4e5b601c7da5c662d8cf9c46177810fdeeed23f':
AAPT: Continuation of public/private attribute fix
94ea10844c2b1ab344a5bcb404a19fdf66434874 22-Sep-2014 Adam Lesinski <adamlesinski@google.com> am 36b5795f: am 81745c51: Merge "AAPT: Continuation of public/private attribute fix" into lmp-dev

* commit '36b5795fc9e9a2eed320a0d626bce44a8c231f6b':
AAPT: Continuation of public/private attribute fix
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.cpp
0fa7511db2ec1e2326938f92262d00f23876307e 19-Sep-2014 Adam Lesinski <adamlesinski@google.com> am 9ee3ba23: am e7e9ad6d: am 863b1a90: am 19f9d54f: Merge "Fix backwards compat problem with AAPT public attrs" into lmp-dev

* commit '9ee3ba23395bd1a13bbfd3fe523ee611a5ca001b':
Fix backwards compat problem with AAPT public attrs
8d2556f0de2786367babaafbf1c34b24926e48ca 19-Sep-2014 Adam Lesinski <adamlesinski@google.com> am 8bdb265f: am 19f9d54f: Merge "Fix backwards compat problem with AAPT public attrs" into lmp-dev

* commit '8bdb265f0a73bc6f2114ca70f141c214a23696c7':
Fix backwards compat problem with AAPT public attrs
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.cpp
017d1bdca7d41ceb1351fc73e50f543fb45618a2 10-Sep-2014 Adam Lesinski <adamlesinski@google.com> am 716c7279: am 799dc748: Merge "AAPT: Don\'t crash on illegal symbol name" into lmp-dev

* commit '716c7279854318eeabad39b7bb187aa69ad41c97':
AAPT: Don't crash on illegal symbol name
3fb8c9b50ef1873454acf3a4e7fd33ad182c03d7 10-Sep-2014 Adam Lesinski <adamlesinski@google.com> AAPT: Don't crash on illegal symbol name

We never checked the return value when adding a nested
symbol, which would be NULL if the symbol name was invalid.

External bug: https://code.google.com/p/android/issues/detail?id=75876

Change-Id: I5211f4d4b87897d52f2b6e5907113d31930bb92d
/frameworks/base/tools/aapt/ResourceTable.cpp
20ec4fa2294a91e5ff87839280904aba4a050cf6 09-Sep-2014 Dan Albert <danalbert@google.com> resolved conflicts for merge of 6c585756 to lmp-dev-plus-aosp

Change-Id: I5a25f2bac44ac5efcd7462af91005e09680a1d96
f348c15ecf78e9d58b8238ffcf1d78a279e3a862 09-Sep-2014 Dan Albert <danalbert@google.com> Use char16_t for char things.

When compiling in C++ mode, the compiler will complain about conversions
from uint16_t to char16_t. Be consistent in using char16_t for strings.

Change-Id: I052b6176ced635162920b31560052d9a64f92764
/frameworks/base/tools/aapt/ResourceTable.cpp
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.cpp
6022debdbcc4498736580640c6287b57872617a2 20-Aug-2014 Adam Lesinski <adamlesinski@google.com> AAPT: Fix regression generating dynamic ref table for shared libraries

AAPT stopped generating dynamic reference tables for shared libraries.

Change-Id: Ib0025811bdca1a4756eb21080dd6b6bb3fc1ca3d
/frameworks/base/tools/aapt/ResourceTable.cpp
43a0df04b0826ffb9e4589aac73b07b0c98abe8c 19-Aug-2014 Adam Lesinski <adamlesinski@google.com> Allow enum generated IDs to reuse existing IDs

Change-Id: Ida5dbbce1c4ecb0a4e57511555cec6448737be25
/frameworks/base/tools/aapt/ResourceTable.cpp
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.cpp
57079519f4610715e4c0668c641575d10f3d4461 29-Jul-2014 Adam Lesinski <adamlesinski@google.com> Fix large memory corruption in AAPT

When assigning a new string pool to a package, don't release the
reference to the old memory immediately, as the cleanup code that
is called after references the old memory.

Bug: 16155257
Change-Id: I3eaeb81191b71a282a0ef82856023f09707f1b17
/frameworks/base/tools/aapt/ResourceTable.cpp
f90f2f8dc36e7243b85e0b6a7fd5a590893c827e 06-Jun-2014 Adam Lesinski <adamlesinski@google.com> Support multiple resource tables with same package

In order to support APK split features, the resource
table needs to support loading multiple resource
tables with the same package but potentially new set
of type IDs.

This adds some complexity as the type ID space changes
from dense and ordered to potentially sparse.

A ByteBucketArray is used to store the type IDs in
a memory efficient way that allows for fast retrieval.

In addition, the IDMAP format has changed. We no longer
need random access to the type data, since we store the
types differently. However, random access to entries of
a given type is still required.

Change-Id: If6f5be680b405b368941d9c1f2b5d2ddca964160
/frameworks/base/tools/aapt/ResourceTable.cpp
f0009776203b4e5b705f575990d3fa466a10a1b3 12-May-2014 Adam Lesinski <adamlesinski@google.com> Merge "Add support for building split APKs"
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.cpp
f3e7945c79557cfd4d667caeacf69ee197508535 06-May-2014 Elliott Hughes <enh@google.com> am 86768034: am b593ad60: am f1f28d1d: Merge "Skip resource files for locales en-XA and ar-XB during packaging if pseudolocalization was done automatically. This prevents attemts to add same resource twice."

* commit '867680342e12af59a26756f30cf817a131724943':
Skip resource files for locales en-XA and ar-XB during packaging if pseudolocalization was done automatically. This prevents attemts to add same resource twice.
47843df11fe88b30abcac324173b6c15f16cc797 02-May-2014 Igor Viarheichyk <viarheichyk@google.com> Skip resource files for locales en-XA and ar-XB
during packaging if pseudolocalization was done automatically.
This prevents attemts to add same resource twice.

Change-Id: I51e17f961ac44047bf466ce4aa0d4d17f4ded0d6
/frameworks/base/tools/aapt/ResourceTable.cpp
8c2fff23853d78c19a94d034dbf21fc2718ead9a 01-May-2014 Elliott Hughes <enh@google.com> am fd955f14: am 6a6979ad: am 86315c45: Merge "Fixes issue causing pseudolocalization of strings in non-translatable resource files."

* commit 'fd955f14d6c87dffd1a20c36ad8001705495f831':
Fixes issue causing pseudolocalization of strings in non-translatable resource files.
84410b054c7db0b6685a0f15cb2d1ffcb264f6c9 30-Apr-2014 Igor Viarheichyk <viarheichyk@google.com> Fixes issue causing pseudolocalization of strings
in non-translatable resource files.

Change-Id: Ic8e5effc86226d5be00561ac71bab7695ef90376
/frameworks/base/tools/aapt/ResourceTable.cpp
4b0ee78bfa0df6e278c7327822fd9a0eff52b584 19-Apr-2014 Elliott Hughes <enh@google.com> resolved conflicts for merge of 56ca8219 to master

Change-Id: I62f5804a5c4404eedce09188cda2e3b1bb990b36
a2ef5c0d4fb863c0382e77ae00f986a019b11cbe 12-Mar-2014 Anton Krumin <antkrumin@google.com> Pseudolocalizer improvements.

Fixes accented pseudolocalization and adds RTL pseudolocale.

This change contains following modifications in the pseudolocalization logic:
1) zz_ZZ pseudolocale was removed;
2) en_XA pseudolocale was added for pseudo-accented;
3) ar_XB pseudolocale was added for pseudo-rtl;
4) Pseudo RTL localization functionality was implemented;
5) Text expansion functionality was implemented;
6) Text bracketing was implemented;
7) Couple of issues of previous implementation were fixed.

Change-Id: I9f7f27bed717e39e82717d15c398decffc8bec3c
Signed-off-by: Anton Krumin <antkrumin@google.com>
/frameworks/base/tools/aapt/ResourceTable.cpp
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.cpp
e119b22146c602dac1e8bdfdb325b6c83fc66d66 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.cpp
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.cpp
788fa41482b9d398591b7db8b0b01839029611ad 21-Jan-2014 Narayan Kamath <narayan@google.com> Extended locales in AAPT / AssetManager.

Support 3 letter language codes, script codes &
variants. The bulk of the changes are related to
the implementation of command line filtering of
locales etc. The previous code assumed that the
value of each "axis" (locale, density, size etc.)
could be represented by a 4 byte type. This is
no longer the case.

This change introduces a new class, AaptLocaleValue
which holds a (normalized) locale parsed from a
directory name or a filter string. This class takes
responsibility for parsing locales as well as
writing them to ResTable_config structures, which is
their representation in the resource table.

This includes minor changes at the java / JNI level
for AssetManager. We now call locale.toLanguageTag()
to give the native layer a well formed BCP-47 tag.
I've removed some duplicated parsing code in
AssetManager.cpp and replaced them with functions on
ResTable_config. The native getLocales function has
been changed to return well formed BCP-47 locales as
well, so that the corresponding java function can use
Locale.forLanguageTag to construct a Locale object
out of it.

Finally, this change introduces default and copy
constructors for ResTable_config to prevent having
to memset() the associated memory to 0 on every
stack allocation.

(cherry-picked from commit 91447d88f2bdf9c2bf8d1a53570efef6172fba74)

Change-Id: I1b43086860661012f949fb8e5deb7df44519b854
/frameworks/base/tools/aapt/ResourceTable.cpp
91447d88f2bdf9c2bf8d1a53570efef6172fba74 21-Jan-2014 Narayan Kamath <narayan@google.com> Extended locales in AAPT / AssetManager.

Support 3 letter language codes, script codes &
variants. The bulk of the changes are related to
the implementation of command line filtering of
locales etc. The previous code assumed that the
value of each "axis" (locale, density, size etc.)
could be represented by a 4 byte type. This is
no longer the case.

This change introduces a new class, AaptLocaleValue
which holds a (normalized) locale parsed from a
directory name or a filter string. This class takes
responsibility for parsing locales as well as
writing them to ResTable_config structures, which is
their representation in the resource table.

This includes minor changes at the java / JNI level
for AssetManager. We now call locale.toLanguageTag()
to give the native layer a well formed BCP-47 tag.
I've removed some duplicated parsing code in
AssetManager.cpp and replaced them with functions on
ResTable_config. The native getLocales function has
been changed to return well formed BCP-47 locales as
well, so that the corresponding java function can use
Locale.forLanguageTag to construct a Locale object
out of it.

Finally, this change introduces default and copy
constructors for ResTable_config to prevent having
to memset() the associated memory to 0 on every
stack allocation.

Change-Id: I899a56a9a182ee6be52b9389d1ae59266f5482e9
/frameworks/base/tools/aapt/ResourceTable.cpp
9a9fa163c384e7fff159d339dfcce3b3122bece5 18-Dec-2013 Narayan Kamath <narayan@google.com> Don't pseudolocalize untranslatable strings.

bug: https://code.google.com/p/android/issues/detail?id=63004

(cherry picked from commit 7e1b8ff3e15b35b92978e572ccbfbc47cedce242)

Change-Id: I99ba1a915ae8fc61f70ce570b782108171d0fcaa
/frameworks/base/tools/aapt/ResourceTable.cpp
cd28bd37ea2d88dd72930f032ca73daaad5744b4 15-Nov-2013 Ying Wang <wangying@google.com> Add new aapt flag --error-on-missing-config-entry

It forces aapt to return an error if aapt fails to find an resource
entry for a configuration.

Bug: 11259444
Change-Id: Ie5674a29dff5d4455e7d7c94f6b25560fb1305b7
/frameworks/base/tools/aapt/ResourceTable.cpp
8ff15b4cada7998e78c93934ab2c869c322d7e07 08-Oct-2013 Adam Lesinski <adamlesinski@google.com> AAPT emits error for res with no 'default' product

Rather than ignoring resources that do not match the specified
product, we keep track of the ignored ones and make sure that
some variant of the resource that matches the product was processed.

bug:10860838
Change-Id: I7a35f37fda2c9561634f75323bd4cb2b9047e29b
/frameworks/base/tools/aapt/ResourceTable.cpp
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.cpp
7e1b8ff3e15b35b92978e572ccbfbc47cedce242 10-Dec-2013 Narayan Kamath <narayan@google.com> Don't pseudolocalize untranslatable strings.

bug: https://code.google.com/p/android/issues/detail?id=63004
Change-Id: I8e47a53d887144dc867111e42313d0e113b83ea1
/frameworks/base/tools/aapt/ResourceTable.cpp
2b8e82fd51fca815675e7cb32c35da3932f0dc13 04-Oct-2013 Adam Lesinski <adamlesinski@google.com> AAPT emits error for res with no 'default' product

Rather than ignoring resources that do not match the specified
product, we keep track of the ignored ones and make sure that
some variant of the resource that matches the product was processed.

bug:10860838
Change-Id: I804cd04a053269a35b7e1c1cc743b77493337bf9
/frameworks/base/tools/aapt/ResourceTable.cpp
9f6a119c8aa276432ece4fe2118bd8a3c9b1067e 28-Aug-2013 Mike Lockwood <lockwood@google.com> Move frameworks/base/tools/ to frameworks/tools/

Change-Id: I3ffafdab27cc4aca256c3a5806b630795b75d5c8
/frameworks/base/tools/aapt/ResourceTable.cpp
d8dde13a63565dcd72bcf03a5088407b737ba793 17-Nov-2012 Christopher Tate <ctate@google.com> Cache resource ID lookups in aapt

This speeds up certain workloads considerably, particularly
those involved in buildling apps via the SDK. Windows-based
use should particularly benefit from the change.

Change-Id: I29f4b3a77400b201ee219729cc28a5e359c0c5e8
/frameworks/base/tools/aapt/ResourceTable.cpp
5f7979993979466c79ab4f38d83c6f2aca361662 16-Jun-2012 Fabrice Di Meglio <fdimeglio@google.com> Add support for "-rtl" in resources

- fix bug #7035019 Need to have "-rtl" support for Resource

Change-Id: Ic82145c2ac672729d8a6c695a5f343276a1a0a2c
/frameworks/base/tools/aapt/ResourceTable.cpp
3e2d59146df9e9e325dcc65018bb130b03242bbc 01-May-2012 Jean-Baptiste Queru <jbq@google.com> resolved conflicts for merge of 13c04786 to jb-dev-plus-aosp

Change-Id: Ib7aa5a768f4606beb2a4387811cfed7c00cbc111
39b58ba2b299e1c97e13535aae9add530d942c7b 01-May-2012 Jean-Baptiste Queru <jbq@google.com> resolved conflicts for merge of bc2fb7b9 to jb-dev-plus-aosp

Change-Id: I5386585e473201268c6ed8b05e0a16569d434ea2
345b7eb8749d6954942fd4e961fff9f2f854934c 16-Mar-2012 Jeff Brown <jeffbrown@google.com> Remove dead code in StringPool.

The sorted string pool option was no longer used.
Neither were strings with associated identifiers.

Change-Id: Ic5f6368637fbeedfda873d63f4ad0f3ea9d0d603
/frameworks/base/tools/aapt/ResourceTable.cpp
59eb5fd509c98a371b8824f6b13cf29981a4f063 07-Mar-2012 Ben Gruver <bgruv@google.com> Fix up getAttributeFlags() function

In addition to a couple of minor clean-up items, this fixes an issue that can
rarely cause incorrect parsing of attribute flag values, when there is a '|'
character in the few bytes past the end of the attribute value being parsed.

Change-Id: I6050b1c2db60720c7c0ab7df9eba8cfc629b320e
/frameworks/base/tools/aapt/ResourceTable.cpp
b13b9bdad2baf6ad1ec2e56b6b7598fa20f55fc4 18-Feb-2012 Mathias Agopian <mathias@google.com> frameworks/base refactoring.

step 2: move libutils headers to their new home: androidfw

Change-Id: I14624ba23db92a81f2cb929f104386e1fab293ef
/frameworks/base/tools/aapt/ResourceTable.cpp
249e3ed5400e5c7ab2e9aa8017f612d79d2e8089 08-Feb-2012 Mårten Kongstad <marten.kongstad@sonyericsson.com> 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.

Change-Id: Ic7451b7f4adfef5bfa6b0d7e64e057f317a2cdaa
/frameworks/base/tools/aapt/ResourceTable.cpp
1644c6d7f4931d0b4fe7ea77c63b016af01a46d3 07-Feb-2012 Dianne Hackborn <hackbod@google.com> Only generate private symbols that are needed.

Change-Id: Icc4c86638db8429a387bf87c934cc712f807e213
/frameworks/base/tools/aapt/ResourceTable.cpp
c761d8b0086f9e92eb1e4b3a5683ae6afb84036a 07-Feb-2012 Mårten Kongstad <marten.kongstad@sonyericsson.com> 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.

Change-Id: Ied2e0ab8cb800e49623f0a2044b06cd4935473d5
/frameworks/base/tools/aapt/ResourceTable.cpp
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.cpp
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.cpp
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.cpp
f14dff1219d2a87340dccad657f666f5451d8c6e 10-Jun-2011 Dianne Hackborn <hackbod@google.com> am c6adfed6: am f795e9a8: Okay *now* really enforce the limit on non-public styles.

* commit 'c6adfed6dcea8482e482db58bd396ea8de08426a':
Okay *now* really enforce the limit on non-public styles.
9980043e930f877c4cd066de2b3d57dce4fc926e 10-Jun-2011 Dianne Hackborn <hackbod@google.com> am 820caf7b: am 8821ba86: Ummm... f*, stop breaking the build.

* commit '820caf7b04f1e5c83599437e9e783e91322eb4f9':
Ummm... f*, stop breaking the build.
f795e9a86d4f62e5314ef95978c3ea17d90975db 10-Jun-2011 Dianne Hackborn <hackbod@google.com> Okay *now* really enforce the limit on non-public styles.

Change-Id: Ie8df6acf7cc3dec00f615b2fa9a5122ec79a0aae
/frameworks/base/tools/aapt/ResourceTable.cpp
8821ba860693f5206c56ae727a4231e4d6f0a735 09-Jun-2011 Dianne Hackborn <hackbod@google.com> Ummm... f*, stop breaking the build.

Change-Id: I6a42cb60e7cebda6d17222e6af1f327889323c40
/frameworks/base/tools/aapt/ResourceTable.cpp
f51ded0f8f593d17af82946eb65c05fc04f688b4 10-Jun-2011 Dianne Hackborn <hackbod@google.com> am a8d7ea06: am 220cd77d: Merge "Enforce public resource restriction on bag parents." into honeycomb-mr2

* commit 'a8d7ea067cf22baeee2ff0a33e5a8c5a35936942':
Enforce public resource restriction on bag parents.
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.cpp
06a8ceacb0dc2713cb0bb2c93d2a750f2a58db68 20-May-2011 Dianne Hackborn <hackbod@google.com> am c851ea56: am 69cb8757: Add new "-swNNNdp" resource qualifier.

* commit 'c851ea5672f6e042c2e89b2a2ce4a2467e1fcd2a':
Add new "-swNNNdp" resource qualifier.
69cb87576ba163b61bb0e6477a3b7c57a9b11d40 20-May-2011 Dianne Hackborn <hackbod@google.com> Add new "-swNNNdp" resource qualifier.

Change-Id: I0101e88ca9d8d44138bdcaf571f24b0352f4f6ce
/frameworks/base/tools/aapt/ResourceTable.cpp
2e4a3236a7634d17f89288e9739a438ecbea0471 13-May-2011 Dianne Hackborn <hackbod@google.com> am 46a282f3: am 0ed2e845: Merge "DO NOT MERGE. Integrate add new screen width/height in "dp" configs." into honeycomb-mr2

* commit '46a282f323bc05606e4fe1eba795bd9ac7c99819':
DO NOT MERGE. Integrate add new screen width/height in "dp" configs.
ebff8f92f13513ce37bd74759eb1db63f2220590 13-May-2011 Dianne Hackborn <hackbod@google.com> DO NOT MERGE. Integrate add new screen width/height in "dp" configs.

You can now specify resource configuration variants "wNNNdp"
and "hNNNdp". These are the minimum screen width/height in "dp"
units. This allows you to do things like have your app adjust
its layout based only on the about of horizontal space available.

This introduces a new configuration change flag for screen size.
Note that this configuration change happens each time the orientation
changes. Applications often say they handle the orientation change
to avoid being restarted at a screen rotation, and this will now
cause them to be restarted. To address this, we assume the app can
handle this new config change if its target SDK version is < ICS.

Change-Id: I4acb73d82677b74092c1da9e4046a4951921f9f4
/frameworks/base/tools/aapt/ResourceTable.cpp
18490fb93e206fd899c3258096cc32f293373c92 12-Apr-2011 Kenny Root <kroot@google.com> resolved conflicts for merge of 87b3c0dc to honeycomb-plus-aosp

Change-Id: Ia1a0024aabf531438203eb9fea3a10dd15eabe53
57f4b77c89bafedf9468f9a636561c0c193405c9 17-Mar-2011 Mårten Kongstad <marten.kongstad@sonyericsson.com> 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.

Change-Id: If26ee7754813004a96c043dba37fbe99fa3919db
/frameworks/base/tools/aapt/ResourceTable.cpp
02feeb4b2bb6515491cf3dd7ae2b204caac81bae 18-Jan-2011 Josh Stone <cuviper@gmail.com> 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.

Change-Id: I3478ab7e0b939e61fe0cec20201ac55096264080
/frameworks/base/tools/aapt/ResourceTable.cpp
bf50322a245c430f3b3a1e7ecc299fe0a939daec 18-Jan-2011 Josh Stone <cuviper@gmail.com> 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.

Change-Id: I3478ab7e0b939e61fe0cec20201ac55096264080
/frameworks/base/tools/aapt/ResourceTable.cpp
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.cpp
82849afd719037968ddcb58e14cec8685f702216 07-Nov-2010 Jean-Baptiste Queru <jbq@google.com> am 3442611e: am 5580e44c: Merge "Support changing style parent in overlays"

* commit '3442611ee11b2987c83054fe3c7ed5521f27f052':
Support changing style parent in overlays
3442611ee11b2987c83054fe3c7ed5521f27f052 05-Nov-2010 Jean-Baptiste Queru <jbq@google.com> am 5580e44c: Merge "Support changing style parent in overlays"

* commit '5580e44c250944f5cd011b2682eea5cc2de9706c':
Support changing style parent in overlays
58520b24d40bb2587f394a52535dab4f2736bab1 04-Oct-2010 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 10d5b096 to master

Change-Id: Id5c6ba651f72b48f0d70ee2ca64a6c9adf5e74f7
407f625a9b8e356e765a5ec587c443af1f3aadb5 04-Oct-2010 Dianne Hackborn <hackbod@google.com> 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.

Change-Id: I49922d23b52a34183a8e2f4d2515adaf1fc9149a
/frameworks/base/tools/aapt/ResourceTable.cpp
6f27ab8bd4aca5a43f6bf93cd68c43dde825bfa1 23-Sep-2010 Eric Fischer <enf@google.com> am 9c708358: am 37cedce1: Merge "Add an aapt option to allow string variations for different devices." into gingerbread

Merge commit '9c70835896b6c078ac4c8b2e30cb6cfba70bb9d7'

* commit '9c70835896b6c078ac4c8b2e30cb6cfba70bb9d7':
Add an aapt option to allow string variations for different devices.
90964040cabfc67f92a7c3322a02401bb6f8ae82 16-Sep-2010 Eric Fischer <enf@google.com> 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.

Change-Id: Ie6c1505599e02e15b7818e8be6ec47bc6ce71aaa
/frameworks/base/tools/aapt/ResourceTable.cpp
2fda9f45623e888f71c6ea769305ccc4d9e76af2 02-Jun-2010 Martin Nordholts <martin.nordholts@sonyericsson.com> Support changing style parent in overlays

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.

Change-Id: I5969bb8aab90df437e1967fc504cc0da79107d13
/frameworks/base/tools/aapt/ResourceTable.cpp
f1ff21ac62a51f5ba8ca0821ea8a90f70957e25d 14-Jun-2010 Steve Block <steveblock@google.com> Fixes a few minor problems with AAPT

- 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
/frameworks/base/tools/aapt/ResourceTable.cpp
15fe2cb73b0770316db302f6502f568062d68e74 29-May-2010 Kenny Root <kroot@google.com> 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.

Change-Id: I3a19707f3804aa24e8568dc1653a11576cac5916
/frameworks/base/tools/aapt/ResourceTable.cpp
c9f3088036dd7cce6903e307afea3e289a334036 24-Mar-2010 Kenny Root <kroot@google.com> Use correct API version for UTF-8 checking

Use the constant for checking the API version in aapt instead of a bare
number.

Bug: 2541326
Change-Id: Ice7af7b393363a00f1832dd84753b8138d057fb4
/frameworks/base/tools/aapt/ResourceTable.cpp
1741cd4904414b5b4e768953a8f1abb3f0ef0a0a 18-Mar-2010 Kenny Root <kroot@google.com> 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.

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

This reverts commit 7b467d8b44c00d14590c021928b6a9ad5a36348e.
/frameworks/base/tools/aapt/ResourceTable.cpp
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.cpp
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.cpp
65e185b51ec655518f1917418cd6192400ac439d 05-Mar-2010 Ed Heyl <edheyl@google.com> 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 "**** ".
/frameworks/base/tools/aapt/ResourceTable.cpp
f5a7c121dd3abb9763c30115c772fd1fc03caea2 18-Feb-2010 Kenny Root <kroot@google.com> Change buf size holding integer in ResourceTable

A 32-bit integer can be 10 characters long plus a byte for \0 at the
end.

Change-Id: I58040fe6e1674e78bcc6e07463ff36fb26e280f4
/frameworks/base/tools/aapt/ResourceTable.cpp
27b28b3f62bd3b54fa13acd5d035940b9be464f3 09-Feb-2010 Tobias Haamel <haamel@google.com> 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:

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.
/frameworks/base/tools/aapt/ResourceTable.cpp
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.cpp
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.cpp
59ad275e937bb3c32e59bc01d86f484e7b4bdbe1 04-Nov-2009 Dirk Dougherty <ddougherty@google.com> doc change: fix broken R.styleable formatting (caused by missing periods). Adjust table markup.

Bug: 2230588
Change-Id: I54545dfd9d26acef567e586cfc916f6b883a4de7
/frameworks/base/tools/aapt/ResourceTable.cpp
93d72516994277acdd3894a169ec1f1cbc50db97 03-Sep-2009 Robert Greenwalt <robdroid@android.com> Fix compilation of add-resource tag.

It used the wrong tag-type to find the end of itself.
/frameworks/base/tools/aapt/ResourceTable.cpp
c87d25215c842cea370c6a86ce67585fa8da4900 02-Sep-2009 Eric Fischer <enf@google.com> 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.
/frameworks/base/tools/aapt/ResourceTable.cpp
58c27a0a03f573791935116fa35f6a7c8bf93896 13-Aug-2009 Dianne Hackborn <hackbod@google.com> Allow overlays to add resources.
/frameworks/base/tools/aapt/ResourceTable.cpp
dd931864209eac0b4182d7a0d1ca965fcc3b8c03 13-Jul-2009 Marco Nelissen <marcone@google.com> Format aapt warnings the same way as other compiler warnings
('warning: ' instead of 'WARNING: ' or 'WARNING ')
/frameworks/base/tools/aapt/ResourceTable.cpp
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.cpp
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.cpp
f479aa0900e9a85afdc78b1048684e37579ebf23 21-May-2009 Dianne Hackborn <hackbod@google.com> Add padding to public.xml to avoid breaking from auto-merges.
/frameworks/base/tools/aapt/ResourceTable.cpp
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.cpp
32c2c902200e894c6e887218a337334d81013be5 08-May-2009 Robert Greenwalt <robdroid@android.com> Fix 1840639 to support overlays with zz_ZZ.
Everything but strings worked fine before but a new default string would generate a build error.
/frameworks/base/tools/aapt/ResourceTable.cpp
9411a39866b749ad0a47f15083f311847eb79178 04-Apr-2009 Robert Greenwalt <> AI 144547: Fix change 144342 by making it active only during overlay processing.
BUG=1754390

Automated import of CL 144547
/frameworks/base/tools/aapt/ResourceTable.cpp
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.cpp
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/tools/aapt/ResourceTable.cpp
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/tools/aapt/ResourceTable.cpp
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/base/tools/aapt/ResourceTable.cpp
22f7dfd23490a3de2f21ff96949ba47003aac8f8 20-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@127101
/frameworks/base/tools/aapt/ResourceTable.cpp
9266c558bf1d21ff647525ff99f7dadbca417309 16-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@126645
/frameworks/base/tools/aapt/ResourceTable.cpp
b798689749c64baba81f02e10cf2157c747d6b46 10-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@125939
/frameworks/base/tools/aapt/ResourceTable.cpp
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/tools/aapt/ResourceTable.cpp
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/tools/aapt/ResourceTable.cpp