Remove assertions
This commit is contained in:
parent
220f549711
commit
ba3eb5e784
@ -6,6 +6,7 @@ import android.content.DialogInterface;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
import android.support.annotation.UiThread;
|
||||||
import android.support.v4.app.NavUtils;
|
import android.support.v4.app.NavUtils;
|
||||||
import android.support.v7.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
@ -508,8 +509,8 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UiThread
|
||||||
private void showErrorDialog(String errorMsg) {
|
private void showErrorDialog(String errorMsg) {
|
||||||
assert(Looper.myLooper() == Looper.getMainLooper()); // run on UI thread
|
|
||||||
if (!isFinishing() && !isPaused) {
|
if (!isFinishing() && !isPaused) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
builder.setTitle(R.string.error_label);
|
builder.setTitle(R.string.error_label);
|
||||||
|
@ -50,7 +50,6 @@ public class SubscriptionsAdapter extends BaseAdapter implements AdapterView.OnI
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int getAdjustedPosition(int origPosition) {
|
private int getAdjustedPosition(int origPosition) {
|
||||||
assert(origPosition != getAddTilePosition());
|
|
||||||
return origPosition < getAddTilePosition() ? origPosition : origPosition - 1;
|
return origPosition < getAddTilePosition() ? origPosition : origPosition - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,7 +159,6 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr
|
|||||||
int indexAutoDownload = cursor.getColumnIndex(PodDBAdapter.KEY_AUTO_DOWNLOAD);
|
int indexAutoDownload = cursor.getColumnIndex(PodDBAdapter.KEY_AUTO_DOWNLOAD);
|
||||||
|
|
||||||
long id = cursor.getInt(indexId);
|
long id = cursor.getInt(indexId);
|
||||||
assert(id > 0);
|
|
||||||
String title = cursor.getString(indexTitle);
|
String title = cursor.getString(indexTitle);
|
||||||
String link = cursor.getString(indexLink);
|
String link = cursor.getString(indexLink);
|
||||||
Date pubDate = new Date(cursor.getLong(indexPubDate));
|
Date pubDate = new Date(cursor.getLong(indexPubDate));
|
||||||
|
@ -7,6 +7,7 @@ import android.content.Intent;
|
|||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
import android.support.annotation.IntRange;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.v4.app.NotificationCompat;
|
import android.support.v4.app.NotificationCompat;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@ -513,9 +514,8 @@ public class UserPreferences {
|
|||||||
.apply();
|
.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setVolume(int leftVolume, int rightVolume) {
|
public static void setVolume(@IntRange(from = 0, to = 100) int leftVolume,
|
||||||
assert(0 <= leftVolume && leftVolume <= 100);
|
@IntRange(from = 0, to = 100) int rightVolume) {
|
||||||
assert(0 <= rightVolume && rightVolume <= 100);
|
|
||||||
prefs.edit()
|
prefs.edit()
|
||||||
.putInt(PREF_LEFT_VOLUME, leftVolume)
|
.putInt(PREF_LEFT_VOLUME, leftVolume)
|
||||||
.putInt(PREF_RIGHT_VOLUME, rightVolume)
|
.putInt(PREF_RIGHT_VOLUME, rightVolume)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user