Commit Graph

1168 Commits

Author SHA1 Message Date
Jamie Gennis
67eedd74ab Fix a bug in SurfaceTexture::setBufferCount.
We need to reset mCurrentTexture and mLastQueued in setBufferCount
because it frees all of the buffers associated with the buffer slots.

Change-Id: Ie2f834ec1c07ce7a4ab9b2b5fc5fe8c294010c60
2011-01-09 16:40:06 -08:00
Jamie Gennis
e70d8b4393 Add method logging to the SurfaceTexture C++ class.
Change-Id: Ic05b05428d34c04634ce9fc3f924ff3322bb2da2
2011-01-09 16:40:06 -08:00
Jamie Gennis
3461e0fadf Initialize the SurfaceTexture buffer slots.
Change-Id: I81a562ad897173f33cd6a2127737718a7db610eb
2011-01-09 16:40:06 -08:00
Jamie Gennis
8ba32fade1 Add the SurfaceTexture C++ implementation.
This change adds the C++ implementation of SurfaceTexture and related
classes. The goal of this is for a SurfaceTexture to be passed to
camera service or Stagefright in place of a Surface to allow camera
preview or decoded video frames to be streamed to an OpenGL ES texture
that an application can use.

Change-Id: I55c83a7017f1ecb81c9c9e3252cbd118b914296c
2011-01-06 13:20:47 -08:00
Jamie Gennis
4956334065 Add the ISurfaceComposer::createGraphicBuffer IPC.
This change adds a new binder method to the ISurfaceComposer interface.
This IPC is intended to allow SurfaceFlinger clients to allocate gralloc
buffers using SurfaceFlinger as a proxy to gralloc.

Change-Id: Ide9fc283aec5da6268ba62cfed0c3319a50b640d
2011-01-06 13:12:35 -08:00
Jeff Brown
4125036157 Mouse pointer integration.
Added support for loading the pointer icon from a resource.

Moved the system server related bits of the input manager out
of libui and into libinput since they do not need to be linked into
applications.

Change-Id: Iec11e0725b3add2b905c51f8ea2c3b4b0d1a2d67
2011-01-04 17:31:24 -08:00
Jeff Brown
288757f996 Merge "Add initial support for cursor-based pointing devices." 2010-12-29 13:22:08 -08:00
Jeff Brown
4c501a4217 Add initial support for cursor-based pointing devices.
Some parts stubbed out but you can plug in a mouse and move
a green cursor around to interact with the UI.

Change-Id: I80d597a7f11d3bd92041890f74b3c77326975e6e
2010-12-29 13:19:53 -08:00
Jean-Baptiste Queru
1ee57e397f am 6637e307: am bfb5f596: Merge "Fix for writing empty strings to Parcel::writeString8()"
* commit '6637e307494475b85afe8869d312d4a2f832d8f4':
  Fix for writing empty strings to Parcel::writeString8()
2010-12-28 11:54:08 -08:00
Jean-Baptiste Queru
587567a9b5 am bfb5f596: Merge "Fix for writing empty strings to Parcel::writeString8()"
* commit 'bfb5f5966b36c4960b56f6de10ba261332208db9':
  Fix for writing empty strings to Parcel::writeString8()
2010-12-28 11:39:21 -08:00
Jeff Brown
f71751848b am c6f2b3b3: Merge "Fix policy issues when screen is off. (DO NOT MERGE)" into gingerbread
* commit 'c6f2b3b302c06b8b7b81ec7e3a43a7df1813d0e0':
  Fix policy issues when screen is off. (DO NOT MERGE)
2010-12-23 12:43:48 -08:00
Jeff Brown
e7a0d2beea Fix policy issues when screen is off. (DO NOT MERGE)
Rewrote interceptKeyBeforeQueueing to make the handling more systematic.
Behavior should be identical except:
- We never pass keys to applications when the screen is off and the keyguard
  is not showing (the proximity sensor turned off the screen).
  Previously we passed all non-wake keys through in this case which
  caused a bug on Crespo where the screen would come back on if a soft key
  was held at the time of power off because the resulting key up event
  would sneak in just before the keyguard was shown.  It would then be
  passed through to the dispatcher which would poke user activity and
  wake up the screen.
- We propagate the key flags when broadcasting media keys which
  ensures that recipients can tell when the key is canceled.
- We ignore endcall or power if canceled (shouldn't happen anyways).

Changed the input dispatcher to not poke user activity for canceled
events since they are synthetic and should not wake the device.

Changed the lock screen so that it does not poke the wake lock when the
grab handle is released.  This fixes a bug where the screen would come
back on immediately if the power went off while the user was holding
one of the grab handles because the sliding tab would receive an up
event after screen turned off and release the grab handles.

Bug: 3144874
Change-Id: Iebb91e10592b4ef2de4b1dd3a2e1e4254aacb697
2010-12-22 16:00:21 -08:00
Pravat Dalbehera
d1dff8d4d4 Fix for writing empty strings to Parcel::writeString8()
If writeString8 is called with the following sequence:

 writeString8(String8(""));
 writeString8(String8("TempString"));

Then in the readString8, the 2nd String i.e. "TempString" is not read,
instead an empty string is read.

The bug comes because of the write call for String8("") where there are
no String bytes present. In the write Statement, an extra ‘\0’ is
written. During the Marshalling, Following bytes are written:

1        2         3        4       5   ...
0x0      0x0       0xB      ‘T’     ‘e’  ...

The readString8 function has a check that, if String length is 0, don’t
read anything. So the first byte is read as the length for the first
string. The second byte i.e. ‘\0’ is read as the length for the second
string and hence the second string becomes empty too.

Change-Id: Id7acc0c80ae16e77be4331f1ddf69ea87e758420
2010-12-22 12:57:31 +01:00
Mathias Agopian
5eee3d2b13 Merge "minor clean-up. SurfaceFlinger doesn't need libpixelflinger.so." 2010-12-14 15:51:32 -08:00
Mathias Agopian
90f96b8383 Merge "dump callstack on Surface use error" 2010-12-14 15:51:22 -08:00
Brad Fitzpatrick
1b60843547 Framework-side support for Dalvik "isSensitiveThread" hook.
Used in lock contention stats.

Bug: 3226270
Change-Id: Ie6f58d130a29079a59bdefad40b80304d9bc3623
2010-12-14 09:28:16 -08:00
Mathias Agopian
455d18d4c2 minor clean-up. SurfaceFlinger doesn't need libpixelflinger.so.
Change-Id: I3bdca74351c8e480a05084bc412a96c5f685221d
2010-12-13 16:47:31 -08:00
Mathias Agopian
c44375ce71 Merge "[3258939] Need snapshot to limit which layers are included" 2010-12-10 16:30:46 -08:00
Mathias Agopian
bf2c6a6c8f [3258939] Need snapshot to limit which layers are included
Change-Id: Id7351a0e3f53dde99b291cffba553d89fd4d7ca9
2010-12-10 16:22:31 -08:00
Mathias Agopian
e6f096a4cd dump callstack on Surface use error
Change-Id: I38e260dd47349b9af3a999dda683a083a94be16d
2010-12-10 15:37:48 -08:00
Jeff Brown
7999039b77 Fix race condition in fallback key processing.
Need to ensure that the channel is still valid before proceeding.

Bug: 3271482
Change-Id: Ia6863cbedd9b53cbc5c9c8815e9ea90bef3d2218
2010-12-09 18:14:23 -08:00
Mathias Agopian
0a757814f3 fix [3259708] Graphic Buffer Mapper does not support YV12
remove a bunch of a code that was there only to support broken gralloc implementations

Change-Id: I3c1a9172224cbcc283601abfbbd695a20815451f
2010-12-08 16:48:28 -08:00
Mathias Agopian
a5529c8778 remove support for PUSH_BUFFER surfaces and overlays
the same functionality is now supported through
the h/w composer HAL, and YUV support in the GPU.

Change-Id: I8146605449954b8e8fd7f78810b7d873c2d8f5bf
2010-12-08 16:13:59 -08:00
Erik Gilling
1d21a9cafc surfaceflinger: add support for gralloc dump hooks
Change-Id: Ib6f539ed0132b70d040d653c03d52cc04249ac3c
2010-12-08 15:40:11 -08:00
Kenny Root
a15e3f5a92 Merge "Change assets to use 64-bit API" 2010-12-08 14:46:22 -08:00
Kenny Root
18092ddc86 Change assets to use 64-bit API
The asset system and supporting libraries were using off_t instead of
off64_t to access files larger than 2GB (32-bit signed). This change
replaces all off_t with off64_t and lseek64.

There is a new utils/Compat.h added for Mac OS compatibility.

Also fixed some size-related compiler warnings.

Bug: 3205336
Change-Id: I9097b3cb7a602e811fe52f245939d8975da55e9e
2010-12-08 11:21:30 -08:00
Jeff Brown
02d85b5021 Add support for fallback keycodes.
This change enables the framework to synthesize key events to implement
default behavior when an application does not handle a key.
For example, this change enables numeric keypad keys to perform
their associated special function when numlock is off.

The application is informed that it is processing a fallback keypress
so it can choose to ignore it.

Added a new keycode for switching applications.

Added ALT key deadkeys.

New default key mappings:
- ESC -> BACK
- Meta+ESC -> HOME
- Alt+ESC -> MENU
- Meta+Space -> SEARCH
- Meta+Tab -> APP_SWITCH

Fixed some comments.
Fixed some tests.

Change-Id: Id7f3b6645f3a350275e624547822f72652f3defe
2010-12-07 17:35:26 -08:00
Mathias Agopian
b5a00fcb71 am 48f42f8c: am 4153bf3a: Merge "[3171580] don\'t automatically log GraphicBuffer allocation failures" into gingerbread
* commit '48f42f8c3fbd33b2f46c6290ff5963dd58938cf9':
  [3171580] don't automatically log GraphicBuffer allocation failures
2010-12-07 17:24:03 -08:00
Mathias Agopian
e4f81090c2 am a2977c38: Merge changes Ie03796ae,Ide3e980a into gingerbread
* commit 'a2977c383d363e1e88a5b36230b1fa4c312807d2':
  [3171580] SurfaceFlinger Bypass mode. (DO NOT MERGE)
  [3171580] Add transform field to native buffers. (DO NOT MERGE)
2010-12-07 14:22:56 -08:00
Mathias Agopian
372c56e98b am 4153bf3a: Merge "[3171580] don\'t automatically log GraphicBuffer allocation failures" into gingerbread
* commit '4153bf3a259624a2f2dc497b77b225a1fb517abc':
  [3171580] don't automatically log GraphicBuffer allocation failures
2010-12-07 14:20:09 -08:00
Mathias Agopian
30eb1b1803 [3171580] Add transform field to native buffers. (DO NOT MERGE)
This field indicate how the content of the buffer
needs to be transformed.

Change-Id: Ide3e980a90599e931406135693231276626adbbb
2010-12-03 17:35:07 -08:00
Mathias Agopian
678bdd6349 [3171580] don't automatically log GraphicBuffer allocation failures
some of these failures are not fatal and even expected in some cases
so they should not emit a dump in the log in those cases.

Change-Id: Idcfa252e3bfa9d74e27fe4ad8f8623aa01aa9c5e
2010-12-03 17:33:09 -08:00
Jeff Brown
db360642ed Improve support for external keyboards.
Use Vendor ID, Product ID and optionally the Version to
locate keymaps and configuration files for external devices.

Moved virtual key definition parsing to native code so that
EventHub can identify touch screens with virtual keys and load
the appropriate key layout file.

Cleaned up a lot of old code in EventHub.

Fixed a regression in ViewRoot's fallback event handling.

Fixed a minor bug in FileMap that caused it to try to munmap
or close invalid handled when released if the attempt to map
the file failed.

Added a couple of new String8 conveniences for formatting strings.

Modified Tokenizer to fall back to open+read when mmap fails since
we can't mmap sysfs files as needed to open the virtual key
definition files in /sys/board_properties/.

Change-Id: I6ca5e5f9547619fd082ddac47e87ce185da69ee6
2010-12-02 16:01:32 -08:00
Jeff Brown
53c16642e2 Ensure the ShortcutManager uses the correct key character map.
The ShortcutManager used to only receive the key code of the key event
that triggered the shortcut.  This change now provides the shortcut
manager with the whole key event so it can look up the associated
character using the correct key character map.

To make this more efficient, added a mechanism for recycling
key events.  At the moment it is only used by key events owned by the
system process, since clients of the existing API (such as Views)
might continue to hold on to key events after dispatch has finished so
they would break if the key event were recycled by the framework.

Deprecated KeyCharacterMap.BUILT_IN_KEYBOARD.

Change-Id: I4313725dd63f2be01c350c005a41c7fde9bc67e8
2010-11-30 18:50:17 -08:00
Jeff Brown
6688837ff6 Support non-orientation aware keyboards and other devices.
Fixed a bug with dpad keys on external keyboards being rotated
according to the display orientation by adding a new input device
configuration property called "keyboard.orientationAware".

Added a mechanism for overriding the key layout and key character
map in the input device configuration file using the new
"keyboard.layout" and "keyboard.characterMap" properties.

Also added "trackball.orientationAware", "touch.orientationAware" and
"touch.deviceType" configuration properties.

Rewrote the configuration property reading code in native code
so that it can be used by EventHub and other components.

Added basic support for installable idc, kl, and kcm files
in /data/system/devices.  However, there is no provision for
copying files there yet.

Disabled long-press character pickers on full keyboards so that
key repeating works as expected.

Change-Id: I1bd9f0c3d344421db444e7d271eb09bc8bab4791
2010-11-30 17:15:49 -08:00
Vasu Nori
7c4f09db4c fix messages from sqlite layer in c++ code to be useful.
Change-Id: Ib13f86f3481aae391f5e887bb14877f12bf48034
2010-11-29 11:53:55 -08:00
Jeff Brown
44a2a171e1 Merge "Port Emulator keymaps." 2010-11-23 15:51:27 -08:00
Jeff Brown
d5fdf7d74b Port Emulator keymaps.
Also added a validation tool for keymaps (not currently integrated
into the build system but getting there).

This change brings back Android.mk with the intent that it will
be used to validate keymaps in a later change.

Added some missing keys that are present on phones.

Bug: 3215210
Bug: 3225421
Change-Id: Id817c6e2215164616942c51a42752915d9ceacd3
2010-11-23 15:26:48 -08:00
Jean-Baptiste Queru
ffb0795daf am 9df7f313: am f0f6c54b: Merge "frameworks/base: Destroy the overlay even if there is an error"
* commit '9df7f31359866a77a47c9fab3171c71715fd0056':
  frameworks/base: Destroy the overlay even if there is an error
2010-11-23 11:17:48 -08:00
Jean-Baptiste Queru
ec756056ab am f0f6c54b: Merge "frameworks/base: Destroy the overlay even if there is an error"
* commit 'f0f6c54b13831b11bd7a3bd7a01dc49b7505e56e':
  frameworks/base: Destroy the overlay even if there is an error
2010-11-23 11:14:57 -08:00
Naomi Luis
29a73ba845 frameworks/base: Destroy the overlay even if there is an error
Allow the overlay object to be destroyed whenever the destroy is
invoked. Currently the destroy call returns if there is an error
encountered, which results in open data and control channels.

Change-Id: I1f2ef4ebb5fb1dcabf05ab50b5bbf6e5e240a63a
2010-11-22 14:03:18 -08:00
Jeff Brown
9ee93d18ed Fix SDK build on Windows due to use of mmap.
Change-Id: Id4bd9a6f932285c93c5853e540efc20b99876564
2010-11-19 13:52:19 -08:00
Jeff Brown
46aabb3f51 am b27b8c0c: Fix a key repeating bug. (DO NOT MERGE)
* commit 'b27b8c0caf8ff23d10eea655085769f314050427':
  Fix a key repeating bug. (DO NOT MERGE)
2010-11-18 12:36:59 -08:00
Jeff Brown
0b7b1960e7 am bfc1cc2d: Fix stuck keys when released out of order. (DO NOT MERGE)
* commit 'bfc1cc2d1ea85cc754e63b422eb8cef8ae6a3667':
  Fix stuck keys when released out of order. (DO NOT MERGE)
2010-11-18 12:36:50 -08:00
Jeff Brown
a3477c862a Added support for full PC-style keyboards.
BREAKING CHANGE: Redesigned the key character map format to
accomodate full keyboards with more comprehensive suite of modifiers.
Old key character maps will not work anymore and must be updated.
The new format is plain text only and it not compiled to a binary
file (so the "kcm" tool will be removed in a subsequent check-in).

Added FULL keyboard type to support full PC-style keyboards.

Added SPECIAL_FUNCTION keyboard type to support special function
keypads that do not have any printable keys suitable for typing
and only have keys like HOME and POWER

Added a special VIRTUAL_KEYBOARD device id convention that maps
to a virtual keyboard with a fixed known layout.  This is designed
to work around issues injecting input events on devices whose
built-in keyboard does not have a useful key character map (ie.
when the built-in keyboard is a special function keyboard only.)

Modified several places where events were being synthesized
to use the virtual keyboard.

Removed support for the "qwerty" default layout.
The new default layout is "Generic".  For the most part "qwerty"
was being used as a backstop in case the built-in keyboard did
not have a key character map (probably because it was a special
function keypad) and the framework needed to be able to inject
key events anyways.  The latter issue is resolved by using the
special VIRTUAL_KEYBOARD device instead of BUILT_IN_KEYBOARD.

Added the concept of a key modifier behavior so that
MetaKeyKeyListener can distinguish between keyboards that use
chorded vs. toggled modifiers.

Wrote more robust key layout and key character map parsers
to enable support for new keyboard features and user installable
key maps.

Fixed a bug in InputReader generating key ups when keys
are released out of sequence.

Updated tons of documentation.

Currently QwertyKeyListener is being used for full keyboards
with autotext and capitalization disabled.  This mostly works
but causes some problems with character pickers, etc.
These issues will be resolved in subsequent changes.

Change-Id: Ica48f6097a551141c215bc0d2c6f7b3fb634d354
2010-11-18 09:49:03 -08:00
Jeff Brown
9cf416cbcf Fix a key repeating bug. (DO NOT MERGE)
This change fixes a bug in the dispatcher where the window manager
policy would incorrectly receive a key repeat count of 0 in the case
where the key repeat was generated by the hardware or driver.
Long-press on HOME was broken as a result.

Repeating keys could also get stuck down.

Bug: 3159581
Bug: 3208156
Change-Id: I1145487cfcc41a7850dba4cafc63c4a5951ace5b
2010-11-17 19:42:04 -08:00
Jeff Brown
9bb3ef2e78 Fix stuck keys when released out of order. (DO NOT MERGE)
Bug: 3208156
Change-Id: I14e4d54f4912de5e2fabcd8638120623aa2d16e0
2010-11-17 19:17:54 -08:00
Jean-Baptiste Queru
3f02b88af6 am 5e069074: am a15e4886: Merge "Framebuffer: Support variable number of framebuffers in the UI"
* commit '5e0690745a45f99d12d940dd4aaae814b00a429e':
  Framebuffer: Support variable number of framebuffers in the UI
2010-11-17 17:36:11 -08:00
Jean-Baptiste Queru
af10976583 am a15e4886: Merge "Framebuffer: Support variable number of framebuffers in the UI"
* commit 'a15e4886de8f75f3cb137f51743d330414c910e8':
  Framebuffer: Support variable number of framebuffers in the UI
2010-11-17 17:29:48 -08:00
Kenny Root
7986fe5035 Merge "Split UTF functions from String8/16" 2010-11-15 11:11:22 -08:00