SoundRecorder: Squashed update from QRD project

 * Enables new features and in-call recording.

SoundRecorder: Add support for recording QCELP/EVRC/AAC formats

 - Added support to record in QCELP/EVRC and AAC formats
 - Also added support for voice call recording

Change-Id: I0cac3fe9558ab5b3b58fea11a6a4cd3cc5ec84e4

Conflicts:
	AndroidManifest.xml

SoundRecorder: Add support for 5.1 surround sound recording

- Add Recorder interfaces to set channel and samplingrate
- Use 6 channels, 48k sampling rate, AudioSource.MIC, 3gpp format,
  and AAC encoder for multi-channl AAC surround sound recording.
- Use 6 channels, 48k sampling rate, AudioSource.MIC, WAVE format,
  and linear PCM endoer for raw surround sound recording.

SoundRecorder:Add support for voicecall recording.

Change-Id: I0e2f9d1d03690eda53b735b0da0e53754a7aa83c

Soundrecorder: Enable SSR only if SSR AudioParameter is set to true.

- Read SSR AudioParameter to check if SSR is supported
- Do not show/handle ssr options if SSR is not supported

(cherry picked from commit c63b19e53d730cc5cd707ef808dcbd4cd0a93627)

Change-Id: I0f65b996e7cadeb372d29228e74eb52bd8049e24

SoundRecorder: Fix to stop encoding while in-call

 -Issue: While voice call recording, even if the
  voice call is terminated by other end, the recording
  continues.
 -Fix: Listen to phone state changes while in foreground

CRs-fixed: 390673

(cherry picked from commit 774613b5768815473be91f7cb9a0b9c2552580c4)

Change-Id: Ic70d07b6d3f664074cce8c16f3f54c3d3385a36a

CAF:QRD_AP:SOUNDRECORDER:None:394022:virtual keyboard should not be open after press menu button in sound.

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: 394022
	Targets: msm8X25_sku5,msm8X25_sku7
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: None
	Peer Review: Zhang Kaiyi
	Reference Build or VU:
	Comments:
	(*commit tool - 1.2.0)

Change-Id: I96cae2933e65fd1e59843dfcdda57f0dd9e37165

CAF:QRD_AP:SOUNDRECORDER:None:none:Fix secording available time displays incorrectly

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: none
	Targets: msm8X25_sku5,msm8X25_sku7
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: none
	Peer Review:
	Reference Build or VU:
	Comments: wjiang
	(*commit tool - 1.2.0)

Change-Id: Ic34b5b843b0ff1606d52b2575c8713038090d693

CAF:QRD_AP:SOUNDRECORDER:None:362918:Fix sound record does not stop issue.

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: 362918
	Targets: ALL
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: none
	Peer Review:
	Reference Build or VU:
	Comments: lv yang
	(*commit tool - 1.2.0)

Change-Id: Ib614dd3775f93ab75fd45472450c29e580e2f5e3

CAF:QRD_AP:SOUNDRECORDER:None:CR372081:Fix sound recording can’t display in music player.

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: CR372081
		CR372081: [MM][Music][BJ][SKU7] sound recording can’t display in music player.(10/10)
	Targets: msm8X25_sku5,msm8X25_sku7
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: none
	Peer Review:
	Reference Build or VU:
	Comments:
	(*commit tool - 1.2.0)

Change-Id: Ib94ec2c6e624ebaba841e1ea21c08407e7c35e45

CAF:QRD_AP:SOUNDRECORDER:None:CR363754:Prompt when user's voice is saved

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: CR363754
		CR363754: [UI/FRMK][Others][SKU6]In sounderrecorder,end recording isn't prompt"File has been saved!!!".(100%)
	Targets: msm8X25_sku5,msm8X25_sku7
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: none
	Peer Review:
	Reference Build or VU:
	Comments:
	(*commit tool - 1.2.0)

Change-Id: I6df3a3fba7edb9211365eddaa872871b8a478c0e

CAF:QRD_AP:MUSIC:None:356503:[MM][Music][SKU5][SKU6]It will create two playlist "My recordings"and "...."in the music after record message in English/Chinese environment.(100%)

	Component Name: MUSIC
	Feature Name: None
	Fixed CRs: 356503
	Targets: msm8X25_sku7
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: none
	Peer Review:
	Reference Build or VU:
	Comments: tsima
	(*commit tool - 1.2.0)

Change-Id: I026a9dc68384aaa8dc8a35c73dbc6e8626e4067c

CAF:QRD_AP:SOUNDRECORDER:None:396486 396488:Don't keep recorded song less than 1 min and prompt before discard

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: 396486 396488
	Targets: msm8X25_sku5,msm8X25_sku7
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: none
	Peer Review:
	Reference Build or VU:
	Comments:
	(*commit tool - 1.2.0)

Change-Id: I489060c81c2d16c1ba821d9e037b0f6754a646f5

Revert "CAF:QRD_AP:SOUNDRECORDER:None:394022:virtual keyboard should not be open after press menu button in sound."

This reverts commit de53eaa17669e021a61c4d23a52afd712568c99b.

CAF:QRD_AP:SOUNDRECORDER:None:396485 397606 403507:Hide key event handling from customers unless enable a system property.

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: 396485 397606 403507
	Targets: msm8X25_sku5,msm8X25_sku7
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: none
	Peer Review:
	Reference Build or VU:
	Comments:
	(*commit tool - 1.2.0)

Change-Id: Ia2d8cfda5011f87abaa7a459411067604b53e7e8

CAF:QRD_AP:SOUNDRECORDER:None:400377:1.Insert USB and turn on USB storage. 2.Open soud recorder,start recording. 3.Prompt "Please insert a SD card" when turn on USB storage then start recording.

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: 400377
	Targets: msm8X25_sku5,msm8X25_sku7
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: None
	Peer Review: kaiyiz@qualcomm.com
	Reference Build or VU:
	Comments:
	(*commit tool - 1.2.0)

Change-Id: I68a384a5c4d728b1871854f361328556bb47e3aa

CAF:QRD_AP:SOUNDRECORDER:None:371207:"Press record" in sound recorder is still English although system language set to Chinese.

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: 371207
	Targets: msm8X25_sku5,msm8X25_sku7
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: None
	Peer Review: Yingying@qualcomm.com
	Reference Build or VU:
	Comments:
	(*commit tool - 1.2.0)

Change-Id: I195c349d464ca7e0aaafdca4d27132faefec52d6

CAF:QRD_AP:SOUNDRECORDER:None:408274:[UI/FRMK][Others][NJ][SKU6]Recorder cancel box are still English when set phone language to Chinese.(100%)

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: 408274
	Targets: msm8X25_sku5
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: Nne
	Peer Review:
	Reference Build or VU:
	Comments: WangHui
	(*commit tool - 1.2.0)

Change-Id: I24685b136d7b60e30f10a1e2d8195658445da360

CAF:QRD_AP:SOUNDRECORDER:None:399155:When the system language is Chinese,Hint of Sound Recorder Failed to be Translated into TW Chinese.

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: 399155
	Targets: msm8X25_sku5,msm8X25_sku7
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: None
	Peer Review: yingying
	Reference Build or VU:
	Comments: AR007
	(*commit tool - 1.2.2)

Change-Id: Ie10aa193095e18d281af7c93f6a3d3a4b61b25dc

CAF:QRD_AP:SOUNDRECORDER:None:CR399742:Fixed music sound and recorded sound heard at the same time

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: CR399742
		CR399742: music sound and recorded play at the same time
	Targets: msm8X25_sku5
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: none
	Peer Review:
	Reference Build or VU:
	Comments: mqiu
	(*commit tool - 1.2.1)

Change-Id: I67ffd347d5b74ff23645ed778b0f951d65971dc6

CAF:QRD_AP:SOUNDRECORDER:None:408469:Sound recorder pointer can't return to the beginning position after tap back key when it is recording.

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: 408469
	Targets: msm8X25_sku5,msm8X25_sku7
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: None
	Peer Review: zhibinw
	Reference Build or VU:
	Comments: AR005
	(*commit tool - 1.2.3)

Change-Id: I7fb59476dea2377d39b03e86a131616da9d3c3f6

CAF:QRD_AP:SOUNDRECORDER:None:CR414449:Fix Music stop playing when open the Sound Recorder to recording

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: CR414449
		CR414449: Music stop playing when open the Sound Recorder to recording
	Targets: msm8X25_sku5
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: none
	Peer Review:
	Reference Build or VU:
	Comments: mqiu
	(*commit tool - 1.2.1)

Change-Id: I2ea01fff67a64d9beaab0b6639d00d61aebab275

CAF:QRD_AP:SOUNDRECORDER:None:415966:Fix the sound record can not be stopped after press hock key of headset

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: 415966
	Targets: msm8X25_sku5
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: none
	Peer Review:
	Reference Build or VU:
	Comments: mqiu
	(*commit tool - 1.2.1)

Change-Id: If288e035480f88b0a25b0c85a74c892128c197f1

CAF:QRD_AP:SOUNDRECORDER:None:418635:fix the bug of DUT pop up a 0B record sound in SD card after start to record sound

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: 418635
	Targets: msm8X25_sku5
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: none
	Peer Review:
	Reference Build or VU:
	Comments:
	(*commit tool - 1.2.4)

Change-Id: I7f78cb0c2a2ec0835a768b7ecf83b2da5ab06a31

Revert "CAF:QRD_AP:SOUNDRECORDER:None:CR414449:Fix Music stop playing when open the Sound Recorder to recording"

This reverts commit a9acd46b601864a755c062e7f58253867d893d00.

CAF:QRD_AP:SOUNDRECORDER:None:429055:Can't save recording after power off during sound recording.(100%)

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: 429055
	Targets: msm8X25_skuD
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: None
	Peer Review: mengw
	Reference Build or VU:
	Comments: NE024
	(*commit tool - 1.2.7)

Change-Id: I48c292d360fbde8d6fd2ceb93a10f5f6e02601de

CAF:QRD_AP:SOUNDRECORDER:None:430797:[UI/FRMK][File explorer][NJ][SKUD Prime]The record sound can't discard successfully after rename it(100%) <TCID: None>

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: 430797
	Targets: msm8X25_sku5
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: none
	Peer Review:
	Reference Build or VU:
	Comments: CI002
	(*commit tool - 1.2.7)

Change-Id: Ia5cb7d81343f1dcfea9950ffc2faefaad6078961

Revert "CAF:QRD_AP:SOUNDRECORDER:None:430797:[UI/FRMK][File explorer][NJ][SKUD Prime]The record sound can't discard successfully after rename it(100%) <TCID: None>"

This reverts commit 8783a3e4ac658989f77942b34d4b5edd8581e7ef

CAF:QRD_AP:SOUNDRECORDER:None:430797:[UI/FRMK][File explorer][NJ][SKUD Prime]The record sound can't discard successfully after rename it(100%) <TCID: None>

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: 430797
	Targets: msm8X25_sku5
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: none
	Peer Review:
	Reference Build or VU:
	Comments: CI002
	(*commit tool - 1.2.7)

Change-Id: I6dccecf05fc2cb03c5f64e6fdffc96427bf4bd33

CAF:QRD_AP:FM:None:BZ1067:A "internal application error" box pop up after switch recording from FM to sound record (100%)

	Component Name: FM
	Feature Name: None
	Fixed CRs: BZ1067
	Targets: msm8X25_skuD
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: None
	Peer Review: huiwan
	Reference Build or VU:
	Comments: NE009
	(*commit tool - 1.2.7)

Change-Id: I6adb6beb0392817b06da7042ae1c9c29051fccc5

CAF:QRD_AP:SOUNDRECORDER:None:438413:[Telephony][Messenger][NJ][SKUD][MMS][QMSS]The dialog box of discard or done in audio recorded interface will disappear when lock screen then unlock.(100%)

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: 438413
	Targets: msm8X25_sku5
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: none
	Peer Review:
	Reference Build or VU:
	Comments: CI048
	(*commit tool - 1.2.7)

Change-Id: I7069e840dd9b48816b75ce81037c0cb31eff6abe

CAF:QRD_AP:MESSAGE:None:BZ1480:The message will tip "Discard" when press "Back" key. (100%)

	Component Name: MESSAGE
	Feature Name: None
	Fixed CRs: BZ1480
	Targets: msm8X25_skuD
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: None
	Peer Review: huiwan
	Reference Build or VU:
	Comments: NE013
	(*commit tool - 1.2.7)

Change-Id: I0c07ecab91da18d4dfeb72e45bca538b09e9d99a

CAF:QRD_AP:SOUNDRECORDER:None:432497:It don't any response when click "Done" after disable Media Storage.(100%)

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: 432497
	Targets: msm8X25_sku5
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: None
	Peer Review: huiwan
	Reference Build or VU:
	Comments: NE032
	(*commit tool - 1.2.7)

Change-Id: I2f291f6d53af9548539f17aabea782174e6562bf

CAF:QRD_AP:SOUNDRECORDER:None:450714:Revert the patch of CAF:QRD_AP:SOUNDRECORDER:None:430797:[UI/FRMK][File explorer][NJ][SKUD Prime]The record sound can't discard successfully after rename it(100%) <TCID: None> (Ia5cb7d81343f1dcfea9950ffc2faefaad6078961)

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: 450714
	Targets: msm8X25_sku5
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: none
	Peer Review:
	Reference Build or VU:
	Comments:
	(*commit tool - 1.2.7)

Change-Id: I4f0680ffc1169e99c726e9e5b4c5c560984f3b06

CAF:QRD_AP:MESSAGE:None:BZ1138:The time will flashing the first end time then display the maximum time when tap "start" button again.(100%)

	Component Name: MESSAGE
	Feature Name: None
	Fixed CRs: BZ1138
	Targets: msm8X25_skuD
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: None
	Peer Review: mengw
	Reference Build or VU:
	Comments: NE024
	(*commit tool - 1.2.7)

Change-Id: Id0523be286c2b757dc79f9371998ef7e1b3c0ea4

CAF:QRD_AP:SOUNDRECORDER:None:BZ2120:It will still prompt "Press record,SD card unavailable" before you start record after you switch "Mount SD card" to "charging" in the notification bar. (100%)

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: BZ2120
	Targets: msm8X25_skuD
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: None
	Peer Review: mengw
	Reference Build or VU:
	Comments: NE022
	(*commit tool - 1.2.7)

Change-Id: I34d4c9b2ea7308ccbcac3ee7bec0da77019bb63b

CAF:QRD_AP:SOUNDRECORDER:None:BZ2045:The "Sound recorder" will tip "In call record is in progress".(100%)

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: BZ2045
	Targets: msm8X25_skuD
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: None
	Peer Review: huiwan
	Reference Build or VU:
	Comments: NE003
	(*commit tool - 1.2.7)

Change-Id: Ia09415264011353a11ccf2df8011ff143d4e2107

CAF:QRD_AP:SOUNDRECORDER:None:BZ2737:After we save the recording,the view do not show the recording's name.(100%)

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: BZ2737
	Targets: msm8X25_skuD
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: None
	Peer Review: yandongy
	Reference Build or VU:
	Comments: NE022
	(*commit tool - 1.2.7)

Change-Id: Icb7bdd74e437ef368a894e1718c1a2eeb6fdc40a

CAF:QRD_AP:SOUNDRECORDER:None:BZ2715:Recording will not be added to message after tap back. (100%)

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: BZ2715
	Targets: msm8X25_skuD
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: None
	Peer Review: zhibinw
	Reference Build or VU:
	Comments: NE037
	(*commit tool - 1.2.7)

Change-Id: I77a63b4f87f31cbbb45f14185f13239d789ec5c3

CAF:QRD_AP:SOUNDRECORDER:None:BZ2747:There is no "Recording stopped" when stop recording a voice.(100%)

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: BZ2747
	Targets: msm8X25_skuD
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: None
	Peer Review: zhibinw
	Reference Build or VU:
	Comments: NE032
	(*commit tool - 1.2.7)

Change-Id: Idf9accb351b559e6e2f35a6b925d9a5ee57a5de6

CAF:QRD_AP:SOUNDRECORDER:None:BZ2523:The box will disappear after switch language (100%)

	Component Name: SOUNDRECORDER
	Feature Name: None
	Fixed CRs: BZ2523
	Targets: msm8X25_skuD
	Required VUs:
	Dependency Notes:
	Limitations:
	Suggested Testing: None
	Peer Review: zhibinw
	Reference Build or VU:
	Comments: NE032
	(*commit tool - 1.2.7)

Change-Id: I5cdd8f52e1a43e4aa62cefe458c1a17eb0cd6f81

Revert "CAF:QRD_AP:SOUNDRECORDER:None:BZ2045:The "Sound recorder" will tip "In call record is in progress".(100%)"

This reverts commit 02f9167e06accac1a5bd6a34082f43f859ee6abf.

Revert "CAF:QRD_AP:FM:None:BZ1067:A "internal application error" box pop up after switch recording from FM to sound record (100%)"

This reverts commit 2f5a308316fcd903cd564d7b068adafb25de5b8c.

Change-Id: Ibf070fdcb439f18319e692316fd9c63db244b58c