Implemented the CardContentLoader
- Implemented the CardContentLoader - Refactored the CardLoader and increased the code readable - Added try-with-resource - Removed all custom card codes - Modified ContextualCardManager to add CardContentLoaderCallbacks Bug: 112521307 Test: robotest Change-Id: Ieb9cdeaacdfb8fdae9747c60395206d15af034c1
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package com.android.settings.homepage;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
import android.util.Log;
|
||||
@@ -190,4 +191,12 @@ public class CardDatabaseHelper extends SQLiteOpenHelper {
|
||||
}
|
||||
return sCardDatabaseHelper;
|
||||
}
|
||||
|
||||
Cursor getAllContextualCards() {
|
||||
final SQLiteDatabase db = this.getReadableDatabase();
|
||||
Cursor cursor = db.query(CARD_TABLE, null /* columns */, null /* selection */,
|
||||
null /* selectionArgs */, null /* groupBy */, null /* having */,
|
||||
null /* orderBy */);
|
||||
return cursor;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user