2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 05:37:43 +00:00

Swapped branches in if statement caused settings to not be stored in db

This commit is contained in:
Albert Vaca 2016-09-24 19:29:32 +02:00
parent 347c34927d
commit c7b754a36e

View File

@ -86,10 +86,10 @@ public class AppDatabase {
ContentValues cv = new ContentValues(); ContentValues cv = new ContentValues();
cv.put(KEY_IS_ENABLED, isEnabled?"true":"false"); cv.put(KEY_IS_ENABLED, isEnabled?"true":"false");
if (res.getCount() > 0) { if (res.getCount() > 0) {
ourDatabase.update(DATABASE_TABLE, cv, KEY_PACKAGE_NAME + "=?",new String[]{packageName});
} else {
cv.put(KEY_PACKAGE_NAME, packageName); cv.put(KEY_PACKAGE_NAME, packageName);
ourDatabase.insert(DATABASE_TABLE, null, cv); ourDatabase.insert(DATABASE_TABLE, null, cv);
} else {
ourDatabase.update(DATABASE_TABLE, cv, KEY_PACKAGE_NAME + "=?",new String[]{packageName});
} }
res.close(); res.close();
} }