Refine code style

This commit is contained in:
Mygod
2019-04-14 13:36:59 +08:00
parent b70abd6ffb
commit 8bfbe8ce53
3 changed files with 3 additions and 3 deletions

View File

@@ -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 {

View File

@@ -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

View File

@@ -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) {