Bugfix : Quick pulldown sometimes flips when it should not

When your Quick Settings Panel is set to

Quick pulldown : right

Sometimes (very intermittently) the tray flips (to Quick Settings) as you pull it down from the right side.

This is happening because the pull down happened so fast you can see the top 0-10 pixels of the tray,
and because it was showing the notifications, not the Quick Settiings

However the user expects the tray not to flip, but to just be on the Quck Settings.

The new code simply checks to see that the Event was a pull down event and that the event started in the top status bar.
If this is the case, then the quick panel is swapped to (without flip)

Special Thanks to my daughter Jenny fo painstakingly reproducing this bug.

Change-Id: I8fdbedb1aa6d4fd672bd4cb58b7c99557469ab62
Profiles: add PROFILES_STATE_CHANGED_ACTION broadcast intent

Added a new broadcast intent to profiles manager (PROFILES_STATE_CHANGED_ACTION), for
notify an event when profiles are enabled or disabled.

Change-Id: If701b3be54157c23acdf74e1da658fbce335437e
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
fixed inconsistant define values with android_nfc.h

Change-Id: Idccd2de60caf7b72839d158b39d14e2cfcdd5fc7
SystemUI : QuickSettings Cleanup

Introduce new class to reference from settings and SystemUI to avoid
code duplication.

Differentiate between configuration change vs tile layout modification.

Patchset 2  - Remove whitespace
Patchset 3  - Remove unused ids
Patchset 4  - Better organize the classes
Patchset 5  - Rebase
Patchset 6  - Introduce updateResources()
Patchset 8  - Update tiles to use updateResources()
Patchset 9  - Expand imports
Patchset 10 - Updated all tiles to support updateResources()
              Added dinamic tiles to mQuickSettingsTiles
              Optimized and standarized of calls to updateQuickSettings() from tiles
                 onPostCreate() -> updateTile() -> super.onPostCreate() -> updateQuickSettings()
                 updateResources() -> updateTile() -> super.updateResources() -> updateQuickSettings()
              Rebased
Patchset 11 - Remove unnecessary calls to update Quick Settings

Change-Id: I0baff915b4c3486cc0ac165e3e927399c2b15776

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
QuickSettings: Add LTE Tile (1 of 2)

Patchset 3 - Add proper drawables and update logic
Patchset 4 - Rebase
Patchset 5 - Fix build errors

Thank you to Bjorn Lunden for the drawables

Change-Id: Ia25d098020586e06d38589f84d3d1a581e7cbd9a

Conflicts:
	packages/SystemUI/res/values/strings.xml
Framework: Fix Brightness Tile

Change-Id: Ie26fedae34789f8c1ff16d90cb8d6fafe8c5cb6c
BrightnessTile : Cleanup controller references

This commit cleans up references that are not necessary

Change-Id: Ie6d4581b26e0625cf107a05e7eda695394281075
SystemUI: Fix QuickSetting IME tile

The IME tile reference need to be saved to used at setImeWindowStatus method

Patchset 2: Reset IME tile prior to load tiles

Change-Id: I185c37ed91794af93bd6f750c1e0c039c15f6696
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
QuickSettings: Honors config_show_cmIMESwitcher setting (1/2)

Change-Id: Ia93945cda1a7e491dd3f52c61623b3064624e575
Remove log noise

Change-Id: I1801020ee7ca0e0518a2ec5abb36d6c48d0dd4ef
Added Volume Tile to Quicksettings

Drawable by blunden

Change-Id: I04451d8b4669ae0d4f798010a4c61e5e82990b76
Framework base: Update italian translation

	Minimal correction for consistency with Settings

Change-Id: If5f5eec94b1f38d31c1d1e9d9c20d70cf59acc5d
Japanese: Update Japanese translation.

 Add missing entries.
 A little revised.
 rebased on latest HEAD (patch-3)

Change-Id: Idaecfe258cd61833cac45c9177dd5d1541161d0a

Conflicts:
	core/res/res/values-ja/strings.xml
AudioService: Restore volumes after boot and when a headset is plugged

The correct volume levels for <device>_speaker and <device>_headset are not
restored after booting and when a headset device is plugged in or out.

This fixes a glitch where the first volume change event causes the volume to
be reset to the last stored value instead of increasing/decreasting it by
one step.

Change-Id: I6a483af34fd6d9dd706c6979202bf0cf26d80854

Conflicts:
	media/java/android/media/AudioService.java
Swap volume buttons when the screen is rotated (1/2)

See: http://review.cyanogenmod.org/#/c/14530/

Patch Set 8: Invert the orientation interpretations on tablets

Change-Id: I201febc2827e6fbd347cb0e3f8d3347ad1bc487b

Conflicts:
	core/java/android/provider/Settings.java
Fix resource leak: When call MediaMetadataRetriever.setDataSource or getFrameAtTime should ensure call release in finally to avoid resource leak
                   Patch set 2: Remove unnecessary white spaces

Change-Id: I49a7f2fb99dc8b9560e7c17421125356e45a87ac
Add keymapping for select BT headsets

Per CYAN-522, select BT headsets (e.g. Jabra Street, Jabra BT3030, etc)
send key 159 for fast-forward button, instead of the expected key 208.

Need's testing with affected BT devices.

Change-Id: I06ba689f77dd1058fb82b1de9f72b4df59150cf9
Fix race condition in backlight adjustment.

When configuring the automatic backlight levels, there's a race
condition in setting the lux and brightness settings as the settings
provider doesn't allow storing multiple settings atomically. When
deleting rows, there's quite a high chance of DisplayPowerController
picking up a state where the lux values already have the lower number of
rows, but the brightness values do not, effectively leading to an
ArrayIndexOutOfBoundsException.

Fix that by
- waiting a second of cool-down time until applying the settings and
- adding a sanity check for the very unlikely case that the delay
  between writing both values is > 1 second

Change-Id: I44e41530fc5334aaefc4ab7d3a90542f78fabe0c
JIRA:CYAN-755
mdpi drawables for Navigation Bar Quick Launch Shortcuts

Change-Id: Ie7f05ea58916f9a12479e15475eaabcd3931f0d2
Remove unnecessary updateSurfaceScreenOn call.

This change stops updateSurfaceScreenOn() from being called one time
right after another. It's called at the end of stayAwake(boolean awake),
which is called right before updateSurfaceScreenOn() in release().