Micro cleanup and refactoring

- organize import
- remove unused code in ContextualCardLoaderTest
- refactor CardDatabaseHelper

Test: robotest
Change-Id: I1a5a49bee1c4edb34f1c59f3dbe37cb22f01b0d4
This commit is contained in:
Jason Chiu
2018-12-14 18:43:47 +08:00
parent 008a06cac2
commit 93d4993556
3 changed files with 7 additions and 15 deletions

View File

@@ -197,12 +197,11 @@ public class CardDatabaseHelper extends SQLiteOpenHelper {
}
Cursor getContextualCards() {
final SQLiteDatabase db = this.getReadableDatabase();
final SQLiteDatabase db = getReadableDatabase();
final String selection = CardColumns.CARD_DISMISSED + "=0";
Cursor cursor = db.query(CARD_TABLE, null /* columns */, selection,
return db.query(CARD_TABLE, null /* columns */, selection,
null /* selectionArgs */, null /* groupBy */, null /* having */,
CardColumns.SCORE + " DESC" /* orderBy */);
return cursor;
}
/**