Skip to content

Commit de2dba2

Browse files
committed
Analysis: Resolve obsolete sdk int lint warnings
Warning Message: "Unnecessary; SDK_INT is always >= 24" These 'VERSION.SDK_INT >= Build.VERSION_CODES.M/N' checks are no longer necessary as the 'minSdkVersion' is now '24'. As such, the if condition has been simplified.
1 parent 9655577 commit de2dba2

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1822,7 +1822,7 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
18221822
// Android 7 Ref: https://github.com/wordpress-mobile/WordPress-Android/issues/10872
18231823
// Android 8 Ref: https://github.com/wordpress-mobile/WordPress-Android/issues/8827
18241824
clipboardIdentifier -> {
1825-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && Build.VERSION.SDK_INT < Build.VERSION_CODES.P
1825+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P
18261826
&& Build.MANUFACTURER.lowercase(Locale.getDefault()).equals("samsung")) {
18271827
// Nope return true
18281828
Toast.makeText(context, context.getString(R.string.samsung_disabled_custom_clipboard, Build.VERSION.RELEASE), Toast.LENGTH_LONG).show()

aztec/src/main/kotlin/org/wordpress/aztec/util/ColorConverter.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package org.wordpress.aztec.util
22

33
import android.content.res.Resources
44
import android.graphics.Color
5-
import android.os.Build
65
import android.text.TextUtils
76
import androidx.annotation.ColorInt
87
import org.wordpress.aztec.util.ColorConverter.Companion.COLOR_NOT_FOUND
@@ -209,19 +208,14 @@ class ColorConverter {
209208
* cannot be translated.
210209
*/
211210
@ColorInt
212-
@Suppress("DEPRECATION")
213211
fun getColorInt(colorText: String): Int {
214212
try {
215213
if (isColorResource(colorText)) {
216214
val res = Resources.getSystem()
217215
val name = colorText.substring(1)
218216
val colorRes = res.getIdentifier(name, "color", "android")
219217
if (colorRes != 0) {
220-
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
221-
return res.getColor(colorRes)
222-
} else {
223-
return res.getColor(colorRes, null)
224-
}
218+
return res.getColor(colorRes, null)
225219
}
226220
}
227221
//

0 commit comments

Comments
 (0)