audio: add support for MSM audio formats

- Add support for EVRC, QCELP, and WMA formats
- Add definition for 5.1 channel recording
- Reference change If3676b88fa287b484ef8616c0a6b67177b61a720

Change-Id: I6b6e5ca98921adeadd2a3d76580fe85fb28eeaf0
(cherry picked from commit 10c4f204bb5ac78b9cf3854b536663ccd3d50333)
(cherry picked from commit 3f99cc5f134b0f00a52218ae1c0273cc11ae7702)
(cherry picked from commit 1d35b52c7c9cf1cfd3a3de372391a7a57f593af9)

Conflicts:
	media/java/android/media/MediaFile.java
	media/java/android/media/MediaRecorder.java

Conflicts:
	media/java/android/media/MediaRecorder.java
audio: Define Proxy device

- Added Proxy device changes

Change-Id: I47921d696171de40bcfc30ebf99d4cafa0d4d4a3
(cherry picked from commit a8b7ed78ec088bc6924854661bacde51d7194ab3)
(cherry picked from commit cff61cfd964a1150919d9bfa7ec0ebfe35d5f247)
(cherry picked from commit bf8f7a2a574cb2e6aafae3efa6e4ee163ef65cf7)

Conflicts:
	media/java/android/media/AudioSystem.java

Conflicts:
	media/java/android/media/AudioSystem.java
audio: audio enhancements for playback and recording.

- Add playback and record support for EVRC, QCELP,
  WMA, AMRWBPLUS, WAV, ACE, and EC3.
- Add support for 5.1 channel recording.
- Add support for in call music.
- Add constants for call_state and vsid.
- Add definition for FM and proxy audio devices.
- Remove unnecessary format checks in frameworks.

Change-Id: If3676b88fa287b484ef8616c0a6b67177b61a720
(cherry picked from commit 6ca6cc15af88992ea485a458e67a8546b156672e)
(cherry picked from commit f65028d1752969bf43c853c1bb12ecd12055d5e8)
(cherry picked from commit b1952442db41188b74f331bd2397a579424821ab)

Conflicts:
	media/java/android/media/AudioService.java
	media/java/android/media/MediaFile.java

Conflicts:
	media/java/android/media/AudioFormat.java
	media/java/android/media/AudioRecord.java
	media/java/android/media/AudioService.java
	media/java/android/media/AudioTrack.java
	media/java/android/media/MediaFile.java
  audio: Support for MSM audio formats

  -Add audio format support for Voip.

Change-Id: Ie045ba926b3e1266afd3fb6fba09af3a55daaeef
(cherry picked from commit d1810964ecd2d50064a1fed51049ddc354b9a788)
(cherry picked from commit cd9c6dc56bedcabca77c2a01c6fb15f4d2e8edd5)
(cherry picked from commit 01c09aeae38716860ef1a806985cc946dca93f60)
video: Add support for extended media listener

Added changes to handle additional message types for
dash playback.

Change-Id: Id07828866de8cae44137f26c1e74417aaa45704f
audio: Fix for LPCM surround sound recording

 - Format WAVE was defined as 10, which is getting
 over-ridden by format THREE_GPP2 (which holds value 10),
 because of which Media recorder failed for LPCM SSR.
 - Fix this by defining format WAVE to 11.

Change-Id: I4db84441b70b28da3579e2ff430b42b2711f9404
frameworks/base: Fix race conditions on resume/suspend using power key

The wakelock PowerManagerService.Display sometimes cannot be released
after two quick power key pressings like a double click during phone
sleep (the target will resume then supposedly suspend shortly).

The second key event disturbs display power state on resume, as a
result display resources won't get released on suspend, which is fixed
in this change.

CRs-Fixed: 566059
Change-Id: I633fd377ab235f203ebfb649a74449a2385740c4
base: Fix for wifi tethering crash

Pass network info along with CMD_UPSTREAM_CHANGED
Added a NULL check for Network info in CMD_UPSTREAM_CHANGED

CRs-fixed: 562910
Change-Id: I98bd37205255d9d4025cfb95b0688c68bce3c9bd
Show PIN on Peer device on receiving PIN display request.

P2P provision discovery would request the peer to display a PIN.
The PIN is displayed handling the request, the PIN need to be
entered on keypad of requested peer device to achieve the
connection.

Change-Id: I8b6487681d78eb10c558983a08dec1ac8a8eee65
CRs-fixed: 382608
P2P: Fix for GO inviting a p2p device.

A p2p device on an invitation request from the peer invokes
p2p_peer command to know if the peer is a p2p device / GO.
Due to the cached entries there would be a possibility of
not getting the updated information, ending up in the wrong
negotiation with the invited peer. Thus do not rely on
p2p_peer command, rather assume that the peer is a GO on an
invitation request, provided there is no persistent network
configured.

CRs-Fixed: 486437
Change-Id: Ifaeb6a8c5f9cddd7df96622056541e22aad74314
[2/3] mediaeditor: Allow custom DOMX source instead of Google DOMX default

Part 2 of 3 patches: To allow omap4 devices to use custom "domx" source
via a new BoardConfig.mk item:
TI_CUSTOM_DOMX_PATH := device/<manufacturer>/<device-name>/domx

This setting provides for 3 changes during the build:
1. In hardware/ti/omap4xxx this settings stops standard Google domx
source from being built and changes the domx reference for tiutils.
2. In frameworks/base it changes the default openmax references for
frameworks/base/media/jni/mediaeditor/Android.mk to the new location
3. In frameworks/av changes the openmax references in 5 places, and adds
new includes in ACodec.cpp, CameraSource.cpp and OMXCodec.cpp

This commit is based on cherry-pick from omapzoom (with a more descriptive
BoardConfig setting name):
http://www.omapzoom.org/?p=platform/frameworks/base.git;a=commit;h=f7f929ff477955333bf7e7413a81a66d683d1f3f

Change-Id: I7ba8052a6144597bf961b78723186c58b7e12e48
Fix a bootloop problem when /data/system/usagestats/usage-history.xml is empty.
This often occurs after an incomplete reboot/shutdown or battery pull.

Change-Id: I4f01151f4051df4ae1b85fa460ec7a9e70122878
Don't spam logcat when using touchscreen while state is disabled

For example if the bootanimation is loading and you press the screen you get loads of spam
pm: Prevent a system_server crash is package name is null

 * If an app is placed on the system partition and it doesn't specify a
   valid package name, system_server will crash forever. Just skip it.

Change-Id: I9b911d40b3c4d7cf6fac8cc0166a2ba359329b7b
Improve scrolling cache

Scrolling cache helps make short scrolls/flings smooth but will
cause stutter when long flings are made. This patch disables
scrolling cache when long flings are made.

This patch also fixes a related bug where scrolling cache will
not be enabled properly when transitioning from flinging to scrolling.

Patch Set 2: Calculate threshold based on maximum velocity (Sang Tae Park)

Change-Id: I1fdbaad92263c9f983a32900e74eba1f0367902b
Fix: FATAL exception during Autonomus group creation failure

Failure in forming an autonomus group causes FATAL IllegalArgumentException
exception as deviceAddress will be empty in mPeersLostDuringConnection.

Added check to verify if it is autonomus group before trying to remove
any peer or clear device list.

Change-Id: I486463782e85c7f0031b6f62ec5aaf8afb11b652
CRs-fixed:554767
(cherry picked from commit 55bb4f6dd9fc3e5c8aa7c8bc8ece01f0603e0a83)
(cherry picked from commit 3dbbf14276a403841e1d69cd2624dfad74d6f540)
(cherry picked from commit 8642fcd59686e54c1ea215016bfa7562d17b27c0)
p2p: Flush the p2p scan result on group remove event

Flush out p2p scan results on receiving group removal event.
p2p scan window will be updated on next p2p scan.

Change-Id: I3bcfed355574478bda2cac688b7df956c2701683
CRs-Fixed: 504022
(cherry picked from commit eaeecac20b125ffff8fea7a12b514999fff6bf5f)
(cherry picked from commit 3541e2cb0768865ecc312ead33f48c673e177ac3)
p2p:Fix for discovery failure until STA is connected to AP.

The station when connecting to AP (wifi state is either
connecting or obtaining ip address) shall stop the already
issued p2p_find on the DHCP start and start the same after
the DHCP handshake. p2p service manager shall return a failure
for any p2p_find operation during these period resulting in a
discover failure.
Address this by deferring the p2p_find issued during this period
(set mDiscoveryPostponed to true) rather than returning a failure.

Change-Id: I40b2017bf126fd0d543ada8853223402cda63e9d
CRs-Fixed: 532138
Wifi: Allow configuration of the P2P ifname

ICS used the same wifi.interface as the regular wifi service.
Let's use wifi.p2pinterface here, since they _can_ be different

Change-Id: Iab68b245b33377271354c849bbe33725a26193f1

Conflicts:
	wifi/java/android/net/wifi/p2p/WifiP2pService.java
Wifi: Get the list of supported channels

Get the list of supported channels/frequencies from wpa_supplicant and provide
them thru WifiManager.getSupportedChannels();

One channel is represented thru the class WifiChannel which includes channel
number, frequency in MHz and a flag if IBSS mode is allowed on this channel.

Like isIbssSupported() we can only expect a result after WIFI_STATE_ENABLED has
been reached.

Change-Id: I9fc34642b9a0047f6871b180a3a7a69d47b7e2ff

Conflicts:
	services/java/com/android/server/wifi/WifiService.java
	wifi/java/android/net/wifi/IWifiManager.aidl
	wifi/java/android/net/wifi/WifiManager.java
	wifi/java/android/net/wifi/WifiNative.java
	wifi/java/android/net/wifi/WifiStateMachine.java