Fix NPE if themeContext is null - round 2

If a theme is uninstalled and timing is perfect, it can happen
that the CopyImageService is trying to get the PackageContext
of a not existing package.

Return from the function if a NameNotFoundException is catched.

Change-Id: I8f4e33d527f78228f9681ac518292364e9269a0c
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
Themes: Add read/write permissions [2/2]

Change-Id: Ie41b1605b5773d651b8ef8f3162791fef5c78cfc
Automatic translation import

Change-Id: I4afb8ee9e6ac3f3f11ff95427bb789f2ee7018c8
Merge "Fix NPE if themeContext is null - round 2" into cm-11.0
Merge "Themes: Add read/write permissions [2/2]" into cm-11.0
Cleanup cached preview images on uninstall

Change-Id: I9267a160fbabeb67ade2f18fdaf8d8c6acc539da
When applied theme is removed, revert to default

Fixes issue where fonts and other resources do not get reverted
properly when an applied theme is uninstalled.

Change-Id: I30c9ea018f8bffc6aff51c5b38ff1e4ec82b7b20
Insert instead of update if theme doesn't exist

This handles the case where an app is being upgraded and previously was
not a theme. and therefore wasn't in the provider.

Change-Id: I7b3f64aed2b78081822cb0f9daf0cbd638e0b15b
Merge "Insert instead of update if theme doesn't exist" into cm-11.0
ThemesProvider: Fix query compilation error

This fixes syntax error when excute the SELECT Clause

06-11 13:45:39.370: E/AndroidRuntime(3359): java.lang.RuntimeException: Unable to start
receiver org.cyanogenmod.themes.provider.AppReceiver: android.database.sqlite.SQLiteException:
near "?": syntax error (code 1): , while compiling: SELECT pkg_name FROM themes WHERE (pkg_name?)

Change-Id: If9857b1db447e8752ddf04ce3f7d2cc84d5b28a5
Automatic translation import

Change-Id: I3d8ee2920861a04e551bc632f2aff48b0733fe7b
Make sure to update theme capabilities.

Change-Id: I42970fd98e629bde8f32d698b67892ba7b8e6965
Reapply theme components when theme updated.

Change-Id: Ia841ae6ef466e0b60016fab47abfe4c1089cc902
Automatic translation import

Change-Id: Iff1e157a03ba5e2335d55cfb75c2962d5511c060
Reapply theme components in a runnable.

We need to give other apps a chance to finish processing the
ACTION_PACKAGE_REPLACED before reapplying the updated theme
components.

An example of this behavior can be seen when a legacy icon pack is
applied and is updated.  Some Google services, such as google play,
FC when this happens.

Change-Id: If526223e6d318b4240fa765abb53dbe61f9ce746
Define reapply delay as a constant

Change-Id: Ifc606b5ca07efeaef428edb7bd464cabcbe5c474
Automatic translation import

Change-Id: I05d09af62f1013fa03df61969428208d5cb00c8a
Revert "Listen for ACTION_PACKAGE_BEING_REMOVED"

This reverts commit 13b9a546c7dee1ca588ef7cbb2f643df85f8f0a0.

Change-Id: Id560c730957484f2ae693f63b4597f275e44aaff
Revert "Reapply theme components in a runnable."

This reverts commit 92f77e77e097e59f9ec8d7bc64324f1987230af6.

Change-Id: I79a7beedb43d097e743a41b0501805cd1afad9d4
Merge branch 'cm-11.0' into stable/cm-11.0