Show memory full text only for internal storage

When the internal memory is full, a warning text is shown
in Settings/Storage. This warning was displayed for all
types of memory (internal/primary, sd card and usb storage)
even though it was only referring to the primary memory.
With this fix, it is only shown for the primary memory.

Change-Id: I35ad4b0b45c6752ddc9d7166495435b27fd4a170
Fix one NPE in tethering setting

Once we not declare BT feature, go Setting->more->tethering
will trigger this NPE.
Cherry-picked from AOSP: https://android-review.googlesource.com/#/c/63695/

Change-Id: I4736e7bade261475acda74e26250a81452018ffa
Signed-off-by: Jianzheng Zhou <jianzheng.zhou@freescale.com>
Bluetooth: Destroy BT Dialog on BT power off.

Check for Bluetooth off Broadcast to destroy disconnect
dialog when Bluetooth is turned off from power widget.

Change-Id: Ie556a17c7d574f77da5181c08705648ebf5733cc
CRs-Fixed: 579028
Bluetooth:GAP: Handle exception while unregistering the Receiver

Handle the IllegalArgumentException while unregistering the
Receiver.

Usually when user presses both cancel and okay for the disconnect
dialog, OnClickListener will be called twice for both options,
and for the second time it is expected that receiver would have
already unregistered.

Change-Id: I36e30d551df76b7cfd1754305a1087578fd4a275
CRs-Fixed: 595648
Bluetooth: disable scan icon when BT state is off

Usually onScanningStateChanged function should take care
of disabling the scan icon when the scan is completed.

But When the BT scan is going on and try to switch of the
BT, as onScanningStateChanged function doesn't have the
reference for scan icon it will not disable it, so disabling
is taken care in BluetoothSettings on receiving BT Off state.

On receiving BT Off state, disable the scan progress icon only
when available device category is present.

CRs-Fixed: 543777,596214
Change-Id: Ib827903d4f5c80eeb6ac8a06fb1a945140dd20c9
Bluetooth: A2dp: Add A2dp Source UUID

Add A2dp source UUID to A2dp profile UUID list so that
once SDP is performed after pairing, A2dp profile is added
to the cached device instance if remote device supports
either A2dp source or sink role.

Change-Id: I67b16ac2c6fd7a6c2510c80c41dca27c35225a1b
CRs-Fixed: 593841
Bluetooth: Validate the device for A2dpSink

This change will check if remote device supports A2dpSink before
sending A2dp connection Request.

Change-Id: I141099f14b697debce59d094a388de344aad1df1
CRs-fixed: 590200
Settings: fix NPE with null check on NFC adapter

Verifies the adapter is not null before dereferencing it and log and error if so

PS:
- fix codestyle and rebase

Change-Id: Id2a34c4698a97476bee9b78cb0ac7b980d1595cf
Bluetooth: GAP: Avoid adding device to cached device list

Change will ensure that devices will not be added to the cached
device list if profile connection state is STATE_DISCONNECTED
or STATE_DISCONNECTING. Otherwise, devices will be added to cached
list and while inquring device will not be listed in available
device list.

CRs-Fixed: 586975
Change-Id: I60bc01c0f2cb5ea87f3c633bcec2f04c90939d67
Bluetooth: HID: Use proper values of connection status

This patch fixes issue in retrieving correct connection status when
more than one hid device was connected to DUT. In such situation
current implementation was sending STATE_DISCONNECTED as connection
state because of wrong check of matching device as 1st device in
connected device list. Instead of this now actual connection state
device is retrieved from HidService.

Change-Id: I2c766e9fc6eb9e97c3745016e38fa5c374c16539
CRs-Fixed: 593065