Partial revert of this commit: https://github.com/crdroidandroid/android_packages_apps_Settings/commit/f9d19a1db563fc2497515067d80836860b5d237f

Lets keep the SecureSettingSwitchPreference class for possible future usage

(cherry picked from commit a567cc7042c409e78f9c607f06cf44e0bef6457f)
Bluetooth: GAP: Handled scan mode during first time BT On

As the discoverability time out concept changed as per the
new design and this code snippet "setting scan mode to
connectable only when endtimestamp is null" is not
applicable.DUT remains in only connectable mode
if user remains in the settings menu.

Change-Id: I7aa2ea7d23c4a47f716e2c0645b2ad73018ada39
CRs-fixed: 714578
(cherry picked from commit f7377fcd2b742c8e92896cdfa94b656a496c957b)
(cherry picked from commit 4874e9e008db9510eea23b35f64d50b198a0b1da)
Bluetooth: Don't Initiate Connection if UUID not updated

 - if UUIDs are not updated don't initiate profile connection
 - add new profiles to already existing list
 -  don't delete profiles from the existing list

CRs-Fixed: 717840

Change-Id: Id71a5aad59f4004c262f3ad17f34fa0574654170
(cherry picked from commit 146cea44db537ed19e6cea711b2361fa2987eb0a)
(cherry picked from commit deae59b8265c9d48d008e2567771a78af4fbb5c0)
Bluetooth: Enable Page and Inquiry Scan.

When Bluetooth Setting is in foreground enable both
Page Scan and Inquiry Scan.
Changes made to make device both in connectable and
discoverable if user is in Bluetooth setting menu.
CRs-Fixed: 753990

Change-Id: I2d72ce3192f6b7fa9eb6beb5a175a3e732dac5a8
(cherry picked from commit 88d045c1afc08b9f31a880bdad42fcc2caf6d01d)
(cherry picked from commit 42cff46bcfe6d749f6005f78f01feb644df2b7a3)
Bluetooth: GAP: Reset Alias name during virtual unplug

As per this fix Alias name get resetted when hid virtual
unplug initiated from HID device.

Change-Id: Idb1cba447072fd70c21cfecef8776b2baaf730bc
CRs-Fixed: 754689
(cherry picked from commit 485e855f5b6c18d535cc86306bc4e7cf60bad396)
(cherry picked from commit aeabfc6cdb5d7f523fbc6fe31c36111b899941d3)
Bluetooth: Refresh UI after checkbox is Unchecked.

 - Refresh list of auto-connectible profiles when
   Checkbox is unchecked in disconnected state.

Change-Id: Iddca04cbb06262556ea7decb39279df26e358eb6
CRs-Fixed: 758480
(cherry picked from commit 459e6620f47cf5ae814613209bff02bd878bff50)
(cherry picked from commit 9f22262db25bb36fc4fc51792dfba436254e5649)
Bluetooth: Security: Add Null check during pairing cancel intent.

Added null check, so before posing event we can restrict events,
if cached device list is empty

Change-Id: I458d181abe5eec2497b80b1713ddbc3502b79786
CRs-Fixed: 546364
(cherry picked from commit 7d7222c3e5c1054b4e2f3e59cc40cb182a72b040)
(cherry picked from commit 8ce523155dd030d82c32cf502d317023b017645b)
(cherry picked from commit 938686e749bca911e5f63150223116d1c381da8e)
(cherry picked from commit 8652b0207eff19b1a9ed0ba1eceecf1871c991a2)
(cherry picked from commit fc0b6f51aa00c1db54ea5cd53fef3d0e9c2bbae7)
Bluetooth: GAP: Handled Null pointer deference in unregisterReceiver

Handled Null pointer deference in unregisterReceiver event of
pairing dialog

Change-Id: Ie0d0561cb3c0f09a018e1aeb20579700c6e8d783
CRs-fixed: 761872
(cherry picked from commit 1b9fa93337a08b2c38e98368a8d70be6b8a191ff)
(cherry picked from commit 20b5dc4ef70d46f9b4dd2bffe16b056d0482eb1c)
Bluetooth: Add Manifest configure to fix settings crash issue.

Settings is crashed when press back key after rotating screen when
Bluetooth profile activity is opened. Add manifest configure to
enable screen orientation feature.

Change-Id: I4550b18383d817d1a2f46fbeebda8a3bdab580c6
CRs-Fixed: 762437
(cherry picked from commit bc8b9a471cec7fcfc2737dc844c1002ff9b9793c)
(cherry picked from commit 34f585e1d6434f8cb8dcf4fcccb0bade23d70d9a)