summaryrefslogtreecommitdiffstats
path: root/libs/androidfw/tests
Commit message (Collapse)AuthorAgeFilesLines
* tests: Fix compilation issue for themes unit testsSandeep Chawla2016-01-252-163/+51
| | | | | | | - Revert header file for tests to AOSP - Revert Android.mk to CM 12.1 version Change-Id: Ie7ef8bad6ebe6579eb4350000af995f8b9f5964a
* Themes: Create data/cm/ for CM specific test datad34d2015-10-2741-11/+1800
| | | | Change-Id: I523845be1bf2cbe1c2f01fc1cb0e7d2a9d8ef1e1
* Themes: Port to CM13 [1/3]Andy Mast2015-10-2628-144/+1618
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Themes: Aapt port Id: I106d447daf7935bada65e78911d8973ce0ca27ae Themes: Port our additions to idmap Id: I2e47cc23de4e7c0b884cccbd87c7d77079ac6824 Themes: remove legacy theme support from idmap Id: I17dfe35f9985d8cef790b26a8bcda738ea65917c Themes: Forward port changes to Installer.java Id: If64e856773e50f5ed74f2358e0c590abad724689 Themes: Add clean spec for aapt Id: I68f5f63f7e83b99230860dd2d8646e96da484b62 androidfw: Port CM overlay contributions Id: Id7b7f5f35011922c668fcea3a8aec5b42bd28653 androidfw: Port addOverlayPath and removeOverlayPath Id: I279db083af28fd8941f3227f2a7512ff094742c1 androidfw: Port addCommonOverlayPath Id: I12d2fe05a04f6a7e553c330505a475346374b507 androidfw: Port addIconPath Id: Ide3db28cde0c7f93edd9e7ad626ebace8d4105cc androidfw: Allow package ID to be overriden at runtime Id: Ieca3a0ae070a6c0ad0cf2b73b5944d83397d08b9 Aapt: Zip Parsing Test Cases w/ Refactoring Id: I28f9115700e186136432138d228111ebcfbd0480 Themes: Update tests for idmap Id: I3dae5bd376d122eab397863378599ae0ac7c6734 androidfw: Add test case for overriding package id Id: I2668c529e24a55cd6bc8437406fc284b853a75e7 androidfw: Add tests for bags The overlayOverridesStyleAttribute will currently fail since our changes to allow theming styles is not currently implemented. Id: Idfacc4382baf4152c839799a22b6cbe015ef2197 androidfw: Don't consider package ids 0x60 and 0x61 as dynamic Package IDs that are not 0x01 (system) or 0x7f (app) are treated as dynamic references. Overlays are assigned specific package ids that fall within the region of shared libraries. This patch treats them the same as system and app resource packages. Id: Ieecaa889bed50490796351302405a38f77c84f4e Theme Parsing & Info Id: I3583d7e8ca704402e3d8c6e1c7cea1645b91c06f Port ThemeUtils and its dependencies This is pretty much copy/paste from cm-11.0 Id: I406860a259136ccca107b981aca0369851df445e Themes: AndroidManifest and Intent port Id: Ib97e8539301d20d120fd8b49891fdaae8205fe42 ComposedIconInfo Port (w/ stubbed IconPackHelper) IconPackHelper is stubbed out so that PMService can reference it, we'll need to port the Resource stack before porting the implementation. Id: I59b680511de525e1d375a4f3be04347686b5e81b Port PackageManagerService and other dependencies Id: I11629d1e5eee21e01c060bc6c0393aae96034b69 Themes: Add in ThemeService See also: external/selinux. The policy must be added in order for the service to start without a security exception. Change-Id: Ic6f64796b264e430e9706a17a3fd2a35085fd1ca TODO: ThemeService / Keyguard interaction TODO: SystemServer - AppsLaunchFailure Add AppsLaunchFailure Id: I09a3826f89c62cb898866408e807f269616f48fc androidfw: Update bags tests The overlayOverridesStyleAttribute was updated such that it does not check the attribute of the theme before adding the overlay. The bag is cached on the first call and the next call, after the overlay is attached, returns that pre-computed bag so the test would always fail. We now simply check that the attribute matches the one in the overlay, and if so then the test passes. This patch also adds a new test to check that an overlay can reference and access resources that are unique to the overlay. Currently this test fails. Id: I3892df3f0d9443a73eaa11b3d5e97cfe86620a73 androidfw: Add test for referencing overlay styles as parents Id: I4fa3bd447c888e96176955924ebe7ee5c784ab55 androidfw: Allow referencing and retrieving overlay resources This patch allows a theme to reference it's own resources. Overlays get their own group which contains those resources that are not idmapped. Idmapped resources end up in the target's group. Id: Ibc119ddcdb35d44a8afec3c6152bcab2909cda18 androidfw: Fill in missing attributes from overlay style Id: I74051b379b73c728c6a2aa4bc62f3cd268a40b53 Protect windowNoTitle and windowActionBar attributes This patch creates a new method to define "protected" attributes. These are attributes like windowActionBar which should not be modified by a theme. Some apps (eg gmail) use the appcompat library which has its own Actionbar classes. When an app uses its own Actionbar it must not include the default actionbar which is achieved through the windowActionBar attribute. Some themes may try to change these attributes, which can will cause the app to crash. Id: Ie3bb7285eed09f3f13facf9d142ea9eb83796eec Themes: Use SYSTEM_DEFAULT in ThemeService Id: I52794dd98ca2f64aa50046ecdd7f79f27c21dd98 androidfw: Test missing parent attributes are merged in This test checks that an overlaid style contains any attributes that were in the original style but omitted in the overlaid style. Id: I6b496ef2eb0a7ef27b4fafdfda5bdf7ccffad989 androidfw: Add test case for protected attributes For this test to pass a protected attribute, such as windowNoTitle, must be equal to the original and not the value specified in the overlay. Id: Ic03f11214a1fc4139e3c48d7e72694a80f819023 Themes: Attach theme and icon resources from java Id: I9ffa0ce96a4af603b78b32d6b190f9698d3e4b4f Themes: Icons, icons, icons! Let there be icons. Legacy icons and composed icons are included in this patch. Id: I9fedafa270f1c4dc30c9c8ffd4cf619895e688e6 Themes: Retrieve explicitly themed context and resources Id: I4e41c251aee47361b183b60089bf5666540f653e Themes: Add themeChange config change to manifest Id: Ia84c0089a79637906e4f75fa38a56e8ff3b21a2b Themes: Register THEME_SERVICE in ContextImpl Id: I608a0b65c7e2ff0d69bae7bf343916f2b985f4a0 Themes: Remove legacy theme support Id: I25887843d31f705425aa40f9a23482fd2cafaef8 androidfw: correctly index paths in idmap Since we added the mtime values for the target and overlay, the indices are increased by two. Id: Ie0f5474d425945d58a12021cd2739240d2e98c0a androidfw: Fix opening assets from theme resources Id: Iedb51163a62b046cdf7fda1ad1b55cc1ee409047 Themes: Consider overlaid resource as "best fit" Id: Ife8342a49eb9502be52f085f88161b113332e9e6 Themes: Save and restore theme config Id: I3fcd445fb458aa6ed09397c05df6eb66d9be7235 Themes: Let ThemeService process additional themes Id: I45837f26948367d5cc6c520e8c53f9da60bd1fda AAPT: Don't applyVersionForCompatibility on android When compiling themes with aapt, we do not want aapt to call applyVersionForCompatibility as this causes the entries in the resource table to have an incorrect path. Id: Ie2c69533b3659c7b7458d6e4b7bdc84946d1be8e androidfw: Don't consider package id 0x5f as dynamic Package id 0x5f is reserved for common overlay resources and needs to be reserved so that it is not considered a dynamic. Id: Id27b8e0e2231ee8541365274d512e347afcfd05b AAPT: Include resources.arsc in apk Common resources needs the resources.arsc in the resources.apk so that it can be included when processing other overlays. Without it, common resources cannot be referenced. Id: I4aee29f660e4a0aa1909240dc0ca5680f0a2d135 Themes: Add keyguard wallpaper support to theme service Id: Ib8f8acd55ab4d2b6ef06ee0a630dc50c4f870beb Themes: Don't pre-process non .9.png images When creating a resources.apk we do not need to pre-process the normal .png images as those can be referenced directly from the theme's apk. Id: Iaf846a03ead9ecb1e68c040eac6e0ecbfc6e5875 Themes: Adjust offsets for idmap hashes Idmap now has a header so the indices to the hashes need to be incremented by one. Id: If1fb183cc116ef9e3ad6cb4e17b6e44763e9e72a Themes: Use single ThemeInfo instead of an array We only ever used the first index so there is no need to use an array of ThemeInfo(s) Id: I9e2af076bc17396a0c978be3c0d31c41277db3df New converter for Kitkat -> L fonts.xml L introduced a new fonts xml format. Its great, but our themes will keep using hte old format. This provides a converter and test cases. The parser was taken from the chooser and remains mostly unchanged with the exception of a getName() helper method. Id: Ia1d42c9e50eb7b52d2d98fe6dbeee530bef3adc2 Themes: Port theme bootanimation support to CM12 Id: Ie016884b0e3b77e08732308923ac44e0975e0116 Resources: Clear drawable cache Id: I04b5b78cce703194a2baeff9c51d2e4733b8ccc9 Font switching Id: Ia43060a7db624102cdcd9b0d9dc7148441401584 Zygote changes Id: Ie3681cf0d2b9929661cf1214e899cef9a5f37471 Recreate String Blocks Id: I4747ebd1a0908b76ae7214b0584948353d426fc5 add a getter for the x and y offsets of the wallpaper window Id: I35294bcac664e85cc5d344b50b5c4335a60d3f37 Themes: Don't spam logcat with CREATING STRING CACHE When processing resources with AAPT on the device, it spams the logcat with warning messages about CREATING STRING CACHE. Change ALOGW to ALOGV so it will only show when verbose logging is enabled. Id: I5b591c3336e176dd71cebe672d60721c29651b00 SystemUI: Audio Volume Panel Id: I78c471864af401b274597339b8451e65931fdb32 AmService uiContext port Id: Ida251d7f80797b0ec78b3d20cf60a795d6c4c1f0 Cleanly detach theme assets Types from an overlay are added to the target group's TypeList and need to be removed when the overlay assets are detached. Failing to remove these types results in resources not being retieved due to the erroneous types. Id: I4a9c624e30309e61fce905ced45c55acd3ac4845 Themes: GlobalAction Port Id: Ifd87e04f94a284e77f1c48bec9fd75d69c45c47e Themes: Do not store forward locked themes in ASEC containers If a theme is in a asec container and is applied, when the device is rebooted the device will get stuck in a nasty boot loop since the theme resources must be read and the asec container is not ready yet. Id: I1d93d8175d5c40b34c222974960c43352012a5ad Use systemui's applied theme for notifications. Notifications contain RemoteViews which are inflated using the application's context for which this notification belongs to. This can look out of place if SystemUI is using a different theme than the rest of the system. This patch will use SystemUIs theme when inflating the RemoteViews, giving us a more consistent look in the notification drawer. Id: I9514ce7fcc4858bad3d3c4190f55c1f5a1441d7c SysUI: Add theme support This ports over the changes needed to facilitate a theme change in SystemUI. Id: I673fb79db90994371a9c0627746a97414132f0ba Themes: Allow composing of VectorDrawable Base icons can be vector drawables. This patch allows them to be composed. Currently, VectorDrawables cannot have filters applied since they do not have a method to get the Paint object like BitmapDrawable and PaintDrawable. Id: I762c8e1f4d1c945b8ebc164bbd7944120324bd42 Themes: Add target api to ThemesContract This will allow the ThemesProvider to track the api a theme was built for. We may want to let the user know when a theme may not be designed for the version of CM installed on their device. Id: Idf0e6cef0ce9ac5e221ce5ff7e0b155ae0258d5f Access Themed ResTables from compiled theme apk [1/2] Before this patch the ResTable for a theme/app was created and accessed seperate from the compiled APK. Since the compiled APK has its own copy of the resources.arsc, we can just reuse the table in the APK instead. Id: I106a2434e74784bc04014831098f49fe128bc7e2 Themes: Port AppsLaunchFailureReceiver to CM12 Id: I5c3265e64aef1536ba5fceed0ec89082e786b686 Themes: Bump idmap hash version to 3 Due to changes in idmap, we need to force the recreation of resource cache when upgrading from CM11 to CM12. Id: I25c1e2c598bca889818e2d685651e3214c30ab3c Remove debug logs Id: Ia5cfa83ddf6da195e20526a94ba154864b8d0ecb Send target sdk version to aapt [1/2] If vector drawables are used in a theme we must have a minSdkVersion of 21 passed to aapt or else aapt will Segfault. Id: I687ee146f9f80543bbcdd06d93891cb3b23001c4 Add missing imports to ActivityThread Id: I09fe07807ed824ccb938e0e174b06653c613c403 Themes: Dynamically add/remove content from StatusBarWindow StatusBarWindowView has logic for resizing and fading content which doesn't always behave correctly if this view is not the root. Rather than create a container, this patch uses the existing StatusBarWindowView as the container and the inflated status bar is then added to this view. Id: Ia93d25a589419145f95d75b1b56eb3c2f300f935 Themes: don't use preloaded drawables when themed If we have themed assets we should try and load those rather than pulling from the preloaded drawables. This allows us to continue and preload drawables in ZygoteInit while maintaining the ability to theme those preloaded assets. Id: I68cfc099d328ece0791b6d0e5cf11d07097fd1fd CM11 -> CM12 Upgrade [1/3] - Introduce a new secure setting "THEME_PREV_BOOT_API_LEVEL". This field will always be set to the previous api level for themes. So if we upgrade from CM11 to CM12 this value will differ from the current API causing an upgrade to trigger - When moving from CM11 -> CM12, unapply incompatible overlays - Rename "holo" to "system" in secure settings themeConfig - Provide a testing downgrade script to put the secure settings db into a state similiar to CM11 (at least for themes) Id: I71be2c0ad83e60ffe8c574f913e5eaecb9700045 Themes: Add constant for system target API Id: I0a6caf65c9e8b0feeef1ae848ba4683235304e8c Change-Id: Ide6d4e1daf535a54efb1ec7cf39ef8b2fb8cf272
* Add -round and -notround qualifier to android runtime/aaptAdam Lesinski2015-05-151-0/+78
| | | | | | | | The round qualifier denotes a device with a screen shape that is round. The qualifier shows up after the 'long/notlong' qualifier and before the orientation 'port/land/square' qualifiers. Change-Id: I3044258b2703a9165694b79725bade770fa6cea1
* Fix UB in ResourceTable::stringToInt.Dan Albert2015-04-082-13/+98
| | | | | | | | | | Was here because UBsan found integer overflow in the parsing for hex numbers, since hex numbers here are actually unsigned but assigned to a signed integer. Also fixes a number of missing error conditions. Change-Id: Iaea576daedfc6c75521cde02de3fe9dd0198a3b7
* am 740acf21: am c7801877: Merge "Fix issue where non-resource attributes ↵Adam Lesinski2014-12-111-0/+17
|\ | | | | | | | | | | | | would cause obtainStyleAttributes to fail" into lmp-mr1-dev * commit '740acf213c56c406132294790fa2fadd0380cfa7': Fix issue where non-resource attributes would cause obtainStyleAttributes to fail
| * Fix issue where non-resource attributes would cause obtainStyleAttributes to ↵Adam Lesinski2014-12-101-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | fail A sentinal value of 0x00000000 was used to mark the first time an AttributeFinder was used. If the resource ID of an attribute was also 0x00000000 (which occurs with non-resource attributes, like 'style'), then it would be mistaken as the sentinel start value. Bug:18421787 Change-Id: I4be353e0f8c940cb6f262d155129f048dcc444ae
* | Merge commit '06d8b7b8' into manualmergeAdam Lesinski2014-11-172-0/+112
|\ \ | |/ | | | | | | | | | | Conflicts: core/jni/android_util_AssetManager.cpp Change-Id: I77b72d0d3ec8184ccd97419e4c76b7d55b1a52ca
| * Implement back-tracking when searching for attributes in XML or resource bagAdam Lesinski2014-11-042-0/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shared libraries have their package ID assigned at run-time, so some of the guarantees we used to have about sort order of attributes in bags or XML elements no longer hold. This CL adds back-tracking and can jump to the nearest attribute with the same package ID and continue searching. This means that attributes with the same package ID must be sorted by increasing resource ID, as was the case before. Attributes with the same package ID must be grouped together, but the groups can be in any order. Ex: 0x02010001, 0x02010002, 0x01010000, 0x01010010, 0x7f010032 Bug:17666947 Change-Id: I9c198bbb6ca788849aac85b6323606ea5d9550d6
* | resolved conflicts for merge of 487ae9b8 to lmp-mr1-dev-plus-aospAndreas Gampe2014-11-071-1/+11
|\ \ | | | | | | | | | Change-Id: I395f184d885a7ef30aa113ab01fcaacc94243008
| * | Frameworks/base: Wall Werror in libs/androidfwAndreas Gampe2014-11-071-1/+9
| | | | | | | | | | | | | | | | | | | | | Turn on -Wall -Werror in libs/androidfw. Fix warnings. Refactor some code. Change-Id: I66fe54ace433c15dee5de328b149ca142f74b2dd
| * | am aeef612f: Merge "Search all packages for a given type string when looking ↵Adam Lesinski2014-10-091-1/+14
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | up resources by name" into lmp-dev * commit 'aeef612f200b6b5cee214230271e1c3d718151ee': Search all packages for a given type string when looking up resources by name
| * \ \ resolved conflicts for merge of 8791ebf0 to lmp-dev-plus-aospDan Albert2014-09-191-1/+0
| |\ \ \ | | | | | | | | | | | | | | | Change-Id: I9d0f81003f84d03a7a67420dd496fde18dd654d4
* | \ \ \ Merge commit '78be0498' into manualmergeAdam Lesinski2014-11-031-3/+0
|\ \ \ \ \ | | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: libs/androidfw/ResourceTypes.cpp tools/aapt/Android.mk tools/aapt/StringPool.cpp tools/aapt/StringPool.h Change-Id: I9d69efdfb892032895ace12159d193304f02dc6c
| * | | | Merge "Fix issues that will be present in C++11" into lmp-mr1-devAdam Lesinski2014-11-031-3/+0
| |\ \ \ \
| | * | | | Fix issues that will be present in C++11Adam Lesinski2014-11-031-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | | | | | am 31b76b66: Merge "libandroidfw: Do not build device library when building ↵Adam Lesinski2014-10-281-0/+3
|\ \ \ \ \ \ | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SDK" into lmp-mr1-dev automerge: 06caf1b * commit '06caf1b1112a6a3e364a46d02b883451e9180a07': libandroidfw: Do not build device library when building SDK
| * | | | | libandroidfw: Do not build device library when building SDKAdam Lesinski2014-10-241-0/+3
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Building the windows SDK causes a build failure if the device libandroidfw target is not omitted. Change-Id: I587b166342d0d047820911d279f192d2b39b6263
* | | | | am 879f237a: Merge "Added some more Split density tests" into lmp-mr1-devAdam Lesinski2014-10-2436-157/+803
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | automerge: 93b43445 * commit '93b434451abd11ff58ada66abdcddb3f33bb5023': Added some more Split density tests
| * | | | Added some more Split density testsAdam Lesinski2014-10-2336-157/+803
| | |_|/ | |/| | | | | | | | | | Change-Id: I3b83515f1240e713bbcff5385cf054bba693f297
* | | | am 983b668b: am be003a35: am f23e3ea6: am aeef612f: Merge "Search all ↵Adam Lesinski2014-10-101-1/+14
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | packages for a given type string when looking up resources by name" into lmp-dev * commit '983b668bd8deb58cbd3faabb931c4fb2dd80bf2f': Search all packages for a given type string when looking up resources by name
| * | | Search all packages for a given type string when looking up resources by nameAdam Lesinski2014-10-091-1/+14
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we would stop at the first match when looking for a type string, but we should search all packages in case a feature Split added a type with the same name. Bug:17924027 Change-Id: I6bc7ef073324db99448538cd8bdf566658f066ff
* | | resolved conflicts for merge of 8791ebf0 to lmp-mr1-dev-plus-aospDan Albert2014-09-191-1/+0
|\ \ \ | |/ / |/| / | |/ Change-Id: Ifedb15de5a4db6cb0238fec93aaa2d95f1844694
| * Clean up test makefiles.Dan Albert2014-09-111-5/+0
| | | | | | | | | | | | | | | | The build system takes care of linking the correct STL and gtest libraries for you, and specifying them manually confuses the build system when using libc++. Change-Id: I9f76ab26a63ace51293614cfb5ca002f37438e02
* | Fix backwards compat problem with AAPT public attrsAdam Lesinski2014-09-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Add test to ensure themes get copied from separate resource tablesAdam Lesinski2014-08-2912-0/+315
| | | | | | | | Change-Id: I94e9966cf1e9d0e7e6c7daa0606a87bb0f67705e
* | Clean up test allocations so real memory leaks are more visibleAdam Lesinski2014-08-292-32/+29
| | | | | | | | Change-Id: Ic405f08c8d8e3e7fc4e4a991671e980752c19899
* | Introduce anydpi density resource qualifierAdam Lesinski2014-08-254-10/+127
| | | | | | | | | | | | | | | | | | | | This is meant to be used with scaleable vector drawables, and are chosen as the best match unless there is a configuration that matches the density requested exactly. Bug:17007265 Change-Id: Ic3288d0236fe0bff20bb1599aba2582c25b0db32
* | Fix assumption about DynamicRefTable in aaptAdam Lesinski2014-08-151-0/+16
| | | | | | | | | | | | | | | | | | Packages without any resources should not expect to have a DynamicRefTable. Bug:16895517 Bug:17056720 Change-Id: Id006f6bdbf08f30505f6ba5982bc9d1b09db0f0a
* | Revert "Fix aapt dump for APKs with no resources"Adam Lesinski2014-08-151-17/+0
| | | | | | | | | | | | | | | | This reverts commit 0e475302cd196f45a01a525c49089018b238d4ba. I'll re-upload this CL with the correct fix in LoadedApk. Change-Id: I17c6381f8e5907dab9f996f89c5d435b9c08a13a
* | Fix aapt dump for APKs with no resourcesAdam Lesinski2014-08-141-0/+17
| | | | | | | | | | | | | | | | All APKs are expected to have at least one resource table (even if it is empty). We were missing the creation of an empty DynamicRefTable. Bug:16895517 Change-Id: I6a6e887f91b3b4bbcc52b3fd2741ef3d05fab1fd
* | Fix shared library bug in bag attributesAdam Lesinski2014-08-119-39/+200
| | | | | | | | | | | | | | | | | | | | A ResTable_map entry has a name attribute, which could be a dynamic reference if it comes from a shared library. It was not being patched with the correct package id. Bug:16795890 Change-Id: Ia8df6a943269b2fefb2132c3ed74eb1997d7701b
* | AAPT support for feature splitsAdam Lesinski2014-08-0417-501/+466
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | am 8c1c0a68: am 7f319c47: am 1dc550fa: Merge "Fix packing of values at ↵Narayan Kamath2014-07-011-0/+24
|\ \ | |/ | | | | | | | | | | offset 16." * commit '8c1c0a6881b1507f9ae25d753b64de185a7615b2': Fix packing of values at offset 16.
| * Fix packing of values at offset 16.Narayan Kamath2014-06-301-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Our bitmask for setting the highest bit to 0 for 0b11100000 (0xef) instead of 0b01111111 (0x7f) so we would end up setting bit 5 of each offset to zero. Fix this and expand test coverage by adding a fake language (tgp) that has this bit set in both its bytes. This issue was discovered while adding CTS tests for "tgl". Change-Id: Ibb6de03000951c907c252049771039ab7466187a
| * Extended locales in AAPT / AssetManager.Narayan Kamath2014-02-141-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * AssetManager support for 3 letter lang/country codes.Narayan Kamath2014-02-142-1/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 3 letter codes are packed into the existing 32 bit locale field in ResTable_config - We introduce new fields for script / variant information. Note that we define a "match" between two ResTable_config structures to be purely on the basis of their language & country (disregarding the script and the variant). However, configs with scripts and variants are considered to be more specific than those without. (cherry picked from commit 378c6775a62d9c461cde51f06c1b14bb014c78fd) Change-Id: I7dce82a3fe2412834252723f458826ae41535a78
| * Reimplement ZipFileRO in terms of libziparchive.Narayan Kamath2013-12-092-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lets us share zip archive processing code with both the runtime (Art, dalvik) and critical java code (StrictJarFile). This change also moves several utility methods to ZipUtils and dedups code across several zip inflation methods. One of the side effects of this change is that several processing loops are now O(n) instead of O(n^2). bug: 10193060 Change-Id: I3c7188496837a47246c4f342e45485a70fef3169
* | Support multiple resource tables with same packageAdam Lesinski2014-06-1820-24/+1343
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Shared library resource supportAdam Lesinski2014-03-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Extended locales in AAPT / AssetManager.Narayan Kamath2014-02-101-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | AssetManager support for 3 letter lang/country codes.Narayan Kamath2014-02-102-1/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - 3 letter codes are packed into the existing 32 bit locale field in ResTable_config - We introduce new fields for script / variant information. Note that we define a "match" between two ResTable_config structures to be purely on the basis of their language & country (disregarding the script and the variant). However, configs with scripts and variants are considered to be more specific than those without. Change-Id: I3c2e909ebbebdbbd0ab72a639d531b2b9fdbd9b9
* | Reimplement ZipFileRO in terms of libziparchive.Narayan Kamath2014-01-272-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lets us share zip archive processing code with both the runtime (Art, dalvik) and critical java code (StrictJarFile). This change also moves several utility methods to ZipUtils and dedups code across several zip inflation methods. One of the side effects of this change is that several processing loops are now O(n) instead of O(n^2). bug: 10193060 (cherry picked from commit afd31e08299008fdc5c2813f21b2573f29dc53df) Change-Id: Iae67e62f1dc6dfc3f43e29bc38e3ffd1cb14d191
* | Revert "move libandroidfw to frameworks/native"Adam Lesinski2014-01-274-0/+636
| | | | | | | | This reverts commit 84b6292c33d71b5739828d08aa8101d1954577f2.
* | move libandroidfw to frameworks/nativeMike Lockwood2013-10-034-636/+0
| | | | | | | | Change-Id: Ic5b8a2742c7141156ab0f00ca29097bfe92bce60
* | add a test for BackupData helpers.Chris Wren2013-09-252-0/+439
|/ | | | | Bug: 10821481 Change-Id: I3e28123d36927ae4a22d26378b8bf1cd4e87cfd2
* Move input library code to frameworks/native.Jeff Brown2013-07-015-1111/+1
| | | | | | | | | No longer compile libandroidfw as a static library on the device since it already exists as a shared library. Keeping the static library would force us to provide a static library version of libinput for the device as well which doesn't make sense. Change-Id: I3517881b87b47dcc209d80dbd0ac6b5cf29a766f
* libutils clean-upMathias Agopian2013-05-072-1/+66
| | | | Change-Id: I11ee943da23a66828455a9770fc3c5ceb4bbcaa9
* am cee11240: am 07b4339b: Merge "Change androidfw tests to native test target"Kenny Root2012-10-022-22/+11
|\ | | | | | | | | * commit 'cee1124052202c7f2a1956a54e5aa538d82197a7': Change androidfw tests to native test target
| * Change androidfw tests to native test targetKenny Root2012-10-022-22/+11
| | | | | | | | | | | | | | | | | | Change the androidfw tests to the BUILD_NATIVE_TEST target so they end up in the correct directory. Also remove the module tags and C include paths. The include paths are automatically added when the library is used. Change-Id: Ia47f6c25130c5068b89d6dc067e5d9c714a6d08a