summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authord34d <clark@cyngn.com>2015-05-26 20:05:07 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2015-05-26 22:21:06 (GMT)
commitb83a558be9b40d46dbcf40666550d8b2cc29fb3e (patch)
tree50a86c07c031df06c79babf42c26b10d75152e96 /src
parentbb432a101f6329a543f3be3b0cb4067f07ff2d70 (diff)
downloadandroid_packages_providers_ThemesProvider-b83a558be9b40d46dbcf40666550d8b2cc29fb3e.zip
android_packages_providers_ThemesProvider-b83a558be9b40d46dbcf40666550d8b2cc29fb3e.tar.gz
android_packages_providers_ThemesProvider-b83a558be9b40d46dbcf40666550d8b2cc29fb3e.tar.bz2
Check old install state before reapplying icon pack
We only want to reapply an icon pack if the old state was UPDATING and the new state is INSTALLED. Other combinations should not trigger the reapply code. Change-Id: I6ba90341795eed365211ac2b29239e47842d62be
Diffstat (limited to 'src')
-rw-r--r--src/org/cyanogenmod/themes/provider/ThemePackageHelper.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java b/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java
index 3c4ddaf..83e8e19 100644
--- a/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java
+++ b/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java
@@ -224,9 +224,14 @@ public class ThemePackageHelper {
String[] args = { pi.packageName };
context.getContentResolver().update(ThemesColumns.CONTENT_URI, values, where, args);
- if (!isProcessing) {
- // We should reapply any components that are currently applied for this theme.
- reapplyInstalledComponentsForTheme(context, pi.packageName);
+ final int oldInstallState =
+ ProviderUtils.getInstallStateForTheme(context, pi.packageName);
+ final int newState = isProcessing ? InstallState.UPDATING : InstallState.INSTALLED;
+ if (newState == ThemesColumns.InstallState.INSTALLED) {
+ if (oldInstallState == ThemesColumns.InstallState.UPDATING) {
+ // We should reapply any components that are currently applied for this theme.
+ reapplyInstalledComponentsForTheme(context, pi.packageName);
+ }
}
}