data flow issue + declaration redundancy
make final unused methods make final BUILD SUCCESSFUL in 0s 39 actionable tasks: 39 up-to-date
This commit is contained in:
parent
3ab06bf383
commit
0ab86937d2
38 changed files with 98 additions and 112 deletions
|
|
@ -67,7 +67,7 @@ public class DownloadMission implements Serializable {
|
|||
public long done;
|
||||
public int threadCount = 3;
|
||||
public int finishCount;
|
||||
private List<Long> threadPositions = new ArrayList<Long>();
|
||||
private final List<Long> threadPositions = new ArrayList<Long>();
|
||||
public final Map<Long, Boolean> blockState = new HashMap<Long, Boolean>();
|
||||
public boolean running;
|
||||
public boolean finished;
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ public class DownloadRunnable implements Runnable {
|
|||
// A server may be ignoring the range request
|
||||
if (conn.getResponseCode() != 206) {
|
||||
mMission.errCode = DownloadMission.ERROR_SERVER_UNSUPPORTED;
|
||||
notifyError(DownloadMission.ERROR_SERVER_UNSUPPORTED);
|
||||
notifyError();
|
||||
|
||||
if (DEBUG) {
|
||||
Log.e(TAG, mId + ":Unsupported " + conn.getResponseCode());
|
||||
|
|
@ -161,9 +161,9 @@ public class DownloadRunnable implements Runnable {
|
|||
}
|
||||
}
|
||||
|
||||
private void notifyError(final int err) {
|
||||
private void notifyError() {
|
||||
synchronized (mMission) {
|
||||
mMission.notifyError(err);
|
||||
mMission.notifyError(DownloadMission.ERROR_SERVER_UNSUPPORTED);
|
||||
mMission.pause();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class DownloadManagerService extends Service {
|
|||
private DownloadDataSource mDataSource;
|
||||
|
||||
|
||||
private MissionListener missionListener = new MissionListener();
|
||||
private final MissionListener missionListener = new MissionListener();
|
||||
|
||||
|
||||
private void notifyMediaScanner(DownloadMission mission) {
|
||||
|
|
|
|||
|
|
@ -306,12 +306,12 @@ public class MissionAdapter extends RecyclerView.Adapter<MissionAdapter.ViewHold
|
|||
public DownloadMission mission;
|
||||
public int position;
|
||||
|
||||
public TextView status;
|
||||
public ImageView icon;
|
||||
public TextView name;
|
||||
public TextView size;
|
||||
public View bkg;
|
||||
public ImageView menu;
|
||||
public final TextView status;
|
||||
public final ImageView icon;
|
||||
public final TextView name;
|
||||
public final TextView size;
|
||||
public final View bkg;
|
||||
public final ImageView menu;
|
||||
public ProgressDrawable progress;
|
||||
public MissionObserver observer;
|
||||
|
||||
|
|
@ -332,8 +332,8 @@ public class MissionAdapter extends RecyclerView.Adapter<MissionAdapter.ViewHold
|
|||
}
|
||||
|
||||
static class MissionObserver implements DownloadMission.MissionListener {
|
||||
private MissionAdapter mAdapter;
|
||||
private ViewHolder mHolder;
|
||||
private final MissionAdapter mAdapter;
|
||||
private final ViewHolder mHolder;
|
||||
|
||||
public MissionObserver(MissionAdapter adapter, ViewHolder holder) {
|
||||
mAdapter = adapter;
|
||||
|
|
@ -365,7 +365,7 @@ public class MissionAdapter extends RecyclerView.Adapter<MissionAdapter.ViewHold
|
|||
|
||||
private static class ChecksumTask extends AsyncTask<String, Void, String> {
|
||||
ProgressDialog prog;
|
||||
WeakReference<Activity> weakReference;
|
||||
final WeakReference<Activity> weakReference;
|
||||
|
||||
ChecksumTask(@NonNull Activity activity) {
|
||||
weakReference = new WeakReference<>(activity);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ import android.support.v4.content.ContextCompat;
|
|||
|
||||
public class ProgressDrawable extends Drawable {
|
||||
private float mProgress;
|
||||
private int mBackgroundColor, mForegroundColor;
|
||||
private final int mBackgroundColor;
|
||||
private final int mForegroundColor;
|
||||
|
||||
public ProgressDrawable(Context context, @ColorRes int background, @ColorRes int foreground) {
|
||||
this(ContextCompat.getColor(context, background), ContextCompat.getColor(context, foreground));
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public abstract class MissionsFragment extends Fragment {
|
|||
private DeleteDownloadManager mDeleteDownloadManager;
|
||||
private Disposable mDeleteDisposable;
|
||||
|
||||
private ServiceConnection mConnection = new ServiceConnection() {
|
||||
private final ServiceConnection mConnection = new ServiceConnection() {
|
||||
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName name, IBinder binder) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue