summaryrefslogtreecommitdiff
path: root/tools/aapt/ResourceTable.h
AgeCommit message (Collapse)Author
2017-04-17AAPT: Auto-alias application adaptive-icon Adam Lesinski
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
2017-03-28AAPT: Version <adaptive-icon> to v26 Adam Lesinski
Bug: 35908647 Test: manual Change-Id: Ic8f43efe34385192fbab18675eb5898ed80912a5
2017-03-21Revert "AAPT: Version <adaptive-icon> to v26" Guang Zhu
Bug: 36462965 Bug: 35908647 This reverts commit c7614e5d1e8f9139cccf6ab9b78dda16b98f7656. Change-Id: I25279e7c53823dad0703c7e2ea8ff91bdbc1a0f2
2017-03-16AAPT: Version <adaptive-icon> to v26 Adam Lesinski
Bug: 35908647 Change-Id: I307fb2f666cb8519adb9a7f676b87706dc6c683f Test: manual
2016-02-26AAPT: Allow duplicate attribute definitions if identical Adam Lesinski
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
2016-02-25Revert "AAPT: Allow duplicate attribute definitions if identical" Adam Lesinski
This reverts commit c25283b5e206ceae2aa6eb01877b79c3c1f0adfb. Change-Id: I2f42a4360fa53c4333494afe0178dcec56d62d8e
2016-02-22AAPT: Allow duplicate attribute definitions if identical Adam Lesinski
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
2015-11-30Implement AAPT Bundle format Adam Lesinski
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
2015-11-30Revert "Implement AAPT Bundle format" Adam Lesinski
This reverts commit 9d0f7d44d5cc5322415f52f7ce03cc37a478b350. Caused a build breakage when parsing some attributes. Change-Id: I89ca958b2f2e820d353648df8aadd90bbe8d8339
2015-11-24Implement AAPT Bundle format Adam Lesinski
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
2015-08-14AAPT: Fix regression in resource versioning Adam Lesinski
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
2015-06-02aapt: add option for stricter symbol generation Adrian Roos
Adds an option that prevents generating java symbols for string resources that don't have a default localization. Bug: 21537397 Change-Id: Ifafa942b24d5cdbed93651cde363e859be13d395
2015-03-05resolved conflicts for merge of 701f9c2f to stage-aosp-master Dan Albert
Change-Id: I42e0411c0acef4b15137491ecaaed95d9b1cd0c1
2015-03-04Stop using namespace std. Dan Albert
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
2015-01-14AAPT: Handle all old unversioned attribute usage Adam Lesinski
All references to attributes defined in pre-LOLLIPOP_MR1 SDK are moved to version qualified resource entries. Bug:18221682 Change-Id: Ifd739530ebcf99e6bc7ddb3f10bc5e05f0726e62
2014-12-03AAPT: Move private attrs to new type for framework Adam Lesinski
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
2014-11-03Add error checking to aapt for split generation Adam Lesinski
Change-Id: Ica627db6a671f6a6c35f98bfd9c03598ffe103ce
2014-09-24AAPT: Fix issue with synthesized resource not actually showing up Adam Lesinski
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
2014-09-22AAPT: Continuation of public/private attribute fix Adam Lesinski
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
2014-09-18Fix backwards compat problem with AAPT public attrs Adam Lesinski
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
2014-08-21AAPT: mipmaps should not end up in Splits Adam Lesinski
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
2014-08-04AAPT support for feature splits Adam Lesinski
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
2014-05-11Add support for building split APKs Adam Lesinski
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
2014-03-25Shared library resource support Adam Lesinski
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
2014-03-20Reduce warning verbosity in aapt Adam Lesinski
- Attributed source of problems to the correct file. - Only verify string localizations against valid locales. Bug:13140015 Change-Id: I9dabc5efa0510649caee8af0c8ebb803d6f48269
2014-01-27Revert "Move frameworks/base/tools/ to frameworks/tools/" Adam Lesinski
This reverts commit 9f6a119c8aa276432ece4fe2118bd8a3c9b1067e.
2013-08-28Move frameworks/base/tools/ to frameworks/tools/ Mike Lockwood
Change-Id: I3ffafdab27cc4aca256c3a5806b630795b75d5c8
2012-01-31aapt now sorts the strings in the resource string pool. Dianne Hackborn
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
2011-10-16New aapt feature to do smarter filtering of configurations. Dianne Hackborn
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
2011-09-27Don't lose product variant strings that also vary between locales. Eric Fischer
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
2011-06-09Enforce public resource restriction on bag parents. Dianne Hackborn
Need to put some more styles in the SDK to avoid breaking apps. Also, welcome Android 3.2. Change-Id: Ia31d07c9b1b91ad868d8630437fdc1b5ae24f37d
2010-11-22Add knowledge of mipmap to aapt Kenny Root
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
2010-03-10Revert "Dedupe resource config pointers" Kenny Root
This reverts commit 7b467d8b44c00d14590c021928b6a9ad5a36348e.
2010-03-09Dedupe resource config pointers Kenny Root
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
2010-03-09Add ability for some manifest attributes to reference resources. Dianne Hackborn
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
2010-02-04Add --auto-add-overlay option to aapt. Xavier Ducrohet
This option allows resources only present in overlays to be added automatically instead of being declared through <add-resource> Change-Id: Iff782311056f6a045193e57d204f7d3413e11b26
2009-12-07Optional use of UTF-8 strings in resource bundles Kenny Root
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
2009-08-13Allow overlays to add resources. Dianne Hackborn
2009-06-09Make aapt Error out when an overlay adds a string. Robert Greenwalt
Final added check (I think) for 1585775 - not letting overlays add resources. modified: ResourceTable.cpp modified: ResourceTable.h
2009-06-05Add per-named-item overlay ability in res xml. Robert Greenwalt
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
2009-05-15Implement compatibility support for WRITE_SDCARD permission. Dianne Hackborn
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.
2009-04-02AI 144342: Fix bag (string-array,etc) behavior with overlays. Robert Greenwalt
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
2009-03-03auto import from //depot/cupcake/@135843 The Android Open Source Project
2009-03-03auto import from //depot/cupcake/@135843 The Android Open Source Project
2009-01-15auto import from //branches/cupcake/...@126645 The Android Open Source Project
2008-12-17Code drop from //branches/cupcake/...@124589 The Android Open Source Project
2008-10-21Initial Contribution The Android Open Source Project