OmniSwitch: fix IndexOutOfBoundsException

This might not be the final solution but for now
fix the crash

05 17:54:17.560 E/AndroidRuntime(18708): java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
04-05 17:54:17.560 E/AndroidRuntime(18708):     at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
04-05 17:54:17.560 E/AndroidRuntime(18708):     at java.util.ArrayList.get(ArrayList.java:308)
04-05 17:54:17.560 E/AndroidRuntime(18708):     at android.widget.ArrayAdapter.getItem(ArrayAdapter.java:337)
04-05 17:54:17.560 E/AndroidRuntime(18708):     at org.omnirom.omniswitch.ui.SwitchLayout.onDismiss(SwitchLayout.java:326)
04-05 17:54:17.560 E/AndroidRuntime(18708):     at org.omnirom.omniswitch.ui.SwipeDismissHorizontalListViewTouchListener.onAnimationEnd(SwipeDismissHorizontalListViewTouchListener.java:408)
04-05 17:54:17.560 E/AndroidRuntime(18708):     at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1056)
04-05 17:54:17.560 E/AndroidRuntime(18708):     at android.animation.ValueAnimator.access00(ValueAnimator.java:50)

Change-Id: Iea4e5f8883b9d291091a901ff94637b11c3c5b0f
OmniSwitch: fixes for handling disabled apps

Disabling apps is not sending a removed intent so make
sure we remove disabled apps from favorites on next update.
Also listen to PACKAGE_CHANGED to update package list
in that case and only if service is really running.

Change-Id: I73838d21f3e21988afd195df3cde59f862bc3ac2
OmniSwitch: quick switcher

-added back button support
-added quick switcher settings
-added quick switcher button config

PS10:
-fixed division by zero - thanks Juan
-added item limit preference

PS11:
-quick switcher depends on drag handle
-fix drag handle switch
-next try - division by zero fix - thanks Menno

PS12:
-fixed timing issue - thanks Cory

PS13:
-added showcase for quick switcher
-remove start and stop service broadcaset and
INTERACT_ACROSS_USERS_FULL permissions since we dont
need it anymore with the simplified recents integration
requires https://gerrit.omnirom.org/6953
-listem to ACTION_SHUTDOWN intent to save local prefs
-fixed back key handling

PS14:
-added ordering support for action buttons - coudnt resist :)

PS15:
-tweaking horizontal scroller

PS16:
-uprev version

Change-Id: I845598bb706089c788e8d829d7d4ebfb7928eb73
OmniSwitch: Immersive mode button

PS13:
-make image a little bit smaller to match the rest
-cleanup

PS14:
-more cleanup

Change-Id: Ief338c252f0c7b9819040a48cc374d1f208854cc
OmniSwitch: FR translation

PS2-4: rebase and add translation
PS5: correction

Change-Id: I69737662768f122aa72f5962106df1a8298c167b
OmniSwitch: center action buttons again

Change-Id: Ida6292d1cdcab26094f49b8fa06877caf5795bc7
OmniSwitch: Add IT-Translation

 1.Update
 2.Fix error

Change-Id: Ia733fc2713e0c8c7215e1e75d5229a3c9e40ab7b
OmniSwitch: CA translation

Change-Id: Ie39e05c28d5013d7b65f3544c1a3c271e79ef9ec
OmniSwitch: ES translation

Change-Id: I2cf680b91a0ee89da6ebe854c0bfb8ec951c18e7
OmniSwitch: cleanup and bugfixes

-enhanced favorite handling
-disable debug by default
-added hu translation
-support color picker dialog rotation
-added FavoritePreference
-adapted landscape size calculation
-minor fixes

Change-Id: I1ab416c7a573e903a2dd884069bd61f58fff1f9d
OmniSwitch: FR translation

Change-Id: I58382b1ffd998b0b90e6d57815dfa0dd75b798dc
OmniSwitch: Es translation

Change-Id: Ia5de87cd32f1d210e4cf906575cf06b6f12f8ff0
OmniSwitch: rework scroller fling

Make fling faster and smoother

Change-Id: Iadbad3957d88bf3100d3ff86f86ef18aed427743
OmniSwitch: update CA translations

Change-Id: I8d91c927382753669a6bc26facac1d2869abe3d8
Fix CA translations. This was breaking builds.

Change-Id: Ic6517613d7e0671ac4741bceba0bc53090eb5e8e
OmniSwitch: fix quick switcher derps

-make sure quick switcher update can not happen after finger leave
-correctly respect disabled quick switcher

Change-Id: I1269c16129e900093df206cd5c4e4ebb8febfd21
OmniSwitch: Update RU translations

Change-Id: I1f7b82bef945f0fd136b91ca89d2772db24d2265
OmniSwitch: rework image handling

-use LruCache
-added default thumb handling
-dont store package icon again
-added matching of task intents with package intents for
adding to favorites
-fix ListAdapter derp

Change-Id: I5b3e7b3e892afb825206683438cbe1c12c4ae0e2
OmniSwitch: added flat style

Change-Id: Ieee317ebe398f076840a55bbfb5eca113a213f6c
OmniSwitch: FR translation

Change-Id: I42ac7d35b4e51b2c84f2ddfb057461a63cba0a30