msm8960-common: squashed commits from CM

msm8960-common: re-enable hardware key rebinds

Change-Id: Ifc52a06fa3440f51c776836335b6dc8a5bd8e1fd

Conflicts:
	overlay/frameworks/base/core/res/res/values/config.xml

msm8960-common: enable separate audio input

Change-Id: I13edcd4a3b81edd5caac1952922ba25930b02666

msm8960-common: RIL: add more responses and handle them

ril.cpp: don't return when exceeding the default 1000+number-of-elements
    but try to match custom responses

ril_unsol_commands.h: add htc custom responses and their parameters
    to be passed on to RILJ

telephony/ril.h: define htc custom responses

Forward port of http://review.cyanogenmod.org/#/c/27316/

Patch Set 2: removed verbose logging

Change-Id: Ied76a89d6a758b6a646d1d9128ec0dcbb2786ac9

msm8960-common: remove unimplemented devices

Change-Id: Ibba91410d7375b7367878df24ce41ea700dd8a74

include: re-add msm_audio headers from jellybean

Change-Id: I19f5a38d1fc2cdb02bb1ff6d3f0a14c674dfe057

msm8960-common: remove commented defines

Change-Id: I70b3ea0efaa30219c28348353a116eaaceeafb15

msm8960-common: fix audio_policy.conf

Change-Id: I8c2fa9ce9d6dbfd5114670b1479fe5462bbe98bf

msm8960-common: update ION header, use newer ION API

Change-Id: If6d1db81e69e7d59a8580019fb1cdb6ba88c88b2

Revert "msm8960-common: update ION header, use newer ION API"

This reverts commit 2ac4d85cd13a69212bddfd894ae35cc08d9dfc3c.

msm8960-common: Use HTC8960RIL

* Move ro.telephony.ril_class to common
* Update class to extend QualcommSharedRIL

Change-Id: I9cfc98d677c283f63827c985859a9b18de1c47e2

msm8960-common: update audio_policy with AUDIO_DEVICE_IN_BACK_MIC

msm8960-common: move kernel configuration to common

Change-Id: I489503f336386196ac30ca14484b801319b2d476

msm8960-common: move init scripts to common where possible

Change-Id: If589a22d541cf12e02bbd945fc3a46ea56f90b7a

msm8960-common: import camera HAL
Change-Id: I73ea757c7416028b98156159cc1704fd099b36f9

camera: remove line from makefile

Change-Id: Iaac7280fa930571380fb1efa7113ccdbcfec5cc8

camera: ifdef for TARGET_PROVIDES_CAMERA_HAL

Allows HTC msm8960 camera HAL to be built instead of mako camera HAL if
TARGET_PROVIDES_CAMERA_HAL is set to true

Change-Id: I804f3623f41f324229ae24b17949f65c54d82712

msm8960-common: re-add camera header

Change-Id: I4f1450cfd2ecdf5b33ff6d52d9abe60848896cd6

camera: build only for HTC msm8960 devices

Change-Id: I173fae4474731209e5e8583b6aa21ace2d67d8ae

msm8960-common: build local HTC camera HAL

Change-Id: I1a795e516a8363aeca9ac8755ca27c10f3340113

msm8960-common: use qcom display variant

Change-Id: I595b696da8166e27b193e43da3831e66389a3cbf

msm8960-common: update header files for qcom display variant

Change-Id: Icc59bb3fdb7701667f5ea4530eb1a01c2d1ab3d3

msm8960-common: update property for mdp composition

Change-Id: I546c3b243e739b866162ada824740f3c084c6d0c

configs: update audio_policy.conf

Change-Id: Id9aba995c4daaef0ecd03968c17f91693331876d

msm8960-common: use CAF QCOM Audio variant

Change-Id: I21a8fc82e36972c4f91e0a0861212125503e3af1

msm8960-common: add videodev2.h header

HTC kernel header doesn't match the videodev2.h header in the bionic
source tree.

Change-Id: I1cb1f4a2d15b6f9f0172fa3341fe7be8a098612e

msm8960-common: power: Tuning and cleanups

 * Tune the governor for better power usage and interactivity
 * Reset tuning parameters if governor changes
 * Cleanup

Change-Id: I4e6638e2402e76e44b8804465a5e5be63f5b85f9

msm8960-common: enable mtp usb connection type

Patch set 1: initial
Patch set 2: allow for distinct mtp and mtp+adb product ids and remove infeasible combination mtp+mass_storage

Change-Id: I4812489313ddfbd85d691b7cfce4b23db3a8031e

msm8960-common: support basic notification LED flashes

Patch set 1: Support for flash modes:
             1) off
             2) normal (~250ms pulse in 2sec)
             3) long (~1sec pulse in 2sec)
             4) always on

Change-Id: Ic304cbe43466c451f8bbe6f5395988c8516cb526

Conflicts:
	overlay/packages/apps/Settings/res/values/arrays.xml

camera: remove 768x432 as a valid preview resolution

Video camera code will choose 768x432 as the preview resolution for
non-720p display devices when HD video recording resolution is selected
otherwise.

Change-Id: I5366831bf8576c8911da7f23883443178034365b

Camera: Fix CTS testPreviewPictureSizesCombination.

CRs-fixed: 346704

(cherry picked from commit 921dcbf654e2a1ac3ed585b15c917576814d87c0)
(cherry picked from commit 677870b791069b3b8e9aa347d6666e6f4c9581f5)

Change-Id: I6ec20790a8812dc2cae9933b29989a2f63450b16

msm8960-common: move recovery files to common where possible

Change-Id: I54c7afe2b541e1b24eb95c2384001c6f5d6a0758

Add CDMA/GSM phone debug message, mAid, mUSIM and mSetPreferredNetwork to HTC8960RIL

These three variables are not set in HTC8960RIL, causing preferred network to always revert to WCDMA preferred. (e.g. evita LTE not enabled on boot)
Add them back (like in QualcommSharedRIL), and also add missing debug message too.

Essentially port of http://review.cyanogenmod.org/#/c/22987 and http://review.cyanogenmod.org/#/c/29556/ to HTC8960RIL.

Change-Id: Iad43a300bc2dfffae201153d5009a756cebb4e32

msm8960: update headers to match kernel

Change-Id: Iff6e9513fa98cacaf77cbbe60f0da9d6603ea576

msm8960: use roboto for recovery font

Change-Id: I881a0e4ce6864d92ae5506d07987e685fc88eebd

msm8960-common: camera: enable needsEarlyVideoSize

Send video-size parameter to HAL before recording begins to ensure that
video size lines up with preview size so memory allocations line up
correctly.

Change-Id: Idf1f52a8aadaf7232bfbadb6ee6464e0ee0c7d70

Camera: Set and get proper video size key as described in the application file.

CRs-Fixed: 343259

(cherry picked from commit 98bb823f9d2171a8d9d8331bbc3aa9972598a7a5)

Change-Id: I59b8e5d28c04baf9f0b6eef512988f5f5662c505

HAL: return pretained preview buffer to surface when preview window changed or camera disconnected.

When preview is paused due to taking snapshot, preview buffer is retained.
However, if UI changes preview window or disconnect, previous preview buffer is
not valid any more, so we need to put it back. Next time when preview is
started, it will act as a clean start of preview and get preview buffer
from display.

CR-fixed: 342926

Change-Id: I45b4580fedf523264285d0179260f13127e95bc5

Camera:Preview buffer length correction in YV12 mode also.

CRs-fixed: 343289
(cherry picked from commit 0d4758953a0c925c60f5f117bef6f719daaa9de3)

Change-Id: Ifb0a39294132db806a622eafef63931eebacf3ca

Camera: Compare correct buffer size with the 4k aligned buffer size.

Preview width and height received in peview callback were incorrect,
causing mmap failures. Instead of fetching width and height in
every preview callback, stored the preview buffer size value
while preview buffer allocation.

Change-Id: I8a5387777760d0cdec514f0adec31de105956785
CRs-Fixed: 341634

HAL: fix memory leak for preview buffers

During camera hardware release, preview buffers hold during taking picture
need to return back to surface if they are not done yet.

CRs-fixed: 344896

Change-Id: I1817fb42446049276d33bf7a3fbfac80a1a9c105

Conflicts:

	QCameraHWI_Preview.cpp

Camera: Fix for ZSL/Burst mode JPEG memory leak

This change fixes the memory leaks
during ZSL/Burst mode in the omx
layer.

Change-Id: Ia6c557c7db9572cc3e6c4dabddb65c5a0bf6d189
CRs-fixed: 349015
(cherry picked from commit 17c0940805dcc3ba5840eada8a3a026c0d501136)

HAL: fix memory leak for preview buffers and add error handling

During camera hardware release, preview buffers hold during taking picture
need to return back to surface if they are not done yet.

Change-Id: I3533d43eb0aa4a9f6c0c8eb222702772eae27d1a
(cherry picked from commit 083cbdda6e88218cd7b8c4583c02ef1bae3e0bc6)
(cherry picked from commit 236c33ac4bf8ae350c4838a5168cdc2e9603d01a)

camera: Clean, write-back, cache for preview and video buffers.

Write-back preview and video buffers to main memory before they
are delivered to display and video encoder respectively.

Change-Id: I748a23a2b1ade1163d6ec09623090ad4d043a441

msm: camera: invalidate cached buffers before sending to hardware

Since the buffers are now allocated in cached mode they
need to be cache-invalidated before hardware writes new
data into them. This prevents the CPU from reading stale data
from the cache. Also, if hardware reads a CPU modified buffer, the
data needs to be cache-cleaned or written back before hardware
reads from it. An example here is gemini reading a post-processed
buffer for JPEG encoding.

Change-Id: I8b4598f7984b8292bcc7ed1cc8d7ac03dd7365a8

msm8960-common: reenable LED settings overlay

Enables the ability to use Torch through lockscreen button action

Change-Id: Iff7f6596dd712163d61f03c3d5d39fb5a43211da

Conflicts:
	overlay/packages/apps/Settings/res/values/config.xml