Fix a couple of nasty heap corruption bugs.

- When replacing the buffer pointer with another one, the allocated
  length wasn't updated. As the TI encoder relies of those being matched
up (it e.g. does a memset(pBuffer, 0, nAllocLen) at certain places), this
could lead to random memory being overwritten (or to a segfault when
reaching the end of the mapping)
- When replacing the buffer, the old buffer wasn't saved and restored
  before calling freeBuffer. This led to a different address passed to
free() than was returned by malloc(), could lead to all kinds of weird,
undefined behaviour.
Camera: Handle error event from HAL + burst mode code clean up.

(a)Error mapping is not proper so change the error type from UNKNOWN_ERROR
   to CAMERA_ERROR_UNKNOWN.

(b)Ccde clean up for burst mode.

Change-Id: I9ba351eba9526f0f274f52b12003b7ea0aae12be
stagefright: Fix camcorder effects on MSM8660.

 * Patch adapted from
   https://www.codeaurora.org/gitweb/quic/la/?p=platform/frameworks/base.git;a=commit;h=a686ca15dc27aeeeffa3a0039c2c546af7f6272f
 * We need to use buffers from the MM heap on the 8660 devices I am
   testing.

Change-Id: I1e31f2db521834a068e11d48e88547044b0c906f
Fix InputReader test

Change-Id: I91e985ccf5102c61dccfa34504e403aeb8288321
libstagefright: Unbreak live effects

Change I1e31f2db521834a068e11d48e88547044b0c906f broke live effects
for (probably all) non-Samsung msm8660 devices. Use platform-based
logic to choose the correct memory pool (SMI for 8660 and MM for
everyone else), and add a build-time switch for devices that always
want MM regardless of platform (BOARD_CAMERA_USE_MM_HEAP)

Change-Id: I103946c40548f319bb1446f75a6a539aa3eb51b8
add missing file for "Iec99d52f: Load a device specific key handler"

Change-Id: If4809725e8435e011c05642639f577f84cf0a8c5
This reverts two wrong patch sets fix attempts.

Trying to fix my stupid mistakes.
Reverted commits:

*) 5e2284869bc6b53d6de786d6b5846e9b79383f04:
   Fix InputReader test

*) 8f2303e5b3b2c1e40c52bfb4028a663e503d132e:
   add missing file for "Iec99d52f: Load a device specific key handler"

*) 2ee7ed47a844f168db074c95e4fc93e9745618c0:
   InputManager: Add system setting to define keyboard locales

*) cf02764d48eadacdb9114225e043835143c4ed07:
   Load a device specific key handler

Change-Id: Ibdaa8d52054c830a4e3659bf356cc2df71342eb3
InputManager: Add system setting to define keyboard locales

KEYLAYOUT_OVERRIDES expects a string of "devicename,layoutfile" to set
keyboard layout and character map to files in /system/usr/keylayout and
/system/user/keychars.

This overrides the default behaviour of opening files that match the
device's input name if there's no configuration file.
Dispatch keys to a device specific key handler

Injects a device key handler into the input path to handle additional
keys (as found on some docks with a hardware keyboard).

Configurable via overlay settings config_deviceKeyHandlerLib and
config_deviceKeyHandlerClass.
Merge "Fix a couple of nasty heap corruption bugs." into ics
clean up overridden unsolicited response

Problems fixed:
  - Cases 1031-1035 are now fully handled by RIL.java base class; override
    them here only for devices using GB radio libraries
  - Comments for cases 1031-1035 did not match the codes in ril.h (in ICS)
  - Case 1034 is RIL_CONNECTED - overriding it caused this message to be
    obscured and mRilVersion was never set and connection notification was
    not sent out (root cause for hanging SETUP_DATA_CALL on Skyrocket and Note)
  - Add case 1038 (DATA_NETWORK_STATE_CHANGED)

Change-Id: Ie0197446193111394833f40bfedf8e1516deb7db
Merge "clean up overridden unsolicited response" into ics
Merge remote-tracking branch 'cm/ics' into ics