Use no value as auto oc
This commit is contained in:
@@ -30,7 +30,6 @@ class App : Application() {
|
||||
deviceContext.moveSharedPreferencesFrom(this, PreferenceManager.getDefaultSharedPreferencesName(this))
|
||||
} else deviceContext = this
|
||||
// workaround for support lib PreferenceDataStore bug
|
||||
operatingChannel = operatingChannel
|
||||
dns = dns
|
||||
ServiceNotification.updateNotificationChannels()
|
||||
}
|
||||
@@ -45,12 +44,10 @@ class App : Application() {
|
||||
val pref: SharedPreferences by lazy { PreferenceManager.getDefaultSharedPreferences(deviceContext) }
|
||||
val connectivity by lazy { getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager }
|
||||
|
||||
var operatingChannel: Int
|
||||
get() {
|
||||
val result = pref.getString(KEY_OPERATING_CHANNEL, null)?.toIntOrNull() ?: 0
|
||||
return if (result in 0..165) result else 0
|
||||
}
|
||||
set(value) = pref.edit().putString(KEY_OPERATING_CHANNEL, value.toString()).apply()
|
||||
val operatingChannel: Int get() {
|
||||
val result = pref.getString(KEY_OPERATING_CHANNEL, null)?.toIntOrNull() ?: 0
|
||||
return if (result in 1..165) result else 0
|
||||
}
|
||||
var dns: String
|
||||
get() = pref.getString(KEY_DNS, "8.8.8.8")
|
||||
set(value) = pref.edit().putString(KEY_DNS, value).apply()
|
||||
|
||||
Reference in New Issue
Block a user