diff options
author | d34d <clark@cyngn.com> | 2015-03-11 15:05:32 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2015-03-12 16:01:16 +0000 |
commit | 6c29892fc83a43a7f363f56950ac6e7a8423ac91 (patch) | |
tree | fa822f579149c92f7562969f728eb0d7ed401622 /src/org/cyanogenmod/themes/provider/AppReceiver.java | |
parent | cc0e0e1f3d19109cfe2a6ff2e2b616d5b97e90f6 (diff) | |
download | android_packages_providers_ThemesProvider-staging/cm-12.1.tar.gz android_packages_providers_ThemesProvider-staging/cm-12.1.tar.bz2 android_packages_providers_ThemesProvider-staging/cm-12.1.zip |
Themes: Process theme resources after package scanned [2/2]staging/cm-12.1
The provider now assumes that the theme service will process all
themes and icons packs, and then sends the appropriate broadcast
once processing is done for that package.
The preview generator now queries for the theme 's capabilities rather
than rely on that info to be passed in. This is partly due to the
new flow of installing a theme as well as the fact that legacy
icon packs were not having previews generated.
Change-Id: I418debb6f91296107476016367131fac2c3a32ce
Diffstat (limited to 'src/org/cyanogenmod/themes/provider/AppReceiver.java')
-rw-r--r-- | src/org/cyanogenmod/themes/provider/AppReceiver.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/org/cyanogenmod/themes/provider/AppReceiver.java b/src/org/cyanogenmod/themes/provider/AppReceiver.java index 2a6f85a..1db9dde 100644 --- a/src/org/cyanogenmod/themes/provider/AppReceiver.java +++ b/src/org/cyanogenmod/themes/provider/AppReceiver.java @@ -33,20 +33,19 @@ public class AppReceiver extends BroadcastReceiver { final String pkgName = uri != null ? uri.getSchemeSpecificPart() : null; final boolean isReplacing = intent.getExtras().getBoolean(Intent.EXTRA_REPLACING, false); final String action = intent.getAction(); - final boolean themeProcessing; 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) { - themeProcessing = ProviderUtils.isThemeBeingProcessed(context, pkgName); - ThemePackageHelper.insertPackage(context, pkgName, themeProcessing); + ThemePackageHelper.insertPackage(context, pkgName, true); } else if (Intent.ACTION_PACKAGE_FULLY_REMOVED.equals(action)) { ThemePackageHelper.removePackage(context, pkgName); } else if (Intent.ACTION_PACKAGE_REPLACED.equals(action)) { - themeProcessing = ProviderUtils.isThemeBeingProcessed(context, pkgName); if (ProviderUtils.themeExistsInProvider(context, pkgName)) { - ThemePackageHelper.updatePackage(context, pkgName, themeProcessing); + ThemePackageHelper.updatePackage(context, pkgName, true); } else { // Edge case where app was not a theme in previous install - ThemePackageHelper.insertPackage(context, pkgName, themeProcessing); + ThemePackageHelper.insertPackage(context, pkgName, true); } } else if (Intent.ACTION_THEME_RESOURCES_CACHED.equals(action)) { final String themePkgName = intent.getStringExtra(Intent.EXTRA_THEME_PACKAGE_NAME); |