Bluetooth: SAP: Add framework changes to support SAP

Bluetooth SIM access server (SAP) profile APIs added to the
framework APIs. As SAP server supports only disconnection
of SAP profile level connection this API is implemeted
along with other APIs.

It registers bluetooth state changed callback with the
adapter service,once there is a change in the bluetooth
state,it will bind/unbind the SAP service which is
implemented in BluetoothExt.APK.

SAP service, and other SAP Application layer is implemented
in BluetoothExt.APK.

Change-Id: I7215f503244c5ee277e83d60d6960f18559acfb9

Conflicts:
	core/java/android/bluetooth/BluetoothDevice.java
(cherry picked from commit 86d14a60283c2315bea8a34f24dd0c22139a136b)
(cherry picked from commit 718d372656fa7a456247c4909baac6e7104049f8)
Bluetooth: Support  HFP Client role on Bluedroid.

Implementation changes to support HFP Client role
on Bluedroid stack

Change-Id: Ie37e95d3b0e3f785af818fb495c835e420792f4d
(cherry picked from commit 072fad9a9a17c2a31660e7ac6cd6eba82d63fe50)
(cherry picked from commit 559508238c2fe1f8f10049549b8a29053399407c)
base: IPV6 tethering support

Added two APIs addUpstreamV6Interface and removeUpstreamV6Interface,
required to pass the interfaces to use to the Router Advertisement
Proxy.
Added a dun entry to the networkAttributes value in
res/values/config.xml.
This is to allow tethering to work with the dunRequired property.
Added dun to allowable tether upstream type.
Enabled debug flags for debug logging inside framework components.
Regardless of MOBILE_TYPE_DUN APN being available, if dun_required
flag is not set, fall back to HIPRI as a preferred APN for the
embedded data call.
Debug logging was enabled by default which was causing security
vulnerabilities. This patch disables debug logging.

CRs-fixed: 555006
Change-Id: Idb0971449473554bcd749d478563db7ba351d55d
Acked-by: Subash Abhinov Kasiviswanathan <subashab@qti.qualcomm.com>
(cherry picked from commit 43bac130e4bab1c12792d29042f85c6a10372553)
(cherry picked from commit be8491aa9d82177c200eab1af713244a7bbbdcfc)
Bluetooth: Add Get/Set socket option to the Bluetooth Socket

Introduced Get/Set socket option to the Bluetooth Socket.
For these APIs it will directly call the APIs of Adapter
Service.The corresponding APIs have been implemented in
the Adapter service of native Bluetooth APK.

CRs-Fixed: 557180
Change-Id: Ic49b66599fb3c4c500e52295895d708dbc172cc7
(cherry picked from commit 80a5a8d9f465458c5417e532cc98970951f2c675)
(cherry picked from commit 5b4c228467074d2b71e02cd36c220584dba818fe)
Bluetooth: DUN: Add framework changes to support DUN

Bluetooth DUN profile APIs added to the framework APIs.
As DUN server supports only disconnection of DUN profile
level connection this API is implemeted along with other
APIs.

It registers bluetooth state changed callback with the
adapter service,once there is a change in the bluetooth
state,it will bind/unbind the DUN service which is
implemented in BluetoothExt.APK.

DUN service, and other DUN Application layer are mplemented
in BluetoothExt.APK.

CRs-Fixed: 557180
Change-Id: I6ce1204ac6138e28ad7486f2855f0f7444ad3886
(cherry picked from commit 2e60ff9becce9db20d1714786f74cb29b9ad9c74)
(cherry picked from commit ff766d48a4f6eb1b2efeaefa30f8467deefccfa1)
Fixing Compilation issues.

Change-Id: I3934dc861454f245a61c34a2cbd8dbd31147dfb2
(cherry picked from commit bb239ed63fe95c799c634109614c27c71ccfa544)
(cherry picked from commit 4143b7c7a3beb6835f673404bc13cddd22e1c298)
frameworks/base: move the traces file to avoid data loss.

If an ANR comes just after the framework reboot, the traces for
the framework reboot will get over-written with the ANR traces.
So, We are missing the traces for the framework reboot which
makes debugging the framework reboot difficult.

This patch will rename this trace file for the framework reboot
once the ActivityManager collects the traces.

Change-Id: Iee07b13ba02d8aab9cc43567aa5df131cc43c737
(cherry picked from commit 93348d7b1f48f1b3f6759bcff73153dce5709ded)
(cherry picked from commit 1c7cad9ce8b66eebe556c76c01a9396d449411cf)
frameworks/base: creating sperate files for ANRs traces

If an ANR comes just after the framework reboot, the traces for the
framework reboot will get over-written with the ANR traces. So, We
are missing the traces for the framework reboot which makes debugging
the framework reboot difficult.

Even for multiple ANRs in different apps, we will get the traces for
the last ANR.

Most of the time traces show that the call is stuck in some native call
and we do not have any info about the native call stack becuase we do
not collect the tombstones for teh ANR.

This patch will create one trace file for each application in case of ANR
and the filename would be traces_<app_name>.txt and the traces for
framework reboot will be stored in traces.txt

Change-Id: I5b78ce62b26f25d3dc14097e2988ba12c2d77826
(cherry picked from commit ea06416e430a85bef7cd21367e5948251f17c225)
(cherry picked from commit d678e40d53f0788b2883aa7c524da666ac2a8b4d)
BootReceiver: Skip subdirectories inside tombstones scan

Properly handle (vendor-specific) subdirs under tombstones
directory by skipping over them.

CRs-Fixed: 407529
Change-Id: I0cecd9fa629fad35d62d508ddaf13968c2e46f93
(cherry picked from commit 1440830e6ea3097278bc74762f09a21854d1b416)
(cherry picked from commit e042bd6f036a6dd3af4924b9a9111d9499259ae4)
SystemUi : Port forward statusbar brightness control

Brings back the status bar brightness control from cm-10.2

Change-Id: Icc04e7da3286e9925f8b90528c1e022b33d33e9d
Add GlowPadView extensions needed for lockscreen targets and nav ring.

Change-Id: I4f82fd3fe04ac16c6737d38b2473f2a533c5d326
Update reboot and screenshot power menu drawables with xxhdpi versions

Change-Id: I59fff6cf1621f59662408b8223a6582cdb54049e
keyboard: re-add code to detect lid state

This was lost in the cm-11 merge. Without this, a change in lid state
isn't generated to light up the keyboard backlight

Change-Id: Ief35cebcb62da13afe1ae7531d69ab58e196be9e
QuickSettings: Port from cm-10.2 (Squashed commit)

Port quicksettings / ribbon from cm-10.2

Change-Id: I6710a62a82ed274eb9e8c86cd2a1faf657ae53f1

Quick Settings: Swipe to switch

Adds the ability to switch to / from Quick Settings, using a sideways
swipe gesture.

Change-Id: I3cab45f72fe3c5fa40d4631fc6a84ea7bfe51bd1

Improve notification shade auto-collapse code.

- When the user dismisses a notification by swiping, also collapse
  notification shade if there are persistent notifications remaining.
  Only skip collapsing if there are still non-persistent notifications
  pending
- When the notification is removed by the app, wait a bit until
  collapsing the shade so the removal doesn't come as a surprise to the
  user
- Centralize the collapse trigger at one place

Change-Id: I4e5114f66e799a7c80e18b38abce5678da460846

Make notification-shade-collapse-after-dismiss behaviour configurable

Change-Id: I1be0be2753b479e6d2e4fc8e17d971d03ce01bb7

QuickSettings: Update all QS drawables to fit KitKat

- Recolored all drawables according to the new color theme
- Recreated some drawables to be able to include all in xxhdpi
- Remove some unused drawables

Change-Id: Ib5430059f67ff73677821122b8f2037094ba90c5

QuickSettings: Re-add Quick pulldown

Change-Id: I7bad553fe7eb4a3e91af69f811d99b74f7572aa3

Conflicts:
	core/java/android/provider/Settings.java
	core/java/com/android/internal/util/cm/QSConstants.java
	core/java/com/android/internal/util/cm/QSUtils.java
	packages/SystemUI/AndroidManifest.xml
	packages/SystemUI/src/com/android/systemui/quicksettings/UserTile.java