1
0
Fork 0

No issue: Fix build breakage on erroneous lint warnings for WrongConstant: MODE_NIGHT_AUTO_BATTERY

master
Colin Lee 2019-04-04 09:44:03 -05:00
parent 1d032bbe53
commit fc84d3afdc
2 changed files with 5 additions and 0 deletions

View File

@ -138,6 +138,8 @@ open class FenixApplication : Application() {
} }
} }
@SuppressLint("WrongConstant")
// Suppressing erroneous lint warning about using MODE_NIGHT_AUTO_BATTERY, a likely library bug
private fun setDayNightTheme() { private fun setDayNightTheme() {
when { when {
Settings.getInstance(this).shouldUseLightTheme -> { Settings.getInstance(this).shouldUseLightTheme -> {

View File

@ -4,6 +4,7 @@
package org.mozilla.fenix.settings package org.mozilla.fenix.settings
import android.annotation.SuppressLint
import android.os.Bundle import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate import androidx.appcompat.app.AppCompatDelegate
@ -69,6 +70,8 @@ class ThemeFragment : PreferenceFragmentCompat() {
} }
} }
@SuppressLint("WrongConstant")
// Suppressing erroneous lint warning about using MODE_NIGHT_AUTO_BATTERY, a likely library bug
private fun bindAutoBatteryTheme() { private fun bindAutoBatteryTheme() {
val keyBatteryTheme = getString(R.string.pref_key_auto_battery_theme) val keyBatteryTheme = getString(R.string.pref_key_auto_battery_theme)
radioAutoBatteryTheme = requireNotNull(findPreference(keyBatteryTheme)) radioAutoBatteryTheme = requireNotNull(findPreference(keyBatteryTheme))