Active display: Fix for HDPI devices.

Thank's to @AlmightyMegadeth00 for the tips...

Change-Id: I644eea927381af98d5779048fce37c3f1d3c6dd3
Signed-off-by: aways <aways@c-rom.biz>
Squashed commit of QuickBoot feature from Qualcomm

QuickBoot: don't log boot events when in QuickBoot mode.

Don't need log boot events when booting from QuickBoot mode.

Change-Id: Id381530418c09ac1d650f45e7a368dbd7945aff3

QuickBoot: don't wake up screen when usb connected

Don't wake up screen in QuickBoot mode when usb connected.

Change-Id: If65936a0edbbc3b36a0768294e5c3bd7d741018a

QuickBoot: filt out alarms that for non-system users

Don't allow alarms for non-system users when under QUickBoot
mode.

Change-Id: I322d08f7236b6895462c4cd3304326c66f67ddd2

QuickBoot: restrict app's auto start under Quickboot mode

Don't let broadcast trigger apps auto start when in Quickboot mode.

Change-Id: I5d156cbea4ef18397ce4569cb74f73a446a6e49b

QuickBoot: remove alarms for killed apps

Device may be woken up by WAKEUP alarms, which have been set
by those killed apps before. Here to get the killed apps list
and remove the alarms from AlarmManagerService.

Change-Id: Ib34f5fc234b834b2fe4528229c267c8693fc76cb

SyncManager: Fix SyncManager null pointer issue under QuickBoot

BOOT_COMPLETED broadcast will cause mBootQueue null pointer issue.
Then system_server will crash. Add protection here to avoid
system_server crash.

Change-Id: I78029dfa90709455e4c2220e06b95640383655f8

QuickBoot: add execption restore mechanism

There may be some exceptions like battery unplugged When device
is put into QuickBoot mode. Then device will be in airplane
mode after next boot. We don't want such kind of things happen.
So start restore task to check if need restore before main
screen shows.

Change-Id: I3d0967c2f446fd71eca87ff085617edca549c984

QuickBoot: switch normal power off to quickboot

Handle power off button when quickboot mode enabled.

Change-Id: I6a668cbe823018b5e508633a76202d0df0381694

QuickBoot: support QuickBoot power on

Support long press power key to power on when in QuickBoot mode.

Change-Id: Id493d352bce73683b9696a2685a6c902f1195799

QuickBoot: Don't handle SHUTDOWN broadcast from QuickBoot

Don't process the ACTION_SHUTDOWN broadcast sent by QuickBoot.
It is only for apps.
Change-Id: I73d1a7b8edda0a898dd052831033806e18b37c99

QuickBoot: rename some intents and broadcasts

Modify some improper names for intents or broadcasts of QuickBoot.

Change-Id: I92357b0110643bb425199452cb03bd75248a5d83

QuickBoot: Support poweroff alarm under QuickBoot mode

Add white list in QuickBoot mode to support poweroff alarm.
    1. Allow original deskclock app and quickboot app to be launched.
    2. Don't filter out deskclock's alarms.

Change-Id: Ie4254e3da45837d3185d3daba625a42c50fd7f52

QuickBoot: enable poweroff charging under QuickBoot mode

control native charger's enable/disable under QuickBoot
mode.

Change-Id: I4f80c74b042e03bddc9f7fe419f4ed1f8b1409d5

QuickBoot: Add wakeup check under QuickBoot mode

We only want QuickBoot application to wakeup screen in QuickBoot
mode. Add wakeup check to filter out other wakeup callers.

Change-Id: Id82a0938003d2a776efda0e39a57877f41fc1ee4

Conflicts:
	policy/src/com/android/internal/policy/impl/GlobalActions.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
	services/java/com/android/server/power/PowerManagerService.java
Shorten app switch delay time

Change-Id: I8759c98e8bd03454fa7e86ab27b25743c9f73c5e
Do not show Home behind full screen activity

When ensureActivitiesVisibleLocked goes through foreground activity
stack and reaches non-fullscreen activity, it sets showHomeBehindStack
variable to true.

If there is a fullscreen activity behind, showHomeBehindStack remains
unchanged, which causes Home application to be displayed anyway.
In this case user will see a fullscreen activity and Home activity
simultaneously.

To fix the issue we set showHomeBehindStack to false when we reach
fullscreen activity in the activity stack.

This was made visible by the following commit:
446ef1de8d373c1b017df8d19ebf9a47811fb402

Change-Id: I535c1283a4e26f5cf606375b837d4b7195324af0
quickboot: Only enable QuickBoot if package is installed

 * Also move to Settings.Global

Change-Id: I87e1464d717b41437072523c0ecab52227d7888b

Conflicts:
	packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
QS: Flip drawables used by Immersive hide nav/status bar only modes

Better logic this way as the arrows on each Immersive modes icon will now point
in the direction needed to swipe to reveal each modes hidden bar.

Signed-off-by: Ricky Salinas <rsalinas1@mail.usf.edu>

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java

Change-Id: I130bb0e4dbb449071f7698913f8139a2b541733d
PIE 2.0 - credit (and lots of it) goes to the AOSPA team!

Pie is an alternative navigation and system info interface. It replaces the
standard navbar/statusbar with a navigation arc decorated with statusbar info.

Important notes for developers:
* When PIE is enabled apps don't even have to support immersive mode, they just have
  to check for configuration updates (sadly not even this is done by all apps).
  When PIE is disabled, apps have to setup an "onSystemUiVisibilityChangeListener"
  (best practice for PIE enabled, too).
* Changed how ActivityInfo handles apps capabilities like recalculate screen
  size etc. Check code comment(s).

Some info:
* Quicksettings and notification panels are not available anymore, google now
  replace swipe up gesture.
* Switched to kitkat colors.
* General improvement to the code, reorganize classes.
* Cleanup a lot and remove useless code.
* Merge with immersive mode, they live in a homogenized state.
* Improve immersive code a bit.
* Upon first activation, toggling immersive tile, the user is presented with a dialog ask$
  to enable or disable the feature. The preference can be resetted in "Backup & restore" $
* Reduce and center its trigger area.
* While pie is triggered screen is keept on.
* Depending on immersive mode, will show full or lite pie.
* New circled snap points.
* Detach pie on every rotation and/or when screen goes off while you have it triggered.
* What else, what some slices?

Key contributors:
@BigBrother1984
@D4rKn3sSyS
@Anu6is
@David96
@drcmda

PIE [WIP]

Still need to fix:

RecentsActivity.java
NavigationBarView.java

Still need to modify:

Still need to add:

Change-Id: I04b0d8de721f00d4e95b1b80e60639229ab70623

Recents: Clear all button for recent apps.

An icon will appear on navbar when there are apps available to be killed on recent apps.

Credits to @BigBrother1984 for kitkat porting from jellybean

Patchset 2: Tablet mode is deprecated now, so no need of multiple callbacks
Patchset 3: Remove copyright from unaffected files
Patchset 4: Remove unused imports

Change-Id: I93d1d4cb34325190b03ae3a0d40e1bc170c92d91

Conflicts:
	core/java/android/app/StatusBarManager.java
	packages/SystemUI/res/drawable-xhdpi/ic_sysbar_recent_clear_land.png
	packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
	packages/SystemUI/src/com/android/systemui/recent/RecentsPanelView.java
	packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

NavBar commits part 2 [wip]

Change-Id: Ibd4cda692a7a96ff195f54aed47f590524f99d16

PIE 2.0

Pie is an alternative navigation and system info interface. It replaces the
standard navbar/statusbar with a navigation arc decorated with statusbar info.

Important notes for developers:
* When PIE is enabled apps don't even have to support immersive mode, they just have
  to check for configuration updates (sadly not even this is done by all apps).
  When PIE is disabled, apps have to setup an "onSystemUiVisibilityChangeListener"
  (best practice for PIE enabled, too).
* Changed how ActivityInfo handles apps capabilities like recalculate screen
  size etc. Check code comment(s).

Some info:
* Quicksettings and notification panels are not available anymore, google now
  replace swipe up gesture.
* Switched to kitkat colors.
* General improvement to the code, reorganize classes.
* Cleanup a lot and remove useless code.
* Merge with immersive mode, they live in a homogenized state.
* Improve immersive code a bit.
* Upon first activation, toggling immersive tile, the user is presented with a dialog asking
  to enable or disable the feature. The preference can be resetted in "Backup & restore" in settings.
* Reduce and center its trigger area.
* While pie is triggered screen is keept on.
* Depending on immersive mode, will show full or lite pie.
* New circled snap points.
* Detach pie on every rotation and/or when screen goes off while you have it triggered.
* What else, what some slices?

Key contributors:
@BigBrother1984
@D4rKn3sSyS
@Anu6is
@David96
@drcmda

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Signed-off-by: Jesus David <jesdga95@gmail.com>
Signed-off-by: Curtis Mayers <curtis.mayers@gmail.com>
Signed-off-by: David L.-W. <david.leppla.weber@gmail.com>
Signed-off-by: Paul Henschel <drcmda@gmail.com>
Change-Id: I6d09b1e2124d14e6cec48b40ea0c7948ebbb02b3

Conflicts:
	core/java/android/content/pm/ActivityInfo.java
	core/java/android/provider/Settings.java
	packages/SystemUI/res/values/pa_dimens.xml
	packages/SystemUI/res/values/pa_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
	packages/SystemUI/src/com/android/systemui/statusbar/pie/PieControlPanel.java
	packages/SystemUI/src/com/android/systemui/statusbar/pie/PieController.java
	packages/SystemUI/src/com/android/systemui/statusbar/pie/PieHelper.java
	packages/SystemUI/src/com/android/systemui/statusbar/pie/PieItem.java
	packages/SystemUI/src/com/android/systemui/statusbar/pie/PieMenu.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

[1/2] Frameworks: Add in-the-spot user preference dialog

This is a new way to setup your device, more intuitively, without diving into a sea of a hundred of menus
The basic idea is taken from TouchWiz roms (here: http://goo.gl/W40rF6)
Also create a helper class for implementing this easier all around the ROM and implement it for first time on Quick Pull down

Drawables by Arz Bhatia

PS2: Code style fixes

Change-Id: I95695a8cbbfea7740b6417ff9ba9ef84e0b7cdd7

Conflicts:
	core/java/android/provider/Settings.java
	core/res/res/values-es/pa_strings.xml
	core/res/res/values/pa_strings.xml
	core/res/res/values/pa_symbols.xml
	packages/SystemUI/res/values-es/pa_strings.xml
	packages/SystemUI/res/values/pa_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java

Fix up Pie; clean up Recents and other stuff

Change-Id: I39aec77be0b455530ae7ee54aa6fd1bf82ea00db
Merge branch 'pie' into kitkat
Merge branch 'kitkat' of https://github.com/TeamHorizon/platform_frameworks_base into kitkat

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Change-Id: Ib572f8cbc85217a4ddee9a5fb4f9eafef3764efb