From fb3ed83d51af3149370343f9675770a19fe5ebb3 Mon Sep 17 00:00:00 2001
From: Zhidong Piao
There are multiple types of errors:
** It adds more headers to {@code videoplayback} URLs, such as {@code Origin}, {@code Referer} @@ -73,7 +73,7 @@ import java.util.zip.GZIPInputStream; *
* * There are many unused methods in this class because everything was copied from {@link - * com.google.android.exoplayer2.upstream.DefaultHttpDataSource} with as little changes as possible. + * DefaultHttpDataSource} with as little changes as possible. * SonarQube warnings were also suppressed for the same reason. */ @SuppressWarnings({"squid:S3011", "squid:S4738"}) @@ -197,7 +197,7 @@ public final class YoutubeHttpDataSource extends BaseDataSource implements HttpD /** * Sets a content type {@link Predicate}. If a content type is rejected by the predicate - * then a {@link HttpDataSource.InvalidContentTypeException} is thrown from + * then a {@link InvalidContentTypeException} is thrown from * {@link YoutubeHttpDataSource#open(DataSpec)}. * *
diff --git a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java
index abde7c3d1..f9ca530b2 100644
--- a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java
+++ b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java
@@ -280,11 +280,11 @@ public final class PlayerHelper {
public static boolean isAutoplayAllowedByUser(@NonNull final Context context) {
switch (PlayerHelper.getAutoplayType(context)) {
- case PlayerHelper.AutoplayType.AUTOPLAY_TYPE_NEVER:
+ case AutoplayType.AUTOPLAY_TYPE_NEVER:
return false;
- case PlayerHelper.AutoplayType.AUTOPLAY_TYPE_WIFI:
+ case AutoplayType.AUTOPLAY_TYPE_WIFI:
return !ListHelper.isMeteredNetwork(context);
- case PlayerHelper.AutoplayType.AUTOPLAY_TYPE_ALWAYS:
+ case AutoplayType.AUTOPLAY_TYPE_ALWAYS:
default:
return true;
}
@@ -382,7 +382,7 @@ public final class PlayerHelper {
public static boolean globalScreenOrientationLocked(final Context context) {
// 1: Screen orientation changes using accelerometer
// 0: Screen orientation is locked
- return android.provider.Settings.System.getInt(
+ return Settings.System.getInt(
context.getContentResolver(), Settings.System.ACCELEROMETER_ROTATION, 0) == 0;
}
diff --git a/app/src/main/java/org/schabi/newpipe/player/mediaitem/StreamInfoTag.java b/app/src/main/java/org/schabi/newpipe/player/mediaitem/StreamInfoTag.java
index 4095f2bc8..ad6c0b405 100644
--- a/app/src/main/java/org/schabi/newpipe/player/mediaitem/StreamInfoTag.java
+++ b/app/src/main/java/org/schabi/newpipe/player/mediaitem/StreamInfoTag.java
@@ -23,12 +23,12 @@ public final class StreamInfoTag implements MediaItemTag {
@NonNull
private final StreamInfo streamInfo;
@Nullable
- private final MediaItemTag.Quality quality;
+ private final Quality quality;
@Nullable
private final Object extras;
private StreamInfoTag(@NonNull final StreamInfo streamInfo,
- @Nullable final MediaItemTag.Quality quality,
+ @Nullable final Quality quality,
@Nullable final Object extras) {
this.streamInfo = streamInfo;
this.quality = quality;
diff --git a/app/src/main/java/org/schabi/newpipe/player/mediasource/FailedMediaSource.java b/app/src/main/java/org/schabi/newpipe/player/mediasource/FailedMediaSource.java
index b9ca90d89..8bed2f240 100644
--- a/app/src/main/java/org/schabi/newpipe/player/mediasource/FailedMediaSource.java
+++ b/app/src/main/java/org/schabi/newpipe/player/mediasource/FailedMediaSource.java
@@ -121,7 +121,7 @@ public class FailedMediaSource extends BaseMediaSource implements ManagedMediaSo
* {@link com.google.android.exoplayer2.Player.Listener#onPlayerError(PlaybackException)}.
*
* @throws IOException An error which will always result in
- * {@link com.google.android.exoplayer2.PlaybackException#ERROR_CODE_IO_UNSPECIFIED}.
+ * {@link PlaybackException#ERROR_CODE_IO_UNSPECIFIED}.
*/
@Override
public void maybeThrowSourceInfoRefreshError() throws IOException {
diff --git a/app/src/main/java/org/schabi/newpipe/player/ui/VideoPlayerUi.java b/app/src/main/java/org/schabi/newpipe/player/ui/VideoPlayerUi.java
index 1709755f2..e0e253181 100644
--- a/app/src/main/java/org/schabi/newpipe/player/ui/VideoPlayerUi.java
+++ b/app/src/main/java/org/schabi/newpipe/player/ui/VideoPlayerUi.java
@@ -1425,7 +1425,7 @@ public abstract class VideoPlayerUi extends PlayerUi
break;
}
- if (player.getCurrentState() == org.schabi.newpipe.player.Player.STATE_BLOCKED) {
+ if (player.getCurrentState() == Player.STATE_BLOCKED) {
return true;
}
diff --git a/app/src/main/java/org/schabi/newpipe/settings/PeertubeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/PeertubeInstanceListFragment.java
index 1158b3d83..e6d281233 100644
--- a/app/src/main/java/org/schabi/newpipe/settings/PeertubeInstanceListFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/settings/PeertubeInstanceListFragment.java
@@ -339,14 +339,14 @@ public class PeertubeInstanceListFragment extends Fragment {
@NonNull
@Override
- public InstanceListAdapter.TabViewHolder onCreateViewHolder(@NonNull final ViewGroup parent,
+ public TabViewHolder onCreateViewHolder(@NonNull final ViewGroup parent,
final int viewType) {
- return new InstanceListAdapter.TabViewHolder(ItemInstanceBinding.inflate(inflater,
+ return new TabViewHolder(ItemInstanceBinding.inflate(inflater,
parent, false));
}
@Override
- public void onBindViewHolder(@NonNull final InstanceListAdapter.TabViewHolder holder,
+ public void onBindViewHolder(@NonNull final TabViewHolder holder,
final int position) {
holder.bind(position);
}
diff --git a/app/src/main/java/org/schabi/newpipe/settings/tabs/ChooseTabsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/tabs/ChooseTabsFragment.java
index 289c824ba..b6556db9e 100644
--- a/app/src/main/java/org/schabi/newpipe/settings/tabs/ChooseTabsFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/settings/tabs/ChooseTabsFragment.java
@@ -45,7 +45,7 @@ public class ChooseTabsFragment extends Fragment {
private TabsManager tabsManager;
private final List
diff --git a/app/src/main/java/org/schabi/newpipe/util/external_communication/ShareUtils.java b/app/src/main/java/org/schabi/newpipe/util/external_communication/ShareUtils.java
index debeb902c..f543def37 100644
--- a/app/src/main/java/org/schabi/newpipe/util/external_communication/ShareUtils.java
+++ b/app/src/main/java/org/schabi/newpipe/util/external_communication/ShareUtils.java
@@ -163,12 +163,12 @@ public final class ShareUtils {
/**
* Open the system chooser to launch an intent.
*
- * This method opens an {@link android.content.Intent#ACTION_CHOOSER} of the intent putted
+ * This method opens an {@link Intent#ACTION_CHOOSER} of the intent putted
* as the intent param. If the setTitleChooser boolean is true, the string "Open with" will be
* set as the title of the system chooser.
- * For Android P and higher, title for {@link android.content.Intent#ACTION_SEND} system
+ * For Android P and higher, title for {@link Intent#ACTION_SEND} system
* choosers must be set on this intent, not on the
- * {@link android.content.Intent#ACTION_CHOOSER} intent.
+ * {@link Intent#ACTION_CHOOSER} intent.
*
* @param context the context to use
* @param intent the intent to open
diff --git a/app/src/main/java/org/schabi/newpipe/views/FocusAwareDrawerLayout.java b/app/src/main/java/org/schabi/newpipe/views/FocusAwareDrawerLayout.java
index 5c694c3a9..4522999ba 100644
--- a/app/src/main/java/org/schabi/newpipe/views/FocusAwareDrawerLayout.java
+++ b/app/src/main/java/org/schabi/newpipe/views/FocusAwareDrawerLayout.java
@@ -57,8 +57,8 @@ public final class FocusAwareDrawerLayout extends DrawerLayout {
for (int i = 0; i < getChildCount(); ++i) {
final View child = getChildAt(i);
- final DrawerLayout.LayoutParams lp =
- (DrawerLayout.LayoutParams) child.getLayoutParams();
+ final LayoutParams lp =
+ (LayoutParams) child.getLayoutParams();
if (lp.gravity != 0 && isDrawerVisible(child)) {
hasOpenPanels = true;
@@ -85,8 +85,8 @@ public final class FocusAwareDrawerLayout extends DrawerLayout {
for (int i = 0; i < getChildCount(); ++i) {
final View child = getChildAt(i);
- final DrawerLayout.LayoutParams lp =
- (DrawerLayout.LayoutParams) child.getLayoutParams();
+ final LayoutParams lp =
+ (LayoutParams) child.getLayoutParams();
if (lp.gravity == 0) {
content = child;
diff --git a/app/src/main/java/us/shandian/giga/get/DownloadRunnable.java b/app/src/main/java/us/shandian/giga/get/DownloadRunnable.java
index 6f504cea3..d1f0d6126 100644
--- a/app/src/main/java/us/shandian/giga/get/DownloadRunnable.java
+++ b/app/src/main/java/us/shandian/giga/get/DownloadRunnable.java
@@ -94,7 +94,7 @@ public class DownloadRunnable extends Thread {
continue;
}
- throw new DownloadMission.HttpError(416);
+ throw new HttpError(416);
}
retry = false;
@@ -104,7 +104,7 @@ public class DownloadRunnable extends Thread {
if (DEBUG) {
Log.e(TAG, mId + ":Unsupported " + mConn.getResponseCode());
}
- mMission.notifyError(new DownloadMission.HttpError(mConn.getResponseCode()));
+ mMission.notifyError(new HttpError(mConn.getResponseCode()));
break;
}
diff --git a/app/src/main/java/us/shandian/giga/get/DownloadRunnableFallback.java b/app/src/main/java/us/shandian/giga/get/DownloadRunnableFallback.java
index eed5db463..8bc3630ad 100644
--- a/app/src/main/java/us/shandian/giga/get/DownloadRunnableFallback.java
+++ b/app/src/main/java/us/shandian/giga/get/DownloadRunnableFallback.java
@@ -75,7 +75,7 @@ public class DownloadRunnableFallback extends Thread {
mMission.notifyProgress(-start);
start = 0;
mRetryCount--;
- throw new DownloadMission.HttpError(416);
+ throw new HttpError(416);
}
// secondary check for the file length
diff --git a/app/src/main/java/us/shandian/giga/get/sqlite/FinishedMissionStore.java b/app/src/main/java/us/shandian/giga/get/sqlite/FinishedMissionStore.java
index 704385212..d6191fdb1 100644
--- a/app/src/main/java/us/shandian/giga/get/sqlite/FinishedMissionStore.java
+++ b/app/src/main/java/us/shandian/giga/get/sqlite/FinishedMissionStore.java
@@ -20,7 +20,7 @@ import us.shandian.giga.get.Mission;
import org.schabi.newpipe.streams.io.StoredFileHelper;
/**
- * SQLite helper to store finished {@link us.shandian.giga.get.FinishedMission}'s
+ * SQLite helper to store finished {@link FinishedMission}'s
*/
public class FinishedMissionStore extends SQLiteOpenHelper {
diff --git a/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java b/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java
index 343b13ef8..494532f2b 100644
--- a/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java
+++ b/app/src/main/java/us/shandian/giga/ui/adapter/MissionAdapter.java
@@ -837,7 +837,7 @@ public class MissionAdapter extends Adapter