Bluetooth: HFP 1.6 features only works for 1.6

The AT commands(AT+BAC, AT+BCC, AT+BCS, AT+BIA)
 only for HFP 1.6 are working for 1.6 only.
The system property ro.qualcomm.bluetooth.hfp.ver=1.6
 when HFP version is 1.6

CRs-fixed: 341180
(cherry picked from commit 13de96abad8ed979c1f68a02a58d560ce30a22f0)

Change-Id: I270f04de268ce31c71cbc758d3ecfc4cda588e41
Bluetooth: Check for existing SCO before starting outgoing connection.

Found some carkits initiate incoming sco connection soon after
Call status is updated as active from DUT. In A2DP+ Dial from Headset
case, to suspend A2DP stream there is a timer in BluetoothHandsfree.
Only after suspending A2DP stream the outgoing SCO is attempted. Figured
there is a possibility of attempting outgoing connection though there
is SCO connection initiated by remote device. In this case there is
possibility of software abort on the existing SCO connection and
audio doesnt route on proper channel. The current check fixes the issue.

CRs-Fixed: 351920

(cherry picked from commit 6cd6ba479f944a187744326d87884831bdf8ab04)

Change-Id: If6cc2f5e8c56513d82a0b4647f71a101aee769dc
Revert "Allow only NT_MODE_GSM_ONLY or NT_MODE_WCDMA_PREF"

The issue is that this fix is resetting the network mode in the setting
database to NT_MODE_WCDMA_PREF (0) for all non GSM_ONLY modes. So if user
sets the mode to say Global, the network mode is getting set to WCDMA as
soon as the GsmUmtsOptions Activity is getting created. This causes anyone
who uses the Settings.Secure.PREFERRED_NETWORK_MODE directly to see value
of NT_MODE_WCDMA_PREF instead of the actual network mode that is set by
the user.

This reverts commit 5c7d3167b8372b040d6c0a695f7c0822d80b2c21.
CRs-Fixed: 349523

(cherry picked from commit 33ae0665521da4a995e77292c84110838820cba2)

Change-Id: I7a07bf3744e66ff57b891e39de3fdc67527cf275
Telephony: Add APIs that report actual error code on PIN/PUK operations

The current APIs that are used to verify the PIN and PUK only convey
whether the operation succeeded or failed. As a result on ANY failure
clients ask the user to re-enter the PIN.

Add 2 new APIs that report the actual error code in case of failure.

(cherry picked from commit e35a442c3e6d0bba991bdfece23c6e5b7e0cb568)

Change-Id: I6c1a36c79f4250ee2fd19aa517439070ceab2f34
CRs-Fixed: 357021
Bluetooth : Supported APIs for reading Voice recognition feature.

The current change provides API through BluetoothHeadsetService
for reading Remote device VR support. The Voice dialer APP can read this
value before routing the audio over SCO when voice recognition started.

Change-Id: I976a988aff486c54c6b2fe2e7d6d101cebe9ee07
(cherry picked from commit 39f73631fb6279c979481457dc599307088ff628)
Bluetooth: Validate return for getServiceState API.

- NullPointerException occured while HFP reconnect after power cycle.
  This happens when AT+COPS? or AT+CNUM is received
  before Phone is initialized.

CRs-Fixed: 329627

Change-Id: I703a9f8f7b9a8cdba7bdf0fd6f1f6e9ac31d858f
(cherry picked from commit 91049f269828ac8327f2a934c1c5024cbccdea9c)
Revert "Phone: setAudioMode to call Ringing in onNewRingingConnection API ."

This reverts commit f2349eac54b112a740ecc13fba3fbde4f4380acd.
NotificationMgr: Force led notification even if screen off

Change-Id: Icaa9a0d176c116888d5fdfd2f58404b1115bf4df