summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authord34d <clark@cyngn.com>2015-01-23 15:41:37 -0800
committerd34d <clark@cyngn.com>2015-01-23 15:54:56 -0800
commitd8da252a3299cba864508b5e398753404062f18a (patch)
tree24b3545df795d52c5ba51501bb59ee926af97d0d
parent3c1b6dd43a9f53bb55c0c1fd8ab52da0989facaf (diff)
downloadandroid_packages_providers_ThemesProvider-d8da252a3299cba864508b5e398753404062f18a.tar.gz
android_packages_providers_ThemesProvider-d8da252a3299cba864508b5e398753404062f18a.tar.bz2
android_packages_providers_ThemesProvider-d8da252a3299cba864508b5e398753404062f18a.zip
Fix isPresentableTheme() logic
The way it was written guaranteed that ALL themes are marked as being presentable as a theme pack. Change-Id: Ic6cfa08ebd5f1841ea19da9bedb9c71c2fb02d0c
-rw-r--r--src/org/cyanogenmod/themes/provider/ThemePackageHelper.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java b/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java
index f26e5e7..8d9a933 100644
--- a/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java
+++ b/src/org/cyanogenmod/themes/provider/ThemePackageHelper.java
@@ -86,7 +86,7 @@ public class ThemePackageHelper {
private static void insertPackageInternal(Context context, PackageInfo pi,
Map<String, Boolean> capabilities, boolean processPreviews) {
ThemeInfo info = pi.themeInfo;
- boolean isPresentableTheme = ThemePackageHelper.isPresentableTheme(capabilities);
+ boolean isPresentableTheme = isPresentableTheme(capabilities);
ContentValues values = new ContentValues();
values.put(ThemesColumns.PKG_NAME, pi.packageName);
@@ -285,13 +285,16 @@ public class ThemePackageHelper {
}
// Presently we are defining a "presentable" theme as any theme
- // which implements 2+ components. Such themes can be shown to the user
- // under the "themes" category.
+ // which has icons, wallpaper, and overlays
public static boolean isPresentableTheme(Map<String, Boolean> implementMap) {
return implementMap != null &&
- implementMap.containsKey(ThemesColumns.MODIFIES_LAUNCHER) &&
- implementMap.containsKey(ThemesColumns.MODIFIES_ICONS) &&
- implementMap.containsKey(ThemesColumns.MODIFIES_OVERLAYS);
+ hasThemeComponent(implementMap, ThemesColumns.MODIFIES_LAUNCHER) &&
+ hasThemeComponent(implementMap, ThemesColumns.MODIFIES_ICONS) &&
+ hasThemeComponent(implementMap, ThemesColumns.MODIFIES_OVERLAYS);
+ }
+
+ private static boolean hasThemeComponent(Map<String, Boolean> componentMap, String component) {
+ return componentMap.containsKey(component) && componentMap.get(component);
}
private static void reapplyInstalledComponentsForTheme(Context context, String pkgName) {