Skip to content

Commit c69bcaa

Browse files
committed
Fixed some Sonar warnings
1 parent 50d7d1b commit c69bcaa

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

app/src/main/java/org/schabi/newpipe/settings/ContentSettingsManager.kt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package org.schabi.newpipe.settings
22

33
import android.content.SharedPreferences
44
import android.util.Log
5+
import org.schabi.newpipe.MainActivity.DEBUG
56
import org.schabi.newpipe.streams.io.SharpOutputStream
67
import org.schabi.newpipe.streams.io.StoredFileHelper
78
import org.schabi.newpipe.util.ZipHelper
@@ -32,7 +33,9 @@ class ContentSettingsManager(private val fileLocator: NewPipeFileLocator) {
3233
output.flush()
3334
}
3435
} catch (e: IOException) {
35-
Log.e(TAG, "Unable to exportDatabase", e)
36+
if (DEBUG) {
37+
Log.e(TAG, "Unable to exportDatabase", e)
38+
}
3639
}
3740

3841
ZipHelper.addFileToZip(outZip, fileLocator.settings.path, "newpipe.settings")
@@ -105,9 +108,13 @@ class ContentSettingsManager(private val fileLocator: NewPipeFileLocator) {
105108
preferenceEditor.commit()
106109
}
107110
} catch (e: IOException) {
108-
Log.e(TAG, "Unable to loadSharedPreferences", e)
111+
if (DEBUG) {
112+
Log.e(TAG, "Unable to loadSharedPreferences", e)
113+
}
109114
} catch (e: ClassNotFoundException) {
110-
Log.e(TAG, "Unable to loadSharedPreferences", e)
115+
if (DEBUG) {
116+
Log.e(TAG, "Unable to loadSharedPreferences", e)
117+
}
111118
}
112119
}
113120
}

app/src/main/java/org/schabi/newpipe/views/player/PlayerFastSeekOverlay.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import android.content.Context
44
import android.util.AttributeSet
55
import android.util.Log
66
import android.view.LayoutInflater
7-
import androidx.annotation.NonNull
87
import androidx.constraintlayout.widget.ConstraintLayout
98
import androidx.constraintlayout.widget.ConstraintLayout.LayoutParams.END
109
import androidx.constraintlayout.widget.ConstraintLayout.LayoutParams.PARENT_ID
@@ -127,7 +126,6 @@ class PlayerFastSeekOverlay(context: Context, attrs: AttributeSet?) :
127126
/**
128127
* Determines if the playback should forward/rewind or do nothing.
129128
*/
130-
@NonNull
131129
fun getFastSeekDirection(portion: DisplayPortion): FastSeekDirection
132130
fun seek(forward: Boolean)
133131

0 commit comments

Comments
 (0)