Refine code style
This commit is contained in:
@@ -71,7 +71,7 @@ class RepeaterService : Service(), WifiP2pManager.ChannelListener, SharedPrefere
|
||||
val result = app.pref.getString(KEY_OPERATING_CHANNEL, null)?.toIntOrNull() ?: 0
|
||||
return if (result in 1..165) result else 0
|
||||
}
|
||||
set(value) = app.pref.edit { putString(RepeaterService.KEY_OPERATING_CHANNEL, value.toString()) }
|
||||
set(value) = app.pref.edit { putString(KEY_OPERATING_CHANNEL, value.toString()) }
|
||||
}
|
||||
|
||||
enum class Status {
|
||||
|
||||
@@ -73,7 +73,7 @@ object MacLookup {
|
||||
private fun extractCountry(mac: Long, response: String, obj: JSONObject): MatchResult? {
|
||||
countryCodeRegex.matchEntire(obj.optString("country"))?.also { return it }
|
||||
val address = obj.optString("address")
|
||||
if (address.isNullOrBlank()) return null
|
||||
if (address.isBlank()) return null
|
||||
countryCodeRegex.find(address)?.also { return it }
|
||||
Timber.w(UnexpectedError(mac, response))
|
||||
return null
|
||||
|
||||
@@ -69,7 +69,7 @@ class WifiDoubleLock(lockType: Int) : AutoCloseable {
|
||||
LowLatency(WifiManager.WIFI_MODE_FULL_LOW_LATENCY, true),
|
||||
}
|
||||
|
||||
class ActivityListener(val activity: ComponentActivity) :
|
||||
class ActivityListener(private val activity: ComponentActivity) :
|
||||
LifecycleObserver, SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
private var keepScreenOn: Boolean = false
|
||||
set(value) {
|
||||
|
||||
Reference in New Issue
Block a user