summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authord34d <clark@cyngn.com>2015-02-15 21:24:02 (GMT)
committerd34d <clark@cyngn.com>2015-02-16 00:52:38 (GMT)
commit063f22008221b93306210095974bc5a5e306e1cc (patch)
tree53a1623d1e6260ce7d8f98d18eae2a4a172c7168 /src
parent9fe79722e7ee3d0e1ea568655589e39c8eabb8a7 (diff)
downloadandroid_packages_providers_ThemesProvider-063f22008221b93306210095974bc5a5e306e1cc.zip
android_packages_providers_ThemesProvider-063f22008221b93306210095974bc5a5e306e1cc.tar.gz
android_packages_providers_ThemesProvider-063f22008221b93306210095974bc5a5e306e1cc.tar.bz2
Don't update package while resources are being processed
ThemePackageHelper.updatePackage() will call theme service to reapply a theme if it has been updated and currently applied. This should not happen until the the resources are ready to be re-attached to all running apps. Change-Id: Ieff6cfccae01fb336468416949e7ff3d87cd7699
Diffstat (limited to 'src')
-rw-r--r--src/org/cyanogenmod/themes/provider/AppReceiver.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/org/cyanogenmod/themes/provider/AppReceiver.java b/src/org/cyanogenmod/themes/provider/AppReceiver.java
index fc9376f..d979c96 100644
--- a/src/org/cyanogenmod/themes/provider/AppReceiver.java
+++ b/src/org/cyanogenmod/themes/provider/AppReceiver.java
@@ -52,16 +52,16 @@ public class AppReceiver extends BroadcastReceiver {
} else if (Intent.ACTION_PACKAGE_REPLACED.equals(action)) {
final boolean themeProcessing = isThemeBeingProcessed(context, pkgName);
if (themeExistsInProvider(context, pkgName)) {
- ThemePackageHelper.updatePackage(context, pkgName);
+ if (!themeProcessing) ThemePackageHelper.updatePackage(context, pkgName);
} else {
// Edge case where app was not a theme in previous install
ThemePackageHelper.insertPackage(context, pkgName, !themeProcessing);
+ }
- if (themeProcessing) {
- // store this package name so we know it's being processed and it can be
- // added or updated when ACTION_THEME_RESOURCES_CACHED is received
- PreferenceUtils.addThemeBeingProcessed(context, pkgName);
- }
+ if (themeProcessing) {
+ // store this package name so we know it's being processed and it can be
+ // added or updated when ACTION_THEME_RESOURCES_CACHED is received
+ PreferenceUtils.addThemeBeingProcessed(context, pkgName);
}
} else if (Intent.ACTION_THEME_RESOURCES_CACHED.equals(action)) {
final String themePkgName = intent.getStringExtra(Intent.EXTRA_THEME_PACKAGE_NAME);