• Home
  • History
  • Annotate
  • only in /frameworks/base/libs/androidfw/
History log of /frameworks/base/libs/androidfw/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
42eea270a0a2bc54f454312817c41ac357e3a884 16-Jan-2015 Adam Lesinski <adamlesinski@google.com> Process base APK

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
esourceTypes.cpp
43a4a8c777fbb8f71540ac7fbe82674489ef557b 09-Jan-2015 Christopher Tate <ctate@google.com> Fix redundant file backups

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
ackupHelpers.cpp
5dce5e67dbdcd14882edf3f64fba671c77577ee4 10-Dec-2014 Adam Lesinski <adamlesinski@google.com> Fix issue where non-resource attributes would cause obtainStyleAttributes to 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
ests/AttributeFinder_test.cpp
9b624c186cb6059dfb3ec24bfb6386a0fc17b88c 20-Nov-2014 Adam Lesinski <adamlesinski@google.com> AAPT: Move private attrs to new type for framework

Private attributes are typically placed after public
attributes in the resource table. Each time a new version
of the Android framework is released, new public attributes
take the place of the private attributes, and the private
attributes are shifted after the new public ones.

This means that any apps built against the newer SDK
may inadvertently be using private attributes on older
devices.

This change moves all private attributes to a completely
different type ID, so there will never be collisions across
versions.

These private attributes are automatically moved to a synthesized
type only for the system resources.

Bug:18263655

Change-Id: I7a850512953fadcc9f3524d509cea30249782db8
esourceTypes.cpp
cd6f00c3a05717862a88b7409d11176ae53fd9a9 17-Nov-2014 Adam Lesinski <adamlesinski@google.com> Merge "Implement back-tracking when searching for attributes in XML or resource bag" into lmp-mr1-dev
a7d1d73a477fe512d9ea69ee2883084630ec24c4 02-Oct-2014 Adam Lesinski <adamlesinski@google.com> Implement back-tracking when searching for attributes in XML or resource bag

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
esourceTypes.cpp
ests/Android.mk
ests/AttributeFinder_test.cpp
de7de47fef1dcaa26d553665d89e4d3792325c3f 03-Nov-2014 Adam Lesinski <adamlesinski@google.com> Add error checking to aapt for split generation

Change-Id: Ica627db6a671f6a6c35f98bfd9c03598ffe103ce
esourceTypes.cpp
668f0a356cba44c22d8ca0c9f4711613885d46a9 04-Nov-2014 Adam Lesinski <adamlesinski@google.com> Merge "Fix issues that will be present in C++11" into lmp-mr1-dev
4bf58108d442b37ab4adf5ce3a4ecd63472ce254 03-Nov-2014 Adam Lesinski <adamlesinski@google.com> Fix issues that will be present in C++11

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

Change-Id: I869c32637543bbcfb39d2643e7d9df10d33acd3c
ndroid.mk
esourceTypes.cpp
isc.cpp
ests/Android.mk
f2969405020a72e282c348a6ea201d56e9f8d4ba 30-Oct-2014 Alan Viverette <alanv@google.com> Distinguish unspecified and explicit null values in resources

BUG: 17919345
Change-Id: Ic4f04f7dd0f986f58a749b5950d80c1cfdb074ea
esourceTypes.cpp
f001e37b316a0d5b9c9eda08bbe53ea4b06562a3 21-Oct-2014 Adam Lesinski <adamlesinski@google.com> libandroidfw: Do not build device library when building SDK

Building the windows SDK causes a build failure if the device
libandroidfw target is not omitted.

Change-Id: I587b166342d0d047820911d279f192d2b39b6263
ests/Android.mk
60293197379e522c870c4a28462804207bab505d 22-Oct-2014 Adam Lesinski <adamlesinski@google.com> Added some more Split density tests

Change-Id: I3b83515f1240e713bbcff5385cf054bba693f297
ests/Android.mk
ests/ResTable_test.cpp
ests/Split_test.cpp
ests/TestHelpers.cpp
ests/TestHelpers.h
ests/data/app/R.h
ests/data/app/build
ests/data/app/res/values/values.xml
ests/data/basic/R.h
ests/data/basic/basic_arsc.h
ests/data/basic/build
ests/data/basic/res/layout-fr-sw600dp/main.xml
ests/data/basic/res/layout/main.xml
ests/data/basic/res/values-de/values.xml
ests/data/basic/res/values-fr/values.xml
ests/data/basic/res/values-hdpi/values.xml
ests/data/basic/res/values-sv/values.xml
ests/data/basic/res/values-xhdpi/values.xml
ests/data/basic/res/values-xxhdpi/values.xml
ests/data/basic/res/values/values.xml
ests/data/basic/split_de_fr_arsc.h
ests/data/basic/split_hdpi_v4_arsc.h
ests/data/basic/split_xhdpi_v4_arsc.h
ests/data/basic/split_xxhdpi_v4_arsc.h
ests/data/feature/build
ests/data/feature/feature_arsc.h
ests/data/feature/res/values/values.xml
ests/data/lib/R.h
ests/data/lib/build
ests/data/lib/lib_arsc.h
ests/data/lib/res/values/values.xml
ests/data/overlay/build
ests/data/overlay/res/values/values.xml
ests/data/system/R.h
ests/data/system/build
ests/data/system/res/values/themes.xml
e60a87f5529b2867ba3f4e60b39d7b47b67f8ca3 09-Oct-2014 Adam Lesinski <adamlesinski@google.com> Search all packages for a given type string when looking up resources by name

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
esourceTypes.cpp
ests/Split_test.cpp
908c748096d855d47da2f5e20fd4d9d31d1e603c 01-Oct-2014 Adam Powell <adamp@google.com> Revert "Fix issue with using locally defined attrs in a shared lib"

This reverts commit 5069dd69898bd0d9c69ba2bbd37239ec8d1c9dc6.

The reverted commit caused issues loading resources supplied by static libraries.

Bug 17748356

Change-Id: I860a4f31451ee7c03c02974826472a67226b029f
esourceTypes.cpp
5069dd69898bd0d9c69ba2bbd37239ec8d1c9dc6 01-Oct-2014 Adam Lesinski <adamlesinski@google.com> Fix issue with using locally defined attrs in a shared lib

The attribute name resource IDs were never fixed up with
the runtime package ID so we weren't finding attributes
whenever the runtime package ID was different than the build
time one, which happened to be when a shared lib referenced itself
(0x00 vs 0x02).

Bug:17666947
Change-Id: Icf3e874bcea0e27eebe42d60fbed626a34bf9266
esourceTypes.cpp
82a2dd8efe48d3a4e04655f01329da857ace4b7d 18-Sep-2014 Adam Lesinski <adamlesinski@google.com> Fix backwards compat problem with AAPT public attrs

AAPT has traditionally assigned resource IDs to public attributes,
and then followed those public definitions with private attributes.

--- PUBLIC ---
| 0x01010234 | attr/color
| 0x01010235 | attr/background

--- PRIVATE ---
| 0x01010236 | attr/secret
| 0x01010237 | attr/shhh

Each release, when attributes are added, they take the place of the private
attributes and the private attributes are shifted down again.

--- PUBLIC ---
| 0x01010234 | attr/color
| 0x01010235 | attr/background
| 0x01010236 | attr/shinyNewAttr
| 0x01010237 | attr/highlyValuedFeature

--- PRIVATE ---
| 0x01010238 | attr/secret
| 0x01010239 | attr/shhh

Platform code may look for private attributes set in a theme. If an app
compiled against a newer version of the platform uses a new public
attribute that happens to have the same ID as the private attribute
the older platform is expecting, then the behavior is undefined.

We get around this by detecting any newly defined attributes (in L),
copy the resource into a -v21 qualified resource, and delete the
attribute from the original resource. This ensures that older platforms
don't see the new attribute, but when running on L+ platforms, the
attribute will be respected.

We still need to address this problem in the platform moving forward,
as this will only help us in the transition from pre L to L.

Bug:17520380
Change-Id: Ia2a985798b50006c21c7c3431d30d9598f27cd91
esourceTypes.cpp
ests/data/basic/build
9d9cc6233c7035c32d3b8622aa5dc7d413193dc7 29-Aug-2014 Adam Lesinski <adamlesinski@google.com> Add test to ensure themes get copied from separate resource tables

Change-Id: I94e9966cf1e9d0e7e6c7daa0606a87bb0f67705e
ests/Android.mk
ests/Theme_test.cpp
ests/data/app/AndroidManifest.xml
ests/data/app/R.h
ests/data/app/app_arsc.h
ests/data/app/build
ests/data/app/res/values/values.xml
ests/data/system/AndroidManifest.xml
ests/data/system/R.h
ests/data/system/build
ests/data/system/res/values/themes.xml
ests/data/system/system_arsc.h
d79e33379d56e20b7dd67baa992409b72a335ded 29-Aug-2014 Adam Lesinski <adamlesinski@google.com> Clean up test allocations so real memory leaks are more visible

Change-Id: Ic405f08c8d8e3e7fc4e4a991671e980752c19899
ests/BackupData_test.cpp
ests/ObbFile_test.cpp
a9aa9f045836ca03b378653728476f9a298f5260 29-Aug-2014 Adam Lesinski <adamlesinski@google.com> Merge "Fix memory leak in ResTable" into lmp-dev
7f668d03ceec1ce1732f51cfe9828e6376bbecbc 29-Aug-2014 Adam Lesinski <adamlesinski@google.com> Fix memory leak in ResTable

We were basically never cleaning any of the
cached bags... oops :S

Bug:16683269
Change-Id: Ic0a44218f660e16fbaac8df1d61ce6f1fdb0018b
esourceTypes.cpp
ad2d07d2d98a46babb2a9472413fe9ce5080ca76 28-Aug-2014 Adam Lesinski <adamlesinski@google.com> Stamp platform version code into app Apks

The versionCode of theframework resources that an app is built against
gets stamped inside an app's AndroidManifest.xml in the <manifest>
tag as "platformBuildVersionCode" and "platformBuildVersionName"
attributes.

Bug:17207635
Change-Id: Id573c3dffcbca38eec9c0eb3e89f4a547e3361d3
esourceTypes.cpp
31245b4f06003f1c8cd44c31b387c96ab4e282f9 23-Aug-2014 Adam Lesinski <adamlesinski@google.com> Introduce anydpi density resource qualifier

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
esourceTypes.cpp
ests/Android.mk
ests/ConfigLocale_test.cpp
ests/Config_test.cpp
ests/ResourceTypes_test.cpp
ests/TestHelpers.h
6022debdbcc4498736580640c6287b57872617a2 20-Aug-2014 Adam Lesinski <adamlesinski@google.com> AAPT: Fix regression generating dynamic ref table for shared libraries

AAPT stopped generating dynamic reference tables for shared libraries.

Change-Id: Ib0025811bdca1a4756eb21080dd6b6bb3fc1ca3d
esourceTypes.cpp
2cb761e3ddb9d68ab430013e9cd15ecaab9fbc62 15-Aug-2014 Adam Lesinski <adamlesinski@google.com> Fix assumption about DynamicRefTable in aapt

Packages without any resources should not expect to have
a DynamicRefTable.

Bug:16895517
Bug:17056720
Change-Id: Id006f6bdbf08f30505f6ba5982bc9d1b09db0f0a
esourceTypes.cpp
ests/ResTable_test.cpp
89147ed84b140d83e144ad9eaa568cc9c6fb514c 15-Aug-2014 Adam Lesinski <adamlesinski@google.com> Merge "Revert "Fix aapt dump for APKs with no resources"" into lmp-dev
18560886cbb7825c1bb034c96e5d0cd4dbdbb8ee 15-Aug-2014 Adam Lesinski <adamlesinski@google.com> Revert "Fix aapt dump for APKs with no resources"

This reverts commit 0e475302cd196f45a01a525c49089018b238d4ba.

I'll re-upload this CL with the correct fix in LoadedApk.

Change-Id: I17c6381f8e5907dab9f996f89c5d435b9c08a13a
esourceTypes.cpp
ests/ResTable_test.cpp
4b2d0f20db2e0f9395a0c12ed5d4b6020eb272cb 15-Aug-2014 Adam Lesinski <adamlesinski@google.com> Fix crash in ResStringPool

When a String isn't found in the StringPool,
we should not try to construct a String8 object
from the NULL string.

Bug:15163956
Change-Id: I51e701918b10a72c18a860b8a36dce2afd9c0b82
esourceTypes.cpp
e23a91e2bdab06e3c0c64201e88e50ab76c6b74b 14-Aug-2014 Adam Lesinski <adamlesinski@google.com> Fix aapt dump for APKs with no resources

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
esourceTypes.cpp
ests/ResTable_test.cpp
d7df9d7b38064b81e1b035893001499e79fc3cc0 15-Aug-2014 Adam Lesinski <adamlesinski@google.com> Merge "Fix aapt dump for APKs with no resources" into lmp-dev
8d5667d2a283bc9e35cfe8a7e77c9143c8957004 14-Aug-2014 Adam Lesinski <adamlesinski@google.com> Print xxxhdpi from ResTable_config::toString

Change-Id: I2e1a07649cb498c12023b198d8e50534f9d91840
esourceTypes.cpp
ccf25c7bf69eb8c04246e3f79da31b52c2922a80 09-Aug-2014 Adam Lesinski <adamlesinski@google.com> Fix shared library bug in bag attributes

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
esourceTypes.cpp
ests/Idmap_test.cpp
ests/ResTable_test.cpp
ests/Split_test.cpp
ests/data/R.h
ests/data/basic/R.h
ests/data/lib/AndroidManifest.xml
ests/data/lib/R.h
ests/data/lib/build
ests/data/lib/lib_arsc.h
ests/data/lib/res/values/values.xml
833f3ccbc8f4dd1ec8abb9121988b99ff34ec4c1 19-Jun-2014 Adam Lesinski <adamlesinski@google.com> AAPT support for feature splits

This change allows the developer to add a base package for
which to build a feature split. The generated resource types
will begin after the base APK's defined types so as not
to collide or override resources.

Multiple features can be generated by first choosing an
arbitrary order for the features. Then for each feature,
the base APK and any preceding features are specified
with the --feature-of flags.

So with a base APK 'A' and features, 'B', and 'C',
'B' would be built with

aapt package [...] --feature-of A [...]

and 'C' would be built with

aapt package [...] --feature-of A --feature-of B [...]

Change-Id: I1be66e3f8df9a737b21c71f8a93685376c7e6780
esourceTypes.cpp
ests/Idmap_test.cpp
ests/ResTable_test.cpp
ests/Split_test.cpp
ests/data/R.h
ests/data/basic/basic_arsc.h
ests/data/basic/build
ests/data/basic/res/layout-fr-sw600dp/main.xml
ests/data/basic/res/layout/main.xml
ests/data/basic/res/values-de/values.xml
ests/data/basic/res/values-fr/values.xml
ests/data/basic/split_de_fr_arsc.h
ests/data/feature/AndroidManifest.xml
ests/data/feature/build
ests/data/feature/feature_arsc.h
ests/data/feature/res/values/values.xml
ests/data/split_base_arsc.h
ests/data/split_de_fr_arsc.h
f28d505dc5f72d82cd791a5b9c7be3775eab75e5 26-Jul-2014 Adam Lesinski <adamlesinski@google.com> Ensure the ResTable data is at least the size of a ResTable_header

Change-Id: Ib8d5574bd6a125797a582837987332e66721e84d
esourceTypes.cpp
7df3625d5bb28d11cce9ac23429f5e3c6ebac030 16-Jan-2014 Martin Kosiba <mkosiba@google.com> Allow for appending of resources to an AssetManager.

BUG: 11505352
Change-Id: Ifa290580a6dc63c2f471d0bbf5f066db14aed4d7
ssetManager.cpp
e8e968a7c6f08c8db0603143d775863301cb03d6 10-Jul-2014 Elliott Hughes <enh@google.com> am 583a845c: am 3964ea46: am d74f99d3: Merge "Switch frameworks/base/libs/androidfw to the new icu."

* commit '583a845c6eb6308d7ada72cb0e91444efc91cc54':
Switch frameworks/base/libs/androidfw to the new icu.
583a845c6eb6308d7ada72cb0e91444efc91cc54 10-Jul-2014 Elliott Hughes <enh@google.com> am 3964ea46: am d74f99d3: Merge "Switch frameworks/base/libs/androidfw to the new icu."

* commit '3964ea46750cd5715f29ad4d9cada4a35208ad7a':
Switch frameworks/base/libs/androidfw to the new icu.
6a4deeda70698d7574d20a97c746ed2ba52f5b8d 10-Jul-2014 Elliott Hughes <enh@google.com> Switch frameworks/base/libs/androidfw to the new icu.

Change-Id: Id82830750dd7e83bbc66811a1133b403cc697c97
ndroid.mk
10eb3b0665dd7c636af5f0d657512c1a2e309e0c 07-Jul-2014 Narayan Kamath <narayan@google.com> am e0849423: am 501bb0a5: Merge "Fix issue when converting fil->tl."

* commit 'e0849423214007d4377638fb42db15276e3ca575':
Fix issue when converting fil->tl.
fec5106c8ea5791614385c17bd1bf0ecff9afe9a 05-Jul-2014 Narayan Kamath <narayan@google.com> Fix issue when converting fil->tl.

We should call ResourceTable::getLocales directly,
and not AssetManager::getLocales. The latter will convert
"tl" to "fil" so we'll end up thinking we have resources
for "fil" when we don't really have any.

bug: 15873165

Change-Id: I9753e4608aaecede328a40ee1f3ee6b016d0dedc
ssetManager.cpp
23902f5f4d0d6665d6837d3d085d3c11b5aa1ec0 07-Jul-2014 Narayan Kamath <narayan@google.com> am 10eb3b06: am e0849423: am 501bb0a5: Merge "Fix issue when converting fil->tl."

* commit '10eb3b0665dd7c636af5f0d657512c1a2e309e0c':
Fix issue when converting fil->tl.
a00144ca898ec23c02d3cc4be0ce1bdfee53faf3 03-Jul-2014 Nick Kralevich <nnk@google.com> resolved conflicts for merge of a8dbd7b4 to master

Change-Id: I90f42546c6d0a8f21af3041e59baf6a226247b1c
a8dbd7b433c2fff81881b5750529689d16f7f06b 02-Jul-2014 Narayan Kamath <narayan@google.com> am 39e4f590: am f56399f6: Merge "Fall back to "tl" if "fil" is absent."

* commit '39e4f590787246ce35b995c0c0ce37b676a05e0c':
Fall back to "tl" if "fil" is absent.
e4345dbd2a892f38e62269d94e5ee7002d121bed 26-Jun-2014 Narayan Kamath <narayan@google.com> Fall back to "tl" if "fil" is absent.

For JB-MR1, there was a hack that used "tl" where
we really meant "fil" because ICU didn't have localizations
for "fil". This has now been fixed, and we now support 3 letter
language codes for AAPT so we can use "fil" where required.

For the benefit of apps that need to target older platforms,
we fall back to "tl" if the app has assets for "tl" and the
resource locale is "fil".

See bugs 7291355, 7207176 and 8049507 for more context.

Change-Id: I1ac8502525f99b40f9091d5efd2df33518d47a41
ssetManager.cpp
8c1c0a6881b1507f9ae25d753b64de185a7615b2 01-Jul-2014 Narayan Kamath <narayan@google.com> am 7f319c47: am 1dc550fa: Merge "Fix packing of values at offset 16."

* commit '7f319c47c8f5e947638eb1e5e73789ff83123bba':
Fix packing of values at offset 16.
b2975916224caecfc2fbb84e71ebd625ce6eeb1c 30-Jun-2014 Narayan Kamath <narayan@google.com> Fix packing of values at offset 16.

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
esourceTypes.cpp
ests/ResourceTypes_test.cpp
c7400b0ce66e916cf8be239c26cd5acbd15ef745 01-Jul-2014 Narayan Kamath <narayan@google.com> am 8c1c0a68: am 7f319c47: am 1dc550fa: Merge "Fix packing of values at offset 16."

* commit '8c1c0a6881b1507f9ae25d753b64de185a7615b2':
Fix packing of values at offset 16.
70bf06986a90c21137fc4836aa0e56d68a2ab588 24-Jun-2014 Narayan Kamath <narayan@google.com> am b20b0629: am 71dfc7e9: Merge "Memory leak in parsePackage"

* commit 'b20b0629c2ea6a8e1f7bebd0791dd21e545a4605':
Memory leak in parsePackage
71dfc7e9accc1ca3cda52bdf475b03fa2a334e78 24-Jun-2014 Narayan Kamath <narayan@google.com> Merge "Memory leak in parsePackage"
5f7ce10c937abf7da6d547ae91bda495dfbc414d 18-Jun-2014 Henrik Baard <henrik.baard@sonymobile.com> Memory leak in parsePackage

The method parsePackage failes to delete some resources
in case of failures.

Added delete of "package" in the cases that was previously
missed.

Change-Id: I183e9ec5864c5ed18bb48410ab41317cb3d96bda
esourceTypes.cpp
fb600d60c06192f1a5b1c09bc86f92a80894a6c1 18-Jun-2014 Adam Lesinski <adamlesinski@google.com> Fix build break in log statement

For logging purposes, a uint32_t was being converted into
a void pointer, which on certain systems would be a conversion
to a different size.

Change-Id: I90af69ab975d84c9c8cbb1cce94ff4e9cc6edcf2
ypeWrappers.cpp
f90f2f8dc36e7243b85e0b6a7fd5a590893c827e 06-Jun-2014 Adam Lesinski <adamlesinski@google.com> Support multiple resource tables with same package

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

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

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

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

Change-Id: If6f5be680b405b368941d9c1f2b5d2ddca964160
ndroid.mk
ssetManager.cpp
esourceTypes.cpp
ypeWrappers.cpp
ests/Android.mk
ests/ByteBucketArray_test.cpp
ests/Idmap_test.cpp
ests/ResTable_test.cpp
ests/ResourceTypes_test.cpp
ests/Split_test.cpp
ests/TestHelpers.h
ests/TypeWrappers_test.cpp
ests/data/.gitignore
ests/data/basic/AndroidManifest.xml
ests/data/basic/basic_arsc.h
ests/data/basic/build
ests/data/basic/res/values-sv/values.xml
ests/data/basic/res/values/values.xml
ests/data/overlay/AndroidManifest.xml
ests/data/overlay/build
ests/data/overlay/overlay_arsc.h
ests/data/overlay/res/values/values.xml
ests/data/split_base_arsc.h
ests/data/split_de_fr_arsc.h
f5cb96cfbbd2a7148b4b337097c94bea3f52d5f3 17-Jun-2014 Adam Lesinski <adamlesinski@google.com> am 51736de1: am 4c488cca: Merge "[Asset Manager] Fix memory leakage bug"

* commit '51736de19a4c225a54cda73754d0f57aa68def4f':
[Asset Manager] Fix memory leakage bug
7efc0eb163e8d07963c354805b6f36010aa74106 17-Jun-2014 Adam Lesinski <adamlesinski@google.com> am f5cb96cf: am 51736de1: am 4c488cca: Merge "[Asset Manager] Fix memory leakage bug"

* commit 'f5cb96cfbbd2a7148b4b337097c94bea3f52d5f3':
[Asset Manager] Fix memory leakage bug
7c57d2337150ab52c148d30d9126f3b99ca951b4 16-Jun-2014 sean_lu <sean_lu@htc.com> [Asset Manager] Fix memory leakage bug

Symptom: memory leakage
Root Cause: new SortedVector but not free it in native cpp
Solution: free the SortedVector
Project: AOSP
Note:

Change-Id: Iab5a7f2e8d8509631301e7231427927d4797c856
ssetManager.cpp
961dda77965203da05df2c865d42a1968d622343 10-Jun-2014 Adam Lesinski <adamlesinski@google.com> Creating an empty package should be succesfull

Bug: 15473436
Change-Id: I788deb21a1298281c508429bab635aa713803984
esourceTypes.cpp
7322ea7b73000ef50be18d72750624bb1832dec4 14-May-2014 Adam Lesinski <adamlesinski@google.com> Fix potential crash in libandroidfw

A malformed APK may cause a crash if it
encodes its chunk size as a signed number
(MSB set to 1).

Bug:14898892
Change-Id: I342853c2b0859e5be15d712d451323afc367d329
esourceTypes.cpp
fab50875b98e8274ac8ee44b38ba42521bbbf1f9 16-Apr-2014 Adam Lesinski <adamlesinski@google.com> Add support for building split APKs

Build multiple APKs, each containing a disjoint subset
of configurations. These can then be loaded into the device
AssetManager and should operate as if they were never split.

Use the idea of building multiple sets of files, where each
set represents an APK. An ApkBuilder can place files
in a set based on its configuration, but you can actually
add directly to a set, in the case of the resources.arsc and
generated AndroidManifest.xml for splits.

Change-Id: Ic65d3f0ac1bbd290185695b9971d425c85ab1de3
esourceTypes.cpp
0a0454fdcc7aeac6e57f9466da8f39bcf5f3f6ec 04-Apr-2014 John Spurlock <jspurlock@google.com> am 642421aa: am 5c31e487: Merge "Introduce new UI_MODE_TYPE_WATCH and qualifier." into klp-modular-dev

* commit '642421aa7f284817cc1a972a7f9c7a64696a0116':
Introduce new UI_MODE_TYPE_WATCH and qualifier.
642421aa7f284817cc1a972a7f9c7a64696a0116 04-Apr-2014 John Spurlock <jspurlock@google.com> am 5c31e487: Merge "Introduce new UI_MODE_TYPE_WATCH and qualifier." into klp-modular-dev

* commit '5c31e487c4577e1c47ee7c949325d6a13f0d462e':
Introduce new UI_MODE_TYPE_WATCH and qualifier.
6c191299a73388cd593809c0b66bafbd08fd2982 03-Apr-2014 John Spurlock <jspurlock@google.com> Introduce new UI_MODE_TYPE_WATCH and qualifier.

Default ui mode to watch if we have FEATURE_WATCH.

Bug:13395758
Change-Id: Ie5ff95de60e69e91ad3612c7d2f1fca7f49061bd
esourceTypes.cpp
ecd072161ec57ba8dfb26659511c0f6605601560 27-Mar-2014 Narayan Kamath <narayan@google.com> resolved conflicts for merge of 22d07464 to master

Change-Id: Ic037261eedd6e224938c960d2b4597590c81ed9d
f5df700e6ce056ebfa322314d970e52d6facc35a 25-Mar-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Make frameworks/base code more portable

Changes in this patch include

[x] Use %zu for size_t, %zd for ssize_t

[x] Some minor changes have been done to conform with
standard JNI practice (e.g. use of jint instead of int
in JNI function prototypes)

Change-Id: Id1aaa7894a7d0b85ac7ecd7b2bfd8cc40374261f
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
ackupData.cpp
ackupHelpers.cpp
ursorWindow.cpp
esourceTypes.cpp
de898ff42912bd7ca1bfb099cd439562496765a4 30-Jan-2014 Adam Lesinski <adamlesinski@google.com> Shared library resource support

Shared libraries can now export resources for applications
to use.

Exporting resources works the same way the framework exports
resources, by defining the public symbols in res/values/public.xml.

Building a shared library requires aapt to be invoked with the
--shared-lib option. Shared libraries will be assigned a package
ID of 0x00 at build-time. At runtime, all loaded shared libraries
will be assigned a new package ID.

Currently, shared libraries should not import other shared libraries,
as those dependencies will not be loaded at runtime.

At runtime, reflection is used to update the package ID of resource
symbols in the shared library's R class file. The package name of
the R class file is assumed to be the same as the shared library's
package name declared in its manifest. This will be customizable in
a future commit.

See /tests/SharedLibrary/ for examples of a shared library and its
client.

Bug:12724178
Change-Id: I60c0cb8ab87849f8f8a1a13431562fe8603020a7
ssetManager.cpp
esourceTypes.cpp
ests/ObbFile_test.cpp
7e9e30599439a15c9a08206c10ef8b9d164e695b 19-Mar-2014 Mark Salyzyn <salyzyn@google.com> am 9ca25502: am 48250e14: am 9a09a523: am 0b472ae1: Merge "androidfw: resolve 64-bit build issues"

* commit '9ca25502c05854288733ee5142e8bf6594821f83':
androidfw: resolve 64-bit build issues
00adb8685ee996f9d2650d617c8c0e98f13ef406 19-Mar-2014 Mark Salyzyn <salyzyn@google.com> androidfw: resolve 64-bit build issues

- uid_t/gid_t cast to unsigned long
- unused argument warnings
- tab and space requirements

Change-Id: Ib446d8165b9082be02edb55e6b71fd1a03ea3431
sset.cpp
ackupData.cpp
ackupHelpers.cpp
ursorWindow.cpp
esourceTypes.cpp
ipUtils.cpp
b5c4e7fd3866bbe30d7ea4d7bc463da5a70970e2 10-Mar-2014 Narayan Kamath <narayan@google.com> resolved conflicts for merge of 92860a74 to master

Change-Id: I3036ef9f1251c756092dc5ee2c4fed8146855e1e
6381dd4ff212a95be30d2b445d40ff419ab076b4 03-Mar-2014 Narayan Kamath <narayan@google.com> LP64: Make 9 patches architecture agnostic.

The Res_png_9patch struct had several pointer members
whose size differed between 32 and 64 bit platforms.

These members have been replaced by uint32_t offsets
to serialized data. The serialized form for 9patches
places a Res_png_9patch object at the beginning of
serialized data, followed by int32_t arrays of xDivs,
yDivs and colors.

Note that these offsets are not strictly required,
since they can be computed from the values of numXDivs,
numYDivs & numColors, however they are called in tight
loops so having them computed once is a beneficial.

This change also removed the unused patch_equals function
from aapt's Image.cpp.

Change-Id: I3b9ac8ae5c05510d41377cae4dff1c69b40c2531
esourceTypes.cpp
e0d10cd92369d56e593e8592084024d1cd1655db 28-Feb-2014 Narayan Kamath <narayan@google.com> am d8ccf8b7: am be094d89: am 8fb22ae7: am eee2c72f: Merge "Various format string fixes for 64bit"

* commit 'd8ccf8b789461e1706d10df44d109849fa974fc5':
Various format string fixes for 64bit
95ece35c2f8b86203e88b49d67cef8e80e107a2b 13-Feb-2014 Kévin PETIT <kevin.petit@arm.com> Various format string fixes for 64bit

Change-Id: I74532a4e0400033f5ee3e3f6827ac42f77d16f53
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
ackupHelpers.cpp
b048c33d5bdaec747195dfedf971d4d9155f5000 21-Feb-2014 Christopher Tate <ctate@google.com> Don't assume that we're at start of file at ctor time

BackupDataReader / BackupDataWriter were implicitly assuming that when
instantiated, the underlying fd was positioned at start-of-file. If one
tried to e.g. open an existing data stream to append further data to it,
things might randomly fail (at read time, possibly when consuming the
stream later) due to incorrect alignment of the data entities: the
appending writer would assume that no padding was needed to achieve
correct alignment, and this might easily be false.

Now the underlying native reader/writer helpers recognize the true
position within the file when constructed, and as a result it's now
safe to e.g. construct a BackupDataOutput for an existing file and
then append to it.

Change-Id: If0484921e687852f923a4b4efabff573a6c16981
ackupData.cpp
f9bf991cb57e8835a2dcffb35853b4d77ac7b2c4 20-Feb-2014 Narayan Kamath <narayan@google.com> am bcb433b4: am b1903653: am 128599e4: am 2b3c14bf: Merge "libandroidfw: fix build error for 64-bit"

* commit 'bcb433b43acb424ff7bc6afab03ce12d8cc9a198':
libandroidfw: fix build error for 64-bit
443dd9313f06ec61abc9fee908f6e693d1091590 12-Feb-2014 Patrik Bannura <patrik.bannura@sonymobile.com> libandroidfw: fix build error for 64-bit

Fixed casting int to pointer in logging code.
Previously ints where printed as pointers and
the %p format specifier was used for convenience
to get hex output. This change uses %x and also
gets rid of the casts.

Change-Id: Ia2539769d245f50c0f3884119f80682defe69d61
esourceTypes.cpp
788fa41482b9d398591b7db8b0b01839029611ad 21-Jan-2014 Narayan Kamath <narayan@google.com> Extended locales in AAPT / AssetManager.

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

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

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

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

(cherry-picked from commit 91447d88f2bdf9c2bf8d1a53570efef6172fba74)

Change-Id: I1b43086860661012f949fb8e5deb7df44519b854
ssetManager.cpp
esourceTypes.cpp
ests/ResourceTypes_test.cpp
48620f1d1b03e1cb4e0dce4999e0a4c2daf3a1b2 20-Jan-2014 Narayan Kamath <narayan@google.com> AssetManager support for 3 letter lang/country codes.

- 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
esourceTypes.cpp
ests/Android.mk
ests/ResourceTypes_test.cpp
d5c8044e7e1f1402fdd4a035690329294ab07b33 12-Feb-2014 Nick Kralevich <nnk@google.com> resolved conflicts for merge of 1cbea39f to master

Change-Id: Ib33484546c6a03cbc4cd96e97d9d785d68e10700
1cbea39fe1740d7d1c3e4aa0e4771a99a56c79ef 12-Feb-2014 Nick Kralevich <nnk@google.com> resolved conflicts for merge of dd3d95f1 to klp-volantis-dev

Change-Id: I96c0f0da852a0b3cf8aef9158678d38aa30f456f
ecbeae74f299f44f9ec4c79ddd885e999d4e1b64 12-Feb-2014 Colin Cross <ccross@android.com> Use size_t* in AssetManager::createIdmap

ResTable::createIdmap takes a size_t*, and the idmap command is
passing in a size_t*, make AssetManager::createIdmap take a
size_t*. Should fix the mac build.

Change-Id: Idc16dedfe2aa7367c75f89a937a8242d494e8f8e
ssetManager.cpp
d9e385b111ebf811beb0f29178a2fbd4d667509f 11-Feb-2014 Dianne Hackborn <hackbod@google.com> Fix build.

At least part of what is broken. Other stuff still seems to be.

Change-Id: I367dc0377bd5b4e59d9d9b68f3506bf1d64aa591
(cherry picked from commit 32bb5fae353b5bb6275e75952e89c514c7369cee)
ssetManager.cpp
32bb5fae353b5bb6275e75952e89c514c7369cee 11-Feb-2014 Dianne Hackborn <hackbod@google.com> Fix build.

At least part of what is broken. Other stuff still seems to be.

Change-Id: I367dc0377bd5b4e59d9d9b68f3506bf1d64aa591
ssetManager.cpp
47b80be208fcc1d4824bc24959080233a44041db 11-Feb-2014 Dianne Hackborn <hackbod@android.com> am be49403a: am 0cd115e1: am 578087e3: Merge "New command line tool \'idmap\'"

* commit 'be49403a0362c18edaeafe59ac09baac14294dee':
New command line tool 'idmap'
91447d88f2bdf9c2bf8d1a53570efef6172fba74 21-Jan-2014 Narayan Kamath <narayan@google.com> Extended locales in AAPT / AssetManager.

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

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

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

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

Change-Id: I899a56a9a182ee6be52b9389d1ae59266f5482e9
ssetManager.cpp
esourceTypes.cpp
ests/ResourceTypes_test.cpp
378c6775a62d9c461cde51f06c1b14bb014c78fd 20-Jan-2014 Narayan Kamath <narayan@google.com> AssetManager support for 3 letter lang/country codes.

- 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
esourceTypes.cpp
ests/Android.mk
ests/ResourceTypes_test.cpp
48d22323ce39f9aab003dce74456889b6414af55 31-Jan-2014 Mårten Kongstad <marten.kongstad@sonymobile.com> Runtime resource overlay, iteration 2

Support any number of overlay packages. Support any target package.

UPDATED PACKAGE MATCHING
------------------------
In Runtime resource overlay, iteration 1, only a single overlay package
was considered. Package matching was based on file paths:
/vendor/overlay/system/framework-res.apk corresponded to
/system/framework-res.apk. Introduce a more flexible matching scheme
where any package is an overlay package if its manifest includes

<overlay targetPackage="com.target.package"/>

For security reasons, an overlay package must fulfill certain criteria
to take effect: see below.

THE IDMAP TOOL AND IDMAP FILES
------------------------------
Idmap files are created by the 'idmap' binary; idmap files must be
present when loading packages. For the Android system, Zygote calls
'idmap' as part of the resource pre-loading. For application packages,
'idmap' is invoked via 'installd' during package installation (similar
to 'dexopt').

UPDATED FLOW
------------
The following is an outline of the start-up sequences for the Android
system and Android apps. Steps marked with '+' are introduced by this
commit.

Zygote initialization
Initial AssetManager object created
+ idmap --scan creates idmaps for overlays targeting 'android', \
stores list of overlays in /data/resource-cache/overlays.list
AssetManager caches framework-res.apk
+ AssetManager caches overlay packages listed in overlays.list

Android boot
New AssetManager's ResTable acquired
AssetManager re-uses cached framework-res.apk
+ AssetManager re-uses cached 'android' overlays (if any)

App boot
ActivityThread prepares AssetManager to load app.apk
+ ActivityThread prepares AssetManager to load app overlays (if any)
New AssetManager's ResTable acquired as per Android boot

SECURITY
--------
Overlay packages are required to be pre-loaded (in /vendor/overlay).
These packages are trusted by definition. A future iteration of runtime
resource overlay may add support for downloaded overlays, which would
likely require target and overlay signatures match for the overlay to
be trusted.

LOOKUP PRIORITY
---------------
During resource lookup, packages are sequentially queried to provide a
best match, given the constraints of the current configuration. If any
package provide a better match than what has been found so far, it
replaces the previous match. The target package is always queried last.

When loading a package with more than one overlay, the order in which
the overlays are added become significant if several packages overlay
the same resource.

Had downloaded overlays been supported, the install time could have been
used to determine the load order. Regardless, for pre-installed
overlays, the install time is randomly determined by the order in which
the Package Manager locates the packages during initial boot. To support
a well-defined order, pre-installed overlay packages are expected to
define an additional 'priority' attribute in their <overlay> tags:

<overlay targetPackage="com.target.package" priority="1234"/>

Pre-installed overlays are loaded in order of their priority attributes,
sorted in ascending order.

Assigning the same priority to several overlays targeting the same base
package leads to undefined behaviour. It is the responsibility of the
vendor to avoid this.

The following example shows the ResTable and PackageGroups after loading
an application and two overlays. The resource lookup framework will
query the packages in the order C, B, A.

+------+------+- -+------+------+
| 0x01 | | ... | | 0x7f |
+------+------+- -+------+------+
| |
"android" Target package A
|
Pre-installed overlay B (priority 1)
|
Pre-installed overlay C (priority 2)

Change-Id: If49c963149369b1957f7d2303b3dd27f669ed24e
ssetManager.cpp
esourceTypes.cpp
65a05fd56dbc9fd9c2511a97f49c445a748fb3c5 31-Jan-2014 Mårten Kongstad <marten.kongstad@sonymobile.com> New command line tool 'idmap'

Introduce a new tool 'idmap' to handle generation and verification of
idmap files. The tool is modelled on 'dexopt', and is intended to be
used similarly, notably by 'installd'.
See cmds/idmap/idmap.cpp for further documentation on 'idmap'.

Note: this commit is interdependent on a commit in project build/ to add
'idmap' to PRODUCT_PACKAGES.

Note: the changes to androidfw are only stubs. The actual implementation
will be provided in Runtime resource overlay, iteration 2.

Change-Id: I7131b74ece1e46c8a9c0a31d103e686aa07da2bb
ssetManager.cpp
esourceTypes.cpp
7c4887f66bfa3dad16f8b03dc825ade96d7de130 27-Jan-2014 Narayan Kamath <narayan@google.com> Change ResourceType cookies to int32_t.

Also change the order of parameters in ResTable constructors
to avoid ambiguity.

(cherry picked from commit 00b314436f4fdfada4bbf1e79ec12e9fa38aeaf1)

Change-Id: I874c5d03c134dc3c331fba423b5280366296287c
ssetManager.cpp
esourceTypes.cpp
00b314436f4fdfada4bbf1e79ec12e9fa38aeaf1 27-Jan-2014 Narayan Kamath <narayan@google.com> Change ResourceType cookies to int32_t.

Also change the order of parameters in ResTable constructors
to avoid ambiguity.

Change-Id: If7bfa1f640dddca39b9f26a3ce84081fa7b6e6e3
ssetManager.cpp
esourceTypes.cpp
a0c6260705c841f501282e0e337970ca9a00e064 24-Jan-2014 Narayan Kamath <narayan@google.com> AssetManager cookies should be int32_t and not void*.

Cookies are really indices into vectors and arrays, so
they don't need to be void*. We choose int32_t instead
of size_t to allow their width to be well specified.

Change-Id: I319f271bd4f102dee7cb9f00df4c75ea697456f5
ssetManager.cpp
90f58dbf79057b185b04c5003c8bcae10116409b 11-Dec-2013 Narayan Kamath <narayan@google.com> Add libutils dependency for libandroidfw host build.

(cherry picked from commit 070274ec0ccb8643c52e41e4119f356f0f51bc36)

Change-Id: I25acff1d36b3adce14b2576485bda93c914d7f5d
ndroid.mk
560566d2915c03bed338fc532ac7f7aa3620cfdf 03-Dec-2013 Narayan Kamath <narayan@google.com> Reimplement ZipFileRO in terms of libziparchive.

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
ndroid.mk
sset.cpp
ssetManager.cpp
ipFileRO.cpp
ipUtils.cpp
ests/Android.mk
ests/ZipFileRO_test.cpp
ests/ZipUtils_test.cpp
e1aa223657dd1def8609b377afa86a024bfd4e14 29-Oct-2013 Elliott Hughes <enh@google.com> Re-apply androidfw fixes lost by the directory rearrangement.

Assignment to wrong variable in libs/androidfw/AssetManager.cpp.
https://code.google.com/p/android/issues/detail?id=61560

Missing delete[]s in libs/androidfw/ObbFile.cpp.
https://code.google.com/p/android/issues/detail?id=61549

Change-Id: I24e6867284d70a7793d78e62d1a836cbee310fb0
ssetManager.cpp
bbFile.cpp
16c4d154dca43c662571129af31b27433b919a32 24-Jan-2014 Adam Lesinski <adamlesinski@google.com> Revert "move libandroidfw to frameworks/native"

This reverts commit 84b6292c33d71b5739828d08aa8101d1954577f2.
ndroid.mk
sset.cpp
ssetDir.cpp
ssetManager.cpp
ackupData.cpp
ackupHelpers.cpp
ursorWindow.cpp
ODULE_LICENSE_APACHE2
OTICE
bbFile.cpp
esourceTypes.cpp
treamingZipInflater.cpp
ipFileRO.cpp
ipUtils.cpp
isc.cpp
ests/Android.mk
ests/BackupData_test.cpp
ests/ObbFile_test.cpp
ests/ZipFileRO_test.cpp
745d4efc8369d255341d810790132660e33d3b61 27-Jan-2014 Narayan Kamath <narayan@google.com> AssetManager cookies should be int32_t and not void*.

Cookies are really indices into vectors and arrays, so
they don't need to be void*. We choose int32_t instead
of size_t to allow their width to be well specified.

(cherry picked from commit ebfdd0f467e39c3af8d92cade78263935340acb7)
(cherry picked from commit a7fa2e592e2e579e5acdb903dba83fc074ebc215)
(cherry picked from commit a9d5701b034ed2d9771b3f0943e1add00741d7cd)

Change-Id: I2aed3db568b6fdc487bf99e2c5dd123206736fda
ssetManager.cpp
070274ec0ccb8643c52e41e4119f356f0f51bc36 11-Dec-2013 Narayan Kamath <narayan@google.com> Add libutils dependency for libandroidfw host build.

Change-Id: I7fe0bb466f0b1cdbfef8934da2231ad20f05b648
ndroid.mk
afd31e08299008fdc5c2813f21b2573f29dc53df 03-Dec-2013 Narayan Kamath <narayan@google.com> Reimplement ZipFileRO in terms of libziparchive.

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
ndroid.mk
sset.cpp
ssetManager.cpp
ipFileRO.cpp
ipUtils.cpp
ests/Android.mk
ests/ZipFileRO_test.cpp
ests/ZipUtils_test.cpp
dbccd44a638ae8705a5b14bff8b2dd74abc26045 22-Nov-2013 The Android Open Source Project <initial-contribution@android.com> Merge commit 'b873a17ce7be0a9771c24999adca6964431728f6' into HEAD

Change-Id: I938755073e70602cc8f51ce9bd420fdcf870cecd
c367d48c55e5a3fa0df14fd62889e4bb6b63cb01 29-Oct-2013 Elliott Hughes <enh@google.com> Fix a variety of small publicly-reported bugs.

Possible NULL dereference in cmds/bootanimation/BootAnimation.cpp.
https://code.google.com/p/android/issues/detail?id=61556

Missing fclose in core/jni/android_os_Debug.cpp.
https://code.google.com/p/android/issues/detail?id=61546

Bad loop guards in core/jni/android_util_Process.cpp.
https://code.google.com/p/android/issues/detail?id=61557

Assignment to wrong variable in libs/androidfw/AssetManager.cpp.
https://code.google.com/p/android/issues/detail?id=61560

Missing delete[]s in libs/androidfw/ObbFile.cpp.
https://code.google.com/p/android/issues/detail?id=61549

Leaks on error in tools/aapt/Images.cpp.
https://code.google.com/p/android/issues/detail?id=61552

Two missing fclose calls in tools/aapt/Resource.cpp.
https://code.google.com/p/android/issues/detail?id=61553

Missing fclose in tools/aidl/aidl.cpp.
https://code.google.com/p/android/issues/detail?id=61554

Change-Id: I5820f3824e72d07a9acb776cf0af3e7443f5694a
ssetManager.cpp
bbFile.cpp
84b6292c33d71b5739828d08aa8101d1954577f2 03-Oct-2013 Mike Lockwood <lockwood@google.com> move libandroidfw to frameworks/native

Change-Id: Ic5b8a2742c7141156ab0f00ca29097bfe92bce60
ndroid.mk
sset.cpp
ssetDir.cpp
ssetManager.cpp
ackupData.cpp
ackupHelpers.cpp
ursorWindow.cpp
ODULE_LICENSE_APACHE2
OTICE
bbFile.cpp
esourceTypes.cpp
treamingZipInflater.cpp
ipFileRO.cpp
ipUtils.cpp
isc.cpp
ests/Android.mk
ests/BackupData_test.cpp
ests/ObbFile_test.cpp
ests/ZipFileRO_test.cpp
fd5f566db84722f9cf54085d8a378e9398ef260d 19-Sep-2013 Chris Wren <cwren@android.com> add a test for BackupData helpers.

Bug: 10821481
Change-Id: I3e28123d36927ae4a22d26378b8bf1cd4e87cfd2
ests/Android.mk
ests/BackupData_test.cpp
1c7cf90af4d81e609dcb6b0f9afa5787e2a8a344 12-Sep-2013 Kenny Root <kroot@google.com> Fix another off-by-one error in ZipFileRO

Bug: 10424836
Change-Id: I491458bd31ef39e87127d061427b32a3d59ac807
ipFileRO.cpp
0d6c2d7b9db209d740992045dd3b842e52306598 21-Aug-2013 Kenny Root <kroot@google.com> Reconcile differences between zip implementations

Reconcile the difference between ZipFileRO and java.util.ZipFile to have
the same behavior.

Bug: 10424836
Change-Id: I6bde1bad7e20065ee650945fd43a913c05ce5ac7
ipFileRO.cpp
0c4b3646b0feb1bed89bf374ff03af797834d8c3 11-Sep-2013 Kenny Root <kroot@google.com> Revert "Reconcile differences between zip implementations"

This reverts commit 9ffddc7eb50653cf60ce6b27a0e1945eed5b5ce1.

Change-Id: Ifeba63511211bfc2b375f2205e319e91403b7d06
ipFileRO.cpp
9ffddc7eb50653cf60ce6b27a0e1945eed5b5ce1 21-Aug-2013 Kenny Root <kroot@google.com> Reconcile differences between zip implementations

Reconcile the difference between ZipFileRO and java.util.ZipFile to have
the same behavior.

Bug: 10424836
Change-Id: Iff159c9e1a91b59f6c5346dc0278cb9e4bbc1a39
ipFileRO.cpp
83ad4e393ae8223745924ac9b37949c8efbce3f2 05-Aug-2013 Elliott Hughes <enh@google.com> Remove an unused C zip API.

Change-Id: I10ae849bdedf3e3bb97547c4f9e5a20742e9d6b1
ndroid.mk
ipFileCRO.cpp
d45c68dd24fe3dd510af5a9591b5e2f509b56772 31-Jul-2013 Dianne Hackborn <hackbod@google.com> Resource memory optimization.

Don't ever need the cached UTF-16 string conversions on the
device. Don't need to create those strings, and don't need
to create the lookup array for them at all. This requires
fixing all of the remaining places in the platform where we
interacted with the resources with the blind assumption that
the strings are UTF-16.

Change-Id: Ia0e5a150499837471e494e85b23b05fa06e0cf1d
esourceTypes.cpp
0d6e7315eb302b5402535dca87ac2c4dad4709b8 24-Jul-2013 Colin Cross <ccross@android.com> add static dependency on liblog

Change-Id: I8056aa744b37ef0c31229329a0de79c58c5955ea
ndroid.mk
9d3b1a424c5c61e24e9659d15fb353026a00d925 02-Jul-2013 Jeff Brown <jeffbrown@google.com> Move input library code to frameworks/native.

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
ndroid.mk
ursorWindow.cpp
nput.cpp
nputDevice.cpp
nputTransport.cpp
eyCharacterMap.cpp
eyLayoutMap.cpp
eyboard.cpp
esourceTypes.cpp
elocityControl.cpp
elocityTracker.cpp
irtualKeyMap.cpp
ests/Android.mk
ests/InputChannel_test.cpp
ests/InputEvent_test.cpp
ests/InputPublisherAndConsumer_test.cpp
ests/TestHelpers.h
0618148f9031129540631b6d5aa823377e993415 19-Jun-2013 Jeff Brown <jeffbrown@google.com> input: Handle a few extra error conditions.

It turns out that SOCK_SEQPACKET sockets may sometimes return
ECONNREFUSED or ECONNRESET errors when the peer dies instead of
the usual EPIPE.

Bug: 9479906
Change-Id: Ia7e572b08bf63e43ba5aeda58281508beb5f8c73
nputTransport.cpp
631500ef58e016943bd73521d113f12eab16dc25 22-May-2013 Nick Kralevich <nnk@google.com> Move VelocityTracker.cpp to target build only

VelocityTracker.cpp makes reference to property_get, which
doesn't make a lot of sense when compiling for the host.
Compile this file for the target only.

Keyboard.cpp: Remove unnecessary include file.

Change-Id: Iee9edd81953b2e7e815005770ce286a6ec586f20
ndroid.mk
eyboard.cpp
1f5762e646bed2290934280464832782766ee68e 07-May-2013 Mathias Agopian <mathias@google.com> libutils clean-up

Change-Id: I11ee943da23a66828455a9770fc3c5ceb4bbcaa9
ndroid.mk
sset.cpp
ssetManager.cpp
esourceTypes.cpp
ipFileCRO.cpp
ipFileRO.cpp
ipUtils.cpp
isc.cpp
ests/Android.mk
ests/ZipFileRO_test.cpp
fb903a45d7b924c1dfacadaa99ebdf93fd8a1de4 18-Mar-2013 Bjorn Bringert <bringert@android.com> Allow compiling aapt for the device

Changes:

- The static device version of libandroidfw now includes
the extra functions needed by aapt. I could only find
a few host tools that use the static library, so this is
hopefully not a problem.

- The pseudolocalization code is moved into aapt.
It was previously in libhost, but only used by aapt.

Change-Id: Ib393ebb7dcebee8abbb628cbe5255ea1679674ac
ndroid.mk
esourceTypes.cpp
c51d050f1bc2c393707f7c5e1f6906169ace7497 16-Apr-2013 Dianne Hackborn <hackbod@google.com> Maybe fix issue #8620910: Win_sdk build failed and unable to create...

...the sdk platform repo

Change-Id: Ib6cd7c0dfb9b6217ae79af3e2ac25fe0442996e3
ssetManager.cpp
f7be4800df28d7cb6a96003046bf90245e7054ab 12-Apr-2013 Dianne Hackborn <hackbod@google.com> Add new resources trace, also trace apk dex loading.

Change-Id: Ia48566efb21ee018659bd976ddb3a0f4997b9a3a
ssetManager.cpp
bdb706e48d71af498156efbb10d0f0c1fcef8878 05-Apr-2013 Michael Wright <michaelwr@google.com> Merge "Pipe through device resolution information" into jb-mr2-dev
1951ce86c21445ac191e4d2d95233f4f5c096b56 05-Apr-2013 Jeff Brown <jeffbrown@google.com> Correctly manage the lifecycle of IME InputChannels.

InputChannels are normally duplicated when sent to a remote process
over Binder but this does not happen if the recipient is running within
the system server process. This causes problems for KeyGuard because the
InputMethodManagerService may accidentally dispose the channel
that KeyGuard is using.

Fixed the lifecycle of InputChannels that are managed by the IME
framework. We now return a duplicate of the channel to the application
and then take care to dispose of the duplicate when necessary.
In particular, InputBindResult disposes its InputChannel automatically
when returned through Binder (using PARCELABLE_WRITE_RETURN_VALUE).

Bug: 8493879
Change-Id: I08ec3d13268c76f3b56706b4523508bcefa3be79
nputTransport.cpp
c6091c64c90e9557ea58e0d7cf75915aea7c6c3e 02-Apr-2013 Michael Wright <michaelwr@google.com> Pipe through device resolution information

Bug: 8424494
Change-Id: Iafeeee0d5cd29342c1cdc86b9616222aaa5d1b94
nputDevice.cpp
294b512ecaa98a6a8ef12285ad14e7a4091b5d57 19-Feb-2013 Christopher Tate <ctate@google.com> DO NOT MERGE - Full backup/restore now handles OBBs sensibly

OBB backup/ restore is no longer handled within the target app
process. This is done to avoid having to require that OBB-using
apps have full read/write permission for external storage.

The new OBB backup service is a new component running in the
same app as the already-existing shared storage backup agent.
The backup infrastructure delegates backup/restore of apps'
OBB contents to this component (because the system process
may not itself read/write external storage).

From the command line, OBB backup is enabled by using new
-obb / -noobb flags with adb backup. The default is noobb.

Finally, a couple of nit fixes:

- buffer-size mismatch between the writer and reader of chunked
file data has been corrected; now the reading side won't be
issuing an extra pipe read per chunk.

- bu now explicitly closes the transport socket fd after
adopting it. This was benign but triggered a logged
warning about leaked fds.

(Cherrypicked)

Change-Id: I471f6348abcccb7bf1e1710b7beda9f23de53e14
ackupHelpers.cpp
893df066bbd156b05171e68204a407a212c507e9 22-Feb-2013 Kenny Root <kroot@google.com> am 8dda0956: am 49999acb: Merge "StreamingZipInflater: fix mmap\'d end of read"

* commit '8dda0956b6565a958989af44e885b94dc9bfc9bd':
StreamingZipInflater: fix mmap'd end of read
c6e35cb47a90a43b5a0009f526b695b2b5c87465 15-Feb-2013 Kenny Root <kroot@google.com> StreamingZipInflater: fix mmap'd end of read

When reaching the end of a mmap'd segment, it was erroneously trying to
read more data. This is because we were reading data one character at a
time, so we never reached the Z_STREAM_END result without going through
the loop once more.

Bug: https://code.google.com/p/android/issues/detail?id=39041
Change-Id: I6c53b8187384a42217c32112d6a0c2857f471109
treamingZipInflater.cpp
6b7fcc8f6754f0bf7a406834a6dc066710a9de51 07-Feb-2013 Jeffrey Brown <jeffbrown@android.com> am 75701e8f: am 7eb4db35: am b9185fd1: Merge "Fix PointerCoords Parcel incorrectly storing values as Int32"

# By Ilya Polenov
# Via Android Git Automerger (2) and Gerrit Code Review (2)
* commit '75701e8fc92285680637f69e0f004741919ddc10':
Fix PointerCoords Parcel incorrectly storing values as Int32
7eb4db35935237a6bd029d5bafda97fa5d4d905c 07-Feb-2013 Jeffrey Brown <jeffbrown@android.com> am b9185fd1: Merge "Fix PointerCoords Parcel incorrectly storing values as Int32"

# By Ilya Polenov
# Via Gerrit Code Review
* commit 'b9185fd1ffd85239e3ab10ab34cb9d8508970fb4':
Fix PointerCoords Parcel incorrectly storing values as Int32
1df477acf60538f9de18bd597e090d075fa83509 01-Feb-2013 Michael Wright <michaelwr@google.com> Add initial plumbing for brightness keys

Change-Id: I595e8a25e6c245e4b22f06df9a8acdbb75e4b041
nput.cpp
716f7b3f5e29adedf1cd5c11529d9cfd82246897 10-Dec-2012 Ilya Polenov <daioptych@gmail.com> Fix PointerCoords Parcel incorrectly storing values as Int32

PointerCoords stores its values as float and its Parcel should
do the same. Wrong behaviour may be noticed when MotionEvent is
injected using Instrumentation method sendPointerSync. All its
PointerCoords values(size, orientation, pressure, etc) will be
casted to integer omitting their decimal part. This fix addresses
this issue.

Change-Id: Ifa3dfce4d5c2e6c060852f4208cb5684e827c7e6
Signed-off-by: Ilya Polenov <daioptych@gmail.com>
nput.cpp
81cfb63e9fc6ef72e5b488225fe9b7a43551fc9e 04-Jan-2013 Elliott Hughes <enh@google.com> am d13b23a4: Merge "Revert "fix potential memory leak""

* commit 'd13b23a436075262cc83f7502f7159de24546003':
Revert "fix potential memory leak"
767e1c010c0664fa4bf7e7e32b840af4bbe0b0cf 04-Jan-2013 Elliott Hughes <enh@google.com> am 9aac0c1b: Merge "fix potential memory leak"

* commit '9aac0c1b35ec666a18f320be99e6aa37d0bcf202':
fix potential memory leak
957efcdc7331957df415faf9ab40f8bc08f5bd99 04-Jan-2013 Elliott Hughes <enh@google.com> Revert "fix potential memory leak"

This reverts commit bc268b9014f211910e412a7fda96b6394ff2badc

Change-Id: I07f49bd0cfecc43bc761d2b0635c9915a8e30272
esourceTypes.cpp
bc268b9014f211910e412a7fda96b6394ff2badc 21-Dec-2012 Sungmin Choi <sungmin.choi@lge.com> fix potential memory leak

use delete before return

Change-Id: I5449ad90bb6910f057bd825b722c9803a7343c34
esourceTypes.cpp
eea47240b085fa0260011423774506b5375b9351 17-Dec-2012 Christopher Tate <ctate@android.com> am 4b0ed017: Merge "BackupHelpers: Fix Typo"

* commit '4b0ed0178de2c9c21bd5514671b8b4282f6a03db':
BackupHelpers: Fix Typo
8b2e2c8abc20de5ba3d938d8c559d0c5e2f9e356 16-Dec-2012 You Kim <you.kim72@gmail.com> BackupHelpers: Fix Typo

delete --> free

Change-Id: Idbf7e677f8cc4a9a9d04e58b5cf7d0f1589c5211
ackupHelpers.cpp
5780e196806b3741786b212866435593990f97ee 13-Dec-2012 Fabrice Di Meglio <fdimeglio@google.com> am 5c0d6f99: am 9de88dad: Merge "Fix bug #7724071 ImageView drawable is not loaded correctly when changing Locale" into jb-mr1.1-dev

* commit '5c0d6f9980ed4684cbeefc28036dd9eeac474375':
Fix bug #7724071 ImageView drawable is not loaded correctly when changing Locale
350993591974a8c7a2eca665f96304d296104789 12-Dec-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #7724071 ImageView drawable is not loaded correctly when changing Locale

aapt is not generating the correct CONFIG_LAYOUTDIR bit when a Drawable has a
LTR and RTL version. It was generating instead the wrong CONFIG_SCREEN_LAYOUT bit.

This was linked to the fact that the layout direction bits are contained into the
screen layout bit.

So now make sure that we are generating the correct CONFIG_LAYOUTDIR bit.

Change-Id: If17c84d31e6c128721ed97ee6711660b131bf941
esourceTypes.cpp
be37b5fa2473fd6ee5c1223472b29f212067761d 14-Nov-2012 Kenny Root <kroot@android.com> Merge "Free resources in correct order in ResStringPool::uninit"
58b99bf1d8d203d91a63619a99a8f29911ba58bc 13-Oct-2012 Kenny Root <kroot@google.com> am 82634313: Merge "Reject bad ResXMLTree::setTo calls"

* commit '826343138dfd8666d2263dd82bfdbf657fc1881e':
Reject bad ResXMLTree::setTo calls
32d6aef11abd4660fc764ffa53bd88c7589f2d35 10-Oct-2012 Kenny Root <kroot@google.com> Reject bad ResXMLTree::setTo calls

Bug: http://code.google.com/p/android/issues/detail?id=21838
Change-Id: I1092499906f0cafe5a3c42ab2579edf3763cedb7
esourceTypes.cpp
a1d82ff39315c962fbd6839f7a581ffaafe675e4 08-Oct-2012 Chris Dearman <chris@mips.com> Free resources in correct order in ResStringPool::uninit

mOwnedData contains the mHeader data structure

Change-Id: I0ae9ba3a0d18fc3f368c629501fadebce8807198
esourceTypes.cpp
49bbbf2c1c96432f1f599d5573931470117be45a 05-Oct-2012 Christopher Tate <ctate@google.com> am d87cb794: am 0cd3c976: Merge "Settings (and general) restore fixes" into jb-mr1-dev

* commit 'd87cb794b063c503f4d732141904bd1edd5c5914':
Settings (and general) restore fixes
5067685ccf6c294a77a3e7f0577190600a0e6238 05-Oct-2012 Christopher Tate <ctate@google.com> Settings (and general) restore fixes

Pro tem, we ignore wifi configuration data when restoring system settings.
This is not ideal, but it *does* mean we do not bounce wifi off and on
again during the extended restore process, which in turn means we don't
interfere with things like the Play Store's download of applications.
We do continue to back up wifi configuration, and will start using that
data again when the new implementation that restores AP configurations
without having to bounce wifi comes to pass.

Also, this CL fixes a longstanding bug in BackupDataInput.skipEntityData()
that was being reproduced reliably once settings restore was skipping
the wifi-related entities in the restore stream.

Bug 7249405

Change-Id: I61520a9a116b66ebdf95734d09d9afd46406df01
ackupData.cpp
f0771b192c5530681ca407bdf3c1b21fd519c897 02-Oct-2012 Kenny Root <kroot@google.com> am cee11240: am 07b4339b: Merge "Change androidfw tests to native test target"

* commit 'cee1124052202c7f2a1956a54e5aa538d82197a7':
Change androidfw tests to native test target
f3f286df4d79834ec350bdc18d01acd51f4791e1 02-Oct-2012 Kenny Root <kroot@google.com> Change androidfw tests to native test target

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
ests/Android.mk
ests/InputEvent_test.cpp
8a802dbdabdfd27692c2e38b2c3adafe95566106 05-Sep-2012 Fabrice Di Meglio <fdimeglio@google.com> Use "ldrtl" and "ldltr" config qualifiers for RTL / LTR resources

- we cannot use "rtl" / "ltr" qualifiers as they can conflict with ISO-639 Alpha-3
codespace which uses 3 letters for identifying a language code (and could use either
"rtl" or "ltr" strings for defining a language in the future).

- we are using instead "ldrtl" for RTL and "ldltr" for LTR resources. Those qualifiers
are defined by more than 3 chars and outside of what is defined into ISO-639. They
are also more understandable as "ld" prefix is for "layoutdirection"

Change-Id: Id43e948103707e09bef63ebd54ac1779dde58e72
esourceTypes.cpp
5f7979993979466c79ab4f38d83c6f2aca361662 16-Jun-2012 Fabrice Di Meglio <fdimeglio@google.com> Add support for "-rtl" in resources

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

Change-Id: Ic82145c2ac672729d8a6c695a5f343276a1a0a2c
esourceTypes.cpp
69a3ce1eb1af3129056f7da95a491da0280019b5 05-Aug-2012 Mathias Agopian <mathias@google.com> libutils cleanup

Change-Id: Ic069539338ba4097dba9399904f02bbd0296c20e
ssetManager.cpp
4b447b91debda9c9a0e230cab9e140e356b2a305 27-Jun-2012 Nick Kralevich <nnk@google.com> Add mode when open(O_CREAT) is used.

When creating a new file using open(..., O_CREAT), it is an error
to fail to specify a creation mode. If a mode is not specified, a
random stack provided value is used as the "mode".

This will become a compile error in a future Android change.

Change-Id: I8635e8b69587ed107253870d991c3fcf563ca876
ests/ObbFile_test.cpp
78f04a364f8cd7dc3a7a0aaf73c96a6cc84718b6 04-Jun-2012 Jeff Brown <jeffbrown@google.com> am 51df04b9: Port the legacy velocity tracker strategy.

* commit '51df04b93e8e362edd867abd7efaf1659b8b8b82':
Port the legacy velocity tracker strategy.
ba58221769575d1129c61fe0da9030986eb899bd 04-Jun-2012 Jeff Brown <jeffbrown@google.com> am a5b06982: Implement a second order integrating VT strategy.

* commit 'a5b0698231459ac5b54cf8e8952ac5c2b2b2198b':
Implement a second order integrating VT strategy.
2fd6baef5911d3bb481d1a603180d7371d43df41 04-Jun-2012 Jeff Brown <jeffbrown@google.com> am 18f329e9: Implement a weighted least squares VelocityTracker strategy.

* commit '18f329e9480fca75210bb7496e5b4bc987b4ad8f':
Implement a weighted least squares VelocityTracker strategy.
51df04b93e8e362edd867abd7efaf1659b8b8b82 04-Jun-2012 Jeff Brown <jeffbrown@google.com> Port the legacy velocity tracker strategy.

For comparison purposes, port the legacy velocity tracker
algorithm as it behaved prior to ICS.

Bug: 6413587
Change-Id: I7e8e56584dcdb1a3c660ca9d8f9c5bd5d868e449
elocityTracker.cpp
a5b0698231459ac5b54cf8e8952ac5c2b2b2198b 04-Jun-2012 Jeff Brown <jeffbrown@google.com> Implement a second order integrating VT strategy.

Bug: 6413587
Change-Id: I51bc7b8cbff22b10b728fc84ee15370e9984dd55
elocityTracker.cpp
18f329e9480fca75210bb7496e5b4bc987b4ad8f 03-Jun-2012 Jeff Brown <jeffbrown@google.com> Implement a weighted least squares VelocityTracker strategy.

No change to the default strategy.

Bug: 6413587
Change-Id: I08eb6f9a511e65ad637359b55b5993c26ba93b40
elocityTracker.cpp
767bc6d26c98594525ed7dd94e8880335e15e8a8 04-Jun-2012 Jeff Brown <jeffbrown@google.com> am 1fbbc071: Merge "Implement an integrating VelocityTracker strategy." into jb-dev

* commit '1fbbc0716f9b70c6dcee00c4550757077ef7f7b5':
Implement an integrating VelocityTracker strategy.
7d3fa093bbd34e19f6b580b6258c8ea4e138c777 04-Jun-2012 Jeff Brown <jeffbrown@google.com> am f47e76e2: Merge "Make velocity tracker strategy configurable." into jb-dev

* commit 'f47e76e2c78e78e26110786e99548d718d177c32':
Make velocity tracker strategy configurable.
53dd12a66884540b87fe428383e2f79d0f5e32ba 01-Jun-2012 Jeff Brown <jeffbrown@google.com> Implement an integrating VelocityTracker strategy.

This algorithm better tolerates certain kinds of errors in the
touch input than the least squares strategy but it may underestimate
the velocity of accelerating movements. This algorithm is
mainly of interest as a baseline for testing and comparison with the
least squares algorithm, which remains the default.

Bug: 6413587
Change-Id: I8ddb50084e44875e234717907e5b06d03f59788c
elocityTracker.cpp
9eb7d86181729c3eb769d71123c4ce9ffc868f08 01-Jun-2012 Jeff Brown <jeffbrown@google.com> Make velocity tracker strategy configurable.

This change is very useful for testing purposes because it makes it
easy to compare different implementations to see how they behave.

There is no change to the current default strategy.

Bug: 6413587
Change-Id: I4d8567aa4160571ba9fa397ce419882cd9366749
elocityTracker.cpp
aebfdc231aadab63e51d740a8f3abf97953fd9f2 15-May-2012 Jeff Brown <jeffbrown@google.com> am e4db99cf: Merge "Detect when pointer has stopped moving." into jb-dev

* commit 'e4db99cf87c47730e80dc1431f07f4f1062c648e':
Detect when pointer has stopped moving.
634ec69aa9f7e5806098800b504ae94dda1df5f3 15-May-2012 Jeff Brown <jeffbrown@google.com> am 08b544c7: Merge "Fix pointer indexing issue in VelocityTracker." into jb-dev

* commit '08b544c7be67343b10a4130611318b8273d06433':
Fix pointer indexing issue in VelocityTracker.
7469f8bb949bef1328877593952b8fe9801a3c67 15-May-2012 Jeff Brown <jeffbrown@google.com> am 47a4a50d: Merge "Improve touch event resampling." into jb-dev

* commit '47a4a50df09b5ab76ee06cb8845fe5a02952ec32':
Improve touch event resampling.
e2ec70bf92e80800bd5163f56632b9eb14cce290 15-May-2012 Jeff Brown <jeffbrown@google.com> am 00ff4748: Merge "More VelocityTracker refactoring." into jb-dev

* commit '00ff47484f8137aa3e59f680ff07d2662cfb4088':
More VelocityTracker refactoring.
90729403d50488566eb4ae0e09bb1be21979a633 15-May-2012 Jeff Brown <jeffbrown@google.com> Detect when pointer has stopped moving.

Some input devices do not generate ACTION_MOVE events while all
pointers have stopped, thereby lulling the VelocityTracker into
a false sense of complacency. Before handling the following sample,
reset the VelocityTracker state so as not to be influenced by
earlier samples before the pointer stopped. The velocity after
stopping is assumed to be discontinuous.

Bug: 6413587
Change-Id: I6387bc036ff141d083d3d17a89e37eeaa3188349
elocityTracker.cpp
dcab190bd23f632f278af448b0c85b4cadcc6692 15-May-2012 Jeff Brown <jeffbrown@google.com> Fix pointer indexing issue in VelocityTracker.

VelocityTracker was implicitly assuming that the pointer ids in
a MotionEvent were ordered. That is not necessarily the case
so we need to be careful while copying the pointer coordinates out.

Bug: 6413587
Change-Id: I3b23a954f893eebdf786f2a94207149b092ef036
elocityTracker.cpp
7174a491bc1f89da65eaef3be25f3ea3f3e3bab5 15-May-2012 Jeff Brown <jeffbrown@google.com> Improve touch event resampling.

Fixed a few bugs related to the id-to-index mapping for
pointer coordinates.

Tightened the bounds on the resampling time interval to
avoid predicting too far into the future.

Only lerp X and Y components of motion events.

Alter the future to satisfy past predictions. (Rewrite touch
events to conceal obvious discontinuities.)

Added a system property to control whether resampling is enabled
for debugging purposes.

Bug: 6375101
Change-Id: I35972d63278bc4e78148053a4125ad9abeebfedb
nput.cpp
nputTransport.cpp
85bd0d62830a098c1bdc720dfdcf4fe1b18b657c 14-May-2012 Jeff Brown <jeffbrown@google.com> More VelocityTracker refactoring.

Bug: 6413587
Change-Id: Ida1152e7a34d5fe5caab5e6b5e1bc79f6c7a25e6
elocityTracker.cpp
47272c932ab6157022aaefd015e5d1df9dc5bd2f 11-May-2012 Jeff Brown <jeffbrown@google.com> am b12b6b51: Merge "Minor refactoring before starting on velocity tracker changes." into jb-dev

* commit 'b12b6b5116e3d76474296b45f570693bb10d6c99':
Minor refactoring before starting on velocity tracker changes.
8a90e6e3174083f274538567d851f98478fc83e9 11-May-2012 Jeff Brown <jeffbrown@google.com> Minor refactoring before starting on velocity tracker changes.

Bug: 6413587
Change-Id: I5eba2bb57193bff78cb3740de5f87aca0b31d154
ndroid.mk
nput.cpp
elocityControl.cpp
elocityTracker.cpp
c3cca66404571454ee13b341925fe45efd5036e6 02-May-2012 Jeff Brown <jeffbrown@google.com> am 0632b35b: Merge "Improve handling of built-in keyboard." into jb-dev

* commit '0632b35b6828cd4324b3d218c2e38f895e819aad':
Improve handling of built-in keyboard.
daa3753a04699724d2cfe824ac1f5a266d643a05 02-May-2012 Jeff Brown <jeffbrown@google.com> Improve handling of built-in keyboard.

The window manager policy made some incorrect assumptions about the
meaning of the Configuration.keyboard field. We need to be more
careful about distinguishing between built-in and external keyboards.

Most of this change is to move the determination of the parts of
the Configuration related to input devices into the WindowManagerService
leveraging new features of the InputManagerService to good effect.

Then we plumb through the flag that indicates whether a device
is internal or external so that we can be more particular about
how the lid switch effects changes to the Configuration.

Bug: 6424373
Change-Id: I36a1c22ade35e578955465a25940a33f227b9763
nputDevice.cpp
3e2d59146df9e9e325dcc65018bb130b03242bbc 01-May-2012 Jean-Baptiste Queru <jbq@google.com> resolved conflicts for merge of 13c04786 to jb-dev-plus-aosp

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

Change-Id: I5386585e473201268c6ed8b05e0a16569d434ea2
771526c88f5cc4b56a41cb12aa06a28d377a07d5 28-Apr-2012 Jeff Brown <jeffbrown@google.com> Resample touch events on frame boundaries.

Bug: 6375101
Change-Id: I8774e366306bb2b6b4e42b913525bf25b0380ec3
nput.cpp
nputTransport.cpp
ests/InputPublisherAndConsumer_test.cpp
8bca94ad83f82682bc15df29dc25377fe43da17f 24-Apr-2012 Jeff Brown <jeffbrown@google.com> More work on international keyboards.

Changed the English US keymaps to implement a strict US key map
with no additional ALT functions.

Fixed a bug copying the alias in the InputDevice copy constructor.

Added support for end of line comments in KCM and KL files.

Added the German keyboard layout.

Sorted the keys in the keyboard layout files by physical arrangement
to make it easier to maintain them.

Bug: 6110399
Change-Id: If44d83de5b98f2bf0016cbb8e12264387b286aaa
nputDevice.cpp
eyCharacterMap.cpp
eyLayoutMap.cpp
5bbd4b4f5fc19302fa017ad6afee6eb2d489d91a 21-Apr-2012 Jeff Brown <jeffbrown@google.com> Get alias for Bluetooth devices.

Bluetooth devices can be renamed by the user. Make the
input system aware of the user-specified name and transparently
pass it down to applications. This enables the keyboard
layout picker Settings UI to use device names that are
consistent with what the user set in the Bluetooth UI.

Bug: 6363157
Change-Id: I8eea26ce2c69c2a3f09c8de02e9e847610e0419c
nputDevice.cpp
9a2bbf680e3b5b98051b9f2913ab6bd31b77f79a 18-Apr-2012 Jeff Brown <jeffbrown@google.com> Improve handling of certain keyboard layout properties.

Automatically choose a default value for the 'number' property
based on the characters that the key can generate.

Don't generate any character when ctrl, alt or meta is
pressed unless the behavior exactly matches the modifier keys
that are pressed.

Simplified the basic keyboard layouts taking into account the
new features.

Bug: 6110399
Change-Id: Ibc0f0b50c2dcf3f962a33ac77c24d2993b77637d
eyCharacterMap.cpp
4a3862f6b0a8971b6ab5b1c46735b28e7604d0db 18-Apr-2012 Jeff Brown <jeffbrown@google.com> Add Dvorak keyboard layout.

Added support for mapping both scan codes and HID usages to
KeyLayoutMap and KeyCharacterMap. Keyboard overlays can
now influence how key events are mapped to key codes.

Bug: 6110399
Change-Id: I6619fd2d3e1337c55928f89869dbc45b535c7ccf
eyCharacterMap.cpp
eyLayoutMap.cpp
6ec6f79e1ac1714e3b837796e99f07ff88f66601 18-Apr-2012 Jeff Brown <jeffbrown@google.com> Support loading keyboard layout overlays from resources.

Added the concept of a keyboard layout overlay, which is
a key character map file that has "type OVERLAY".

Added support for loading keyboard layout overlays from
resources dynamically. The layouts are reloaded whenever they
are changed in the Settings application or an application
is installed. This is somewhat more aggressive than necessary
so we might want to optimize it later.

Before system-ready, the input system uses just the generic
keyboard layouts that are included on the device system image.
After system-ready, it considers the user's selected keyboard
layout overlay and attempts to load it as necessary. We need to
wait until system-ready before doing this because we need to
be in a state where it is safe to start applications or access
their resources.

Bug: 6110399
Change-Id: Iae0886d3356649b0d2440aa00910a888cedd8323
eyCharacterMap.cpp
eyboard.cpp
a47425a13c19f95057df78b8bb65bb25657e8753 13-Apr-2012 Jeff Brown <jeffbrown@google.com> Add support for input devices that have vibrators.

Added a getVibrator() method to InputDevice which returns a Vibrator
associated with that input device. Its uses the same API as the
system vibrator which makes it easy for applications to be modified
to use one or the other.

Bug: 6334179
Change-Id: Ifc7f13dbcb778670f3f1c07ccc562334e6109d2e
nputDevice.cpp
af9e8d38184c6ba4d2d3eb5bde7014a66dd8a78b 13-Apr-2012 Jeff Brown <jeffbrown@google.com> Notify applications when input devices change.

This change allows the InputManager to keep track of what input
devices are registered with the system and when they change.
It needs to do this so that it can properly clear its cache of
input device properties (especially the key map!) when changes
occur.

Added new API so that applications can register listeners for
input device changes.

Fixed a minor bug in EventHub where it didn't handle EPOLLHUP
properly so it would spam the log about unsupposed epoll events
until inotify noticed that the device was gone and removed it.

Change-Id: I937d8c601f7185d4299038bce6a2934fe4fdd2b3
nputDevice.cpp
cc1169831921d9295b2fc01c1eaf7e9b00836f53 12-Apr-2012 Jeff Brown <jeffbrown@google.com> HID usage should take precedence over scan code.

Change-Id: Ibd8988e3dcc0d64f4019ffe491d9789733f9d243
eyLayoutMap.cpp
49ccac530b5a798e3c4a79b66b51b8546a0deed1 12-Apr-2012 Jeff Brown <jeffbrown@google.com> Refactor key code mapping.

Added handling for EV_MSC / MSC_SCAN which typically reports
the HID usage associated with a key. This will enable key maps
to map keys with HID usages that Linux does not natively recognize.

Removed keyCode and flags fields from EventHub RawEvent since
they don't necessarily make sense in isolation now that we
pay attention to HID usage codes too.

Removed the fallback code for mapping keys and axes. In practice,
an input device should be self-sufficient. We should not ever
need to look at the built-in keyboard's key map. In fact, there
usually isn't a built-in keyboard anyhow. This code was originally
working around a problem where we weren't loading the key map
for touch screens with virtual keys, which has long since been fixed.

Change-Id: I0a319bdec44be9514f795526347397e94d53a127
eyLayoutMap.cpp
9f25b7fdf216c9ef0bd2322cd223eeaf0d60f77f 10-Apr-2012 Jeff Brown <jeffbrown@google.com> Request key maps from input manager service.

Instead of each application loading the KeyCharacterMap from
the file system, get them from the input manager service as
part of the InputDevice object.

Refactored InputManager to be a proper singleton instead of
having a bunch of static methods.

InputManager now maintains a cache of all InputDevice objects
that it has loaded. Currently we never invalidate the cache
which can cause InputDevice to return stale motion ranges if
the device is reconfigured. This will be fixed in a future change.

Added a fake InputDevice with ID -1 to represent the virtual keyboard.

Change-Id: If7a695839ad0972317a5aab89e9d1e42ace28eb7
ndroid.mk
nput.cpp
nputDevice.cpp
eyCharacterMap.cpp
eyLayoutMap.cpp
eyboard.cpp
e38fdfae9196afd1bdc14c5ec6c12793af1e2550 06-Apr-2012 Jeff Brown <jeffbrown@google.com> Add a unique input device descriptor.

The purpose of the input device descriptor is to make it possible
to associate persistent settings for each input device, such as the
keyboard layout.

The descriptor is a hash of the information we have about the
device, such as its vendor id, product id, unique id, name,
or location.

Bug: 6110399
Change-Id: Idb80f946819b3f0dbf4e661bb0a753dbc2b60981
nput.cpp
a982dc05d7ca919c07f50e446549ef9dceadf6bd 23-Mar-2012 Colin Cross <ccross@android.com> frameworks/base: move Zip* from libandroidfw to libutils

ZipUtils is needed by build/tools, move it from libandroidfw
(frameworks/base) to libutils (frameworks/native).

Change-Id: I2b4b7adcdf68eb25ee7cba5dd3b69eadf0523af3
ndroid.mk
sset.cpp
ssetManager.cpp
ipFileCRO.cpp
ipFileRO.cpp
ipUtils.cpp
ests/Android.mk
ests/ZipFileRO_test.cpp
9dc348d75688faba645c03ecd6e72de7cecc87ba 13-Mar-2012 Jeff Brown <jeffbrown@google.com> Merge "Fix spurious ANRs in native activities."
2b6c32ca4177f1a97307f9cbd81ca485df28762c 13-Mar-2012 Jeff Brown <jeffbrown@google.com> Fix spurious ANRs in native activities.

Some native activities experienced ANRs when the input consumer
deferred an input event due to client-side batching. If the
input channel was fully emptied then the client had no way of
knowing that it should wake up to handle the deferred input event.

This patch also fixes some lock issues in the native activity
input queue implementation. In at least one error case, it
was possible for a function to exit without releasing the lock.

Bug: 6051176
Change-Id: I4d9d843237e69b9834f8d8b360031b677fcab8c3
nput.cpp
nputTransport.cpp
5c6dfeb1fb47102ffce415ea7898b33dd1290d54 09-Mar-2012 Dianne Hackborn <hackbod@google.com> Fix issue #6054627: resource matching issue of size qualifiers

Resource matching would incorrectly identify two configs with the
same value as better than.

Change-Id: I7297dcf58fd5a43f1a5ff53bb093eeeb2cad090f
esourceTypes.cpp
08965ec67ada98f63f8ac879cc44c8b0e7ff046d 06-Mar-2012 Mathias Agopian <mathias@google.com> fixup hardcoded include paths for new project

Change-Id: Id443ec5c99bb4d7653905f1be1f72a029e0cf087
ests/InputChannel_test.cpp
ests/InputPublisherAndConsumer_test.cpp
ests/TestHelpers.h
49d2b1864c3dfec6faff74d67cb2527a8f1af5a8 28-Feb-2012 Mathias Agopian <mathias@google.com> move CursorWindow from libbinder to libandroidfw

Change-Id: I3b304e4f74e0d0ec8b20c57296c62449c9a0f792
ndroid.mk
ursorWindow.cpp
027692b640059fb1a9795215c0a863183aa5829c 22-Feb-2012 Mathias Agopian <mathias@google.com> attempt to fix sdk build

Change-Id: I94f32a9a7abccb52487bb9ff5e286faa4acfceff
ndroid.mk
cbc69718cb8c637426bc1a642a13a1880d843a45 21-Feb-2012 Mathias Agopian <mathias@google.com> another attempt at fixing the linux build

Change-Id: Iac20439fd6eea4682859112e72f051294bc87ef6
ndroid.mk
30167542cb23726a0d28c2eeb280f16f3101e97f 21-Feb-2012 Mathias Agopian <mathias@google.com> another attempt to fix the linux build

Change-Id: Ifd4714de7281ffc8a8c90fb25fb34719a19a9b6f
ndroid.mk
cd0f3088ef4c0f211d68235d9aa0556bd4e0984b 21-Feb-2012 Jean-Baptiste Queru <jbq@google.com> Add stubs for improved compatibility

Change-Id: I77b348b4c592e0b694aabb069812c94b9cb79a00
ndroid.mk
ummy.cpp
30c46ad519c127a92f2bd3ca1dc1eab9da6ac165 21-Feb-2012 Mathias Agopian <mathias@google.com> attempt to fix linux builds

Change-Id: I46d6f914fdc32dc26cc71bed3399e202f00eeb2a
ndroid.mk
83c64e6b624a876436d2ef5d2f173b10407e27b4 21-Feb-2012 Mathias Agopian <mathias@google.com> frameworks/base refactoring

create the new libandroidfw from parts of libui and libutils

Change-Id: I1584995616fff5d527a2aba63921b682a6194d58
ndroid.mk
sset.cpp
ssetDir.cpp
ssetManager.cpp
ackupData.cpp
ackupHelpers.cpp
nput.cpp
nputTransport.cpp
eyCharacterMap.cpp
eyLayoutMap.cpp
eyboard.cpp
ODULE_LICENSE_APACHE2
OTICE
bbFile.cpp
esourceTypes.cpp
treamingZipInflater.cpp
irtualKeyMap.cpp
ipFileCRO.cpp
ipFileRO.cpp
ipUtils.cpp
ests/Android.mk
ests/InputChannel_test.cpp
ests/InputEvent_test.cpp
ests/InputPublisherAndConsumer_test.cpp
ests/ObbFile_test.cpp
ests/ZipFileRO_test.cpp