diff options
author | Luis Vidal <lvidal@cyngn.com> | 2016-01-29 14:29:02 -0800 |
---|---|---|
committer | Luis Vidal <lvidal@cyngn.com> | 2016-02-01 11:18:22 -0800 |
commit | ddc2a9720256d449681eb103845b81251e6ca7c6 (patch) | |
tree | 346e1e4d93b2a9c5ee1ceccaae7c70314b78b4ed | |
parent | 12aa9b13dd3d31bbcf8fcb269b90b7134779f973 (diff) | |
download | android_packages_providers_ThemesProvider-ddc2a9720256d449681eb103845b81251e6ca7c6.tar.gz android_packages_providers_ThemesProvider-ddc2a9720256d449681eb103845b81251e6ca7c6.tar.bz2 android_packages_providers_ThemesProvider-ddc2a9720256d449681eb103845b81251e6ca7c6.zip |
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
(cherry picked from commit 767ac8cd0c8859e1c8a647250253c3f4cf60a663)
-rw-r--r-- | src/org/cyanogenmod/themes/provider/util/ProviderUtils.java | 5 | ||||
-rw-r--r-- | src/org/cyanogenmod/themes/provider/util/WallpaperPreviewGenerator.java | 2 |
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); |