Removed unused methods
This commit is contained in:
parent
8119b4a8e1
commit
687693ccb0
|
@ -368,7 +368,6 @@ public class DBReaderTest {
|
|||
|
||||
@Test
|
||||
public void testGetFeedItemlistCheckChaptersFalse() throws Exception {
|
||||
Context context = InstrumentationRegistry.getTargetContext();
|
||||
List<Feed> feeds = DBTestUtils.saveFeedlist(10, 10, false, false, 0);
|
||||
for (Feed feed : feeds) {
|
||||
for (FeedItem item : feed.getItems()) {
|
||||
|
|
|
@ -98,15 +98,6 @@ public class UITestUtils {
|
|||
return String.format("%s/files/%d", server.getBaseUrl(), id);
|
||||
}
|
||||
|
||||
private File newBitmapFile(String name) throws IOException {
|
||||
File imgFile = new File(destDir, name);
|
||||
Bitmap bitmap = Bitmap.createBitmap(128, 128, Bitmap.Config.ARGB_8888);
|
||||
FileOutputStream out = new FileOutputStream(imgFile);
|
||||
bitmap.compress(Bitmap.CompressFormat.PNG, 1, out);
|
||||
out.close();
|
||||
return imgFile;
|
||||
}
|
||||
|
||||
private File newMediaFile(String name) throws IOException {
|
||||
File mediaFile = new File(hostedMediaDir, name);
|
||||
if (mediaFile.exists()) {
|
||||
|
|
|
@ -507,17 +507,6 @@ public final class DBReader {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the download log for a particular feed from the database.
|
||||
*
|
||||
* @param feed Feed for which the download log is loaded
|
||||
* @return A list with DownloadStatus objects that represent the feed's download log,
|
||||
* newest events first.
|
||||
*/
|
||||
public static List<DownloadStatus> getFeedDownloadLog(Feed feed) {
|
||||
return getFeedDownloadLog(feed.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the download log for a particular feed from the database.
|
||||
*
|
||||
|
|
|
@ -379,18 +379,6 @@ public final class DBTasks {
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the queue from the database and checks if the specified FeedItem is in the queue.
|
||||
* This method should NOT be executed in the GUI thread.
|
||||
*
|
||||
* @param context Used for accessing the DB.
|
||||
* @param feedItemId ID of the FeedItem
|
||||
*/
|
||||
public static boolean isInQueue(Context context, final long feedItemId) {
|
||||
LongList queue = DBReader.getQueueIDList();
|
||||
return queue.contains(feedItemId);
|
||||
}
|
||||
|
||||
private static Feed searchFeedByIdentifyingValueOrID(PodDBAdapter adapter,
|
||||
Feed feed) {
|
||||
if (feed.getId() != 0) {
|
||||
|
|
|
@ -904,49 +904,6 @@ public class PodDBAdapter {
|
|||
null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a cursor for a DB query in the FeedImages table for given IDs.
|
||||
*
|
||||
* @param imageIds IDs of the images
|
||||
* @return The cursor of the query
|
||||
*/
|
||||
public final Cursor getImageCursor(String... imageIds) {
|
||||
int length = imageIds.length;
|
||||
if (length > IN_OPERATOR_MAXIMUM) {
|
||||
Log.w(TAG, "Length of id array is larger than "
|
||||
+ IN_OPERATOR_MAXIMUM + ". Creating multiple cursors");
|
||||
int numCursors = (int) (((double) length) / (IN_OPERATOR_MAXIMUM)) + 1;
|
||||
Cursor[] cursors = new Cursor[numCursors];
|
||||
for (int i = 0; i < numCursors; i++) {
|
||||
int neededLength;
|
||||
String[] parts;
|
||||
final int elementsLeft = length - i * IN_OPERATOR_MAXIMUM;
|
||||
|
||||
if (elementsLeft >= IN_OPERATOR_MAXIMUM) {
|
||||
neededLength = IN_OPERATOR_MAXIMUM;
|
||||
parts = Arrays.copyOfRange(imageIds, i
|
||||
* IN_OPERATOR_MAXIMUM, (i + 1)
|
||||
* IN_OPERATOR_MAXIMUM);
|
||||
} else {
|
||||
neededLength = elementsLeft;
|
||||
parts = Arrays.copyOfRange(imageIds, i
|
||||
* IN_OPERATOR_MAXIMUM, (i * IN_OPERATOR_MAXIMUM)
|
||||
+ neededLength);
|
||||
}
|
||||
|
||||
cursors[i] = db.rawQuery("SELECT * FROM "
|
||||
+ TABLE_NAME_FEED_IMAGES + " WHERE " + KEY_ID + " IN "
|
||||
+ buildInOperator(neededLength), parts);
|
||||
}
|
||||
Cursor result = new MergeCursor(cursors);
|
||||
result.moveToFirst();
|
||||
return result;
|
||||
} else {
|
||||
return db.query(TABLE_NAME_FEED_IMAGES, null, KEY_ID + " IN "
|
||||
+ buildInOperator(length), imageIds, null, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
public final Cursor getSimpleChaptersOfFeedItemCursor(final FeedItem item) {
|
||||
return db.query(TABLE_NAME_SIMPLECHAPTERS, null, KEY_FEEDITEM
|
||||
+ "=?", new String[]{String.valueOf(item.getId())}, null,
|
||||
|
|
Loading…
Reference in New Issue