Merge pull request #4691 from damoasda/cleanup-callback-constants
Refactoring: Remove callback functions with constant value
This commit is contained in:
commit
ba09afd215
|
@ -54,9 +54,4 @@ public class DownloadServiceCallbacksImpl implements DownloadServiceCallbacks {
|
||||||
return PendingIntent.getActivity(context, R.id.pending_intent_download_service_autodownload_report,
|
return PendingIntent.getActivity(context, R.id.pending_intent_download_service_autodownload_report,
|
||||||
intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean shouldCreateReport() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,10 +22,4 @@ public class PlaybackServiceCallbacksImpl implements PlaybackServiceCallbacks {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean useQueue() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ public interface DownloadServiceCallbacks {
|
||||||
* <p/>
|
* <p/>
|
||||||
* The PendingIntent takes users to an activity where they can look at all successful and failed downloads.
|
* The PendingIntent takes users to an activity where they can look at all successful and failed downloads.
|
||||||
*
|
*
|
||||||
* @return A non-null PendingIntent for the notification or null if shouldCreateReport()==false
|
* @return A non-null PendingIntent for the notification
|
||||||
*/
|
*/
|
||||||
PendingIntent getReportNotificationContentIntent(Context context);
|
PendingIntent getReportNotificationContentIntent(Context context);
|
||||||
|
|
||||||
|
@ -47,14 +47,8 @@ public interface DownloadServiceCallbacks {
|
||||||
* <p/>
|
* <p/>
|
||||||
* The PendingIntent takes users to an activity where they can look at their episode queue.
|
* The PendingIntent takes users to an activity where they can look at their episode queue.
|
||||||
*
|
*
|
||||||
* @return A non-null PendingIntent for the notification or null if shouldCreateReport()==false
|
* @return A non-null PendingIntent for the notification
|
||||||
*/
|
*/
|
||||||
PendingIntent getAutoDownloadReportNotificationContentIntent(Context context);
|
PendingIntent getAutoDownloadReportNotificationContentIntent(Context context);
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the DownloadService should create a report that shows the number of failed
|
|
||||||
* downloads when the service shuts down.
|
|
||||||
*/
|
|
||||||
boolean shouldCreateReport();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,4 @@ public interface PlaybackServiceCallbacks {
|
||||||
* @return A non-null activity intent.
|
* @return A non-null activity intent.
|
||||||
*/
|
*/
|
||||||
Intent getPlayerActivityIntent(Context context, MediaType mediaType, boolean remotePlayback);
|
Intent getPlayerActivityIntent(Context context, MediaType mediaType, boolean remotePlayback);
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the PlaybackService should load new episodes from the queue when playback ends
|
|
||||||
* and false if the PlaybackService should ignore the queue and load no more episodes when playback
|
|
||||||
* finishes.
|
|
||||||
*/
|
|
||||||
boolean useQueue();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,8 +205,7 @@ public class DownloadService extends Service {
|
||||||
isRunning = false;
|
isRunning = false;
|
||||||
|
|
||||||
boolean showAutoDownloadReport = UserPreferences.showAutoDownloadReport();
|
boolean showAutoDownloadReport = UserPreferences.showAutoDownloadReport();
|
||||||
if (ClientConfig.downloadServiceCallbacks.shouldCreateReport()
|
if (UserPreferences.showDownloadReport() || showAutoDownloadReport) {
|
||||||
&& (UserPreferences.showDownloadReport() || showAutoDownloadReport)) {
|
|
||||||
notificationManager.updateReport(reportQueue, showAutoDownloadReport);
|
notificationManager.updateReport(reportQueue, showAutoDownloadReport);
|
||||||
reportQueue.clear();
|
reportQueue.clear();
|
||||||
}
|
}
|
||||||
|
|
|
@ -973,10 +973,6 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
||||||
Log.d(TAG, "getNextInQueue(), but playable not an instance of FeedMedia, so not proceeding");
|
Log.d(TAG, "getNextInQueue(), but playable not an instance of FeedMedia, so not proceeding");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (!ClientConfig.playbackServiceCallbacks.useQueue()) {
|
|
||||||
Log.d(TAG, "getNextInQueue(), but queue not in use by this app");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
Log.d(TAG, "getNextInQueue()");
|
Log.d(TAG, "getNextInQueue()");
|
||||||
FeedMedia media = (FeedMedia) currentMedia;
|
FeedMedia media = (FeedMedia) currentMedia;
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue