mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-27 03:18:24 +01:00
Remove unused download events (#1236)
* Remove unused DownloadRedditVideoEvent * Remove unused DownloadMediaEvent
This commit is contained in:
parent
a1df8f4d38
commit
da58688586
@ -1,9 +0,0 @@
|
||||
package ml.docilealligator.infinityforreddit.events;
|
||||
|
||||
public class DownloadMediaEvent {
|
||||
public boolean isSuccessful;
|
||||
|
||||
public DownloadMediaEvent(boolean isSuccessful) {
|
||||
this.isSuccessful = isSuccessful;
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
package ml.docilealligator.infinityforreddit.events;
|
||||
|
||||
public class DownloadRedditVideoEvent {
|
||||
public boolean isSuccessful;
|
||||
|
||||
public DownloadRedditVideoEvent(boolean isSuccessful) {
|
||||
this.isSuccessful = isSuccessful;
|
||||
}
|
||||
}
|
@ -27,8 +27,6 @@ import androidx.core.app.NotificationCompat;
|
||||
import androidx.core.app.NotificationManagerCompat;
|
||||
import androidx.documentfile.provider.DocumentFile;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
@ -45,7 +43,6 @@ import ml.docilealligator.infinityforreddit.R;
|
||||
import ml.docilealligator.infinityforreddit.apis.DownloadFile;
|
||||
import ml.docilealligator.infinityforreddit.broadcastreceivers.DownloadedMediaDeleteActionBroadcastReceiver;
|
||||
import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper;
|
||||
import ml.docilealligator.infinityforreddit.events.DownloadMediaEvent;
|
||||
import ml.docilealligator.infinityforreddit.utils.APIUtils;
|
||||
import ml.docilealligator.infinityforreddit.utils.NotificationUtils;
|
||||
import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils;
|
||||
@ -337,14 +334,12 @@ public class DownloadMediaService extends Service {
|
||||
-1, randomNotificationIdOffset, null, null);
|
||||
break;
|
||||
}
|
||||
EventBus.getDefault().post(new DownloadMediaEvent(false));
|
||||
} else {
|
||||
MediaScannerConnection.scanFile(
|
||||
DownloadMediaService.this, new String[]{destinationFileUri.toString()}, null,
|
||||
(path, uri) -> {
|
||||
updateNotification(mediaType, R.string.downloading_media_finished, -1,
|
||||
randomNotificationIdOffset, destinationFileUri, mimeType);
|
||||
EventBus.getDefault().post(new DownloadMediaEvent(true));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -25,15 +25,12 @@ import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.Process;
|
||||
import android.provider.MediaStore;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.core.app.NotificationChannelCompat;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.core.app.NotificationManagerCompat;
|
||||
import androidx.documentfile.provider.DocumentFile;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
@ -52,7 +49,6 @@ import ml.docilealligator.infinityforreddit.R;
|
||||
import ml.docilealligator.infinityforreddit.apis.DownloadFile;
|
||||
import ml.docilealligator.infinityforreddit.broadcastreceivers.DownloadedMediaDeleteActionBroadcastReceiver;
|
||||
import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper;
|
||||
import ml.docilealligator.infinityforreddit.events.DownloadRedditVideoEvent;
|
||||
import ml.docilealligator.infinityforreddit.utils.NotificationUtils;
|
||||
import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils;
|
||||
import okhttp3.OkHttpClient;
|
||||
@ -594,13 +590,11 @@ public class DownloadRedditVideoService extends Service {
|
||||
randomNotificationIdOffset, null);
|
||||
break;
|
||||
}
|
||||
EventBus.getDefault().post(new DownloadRedditVideoEvent(false));
|
||||
} else {
|
||||
MediaScannerConnection.scanFile(
|
||||
this, new String[]{destinationFileUri.toString()}, null,
|
||||
(path, uri) -> {
|
||||
updateNotification(R.string.downloading_reddit_video_finished, -1, randomNotificationIdOffset, destinationFileUri);
|
||||
EventBus.getDefault().post(new DownloadRedditVideoEvent(true));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user