summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLuis Vidal <lvidal@cyngn.com>2016-01-08 23:37:19 (GMT)
committerLuis Vidal <lvidal@cyngn.com>2016-01-08 23:37:19 (GMT)
commitcd4830091a6396571fcce9668b27d48d11f6c0b2 (patch)
treecad4fe99f90bfa78286d82bd32bb387e0c03d5d8 /src
parent5470255aec5c8aaaaddd5980f3f027f3e6ddf444 (diff)
downloadandroid_packages_providers_ThemesProvider-cd4830091a6396571fcce9668b27d48d11f6c0b2.zip
android_packages_providers_ThemesProvider-cd4830091a6396571fcce9668b27d48d11f6c0b2.tar.gz
android_packages_providers_ThemesProvider-cd4830091a6396571fcce9668b27d48d11f6c0b2.tar.bz2
Guard to prevent inserting a record twice when a new theme is installed
When the theme has very few components, ACTION_THEME_RESOURCES_CACHED might be broadcasted before ACTION_PACKAGE_ADDED. This patch will prevent trying to insert a record twice. Change-Id: Ib7764707dcd59af731b3ea083b583e2c83eb6acf
Diffstat (limited to 'src')
-rw-r--r--src/org/cyanogenmod/themes/provider/AppReceiver.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/cyanogenmod/themes/provider/AppReceiver.java b/src/org/cyanogenmod/themes/provider/AppReceiver.java
index 1db9dde..dccba21 100644
--- a/src/org/cyanogenmod/themes/provider/AppReceiver.java
+++ b/src/org/cyanogenmod/themes/provider/AppReceiver.java
@@ -36,7 +36,8 @@ public class AppReceiver extends BroadcastReceiver {
try {
// All themes/icon packs go to the theme service for processing now so assume
// isProcessing is always true when installing/replacing
- if (Intent.ACTION_PACKAGE_ADDED.equals(action) && !isReplacing) {
+ if (Intent.ACTION_PACKAGE_ADDED.equals(action) && !isReplacing
+ && !ProviderUtils.themeExistsInProvider(context, pkgName)) {
ThemePackageHelper.insertPackage(context, pkgName, true);
} else if (Intent.ACTION_PACKAGE_FULLY_REMOVED.equals(action)) {
ThemePackageHelper.removePackage(context, pkgName);