Power Menu: Update the Expanded Desktop drawable

Also add a proper "off" state.

Patch Set 2-4: Add to symbols.xml
Patch Set 5: Remove the useless extra sw600dp-xhdpi drawable

Change-Id: I111982a4985bba19353dd4f3872e5b21e73dd5f9

Conflicts:
	core/res/res/drawable-sw600dp-xhdpi/ic_lock_expanded_desktop.png
	core/res/res/values/symbols.xml

Signed-off-by: Paul Beeler <sparksco@gmail.com>
Fix divisions by zero on boot.

Change I976ffae3a56d411b00026f86b16efa9743a23293 introduced a problem
where depending on the rotation settings the WM override display
configuration would be filled with invalid values.
Fix that by correctly checking that the display is ready prior to
setting the override configuration.

Change-Id: Ia3fd7603d9c1212cd32536803b4c12390a798606
LockscreenTargets : Dismiss on target select

Only dismiss prior to activity launch for lockscreen shortcuts,
camera and appwidget picker remain untouched.

Change-Id: I2770c628ce0708570aa6ea0eac9e3cd1d82287fb
Revert "am: Allow more hidden apps on devices with lots of RAM"

This reverts commit 3c3d7447c8bc749d5723bf01edfdbfcd2f954e64.
Fix pie controls being disabled by launcher gestures.

Some launchers have gestures for expanding/collapsing the status bar
from swipe gestures which call the respective StatusBarService methods
even if the status bar isn't visible due to expanded desktop. Because of
that, the status bar code internally thinks the expansion is carried out
(even if invisible), thus disabling the bottom pie controls in the
process.
Fix that by making PhoneStatusBar aware of it being hidden by expanded
desktop and ignoring the expand call in that case.

Change-Id: If386ca953517d9b5efcb6cb9054f5c5e6a9e0bc4
Remove opaque check in GLRenderer when preparing dirty region.

Since preserved swap is enabled, we need to clear the color buffer
when the scissor rect is prepared for a new process. This prevents
garbage to be present from the previous process in the color buffer.

CRs-Fixed: 391492, 403067, 405916

Change-Id: I1f72a3dee2f5d58a984f4cd367c9f7bf08ab9d6a

Conflicts:

	libs/hwui/OpenGLRenderer.cpp

[PATCH] Remove opaque check in preparing dirty region

Since preserved swap is enabled, we need to clear the color buffer
when the scissor rect is prepared for a new rocess. This prevents
garbage to be present from the previous process in the color buffer.

(cherry picked from commit 2b5e584e2615852b68a69bb529c6926190246b64)

Change-Id: I92a4fa35e0746f12fcd736e21fd30d9c4b644a8a
CRs-Fixed: 391492, 403067, 405916

Conflicts:

	libs/hwui/OpenGLRenderer.cpp

Enable scissor when preparing dirty rect that is opaque

Now enabling scissor before setting it in the opaque case, previously was not doing so.

Change-Id: I1ea904cf01603096e423556090564291ab712d36
CRs-Fixed: 465346
Depends-on: 278453
Tighten enforcement of file modes.

Bug: 8275867
Change-Id: I4da14f2dd0049aca69636999696c1f3c02b3b792
FlingTracker can divide by zero and hang StatusBar in an infinite loop

if 2 events have the same timestamp then FlingTracker in PanelView will divide
by zero causing NaNs. the bug is usually triggered by rapid StatusBar up/down
dragging activity and updateCarrierLabelVisibility can then loop indefinitely
looking at NaNs. the user visible symptom is that StatusBar refuses to pull
down and is burning cpu time.

Signed-off-by: Michael Bestas <mikeioannina@gmail.com>

Change-Id: I0791c6bea953bf03346185fc6aaf44aaea79aace
Merge Navigation Bar and Pie Controls button config (1/2)

Based on the commit series for pie controls, this commit
makes the Navigation Bar and Pie Controls share
the same button layout. However, there is no button layout
editor for pie controls, which makes the navigation bar
the leading entity when it comes to button layouts.

This commit introduces:
* A common notion of navigation buttons.
  (class NavigationButtons)
* Some setting constants changes.
* Removal of the pie search key, since it is no longer needed.
* Sophisticated key event injection.
* Virtual key sound effect

Change-Id: Id68f8d0b597d7d89c55c3f66f994e632d014f006

Conflicts:
	core/java/android/provider/Settings.java

Signed-off-by: Paul Beeler <sparksco@gmail.com>
hwui: This code should only be enabled with QCOM_BSP

 * Crashy crashy!

Change-Id: I1a06ac54a8ce2dccbf4a67424b0cbb6e7dd21e8b
Revert "hwui: This code should only be enabled with QCOM_BSP"

This reverts commit 47fab2212992c5bdd42a610052ad2daab0b3145b.
Revert "Remove opaque check in GLRenderer when preparing dirty region."

This reverts commit 72a7fa9034c5c83cc6f9a0b1b301f31a7143b4ca.
Improving pie control's user interaction

User feedback showed that it is sometimes difficult to interact
with pie controls. This commit adds some tweaks to how pie
controls react on user touch events.

This changes:
* Pie trigger on LEFT and RIGHT are now more forgiving in the
  initial phase of a swipe. (This should reduce problems when
  trying to activate the pie with a thumb.)
* Pie items are now more sloppy when it comes to focus.

Patch Set #2:
* Removed sloppy focus.

Change-Id: Ib21556ed7f7ff9c6cdbcd1760e94a17c8534706a
Fix DateUtils.formatElapsedTime.

More reuse of StringBuilders, less broken home-grown formatting code.

Long-term, we should hand this over to icu4c, but they're not ready yet.

Bug: http://code.google.com/p/android/issues/detail?id=41401
Bug: 7736688
Change-Id: Ib3c1e1aad05827df646aa18645cce19dffb7551f
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>
use Calendar in DateUtils format method

The DatePickerDialog is using DateUtils to format the dialog's title
and the DateUtils class does not work with dates outside to the
specified range.
For example, if user selects 2038-03-07, DatePickerDialog shows
1902-01-30 on Title.
The reason for the DateUtils class not being able to format dates
outside the range of 1902 and 2036 is because internally it is using
the Time class which does not support such dates.
To fix it, use Calendar class in DataUilts format method.

Steps to reproduce:
1. Settings -> Date & time
2. uncheck Automatic date & time
3. Set Date
4. choose any date before 1902 or after 2037
5. update wrong date on Title

Bug: https://code.google.com/p/android/issues/detail?id=13050
Change-Id: I003266765751b5c340426af84daef271f39f771e
Adapt navigation bar's long press behaviour for pie controls (DRAFT)

This commit brings the navigation bar long press behaviour to
pie controls.

Two things will be considered for long press:
* Long press on HOME will open Google Now.
* Long press on BACK will kill an application if enabled within
  the debug options.

Patch Set #2:
* Jacob's colours

Change-Id: I8cfa87a5be0678f0452011d85d427439d7cf31e9
Revert "Fix resource leak: When call MediaMetadataRetriever.setDataSource or getFrameAtTime should ensure call release in finally to avoid resource leak"

This reverts commit 7bb32e5e6fe7b266a1c4a45f4a6083165dc78d4e.
Revert "AudioService: Restore volumes after boot and when a headset is plugged"

This reverts commit 912dd61c4f16f18824c655884f67b9c5e9729f03.
Revert "AudioService: allow volume control on analog dock"

This reverts commit 63f508270ca74089e46cb1f5f029d3cc63e171b6.