summaryrefslogtreecommitdiffstats
path: root/src/org/cyanogenmod/themes/provider/ThemesProvider.java
diff options
context:
space:
mode:
authord34d <clark@cyngn.com>2015-03-11 15:05:32 -0700
committerGerrit Code Review <gerrit@cyanogenmod.org>2015-03-12 16:01:16 +0000
commit6c29892fc83a43a7f363f56950ac6e7a8423ac91 (patch)
treefa822f579149c92f7562969f728eb0d7ed401622 /src/org/cyanogenmod/themes/provider/ThemesProvider.java
parentcc0e0e1f3d19109cfe2a6ff2e2b616d5b97e90f6 (diff)
downloadandroid_packages_providers_ThemesProvider-6c29892fc83a43a7f363f56950ac6e7a8423ac91.tar.gz
android_packages_providers_ThemesProvider-6c29892fc83a43a7f363f56950ac6e7a8423ac91.tar.bz2
android_packages_providers_ThemesProvider-6c29892fc83a43a7f363f56950ac6e7a8423ac91.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/ThemesProvider.java')
-rw-r--r--src/org/cyanogenmod/themes/provider/ThemesProvider.java43
1 files changed, 8 insertions, 35 deletions
diff --git a/src/org/cyanogenmod/themes/provider/ThemesProvider.java b/src/org/cyanogenmod/themes/provider/ThemesProvider.java
index ed9025c..2d57f73 100644
--- a/src/org/cyanogenmod/themes/provider/ThemesProvider.java
+++ b/src/org/cyanogenmod/themes/provider/ThemesProvider.java
@@ -153,10 +153,10 @@ public class ThemesProvider extends ContentProvider {
long id = 0;
switch (uriType) {
case THEMES:
- boolean processPreviews = true;
+ boolean processPreviews = false;
if (values.containsKey(ThemesColumns.INSTALL_STATE)) {
int state = values.getAsInteger(ThemesColumns.INSTALL_STATE);
- processPreviews = state == ThemesColumns.InstallState.INSTALLING;
+ processPreviews = state == ThemesColumns.InstallState.INSTALLED;
}
id = sqlDB.insert(ThemesOpenHelper.ThemesTable.TABLE_NAME, null, values);
if (processPreviews) {
@@ -164,21 +164,6 @@ public class ThemesProvider extends ContentProvider {
intent.setAction(PreviewGenerationService.ACTION_INSERT);
intent.putExtra(PreviewGenerationService.EXTRA_PKG_NAME,
values.getAsString(ThemesColumns.PKG_NAME));
- Boolean hasSystemUi = values.getAsBoolean(ThemesColumns.MODIFIES_STATUS_BAR);
- intent.putExtra(PreviewGenerationService.EXTRA_HAS_SYSTEMUI,
- hasSystemUi != null && hasSystemUi);
- Boolean hasIcons = values.getAsBoolean(ThemesColumns.MODIFIES_ICONS);
- intent.putExtra(PreviewGenerationService.EXTRA_HAS_ICONS,
- hasIcons != null && hasIcons);
- Boolean hasStyles = values.getAsBoolean(ThemesColumns.MODIFIES_OVERLAYS);
- intent.putExtra(PreviewGenerationService.EXTRA_HAS_STYLES,
- hasStyles != null && hasStyles);
- Boolean hasWallpaper = values.getAsBoolean(ThemesColumns.MODIFIES_LAUNCHER);
- intent.putExtra(PreviewGenerationService.EXTRA_HAS_WALLPAPER,
- hasWallpaper != null && hasWallpaper);
- Boolean hasBootAni = values.getAsBoolean(ThemesColumns.MODIFIES_BOOT_ANIM);
- intent.putExtra(PreviewGenerationService.EXTRA_HAS_BOOTANIMATION,
- hasBootAni != null && hasBootAni);
getContext().startService(intent);
}
break;
@@ -278,28 +263,16 @@ public class ThemesProvider extends ContentProvider {
case THEMES:
case THEMES_ID:
String pkgName = values.getAsString(ThemesColumns.PKG_NAME);
- final boolean updatePreviews = getShouldUpdatePreviews(sqlDB, pkgName);
+ boolean updatePreviews = false;
+ if (values.containsKey(ThemesColumns.INSTALL_STATE)) {
+ int state = values.getAsInteger(ThemesColumns.INSTALL_STATE);
+ updatePreviews = state == ThemesColumns.InstallState.INSTALLED;
+ }
rowsUpdated = sqlDB.update(ThemesTable.TABLE_NAME, values, selection, selectionArgs);
if (updateNotTriggeredByContentProvider(values) && updatePreviews) {
Intent intent = new Intent(getContext(), PreviewGenerationService.class);
intent.setAction(PreviewGenerationService.ACTION_UPDATE);
- intent.putExtra(PreviewGenerationService.EXTRA_PKG_NAME,
- values.getAsString(ThemesColumns.PKG_NAME));
- Boolean hasSystemUi = values.getAsBoolean(ThemesColumns.MODIFIES_STATUS_BAR);
- intent.putExtra(PreviewGenerationService.EXTRA_HAS_SYSTEMUI,
- hasSystemUi != null && hasSystemUi);
- Boolean hasIcons = values.getAsBoolean(ThemesColumns.MODIFIES_ICONS);
- intent.putExtra(PreviewGenerationService.EXTRA_HAS_ICONS,
- hasIcons != null && hasIcons);
- Boolean hasStyles = values.getAsBoolean(ThemesColumns.MODIFIES_OVERLAYS);
- intent.putExtra(PreviewGenerationService.EXTRA_HAS_STYLES,
- hasStyles != null && hasStyles);
- Boolean hasWallpaper = values.getAsBoolean(ThemesColumns.MODIFIES_LAUNCHER);
- intent.putExtra(PreviewGenerationService.EXTRA_HAS_WALLPAPER,
- hasWallpaper != null && hasWallpaper);
- Boolean hasBootAni = values.getAsBoolean(ThemesColumns.MODIFIES_BOOT_ANIM);
- intent.putExtra(PreviewGenerationService.EXTRA_HAS_BOOTANIMATION,
- hasBootAni != null && hasBootAni);
+ intent.putExtra(PreviewGenerationService.EXTRA_PKG_NAME, pkgName);
getContext().startService(intent);
}
getContext().getContentResolver().notifyChange(uri, null);