summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLuis Vidal <lvidal@cyngn.com>2016-01-29 22:29:02 (GMT)
committerLuis Vidal <lvidal@cyngn.com>2016-01-29 22:29:02 (GMT)
commit767ac8cd0c8859e1c8a647250253c3f4cf60a663 (patch)
tree9c216152fb9826a08adf8b970aaa0d4b0d929b0e /src
parent0bc8edadecaaabf6d132cd87c263ccf15eba575a (diff)
downloadandroid_packages_providers_ThemesProvider-767ac8cd0c8859e1c8a647250253c3f4cf60a663.zip
android_packages_providers_ThemesProvider-767ac8cd0c8859e1c8a647250253c3f4cf60a663.tar.gz
android_packages_providers_ThemesProvider-767ac8cd0c8859e1c8a647250253c3f4cf60a663.tar.bz2
Prevents extra thumbnails in Lockscreen component
Add extra parenthesis when the preview selection is modified to prevent grouping the component id in the where clause. Without this patch, multiple "ghost" thumbnails are displayed in the lock screen selector when a theme includes multiple wallpapers. This patch will also prevent the WallpaperPreviewGenerator from overriding the wallpaper thumbnail with the lock screen wallpaper. Change-Id: I7215a22168073dce99b13a52c2fd780ff6c44a0d TICKET: CYNGNOS-1758
Diffstat (limited to 'src')
-rw-r--r--src/org/cyanogenmod/themes/provider/util/ProviderUtils.java5
-rw-r--r--src/org/cyanogenmod/themes/provider/util/WallpaperPreviewGenerator.java2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/org/cyanogenmod/themes/provider/util/ProviderUtils.java b/src/org/cyanogenmod/themes/provider/util/ProviderUtils.java
index 66db924..59b3d2e 100644
--- a/src/org/cyanogenmod/themes/provider/util/ProviderUtils.java
+++ b/src/org/cyanogenmod/themes/provider/util/ProviderUtils.java
@@ -146,7 +146,7 @@ public class ProviderUtils {
String newSelection = "";
if (!TextUtils.isEmpty(selection)) {
- newSelection += selection;
+ newSelection += "(" + selection;
}
List<String> projectionItems = getPreviewProjectionItems(projection);
if (projectionItems != null && projectionItems.size() > 0) {
@@ -162,6 +162,9 @@ public class ProviderUtils {
}
newSelection += ")";
}
+ if (!TextUtils.isEmpty(selection)) {
+ newSelection += ")";
+ }
return newSelection;
}
diff --git a/src/org/cyanogenmod/themes/provider/util/WallpaperPreviewGenerator.java b/src/org/cyanogenmod/themes/provider/util/WallpaperPreviewGenerator.java
index 0e90f48..f1a040c 100644
--- a/src/org/cyanogenmod/themes/provider/util/WallpaperPreviewGenerator.java
+++ b/src/org/cyanogenmod/themes/provider/util/WallpaperPreviewGenerator.java
@@ -120,7 +120,7 @@ public class WallpaperPreviewGenerator {
Bitmap thumbnail = Bitmap.createScaledBitmap(preview, mThumbnailSize, mThumbnailSize,
true);
filePrefix = isLockWallpaper ? PreviewColumns.LOCK_WALLPAPER_THUMBNAIL :
- PreviewColumns.LOCK_WALLPAPER_THUMBNAIL;
+ PreviewColumns.WALLPAPER_THUMBNAIL;
fileName = filePrefix + componentID;
item.thumbnailPath = PreviewUtils.compressAndSavePng(thumbnail, baseDir, pkgName,
fileName);