Weaken declaration access

This commit is contained in:
Martin Fietz 2018-01-14 18:04:53 +01:00
parent eaa9947869
commit b86b6caec8
115 changed files with 410 additions and 409 deletions

View File

@ -32,8 +32,8 @@ import de.test.antennapod.util.syndication.feedgenerator.RSS2Generator;
public class FeedHandlerTest extends InstrumentationTestCase {
private static final String FEEDS_DIR = "testfeeds";
File file = null;
OutputStream outputStream = null;
private File file = null;
private OutputStream outputStream = null;
protected void setUp() throws Exception {
super.setUp();

View File

@ -27,12 +27,12 @@ import static de.test.antennapod.storage.DBTestUtils.saveFeedlist;
public class DBCleanupTests extends InstrumentationTestCase {
private static final String TAG = "DBTasksTest";
protected static final int EPISODE_CACHE_SIZE = 5;
static final int EPISODE_CACHE_SIZE = 5;
private final int cleanupAlgorithm;
protected Context context;
Context context;
protected File destFolder;
private File destFolder;
public DBCleanupTests() {
this.cleanupAlgorithm = UserPreferences.EPISODE_CLEANUP_DEFAULT;
@ -104,9 +104,9 @@ public class DBCleanupTests extends InstrumentationTestCase {
}
}
protected void populateItems(final int numItems, Feed feed, List<FeedItem> items,
List<File> files, int itemState, boolean addToQueue,
boolean addToFavorites) throws IOException {
void populateItems(final int numItems, Feed feed, List<FeedItem> items,
List<File> files, int itemState, boolean addToQueue,
boolean addToFavorites) throws IOException {
for (int i = 0; i < numItems; i++) {
Date itemDate = new Date(numItems - i);
Date playbackCompletionDate = null;

View File

@ -19,7 +19,7 @@ import de.danoeh.antennapod.core.util.flattr.FlattrStatus;
/**
* Utility methods for DB* tests.
*/
public class DBTestUtils {
class DBTestUtils {
/**
* Use this method when tests don't involve chapters.

View File

@ -33,8 +33,8 @@ import de.danoeh.antennapod.core.storage.PodDBAdapter;
public class PlaybackSonicTest extends ActivityInstrumentationTestCase2<MainActivity> {
private static final String TAG = PlaybackTest.class.getSimpleName();
public static final int EPISODES_DRAWER_LIST_INDEX = 1;
public static final int QUEUE_DRAWER_LIST_INDEX = 0;
private static final int EPISODES_DRAWER_LIST_INDEX = 1;
private static final int QUEUE_DRAWER_LIST_INDEX = 0;
private Solo solo;
private UITestUtils uiTestUtils;

View File

@ -30,8 +30,8 @@ import de.danoeh.antennapod.core.storage.PodDBAdapter;
public class PlaybackTest extends ActivityInstrumentationTestCase2<MainActivity> {
private static final String TAG = PlaybackTest.class.getSimpleName();
public static final int EPISODES_DRAWER_LIST_INDEX = 1;
public static final int QUEUE_DRAWER_LIST_INDEX = 0;
private static final int EPISODES_DRAWER_LIST_INDEX = 1;
private static final int QUEUE_DRAWER_LIST_INDEX = 0;
private Solo solo;
private UITestUtils uiTestUtils;

View File

@ -36,16 +36,16 @@ import de.test.antennapod.util.syndication.feedgenerator.RSS2Generator;
* Utility methods for UI tests.
* Starts a web server that hosts feeds, episodes and images.
*/
public class UITestUtils {
class UITestUtils {
private static final String TAG = UITestUtils.class.getSimpleName();
private static final String DATA_FOLDER = "test/UITestUtils";
public static final int NUM_FEEDS = 5;
public static final int NUM_ITEMS_PER_FEED = 10;
private static final int NUM_FEEDS = 5;
private static final int NUM_ITEMS_PER_FEED = 10;
public static final String TEST_FILE_NAME = "3sec.mp3";
private static final String TEST_FILE_NAME = "3sec.mp3";
private Context context;

View File

@ -88,15 +88,15 @@ public abstract class NanoHTTPD {
* This is required as the Keep-Alive HTTP connections would otherwise
* block the socket reading thread forever (or as long the browser is open).
*/
public static final int SOCKET_READ_TIMEOUT = 5000;
private static final int SOCKET_READ_TIMEOUT = 5000;
/**
* Common mime type for dynamic content: plain text
*/
public static final String MIME_PLAINTEXT = "text/plain";
private static final String MIME_PLAINTEXT = "text/plain";
/**
* Common mime type for dynamic content: html
*/
public static final String MIME_HTML = "text/html";
private static final String MIME_HTML = "text/html";
/**
* Pseudo-Parameter to use to store the actual query string in the parameters map for later re-processing.
*/
@ -118,14 +118,14 @@ public abstract class NanoHTTPD {
/**
* Constructs an HTTP server on given port.
*/
public NanoHTTPD(int port) {
NanoHTTPD(int port) {
this(null, port);
}
/**
* Constructs an HTTP server on given hostname and port.
*/
public NanoHTTPD(String hostname, int port) {
private NanoHTTPD(String hostname, int port) {
this.hostname = hostname;
this.myPort = port;
setTempFileManagerFactory(new DefaultTempFileManagerFactory());
@ -226,7 +226,7 @@ public abstract class NanoHTTPD {
*
* @param socket the {@link Socket} for the connection.
*/
public synchronized void registerConnection(Socket socket) {
private synchronized void registerConnection(Socket socket) {
openConnections.add(socket);
}
@ -236,14 +236,14 @@ public abstract class NanoHTTPD {
* @param socket
* the {@link Socket} for the connection.
*/
public synchronized void unRegisterConnection(Socket socket) {
private synchronized void unRegisterConnection(Socket socket) {
openConnections.remove(socket);
}
/**
* Forcibly closes all connections that are open.
*/
public synchronized void closeAllConnections() {
private synchronized void closeAllConnections() {
for (Socket socket : openConnections) {
safeClose(socket);
}
@ -253,7 +253,7 @@ public abstract class NanoHTTPD {
return myServerSocket == null ? -1 : myServerSocket.getLocalPort();
}
public final boolean wasStarted() {
private boolean wasStarted() {
return myServerSocket != null && myThread != null;
}
@ -288,7 +288,7 @@ public abstract class NanoHTTPD {
* @param session The HTTP session
* @return HTTP response, see class Response for details
*/
public Response serve(IHTTPSession session) {
Response serve(IHTTPSession session) {
Map<String, String> files = new ArrayMap<>();
Method method = session.getMethod();
if (Method.PUT.equals(method) || Method.POST.equals(method)) {
@ -312,7 +312,7 @@ public abstract class NanoHTTPD {
* @param str the percent encoded <code>String</code>
* @return expanded form of the input, for example "foo%20bar" becomes "foo bar"
*/
protected String decodePercent(String str) {
private String decodePercent(String str) {
String decoded = null;
try {
decoded = URLDecoder.decode(str, "UTF8");
@ -341,7 +341,7 @@ public abstract class NanoHTTPD {
* @param queryString a query string pulled from the URL.
* @return a map of <code>String</code> (parameter name) to <code>List&lt;String&gt;</code> (a list of the values supplied).
*/
protected Map<String, List<String>> decodeParameters(String queryString) {
private Map<String, List<String>> decodeParameters(String queryString) {
Map<String, List<String>> parms = new ArrayMap<>();
if (queryString != null) {
StringTokenizer st = new StringTokenizer(queryString, "&");
@ -372,7 +372,7 @@ public abstract class NanoHTTPD {
*
* @param asyncRunner new strategy for handling threads.
*/
public void setAsyncRunner(AsyncRunner asyncRunner) {
private void setAsyncRunner(AsyncRunner asyncRunner) {
this.asyncRunner = asyncRunner;
}
@ -387,7 +387,7 @@ public abstract class NanoHTTPD {
*
* @param tempFileManagerFactory new strategy for handling temp files.
*/
public void setTempFileManagerFactory(TempFileManagerFactory tempFileManagerFactory) {
private void setTempFileManagerFactory(TempFileManagerFactory tempFileManagerFactory) {
this.tempFileManagerFactory = tempFileManagerFactory;
}
@ -610,7 +610,7 @@ public abstract class NanoHTTPD {
/**
* Sends given response to the socket.
*/
protected void send(OutputStream outputStream) {
void send(OutputStream outputStream) {
String mime = mimeType;
SimpleDateFormat gmtFrmt = new SimpleDateFormat("E, d MMM yyyy HH:mm:ss 'GMT'", Locale.US);
gmtFrmt.setTimeZone(TimeZone.getTimeZone("GMT"));
@ -655,13 +655,13 @@ public abstract class NanoHTTPD {
}
}
protected void sendContentLengthHeaderIfNotAlreadyPresent(PrintWriter pw, Map<String, String> header, int size) {
void sendContentLengthHeaderIfNotAlreadyPresent(PrintWriter pw, Map<String, String> header, int size) {
if (!headerAlreadySent(header, "content-length")) {
pw.print("Content-Length: "+ size +"\r\n");
}
}
protected void sendConnectionHeaderIfNotAlreadyPresent(PrintWriter pw, Map<String, String> header) {
void sendConnectionHeaderIfNotAlreadyPresent(PrintWriter pw, Map<String, String> header) {
if (!headerAlreadySent(header, "connection")) {
pw.print("Connection: keep-alive\r\n");
}

View File

@ -19,7 +19,7 @@ public class AtomGenerator implements FeedGenerator{
private static final String NS_ATOM = "http://www.w3.org/2005/Atom";
public static final long FEATURE_USE_RFC3339LOCAL = 1;
private static final long FEATURE_USE_RFC3339LOCAL = 1;
@Override
public void writeFeed(Feed feed, OutputStream outputStream, String encoding, long flags) throws IOException {

View File

@ -7,7 +7,7 @@ import java.io.IOException;
/**
* Utility methods for FeedGenerator
*/
public class GeneratorUtil {
class GeneratorUtil {
public static void addPaymentLink(XmlSerializer xml, String paymentLink, boolean withNamespace) throws IOException {
String ns = (withNamespace) ? "http://www.w3.org/2005/Atom" : null;

View File

@ -2,6 +2,6 @@ package de.danoeh.antennapod.config;
import de.danoeh.antennapod.core.CastCallbacks;
public class CastCallbackImpl implements CastCallbacks {
class CastCallbackImpl implements CastCallbacks {
}

View File

@ -5,7 +5,7 @@ import de.danoeh.antennapod.core.preferences.UserPreferences;
/**
* Implements functions from PreferenceController that are flavor dependent.
*/
public class PreferenceControllerFlavorHelper {
class PreferenceControllerFlavorHelper {
static void setupFlavoredUI(PreferenceController.PreferenceUI ui) {
ui.findPreference(UserPreferences.PREF_CAST_ENABLED).setEnabled(false);

View File

@ -19,7 +19,7 @@ import de.danoeh.antennapod.dialog.VariableSpeedDialog;
* Activity for playing audio files.
*/
public class AudioplayerActivity extends MediaplayerInfoActivity {
public static final String TAG = "AudioPlayerActivity";
private static final String TAG = "AudioPlayerActivity";
private AtomicBoolean isSetup = new AtomicBoolean(false);

View File

@ -13,7 +13,7 @@ import de.danoeh.antennapod.core.service.playback.PlaybackService;
* Activity for controlling the remote playback on a Cast device.
*/
public class CastplayerActivity extends MediaplayerInfoActivity {
public static final String TAG = "CastPlayerActivity";
private static final String TAG = "CastPlayerActivity";
private AtomicBoolean isSetup = new AtomicBoolean(false);

View File

@ -82,7 +82,7 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
public static final String PREF_NAME = "MainActivityPrefs";
public static final String PREF_IS_FIRST_LAUNCH = "prefMainActivityIsFirstLaunch";
public static final String PREF_LAST_FRAGMENT_TAG = "prefMainActivityLastFragmentTag";
private static final String PREF_LAST_FRAGMENT_TAG = "prefMainActivityLastFragmentTag";
public static final String EXTRA_NAV_TYPE = "nav_type";
public static final String EXTRA_NAV_INDEX = "nav_index";
@ -90,8 +90,8 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
public static final String EXTRA_FRAGMENT_ARGS = "fragment_args";
public static final String EXTRA_FEED_ID = "fragment_feed_id";
public static final String SAVE_BACKSTACK_COUNT = "backstackCount";
public static final String SAVE_TITLE = "title";
private static final String SAVE_BACKSTACK_COUNT = "backstackCount";
private static final String SAVE_TITLE = "title";
public static final String[] NAV_DRAWER_TAGS = {
QueueFragment.TAG,
@ -235,7 +235,7 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
}
}
public void showDrawerPreferencesDialog() {
private void showDrawerPreferencesDialog() {
final List<String> hiddenDrawerItems = UserPreferences.getHiddenDrawerItems();
String[] navLabels = new String[NAV_DRAWER_TAGS.length];
final boolean[] checked = new boolean[NAV_DRAWER_TAGS.length];
@ -269,7 +269,7 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
return (navDrawerData != null) ? navDrawerData.feeds : null;
}
public void loadFragment(int index, Bundle args) {
private void loadFragment(int index, Bundle args) {
Log.d(TAG, "loadFragment(index: " + index + ", args: " + args + ")");
if (index < navAdapter.getSubscriptionOffset()) {
String tag = navAdapter.getTags().get(index);

View File

@ -67,19 +67,19 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
private static final String PREFS = "MediaPlayerActivityPreferences";
private static final String PREF_SHOW_TIME_LEFT = "showTimeLeft";
protected PlaybackController controller;
PlaybackController controller;
protected TextView txtvPosition;
protected TextView txtvLength;
protected SeekBar sbPosition;
protected ImageButton butRev;
protected TextView txtvRev;
protected ImageButton butPlay;
protected ImageButton butFF;
protected TextView txtvFF;
protected ImageButton butSkip;
private TextView txtvPosition;
private TextView txtvLength;
SeekBar sbPosition;
private ImageButton butRev;
private TextView txtvRev;
private ImageButton butPlay;
private ImageButton butFF;
private TextView txtvFF;
private ImageButton butSkip;
protected boolean showTimeLeft = false;
private boolean showTimeLeft = false;
private boolean isFavorite = false;
@ -184,31 +184,31 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
};
}
protected static TextView getTxtvFFFromActivity(MediaplayerActivity activity) {
private static TextView getTxtvFFFromActivity(MediaplayerActivity activity) {
return activity.txtvFF;
}
protected static TextView getTxtvRevFromActivity(MediaplayerActivity activity) {
private static TextView getTxtvRevFromActivity(MediaplayerActivity activity) {
return activity.txtvRev;
}
protected void onSetSpeedAbilityChanged() {
private void onSetSpeedAbilityChanged() {
Log.d(TAG, "onSetSpeedAbilityChanged()");
updatePlaybackSpeedButton();
}
protected void onPlaybackSpeedChange() {
private void onPlaybackSpeedChange() {
updatePlaybackSpeedButtonText();
}
protected void onServiceQueried() {
private void onServiceQueried() {
supportInvalidateOptionsMenu();
}
protected void chooseTheme() {
void chooseTheme() {
setTheme(UserPreferences.getTheme());
}
protected void setScreenOn(boolean enable) {
void setScreenOn(boolean enable) {
}
@Override
@ -249,7 +249,7 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
*/
protected abstract void onBufferEnd();
protected void onBufferUpdate(float progress) {
private void onBufferUpdate(float progress) {
if (sbPosition != null) {
sbPosition.setSecondaryProgress((int) progress * sbPosition.getMax());
}
@ -258,7 +258,7 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
/**
* Current screen orientation.
*/
protected int orientation;
private int orientation;
@Override
protected void onStart() {
@ -619,7 +619,7 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
protected abstract void clearStatusMsg();
protected void onPositionObserverUpdate() {
void onPositionObserverUpdate() {
if (controller == null || txtvPosition == null || txtvLength == null) {
return;
}
@ -655,7 +655,7 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
* to the PlaybackService to ensure that the activity has the right
* FeedMedia object.
*/
protected boolean loadMediaInfo() {
boolean loadMediaInfo() {
Log.d(TAG, "loadMediaInfo()");
if(controller == null || controller.getMedia() == null) {
return false;
@ -669,11 +669,11 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
return true;
}
protected void updatePlaybackSpeedButton() {
void updatePlaybackSpeedButton() {
// Only meaningful on AudioplayerActivity, where it is overridden.
}
protected void updatePlaybackSpeedButtonText() {
void updatePlaybackSpeedButtonText() {
// Only meaningful on AudioplayerActivity, where it is overridden.
}
@ -763,7 +763,7 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
builder.create().show();
}
protected void setupGUI() {
void setupGUI() {
setContentView(getContentViewResourceId());
sbPosition = (SeekBar) findViewById(R.id.sbPosition);
txtvPosition = (TextView) findViewById(R.id.txtvPosition);
@ -837,7 +837,7 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
}
}
protected void onRewind() {
void onRewind() {
if (controller == null) {
return;
}
@ -845,14 +845,14 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
controller.seekTo(curr - UserPreferences.getRewindSecs() * 1000);
}
protected void onPlayPause() {
void onPlayPause() {
if(controller == null) {
return;
}
controller.playPause();
}
protected void onFastForward() {
void onFastForward() {
if (controller == null) {
return;
}
@ -862,7 +862,7 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
protected abstract int getContentViewResourceId();
void handleError(int errorCode) {
private void handleError(int errorCode) {
final AlertDialog.Builder errorDialog = new AlertDialog.Builder(this);
errorDialog.setTitle(R.string.error_label);
errorDialog.setMessage(MediaPlayerError.getErrorString(this, errorCode));
@ -875,7 +875,7 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
errorDialog.create().show();
}
float prog;
private float prog;
@Override
public void onProgressChanged (SeekBar seekBar,int progress, boolean fromUser) {

View File

@ -77,11 +77,11 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem
private static final int POS_CHAPTERS = 2;
private static final int NUM_CONTENT_FRAGMENTS = 3;
final String TAG = "MediaplayerInfoActivity";
private final String TAG = "MediaplayerInfoActivity";
private static final String PREFS = "AudioPlayerActivityPreferences";
private static final String PREF_KEY_SELECTED_FRAGMENT_POSITION = "selectedFragmentPosition";
public static final String[] NAV_DRAWER_TAGS = {
private static final String[] NAV_DRAWER_TAGS = {
QueueFragment.TAG,
EpisodesFragment.TAG,
SubscriptionFragment.TAG,
@ -91,8 +91,8 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem
NavListAdapter.SUBSCRIPTION_LIST_TAG
};
protected Button butPlaybackSpeed;
protected ImageButton butCastDisconnect;
Button butPlaybackSpeed;
ImageButton butCastDisconnect;
private DrawerLayout drawerLayout;
private NavListAdapter navAdapter;
private ListView navList;
@ -151,7 +151,7 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem
setTheme(UserPreferences.getNoTitleTheme());
}
protected void saveCurrentFragment() {
void saveCurrentFragment() {
if(pager == null) {
return;
}
@ -305,7 +305,7 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem
return true;
}
public void notifyMediaPositionChanged() {
private void notifyMediaPositionChanged() {
if(pagerAdapter == null) {
return;
}
@ -446,7 +446,7 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem
}
}
public void showDrawerPreferencesDialog() {
private void showDrawerPreferencesDialog() {
final List<String> hiddenDrawerItems = UserPreferences.getHiddenDrawerItems();
String[] navLabels = new String[NAV_DRAWER_TAGS.length];
final boolean[] checked = new boolean[NAV_DRAWER_TAGS.length];

View File

@ -83,7 +83,7 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
public static final String ARG_FEEDURL = "arg.feedurl";
// Optional argument: specify a title for the actionbar.
public static final String ARG_TITLE = "title";
public static final int RESULT_ERROR = 2;
private static final int RESULT_ERROR = 2;
private static final String TAG = "OnlineFeedViewActivity";
private static final int EVENTS = EventDistributor.FEED_LIST_UPDATE;
private volatile List<Feed> feeds;

View File

@ -68,7 +68,7 @@ public class OpmlImportBaseActivity extends AppCompatActivity {
}
}
protected void importUri(@Nullable Uri uri) {
void importUri(@Nullable Uri uri) {
if(uri == null) {
new MaterialDialog.Builder(this)
.content(R.string.opml_import_error_no_file)
@ -114,7 +114,7 @@ public class OpmlImportBaseActivity extends AppCompatActivity {
}
/** Starts the import process. */
protected void startImport() {
private void startImport() {
try {
Reader mReader = new InputStreamReader(getContentResolver().openInputStream(uri), LangUtils.UTF_8);
importWorker = new OpmlImportWorker(this, mReader) {
@ -144,7 +144,7 @@ public class OpmlImportBaseActivity extends AppCompatActivity {
}
}
protected boolean finishWhenCanceled() {
boolean finishWhenCanceled() {
return false;
}

View File

@ -173,7 +173,7 @@ public class VideoplayerActivity extends MediaplayerActivity {
progressIndicator.setVisibility(View.INVISIBLE);
}
View.OnTouchListener onVideoviewTouched = (v, event) -> {
private View.OnTouchListener onVideoviewTouched = (v, event) -> {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
videoControlsHider.stop();
toggleVideoControlsVisibility();
@ -187,7 +187,7 @@ public class VideoplayerActivity extends MediaplayerActivity {
};
@SuppressLint("NewApi")
void setupVideoControlsToggler() {
private void setupVideoControlsToggler() {
videoControlsHider.stop();
videoControlsHider.start();
}

View File

@ -61,7 +61,7 @@ public class GpodnetAuthenticationActivity extends AppCompatActivity {
private volatile String password;
private volatile GpodnetDevice selectedDevice;
View[] views;
private View[] views;
@Override
protected void onCreate(Bundle savedInstanceState) {

View File

@ -3,7 +3,7 @@ package de.danoeh.antennapod.adapter;
import de.danoeh.antennapod.core.feed.FeedItem;
import de.danoeh.antennapod.core.util.LongList;
public interface ActionButtonCallback {
interface ActionButtonCallback {
/** Is called when the action button of a list item has been pressed. */
void onActionButtonPressed(FeedItem item, LongList queueIds);
}

View File

@ -16,7 +16,7 @@ import de.danoeh.antennapod.core.storage.DownloadRequester;
* Utility methods for the action button that is displayed on the right hand side
* of a listitem.
*/
public class ActionButtonUtils {
class ActionButtonUtils {
private final int[] labels;
private final TypedArray drawables;

View File

@ -19,7 +19,7 @@ import de.danoeh.antennapod.core.util.ThemeUtils;
public class DownloadlistAdapter extends BaseAdapter {
public static final int SELECTION_NONE = -1;
private static final int SELECTION_NONE = -1;
private int selectedItemIndex;
private ItemAccess itemAccess;

View File

@ -48,10 +48,10 @@ import de.danoeh.antennapod.fragment.SubscriptionFragment;
public class NavListAdapter extends BaseAdapter
implements SharedPreferences.OnSharedPreferenceChangeListener {
public static final int VIEW_TYPE_COUNT = 3;
private static final int VIEW_TYPE_COUNT = 3;
public static final int VIEW_TYPE_NAV = 0;
public static final int VIEW_TYPE_SECTION_DIVIDER = 1;
public static final int VIEW_TYPE_SUBSCRIPTION = 2;
private static final int VIEW_TYPE_SUBSCRIPTION = 2;
/**
* a tag used as a placeholder to indicate if the subscription list should be displayed or not

View File

@ -24,7 +24,7 @@ import de.danoeh.antennapod.core.util.Converter;
*/
public class StatisticsListAdapter extends BaseAdapter {
private Context context;
List<DBReader.StatisticsItem> feedTime = new ArrayList<>();
private List<DBReader.StatisticsItem> feedTime = new ArrayList<>();
private boolean countAll = true;
public StatisticsListAdapter(Context context) {

View File

@ -31,7 +31,7 @@ public class ExportWorker {
DEFAULT_OUTPUT_NAME + "." + exportWriter.fileExtension()));
}
public ExportWorker(ExportWriter exportWriter, @NonNull File output) {
private ExportWorker(ExportWriter exportWriter, @NonNull File output) {
this.exportWriter = exportWriter;
this.output = output;
}

View File

@ -6,7 +6,7 @@ import de.danoeh.antennapod.core.ClientConfig;
/**
* Configures the ClientConfig class of the core package.
*/
public class ClientConfigurator {
class ClientConfigurator {
static {
ClientConfig.USER_AGENT = "AntennaPod/" + BuildConfig.VERSION_NAME;

View File

@ -34,12 +34,12 @@ public class EpisodesApplyActionFragment extends Fragment {
public String TAG = "EpisodeActionFragment";
public static final int ACTION_QUEUE = 1;
public static final int ACTION_MARK_PLAYED = 2;
public static final int ACTION_MARK_UNPLAYED = 4;
public static final int ACTION_DOWNLOAD = 8;
private static final int ACTION_QUEUE = 1;
private static final int ACTION_MARK_PLAYED = 2;
private static final int ACTION_MARK_UNPLAYED = 4;
private static final int ACTION_DOWNLOAD = 8;
public static final int ACTION_REMOVE = 16;
public static final int ACTION_ALL = ACTION_QUEUE | ACTION_MARK_PLAYED | ACTION_MARK_UNPLAYED
private static final int ACTION_ALL = ACTION_QUEUE | ACTION_MARK_PLAYED | ACTION_MARK_UNPLAYED
| ACTION_DOWNLOAD | ACTION_REMOVE;
private ListView mListView;

View File

@ -54,7 +54,7 @@ public class RatingDialog {
}
}
public static void rateNow() {
private static void rateNow() {
Context context = mContext.get();
if(context == null) {
return;
@ -67,11 +67,11 @@ public class RatingDialog {
saveRated();
}
public static boolean rated() {
private static boolean rated() {
return mPreferences.getBoolean(KEY_RATED, false);
}
public static void saveRated() {
private static void saveRated() {
mPreferences
.edit()
.putBoolean(KEY_RATED, true)

View File

@ -25,7 +25,7 @@ public class AddFeedFragment extends Fragment {
/**
* Preset value for url text field.
*/
public static final String ARG_FEED_URL = "feedurl";
private static final String ARG_FEED_URL = "feedurl";
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

View File

@ -69,24 +69,24 @@ public class AllEpisodesFragment extends Fragment {
private static final String PREF_SCROLL_POSITION = "scroll_position";
private static final String PREF_SCROLL_OFFSET = "scroll_offset";
protected RecyclerView recyclerView;
protected AllEpisodesRecycleAdapter listAdapter;
RecyclerView recyclerView;
AllEpisodesRecycleAdapter listAdapter;
private ProgressBar progLoading;
protected List<FeedItem> episodes;
List<FeedItem> episodes;
private List<Downloader> downloaderList;
private boolean itemsLoaded = false;
private boolean viewsCreated = false;
private boolean isUpdatingFeeds;
protected boolean isMenuInvalidationAllowed = false;
boolean isMenuInvalidationAllowed = false;
protected Subscription subscription;
Subscription subscription;
private LinearLayoutManager layoutManager;
protected boolean showOnlyNewEpisodes() { return false; }
protected String getPrefName() { return DEFAULT_PREF_NAME; }
boolean showOnlyNewEpisodes() { return false; }
String getPrefName() { return DEFAULT_PREF_NAME; }
@Override
public void onCreate(Bundle savedInstanceState) {
@ -165,7 +165,7 @@ public class AllEpisodesFragment extends Fragment {
}
}
protected void resetViewState() {
void resetViewState() {
viewsCreated = false;
listAdapter = null;
}
@ -299,10 +299,10 @@ public class AllEpisodesFragment extends Fragment {
R.layout.all_episodes_fragment);
}
protected View onCreateViewHelper(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState,
int fragmentResource) {
View onCreateViewHelper(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState,
int fragmentResource) {
super.onCreateView(inflater, container, savedInstanceState);
View root = inflater.inflate(fragmentResource, container, false);
@ -346,7 +346,7 @@ public class AllEpisodesFragment extends Fragment {
updateShowOnlyEpisodesListViewState();
}
protected AllEpisodesRecycleAdapter.ItemAccess itemAccess = new AllEpisodesRecycleAdapter.ItemAccess() {
private AllEpisodesRecycleAdapter.ItemAccess itemAccess = new AllEpisodesRecycleAdapter.ItemAccess() {
@Override
public int getCount() {
@ -459,7 +459,7 @@ public class AllEpisodesFragment extends Fragment {
private void updateShowOnlyEpisodesListViewState() {
}
protected void loadItems() {
void loadItems() {
if(subscription != null) {
subscription.unsubscribe();
}
@ -483,7 +483,7 @@ public class AllEpisodesFragment extends Fragment {
}, error -> Log.e(TAG, Log.getStackTraceString(error)));
}
protected List<FeedItem> loadData() {
List<FeedItem> loadData() {
return DBReader.getRecentlyPublishedEpisodes(RECENT_EPISODES_LIMIT);
}

View File

@ -25,7 +25,7 @@ public class DownloadsFragment extends Fragment {
public static final String ARG_SELECTED_TAB = "selected_tab";
public static final int POS_RUNNING = 0;
public static final int POS_COMPLETED = 1;
private static final int POS_COMPLETED = 1;
public static final int POS_LOG = 2;
private static final String PREF_LAST_TAB_POSITION = "tab_position";

View File

@ -21,10 +21,10 @@ public class EpisodesFragment extends Fragment {
public static final String TAG = "EpisodesFragment";
private static final String PREF_LAST_TAB_POSITION = "tab_position";
public static final int POS_NEW_EPISODES = 0;
public static final int POS_ALL_EPISODES = 1;
public static final int POS_FAV_EPISODES = 2;
public static final int TOTAL_COUNT = 3;
private static final int POS_NEW_EPISODES = 0;
private static final int POS_ALL_EPISODES = 1;
private static final int POS_FAV_EPISODES = 2;
private static final int TOTAL_COUNT = 3;
private TabLayout tabLayout;

View File

@ -208,7 +208,7 @@ public class ExternalPlayerFragment extends Fragment {
return controller;
}
public void onPositionObserverUpdate() {
private void onPositionObserverUpdate() {
mProgressBar.setProgress((int)
((double) controller.getPosition() / controller.getDuration() * 100));
}

View File

@ -26,7 +26,7 @@ import de.danoeh.antennapod.core.storage.DBWriter;
public class FavoriteEpisodesFragment extends AllEpisodesFragment {
public static final String TAG = "FavoriteEpisodesFrag";
private static final String TAG = "FavoriteEpisodesFrag";
private static final String PREF_NAME = "PrefFavoriteEpisodesFragment";

View File

@ -169,7 +169,7 @@ public class FyydSearchFragment extends Fragment {
progressBar.setVisibility(View.VISIBLE);
}
void processSearchResult(FyydResponse response) {
private void processSearchResult(FyydResponse response) {
adapter.clear();
if (!response.getData().isEmpty()) {
adapter.clear();

View File

@ -87,9 +87,9 @@ public class ItemlistFragment extends ListFragment {
| EventDistributor.PLAYER_STATUS_UPDATE;
public static final String EXTRA_SELECTED_FEEDITEM = "extra.de.danoeh.antennapod.activity.selected_feeditem";
public static final String ARGUMENT_FEED_ID = "argument.de.danoeh.antennapod.feed_id";
private static final String ARGUMENT_FEED_ID = "argument.de.danoeh.antennapod.feed_id";
protected FeedItemlistAdapter adapter;
private FeedItemlistAdapter adapter;
private ContextMenu contextMenu;
private AdapterView.AdapterContextMenuInfo lastMenuInfo = null;

View File

@ -75,7 +75,7 @@ public class ItunesSearchFragment extends Fragment {
* Replace adapter data with provided search results from SearchTask.
* @param result List of Podcast objects containing search results
*/
void updateData(List<Podcast> result) {
private void updateData(List<Podcast> result) {
this.searchResults = result;
adapter.clear();
if (result != null && result.size() > 0) {

View File

@ -20,7 +20,7 @@ import de.danoeh.antennapod.R;
*/
public class GpodnetMainFragment extends Fragment {
public static final String TAG = "GpodnetMainFragment";
private static final String TAG = "GpodnetMainFragment";
private static final String PREF_LAST_TAB_POSITION = "tab_position";
private TabLayout tabLayout;

View File

@ -91,7 +91,7 @@ public abstract class PodcastListFragment extends Fragment {
return root;
}
protected void onPodcastSelected(GpodnetPodcast selection) {
private void onPodcastSelected(GpodnetPodcast selection) {
Log.d(TAG, "Selected podcast: " + selection.toString());
Intent intent = new Intent(getActivity(), OnlineFeedViewActivity.class);
intent.putExtra(OnlineFeedViewActivity.ARG_FEEDURL, selection.getUrl());
@ -101,7 +101,7 @@ public abstract class PodcastListFragment extends Fragment {
protected abstract List<GpodnetPodcast> loadPodcastData(GpodnetService service) throws GpodnetServiceException;
protected final void loadData() {
final void loadData() {
AsyncTask<Void, Void, List<GpodnetPodcast>> loaderTask = new AsyncTask<Void, Void, List<GpodnetPodcast>>() {
volatile Exception exception = null;

View File

@ -73,7 +73,7 @@ public class SearchListFragment extends PodcastListFragment {
return service.searchPodcasts(query, 0);
}
public void changeQuery(String query) {
private void changeQuery(String query) {
Validate.notNull(query);
this.query = query;

View File

@ -22,8 +22,8 @@ public class SPAReceiver extends BroadcastReceiver{
private static final String TAG = "SPAReceiver";
public static final String ACTION_SP_APPS_QUERY_FEEDS = "de.danoeh.antennapdsp.intent.SP_APPS_QUERY_FEEDS";
public static final String ACTION_SP_APPS_QUERY_FEEDS_REPSONSE = "de.danoeh.antennapdsp.intent.SP_APPS_QUERY_FEEDS_RESPONSE";
public static final String ACTION_SP_APPS_QUERY_FEEDS_REPSONSE_FEEDS_EXTRA = "feeds";
private static final String ACTION_SP_APPS_QUERY_FEEDS_REPSONSE = "de.danoeh.antennapdsp.intent.SP_APPS_QUERY_FEEDS_RESPONSE";
private static final String ACTION_SP_APPS_QUERY_FEEDS_REPSONSE_FEEDS_EXTRA = "feeds";
@Override
public void onReceive(Context context, Intent intent) {

View File

@ -1,6 +1,6 @@
package de.danoeh.antennapod.core.feed;
public class FeedImageMother {
class FeedImageMother {
public static FeedImage anyFeedImage() {
return new FeedImage(0, "image", null, "http://example.com/picture", false);

View File

@ -2,7 +2,7 @@ package de.danoeh.antennapod.core.feed;
import static de.danoeh.antennapod.core.feed.FeedImageMother.anyFeedImage;
public class FeedMother {
class FeedMother {
public static Feed anyFeed() {
FeedImage image = anyFeedImage();

View File

@ -3,7 +3,7 @@ package de.danoeh.antennapod.core.feed;
/**
* Implements methods for FeedMedia that are flavor dependent.
*/
public class FeedMediaFlavorHelper {
class FeedMediaFlavorHelper {
private FeedMediaFlavorHelper(){}
static boolean instanceOfRemoteMedia(Object o) {
return false;

View File

@ -8,7 +8,7 @@ import android.support.v4.media.session.PlaybackStateCompat;
/**
* Class intended to work along PlaybackService and provide support for different flavors.
*/
public class PlaybackServiceFlavorHelper {
class PlaybackServiceFlavorHelper {
private PlaybackService.FlavorHelperCallback callback;

View File

@ -23,9 +23,9 @@ import de.danoeh.antennapod.core.storage.DBWriter;
/*
* This class's job is do perform maintenance tasks whenever the app has been updated
*/
public class UpdateManager {
class UpdateManager {
public static final String TAG = UpdateManager.class.getSimpleName();
private static final String TAG = UpdateManager.class.getSimpleName();
private static final String PREF_NAME = "app_version";
private static final String KEY_VERSION_CODE = "version_code";
@ -55,11 +55,11 @@ public class UpdateManager {
}
}
public static int getStoredVersionCode() {
private static int getStoredVersionCode() {
return prefs.getInt(KEY_VERSION_CODE, -1);
}
public static void setCurrentVersionCode() {
private static void setCurrentVersionCode() {
prefs.edit().putInt(KEY_VERSION_CODE, currentVersionCode).apply();
}

View File

@ -8,7 +8,7 @@ import android.support.v4.content.AsyncTaskLoader;
* This class will provide a useful default implementation that would otherwise always be necessary when interacting
* with the DB*-classes with an AsyncTaskLoader.
*/
public abstract class DBTaskLoader<D> extends AsyncTaskLoader<D> {
abstract class DBTaskLoader<D> extends AsyncTaskLoader<D> {
public DBTaskLoader(Context context) {
super(context);

View File

@ -14,9 +14,9 @@ import de.danoeh.antennapod.core.storage.DBWriter;
/** Removes a feed in the background. */
public class FeedRemover extends AsyncTask<Void, Void, Void> {
Context context;
ProgressDialog dialog;
Feed feed;
private Context context;
private ProgressDialog dialog;
private Feed feed;
public boolean skipOnCompletion = false;
public FeedRemover(Context context, Feed feed) {

View File

@ -38,7 +38,7 @@ import de.danoeh.antennapod.core.util.flattr.FlattrUtils;
* to flattr something, a notification will be displayed.
*/
public class FlattrClickWorker extends AsyncTask<Void, Integer, FlattrClickWorker.ExitCode> {
protected static final String TAG = "FlattrClickWorker";
private static final String TAG = "FlattrClickWorker";
private static final int NOTIFICATION_ID = 4;

View File

@ -18,8 +18,8 @@ import de.danoeh.antennapod.core.util.flattr.FlattrUtils;
*/
public class FlattrStatusFetcher extends Thread {
protected static final String TAG = "FlattrStatusFetcher";
protected Context context;
private static final String TAG = "FlattrStatusFetcher";
private Context context;
public FlattrStatusFetcher(Context context) {
super();

View File

@ -22,12 +22,12 @@ import de.danoeh.antennapod.core.util.flattr.FlattrUtils;
public class FlattrTokenFetcher extends AsyncTask<Void, Void, AccessToken> {
private static final String TAG = "FlattrTokenFetcher";
Context context;
AndroidAuthenticator auth;
AccessToken token;
Uri uri;
ProgressDialog dialog;
FlattrException exception;
private Context context;
private AndroidAuthenticator auth;
private AccessToken token;
private Uri uri;
private ProgressDialog dialog;
private FlattrException exception;
public FlattrTokenFetcher(Context context, AndroidAuthenticator auth, Uri uri) {
super();

View File

@ -15,7 +15,7 @@ public abstract class ConfirmationDialog {
private static final String TAG = ConfirmationDialog.class.getSimpleName();
protected Context context;
private Context context;
private int titleId;
private String message;
@ -32,7 +32,7 @@ public abstract class ConfirmationDialog {
this.message = message;
}
public void onCancelButtonPressed(DialogInterface dialog) {
private void onCancelButtonPressed(DialogInterface dialog) {
Log.d(TAG, "Dialog was cancelled");
dialog.dismiss();
}

View File

@ -11,8 +11,8 @@ public class FavoritesEvent {
ADDED, REMOVED
}
public final Action action;
public final FeedItem item;
private final Action action;
private final FeedItem item;
private FavoritesEvent(Action action, FeedItem item) {
this.action = action;

View File

@ -17,7 +17,8 @@ public class FeedItemEvent {
UPDATE, DELETE_MEDIA
}
@NonNull public final Action action;
@NonNull
private final Action action;
@NonNull public final List<FeedItem> items;
private FeedItemEvent(Action action, List<FeedItem> items) {

View File

@ -8,8 +8,8 @@ public class FeedMediaEvent {
UPDATE
}
public final Action action;
public final FeedMedia media;
private final Action action;
private final FeedMedia media;
private FeedMediaEvent(Action action, FeedMedia media) {
this.action = action;

View File

@ -3,7 +3,7 @@ package de.danoeh.antennapod.core.export.opml;
import de.danoeh.antennapod.core.export.CommonSymbols;
/** Contains symbols for reading and writing OPML documents. */
public final class OpmlSymbols extends CommonSymbols {
final class OpmlSymbols extends CommonSymbols {
public static final String OPML = "opml";
static final String OUTLINE = "outline";

View File

@ -7,19 +7,19 @@ import de.danoeh.antennapod.core.storage.PodDBAdapter;
public abstract class Chapter extends FeedComponent {
/** Defines starting point in milliseconds. */
protected long start;
protected String title;
protected String link;
long start;
String title;
String link;
public Chapter() {
Chapter() {
}
public Chapter(long start) {
Chapter(long start) {
super();
this.start = start;
}
public Chapter(long start, String title, FeedItem item, String link) {
Chapter(long start, String title, FeedItem item, String link) {
super();
this.start = start;
this.title = title;

View File

@ -52,7 +52,7 @@ public class EventDistributor extends Observable {
deleteObserver(el);
}
public void addEvent(Integer i) {
private void addEvent(Integer i) {
events.offer(i);
handler.post(EventDistributor.this::processEventQueue);
}

View File

@ -7,9 +7,9 @@ package de.danoeh.antennapod.core.feed;
*/
public abstract class FeedComponent {
protected long id;
long id;
public FeedComponent() {
FeedComponent() {
super();
}
@ -26,7 +26,7 @@ public abstract class FeedComponent {
* FeedComponent. This method should only update attributes which where read from
* the feed.
*/
public void updateFromOther(FeedComponent other) {
void updateFromOther(FeedComponent other) {
}
/**
@ -36,7 +36,7 @@ public abstract class FeedComponent {
*
* @return true if attribute values are different, false otherwise
*/
public boolean compareWithOther(FeedComponent other) {
boolean compareWithOther(FeedComponent other) {
return false;
}

View File

@ -9,7 +9,7 @@ public class FeedEvent {
FILTER_CHANGED
}
public final Action action;
private final Action action;
public final long feedId;
public FeedEvent(Action action, long feedId) {

View File

@ -9,9 +9,9 @@ import java.io.File;
*/
public abstract class FeedFile extends FeedComponent {
protected String file_url;
String file_url;
protected String download_url;
protected boolean downloaded;
boolean downloaded;
/**
* Creates a new FeedFile object.
@ -40,7 +40,7 @@ public abstract class FeedFile extends FeedComponent {
* FeedFile. This method should only update attributes which where read from
* the feed.
*/
public void updateFromOther(FeedFile other) {
void updateFromOther(FeedFile other) {
super.updateFromOther(other);
this.download_url = other.download_url;
}
@ -52,7 +52,7 @@ public abstract class FeedFile extends FeedComponent {
*
* @return true if attribute values are different, false otherwise
*/
public boolean compareWithOther(FeedFile other) {
boolean compareWithOther(FeedFile other) {
if (super.compareWithOther(other)) {
return true;
}

View File

@ -11,8 +11,8 @@ import de.danoeh.antennapod.core.storage.PodDBAdapter;
public class FeedImage extends FeedFile implements ImageResource {
public static final int FEEDFILETYPE_FEEDIMAGE = 1;
protected String title;
protected FeedComponent owner;
private String title;
private FeedComponent owner;
public FeedImage(FeedComponent owner, String download_url, String title) {
super(null, download_url, false);

View File

@ -34,7 +34,7 @@ public class FeedMedia extends FeedFile implements Playable {
public static final int PLAYABLE_TYPE_FEEDMEDIA = 1;
public static final String PREF_MEDIA_ID = "FeedMedia.PrefMediaId";
public static final String PREF_FEED_ID = "FeedMedia.PrefFeedId";
private static final String PREF_FEED_ID = "FeedMedia.PrefFeedId";
/**
* Indicates we've checked on the size of the item via the network
@ -88,10 +88,10 @@ public class FeedMedia extends FeedFile implements Playable {
this.lastPlayedTime = lastPlayedTime;
}
public FeedMedia(long id, FeedItem item, int duration, int position,
long size, String mime_type, String file_url, String download_url,
boolean downloaded, Date playbackCompletionDate, int played_duration,
Boolean hasEmbeddedPicture, long lastPlayedTime) {
private FeedMedia(long id, FeedItem item, int duration, int position,
long size, String mime_type, String file_url, String download_url,
boolean downloaded, Date playbackCompletionDate, int played_duration,
Boolean hasEmbeddedPicture, long lastPlayedTime) {
this(id, item, duration, position, size, mime_type, file_url, download_url, downloaded,
playbackCompletionDate, played_duration, lastPlayedTime);
this.hasEmbeddedPicture = hasEmbeddedPicture;

View File

@ -33,7 +33,7 @@ public class FeedPreferences {
this(feedID, autoDownload, true, auto_delete_action, username, password, new FeedFilter());
}
public FeedPreferences(long feedID, boolean autoDownload, boolean keepUpdated, AutoDeleteAction auto_delete_action, String username, String password, @NonNull FeedFilter filter) {
private FeedPreferences(long feedID, boolean autoDownload, boolean keepUpdated, AutoDeleteAction auto_delete_action, String username, String password, @NonNull FeedFilter filter) {
this.feedID = feedID;
this.autoDownload = autoDownload;
this.keepUpdated = keepUpdated;

View File

@ -27,7 +27,7 @@ import okhttp3.Response;
/**
* @see com.bumptech.glide.integration.okhttp3.OkHttpUrlLoader
*/
public class ApOkHttpUrlLoader implements ModelLoader<String, InputStream> {
class ApOkHttpUrlLoader implements ModelLoader<String, InputStream> {
private static final String TAG = ApOkHttpUrlLoader.class.getSimpleName();
@ -80,7 +80,7 @@ public class ApOkHttpUrlLoader implements ModelLoader<String, InputStream> {
private final OkHttpClient client;
public ApOkHttpUrlLoader(OkHttpClient client) {
private ApOkHttpUrlLoader(OkHttpClient client) {
this.client = client;
}

View File

@ -1,7 +1,7 @@
package de.danoeh.antennapod.core.gpoddernet;
public class GpodnetServiceBadStatusCodeException extends GpodnetServiceException {
int statusCode;
class GpodnetServiceBadStatusCodeException extends GpodnetServiceException {
private int statusCode;
public GpodnetServiceBadStatusCodeException(String message, int statusCode) {
super(message);

View File

@ -2,10 +2,10 @@ package de.danoeh.antennapod.core.gpoddernet;
public class GpodnetServiceException extends Exception {
public GpodnetServiceException() {
GpodnetServiceException() {
}
public GpodnetServiceException(String message) {
GpodnetServiceException(String message) {
super(message);
}
@ -13,7 +13,7 @@ public class GpodnetServiceException extends Exception {
super(cause);
}
public GpodnetServiceException(String message, Throwable cause) {
GpodnetServiceException(String message, Throwable cause) {
super(message, cause);
}
}

View File

@ -131,7 +131,7 @@ public class GpodnetEpisodeAction {
return this.action;
}
public String getActionString() {
private String getActionString() {
return this.action.name().toLowerCase();
}

View File

@ -21,9 +21,9 @@ public class GpodnetEpisodeActionPostResponse {
* URLs that should be updated. The key of the map is the original URL, the value of the map
* is the sanitized URL.
*/
public final Map<String, String> updatedUrls;
private final Map<String, String> updatedUrls;
public GpodnetEpisodeActionPostResponse(long timestamp, Map<String, String> updatedUrls) {
private GpodnetEpisodeActionPostResponse(long timestamp, Map<String, String> updatedUrls) {
this.timestamp = timestamp;
this.updatedUrls = updatedUrls;
}

View File

@ -16,7 +16,7 @@ public class GpodnetTag implements Parcelable {
this.usage = usage;
}
protected GpodnetTag(Parcel in) {
private GpodnetTag(Parcel in) {
title = in.readString();
tag = in.readString();
usage = in.readInt();

View File

@ -22,9 +22,9 @@ public class GpodnetUploadChangesResponse {
* URLs that should be updated. The key of the map is the original URL, the value of the map
* is the sanitized URL.
*/
public final Map<String, String> updatedUrls;
private final Map<String, String> updatedUrls;
public GpodnetUploadChangesResponse(long timestamp, Map<String, String> updatedUrls) {
private GpodnetUploadChangesResponse(long timestamp, Map<String, String> updatedUrls) {
this.timestamp = timestamp;
this.updatedUrls = updatedUrls;
}

View File

@ -27,19 +27,19 @@ public class GpodnetPreferences {
private static final String TAG = "GpodnetPreferences";
private static final String PREF_NAME = "gpodder.net";
public static final String PREF_GPODNET_USERNAME = "de.danoeh.antennapod.preferences.gpoddernet.username";
public static final String PREF_GPODNET_PASSWORD = "de.danoeh.antennapod.preferences.gpoddernet.password";
public static final String PREF_GPODNET_DEVICEID = "de.danoeh.antennapod.preferences.gpoddernet.deviceID";
public static final String PREF_GPODNET_HOSTNAME = "prefGpodnetHostname";
private static final String PREF_GPODNET_USERNAME = "de.danoeh.antennapod.preferences.gpoddernet.username";
private static final String PREF_GPODNET_PASSWORD = "de.danoeh.antennapod.preferences.gpoddernet.password";
private static final String PREF_GPODNET_DEVICEID = "de.danoeh.antennapod.preferences.gpoddernet.deviceID";
private static final String PREF_GPODNET_HOSTNAME = "prefGpodnetHostname";
public static final String PREF_LAST_SUBSCRIPTION_SYNC_TIMESTAMP = "de.danoeh.antennapod.preferences.gpoddernet.last_sync_timestamp";
public static final String PREF_LAST_EPISODE_ACTIONS_SYNC_TIMESTAMP = "de.danoeh.antennapod.preferences.gpoddernet.last_episode_actions_sync_timestamp";
public static final String PREF_SYNC_ADDED = "de.danoeh.antennapod.preferences.gpoddernet.sync_added";
public static final String PREF_SYNC_REMOVED = "de.danoeh.antennapod.preferences.gpoddernet.sync_removed";
public static final String PREF_SYNC_EPISODE_ACTIONS = "de.danoeh.antennapod.preferences.gpoddernet.sync_queued_episode_actions";
private static final String PREF_LAST_SUBSCRIPTION_SYNC_TIMESTAMP = "de.danoeh.antennapod.preferences.gpoddernet.last_sync_timestamp";
private static final String PREF_LAST_EPISODE_ACTIONS_SYNC_TIMESTAMP = "de.danoeh.antennapod.preferences.gpoddernet.last_episode_actions_sync_timestamp";
private static final String PREF_SYNC_ADDED = "de.danoeh.antennapod.preferences.gpoddernet.sync_added";
private static final String PREF_SYNC_REMOVED = "de.danoeh.antennapod.preferences.gpoddernet.sync_removed";
private static final String PREF_SYNC_EPISODE_ACTIONS = "de.danoeh.antennapod.preferences.gpoddernet.sync_queued_episode_actions";
public static final String PREF_LAST_SYNC_ATTEMPT_TIMESTAMP = "de.danoeh.antennapod.preferences.gpoddernet.last_sync_attempt_timestamp";
public static final String PREF_LAST_SYNC_ATTEMPT_RESULT = "de.danoeh.antennapod.preferences.gpoddernet.last_sync_attempt_result";
private static final String PREF_LAST_SYNC_ATTEMPT_RESULT = "de.danoeh.antennapod.preferences.gpoddernet.last_sync_attempt_result";
private static String username;
private static String password;

View File

@ -42,79 +42,79 @@ import de.danoeh.antennapod.core.util.Converter;
*/
public class UserPreferences {
public static final String IMPORT_DIR = "import/";
private static final String IMPORT_DIR = "import/";
private static final String TAG = "UserPreferences";
// User Interface
public static final String PREF_THEME = "prefTheme";
public static final String PREF_HIDDEN_DRAWER_ITEMS = "prefHiddenDrawerItems";
public static final String PREF_DRAWER_FEED_ORDER = "prefDrawerFeedOrder";
public static final String PREF_DRAWER_FEED_COUNTER = "prefDrawerFeedIndicator";
public static final String PREF_EXPANDED_NOTIFICATION = "prefExpandNotify";
public static final String PREF_PERSISTENT_NOTIFICATION = "prefPersistNotify";
private static final String PREF_DRAWER_FEED_ORDER = "prefDrawerFeedOrder";
private static final String PREF_DRAWER_FEED_COUNTER = "prefDrawerFeedIndicator";
private static final String PREF_EXPANDED_NOTIFICATION = "prefExpandNotify";
private static final String PREF_PERSISTENT_NOTIFICATION = "prefPersistNotify";
public static final String PREF_COMPACT_NOTIFICATION_BUTTONS = "prefCompactNotificationButtons";
public static final String PREF_LOCKSCREEN_BACKGROUND = "prefLockscreenBackground";
public static final String PREF_SHOW_DOWNLOAD_REPORT = "prefShowDownloadReport";
private static final String PREF_SHOW_DOWNLOAD_REPORT = "prefShowDownloadReport";
// Queue
public static final String PREF_QUEUE_ADD_TO_FRONT = "prefQueueAddToFront";
private static final String PREF_QUEUE_ADD_TO_FRONT = "prefQueueAddToFront";
// Playback
public static final String PREF_PAUSE_ON_HEADSET_DISCONNECT = "prefPauseOnHeadsetDisconnect";
public static final String PREF_UNPAUSE_ON_HEADSET_RECONNECT = "prefUnpauseOnHeadsetReconnect";
public static final String PREF_UNPAUSE_ON_BLUETOOTH_RECONNECT = "prefUnpauseOnBluetoothReconnect";
public static final String PREF_HARDWARE_FOWARD_BUTTON_SKIPS = "prefHardwareForwardButtonSkips";
public static final String PREF_HARDWARE_PREVIOUS_BUTTON_RESTARTS = "prefHardwarePreviousButtonRestarts";
private static final String PREF_UNPAUSE_ON_BLUETOOTH_RECONNECT = "prefUnpauseOnBluetoothReconnect";
private static final String PREF_HARDWARE_FOWARD_BUTTON_SKIPS = "prefHardwareForwardButtonSkips";
private static final String PREF_HARDWARE_PREVIOUS_BUTTON_RESTARTS = "prefHardwarePreviousButtonRestarts";
public static final String PREF_FOLLOW_QUEUE = "prefFollowQueue";
public static final String PREF_SKIP_KEEPS_EPISODE = "prefSkipKeepsEpisode";
public static final String PREF_FAVORITE_KEEPS_EPISODE = "prefFavoriteKeepsEpisode";
public static final String PREF_AUTO_DELETE = "prefAutoDelete";
private static final String PREF_SKIP_KEEPS_EPISODE = "prefSkipKeepsEpisode";
private static final String PREF_FAVORITE_KEEPS_EPISODE = "prefFavoriteKeepsEpisode";
private static final String PREF_AUTO_DELETE = "prefAutoDelete";
public static final String PREF_SMART_MARK_AS_PLAYED_SECS = "prefSmartMarkAsPlayedSecs";
public static final String PREF_PLAYBACK_SPEED_ARRAY = "prefPlaybackSpeedArray";
public static final String PREF_PAUSE_PLAYBACK_FOR_FOCUS_LOSS = "prefPauseForFocusLoss";
public static final String PREF_RESUME_AFTER_CALL = "prefResumeAfterCall";
private static final String PREF_PLAYBACK_SPEED_ARRAY = "prefPlaybackSpeedArray";
private static final String PREF_PAUSE_PLAYBACK_FOR_FOCUS_LOSS = "prefPauseForFocusLoss";
private static final String PREF_RESUME_AFTER_CALL = "prefResumeAfterCall";
// Network
public static final String PREF_ENQUEUE_DOWNLOADED = "prefEnqueueDownloaded";
private static final String PREF_ENQUEUE_DOWNLOADED = "prefEnqueueDownloaded";
public static final String PREF_UPDATE_INTERVAL = "prefAutoUpdateIntervall";
public static final String PREF_MOBILE_UPDATE = "prefMobileUpdate";
private static final String PREF_MOBILE_UPDATE = "prefMobileUpdate";
public static final String PREF_EPISODE_CLEANUP = "prefEpisodeCleanup";
public static final String PREF_PARALLEL_DOWNLOADS = "prefParallelDownloads";
public static final String PREF_EPISODE_CACHE_SIZE = "prefEpisodeCacheSize";
public static final String PREF_ENABLE_AUTODL = "prefEnableAutoDl";
public static final String PREF_ENABLE_AUTODL_ON_BATTERY = "prefEnableAutoDownloadOnBattery";
public static final String PREF_ENABLE_AUTODL_WIFI_FILTER = "prefEnableAutoDownloadWifiFilter";
public static final String PREF_ENABLE_AUTODL_ON_MOBILE = "prefEnableAutoDownloadOnMobile";
public static final String PREF_AUTODL_SELECTED_NETWORKS = "prefAutodownloadSelectedNetworks";
public static final String PREF_PROXY_TYPE = "prefProxyType";
public static final String PREF_PROXY_HOST = "prefProxyHost";
public static final String PREF_PROXY_PORT = "prefProxyPort";
public static final String PREF_PROXY_USER = "prefProxyUser";
public static final String PREF_PROXY_PASSWORD = "prefProxyPassword";
private static final String PREF_ENABLE_AUTODL_ON_MOBILE = "prefEnableAutoDownloadOnMobile";
private static final String PREF_AUTODL_SELECTED_NETWORKS = "prefAutodownloadSelectedNetworks";
private static final String PREF_PROXY_TYPE = "prefProxyType";
private static final String PREF_PROXY_HOST = "prefProxyHost";
private static final String PREF_PROXY_PORT = "prefProxyPort";
private static final String PREF_PROXY_USER = "prefProxyUser";
private static final String PREF_PROXY_PASSWORD = "prefProxyPassword";
// Services
public static final String PREF_AUTO_FLATTR = "pref_auto_flattr";
public static final String PREF_AUTO_FLATTR_PLAYED_DURATION_THRESHOLD = "prefAutoFlattrPlayedDurationThreshold";
public static final String PREF_GPODNET_NOTIFICATIONS = "pref_gpodnet_notifications";
private static final String PREF_AUTO_FLATTR = "pref_auto_flattr";
private static final String PREF_AUTO_FLATTR_PLAYED_DURATION_THRESHOLD = "prefAutoFlattrPlayedDurationThreshold";
private static final String PREF_GPODNET_NOTIFICATIONS = "pref_gpodnet_notifications";
// Other
public static final String PREF_DATA_FOLDER = "prefDataFolder";
private static final String PREF_DATA_FOLDER = "prefDataFolder";
public static final String PREF_IMAGE_CACHE_SIZE = "prefImageCacheSize";
// Mediaplayer
public static final String PREF_PLAYBACK_SPEED = "prefPlaybackSpeed";
private static final String PREF_PLAYBACK_SPEED = "prefPlaybackSpeed";
private static final String PREF_FAST_FORWARD_SECS = "prefFastForwardSecs";
private static final String PREF_REWIND_SECS = "prefRewindSecs";
public static final String PREF_QUEUE_LOCKED = "prefQueueLocked";
public static final String IMAGE_CACHE_DEFAULT_VALUE = "100";
public static final int IMAGE_CACHE_SIZE_MINIMUM = 20;
public static final String PREF_LEFT_VOLUME = "prefLeftVolume";
public static final String PREF_RIGHT_VOLUME = "prefRightVolume";
private static final String PREF_QUEUE_LOCKED = "prefQueueLocked";
private static final String IMAGE_CACHE_DEFAULT_VALUE = "100";
private static final int IMAGE_CACHE_SIZE_MINIMUM = 20;
private static final String PREF_LEFT_VOLUME = "prefLeftVolume";
private static final String PREF_RIGHT_VOLUME = "prefRightVolume";
// Experimental
public static final String PREF_SONIC = "prefSonic";
public static final String PREF_STEREO_TO_MONO = "PrefStereoToMono";
private static final String PREF_STEREO_TO_MONO = "PrefStereoToMono";
public static final String PREF_NORMALIZER = "prefNormalizer";
public static final String PREF_CAST_ENABLED = "prefCast"; //Used for enabling Chromecast support
public static final int EPISODE_CLEANUP_QUEUE = -1;
@ -786,7 +786,7 @@ public class UserPreferences {
/**
* Sets the interval in which the feeds are refreshed automatically
*/
public static void restartUpdateIntervalAlarm(long triggerAtMillis, long intervalMillis) {
private static void restartUpdateIntervalAlarm(long triggerAtMillis, long intervalMillis) {
Log.d(TAG, "Restarting update alarm.");
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(context, FeedUpdateReceiver.class);
@ -805,7 +805,7 @@ public class UserPreferences {
/**
* Sets time of day the feeds are refreshed automatically
*/
public static void restartUpdateTimeOfDayAlarm(int hoursOfDay, int minute) {
private static void restartUpdateTimeOfDayAlarm(int hoursOfDay, int minute) {
Log.d(TAG, "Restarting update alarm.");
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
PendingIntent updateIntent = PendingIntent.getBroadcast(context, 0,

View File

@ -47,11 +47,11 @@ public class GpodnetSyncService extends Service {
private static final long WAIT_INTERVAL = 5000L;
public static final String ARG_ACTION = "action";
private static final String ARG_ACTION = "action";
public static final String ACTION_SYNC = "de.danoeh.antennapod.intent.action.sync";
public static final String ACTION_SYNC_SUBSCRIPTIONS = "de.danoeh.antennapod.intent.action.sync_subscriptions";
public static final String ACTION_SYNC_ACTIONS = "de.danoeh.antennapod.intent.action.sync_ACTIONS";
private static final String ACTION_SYNC = "de.danoeh.antennapod.intent.action.sync";
private static final String ACTION_SYNC_SUBSCRIPTIONS = "de.danoeh.antennapod.intent.action.sync_subscriptions";
private static final String ACTION_SYNC_ACTIONS = "de.danoeh.antennapod.intent.action.sync_ACTIONS";
private GpodnetService service;

View File

@ -42,10 +42,10 @@ import okhttp3.internal.http.StatusLine;
public class AntennapodHttpClient {
private static final String TAG = "AntennapodHttpClient";
public static final int CONNECTION_TIMEOUT = 30000;
public static final int READ_TIMEOUT = 30000;
private static final int CONNECTION_TIMEOUT = 30000;
private static final int READ_TIMEOUT = 30000;
public static final int MAX_CONNECTIONS = 8;
private static final int MAX_CONNECTIONS = 8;
private static volatile OkHttpClient httpClient = null;

View File

@ -22,10 +22,10 @@ public class DownloadRequest implements Parcelable {
private final int feedfileType;
private final Bundle arguments;
protected int progressPercent;
protected long soFar;
protected long size;
protected int statusMsg;
private int progressPercent;
private long soFar;
private long size;
private int statusMsg;
public DownloadRequest(@NonNull String destination,
@NonNull String source,
@ -53,7 +53,7 @@ public class DownloadRequest implements Parcelable {
this(destination, source, title, feedfileId, feedfileType, null, null, true, null);
}
public DownloadRequest(Builder builder) {
private DownloadRequest(Builder builder) {
this.destination = builder.destination;
this.source = builder.source;
this.title = builder.title;

View File

@ -534,14 +534,14 @@ public class DownloadService extends Service {
* Calls query downloads on the services main thread. This method should be used instead of queryDownloads if it is
* used from a thread other than the main thread.
*/
void queryDownloadsAsync() {
private void queryDownloadsAsync() {
handler.post(DownloadService.this::queryDownloads);
}
/**
* Check if there's something else to download, otherwise stop
*/
void queryDownloads() {
private void queryDownloads() {
Log.d(TAG, numberOfDownloads.get() + " downloads left");
if (numberOfDownloads.get() <= 0 && DownloadRequester.getInstance().hasNoDownloads()) {
@ -1091,7 +1091,7 @@ public class DownloadService extends Service {
private long lastPost = 0;
final Runnable postDownloaderTask = new Runnable() {
private final Runnable postDownloaderTask = new Runnable() {
@Override
public void run() {
List<Downloader> list = Collections.unmodifiableList(downloads);

View File

@ -19,37 +19,37 @@ public class DownloadStatus {
// ----------------------------------- ATTRIBUTES STORED IN DB
/** Unique id for storing the object in database. */
protected long id;
private long id;
/**
* A human-readable string which is shown to the user so that he can
* identify the download. Should be the title of the item/feed/media or the
* URL if the download has no other title.
*/
protected String title;
protected DownloadError reason;
private String title;
private DownloadError reason;
/**
* A message which can be presented to the user to give more information.
* Should be null if Download was successful.
*/
protected String reasonDetailed;
protected boolean successful;
protected Date completionDate;
protected long feedfileId;
private String reasonDetailed;
private boolean successful;
private Date completionDate;
private long feedfileId;
/**
* Is used to determine the type of the feedfile even if the feedfile does
* not exist anymore. The value should be FEEDFILETYPE_FEED,
* FEEDFILETYPE_FEEDIMAGE or FEEDFILETYPE_FEEDMEDIA
*/
protected int feedfileType;
private int feedfileType;
// ------------------------------------ NOT STORED IN DB
protected boolean done;
protected boolean cancelled;
private boolean done;
private boolean cancelled;
/** Constructor for restoring Download status entries from DB. */
public DownloadStatus(long id, String title, long feedfileId,
int feedfileType, boolean successful, DownloadError reason,
Date completionDate, String reasonDetailed) {
private DownloadStatus(long id, String title, long feedfileId,
int feedfileType, boolean successful, DownloadError reason,
Date completionDate, String reasonDetailed) {
this.id = id;
this.title = title;
this.done = true;

View File

@ -14,14 +14,14 @@ import de.danoeh.antennapod.core.R;
public abstract class Downloader implements Callable<Downloader> {
private static final String TAG = "Downloader";
protected volatile boolean finished;
private volatile boolean finished;
protected volatile boolean cancelled;
volatile boolean cancelled;
protected DownloadRequest request;
protected DownloadStatus result;
DownloadRequest request;
DownloadStatus result;
public Downloader(DownloadRequest request) {
Downloader(DownloadRequest request) {
super();
this.request = request;
this.request.setStatusMsg(R.string.download_pending);

View File

@ -32,7 +32,7 @@ import de.danoeh.antennapod.core.util.playback.VideoPlayer;
* Manages the MediaPlayer object of the PlaybackService.
*/
public class LocalPSMP extends PlaybackServiceMediaPlayer {
public static final String TAG = "LclPlaybackSvcMPlayer";
private static final String TAG = "LclPlaybackSvcMPlayer";
private final AudioManager audioManager;

View File

@ -88,7 +88,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
/**
* True if cast session should disconnect.
*/
public static final String EXTRA_CAST_DISCONNECT = "extra.de.danoeh.antennapod.core.service.castDisconnect";
private static final String EXTRA_CAST_DISCONNECT = "extra.de.danoeh.antennapod.core.service.castDisconnect";
/**
* True if media should be streamed.
*/
@ -198,7 +198,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
/**
* Is true if the service was running, but paused due to headphone disconnect
*/
public static boolean transientPause = false;
private static boolean transientPause = false;
/**
* Is true if a Cast Device is connected to the service.
*/
@ -1630,7 +1630,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
}
public void seekDelta(final int d) {
private void seekDelta(final int d) {
mediaPlayer.seekDelta(d);
}

View File

@ -24,14 +24,14 @@ import de.danoeh.antennapod.core.util.playback.Playable;
* and remote (cast devices) playback.
*/
public abstract class PlaybackServiceMediaPlayer {
public static final String TAG = "PlaybackSvcMediaPlayer";
private static final String TAG = "PlaybackSvcMediaPlayer";
/**
* Return value of some PSMP methods if the method call failed.
*/
static final int INVALID_TIME = -1;
volatile PlayerStatus oldPlayerStatus;
private volatile PlayerStatus oldPlayerStatus;
volatile PlayerStatus playerStatus;
/**
@ -39,8 +39,8 @@ public abstract class PlaybackServiceMediaPlayer {
*/
private WifiManager.WifiLock wifiLock;
protected final PSMPCallback callback;
protected final Context context;
final PSMPCallback callback;
final Context context;
PlaybackServiceMediaPlayer(@NonNull Context context,
@NonNull PSMPCallback callback){

View File

@ -295,7 +295,7 @@ public class PlaybackServiceTaskManager {
/**
* Sleeps for a given time and then pauses playback.
*/
protected class SleepTimer implements Runnable {
class SleepTimer implements Runnable {
private static final String TAG = "SleepTimer";
private static final long UPDATE_INTERVAL = 1000L;
private static final long NOTIFICATION_THRESHOLD = 10000;

View File

@ -7,7 +7,7 @@ import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.util.Log;
public class ShakeListener implements SensorEventListener
class ShakeListener implements SensorEventListener
{
private static final String TAG = ShakeListener.class.getSimpleName();
@ -22,7 +22,7 @@ public class ShakeListener implements SensorEventListener
resume();
}
public void resume() {
private void resume() {
// only a precaution, the user should actually not be able to activate shake to reset
// when the accelerometer is not available
mSensorMgr = (SensorManager) mContext.getSystemService(Context.SENSOR_SERVICE);

View File

@ -44,7 +44,7 @@ public final class DBReader {
/**
* Maximum size of the list returned by {@link #getDownloadLog()}.
*/
public static final int DOWNLOAD_LOG_SIZE = 200;
private static final int DOWNLOAD_LOG_SIZE = 200;
private DBReader() {
@ -120,7 +120,7 @@ public final class DBReader {
loadFeedDataOfFeedItemList(items);
}
public static void loadTagsOfFeedItemList(List<FeedItem> items) {
private static void loadTagsOfFeedItemList(List<FeedItem> items) {
LongList favoriteIds = getFavoriteIDList();
LongList queueIds = getQueueIDList();
@ -141,7 +141,7 @@ public final class DBReader {
*
* @param items The FeedItems whose Feed-objects should be loaded.
*/
public static void loadFeedDataOfFeedItemList(List<FeedItem> items) {
private static void loadFeedDataOfFeedItemList(List<FeedItem> items) {
List<Feed> feeds = getFeedList();
Map<Long, Feed> feedIndex = new ArrayMap<>(feeds.size());
@ -412,7 +412,7 @@ public final class DBReader {
}
}
public static LongList getFavoriteIDList() {
private static LongList getFavoriteIDList() {
Log.d(TAG, "getFavoriteIDList() called");
PodDBAdapter adapter = PodDBAdapter.getInstance();
@ -663,7 +663,7 @@ public final class DBReader {
}
}
static FeedItem getFeedItem(final String podcastUrl, final String episodeUrl, PodDBAdapter adapter) {
private static FeedItem getFeedItem(final String podcastUrl, final String episodeUrl, PodDBAdapter adapter) {
Log.d(TAG, "Loading feeditem with podcast url " + podcastUrl + " and episode url " + episodeUrl);
Cursor cursor = null;
try {
@ -797,7 +797,7 @@ public final class DBReader {
}
}
static void loadChaptersOfFeedItem(PodDBAdapter adapter, FeedItem item) {
private static void loadChaptersOfFeedItem(PodDBAdapter adapter, FeedItem item) {
Cursor cursor = null;
try {
cursor = adapter.getSimpleChaptersOfFeedItemCursor(item);

View File

@ -47,7 +47,7 @@ import static android.content.Context.MODE_PRIVATE;
public final class DBTasks {
private static final String TAG = "DBTasks";
public static final String PREF_NAME = "dbtasks";
private static final String PREF_NAME = "dbtasks";
private static final String PREF_LAST_REFRESH = "last_refresh";
/**
@ -292,7 +292,7 @@ public final class DBTasks {
* @param context Used for requesting the download.
* @param feed The Feed object.
*/
public static void refreshFeed(Context context, Feed feed)
private static void refreshFeed(Context context, Feed feed)
throws DownloadRequestException {
Log.d(TAG, "refreshFeed(feed.id: " + feed.getId() +")");
refreshFeed(context, feed, false, false);
@ -820,7 +820,7 @@ public final class DBTasks {
public abstract void execute(PodDBAdapter adapter);
protected void setResult(T result) {
void setResult(T result) {
this.result = result;
}
}

View File

@ -838,9 +838,9 @@ public class DBWriter {
*
* @param startFlattrClickWorker true if FlattrClickWorker should be started after the FlattrStatus has been saved
*/
public static Future<?> setFeedItemFlattrStatus(final Context context,
final FeedItem item,
final boolean startFlattrClickWorker) {
private static Future<?> setFeedItemFlattrStatus(final Context context,
final FeedItem item,
final boolean startFlattrClickWorker) {
return dbExec.submit(() -> {
PodDBAdapter adapter = PodDBAdapter.getInstance();
adapter.open();

View File

@ -33,8 +33,8 @@ public class DownloadRequester {
private static final String TAG = "DownloadRequester";
public static final String IMAGE_DOWNLOADPATH = "images/";
public static final String FEED_DOWNLOADPATH = "cache/";
public static final String MEDIA_DOWNLOADPATH = "media/";
private static final String FEED_DOWNLOADPATH = "cache/";
private static final String MEDIA_DOWNLOADPATH = "media/";
/**
* Denotes the page of the feed that is contained in the DownloadRequest sent by the DownloadRequester.
@ -305,13 +305,13 @@ public class DownloadRequester {
return downloads.size();
}
public synchronized String getFeedfilePath(Context context)
private synchronized String getFeedfilePath(Context context)
throws DownloadRequestException {
return getExternalFilesDirOrThrowException(context, FEED_DOWNLOADPATH)
.toString() + "/";
}
public synchronized String getFeedfileName(Feed feed) {
private synchronized String getFeedfileName(Feed feed) {
String filename = feed.getDownload_url();
if (feed.getTitle() != null && !feed.getTitle().isEmpty()) {
filename = feed.getTitle();
@ -319,7 +319,7 @@ public class DownloadRequester {
return "feed-" + FileNameGenerator.generateFileName(filename);
}
public synchronized String getMediafilePath(Context context, FeedMedia media)
private synchronized String getMediafilePath(Context context, FeedMedia media)
throws DownloadRequestException {
File externalStorage = getExternalFilesDirOrThrowException(
context,

View File

@ -15,7 +15,7 @@ public abstract class EpisodeCleanupAlgorithm {
* or getPerformCleanupParameter.
* @return The number of episodes that were deleted.
*/
public abstract int performCleanup(Context context, int numToRemove);
protected abstract int performCleanup(Context context, int numToRemove);
public int performCleanup(Context context) {
return performCleanup(context, getDefaultCleanupParameter());
@ -26,7 +26,7 @@ public abstract class EpisodeCleanupAlgorithm {
* space to free to satisfy the episode cache conditions. If the conditions are already satisfied, this
* method should not have any effects.
*/
public abstract int getDefaultCleanupParameter();
protected abstract int getDefaultCleanupParameter();
/**
* Cleans up just enough episodes to make room for the requested number
@ -48,7 +48,7 @@ public abstract class EpisodeCleanupAlgorithm {
* @param amountOfRoomNeeded the number of episodes we want to download
* @return the number of episodes to delete in order to make room
*/
protected int getNumEpisodesToCleanup(final int amountOfRoomNeeded) {
int getNumEpisodesToCleanup(final int amountOfRoomNeeded) {
if (amountOfRoomNeeded >= 0
&& UserPreferences.getEpisodeCacheSize() != UserPreferences
.getEpisodeCacheSizeUnlimited()) {

View File

@ -26,7 +26,7 @@ public class FeedItemStatistics {
* @param lastUpdate pubDate of the latest episode. A lastUpdate value of 0 will be interpreted as DATE_UNKOWN if
* numberOfItems is 0.
*/
public FeedItemStatistics(long feedID, int numberOfItems, int numberOfNewItems, int numberOfInProgressItems, Date lastUpdate) {
private FeedItemStatistics(long feedID, int numberOfItems, int numberOfNewItems, int numberOfInProgressItems, Date lastUpdate) {
this.feedID = feedID;
this.numberOfItems = numberOfItems;
this.numberOfNewItems = numberOfNewItems;

View File

@ -73,7 +73,7 @@ public class PodDBAdapter {
public static final String KEY_MIME_TYPE = "mime_type";
public static final String KEY_IMAGE = "image";
public static final String KEY_FEED = "feed";
public static final String KEY_MEDIA = "media";
private static final String KEY_MEDIA = "media";
public static final String KEY_DOWNLOADED = "downloaded";
public static final String KEY_LASTUPDATE = "last_update";
public static final String KEY_FEEDFILE = "feedfile";
@ -125,7 +125,7 @@ public class PodDBAdapter {
private static final String TABLE_PRIMARY_KEY = KEY_ID
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,";
public static final String CREATE_TABLE_FEEDS = "CREATE TABLE "
private static final String CREATE_TABLE_FEEDS = "CREATE TABLE "
+ TABLE_NAME_FEEDS + " (" + TABLE_PRIMARY_KEY + KEY_TITLE
+ " TEXT," + KEY_CUSTOM_TITLE + " TEXT," + KEY_FILE_URL + " TEXT," + KEY_DOWNLOAD_URL + " TEXT,"
+ KEY_DOWNLOADED + " INTEGER," + KEY_LINK + " TEXT,"
@ -145,7 +145,7 @@ public class PodDBAdapter {
+ KEY_LAST_UPDATE_FAILED + " INTEGER DEFAULT 0,"
+ KEY_AUTO_DELETE_ACTION + " INTEGER DEFAULT 0)";
public static final String CREATE_TABLE_FEED_ITEMS = "CREATE TABLE "
private static final String CREATE_TABLE_FEED_ITEMS = "CREATE TABLE "
+ TABLE_NAME_FEED_ITEMS + " (" + TABLE_PRIMARY_KEY + KEY_TITLE
+ " TEXT," + KEY_CONTENT_ENCODED + " TEXT," + KEY_PUBDATE
+ " INTEGER," + KEY_READ + " INTEGER," + KEY_LINK + " TEXT,"
@ -156,12 +156,12 @@ public class PodDBAdapter {
+ KEY_IMAGE + " INTEGER,"
+ KEY_AUTO_DOWNLOAD + " INTEGER)";
public static final String CREATE_TABLE_FEED_IMAGES = "CREATE TABLE "
private static final String CREATE_TABLE_FEED_IMAGES = "CREATE TABLE "
+ TABLE_NAME_FEED_IMAGES + " (" + TABLE_PRIMARY_KEY + KEY_TITLE
+ " TEXT," + KEY_FILE_URL + " TEXT," + KEY_DOWNLOAD_URL + " TEXT,"
+ KEY_DOWNLOADED + " INTEGER)";
public static final String CREATE_TABLE_FEED_MEDIA = "CREATE TABLE "
private static final String CREATE_TABLE_FEED_MEDIA = "CREATE TABLE "
+ TABLE_NAME_FEED_MEDIA + " (" + TABLE_PRIMARY_KEY + KEY_DURATION
+ " INTEGER," + KEY_FILE_URL + " TEXT," + KEY_DOWNLOAD_URL
+ " TEXT," + KEY_DOWNLOADED + " INTEGER," + KEY_POSITION
@ -172,53 +172,53 @@ public class PodDBAdapter {
+ KEY_HAS_EMBEDDED_PICTURE + " INTEGER,"
+ KEY_LAST_PLAYED_TIME + " INTEGER)";
public static final String CREATE_TABLE_DOWNLOAD_LOG = "CREATE TABLE "
private static final String CREATE_TABLE_DOWNLOAD_LOG = "CREATE TABLE "
+ TABLE_NAME_DOWNLOAD_LOG + " (" + TABLE_PRIMARY_KEY + KEY_FEEDFILE
+ " INTEGER," + KEY_FEEDFILETYPE + " INTEGER," + KEY_REASON
+ " INTEGER," + KEY_SUCCESSFUL + " INTEGER," + KEY_COMPLETION_DATE
+ " INTEGER," + KEY_REASON_DETAILED + " TEXT,"
+ KEY_DOWNLOADSTATUS_TITLE + " TEXT)";
public static final String CREATE_TABLE_QUEUE = "CREATE TABLE "
private static final String CREATE_TABLE_QUEUE = "CREATE TABLE "
+ TABLE_NAME_QUEUE + "(" + KEY_ID + " INTEGER PRIMARY KEY,"
+ KEY_FEEDITEM + " INTEGER," + KEY_FEED + " INTEGER)";
public static final String CREATE_TABLE_SIMPLECHAPTERS = "CREATE TABLE "
private static final String CREATE_TABLE_SIMPLECHAPTERS = "CREATE TABLE "
+ TABLE_NAME_SIMPLECHAPTERS + " (" + TABLE_PRIMARY_KEY + KEY_TITLE
+ " TEXT," + KEY_START + " INTEGER," + KEY_FEEDITEM + " INTEGER,"
+ KEY_LINK + " TEXT," + KEY_CHAPTER_TYPE + " INTEGER)";
// SQL Statements for creating indexes
public static final String CREATE_INDEX_FEEDITEMS_FEED = "CREATE INDEX "
private static final String CREATE_INDEX_FEEDITEMS_FEED = "CREATE INDEX "
+ TABLE_NAME_FEED_ITEMS + "_" + KEY_FEED + " ON " + TABLE_NAME_FEED_ITEMS + " ("
+ KEY_FEED + ")";
public static final String CREATE_INDEX_FEEDITEMS_IMAGE = "CREATE INDEX "
private static final String CREATE_INDEX_FEEDITEMS_IMAGE = "CREATE INDEX "
+ TABLE_NAME_FEED_ITEMS + "_" + KEY_IMAGE + " ON " + TABLE_NAME_FEED_ITEMS + " ("
+ KEY_IMAGE + ")";
public static final String CREATE_INDEX_FEEDITEMS_PUBDATE = "CREATE INDEX IF NOT EXISTS "
private static final String CREATE_INDEX_FEEDITEMS_PUBDATE = "CREATE INDEX IF NOT EXISTS "
+ TABLE_NAME_FEED_ITEMS + "_" + KEY_PUBDATE + " ON " + TABLE_NAME_FEED_ITEMS + " ("
+ KEY_PUBDATE + ")";
public static final String CREATE_INDEX_FEEDITEMS_READ = "CREATE INDEX IF NOT EXISTS "
private static final String CREATE_INDEX_FEEDITEMS_READ = "CREATE INDEX IF NOT EXISTS "
+ TABLE_NAME_FEED_ITEMS + "_" + KEY_READ + " ON " + TABLE_NAME_FEED_ITEMS + " ("
+ KEY_READ + ")";
public static final String CREATE_INDEX_QUEUE_FEEDITEM = "CREATE INDEX "
private static final String CREATE_INDEX_QUEUE_FEEDITEM = "CREATE INDEX "
+ TABLE_NAME_QUEUE + "_" + KEY_FEEDITEM + " ON " + TABLE_NAME_QUEUE + " ("
+ KEY_FEEDITEM + ")";
public static final String CREATE_INDEX_FEEDMEDIA_FEEDITEM = "CREATE INDEX "
private static final String CREATE_INDEX_FEEDMEDIA_FEEDITEM = "CREATE INDEX "
+ TABLE_NAME_FEED_MEDIA + "_" + KEY_FEEDITEM + " ON " + TABLE_NAME_FEED_MEDIA + " ("
+ KEY_FEEDITEM + ")";
public static final String CREATE_INDEX_SIMPLECHAPTERS_FEEDITEM = "CREATE INDEX "
private static final String CREATE_INDEX_SIMPLECHAPTERS_FEEDITEM = "CREATE INDEX "
+ TABLE_NAME_SIMPLECHAPTERS + "_" + KEY_FEEDITEM + " ON " + TABLE_NAME_SIMPLECHAPTERS + " ("
+ KEY_FEEDITEM + ")";
public static final String CREATE_TABLE_FAVORITES = "CREATE TABLE "
private static final String CREATE_TABLE_FAVORITES = "CREATE TABLE "
+ TABLE_NAME_FAVORITES + "(" + KEY_ID + " INTEGER PRIMARY KEY,"
+ KEY_FEEDITEM + " INTEGER," + KEY_FEED + " INTEGER)";
@ -391,7 +391,7 @@ public class PodDBAdapter {
*
* @return the id of the entry
*/
public long setFeed(Feed feed) {
private long setFeed(Feed feed) {
ContentValues values = new ContentValues();
values.put(KEY_TITLE, feed.getFeedTitle());
values.put(KEY_LINK, feed.getLink());
@ -838,7 +838,7 @@ public class PodDBAdapter {
}
}
public void setChapters(FeedItem item) {
private void setChapters(FeedItem item) {
ContentValues values = new ContentValues();
for (Chapter chapter : item.getChapters()) {
values.put(KEY_TITLE, chapter.getTitle());
@ -946,7 +946,7 @@ public class PodDBAdapter {
db.execSQL(deleteClause);
}
public boolean isItemInFavorites(FeedItem item) {
private boolean isItemInFavorites(FeedItem item) {
String query = String.format("SELECT %s from %s WHERE %s=%d",
KEY_ID, TABLE_NAME_FAVORITES, KEY_FEEDITEM, item.getId());
Cursor c = db.rawQuery(query, null);
@ -990,7 +990,7 @@ public class PodDBAdapter {
db.delete(TABLE_NAME_QUEUE, null, null);
}
public void removeFeedMedia(FeedMedia media) {
private void removeFeedMedia(FeedMedia media) {
// delete download log entries for feed media
db.delete(TABLE_NAME_DOWNLOAD_LOG, KEY_FEEDFILE + "=? AND " + KEY_FEEDFILETYPE + "=?",
new String[]{String.valueOf(media.getId()), String.valueOf(FeedMedia.FEEDFILETYPE_FEEDMEDIA)});
@ -999,12 +999,12 @@ public class PodDBAdapter {
new String[]{String.valueOf(media.getId())});
}
public void removeChaptersOfItem(FeedItem item) {
private void removeChaptersOfItem(FeedItem item) {
db.delete(TABLE_NAME_SIMPLECHAPTERS, KEY_FEEDITEM + "=?",
new String[]{String.valueOf(item.getId())});
}
public void removeFeedImage(FeedImage image) {
private void removeFeedImage(FeedImage image) {
db.delete(TABLE_NAME_FEED_IMAGES, KEY_ID + "=?",
new String[]{String.valueOf(image.getId())});
}
@ -1012,7 +1012,7 @@ public class PodDBAdapter {
/**
* Remove a FeedItem and its FeedMedia entry.
*/
public void removeFeedItem(FeedItem item) {
private void removeFeedItem(FeedItem item) {
if (item.getMedia() != null) {
removeFeedMedia(item.getMedia());
}
@ -1088,7 +1088,7 @@ public class PodDBAdapter {
return getAllItemsOfFeedCursor(feed.getId());
}
public final Cursor getAllItemsOfFeedCursor(final long feedId) {
private Cursor getAllItemsOfFeedCursor(final long feedId) {
return db.query(TABLE_NAME_FEED_ITEMS, FEEDITEM_SEL_FI_SMALL, KEY_FEED
+ "=?", new String[]{String.valueOf(feedId)}, null, null,
null);

View File

@ -20,29 +20,29 @@ public class HandlerState {
/**
* Feed that the Handler is currently processing.
*/
protected Feed feed;
Feed feed;
/**
* Contains links to related feeds, e.g. feeds with enclosures in other formats. The key of the map is the
* URL of the feed, the value is the title
*/
protected Map<String, String> alternateUrls;
protected ArrayList<FeedItem> items;
protected FeedItem currentItem;
protected Stack<SyndElement> tagstack;
Map<String, String> alternateUrls;
private ArrayList<FeedItem> items;
private FeedItem currentItem;
Stack<SyndElement> tagstack;
/**
* Namespaces that have been defined so far.
*/
protected Map<String, Namespace> namespaces;
protected Stack<Namespace> defaultNamespaces;
Map<String, Namespace> namespaces;
Stack<Namespace> defaultNamespaces;
/**
* Buffer for saving characters.
*/
protected StringBuffer contentBuf;
StringBuffer contentBuf;
/**
* Temporarily saved objects.
*/
protected Map<String, Object> tempObjects;
private Map<String, Object> tempObjects;
public HandlerState(Feed feed) {
this.feed = feed;

View File

@ -18,10 +18,10 @@ import de.danoeh.antennapod.core.syndication.namespace.SyndElement;
import de.danoeh.antennapod.core.syndication.namespace.atom.NSAtom;
/** Superclass for all SAX Handlers which process Syndication formats */
public class SyndHandler extends DefaultHandler {
class SyndHandler extends DefaultHandler {
private static final String TAG = "SyndHandler";
private static final String DEFAULT_PREFIX = "";
protected HandlerState state;
HandlerState state;
public SyndHandler(Feed feed, TypeGetter.Type type) {
state = new HandlerState(feed);

View File

@ -21,8 +21,8 @@ public class NSITunes extends Namespace {
private static final String AUTHOR = "author";
public static final String DURATION = "duration";
public static final String SUBTITLE = "subtitle";
public static final String SUMMARY = "summary";
private static final String SUBTITLE = "subtitle";
private static final String SUMMARY = "summary";
@Override

View File

@ -17,11 +17,11 @@ public class NSSimpleChapters extends Namespace {
public static final String NSTAG = "psc|sc";
public static final String NSURI = "http://podlove.org/simple-chapters";
public static final String CHAPTERS = "chapters";
public static final String CHAPTER = "chapter";
public static final String START = "start";
public static final String TITLE = "title";
public static final String HREF = "href";
private static final String CHAPTERS = "chapters";
private static final String CHAPTER = "chapter";
private static final String START = "start";
private static final String TITLE = "title";
private static final String HREF = "href";
@Override
public SyndElement handleElementStart(String localName, HandlerState state,

View File

@ -2,8 +2,8 @@ package de.danoeh.antennapod.core.syndication.namespace;
/** Defines a XML Element that is pushed on the tagstack */
public class SyndElement {
protected String name;
protected Namespace namespace;
private String name;
private Namespace namespace;
public SyndElement(String name, Namespace namespace) {
this.name = name;

View File

@ -8,8 +8,8 @@ import de.danoeh.antennapod.core.syndication.namespace.SyndElement;
/** Represents Atom Element which contains text (content, title, summary). */
public class AtomText extends SyndElement {
public static final String TYPE_TEXT = "text";
public static final String TYPE_HTML = "html";
public static final String TYPE_XHTML = "xhtml";
private static final String TYPE_HTML = "html";
private static final String TYPE_XHTML = "xhtml";
private String type;
private String content;

View File

@ -64,8 +64,8 @@ public class NSAtom extends Namespace {
private static final String isText = TITLE + "|" + CONTENT + "|"
+ SUBTITLE + "|" + SUMMARY;
public static final String isFeed = FEED + "|" + NSRSS20.CHANNEL;
public static final String isFeedItem = ENTRY + "|" + NSRSS20.ITEM;
private static final String isFeed = FEED + "|" + NSRSS20.CHANNEL;
private static final String isFeedItem = ENTRY + "|" + NSRSS20.ITEM;
@Override
public SyndElement handleElementStart(String localName, HandlerState state,

View File

@ -92,7 +92,7 @@ public class DuckType {
* false otherwise.
*/
@SuppressWarnings("rawtypes")
public boolean quacksLikeA(Class iface) {
private boolean quacksLikeA(Class iface) {
for (Method method : iface.getMethods()) {
if (findMethodBySignature(method) == null) {
return false;

Some files were not shown because too many files have changed in this diff Show More