Fix more crashes
This commit is contained in:
@@ -249,7 +249,7 @@ class RepeaterService : Service(), CoroutineScope, WifiP2pManager.ChannelListene
|
||||
private fun onPersistentGroupsChanged() = launch {
|
||||
val ownerAddress = lastMac?.let(MacAddressCompat.Companion::fromString) ?: try {
|
||||
P2pSupplicantConfiguration().apply { init() }.bssid
|
||||
} catch (e: RuntimeException) {
|
||||
} catch (e: Exception) {
|
||||
Timber.d(e)
|
||||
null
|
||||
} ?: return@launch
|
||||
|
||||
@@ -159,7 +159,7 @@ abstract class IpMonitor {
|
||||
val lines = result.out.lines()
|
||||
if (lines.any { errorMatcher.containsMatchIn(it) }) throw IOException(result.out)
|
||||
processLines(lines.asSequence())
|
||||
} catch (e: RuntimeException) {
|
||||
} catch (e: Exception) {
|
||||
app.logEvent("ip_su_poll_failure") { param("cause", e.message.toString()) }
|
||||
Timber.d(e)
|
||||
}
|
||||
|
||||
@@ -84,20 +84,22 @@ class WifiApDialogFragment : AlertDialogFragment<WifiApDialogFragment.Arg, WifiA
|
||||
private var started = false
|
||||
override val ret get() = Arg(generateConfig())
|
||||
|
||||
private fun generateConfig(populateBssid: Boolean = true) = base.copy(
|
||||
private fun generateConfig(full: Boolean = true) = base.copy(
|
||||
ssid = dialogView.ssid.text.toString(),
|
||||
passphrase = if (dialogView.password.length() != 0) dialogView.password.text.toString() else null).apply {
|
||||
if (!arg.p2pMode) {
|
||||
securityType = dialogView.security.selectedItemPosition
|
||||
isHiddenSsid = dialogView.hiddenSsid.isChecked
|
||||
}
|
||||
if (full) {
|
||||
val bandOption = dialogView.band.selectedItem as BandOption
|
||||
band = bandOption.band
|
||||
channel = bandOption.channel
|
||||
if (populateBssid) bssid = if (dialogView.bssid.length() != 0) {
|
||||
bssid = if (dialogView.bssid.length() != 0) {
|
||||
MacAddressCompat.fromString(dialogView.bssid.text.toString())
|
||||
} else null
|
||||
}
|
||||
}
|
||||
|
||||
override fun AlertDialog.Builder.prepare(listener: DialogInterface.OnClickListener) {
|
||||
val activity = requireActivity()
|
||||
@@ -142,7 +144,7 @@ class WifiApDialogFragment : AlertDialogFragment<WifiApDialogFragment.Arg, WifiA
|
||||
setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
||||
}
|
||||
} else dialogView.bandWrapper.isGone = true
|
||||
if (!arg.readOnly) dialogView.bssid.addTextChangedListener(this@WifiApDialogFragment)
|
||||
dialogView.bssid.addTextChangedListener(this@WifiApDialogFragment)
|
||||
if (arg.p2pMode) dialogView.hiddenSsid.isGone = true
|
||||
base = arg.configuration
|
||||
populateFromConfiguration()
|
||||
|
||||
Reference in New Issue
Block a user