Configurable recents [1/2]

This allows the user to choose between default, sidebar recents, and omniswitch.

Since the grammar in the comments and coding style of the classes introduced by
slimrecents is clearly not that of the commit's author and we aren't affiliated with
or a kang of slim rom's source i've changed the name to Sidebar recents. The class naming
in the source remains the same and links to the original commits and work done by slim
and omni are listed in the squash history below.  Changes introduced for vanir are mostly
for compatibility and smooth operation at this point.  All credit goes to the authors of
these features-- whoever they may be.

All work done to port slimrecents to vanir was done by Cory Collins.  Thanks for the hard
work bro.

commit b727a522257f67da10df139f27399b9b5f5a6bb7
Author: PrimeDirective <activethrasher00@gmail.com>
Date:   Sat Jun 14 19:05:04 2014 -0400

    Rejigger recents key shooting blanks if OmniSwitch wasn't started

    wtf was this for?  the button won't do anything in both cases.

    Change-Id: I55772dac11529149c411ad8017ffe8a2e2090557

commit c54014f80ba0ee1b8242f59241ef648be036504c
Author: maxwen <max.weninger@gmail.com>
Date:   Tue Feb 4 00:59:36 2014 +0100

    [1/3] base: omniswitch as default recents

    OmniSwitch provides broadcast events for showing
    and hiding the overlay

    We need to make sure that OmniSwitch service is really
    running else we will get no recents at all. Also on startup
    it will take some time until the OmnISwitch service
    has been started.

    OmniSwitch will send a service start and stop broadcast
    that will guard the usage of OmnSwitch

    Change-Id: I31c5ae8839603b6e92b1a4613c793a9427aad2e2
    Signed-off-by: Dan Trifan <jimsth@gmail.com>

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

commit bbb531da59e45b85ac5e545068e8be49c3ba0e13
Author: PrimeDirective <activethrasher00@gmail.com>
Date:   Sat Jun 14 17:09:23 2014 -0400

    remove a bunch of fuckass coding for toggling AOSP and the sidebar recents

    don't add both recents containers. we only need one at a time.  stop doing getInt for
    every. single. recent. action.  further efficiency improvements.

    Change-Id: I2401ea814215a2c286eb91d530383193bfbd59a8

commit 9d6349a9864b2f4878268aa518d418415a45bbbf
Author: Lars Greiss <kufikugel@googlemail.com>
Date:   Wed Feb 19 07:43:38 2014 +0100

    [1/2] Frameworks: Slim recent app screen

    Squashed following commits:
    https://github.com/SlimRoms/frameworks_base/commit/72ce3bbd3a117572e85a9837eceaaca191c86f3a
    https://github.com/SlimRoms/frameworks_base/commit/fb32d4cb2303e354fadb5ecc3d12d223edf40c3b
    https://github.com/SlimRoms/frameworks_base/commit/0347f610f048699157af5b958729a76dcc8f09c7
    https://github.com/SlimRoms/frameworks_base/commit/c6deddcaa57de4b418f8e1eee607b45b99c1671d
    https://github.com/SlimRoms/frameworks_base/commit/d0f982c4a9d551a9b76c55a7c8e9150cb650c085
    https://github.com/SlimRoms/frameworks_base/commit/247961e595003c7b62f8acd5d1074585b5421b03
    https://github.com/SlimRoms/frameworks_base/commit/64f9878a99b7574cb9130bf17b50ffd24213a59f
    https://github.com/SlimRoms/frameworks_base/commit/d2a76f297efe0285ac53e8fc63c45fbad131d2a4
    https://github.com/SlimRoms/frameworks_base/commit/4d10958b149a99bf6fb76f904b7f2f14dfd68aaa
    https://github.com/SlimRoms/frameworks_base/commit/9398710a50b9dd78ba70064b8b699e6c87e2f86f
    https://github.com/SlimRoms/frameworks_base/commit/cc525c326f61f741917af841041f736992028405
    https://github.com/SlimRoms/frameworks_base/commit/6c7aa01ec52ec527fd7b0fba64edbe065993c9d3
    https://github.com/SlimRoms/frameworks_base/commit/7a31a8ae898caaaa64b737d757d8d98354171e72
    https://github.com/SlimRoms/frameworks_base/commit/7a4bec9f252ba4a0b480099c6239487ad2be95d0
    https://github.com/SlimRoms/frameworks_base/commit/2fd00cd9763af1015cb293396c07903140b431a1
    https://github.com/SlimRoms/frameworks_base/commit/57225cb22f7dad525e0d7dc0d8b7299d79011cea
    https://github.com/SlimRoms/frameworks_base/commit/5346e34b9f38f6668f757bc0235e9f9f999b12f7
    https://github.com/SlimRoms/frameworks_base/commit/5ee18d5e1ef06cc7c4d21aac7bf938d03bfc9476

    One of the parts on AOSP google missed to update/improve in the last
    couple of releases is the recent app screen to allow better and faster
    multitasking. I had always a special vision how it could/should look
    and gives the user a faster workflow.

    This commit is now our new recent screen. It is a complete new implementation
    and replaces googles AOSP recent app screen. The code changes in the base itself
    are quiet miniml to call the new recent screen.

    Some notes:

    1. This patch needs a new repo: frameworks_opt_cards which is a central repo
       to get any kind of googles cards style. Thanks Gabrielle Mariotti a ton who
       made the base for this library and hellped a lot out.  We just fixed together with him some parts
       and mad it useable as AOSP central library. So we can use it later for other
       changes as well

    2. Preload needs to work 100%. So it is needed to check that the calling parts
       (like hw key rebinding, pie, navigation bar) do a proper preload. If they do not
       recent screen will just not show up. To follow what they are doing you can enable
       debug in RecentController.java which exactly shows what was called.

    Some notes to the patch itself:

    - Recent app  screen slides from the right edge into the screen

    - Show recent apps in new google card style. Most recent apps show
      expanded with the app screenshot. Other are collapsed. Of course
      the user can change expanded/collapse of each app during the session where the state
      will be restored on next access.

    - Compared to AOSP recents we do a 3 stage loading
      1. step: preload the task list and build or update the cards (does not load any content at this point)
      2. step: User actually toggled the recent screen....icons, text and screenshot thumbnail which will get visible are loaded now
      3. step: Recent screen is fully animated in. All other non visible content at this time are loaded now.
      This allows a smooth experience for the user and a minimal load on the first 2 steps. Especially important due that we handle
      a lot animations which are very picky when it comes to background loads. last 2 steps are async multithreaded loading tasks.

    - We are using for the app icons and thumbnails a bitmap LRU cache controller to have fast access to the bitmaps we need. This improves especially
      the scrolling and as well the loading time due that allready loaded app icons are holded in the LRU cache.

    - Theme support is included as well for all items the recent screen has

    - Most important point: Way faster workflow now. The recent screen neither freezes the underlaying app nor it does interrupt the current process the
      user is in. It just slides over the current app about 40% of the screen. Back button as well just an outside touch (which will be passed trough to the app)
      allows to immediatelly go ahead in your workflow.

    - Normal click opens an app, longpress opens app detail screen (note: we have only one hidden action on our current recents. If we later decide there could be
      other actions as well...showing a google card menu button on the top right is a very easy task and allready provided from the frameworks_opt_cards lib)
      swipe left or right removes the app from the current tasks

    - Pinch to zoom out gesture provides the ability to remove all tasks with a big red warning!!

    - All above mentioned actions are animated.

    - As usual it is multiDpi compatible

    - A lot work went into the optimizing especially for low end non gfx devices where animations
      as well listview scrolling is not that easy. We got the maximum out of optimization here which
      gives acceptable results on low end devices and amazing one on the gfx capable devices.

    - A small side note this patch contains as well a fix on navigation bar preload.

    Thats the short description.....user need to see it to get the real benefits of this new way.

    cheers

    kufi

    ----------------------------------

    Modifications by codex-corp

    SlimRecent: Make it optional [1/2]

    https://github.com/AOSB/android_frameworks_base/commit/dbb5540884826786bfec9f7ea42a515a09c4094e

    Conflicts:
    	core/java/android/provider/Settings.java
    	core/res/res/values/mahdi_symbols.xml
    	packages/SystemUI/Android.mk
    	packages/SystemUI/res/values/mahdi_colors.xml
    	packages/SystemUI/res/values/mahdi_dimens.xml
    	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
    	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

    Change-Id: Ic31b399ecbb933b772979da25797b1f6daf6131f

    Conflicts:
    	core/java/android/provider/Settings.java
    	packages/SystemUI/res/values/vanir_dimens.xml
    	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
    	tools/layoutlib/bridge/src/android/view/IWindowManagerImpl.java

Change-Id: I27415d85627d35180f4cc8c6057252042baeb846
CustomRecents: Add a constants class for the mode enumeration, and leverage RecentsComponent to commonize slim and aosp recents in BaseStatusBar

Change-Id: I1900dbefde8a6badc9258f7b71276a504fe22e99
This is why we can't have nice things... dirt from CustomRecents

Change-Id: Ia4c830a9cbfbb791f0d2b9419fad72f81752d69e