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
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 and will append a unique timestamp
this trace file name for the framework reboot once the
ActivityManager collects the traces. In case of multiple
Watchdog Kills the trace file generated will have diffrent
timestamp so that it does not get overwritten on multiple
Watchdog kills.

Change-Id: I90cb400d06aa909c1560328de4751aa02dbb6858
Audio: Fix title of system ringtone contains messy meta

Title in the Meta information of Bootest.ogg contains
junk characters which is displayed in Settings->Sound-
>Phone ringtones.

Correct the binary file to solve this issue.

Change-Id: I91c0519bb55ee5e74f783b0c147acbde641f6502
CRs-Fixed: 569976
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
base: Do not overwrite VIRTUAL_DISPLAY_FLAG_* values

* VIRTUAL_DISPLAY_FLAG_SUPPORTS_PROTECTED_BUFFERS is
getting read as VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY.
This impacts the content seen on the VD device.

* Ensure that VIRTUAL_DISPLAY_FLAG_SUPPORTS_PROTECTED_BUFFERS
and VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY are different
values to prevent this.

CRs-Fixed: 653794

Change-Id: Ic0ea99a554ab26f2ff941304d1c6809f976076ef
Route Emergency calls on CS pipe

Issue: Emergency calls always routed on IMS pipe for CS call.
Fix: Route emergency calls on CS pipe

Change-Id: Iaf756e29f0213d2d04aecac755f6761a9a944ce2
frameworks/base: Fix binder parcel leak with getMetadata() API

When VideoView calls getMetadata API of MediaPlayer, parcel object
is getting allocated by MediaPlayer and metadata is created over
parcel object. This metadata object is returned to the VideoView
which is being GC without calling recycle on parcel which was
creating leak in binder virtual memory.

CRs-fixed: 669303
Change-Id: I1e265909ee42d4fabd8b2552668b3d84af994294
TelephonyTests: Fix runtime errors for clean run

methods not accessible from test classes

Change-Id: Ic0c379be15b951e92a80fe575f4b5d4fa7874cca
BT: HF: Control verbose logging at runtime.

Verbose logging in BluetoothHeadset can be
controlled from adb shell.

Change-Id: If63974402a4fc91065c8007a224388af12f49cf7
CRs-Fixed: 601899
framework: Added AOSP Security Bridge hooks

The Security Bridge is used to monitor and control
APK installation and clipboard copy-paste activities.
This commit is required to enable enterprise security features.
The commit also includes the Security Bridge Stub.

Change-Id: If881da78f985fdfdcb262068386feb4285e3ae31
Frameworks: Enhance face detection

Add support for facial processing features:
smile detection, gaze detection and blink detection

CRs-Fixed: 587195
Change-Id: Ic186ff0658e755a8b5287cffa1dd58d9eafebc9a
Display: Dirty region propagation

Pass Dirty region values from HW renderer to Surface Texture.

Conflicts:
        core/java/android/view/ViewRootImpl.java

Change-Id: Ibd121ed398a1319d3daf26f9fd39a03323bba666
frameworks/base: Call setDirtyRect to update dirty rectangle.

This change updates dirty rectangle instead of dirty region of a
surface.

Change-Id: Ic5c6e68ff644911a596a2432fd14868edbff9b17
IME: Fix Happened IllegalArgumentException 315 times during monkey test

The method startInputInnerLocked() sometimes throw IllegalArgument
Exception. There are 3 places invoked this method, but one of them
forgot to catch this exception.

Catch the IllegalArgumentException when invoke startInputInnerLocked().

CRs-Fixed: 563388

Change-Id: I315cb46b1d16c2862989cb9c0c10ed6613884522
wlan: Provide runtime option to enable or disable rssi threshold (base)

RSSI threshold check in AutoJoin feature will not allow
to connect if AP's RSSI is low, this option will allow user
to configure through advance setting application.

Change-Id: If479ab453b4760a196000ce9f72ae2fcee116f87
CRs-Fixed: 710284
Bluetooth-Wipower: Support for Wipower feature.

Wipower feature code is been enabled, This is used to
perform wireless charging over bluetooth low energy.

Change-Id: I47551450a1eac966ae0d2443415888d2fc0c8ef4
CRs-fixed: 698314
audio: use fixed volume on proxy devices

- Use fixed volume on proxy devices(WFD audio)

Change-Id: I298f0284c5de235ca5ede179417c0f7b97e9ed38
ProcessCpuTracker: Fix ArrayIndexOutofBoundsException in tempSpeeds

If time_in_state file is not available mCpuSpeeds is created with size 0
and subsequent call if the file becomes available there is an
ArrayIndexOutofBoundsException.
This change avoids the crash by breaking out of the loop, also adds error
logging

CRs-Fixed: 553569
Change-Id: Id5e219ca1cd3f058f714aecd5902ec2f6c11ae03
Fixing IndexOutOfBounds Exception in ActivityManager

Bypass the iteration to avoid the exception during
the execution of ensureActivityVisibleLocked() because
startSpecificActivityLocked() within the loop may delete
the elements from History stack.

Change-Id: I0fdf098973fb167958959fc49a65a7130fad02d5
MediaRecorder: video: Add H265 encoder

Added support to set HEVC video encoder (H265).

Change-Id: I5b8b408d942aa0562a2fa656079c0b5a7b81303d