QuickBoot: switch normal power off to quickboot

Handle power off button when quickboot mode enabled.

Change-Id: If317441a611e5bfed69c1a3c7ee4045b49a36d86
frameworks/base: Fix to avoid crash when the tab is not set.

Tab is not highlighted in Videoapp unlike Music app.
Instead the list is highlighted with mSelectedTab a negative value
when onFocusChange is called.
Add a check for mSelectedTab.

Change-Id: I930657b8a9be4be4d973f876242a15a667ec6f94
CRs-Fixed: 657606
MMS: Fix Messaging will force close after tap one item in suggestion list

The span end is larger than string's length, it caused IndexOutOfBounds
exception.

Check the span end to avoid the IndexOutOfBounds exception.

CRs-Fixed: 555378

Change-Id: Iaf1cbe8db8704b3112afb6207982750b650fe5c5
Common: Add the api to parse the string to current language

These APIs are used to parse the text to local languange.
For example, if the carrier name in English is got from network or SIM card, we will
use these APIs to parse it to local language and display it to the user.

Change-Id: Id4922c526d77f434b43c5ac013472b6a1cd5069c
DownloadManager: add to pause/resume download by user

We add pause and resume APIs here to make application can
pause and resume downloads by DownloadManager.

Code change contains:
  - add pause and resume download APIs.
  - add another paused status for this case.

Change-Id: I5bf4f15b2464009595f7926522ca6d5f1b0e2b8d
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