Fix potential deadlock between LockScreen and WindowManagerService

If LockScreen is enhanced using SurfaceView/GLSurfaceView,
deadlock problem between LockScreen and WindowManagerService
can occur because of IWindow.resized() callback.
And it must lead to watchdog and reset.

IWindow.resized() callback is one-way function so calling resized()
callback of a remote IWindow object is never blocked.
However, calling resized() callback of a local IWindow object
(LockScreen is running on the same system_server process)
is always blocked until resized() callback returns.
Because resized() callback of SurfaceView/GLSurfaceView can lead to
WindowManagerService.relayoutWindow() call, deadlock can occur
between relayoutWindow() and performLayoutAndPlaceSurfacesLockedInner().
(Both functions need locking mWindowMap)

So this patch simulate one-way call when calling resized() callback
of a local IWindow object.

Change-Id: I2a6a5c74ed22d8e6b7a3bea3424ff2879d227105
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
Revert "IME : Fix sym key regression"

This reverts commit 094e31962abbf811d1143c54dfdf540219632e35.
Launch music player on headset connect

Launches the default music player when a headset is connected

Change-Id: Ib97077191c52b14e552265456312162b6ad3fdcd
Profile: respect DPM when overriding screen lock (1/2)

Profile currently allows the user to override the keyguard set by
device policy, which is undesired.

Change-Id: Id8d80cfdad51ca0a64dc231a77e53b104ecb9825

Conflicts:
	core/java/com/android/internal/widget/LockPatternUtils.java
Two REMOVE_PROVIDER messages caused by race condition.

Fix a bug in unstable ContentProvider.
IllegalStateException: ref counts can't go to zero here: stable=0 unstable=0
IllegalStateException: unstable count < 0: -1

There is a race between main thread and background database thread. Main thread
is responsible for handling the REMOVE_PROVIDER message. Database thread starts
insert or query request again and again. acquireProvider in db thread will often
snatch provider from the jaws of death, sometime it fails to remove REMOVE_PROVIDER
which is already fired out from MessageQueue. But completeRemoveProvider in main
thread gets suspended when trying to execute the critical section. If db thread
released the provider before main thread resumes the execution, then two
REMOVE_PROVIDER messages will be executed.

Change-Id: I8588aa1d1a8bc444dcd2adf6f8bc3f055cebbdc4
Signed-off-by: Guobin Zhang <guobin.zhang@intel.com>
Disable navbar searchlight if search assist not available.

Bug:7506441
Change-Id: I55c740d4c3a45b9f7fdfa38346d1bc3fb1299153

Conflicts:
	policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java
Support Wifi display devices that rename themselves.

Some Wifi display devices like to rename themselves after a
connection completes (or at other times).  Make sure to update
the name of the display when we detect that it changed in
our scan results.

This problem is somewhat complicated by the fact that we remember
the display name persistently, so we need to update our list
of remembered displays too.

Improve the state machine to avoid redundant attempts to
disconnect or cancel connection.

Bug: 7478895
Change-Id: I35a9e2c6a8deadbe892dacd5e3b4a5a2b12d6cf0
Revert "Decrease lag generated by autorotation on"

This reverts commit dd58e2ea0ddd8ba750c36c9abf86162e30f9995f.
Reduce jankiness of the transition between a text field with FLAG_NO_FULLSCREEN and a text field with FLAG_NO_EXTRACT_UI

Bug: 7393485

Currently, the extract text view blinks at the transition of InputMethodService.
This change reduces this blinking by making the extract text view invisible when the extract text view is hidden.

Change-Id: I9af96058283a9a5b60707d025ad1abbbbc23c16f
Watch for leaked ParcelFileDescriptors.

Bug: 7426029
Change-Id: I18f7ac7d7b357b092bf9ec91ffb9fa3de5ca0271
Reduce emulator logspam

The emulator doesn't support systrace, but we should point that out
at most once per process.

Bug 7436352

Change-Id: I30e0094dc3b24bc3ab6bc2799ce81ca0a6bb7d9d

Conflicts:
	core/java/android/os/Trace.java
Underp the Underp public API...

Change-Id: I7841c3c4d58dc224dc0e83f46b06cb1de93987a2

Conflicts:
	core/java/android/view/WindowManager.java
Fix NPE when pasting non-text from Clipboard

When copying a link from a bookmark and then pasting it into
a textfield a NullPointerException will occur.
A ClipData.Item is not guaranteed to always contain a text string
and therefore getText() can be set to null.

Using method coerceToText() instead of getText() makes sure that
a text string is always returned.

Change-Id: I81343c0371835a3a7a52045dcd1760e69e59a967
docs: resolve bugs from external tracker

Change-Id: I680970ec63701197103f6c5ab55c25c736aa0519

Conflicts:
	docs/html/google/play/billing/billing_integrate.jd
[Framework] Alternate Default App Picker (1 of 2)

Change-Id: Ia00120c61b81c7d90fc81ca0049dcc713644e11b

Conflicts:
	core/java/android/provider/Settings.java
Frameworks: Add Widgets viewpager for all devices (2/2)

First thanks AOKP for the basic idea and some parts of code.
This commit gives the ability to show up a viewpager with
custom user set widgets. It is bindable to navbar, navring
and to hardwarekeyboards. It works with navbar enabled as
well as with navbar disabled. Like every time we polished it
Slimusual a bit up.

Change to the original widgets viewpager
- bindable also over hardwarebuttons
- shows also up without navbar
- color settings for background and text
- transparency of background (default 25%)
- settings complete overwork
- TRDS compatible
- complete overwork of widget height handling
- multiDpi (thanks mnazim)
- slimup and a lot improvements and fixes

cheers

Change-Id: I64c1a56131616769588500c0faedb7eec6f59249

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/res/drawable-hdpi/ic_sysbar_widget.png
	packages/SystemUI/res/drawable-mdpi/ic_sysbar_widget.png
	packages/SystemUI/res/drawable-xhdpi/ic_sysbar_widget.png
	packages/SystemUI/res/layout/navigation_bar_expanded.xml
	packages/SystemUI/src/com/android/systemui/WidgetSelectActivity.java
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/WidgetPagerAdapter.java
	packages/SystemUI/src/com/android/systemui/statusbar/WidgetView.java
Re-implement magnetic targets

This reverts commit 8d037a2ded2edafc2ecafad2a8d799cb3f82f629.

Change-Id: I26da0ab2c9d65828bf9cd16a82dad7d1c50dc891
LockPatternUtils: isSecure: respect profile settings

When the lock screen is set to secure and overridden to insecure
by profile settings, isSecure() would return true causing confusion
to some code.

For example, attempting to use a lockscreen shortcut
to launch an activity will cause the device to soft-reboot due to
recursive calling and a stack overflow.

Change-Id: I02984671c2a047765f4da1f6a44bb19dea5bf2d3

Conflicts:
	core/java/com/android/internal/widget/LockPatternUtils.java
framework: fix reference leak in activiy manager

Change-Id: If7f27ea35f5a1d1dd7c98fbe5f92729ab9ba0257
Revert "Improve AOSP Download/Upload animation"

This reverts commit dd09388dd8d1422033d65511a3140b6506b9518d.