Fix crash while installing themes rapidly

A theme can be installed on a PM or theme service thread.
If multiple themes are being installed at once and one of
those themes happens to be part of the boot config, then
two themes will try to be installed at the same time. This
causes problems with files like the temp AndroidManfiest.xml
which are not designed to be multi-thread safe.

This patch fixes the issue by making sure a theme is
never installed in a PM thread except during boot.

Change-Id: Ic9a0ffe43d0199a2a893579f3d2dbb6d9340e7b4
ThemeManager: Synchronize access to listeners

If the Set of listeners is modified while iterating we will get
a ConcurentModificationException so we need to synchronize access
to avoid this.

Change-Id: Ib521ad86a665316d707463200c16c1bcdcfac362
Revert "Themes: Build icon cache when applying icons"

This reverts commit 7bb802a478faaac295ccd8b98a3573701edd9b1e.

This is not thread safe.  It is possible for an icon to be in the
middle of being composed when another process requests it.  That
process would not be able to load the image.  In Trebuchet, the
icon would be displayed as the standard "android" icon since it
would not be able to load the icon.

Change-Id: Id9bc38296cc02c376f9ea66565babc00e8dbf634
Protect windowNoTitle and windowActionBar attributes

This patch creates a new method to define "protected" attributes. These
are attributes like windowActionBar which should not be modified by
a theme.

Some apps (eg gmail) use the appcompat library which
has its own Actionbar classes. When an app uses its own
Actionbar it must not include the default actionbar which is
achieved through the windowActionBar attribute.

Some themes may try to change these attributes, which can will cause
the app to crash.

Change-Id: Ie3bb7285eed09f3f13facf9d142ea9eb83796eec
Themes: Handle processing themes in separate thread

If themes are being processed and the user attempts to apply a theme
they will be forced to wait for themes to finish processing before
the theme is applied.  This patch moves processing of theme resources
into a separate handler/thread.

Change-Id: Ib30a1be75915364c2867df04d63700be63c9f2c5
Pass all theme apks to themeservice for processing

3rd party apps expect ACTION_THEME_RESOURCES_CACHED once a theme is installed
regardless of the contents of the theme.

Previously only packages with overlays were passed to the themeservice
for resource processing. The result was packages without overlays would
install and ACTION_THEME_RESOURCES_CACHED would never be broadcasted.

Change-Id: I7cf3f8267805ef2a0626b2690b708e7bbae46bcc
Themes: Remove an app's icons from cache when installing

If an app is being updated then its icons will exist in cache. Go ahead
and delete them so that they can be recreated.

Change-Id: If0ee4388efd4aa146ebcdc46b1b0742f0852bad3