5111 Commits

Author SHA1 Message Date
Michael Wright
f80f60ba2b am d23d916e: Merge "Controllers must have buttons and a movement mechanism." into klp-modular-dev
* commit 'd23d916e0fc573ccde8a622aaa42ccfae9d31f82':
  Controllers must have buttons and a movement mechanism.
2014-03-13 00:40:03 +00:00
Michael Wright
d23d916e0f Merge "Controllers must have buttons and a movement mechanism." into klp-modular-dev 2014-03-13 00:37:10 +00:00
RoboErik
306c46884e am ca9eef62: b/12068020 Make kb layouts only unique to vendor/product. Do not merge
* commit 'ca9eef6203b7cfb0084f8305d4dcc5d70a7a25cd':
  b/12068020 Make kb layouts only unique to vendor/product. Do not merge
2014-03-12 21:12:26 +00:00
RoboErik
840af707b3 am c1e0015e: b/12068020 Add a way to add uniqueness to device descriptors. Do not merge
* commit 'c1e0015ec3dfacc137cb500066020b25f18ecbb7':
  b/12068020 Add a way to add uniqueness to device descriptors. Do not merge
2014-03-12 21:12:23 +00:00
RoboErik
ca9eef6203 b/12068020 Make kb layouts only unique to vendor/product. Do not merge
This is a cherry-pick of https://googleplex-android-review.git.corp.google.com/#/c/399886/

Instead of storing a kb layout per device descriptor (which is expected
to be unique), store it for each vendor/product. This way we can keep
a consistent layout between identical but physically different keyboards.

There are some corner cases this is expected to fail on, namely devices
that incorrectly have the same vendor/product id. Devices that don't
define a vendor/product id will continue to use the descriptor to store
layout files.

Change-Id: I1f2508561992080459310d5a644dad65a9c24f1a
2014-03-12 13:21:08 -07:00
RoboErik
c1e0015ec3 b/12068020 Add a way to add uniqueness to device descriptors. Do not merge
Cherry pick from https://googleplex-android-review.git.corp.google.com/#/c/398226/

This adds an integer to the descriptor of devices without uniqely
identifying information. It will reuse values that are no longer
in use, so if you remove a single device and attach a different
identical device it will appear to be the same device.

TODO: Derive uniqueness from USB port when possible. This version
will generate different descriptors for each half of a USB keyboard
that shows up twice.

Change-Id: Ie628f19c01469f6ec2d354cd00000898ac6432fa
2014-03-12 13:20:57 -07:00
Michael Wright
b0aa4822f5 Controllers must have buttons and a movement mechanism.
Some devices have joystick axes or DPad keys, but no gamepad buttons
(or vice versa). We shouldn't count these as gamepads since games
can't really be expected to work with this setup in the general case.
Instead, require that a device has a movement mechanism (joystick
axes or DPad buttons), as well as at least one gamepad button before
considering it a controller.

Bug: 13432364
Change-Id: Ia113c8441557d4c858c1e5740a3e1c7e0e9fdcdd
2014-03-12 12:58:53 -07:00
Michael Wright
a54f852d3d am ed28fc89: Utilize new Android LED constants. DO NOT MERGE
* commit 'ed28fc89e3085a88c6bd8b4269988150f3eceb56':
  Utilize new Android LED constants. DO NOT MERGE
2014-03-11 23:16:25 +00:00
Michael Wright
ed28fc89e3 Utilize new Android LED constants. DO NOT MERGE
Also, have EventHub manage game controllers' player LEDs

Change-Id: Ic7dba19ad236a3c7d1aff5d3f938bd239b98d51d
2014-03-11 14:52:18 -07:00
Narayan Kamath
8272c84cb5 am bbf82665: am 6e2fb587: Merge "LP64: Make 9 patches architecture agnostic."
* commit 'bbf826659e8e5d0be683b2459207c495303d53b6':
  LP64: Make 9 patches architecture agnostic.
2014-03-10 10:47:45 +00:00
Narayan Kamath
bbf826659e am 6e2fb587: Merge "LP64: Make 9 patches architecture agnostic."
* commit '6e2fb587d71631bd29fdb844a6451d68e2144337':
  LP64: Make 9 patches architecture agnostic.
2014-03-10 03:46:07 -07: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
Narayan Kamath
be094d89db am 8fb22ae7: am eee2c72f: Merge "Various format string fixes for 64bit"
* commit '8fb22ae772fc62a10db6a06f283140d9233e8704':
  Various format string fixes for 64bit
2014-02-28 13:46:53 +00:00
Narayan Kamath
8fb22ae772 am eee2c72f: Merge "Various format string fixes for 64bit"
* commit 'eee2c72f96cd4e6228c50c8b461b4dd84a9f4538':
  Various format string fixes for 64bit
2014-02-28 05:45:01 -08:00
Narayan Kamath
eee2c72f96 Merge "Various format string fixes for 64bit" 2014-02-28 13:41:58 +00:00
Jeff Brown
71e21fec61 am 6ca90042: Add touch.wake IDC property to control wakeup.
* commit '6ca90042b398153e063cf69dea784e201e76a9ee':
  Add touch.wake IDC property to control wakeup.
2014-02-27 01:59:02 +00:00
Jeff Brown
6ca90042b3 Add touch.wake IDC property to control wakeup.
Normally we do not wake the device when the internal touch screen is
touched.  This behavior can now be configured by setting a property
in the input device configuration file.  Add the following line to
the IDC file to enable an initial touch to wake the device from sleep.

  touch.wake = 1

Change-Id: Ifd6d4f51afacd30d85f475725a66e6fcccde9cbb
2014-02-26 15:15:53 -08:00
Chris Craik
aecb8c43d0 am 7b4cce68: am c3bac8a0: Merge "Fix graphics corruption caused by HWUI caches"
* commit '7b4cce68853d8bcfce2b6bd7f999915063eb56d2':
  Fix graphics corruption caused by HWUI caches
2014-02-26 19:10:39 +00:00
Chris Craik
2c42b79c6c Fix AOSP build - DO NOT MERGE
Change-Id: I42b420c2ce89ce364a2809b28b827964e6923fa1
2014-02-26 10:44:50 -08:00
Sangkyu Lee
36fad8f6fc Fix graphics corruption caused by HWUI caches
Some caches(PatchCache, TextureCache, PathCache) for HWUI
uses deferred removal for their cache entries even though
actual resource objects are immediately freed by
ResourceCache.
For this reason, the uniqueness of a resource address in
the caches is not guaranteed in specific cases.
(Because malloc() can return the same address when malloc()
and free() called very frequently.)

So it can be possible the cache have two cache entries for
two different resources but the same memory address.
(Of course one of the resources is already freed.)
It also can be possible mGarbage vector in PatchCache has
duplicated addresses and this can lead to duplicated free
blocks in the free block list and graphics corruption.
(Deferred removal was implmeneted based on an assumption of
unique resource addresses.)

So this patch makes sure resource objects are freed after
the resources are removed from the caches to guarantee
the uniqueness of a resource address and prevent graphics
corruption.

Change-Id: I040f033a4fc783d2c4bc04b113589657c36fb15b
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
2014-02-26 10:43:26 -08:00
Kévin PETIT
95ece35c2f Various format string fixes for 64bit
Change-Id: I74532a4e0400033f5ee3e3f6827ac42f77d16f53
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
2014-02-24 17:39:46 +00:00
Narayan Kamath
7942397b31 am 19256340: am 22c66639: Merge "Fixes for 64bit in libhwui"
* commit '192563407964926537d688d4098054c3834341c0':
  Fixes for 64bit in libhwui
2014-02-21 16:47:38 +00:00
Narayan Kamath
22c6663909 Merge "Fixes for 64bit in libhwui" 2014-02-21 14:23:57 +00:00
Kévin PETIT
73fc558e44 Fixes for 64bit in libhwui
Using reinterpret_cast allows conversions between pointer types
and integers which don't have the same size. The corresponding
flags is -Wint-to-pointer-cast.

Change-Id: I8ff0c79d235fa6d07b8d9305edc185d946d5133d
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
2014-02-21 13:07:29 +00:00
Narayan Kamath
520a5673fb am b152473f: am 9fce8535: Merge "AArch64: Make AssetAtlasService 64-bit compatible"
* commit 'b152473f46d8176e7eb2c55b54342a7a29c525cf':
  AArch64: Make AssetAtlasService 64-bit compatible
2014-02-20 13:02:21 +00:00
Ashok Bhat
4de3f481bc AArch64: Make AssetAtlasService 64-bit compatible
Changes in this patch include

[x] Long(64-bit) is used to store native pointers in
    AssetAtlasService and related classes as they can be 64-bit.

[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: Ib4c77c134e3ad5b21732e20cde9a54a0b16bdab1
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2014-02-20 12:10:24 +00:00
Narayan Kamath
b1903653e4 am 128599e4: am 2b3c14bf: Merge "libandroidfw: fix build error for 64-bit"
* commit '128599e4496bd7ceb9d70f4addde0eba65103709':
  libandroidfw: fix build error for 64-bit
2014-02-20 11:57:19 +00:00
Patrik Bannura
443dd9313f 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
2014-02-20 10:06:23 +00:00
Narayan Kamath
8c1fc83445 am 28879bbf: am be57fca4: Merge "Extended locales in AAPT / AssetManager."
* commit '28879bbfe89dc4bf2067a7183975ecffb82f68e6':
  Extended locales in AAPT / AssetManager.
2014-02-17 11:06:38 +00:00
Narayan Kamath
982931c72b am 183e5e03: am 49024bac: Merge "AssetManager support for 3 letter lang/country codes."
* commit '183e5e038bd844ac415b14f22df5c476732066c8':
  AssetManager support for 3 letter lang/country codes.
2014-02-17 11:06:31 +00: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
Narayan Kamath
fc268ecae1 am aa98fb51: am f991771f: Merge "Use size_t* in AssetManager::createIdmap"
* commit 'aa98fb51a8a0148b72e1662cc42102c6547776ce':
  Use size_t* in AssetManager::createIdmap
2014-02-12 19:22:56 +00:00
Nick Kralevich
dd3d95f182 resolved conflicts for merge of 4ad93639 to klp-modular-dev-plus-aosp
Change-Id: I7ad222301ec0b863d48a1a9a839469436c385ea0
2014-02-12 11:05:59 -08: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
Jeff Brown
be83e4a08e am 38f96e50: Add support for injecting events into ActivityContainers. (DO NOT MERGE)
* commit '38f96e5020b3e82b98fe97b0be363a5ad185860f':
  Add support for injecting events into ActivityContainers. (DO NOT MERGE)
2014-02-12 00:37:24 +00:00
Jeff Brown
38f96e5020 Add support for injecting events into ActivityContainers. (DO NOT MERGE)
Modified ActivityView to inject touch events it receives back into
its activity container.  The container then injects the event into
the input system along with the display id of the underlying virtual
display.

Enhanced the input system to support concurrent dispatch of touch
events on multiple displays which is required for this to work.

Change-Id: I9cf1870db3be6f99a52ed9a1e3ceafe42c940093
2014-02-11 14:43:04 -08:00
Dianne Hackborn
67754d93c4 Merge "Runtime resource overlay, iteration 2" 2014-02-11 21:29:58 +00:00
Dianne Hackborn
be49403a03 am 0cd115e1: am 578087e3: Merge "New command line tool \'idmap\'"
* commit '0cd115e1cebf4c090e7c36a65d4a5b7d1c363c21':
  New command line tool 'idmap'
2014-02-11 20:35:50 +00:00
Dianne Hackborn
578087e398 Merge "New command line tool 'idmap'" 2014-02-11 20:30:08 +00:00
Narayan Kamath
deefd1fdea am 5f7c0b1d: am 6d8b21a8: Merge "Fix TinyHashMap to use generic hash_type instead of hash_t"
* commit '5f7c0b1d80f883fa15f88e0e4d508576a36a45de':
  Fix TinyHashMap to use generic hash_type instead of hash_t
2014-02-11 13:47:50 +00:00
Ashok Bhat
e9bea2a182 Fix TinyHashMap to use generic hash_type instead of hash_t
TinyHashMap used hash_t(key) to generate hashcode. This
would not work for 64-bit pointers as hash_t is declared as
an uint32_t.

Replaced the hash_t(key) call to more generic android::hash_type(key).
This function is a template function declared in TypeHelpers.h and
has a version available for all data types including pointers.

Change-Id: I612cf18b49ca7c30b63f9d6938df68fed7d80d08
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2014-02-07 19:10:04 +00:00
Chris Craik
2c764b20e4 am 0ec3ca6e: am 449273e2: Merge "Fix for positioning of glyphs within a bitmap"
* commit '0ec3ca6e08e5933016beda147ca9a82e96434b15':
  Fix for positioning of glyphs within a bitmap
2014-02-05 21:43:48 +00:00
Chris Craik
449273e2d5 Merge "Fix for positioning of glyphs within a bitmap" 2014-02-05 21:36:42 +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
d49babe50d am 9af95574: am 1cadc07d: Merge "Change ResourceType cookies to int32_t."
* commit '9af955744d4e0d82b61fc99a932b9a5cf28b5df7':
  Change ResourceType cookies to int32_t.
2014-01-31 16:29:19 +00: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
1cd2834fde am 30e20ac5: am ebd43d46: am dff83e2b: am d5970e9c: Merge "AssetManager cookies should be int32_t and not void*."
* commit '30e20ac528731a778eec45506d1e57c8839b318a':
  AssetManager cookies should be int32_t and not void*.
2014-01-27 12:07:15 +00: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