summaryrefslogtreecommitdiffstats
path: root/libs/androidfw
Commit message (Collapse)AuthorAgeFilesLines
* Fix idmap leak in zygote processneo.chae2017-02-031-0/+1
| | | | | | | | | | | | | | | Fix a idmap leak in AssetManager::addSystemOverlays. And, The fix could also prevent fd leak of idmap. Test: none Bug: 32691930 Signed-off-by: Hyangseok Chae <neo.chae@lge.com> (cherry picked from commit 6a742a38509693f8b39ee9a5ad2803fca12688bf) Change-Id: Idc4af77db2b0cb739bd6b009b6af0f9123be1aac (cherry picked from commit 0244ca8d10dfc27e14f481fe649b89f7638c48eb)
* Themes: Fix theming of cmsdk assetsd34d2016-05-191-5/+9
| | | | | | | Missed the pkgid assignment bits in I4f64d53d82c9edafbe624c3b2eafcda7332587fb Change-Id: Ie442c8922f0d9eac3ed5bab70a99d3e065b719c4 TICKET: CYNGNOS-2723
* 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: Reference app resource when compiling theme [2/2]d34d2016-01-221-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to pass in the path to the target apk as an additional included resource apk, allowing theme designers to reference styles and attributes from the original package without needing to duplicate them. Duplicating attributes never worked quite well, and causes all sorts of issues, including crashing apps. Instead of a theme declaring attributes, that are app specific, it can simply reference the originals. This way things like colors that are style specific get included correctly. Here's an example of stat_sys_wifi_signal_4_fully.xml using this feature. By using ?com.android.systemui:attr/ we are able to reference attributes defined in SystemUI directly in our themed resource. <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="17.25dp" android:height="18dp" android:viewportWidth="46.0" android:viewportHeight="48.0"> <path android:fillColor="?com.android.systemui:attr/backgroundColor" android:pathData="M20.4,18.0"/> <path android:fillColor="?com.android.systemui:attr/fillColor" android:pathData="M42.0,32.0l0.0,-4.0L26.0,18.0L26.0,7.0c0.0,-1.7 -1.3,-3.0 -3.0, -3.0c-1.7,0.0 -3.0,1.3 -3.0,3.0l0.0,11.0L4.0,28.0l0.0,4.0l16.0,-5.0l0.0,11.0l-4.0, 3.0l0.0,3.0l7.0,-2.0l7.0,2.0l0.0,-3.0l-4.0,-3.0L26.0,27.0L42.0,32.0z"/> </vector> Change-Id: Icc794da9af2cd48099d42f9d7fbadaad8612b5db TICKET: CYNGNOS-1645
* Merge branch 'LA.BF64.1.2.2_rb4.6' of ↵Steve Kondik2015-11-042-19/+24
|\ | | | | | | | | | | git://codeaurora.org/platform/frameworks/base into cm-13.0 Change-Id: I261957864b149edb709e6f76ed382043f9a96936
| * Merge "base: Fix the problems for runtime overlay."Linux Build Service Account2015-10-261-15/+16
| |\
| | * base: Fix the problems for runtime overlay.yingying2015-10-231-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - There is no need to make the string blocking when adding the asset path, as it will be made by the resources. - After adding the overlay path, it also needs to update the string blocks. - Scan all the sub folders for framework overlay res. Change-Id: Iaad019111ae364c319e58dce57dbf4647b38d4c3 CRs-Fixed: 763809
| * | androidfw: Use the last package to create idmap.yingying2015-10-201-2/+4
| |/ | | | | | | | | | | | | | | | | | | Overlaid packages contain one or two package groups, the first one is system package(android), and the second one is application package. So it should use the last package group to create idmap. When inspecting the idmap, similar as above. Change-Id: I97e0179bc5b5acdcacbe6ec5b5b7c22af51d1d0b
* | androidfw: Reduce logspam when processing themesd34d2015-10-281-1/+1
| | | | | | | | Change-Id: I6372cb9dadbb3db2be1a23e88bd2d67e92a0d74d
* | Remove resources.apk from ZipSet when removing overlayd34d2015-10-271-0/+7
| | | | | | | | | | | | | | | | | | | | When a theme that is currently applied is updated, the resources.apk prior to the update remains in the AssetManager ZipSet and is still used when loading themed assets. This patch removes the resources.apk from the ZipSet so that the new one can be correctly loaded in. Change-Id: Ia0b415a3598779825090f365581d374bf51c812d REF: THEMES-639
* | Themes: Create data/cm/ for CM specific test datad34d2015-10-2741-11/+1800
| | | | | | | | Change-Id: I523845be1bf2cbe1c2f01fc1cb0e7d2a9d8ef1e1
* | Themes: Perform mapping when not from overlayd34d2015-10-271-1/+1
| | | | | | | | | | | | | | | | This will resolve an issue where an unthemed style references itself as the parent i.e. Real Racing 3. Change-Id: I1aaf5567a44ee0e5ddfad1e8c0e5ab7bc8c1e5bf REF: TOMATL-382
* | Themes: Clear bag cache when removing overlay assetsd34d2015-10-271-0/+1
| | | | | | | | | | | | | | | | The bag cache needs to be cleared from the group that was being overlaid, otherwise it will be referencing styles and attributes that may no longer exist. Change-Id: Ieef3ff2c55a643e12e9c4b8b4f6d5fd54da663d7
* | Themes: Don't add common assets if files cannot be accessedd34d2015-10-271-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | If resApkPath does not exist, asset manaager will load the resources from the theme's apk which end up overriding resources in the 0x7f package id. This causes apps, such as SystemUI, to crash endlessly. The correct behavior is to not add common overlay assets if the files that are being passed in as paths cannot be accessed. The same behavior is already used in AssetManager::addOverlayPath() Change-Id: If5e90baeda5f07973f268060dcb6d73dae657603
* | Themes: Restructure resource cache [1/2]d34d2015-10-271-79/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new structure is as follows: /data/resource-cache/ ├─ theme1_pkg_name | ├─ target1_pkg_name | | ├─ idmap | | └─ resources.apk | ├─ target2_pkg_name | · | · | · | ├─ targetN_pkg_name | └─ icons | ├─ hash | └─ resources.apk ├─ theme2_pkg_name · · · └─ themeN_pkg_name Change-Id: Id39688c88929733b42368c1f20ef0e25848a3390
* | Themes: Remove entryIdx param from appendPathToResTabled34d2015-10-271-11/+9
| | | | | | | | Change-Id: Ia7e3d0462e7d9cf67024f14a3a36b0ad54dad527
* | Themes: Port to CM13 [1/3]Andy Mast2015-10-2630-264/+2314
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | androidfw: STFUSteve Kondik2015-10-181-2/+2
| | | | | | | | Change-Id: I949b8e14b0c777c20a56a30941bd9b980fcc6394
* | androidfw: Declare and load cmsdk resource package w/ id.Adnan Begovic2015-10-122-2/+7
|/ | | | Change-Id: I63b8f3e4a938896dd21999c5b4470573a1da2e52
* AAPT: Fix printing of resource configurationsAdam Lesinski2015-07-271-1/+7
| | | | | | | | | Print out proper, copied configuration. We add fields to ResTable_config and if we don't copy and fill in defaults when reading old configurations, we end up with garbage values. This can potentially cause a crash as well. Bug:22773426 Change-Id: I64f5ebe73ee72453bcdad3a19e48f8e7ad58e9c2
* Let findSupportedAbi and hasRenderscriptBitcode scan only relevant filesYusuke Sato2015-06-221-2/+10
| | | | | | | | | for better performance. Without the optimization, these two functions may check more than 100k file names in the pre-installed APK files, which can take a few seconds to finish even on a recent device. Bug: 21957428 Change-Id: I315fd3c6d5aa1076b993752525de449a9933de12
* ZipFileRO: Use precise widths for zip file types.Narayan Kamath2015-06-173-18/+11
| | | | | | | | | | | | | | | | | | getEntryInfo crashes on 64-bit devices because "long" types were being passed int pointers (that pointed to a stack frame) that were reinterpret_cast'ed to long* (sigh.). To fix this issue once and for all, use types with explicitly defined widths. This change also removes some dead invariant checking from Asset.cpp instead of cleaning it up. Note that we've introduced a wart in NativeLibraryHelper, where we need to deal with zlib's uLong type, which is "at least 32 bits wide". bug: 21622286 Change-Id: Iae675a9601db7aae03a8b80b40321d2cc1d97f50
* Add -round and -notround qualifier to android runtime/aaptAdam Lesinski2015-05-152-0/+121
| | | | | | | | 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 file descriptor leak when opening invalid archives.Narayan Kamath2015-05-121-0/+1
| | | | | | | | | | I've inspected all other callers of OpenArchive and this seems to be the only broken one. The easiest way to reproduce this is by using getPackageArchiveInfo or by adding an asset path that isn't a valid APK. bug: https://code.google.com/p/android/issues/detail?id=171099 Change-Id: I41cd85d20f26ad47968e2a6f1384cc03330b558b
* Improve keying for theme caches, rebase system theme on config changeAlan Viverette2015-05-061-0/+24
| | | | | | | | | | | | | | | Themes now use an array of applied styles rather than a String to store their history. They are keyed based on a hash code computed from the history of applied styles. The themed drawable cache has been abstracted out into its own class. Also updates system context to use DayNight as the default and ensures that GlobalActions uses the correct context, which exercises the change. CTS tests have been added in another CL. Bug: 20421157 Change-Id: I9eb4b7dffd198ad24d02f656eaf0839570b59caa
* Merge "Add API for obtaining changing configurations bitmask from Theme" ↵Alan Viverette2015-05-051-0/+10
|\ | | | | | | into mnc-dev
| * Add API for obtaining changing configurations bitmask from ThemeAlan Viverette2015-05-051-0/+10
| | | | | | | | | | | | | | | | Required to know when to reload the system context's theme in response to configuration changes, and thus needed to support the DayNight theme. Bug: 20267825 Change-Id: I7df5e28b7a6d8b611ea030032544cf4800788514
* | am 815d9bb1: Merge "Add a static dependency on libbase."Narayan Kamath2015-04-291-1/+1
|\ \ | |/ |/| | | | | * commit '815d9bb178a0488ed1579cd230d447630ad0891b': Add a static dependency on libbase.
| * Add a static dependency on libbase.Narayan Kamath2015-04-291-1/+1
| | | | | | | | | | | | Used by libziparchive. Change-Id: I120494b620c72b36a725b01f1f274f5dc862a9a3
* | am 05ad674a: am 00e165ae: am e8101c04: Merge "fix compiler error under ↵Nick Kralevich2015-04-251-1/+3
|\ \ | |/ | | | | | | | | | | FORTIFY_SOURCE=2" * commit '05ad674aa888e3f9217de0e5c3176161dd8e31aa': fix compiler error under FORTIFY_SOURCE=2
| * fix compiler error under FORTIFY_SOURCE=2Nick Kralevich2015-04-241-1/+3
| | | | | | | | | | | | | | | | | | | | frameworks/base/libs/androidfw/ObbFile.cpp:340:5: error: ignoring return value of function declared with warn_unused_result attribute [-Werror,-Wunused-result] ftruncate(fd, mFooterStart); ^~~~~~~~~ ~~~~~~~~~~~~~~~~ 1 error generated. amake: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libandroidfw_intermediates/ObbFile.o] Error 1 Change-Id: I7080d64e7a830a10b41c1ebf33c60d32b7c8356e
* | am 7b09e7a9: am 44d7989a: am 571c5a26: Merge "Fix UB in ↵Dan Albert2015-04-153-34/+151
|\ \ | |/ | | | | | | | | | | ResourceTable::stringToInt." * commit '7b09e7a9f3ef804e9cd159023b64eac1ef8b7931': Fix UB in ResourceTable::stringToInt.
| * Fix UB in ResourceTable::stringToInt.Dan Albert2015-04-083-34/+151
| | | | | | | | | | | | | | | | | | | | 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
* | Add payload-size preflight stage to full transport backupChristopher Tate2015-03-261-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now peform a total-size preflight pass before committing data to the wire. This is to eliminate the large superfluous network traffic that would otherwise happen if the transport enforces internal quotas: we now instead ask the transport up front whether it's prepared to accept a given payload size for the package. From the app's perspective this preflight operation is indistinguishable from a full-data backup pass. If the app has provided its own full-data handling in a subclassed backup agent, their usual file-providing code path will be executed. However, the files named for backup during this pass are not opened and read; just measured for their total size. As far as component lifecycles, this measurement pass is simply another call to the agent, immediately after it is bound, with identical timeout semantics to the existing full-data backup invocation. Once the app's file set has been measured the preflight operation invokes a new method on BackupTransport, called checkFullBackupSize(). This method is called after performFullBackup() (which applies any overall whitelist/blacklist policy) but before any data is delivered to the transport via sendBackupData(). The return code from checkFullBackupSize() is similar to the other transport methods: TRANSPORT_OK to permit the full backup to proceed; or TRANSPORT_REJECT_PACKAGE to indicate that the requested payload is unacceptable; or TRANSPORT_ERROR to report a more serious overall transport-level problem that prevents a full-data backup operation from occurring right now. The estimated payload currently does not include the size of the source-package metadata (technically, the manifest entry in its archive payload) or the size of any widget metadata associated with the package's install. In practice this means the preflighted size underestimates by 3 to 5 KB. In addition, the preflight API currently cannot distinguish between payload sizes larger than 2 gigabytes; any payload estimate larger than that is passed as Integer.MAX_VALUE to the checkFullBackupSize() query. Bug 19846750 Change-Id: I44498201e2d4b07482dcb3ca8fa6935dddc467ca
* | Output modified bcp47 tag in ResTable_config::toString()Adam Lesinski2015-03-161-6/+53
| | | | | | | | | | | | | | We expect to be able to parse the output of ResTable_config::toString(), so it should use modified bcp47 (b+en+Latn+US). Change-Id: I597a1779a1fa5cff171c473e6a0368d93b9c7722
* | Enforce null-termination in ResStringPool::stringAtVishwath Mohan2015-03-111-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Rejects any non null-terminated string that a caller asks ResStringPool::stringAt for, returning NULL instead. The rationale for returning NULL rather than amending the string to add a null-terminator is that conformant APK files will have all their strings null-terminated anyway, and that this is a possible signal of a malformed package. Bug: 15288069 Change-Id: I370937b92f2cadf67fbd54203cbc7d1494be969f
* | Prevent integer overflow in ResourceTypesVishwath Mohan2015-03-101-4/+8
| | | | | | | | | | | | | | | | | | | | Adds checks to 2 malloc() calls to ensure that the finally allocated buffer size is not vulnerable to integer overflows. Also includes a sanity check on the upper bound for type_info.numEntries before each call. Bug: 15171384 Change-Id: Ifdf0276bcca7e3d93da7c3577b9486d3c03a9d03
* | am 287c53f4: am 76507a64: am 72dc62ea: Merge "Track removal of refcounts ↵Narayan Kamath2015-02-242-4/+4
|\ \ | |/ | | | | | | | | | | from FileMap." * commit '287c53f4a8bade1cb6c2dd2fe858da9c303e3e3d': Track removal of refcounts from FileMap.
| * am 72dc62ea: Merge "Track removal of refcounts from FileMap."Narayan Kamath2015-02-242-4/+4
| |\ | | | | | | | | | | | | * commit '72dc62ead214bdec5c46d42f4e859b139dba0a00': Track removal of refcounts from FileMap.
| | * Track removal of refcounts from FileMap.Narayan Kamath2015-02-232-4/+4
| | | | | | | | | | | | | | | | | | Use delete instead of release. Change-Id: I25c841b368aa9d51e9259399b94cafa2bbb7a076
* | | am d9bd0886: am aee7225e: Merge "Process base APK" into lmp-mr1-dev ↵Adam Lesinski2015-01-201-1/+7
|\ \ \ | |/ / | | | | | | | | | | | | | | | automerge: 554a6f5 * commit 'd9bd08864eaf9d8847d974eadb81806b9e086a2d': Process base APK
| * | am aee7225e: Merge "Process base APK" into lmp-mr1-devAdam Lesinski2015-01-201-1/+7
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | automerge: 554a6f5 * commit '554a6f5278ec05077d8252249afc911897fbfe76': Process base APK
| | * | Process base APKAdam Lesinski2015-01-161-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The base APK may have resources with configurations that compete against some splits. The base APK must be involved in the selection of splits. Bug:18982001 Change-Id: Ieb29b5a36cf2c68e7831484d98a9fd275acd97e8
| * | | Restore write_delete_fileBrian Carlstrom2015-01-141-0/+7
| | | | | | | | | | | | | | | | Change-Id: Id93a59ae6c82f6068c58b22e2a651ff8a3b8f530
* | | | Restore write_delete_fileBrian Carlstrom2015-01-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit 5baa164aec06a9973a68303bc7752aa76e5c68e5) Change-Id: Ifa9a157346edd479ce03982baf435ab213dc2e79
* | | | am 49138184: am 9568307c: am 43a4a8c7: Fix redundant file backupsChristopher Tate2015-01-151-36/+41
|\ \ \ \ | |/ / / | | | | | | | | | | | | * commit '49138184dee54357b1923f302e4b3fedd73ca34f': Fix redundant file backups
| * | | am 9568307c: am 43a4a8c7: Fix redundant file backupsChristopher Tate2015-01-151-36/+41
| |\ \ \ | | |/ / | | | | | | | | | | | | * commit '9568307cf32c8abc6703dc7a1b0b0fee56c4f8f5': Fix redundant file backups
| | * | Fix redundant file backupsChristopher Tate2015-01-141-38/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We'd observed a bug in which an unchanged file was nevertheless being redundantly transmitted for backup on every backup pass. The underlying issue turns out to have been the FileBackupHelper base implementation's logic for diffing the prior-state file set against the current state, in the case when there had been deletions of prior files. In addition, there was also a parallel bug in which file checksums were not calculated properly in some cases, leading to at least one additional redundant backup of the file in question. Bug 18694053 Change-Id: Ie0dec06486b5fef4624561737019569c85d6b2a0
* | | | am 1e147221: am d6c475dc: am 595ae39f: Merge "Use more intention-revealing ↵Elliott Hughes2015-01-131-1/+3
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | tests for S_ISLNK and S_ISSOCK." * commit '1e14722167210e176cc1f6e702f1a7a98271c6d2': Use more intention-revealing tests for S_ISLNK and S_ISSOCK.
| * | | am d6c475dc: am 595ae39f: Merge "Use more intention-revealing tests for ↵Elliott Hughes2015-01-131-1/+3
| |\ \ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | S_ISLNK and S_ISSOCK." * commit 'd6c475dc246b1681f5c9af9e00ac74183812329c': Use more intention-revealing tests for S_ISLNK and S_ISSOCK.