Suppress unnecessary exceptions
This commit is contained in:
@@ -108,6 +108,7 @@ class WifiApDialogFragment : AlertDialogFragment<WifiApDialogFragment.Arg, WifiA
|
|||||||
|
|
||||||
private lateinit var dialogView: DialogWifiApBinding
|
private lateinit var dialogView: DialogWifiApBinding
|
||||||
private lateinit var base: SoftApConfigurationCompat
|
private lateinit var base: SoftApConfigurationCompat
|
||||||
|
private var pasted = false
|
||||||
private var started = false
|
private var started = false
|
||||||
private val currentChannels get() = when {
|
private val currentChannels get() = when {
|
||||||
!arg.p2pMode -> softApOptions
|
!arg.p2pMode -> softApOptions
|
||||||
@@ -230,7 +231,8 @@ class WifiApDialogFragment : AlertDialogFragment<WifiApDialogFragment.Arg, WifiA
|
|||||||
val channel = base.channels.valueAt(i)
|
val channel = base.channels.valueAt(i)
|
||||||
val selection = currentChannels.indexOfFirst { it.band == band && it.channel == channel }
|
val selection = currentChannels.indexOfFirst { it.band == band && it.channel == channel }
|
||||||
return if (selection == -1) {
|
return if (selection == -1) {
|
||||||
Timber.w(Exception("Unable to locate $band, $channel, ${arg.p2pMode && !RepeaterService.safeMode}"))
|
val msg = "Unable to locate $band, $channel, ${arg.p2pMode && !RepeaterService.safeMode}"
|
||||||
|
if (pasted) Timber.w(msg) else Timber.w(Exception(msg))
|
||||||
0
|
0
|
||||||
} else selection
|
} else selection
|
||||||
}
|
}
|
||||||
@@ -375,6 +377,7 @@ class WifiApDialogFragment : AlertDialogFragment<WifiApDialogFragment.Arg, WifiA
|
|||||||
arg.configuration.underlying?.let { check(it.javaClass == newUnderlying.javaClass) }
|
arg.configuration.underlying?.let { check(it.javaClass == newUnderlying.javaClass) }
|
||||||
} else config.underlying = arg.configuration.underlying
|
} else config.underlying = arg.configuration.underlying
|
||||||
base = config
|
base = config
|
||||||
|
pasted = true
|
||||||
populateFromConfiguration()
|
populateFromConfiguration()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user