Bluetooth-Wipower: MTP continues advertising WPT UUID post connection.

a> Stack conitnues to advertise post connection which would lead to cross
connection with other PTU within vicinity, So as to avoid rest of PTU's
scanning the DUT which continues to advertise, Advertiements are being
stopped post connection.
b> .setTimeout() with any value less than 180Sec as parameter ensures
that it sets the limited mode advertising. since wipower spec demands
the advertisement mode to be limited this partciular change is been
made and the timeout value is been set to 30Secs which is far enough
for PTU to initiate connection.

Change-Id: Id63bcc19d714d087fcb6c78553572b649f106580
CRs-fixed: 734301
Bluetooth: Check for device connection state.

 - Before storing call states check for device connection state.
 - When no device are connected getCurrentCalls returns null

Change-Id: I7211085fabb738267ca7e2524db976e8dc9a568e
FTP: Update isWaitingAuthorization as FALSE when user presses cancel

This patch updtes the value of isWaitingAuthorization to FALSE when user
presses cancel. Without this, authorization state was not correct in
timeout, and cancel scenarios leading to authorization popup not being
received at ftp layer which prevented new FTP connection until BT off and on
was done

CRs-Fixed: 753197
Change-Id: I685fdcc7aba54d3954c8a99a7fbe86e2da2e7773
HID-C: Update report id to pass PTS Teest cases

This patch updates report id for Keyboard and Mouse to get PTS test
cases passed. PTS is not reading the report id from report descriptor
but using values of 1 and 2 resp for Keyboard and Mouse to check input
reports recevied from Device. To get PTS test cases passed, report id
is now updated in sdp report descriptor of HID Device.

Change-Id: I422630f78a727fe2090afcbbe1a0c57bebabc446
CRs-Fxied: 753936
Bluetooth-Wipower: Avoid advertisement on USB connect.

Following changes have been made:
a> Advertisement seen after USB connection, Charge complete ensures
   power apply event is only triggered on 600ms long beacons.
b> Limited mode advetisement interval is reduced to 5seconds.
c> NULL validation been made to avoid unnecessary crashes.

Change-Id: Ie9e31a905674b98a429dca5a25910d62a9f51150
CRs-fixed: 749930
HID-C: Fix KW issues in hiddtestapp

This patch fixes P1 KW issues in HID Client Test App.

Change-Id: I040dde43ee5cfb4a858f8f513aa3310beca66c08
CRs-Fixed: 740857
SAP: Klocwork issue

This change will fix the Klocwork issue coming
with respect to RfcommInputStream in SAP.

Change-Id: I29fc19e6b44b5eb35999111d45327b6cd4251ddb
CRs-fixed: 758581
PBAP C: Fix klocwork issue

This change will fix the klocwork issue coming with respect to
BluetoothPbapTestActivity.

Change-Id: Iffc45dc24796e718fc75c1d2c55743c871dd9839
CRs-fixed: 758578
Bluetooth: Fix KW issues for DUN profile

This patch fixes P1 Klockwork issues in DunService.

Change-Id: I11f724451858d51825ad1a1d8b9dc1fd5ef21c20
CRs-fixed: 759267
FTP: Fix klockwork reported issues.

Fix NPE and RLK issues reported
from klockwork.
CRs-fixed: 758708

Change-Id: I017b1e8b954239cff377ca3e68d6737e32d53b2c
BTTestApp: Fix klockwork issues for MAPClient.

Fix NPE issues reported from klockwork for
BTTestApp  MAP Client relevant implementation.

Change-Id: I4a03d57c78c464dc3ede7c5b3baa46ad68c2442f
CRs-fixed: 758706
SAP: Flush RfcommOutputStream

Flush RfcommOuputStream after every write so that
Sap packets could go seperately. It is done since
It was leading to queing of packets at rfcomm earlier.

CRs-fixed: 760728

Change-Id: I1cc6b5a60ce2c830f4a8bf7f06965e0573aa53b2
FTP: Remove pending user timeout intent on ACL disconnected

This patch fixes the following issues in FTP Code:
   - MSG_INTERNAL_USER_TIMEOUT intent is removed on reception of
     ACL disconnected. Previously this message was not removed and
     new intent was sent to stop obex server resulting in rfcomm
     socket being listened 2 times from ftp service in case ACL is
     disconnected while waiting for authorization.
   - Rfcomm accept thread is closed properly and joined instead of
     making it null on stopObexServer. this might be leading to some
     synchronization issues, as thread variable was made zero before
     it was closed.
   - VERBOSE logging was not shown, so removed all the logs from the
     flag for BluetoothFtpService.java.

Change-Id: Ie5c3ea45bd0a616f3513d63e8de9c332d768e3b2
CRs-Fixed: 761687