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.
Vibrator/airplane overrides (1/2 Frameworks)

Add vibrator overrides for ringer and notification:
* enable
* disable
* only when silent

Add airplane mode overrides:
* enable
* disable

Patch Set 1:
initial patch

Patch Set 2:
remove airplane mode 'enable, leave nfc enabled'

Change-Id: I2efa3e5ef95574b04f872ed970090e507189be2b
telephony: Consolidate Qualcomm RIL implementations

The RIL code for qualcomm devices was getting a bit messy (and
with a fair amount of duplicate code), so move all common code
to a new shared class, and keep only the minimum necessary
method overrides in the device-specific implementations

Change-Id: I50bf1f4efa30e637c825d9c5bf40ba3f2f130924
Load a device specific key handler

Configurable via overlay settings config_deviceKeyHandlerLib and
config_deviceKeyHandlerClass.

Change-Id: Iec99d52f4a665e59cd13939af62f9b5b3becd375
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 it is unconfigured.

Change-Id: I35d07c6986db5a8b0744ff4c8649c2a34cc2fd14
Updated Hebrew Translation

Change-Id: I00315b8082426cdaf44c36bb55712318be991225
SystemUI: fix autorotate toggle

Change-Id: I09a79a999d454f35f235f07689cab973471cd716
Merge "telephony: Consolidate Qualcomm RIL implementations" into ics
libstagefright: Remove assert failure for kKeyHfr

- Remove assert failure if kKeyHfr is not present in
  meta data.
- Assume normal mode recording if kKeyHfr is absent

Change-Id: I17e29c943cc8886df9e8976487c05aabc54c3129
(cherry picked from commit 9fb63299bf27bd30f8a0fab5b9c2777e4342f154)
Feature : Volume adjust sound preference 1/2

Adjusting the volume makes a nice "boing" sound
Personally I find this annoying
This patch makes this a preference in
Settings | Sound
    Volume adjust sound
        Play sound when adjusting volume with hard keys

The Checkbox is defaulted to ON (1 in defaults.xml)

Look for 2/2 for the Settings, Sound Panel Change

Change-Id: Iad89a0c49288094e21824aa9c9e1bf98c29cfec3
Bugfix: reboot needed for dock audio checkbox 1/2

After the patch
http://review.cyanogenmod.com/#/c/15540/

The Dock audio is only observed if the checkbox is checked onBootComplete

This patch adds an extra Event for when the dock setting is changed,
this is picked up by the WiredObserver and either stops or starts listening to the dock.

Note that stopObserving() stops all observations so the other endpoints need re-observing.

Change-Id: Ifcb3e36f116688d0ccb7be15f1e7aa3d24e2981c
RIL: Qualcomm: Unbreak LTE

the mUSIM variable got badly scoped during the qcom telephony
refactoring, breaking LTE for LGE devices

Change-Id: I5186891d30fe9e0544aa2dee64474a6a27097952
Merge "libstagefright: Remove assert failure for kKeyHfr" into ics
Merge "Vibrator/airplane overrides (1/2 Frameworks)" into ics
libstagefright: Remove assert failure for kKeyHfr

- Remove assert failure if kKeyHfr is not present in
  meta data.
- Assume normal mode recording if kKeyHfr is absent

Change-Id: I17e29c943cc8886df9e8976487c05aabc54c3129
(cherry picked from commit 9fb63299bf27bd30f8a0fab5b9c2777e4342f154)
Merge "Load a device specific key handler" into ics
Merge "InputManager: Add system setting to define keyboard locales" into ics
Merge "Updated Hebrew Translation" into ics
NavigationBar : Customization

Allows user to customize navigation bar.

Features :
- Choose from 1-6 # of buttons
- Re-arrange / assign buttons

Patchset 1  : Initial commit
Patchset 2  : Resize side drawables to avoid requestRelayout() [HACK]
Patchset 3  : Added extras to intent to explicity change state
Patchset 4  : New drawables (David Tonder)
              Fix button animation
Patchset 5  : Switch button layout to stock dimensions
              Adjust padding according to new layout
Patchset 6  : Change "Blank" to "Empty" where applicable
Patchset 7  : Lowercase key names (Will require a wipe of the database entry)
              Fix issue where during edit mode if screen turns off, layout gets distorted on restore
              Add "save" extra to intent to clarify whether to save the layout or not
Patchset 8  : Rebase for 4.0.4
Patchset 9  : Fix padding / lowLights
Patchset 10 : Minor fixes
Patchset 11 : Fix issue with losing edit mode after theme changes
	    : Fix whitespace issue
            : Fix low light gravity in landscape
            : Add regular menu button option (icons by DvTonder)
	    : Localize resources
            : Fix padding issue
Patchset 12 : Hide searchbutton like others on lockscreen
Patchset 13 : Fix lowLight padding
Patchset 14 : Code cleanup
Patchset 15 : Minor edit

Change-Id: If24a4413f99b8b4661ffd7ad9565c005fa22d7ba
Merge "Bugfix: reboot needed for dock audio checkbox 1/2" into ics