diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java index 26a283229..4bae6f1ca 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java @@ -167,6 +167,10 @@ public class SearchFragment extends BaseListFragment items, final int index) { + public SinglePlayQueue(@NonNull final List items, final int index) { super(index, playQueueItemsOf(items)); } - private static List playQueueItemsOf(final List items) { + private static List playQueueItemsOf(@NonNull final List items) { final List playQueueItems = new ArrayList<>(items.size()); for (final StreamInfoItem item : items) { playQueueItems.add(new PlayQueueItem(item)); @@ -39,5 +41,7 @@ public final class SinglePlayQueue extends PlayQueue { @Override public void fetch() { + // Item was already passed in constructor. + // No further items need to be fetched as this is a PlayQueue with only one item } } diff --git a/app/src/main/java/us/shandian/giga/get/DownloadInitializer.java b/app/src/main/java/us/shandian/giga/get/DownloadInitializer.java index 1d5a93588..84e968b43 100644 --- a/app/src/main/java/us/shandian/giga/get/DownloadInitializer.java +++ b/app/src/main/java/us/shandian/giga/get/DownloadInitializer.java @@ -18,10 +18,10 @@ import static org.schabi.newpipe.BuildConfig.DEBUG; import static us.shandian.giga.get.DownloadMission.ERROR_HTTP_FORBIDDEN; public class DownloadInitializer extends Thread { - private final static String TAG = "DownloadInitializer"; - final static int mId = 0; - private final static int RESERVE_SPACE_DEFAULT = 5 * 1024 * 1024;// 5 MiB - private final static int RESERVE_SPACE_MAXIMUM = 150 * 1024 * 1024;// 150 MiB + private static final String TAG = "DownloadInitializer"; + static final int mId = 0; + private static final int RESERVE_SPACE_DEFAULT = 5 * 1024 * 1024;// 5 MiB + private static final int RESERVE_SPACE_MAXIMUM = 150 * 1024 * 1024;// 150 MiB private final DownloadMission mMission; private HttpURLConnection mConn; diff --git a/app/src/main/java/us/shandian/giga/io/CircularFileWriter.java b/app/src/main/java/us/shandian/giga/io/CircularFileWriter.java index dbceeb091..4473fa7f9 100644 --- a/app/src/main/java/us/shandian/giga/io/CircularFileWriter.java +++ b/app/src/main/java/us/shandian/giga/io/CircularFileWriter.java @@ -11,10 +11,10 @@ import java.util.Objects; public class CircularFileWriter extends SharpStream { - private final static int QUEUE_BUFFER_SIZE = 8 * 1024;// 8 KiB - private final static int COPY_BUFFER_SIZE = 128 * 1024; // 128 KiB - private final static int NOTIFY_BYTES_INTERVAL = 64 * 1024;// 64 KiB - private final static int THRESHOLD_AUX_LENGTH = 15 * 1024 * 1024;// 15 MiB + private static final int QUEUE_BUFFER_SIZE = 8 * 1024;// 8 KiB + private static final int COPY_BUFFER_SIZE = 128 * 1024; // 128 KiB + private static final int NOTIFY_BYTES_INTERVAL = 64 * 1024;// 64 KiB + private static final int THRESHOLD_AUX_LENGTH = 15 * 1024 * 1024;// 15 MiB private final OffsetChecker callback; diff --git a/app/src/main/java/us/shandian/giga/service/DownloadManager.java b/app/src/main/java/us/shandian/giga/service/DownloadManager.java index 7c248c2b6..9b90fa14b 100644 --- a/app/src/main/java/us/shandian/giga/service/DownloadManager.java +++ b/app/src/main/java/us/shandian/giga/service/DownloadManager.java @@ -30,9 +30,9 @@ public class DownloadManager { enum NetworkState {Unavailable, Operating, MeteredOperating} - public final static int SPECIAL_NOTHING = 0; - public final static int SPECIAL_PENDING = 1; - public final static int SPECIAL_FINISHED = 2; + public static final int SPECIAL_NOTHING = 0; + public static final int SPECIAL_PENDING = 1; + public static final int SPECIAL_FINISHED = 2; public static final String TAG_AUDIO = "audio"; public static final String TAG_VIDEO = "video";