Delete a few unused things

This commit is contained in:
ByteHamster 2022-02-21 22:39:59 +01:00
parent 2f3efa5d33
commit 48852e081a
38 changed files with 57 additions and 342 deletions

View File

@ -127,15 +127,9 @@ public class Rss2Generator implements FeedGenerator {
}
}
writeAdditionalAttributes(xml);
xml.endTag(null, "channel");
xml.endTag(null, "rss");
xml.endDocument();
}
protected void writeAdditionalAttributes(XmlSerializer xml) throws IOException {
}
}

View File

@ -47,7 +47,7 @@ public class WidgetConfigActivity extends AppCompatActivity {
opacityTextView = findViewById(R.id.widget_opacity_textView);
opacitySeekBar = findViewById(R.id.widget_opacity_seekBar);
widgetPreview = findViewById(R.id.widgetLayout);
findViewById(R.id.butConfirm).setOnClickListener(this::confirmCreateWidget);
findViewById(R.id.butConfirm).setOnClickListener(v -> confirmCreateWidget());
opacitySeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
@ -94,7 +94,7 @@ public class WidgetConfigActivity extends AppCompatActivity {
widgetPreview.findViewById(R.id.butRew).setVisibility(ckRewind.isChecked() ? View.VISIBLE : View.GONE);
}
private void confirmCreateWidget(View v) {
private void confirmCreateWidget() {
int backgroundColor = getColorWithAlpha(PlayerWidget.DEFAULT_COLOR, opacitySeekBar.getProgress());
SharedPreferences prefs = getSharedPreferences(PlayerWidget.PREFS_NAME, MODE_PRIVATE);

View File

@ -39,10 +39,6 @@ public class PodcastSearchResult {
this.author = author;
}
private PodcastSearchResult(String title, @Nullable String imageUrl, @Nullable String feedUrl) {
this(title, imageUrl, feedUrl, "");
}
public static PodcastSearchResult dummy() {
return new PodcastSearchResult("", "", "", "");
}

View File

@ -283,7 +283,7 @@ public class ItemFragment extends Fragment {
if (item.getPubDate() != null) {
String pubDateStr = DateFormatter.formatAbbrev(getActivity(), item.getPubDate());
txtvPublished.setText(pubDateStr);
txtvPublished.setContentDescription(DateFormatter.formatForAccessibility(getContext(), item.getPubDate()));
txtvPublished.setContentDescription(DateFormatter.formatForAccessibility(item.getPubDate()));
}
RequestOptions options = new RequestOptions()

View File

@ -335,8 +335,8 @@ public class SearchFragment extends Fragment {
return new Pair<>(Collections.emptyList(), Collections.emptyList());
}
long feed = getArguments().getLong(ARG_FEED);
List<FeedItem> items = FeedSearcher.searchFeedItems(getContext(), query, feed);
List<Feed> feeds = FeedSearcher.searchFeeds(getContext(), query);
List<FeedItem> items = FeedSearcher.searchFeedItems(query, feed);
List<Feed> feeds = FeedSearcher.searchFeeds(query);
return new Pair<>(items, feeds);
}

View File

@ -8,8 +8,6 @@ import androidx.core.util.Consumer;
import com.google.android.material.snackbar.Snackbar;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
@ -66,9 +64,6 @@ public class FeedMultiSelectActionHandler {
preferenceSwitchDialog.openDialog();
}
private static final DecimalFormat SPEED_FORMAT =
new DecimalFormat("0.00", DecimalFormatSymbols.getInstance(Locale.US));
private void playbackSpeedPrefHandler() {
PlaybackSpeedFeedSettingDialogBinding viewBinding =
PlaybackSpeedFeedSettingDialogBinding.inflate(activity.getLayoutInflater());

View File

@ -15,8 +15,6 @@ import de.danoeh.antennapod.net.sync.gpoddernet.model.GpodnetTag;
* Use the newInstance method of this class to create a new TagFragment.
*/
public class TagFragment extends PodcastListFragment {
private static final String TAG = "TagFragment";
private static final int PODCAST_COUNT = 50;
private GpodnetTag tag;

View File

@ -10,7 +10,6 @@ import de.danoeh.antennapod.dialog.ChooseDataFolderDialog;
import java.io.File;
public class StoragePreferencesFragment extends PreferenceFragmentCompat {
private static final String TAG = "StoragePrefFragment";
private static final String PREF_CHOOSE_DATA_DIR = "prefChooseDataDir";
private static final String PREF_IMPORT_EXPORT = "prefImportExport";

View File

@ -11,8 +11,6 @@ import de.danoeh.antennapod.fragment.QueueFragment;
public class SwipePreferencesFragment extends PreferenceFragmentCompat {
private static final String PREF_SWIPE_FEED = "prefSwipeFeed";
private static final String PREF_SWIPE_QUEUE = "prefSwipeQueue";
//private static final String PREF_SWIPE_INBOX = "prefSwipeInbox";
//private static final String PREF_SWIPE_EPISODES = "prefSwipeEpisodes";
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {

View File

@ -17,9 +17,6 @@ import de.danoeh.antennapod.activity.PreferenceActivity;
* Displays the 'about->Contributors' pager screen.
*/
public class ContributorsPagerFragment extends Fragment {
public static final String TAG = "StatisticsFragment";
private static final int POS_DEVELOPERS = 0;
private static final int POS_TRANSLATORS = 1;
private static final int POS_SPECIAL_THANKS = 2;

View File

@ -250,18 +250,6 @@ public class GpodderAuthenticationFragment extends DialogFragment {
return false;
}
private GpodnetDevice findDevice(String id) {
if (devices == null) {
return null;
}
for (GpodnetDevice device : devices) {
if (device.getId().equals(id)) {
return device;
}
}
return null;
}
private void setupFinishView(View view) {
final Button sync = view.findViewById(R.id.butSyncNow);

View File

@ -104,7 +104,7 @@ public class EpisodeItemViewHolder extends RecyclerView.ViewHolder {
title.setText(item.getTitle());
leftPadding.setContentDescription(item.getTitle());
pubDate.setText(DateFormatter.formatAbbrev(activity, item.getPubDate()));
pubDate.setContentDescription(DateFormatter.formatForAccessibility(activity, item.getPubDate()));
pubDate.setContentDescription(DateFormatter.formatForAccessibility(item.getPubDate()));
isNew.setVisibility(item.isNew() ? View.VISIBLE : View.GONE);
isFavorite.setVisibility(item.isTagged(FeedItem.TAG_FAVORITE) ? View.VISIBLE : View.GONE);
isInQueue.setVisibility(item.isTagged(FeedItem.TAG_QUEUE) ? View.VISIBLE : View.GONE);

View File

@ -13,50 +13,43 @@ import de.danoeh.antennapod.core.R;
*/
public abstract class ConfirmationDialog {
private static final String TAG = ConfirmationDialog.class.getSimpleName();
private static final String TAG = ConfirmationDialog.class.getSimpleName();
private final Context context;
private final int titleId;
private final String message;
private final Context context;
private final int titleId;
private final String message;
private int positiveText;
private int negativeText;
private int positiveText;
public ConfirmationDialog(Context context, int titleId, int messageId) {
this(context, titleId, context.getString(messageId));
}
public ConfirmationDialog(Context context, int titleId, int messageId) {
this(context, titleId, context.getString(messageId));
}
public ConfirmationDialog(Context context, int titleId, String message) {
this.context = context;
this.titleId = titleId;
this.message = message;
}
public ConfirmationDialog(Context context, int titleId, String message) {
this.context = context;
this.titleId = titleId;
this.message = message;
}
private void onCancelButtonPressed(DialogInterface dialog) {
Log.d(TAG, "Dialog was cancelled");
dialog.dismiss();
}
private void onCancelButtonPressed(DialogInterface dialog) {
Log.d(TAG, "Dialog was cancelled");
dialog.dismiss();
}
public void setPositiveText(int id) {
this.positiveText = id;
}
public void setNegativeText(int id) {
this.negativeText = id;
public abstract void onConfirmButtonPressed(DialogInterface dialog);
public final AlertDialog createNewDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(titleId);
builder.setMessage(message);
builder.setPositiveButton(positiveText != 0 ? positiveText : R.string.confirm_label,
(dialog, which) -> onConfirmButtonPressed(dialog));
builder.setNegativeButton(R.string.cancel_label, (dialog, which) -> onCancelButtonPressed(dialog));
builder.setOnCancelListener(ConfirmationDialog.this::onCancelButtonPressed);
return builder.create();
}
public abstract void onConfirmButtonPressed(DialogInterface dialog);
public final AlertDialog createNewDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(titleId);
builder.setMessage(message);
builder.setPositiveButton(positiveText != 0 ? positiveText : R.string.confirm_label,
(dialog, which) -> onConfirmButtonPressed(dialog));
builder.setNegativeButton(negativeText != 0 ? negativeText : R.string.cancel_label,
(dialog, which) -> onCancelButtonPressed(dialog));
builder.setOnCancelListener(ConfirmationDialog.this::onCancelButtonPressed);
return builder.create();
}
}

View File

@ -16,9 +16,6 @@ import java.io.InputStream;
// see https://github.com/bumptech/glide/issues/699
class AudioCoverFetcher implements DataFetcher<InputStream> {
private static final String TAG = "AudioCoverFetcher";
private final String path;
private final Context context;

View File

@ -125,12 +125,9 @@ public class UserPreferences {
private static final String PREF_FAST_FORWARD_SECS = "prefFastForwardSecs";
private static final String PREF_REWIND_SECS = "prefRewindSecs";
private static final String PREF_QUEUE_LOCKED = "prefQueueLocked";
private static final String PREF_LEFT_VOLUME = "prefLeftVolume";
private static final String PREF_RIGHT_VOLUME = "prefRightVolume";
// Experimental
private static final String PREF_STEREO_TO_MONO = "PrefStereoToMono";
public static final String PREF_CAST_ENABLED = "prefCast"; //Used for enabling Chromecast support
public static final int EPISODE_CLEANUP_QUEUE = -1;
public static final int EPISODE_CLEANUP_NULL = -2;
public static final int EPISODE_CLEANUP_EXCEPT_FAVORITE = -3;
@ -827,10 +824,6 @@ public class UserPreferences {
return getMediaPlayer().equals(PREF_MEDIA_PLAYER_EXOPLAYER);
}
public static void enableSonic() {
prefs.edit().putString(PREF_MEDIA_PLAYER, "sonic").apply();
}
public static void enableExoplayer() {
prefs.edit().putString(PREF_MEDIA_PLAYER, PREF_MEDIA_PLAYER_EXOPLAYER).apply();
}
@ -956,13 +949,6 @@ public class UserPreferences {
return getUpdateTimeOfDay().length == 2;
}
/**
* Evaluates whether Cast support (Chromecast, Audio Cast, etc) is enabled on the preferences.
*/
public static boolean isCastEnabled() {
return prefs.getBoolean(PREF_CAST_ENABLED, false);
}
public enum BackButtonBehavior {
DEFAULT, OPEN_DRAWER, DOUBLE_TAP, SHOW_PROMPT, GO_TO_PAGE
}
@ -1059,9 +1045,4 @@ public class UserPreferences {
public static boolean shouldShowSubscriptionTitle() {
return prefs.getBoolean(PREF_SUBSCRIPTION_TITLE, false);
}
public static void setSubscriptionTitleSetting(boolean showTitle) {
prefs.edit().putBoolean(PREF_SUBSCRIPTION_TITLE, showTitle).apply();
}
}

View File

@ -9,7 +9,6 @@ import de.danoeh.antennapod.core.storage.DBTasks;
import de.danoeh.antennapod.parser.feed.FeedHandlerResult;
public class FeedSyncTask {
private static final String TAG = "FeedParserTask";
private final DownloadRequest request;
private final Context context;
private DownloadStatus downloadStatus;

View File

@ -713,7 +713,6 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
return stream;
}
/**
* Releases internally used resources. This method should only be called when the object is not used anymore.
*/
@ -738,16 +737,6 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
releaseWifiLockIfNecessary();
}
/**
* Releases internally used resources. This method should only be called when the object is not used anymore.
* This method is executed on an internal executor service.
*/
@Override
public void shutdownQuietly() {
executor.submit(this::shutdown);
executor.shutdown();
}
@Override
public void setVideoSurface(final SurfaceHolder surface) {
executor.submit(() -> {

View File

@ -82,7 +82,6 @@ import de.danoeh.antennapod.core.util.gui.NotificationUtils;
import de.danoeh.antennapod.core.util.playback.PlayableUtils;
import de.danoeh.antennapod.core.util.playback.PlaybackServiceStarter;
import de.danoeh.antennapod.core.widget.WidgetUpdater;
import de.danoeh.antennapod.model.feed.Chapter;
import de.danoeh.antennapod.model.feed.Feed;
import de.danoeh.antennapod.model.feed.FeedItem;
import de.danoeh.antennapod.model.feed.FeedMedia;
@ -1663,23 +1662,14 @@ public class PlaybackService extends MediaBrowserServiceCompat {
mediaPlayer.setStartWhenPrepared(s);
}
public void seekTo(final int t) {
mediaPlayer.seekTo(t);
}
private void seekDelta(final int d) {
mediaPlayer.seekDelta(d);
}
/**
* Seek to the start of the specified chapter.
*/
public void seekToChapter(Chapter c) {
seekTo((int) c.getStart());
}
/**
* call getDuration() on mediaplayer or return INVALID_TIME if player is in
* an invalid state.
@ -1792,7 +1782,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
public void onPlayFromSearch(String query, Bundle extras) {
Log.d(TAG, "onPlayFromSearch query=" + query + " extras=" + extras.toString());
List<FeedItem> results = FeedSearcher.searchFeedItems(getBaseContext(), query, 0);
List<FeedItem> results = FeedSearcher.searchFeedItems(query, 0);
if (results.size() > 0 && results.get(0).getMedia() != null) {
FeedMedia media = results.get(0).getMedia();
startPlaying(media, false);

View File

@ -36,10 +36,6 @@ class PlaybackServiceStateManager {
isInForeground = false;
}
boolean isInForeground() {
return isInForeground;
}
boolean hasReceivedValidStartCommand() {
return hasReceivedValidStartCommand;
}

View File

@ -176,7 +176,7 @@ public final class DBTasks {
media.setDownloaded(false);
media.setFile_url(null);
DBWriter.setFeedMedia(media);
EventBus.getDefault().post(FeedItemEvent.deletedMedia(media.getItem()));
EventBus.getDefault().post(FeedItemEvent.updated(media.getItem()));
EventBus.getDefault().post(new MessageEvent(context.getString(R.string.error_file_not_found)));
}
@ -230,36 +230,7 @@ public final class DBTasks {
UserPreferences.getEpisodeCleanupAlgorithm().performCleanup(context);
}
/**
* Returns the successor of a FeedItem in the queue.
*
* @param itemId ID of the FeedItem
* @param queue Used for determining the successor of the item. If this parameter is null, the method will load
* the queue from the database in the same thread.
* @return Successor of the FeedItem or null if the FeedItem is not in the queue or has no successor.
*/
public static FeedItem getQueueSuccessorOfItem(final long itemId, List<FeedItem> queue) {
FeedItem result = null;
if (queue == null) {
queue = DBReader.getQueue();
}
if (queue != null) {
Iterator<FeedItem> iterator = queue.iterator();
while (iterator.hasNext()) {
FeedItem item = iterator.next();
if (item.getId() == itemId) {
if (iterator.hasNext()) {
result = iterator.next();
}
break;
}
}
}
return result;
}
private static Feed searchFeedByIdentifyingValueOrID(PodDBAdapter adapter,
Feed feed) {
private static Feed searchFeedByIdentifyingValueOrID(Feed feed) {
if (feed.getId() != 0) {
return DBReader.getFeed(feed.getId());
} else {
@ -322,7 +293,7 @@ public final class DBTasks {
adapter.open();
// Look up feed in the feedslist
final Feed savedFeed = searchFeedByIdentifyingValueOrID(adapter, newFeed);
final Feed savedFeed = searchFeedByIdentifyingValueOrID(newFeed);
if (savedFeed == null) {
Log.d(TAG, "Found no existing Feed with title "
+ newFeed.getTitle() + ". Adding as new one.");
@ -456,7 +427,7 @@ public final class DBTasks {
if (savedFeed == null) {
DBWriter.addNewFeed(context, newFeed).get();
// Update with default values that are set in database
resultFeed = searchFeedByIdentifyingValueOrID(adapter, newFeed);
resultFeed = searchFeedByIdentifyingValueOrID(newFeed);
} else {
DBWriter.setCompleteFeed(savedFeed).get();
}
@ -487,15 +458,13 @@ public final class DBTasks {
/**
* Searches the FeedItems of a specific Feed for a given string.
*
* @param context Used for accessing the DB.
* @param feedID The id of the feed whose items should be searched.
* @param query The search string.
* @return A FutureTask object that executes the search request
* and returns the search result as a List of FeedItems.
*/
public static FutureTask<List<FeedItem>> searchFeedItems(final Context context,
final long feedID, final String query) {
return new FutureTask<>(new QueryTask<List<FeedItem>>(context) {
public static FutureTask<List<FeedItem>> searchFeedItems(final long feedID, final String query) {
return new FutureTask<>(new QueryTask<List<FeedItem>>() {
@Override
public void execute(PodDBAdapter adapter) {
Cursor searchResult = adapter.searchItems(feedID, query);
@ -507,8 +476,8 @@ public final class DBTasks {
});
}
public static FutureTask<List<Feed>> searchFeeds(final Context context, final String query) {
return new FutureTask<>(new QueryTask<List<Feed>>(context) {
public static FutureTask<List<Feed>> searchFeeds(final String query) {
return new FutureTask<>(new QueryTask<List<Feed>>() {
@Override
public void execute(PodDBAdapter adapter) {
Cursor cursor = adapter.searchFeeds(query);
@ -533,7 +502,7 @@ public final class DBTasks {
abstract static class QueryTask<T> implements Callable<T> {
private T result;
public QueryTask(Context context) {
public QueryTask() {
}
@Override

View File

@ -13,7 +13,6 @@ import org.greenrobot.eventbus.EventBus;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Locale;
@ -142,7 +141,7 @@ public class DBWriter {
.build();
SynchronizationQueueSink.enqueueEpisodeActionIfSynchronizationIsActive(context, action);
}
EventBus.getDefault().post(FeedItemEvent.deletedMedia(Collections.singletonList(media.getItem())));
EventBus.getDefault().post(FeedItemEvent.updated(media.getItem()));
return true;
}
@ -550,7 +549,7 @@ public class DBWriter {
adapter.addFavoriteItem(item);
adapter.close();
item.addTag(FeedItem.TAG_FAVORITE);
EventBus.getDefault().post(FavoritesEvent.added(item));
EventBus.getDefault().post(new FavoritesEvent());
EventBus.getDefault().post(FeedItemEvent.updated(item));
});
}
@ -561,7 +560,7 @@ public class DBWriter {
adapter.removeFavoriteItem(item);
adapter.close();
item.removeTag(FeedItem.TAG_FAVORITE);
EventBus.getDefault().post(FavoritesEvent.removed(item));
EventBus.getDefault().post(new FavoritesEvent());
EventBus.getDefault().post(FeedItemEvent.updated(item));
});
}

View File

@ -1,6 +1,5 @@
package de.danoeh.antennapod.core.storage;
import android.content.Context;
import androidx.annotation.NonNull;
import de.danoeh.antennapod.model.feed.Feed;
import de.danoeh.antennapod.model.feed.FeedItem;
@ -19,9 +18,9 @@ public class FeedSearcher {
}
@NonNull
public static List<FeedItem> searchFeedItems(final Context context, final String query, final long selectedFeed) {
public static List<FeedItem> searchFeedItems(final String query, final long selectedFeed) {
try {
FutureTask<List<FeedItem>> itemSearchTask = DBTasks.searchFeedItems(context, selectedFeed, query);
FutureTask<List<FeedItem>> itemSearchTask = DBTasks.searchFeedItems(selectedFeed, query);
itemSearchTask.run();
return itemSearchTask.get();
} catch (ExecutionException | InterruptedException e) {
@ -31,9 +30,9 @@ public class FeedSearcher {
}
@NonNull
public static List<Feed> searchFeeds(final Context context, final String query) {
public static List<Feed> searchFeeds(final String query) {
try {
FutureTask<List<Feed>> feedSearchTask = DBTasks.searchFeeds(context, query);
FutureTask<List<Feed>> feedSearchTask = DBTasks.searchFeeds(query);
feedSearchTask.run();
return feedSearchTask.get();
} catch (ExecutionException | InterruptedException e) {

View File

@ -37,7 +37,7 @@ public class DateFormatter {
return android.text.format.DateUtils.formatDateTime(context, date.getTime(), format);
}
public static String formatForAccessibility(final Context context, final Date date) {
public static String formatForAccessibility(final Date date) {
if (date == null) {
return "";
}

View File

@ -5,7 +5,6 @@ import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkCapabilities;
import android.net.NetworkInfo;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.text.TextUtils;
@ -146,18 +145,6 @@ public class NetworkUtils {
return selectedNetworks.contains(Integer.toString(wm.getConnectionInfo().getNetworkId()));
}
/**
* Returns the SSID of the wifi connection, or <code>null</code> if there is no wifi.
*/
public static String getWifiSsid() {
WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
if (wifiInfo != null) {
return wifiInfo.getSSID();
}
return null;
}
public static boolean wasDownloadBlocked(Throwable throwable) {
String message = throwable.getMessage();
if (message != null) {

View File

@ -10,8 +10,6 @@ import android.os.BatteryManager;
*/
public class PowerUtils {
private static final String TAG = "PowerUtils";
private PowerUtils() {
}

View File

@ -6,8 +6,6 @@ import android.support.v4.media.session.PlaybackStateCompat;
import android.support.wearable.media.MediaControlConstants;
public class WearMediaSession {
public static final String TAG = "WearMediaSession";
static void sessionStateAddActionForWear(PlaybackStateCompat.Builder sessionState, String actionName,
CharSequence name, int icon) {
PlaybackStateCompat.CustomAction.Builder actionBuilder =

View File

@ -1,26 +1,7 @@
package de.danoeh.antennapod.event;
import de.danoeh.antennapod.model.feed.FeedItem;
public class FavoritesEvent {
public enum Action {
ADDED, REMOVED
}
private final Action action;
private final FeedItem item;
private FavoritesEvent(Action action, FeedItem item) {
this.action = action;
this.item = item;
}
public static FavoritesEvent added(FeedItem item) {
return new FavoritesEvent(Action.ADDED, item);
}
public static FavoritesEvent removed(FeedItem item) {
return new FavoritesEvent(Action.REMOVED, item);
public FavoritesEvent() {
}
}

View File

@ -9,33 +9,17 @@ import java.util.List;
import de.danoeh.antennapod.model.feed.FeedItem;
public class FeedItemEvent {
public enum Action {
UPDATE, DELETE_MEDIA
}
@NonNull
private final Action action;
@NonNull public final List<FeedItem> items;
private FeedItemEvent(@NonNull Action action, @NonNull List<FeedItem> items) {
this.action = action;
public FeedItemEvent(@NonNull List<FeedItem> items) {
this.items = items;
}
public static FeedItemEvent deletedMedia(List<FeedItem> items) {
return new FeedItemEvent(Action.DELETE_MEDIA, items);
}
public static FeedItemEvent deletedMedia(FeedItem... items) {
return deletedMedia(Arrays.asList(items));
}
public static FeedItemEvent updated(List<FeedItem> items) {
return new FeedItemEvent(Action.UPDATE, items);
return new FeedItemEvent(items);
}
public static FeedItemEvent updated(FeedItem... items) {
return updated(Arrays.asList(items));
return new FeedItemEvent(Arrays.asList(items));
}
}

View File

@ -226,10 +226,6 @@ public class FeedMedia extends FeedFile implements Playable {
return mime_type;
}
public void setMime_type(String mime_type) {
this.mime_type = mime_type;
}
@Nullable
public FeedItem getItem() {
return item;

View File

@ -19,7 +19,6 @@ import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
@ -212,45 +211,6 @@ public class GpodnetService implements ISyncService {
}
}
/**
* Returns synchronization status of devices.
* <p/>
* This method requires authentication.
*
* @throws GpodnetServiceAuthenticationException If there is an authentication error.
*/
public List<List<String>> getSynchronizedDevices() throws GpodnetServiceException {
requireLoggedIn();
try {
URL url = new URI(baseScheme, null, baseHost, basePort,
String.format("/api/2/sync-devices/%s.json", username), null, null).toURL();
Request.Builder request = new Request.Builder().url(url);
String response = executeRequest(request);
JSONObject syncStatus = new JSONObject(response);
List<List<String>> result = new ArrayList<>();
JSONArray synchronizedDevices = syncStatus.getJSONArray("synchronized");
for (int i = 0; i < synchronizedDevices.length(); i++) {
JSONArray groupDevices = synchronizedDevices.getJSONArray(i);
List<String> group = new ArrayList<>();
for (int j = 0; j < groupDevices.length(); j++) {
group.add(groupDevices.getString(j));
}
result.add(group);
}
JSONArray notSynchronizedDevices = syncStatus.getJSONArray("not-synchronized");
for (int i = 0; i < notSynchronizedDevices.length(); i++) {
result.add(Collections.singletonList(notSynchronizedDevices.getString(i)));
}
return result;
} catch (JSONException | MalformedURLException | URISyntaxException e) {
e.printStackTrace();
throw new GpodnetServiceException(e);
}
}
/**
* Configures the device of a given user.
* <p/>
@ -287,39 +247,6 @@ public class GpodnetService implements ISyncService {
}
}
/**
* Links devices for synchronization.
* <p/>
* This method requires authentication.
*
* @throws GpodnetServiceAuthenticationException If there is an authentication error.
*/
public void linkDevices(@NonNull List<String> deviceIds) throws GpodnetServiceException {
requireLoggedIn();
try {
final URL url = new URI(baseScheme, null, baseHost, basePort,
String.format("/api/2/sync-devices/%s.json", username), null, null).toURL();
JSONObject jsonContent = new JSONObject();
JSONArray group = new JSONArray();
for (String deviceId : deviceIds) {
group.put(deviceId);
}
JSONArray synchronizedGroups = new JSONArray();
synchronizedGroups.put(group);
jsonContent.put("synchronize", synchronizedGroups);
jsonContent.put("stop-synchronize", new JSONArray());
Log.d("aaaa", jsonContent.toString());
RequestBody body = RequestBody.create(JSON, jsonContent.toString());
Request.Builder request = new Request.Builder().post(body).url(url);
executeRequest(request);
} catch (JSONException | MalformedURLException | URISyntaxException e) {
e.printStackTrace();
throw new GpodnetServiceException(e);
}
}
/**
* Uploads the subscriptions of a specific device.
* <p/>

View File

@ -8,7 +8,6 @@ import org.xml.sax.Attributes;
import de.danoeh.antennapod.model.feed.FeedItem;
public class DublinCore extends Namespace {
private static final String TAG = "NSDublinCore";
public static final String NSTAG = "dc";
public static final String NSURI = "http://purl.org/dc/elements/1.1/";

View File

@ -5,10 +5,7 @@ import de.danoeh.antennapod.parser.feed.element.SyndElement;
import org.xml.sax.Attributes;
public abstract class Namespace {
public static final String NSTAG = null;
public static final String NSURI = null;
/** Called by a Feedhandler when in startElement and it detects a namespace element
/** Called by a Feedhandler when in startElement and it detects a namespace element
* @return The SyndElement to push onto the stack
* */
public abstract SyndElement handleElementStart(String localName, HandlerState state, Attributes attributes);

View File

@ -30,9 +30,4 @@ public class ID3Chapter extends Chapter {
public int getChapterType() {
return CHAPTERTYPE_ID3CHAPTER;
}
public String getId3ID() {
return id3ID;
}
}

View File

@ -3,14 +3,6 @@ package de.danoeh.antennapod.parser.media.vorbis;
public class VorbisCommentReaderException extends Exception {
private static final long serialVersionUID = 1L;
public VorbisCommentReaderException() {
super();
}
public VorbisCommentReaderException(String message, Throwable cause) {
super(message, cause);
}
public VorbisCommentReaderException(String message) {
super(message);
}

View File

@ -179,12 +179,6 @@ public abstract class PlaybackServiceMediaPlayer {
*/
public abstract void shutdown();
/**
* Releases internally used resources. This method should only be called when the object is not used anymore.
* This method is executed on an internal executor service.
*/
public abstract void shutdownQuietly();
public abstract void setVideoSurface(SurfaceHolder surface);
public abstract void resetVideoSurface();

View File

@ -23,10 +23,6 @@ public enum PlayerStatus {
statusValue = val;
}
public static PlayerStatus fromOrdinal(int o) {
return fromOrdinalLookup[o];
}
public boolean isAtLeast(PlayerStatus other) {
return other == null || this.statusValue >= other.statusValue;
}

View File

@ -13,7 +13,6 @@ import com.google.android.gms.common.GoogleApiAvailability;
* network.
*/
public abstract class CastEnabledActivity extends AppCompatActivity {
private static final String TAG = "CastEnabledActivity";
private boolean canCast = false;
@Override

View File

@ -455,11 +455,6 @@ public class CastPsmp extends PlaybackServiceMediaPlayer {
remoteMediaClient.unregisterCallback(remoteMediaClientCallback);
}
@Override
public void shutdownQuietly() {
shutdown();
}
@Override
public void setVideoSurface(SurfaceHolder surface) {
throw new UnsupportedOperationException("Setting Video Surface unsupported in Remote Media Player");