History log of /frameworks/base/include/androidfw/ResourceTypes.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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
/frameworks/base/include/androidfw/ResourceTypes.h
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
/frameworks/base/include/androidfw/ResourceTypes.h
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
/frameworks/base/include/androidfw/ResourceTypes.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
/frameworks/base/include/androidfw/ResourceTypes.h
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
/frameworks/base/include/androidfw/ResourceTypes.h
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
/frameworks/base/include/androidfw/ResourceTypes.h
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
/frameworks/base/include/androidfw/ResourceTypes.h
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
/frameworks/base/include/androidfw/ResourceTypes.h
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
/frameworks/base/include/androidfw/ResourceTypes.h
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
/frameworks/base/include/androidfw/ResourceTypes.h
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
/frameworks/base/include/androidfw/ResourceTypes.h
4385d37813897be979ff13262bc464979c74e3dd 11-Feb-2014 Dianne Hackborn <hackbod@google.com> Fix build.

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

(cherry picked from 32bb5fae353b5bb6275e75952e89c514c7369cee)

Change-Id: I280376645166fe772ff7a31ff2e8494dce2adbf8
/frameworks/base/include/androidfw/ResourceTypes.h
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
/frameworks/base/include/androidfw/ResourceTypes.h
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
/frameworks/base/include/androidfw/ResourceTypes.h
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
/frameworks/base/include/androidfw/ResourceTypes.h
4482e7cb67c516453a67d73e98a085a5f3576953 26-Nov-2013 Mårten Kongstad <marten.kongstad@sonymobile.com> Fix ResTable_config::CONFIG_* typo (MCC vs MNC)

In commit 08d5b8f, the ResTable_config::CONFIG_* enum was incorrectly
changed to assign the same value to both CONFIG_MCC and CONFIG_MNC:
- CONFIG_MCC = 0x0001,
- CONFIG_MNC = 0x0002,
+ CONFIG_MCC = ACONFIGURATION_MCC,
+ CONFIG_MNC = ACONFIGURATION_MCC,

This commit assigns CONFIG_MNC the value ACONFIGURATION_MNC, as
intended.

Change-Id: I3b8799914a55debdb3ff30a82ada7ad990c49970
/frameworks/base/include/androidfw/ResourceTypes.h
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
/frameworks/base/include/androidfw/ResourceTypes.h
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
/frameworks/base/include/androidfw/ResourceTypes.h
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
/frameworks/base/include/androidfw/ResourceTypes.h
56a2301c7a1169a0692cadaeb48b9a6385d700f5 13-Feb-2013 Dianne Hackborn <hackbod@google.com> Implement issue #6646859: 4K!!!! 4K!!!! 4K!!!!

Change-Id: Ib05a2eb6a03db50074805a437a3639a7d10684a0
/frameworks/base/include/androidfw/ResourceTypes.h
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
/frameworks/base/include/androidfw/ResourceTypes.h
b13b9bdad2baf6ad1ec2e56b6b7598fa20f55fc4 18-Feb-2012 Mathias Agopian <mathias@google.com> frameworks/base refactoring.

step 2: move libutils headers to their new home: androidfw

Change-Id: I14624ba23db92a81f2cb929f104386e1fab293ef
/frameworks/base/include/androidfw/ResourceTypes.h