listview: ensure active views are filled prior than scrap views

The internal Recycler#fillActiveViews should be called prior to add any view
to the scrapViews queue, so it can be use safely without detaching views
because out of sync.

Change-Id: Ie119ad871a89e0a3fa1e07e955fcd5ca7b171f46
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
hwui: Always enable the scissor while composing layer

Due to scissor optimization feature added in KK, scissor was disabled
all the time. Hence the undefined areas/region of textures are not
masking properly with GL_LINEAR filter mode.

Change-Id: Ifbbde2c67a4c01e45eda07ada709e066255fffcb
CRs-fixed: 645077
CM11 Themes: Add support for composed icons [1/2]

If an icon pack includes background, mask, and/or foreground
images and an icon is not included for a given app, an icon
will be generated using the background, mask and foreground.

Icon packs can include the following items into their
appfilter.xml
    <!-- Set deafult scale factor for the icons -->
    <scale factor="1.0" />

    <!-- Set back image for composed icons -->
    <iconback img="iconback" />

    <!-- Set the mask image for composed icons
         Original icon will be masked off using this mask -->
    <iconmask img="iconmask" />

    <!-- Set foreground image for composed icons -->
    <iconupon img="iconupon" />

Note: Mutliple iconback images can be used as follows
    <iconback img1="iconback1" img2="iconback2" img3="iconback3" />

Change-Id: I0f5fd7de4f0eae485139cbcd282c1d1e1663952f
Themes: Don't set icons for iconpack that is applied.

Change-Id: I3cffade2c12ae1dbc1f75e43f1a74609ff0d7135
Themes: Don't kill launchers that handle the theme change

Change-Id: I5e3a7ea2455a4c407928bb5c90b7fc4e5906aa73
SystemUI: prevent NPE on clear recents double press

Pressing Clear all button twice fast or while the list
is clearing but not yet fully cleared causes sysui to crash due to
mRecentTaskDescriptions being null: (http://pastebin.com/2gRFvf8k)

Workaround it by hiding clear all recents button.

Change-Id: I23d10edfd336041739fe80352ee01987e671dbd7
Floating window: Fix possible NPE

Avoid possible NPE if app provides no interface such as pushbullet's
test notification & other apps which provide one.

Change-Id: I14a0d41de36aaced76c928dc1f22c8a7f3913917
Themes: Add categories to theme change intent.

The following categories are available:

org.cyanogenmod.intent.category.MODS_HOMESCREEN
org.cyanogenmod.intent.category.MODS_LOCKSCREEN
org.cyanogenmod.intent.category.MODS_ICONS
org.cyanogenmod.intent.category.MODS_FONTS
org.cyanogenmod.intent.category.MODS_BOOTANIM
org.cyanogenmod.intent.category.MODS_NOTIFICATIONS
org.cyanogenmod.intent.category.MODS_ALARMS
org.cyanogenmod.intent.category.MODS_RINGTONES
org.cyanogenmod.intent.category.MODS_OVERLAYS

Change-Id: Ic444278d1d712cb6207bb10574a471524a8fed41
Keyguard: Avoid unneeded SIM dialog show() calls

This commit makes the progress dialog's show() get called only once each time the SIM unlock process is started.

It was reported that a phone can be frozen by entering the PIN code for the SIM card "too quickly". This leaves the user with a device on which the screen is filled with a non-cancellable dialog box saying that the SIM card is being unlocked. The logs inform that Keyguard experienced a success and no explicit errors could be seen there and only the dialog stayed around, all leading to believe the issue is with how the progress dialog is being showed and later hidden (or simply dismissed), in which case this show() call reduction might be benefitial.

Change-Id: I5519dd30afcb043e4fc6d08748b296c93bb70589
PEEK: Sensors improvements

- Bring some fixes to the algorithm thanks to @D4rKn3sSyS
- Cleanup

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Change-Id: I5c55fd5136f915d4f7c49006030ea019e3c02fb8
DocumentsUI: Remove catch-all statements

This removes several "catch (Exception)" statements which violates the Android code
style guidelines and hides problems.

I left some catch-all statements in, as they seem to be intended like this (grep for
"catch (Exception").

I suggest we do not merge this before we are sure that we fixed any problems. One problem
is a crash when deleting items (I'm currently working to fix that).

PS 2: Add exception to log.
Change-Id: I483c320c7ee256acd993dd2a509c031fa5e3f09e
DocumentsUI: Handle NPE gracefully

Cherry-picked from OmniROM.

http://jira.omnirom.org/browse/OMNI-956

Change-Id: I8d50d71a9c91486dfc9e5da01538c6b5a626f054
frameworks/Documents: ES translations

Change-Id: I289b56f1b9ecdfe1d37633eb64b24eea5c927d9f
Fix Icon size in DocumentsUI

For XXHDPI devices if you go into Settings/Display and Notification light and select a custom value (application) you will see a GIANT icon.

Before - http://i.imgur.com/DRkua3T.png

After - http://i.imgur.com/f7xW4tY.png

Change-Id: Ia355bddc515906134c8b3b4e67d381aaacceec78
DocumentsUI: DE-Translation (add custom strings)

Change-Id: I3f632829baf221c92322d202f81d240919fdcb28
Replaced custom strings with Android defaults

PS2: also replaced menu_cut/copy/paste with strings from android.R.string

Change-Id: I7695b283faa66c6997fad372b31de2c678d222d0
HOVER: Theme Engine compatibilities and some resources tweaks

Use default notification dimens, avoid setting a custom one.
A bit of cleanup too.

Notifications:
Hardcode dimensions to android defaults. Avoid themes to change them,
Ribbons feature (present on CM based roms mostly) needs that.

Thanks to +John Xionidis to help me trick this out for full CM11 made themes :)

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Change-Id: Iae27bd4d25cba9248db249cb4e07bd88f5c97b02
Fix DocumentsUI FC

Change-Id: I2bfd4ea83db53ee83683a4754b49b15cc2abeaca
Themes: Get resources with an explicit theme attached.

Change-Id: If04e82a13250f520d70b58991586c8ce38f0ecb1
Don't log an error if we cannot open icon hash

The icons will end up being processed if we cannot access the hash
so let's just fail gracefully and silently.

Change-Id: I6368ee9bb47a9d52351fff22283ffac2de625b71