ActiveDisplay: some code fixups & improvements

- fix a race condition that was making strange things happen
- general code fixups
- don't process code for redisplaying notifications if in quiet hours

Change-Id: I9fc878da4db52dec74397f803c4e245c385edf37
Frameworks: notify arrayadapter early that data has changed on clear all

Recent clear all. Current behaviour is that we do not update the array adapter at all
due that it gets rebuild on next reload. But in very rare cases it happens that getView
want to update shortly after all is cleared althought the view is not visible anymore.

Whatever just call notifyDataSetChanged after List is cleared to work against it.

Change-Id: I61ca25358ebe164336ba349565459537861c5495
Frameworks: do not kill favorite recent apps

Due of a lot user requests and I basically like the idea (not a fan of clear all apps at all
due that it does not make sense android wise) we ehance the favorite recent apps feature.

This commit basically does not remove the apps from the task list which were marked from the user
as favorite.

3 possibilities:

- No favorites are in the task list - clear all behaves like it was before - all tasks cleared and panel closes

- favorites and non favorites are in the task list - clear all removes all non favorite tasks and favorite tasks stay.
  Yes without fancy animations....we want to be fast ;) - panel stays open

- only favorites are in the list - pinch to zoom out is blocked due that nothing is there to clear all.

single clear of a task with swipe behaves in all cases normal like it was before this change

Change-Id: Ia05562e0f59dfb023aa65ec3a40dd951594dc88e
Frameworks: fix possible NPE + and missing expandable panel correction

Thanks Jorge for pointing it out. This version is way nicer.

Change-Id: I7a65a05ef533c90cbfc68d4de996eae7a0ff66b7
Status Bar Color [1/2]

AICP:
Modified for AICP source

Change-Id: I7c66b9b8bc0d733141b28d78324986ad6a27dac2
Keyguard: disable statusbar clock for dashclock, lockclock and desclock

afaik this was an original commit from Danesh and we extended it later.
Whatever thanks to him in this case :)

Change-Id: I67a370b0a76f938fa3e022e8c467f2d6ebca87c0
[1/2] base: battery light settings

This also adds a new "level" for 100% full battery
to get rid of the comments from people who complain
that 90% is shown as full :)

required overlay:
    <!-- Is the battery LED intrusive? Used to decide if there should be a disable option -->
    <bool name="config_intrusiveBatteryLed">true</bool>

    This will enable if the battery light option is shown in settings

    <!-- Does the battery LED support multiple colors? Used to decide if the user can change the colors -->
    <bool name="config_multiColorBatteryLed">true</bool>

    Also set this for devices like the HTC one which has only
    two colors. This will be handled in the color selction dialog.
    Dont set if for devices like flo which only has white led

Change-Id: I6a173d19b4e1135174de73a9f528a61d81eb50da
Battery led needs to respect quiet hours

Modified from @kufikugel patch for AICP

Change-Id: I1e8b5ca7138bdb54cd254ee07e8e08a53bef35b9
Don't register methods when there's nothing to register.

Change-Id: I6d0233f79bb90089426d702b4076ec5750e82475
Prevent Lockscreen album art from activating FLAG_KEEP_SCREEN_ON

This is a small fix to the showWallpaper method, in which a power
consumption problem has been introduced. This showWallpaper method
toggles the window flag FLAG_SHOW_WALLPAPER, when album art is being
shown in Lockscreen. It is important to set pixel format to
PixelFormat.OPAQUE if flag FLAG_SHOW_WALLPAPER is not being set.

If not, an application that uses window flag FLAG_KEEP_SCREEN_ON
will prevent the keyguard from going to sleep and drain battery.

Change-Id: I1808be28047977ae5ac4dd1168ea25cac8a55a78
Get rid of noise during boot.

This log is not an error, it is a warning, don't spam a stack
crawl when it happens.

Change-Id: I6038e3625cc0c16af9e54887b5e7ec451d9f864d
Fix STE "OK Google"

Thanks @C457 and @Meticulus

Change-Id: Id0ddff1cde4f94c408261cb66be6ca14604e76b9
storage: allow swapping primary storage for apps

Advanced storage settings patch series:
[1/4] vold: allow swapped storage paths at vold init
      http://review.cyanogenmod.org/56515
[2/4] Advanced storage: vold swap storage paths
      http://review.cyanogenmod.org/56516
[3/4] storage: allow swapping primary storage for apps
      http://review.cyanogenmod.org/56950
[4/4] Advanced storage: swap primary storage for apps
      http://review.cyanogenmod.org/56951

By setting the persistent system property
 persist.sys.env.switchexternal=1
the primary device for applications storage will be reported as
/storage/sdcard1. This method currently only works with non-emulated
storage. The path swapping will probably have to be relocated within
getExternalStorage() and other functions emulated storage swap to work.

Change-Id: Ie091eb632280c2dbfd00bbf5f9b0b09be0239234
Add needed @hide to some fields and methods

Change-Id: I1a04c737358052c39163ec923fdf4c8476d2d7f7
Proper quiet hours + Battery LED fix

Change-Id: I1251f9e7ad7e047dd2e669a9b7d04b2ef41e8156
Merge "Fix STE "OK Google"" into kitkat
Merge "storage: allow swapping primary storage for apps" into kitkat
ConnectivtyService : Execute connectivityCheck in thread pool

Since this async task takes long when doing things like waiting for
network connectivity...etc, rather than holding up the single executor
of async task for the framework (app_process), run it on a thread from
the pool so other tasks can execute in parallel.

Change-Id: I7b88a4837c7e117ef47014a20c57f828b811edfb
Merge "ConnectivtyService : Execute connectivityCheck in thread pool" into kitkat
Statusbar: Time and Date actions

Clicking on the Time will open the alarm

Clicking on the Date will open the calendar

...I feel that this is more functional than chaning the time...

Inspired from cm

Source - https://gerrit.omnirom.org/#/c/2292/ (Patchset 2)

AICP:
Modified for AICP source
Fixed nongpress for clock that never worked before

Change-Id: I1ab72ec06fe111cac9ea16d21cd73b78580329ea