Bug: http://b/69933068
This is a partial revert of
https://android-review.googlesource.com/c/platform/frameworks/base/+/109433
so we can use Clang for windows cross compilation.
Clang does not allow a cast to 'signed size_t' and both Clang and
current MinGW accept a ssize_t to the '%zd' format specifier.
Test: m native-host, m native-host-cross with both MinGW and Clang
Change-Id: I5366622b91be1433f6c533c55a9ae429b57c7a27
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
bug:33527757
Test: replace the AAPT in local SDK, and make sure the propertyX/YName
still works within ObjectAnimator.
Change-Id: Ic9bb14cd228dcf7e4d250bd0f6cb5f0c31a14183
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
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
* 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
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
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
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
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
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
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
This reverts commit 9d0f7d44d5cc5322415f52f7ce03cc37a478b350.
Caused a build breakage when parsing some attributes.
Change-Id: I89ca958b2f2e820d353648df8aadd90bbe8d8339
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
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
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
Adds an option that prevents generating java symbols for string
resources that don't have a default localization.
Bug: 21537397
Change-Id: Ifafa942b24d5cdbed93651cde363e859be13d395
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
-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
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
All references to attributes defined in pre-LOLLIPOP_MR1 SDK
are moved to version qualified resource entries.
Bug:18221682
Change-Id: Ifd739530ebcf99e6bc7ddb3f10bc5e05f0726e62
automerge: 465d123
* commit '465d123464eadf180b618164b2ed23702bca3d86':
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
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
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
- 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