summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authord34d <clark@cyngn.com>2015-11-09 18:55:23 (GMT)
committerClark Scheff <clark@cyngn.com>2015-11-19 19:54:18 (GMT)
commite17a588dfbfed60d2e0a7584c9253bafc6c13d57 (patch)
tree2ed6a9a1145994d7d8f860f635a67aa85b056d5a
parent5ba00de4901b2e97c5176f33d029d3a152963b7f (diff)
downloadandroid_packages_providers_ThemesProvider-e17a588dfbfed60d2e0a7584c9253bafc6c13d57.zip
android_packages_providers_ThemesProvider-e17a588dfbfed60d2e0a7584c9253bafc6c13d57.tar.gz
android_packages_providers_ThemesProvider-e17a588dfbfed60d2e0a7584c9253bafc6c13d57.tar.bz2
Fix applied previews query when component doesn't exist
Change-Id: Ia7ce6b8a25958ef8b60f45e56e6777f1a6ff83d6 (cherry picked from commit 2f386fcd435cb455039138e67ff373f821db448d)
-rw-r--r--src/org/cyanogenmod/themes/provider/ThemesProvider.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/cyanogenmod/themes/provider/ThemesProvider.java b/src/org/cyanogenmod/themes/provider/ThemesProvider.java
index 2321b5b..ca24162 100644
--- a/src/org/cyanogenmod/themes/provider/ThemesProvider.java
+++ b/src/org/cyanogenmod/themes/provider/ThemesProvider.java
@@ -373,8 +373,10 @@ public class ThemesProvider extends ContentProvider {
if (component != null && pkgName != null) {
// We need to get the theme's id using its package name
String[] columns = { ThemesColumns._ID };
- Cursor current = db.query(ThemesTable.TABLE_NAME, columns,
- ThemesColumns.PKG_NAME + "='" + pkgName + "'", null, null, null, null);
+ String selection = ThemesColumns.PKG_NAME + "=? AND " + component + "=?";
+ String[] selectionArgs = {pkgName, "1"};
+ Cursor current = db.query(ThemesTable.TABLE_NAME, columns, selection,
+ selectionArgs, null, null, null);
int id = -1;
if (current != null) {
if (current.moveToFirst()) id = current.getInt(0);