2574 Commits

Author SHA1 Message Date
Brian Carlstrom
2194963181 am ce75618e: am 5aba0149: am b85afb38: Merge "Make dex2oat heap size product configurable [frameworks/base]"
* commit 'ce75618e12deebe302c551281ce56c0d60138e0f':
  Make dex2oat heap size product configurable [frameworks/base]
2014-07-09 15:07:35 +00:00
Brian Carlstrom
ce75618e12 am 5aba0149: am b85afb38: Merge "Make dex2oat heap size product configurable [frameworks/base]"
* commit '5aba0149b953fb8e85851811dde995fb35c10051':
  Make dex2oat heap size product configurable [frameworks/base]
2014-07-09 12:36:47 +00:00
Brian Carlstrom
6d77eb99bf Make dex2oat heap size product configurable [frameworks/base]
Bug: 15919420
Change-Id: I9b7b4f60826fc9b0cc6bb3765ceaa36542425006
2014-07-08 15:05:41 -07:00
Adam Lesinski
f90f2f8dc3 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
2014-06-18 19:20:08 +00:00
Ruben Brunk
f967a5486a camera2: Plumb DngCreator to native library.
Change-Id: Ic58bf6cf5086808b503460ef8e451fc0d6f1f850
2014-05-16 23:25:51 -07:00
Narayan Kamath
8ee0b48d60 am 97175deb: am 3856a219: am cecfb94f: Merge "Clean up argc / argv processing for runtime args."
* commit '97175deb446cdaca7f3910b71940cb443bda3cc4':
  Clean up argc / argv processing for runtime args.
2014-04-09 14:06:10 +00:00
Narayan Kamath
97175deb44 am 3856a219: am cecfb94f: Merge "Clean up argc / argv processing for runtime args."
* commit '3856a219fa414ee53c5ef3a0c35dae35e2ca80b1':
  Clean up argc / argv processing for runtime args.
2014-04-09 14:02:08 +00:00
Narayan Kamath
22ec1eefa4 Clean up argc / argv processing for runtime args.
- Make copies of argc, argv before argv is potentially
  overwritten with the process name.
- Allow multiple command line arguments to be passed to
  ZygoteInit (this is required for some of the 64 bit
  zygote work).
- Add an explanatory comment about how these argments
  are processed.

Change-Id: I752be69c5c0f97ed17d1a3dded19f46ee00929b0
2014-04-09 13:39:41 +01:00
John Spurlock
0a0454fdcc 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.
2014-04-04 19:34:11 +00:00
John Spurlock
642421aa7f 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.
2014-04-04 19:28:09 +00:00
John Spurlock
6c191299a7 Introduce new UI_MODE_TYPE_WATCH and qualifier.
Default ui mode to watch if we have FEATURE_WATCH.

Bug:13395758
Change-Id: Ie5ff95de60e69e91ad3612c7d2f1fca7f49061bd
2014-04-04 15:21:53 -04:00
Narayan Kamath
c6f6ba3265 am 71ae2bd4: am f87b3a25: am 374db6c3: Merge "Remove ProcessState::mArgc,mArgV,mArgLen"
* commit '71ae2bd42be21de6d25d1f8c52e3973c172462df':
  Remove ProcessState::mArgc,mArgV,mArgLen
2014-04-03 16:56:32 +00:00
Narayan Kamath
a23fcd7be8 Remove ProcessState::mArgc,mArgV,mArgLen
These look like historical oddities, and weren't really being
used for anything useful.

Process:setArgV0 was being called by android.util.Process, but
that functionality can be moved directly into the implementation
of that class.

bug: 13647418

Change-Id: I216c8f8a4c065f0cf3a61f19f9e32decd26f93f6
2014-04-03 12:29:07 +00:00
John Reck
0d1f634f4b Add invokeFunctor
Change-Id: I09e675d3e02e3e528642175ada00b2b17fab7652
2014-03-28 20:57:32 -07:00
John Reck
750ca6dbdb Remove kStatusInvoke & kStatusDraw
They are unused

Change-Id: I44ecf1164dc6bc1b09438e733976d5a97a25f00e
2014-03-28 16:43:15 -07:00
Adam Lesinski
de898ff429 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
2014-03-25 12:09:56 -07:00
Narayan Kamath
b5c4e7fd38 resolved conflicts for merge of 92860a74 to master
Change-Id: I3036ef9f1251c756092dc5ee2c4fed8146855e1e
2014-03-10 10:57:05 +00:00
Narayan Kamath
6381dd4ff2 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
2014-03-10 10:00:02 +00:00
Brian Carlstrom
aa1d023bb9 am 674fd6c4: am a258b4a9: am 485e3b45: am 5c126c3d: Merge "Add dex2oat-flags plumbing to AndroidRuntime"
* commit '674fd6c442cd3886b3ab12be1d36c5d05ef48cdb':
  Add dex2oat-flags plumbing to AndroidRuntime
2014-03-05 20:09:52 +00:00
Brian Carlstrom
3beff1e023 Add dex2oat-flags plumbing to AndroidRuntime
Change-Id: Idaa7e5351e146d76e1972cbe4d93af69f0b999a6
2014-03-04 14:08:46 -08:00
Narayan Kamath
788fa41482 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
2014-02-14 14:08:57 +00:00
Narayan Kamath
48620f1d1b 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
2014-02-14 14:08:23 +00:00
Andreas Huber
d430354c6b Merge "Revert "Split AndroidRuntime into AndroidRuntimeBase base-class and the rest."" 2014-02-13 17:22:49 +00:00
Andreas Huber
9ae000ca8c Revert "Split AndroidRuntime into AndroidRuntimeBase base-class and the rest."
This reverts commit 7825334929b098b36e1144872200e75ba6d24b13.

Change-Id: I1702eb3ff9d7192d64039c8bf4bc3fc5d8e458c4
2014-02-13 17:22:33 +00:00
Andreas Huber
04f0cab79d Merge "Split AndroidRuntime into AndroidRuntimeBase base-class and the rest." 2014-02-13 16:35:03 +00:00
Andreas Huber
7825334929 Split AndroidRuntime into AndroidRuntimeBase base-class and the rest.
AndroidRuntimeBase (exported by libandroid_runtime_base.so) is all you need
to link against to gain the ability to do AndroidRuntimeBase::getJNIEnv()
thus minimizing build dependencies.

Change-Id: Ia7f0c94c8c02b974c068e0db34774827f96aa95b
2014-02-12 15:00:05 -08:00
Nick Kralevich
d5c8044e7e resolved conflicts for merge of 1cbea39f to master
Change-Id: Ib33484546c6a03cbc4cd96e97d9d785d68e10700
2014-02-12 14:41:25 -08:00
Nick Kralevich
1cbea39fe1 resolved conflicts for merge of dd3d95f1 to klp-volantis-dev
Change-Id: I96c0f0da852a0b3cf8aef9158678d38aa30f456f
2014-02-12 14:08:06 -08:00
Dianne Hackborn
4385d37813 Fix build.
At least part of what is broken.  Other stuff still seems to be.

(cherry picked from 32bb5fae353b5bb6275e75952e89c514c7369cee)

Change-Id: I280376645166fe772ff7a31ff2e8494dce2adbf8
2014-02-12 10:11:34 +00:00
Colin Cross
ecbeae74f2 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
2014-02-11 18:02:06 -08:00
Dianne Hackborn
d9e385b111 Fix build.
At least part of what is broken.  Other stuff still seems to be.

Change-Id: I367dc0377bd5b4e59d9d9b68f3506bf1d64aa591
(cherry picked from commit 32bb5fae353b5bb6275e75952e89c514c7369cee)
2014-02-11 22:47:42 +00:00
Dianne Hackborn
32bb5fae35 Fix build.
At least part of what is broken.  Other stuff still seems to be.

Change-Id: I367dc0377bd5b4e59d9d9b68f3506bf1d64aa591
2014-02-11 14:22:14 -08:00
Dianne Hackborn
47b80be208 am be49403a: am 0cd115e1: am 578087e3: Merge "New command line tool \'idmap\'"
* commit 'be49403a0362c18edaeafe59ac09baac14294dee':
  New command line tool 'idmap'
2014-02-11 20:44:38 +00:00
Michael Wright
d6b473713f Move inputservice over to frameworks/native
Remove all of the pieces except the PointerController and SpriteController over
to frameworks/native in preparation for inputflinger. Those two need to stay in
frameworks/base for now because they depend on Skia currently. In the long run
they should be merged into either the InputManager or the WindowManager rather
than as a part of the inputservice / inputflinger.

Try 2.

Change-Id: I84259356d3eb8efc5aefb9d6b311b5fc590ea3ed
2014-02-11 10:47:36 -08:00
Narayan Kamath
91447d88f2 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
2014-02-10 15:50:16 +00:00
Narayan Kamath
378c6775a6 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
2014-02-10 15:33:30 +00:00
Mårten Kongstad
48d22323ce 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
2014-02-03 11:20:30 +01:00
Mårten Kongstad
65a05fd56d 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
2014-02-03 09:47:16 +01:00
Narayan Kamath
7c4887f66b 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
2014-01-31 13:47:27 +00:00
Narayan Kamath
00b314436f Change ResourceType cookies to int32_t.
Also change the order of parameters in ResTable constructors
to avoid ambiguity.

Change-Id: If7bfa1f640dddca39b9f26a3ce84081fa7b6e6e3
2014-01-28 16:27:52 +00:00
Narayan Kamath
a0c6260705 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
2014-01-27 10:31:11 -08:00
Christopher Tate
ca0b0c18e7 Fix MCC/MNC typo
Manual merge of https://android-review.googlesource.com/70831 across
the header refactoring.

Change-Id: I28b6a61e89b68d914124122882976a9d2f81a609
2014-01-27 10:31:11 -08:00
Narayan Kamath
560566d291 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
2014-01-27 10:31:11 -08:00
Adam Lesinski
16c4d154dc Revert "move libandroidfw to frameworks/native"
This reverts commit 84b6292c33d71b5739828d08aa8101d1954577f2.
2014-01-27 10:31:10 -08:00
Narayan Kamath
745d4efc83 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
2014-01-27 11:20:24 +00:00
Mårten Kongstad
4482e7cb67 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
2013-12-16 12:42:36 +01:00
Narayan Kamath
afd31e0829 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
2013-12-09 16:23:16 +00:00
Mike Lockwood
84b6292c33 move libandroidfw to frameworks/native
Change-Id: Ic5b8a2742c7141156ab0f00ca29097bfe92bce60
2013-10-03 10:30:18 -07:00
Ruben Brunk
87eac99a21 Remove dependency on JNIHelp header side effects.
Bug: 10680559
Change-Id: I47870d6c48906e0a420c52b7bc5945ffe29c68a2
2013-09-10 20:47:43 -07:00
Mathias Agopian
52a9a10b6b Clearly separate consumer and producer interfaces
Bug: 9265647
Change-Id: Ic68e91788d0a05251e1d2fb9f9d4de403c7099bf
2013-08-06 13:07:42 -07:00