Merge branch 'v2.4' into q-beta

This commit is contained in:
Mygod
2019-04-14 13:06:12 +08:00
15 changed files with 96 additions and 93 deletions

View File

@@ -219,6 +219,6 @@ class RepeaterManager(private val parent: TetheringFragment) : Manager(), Servic
}
holder.config = null
}
RepeaterService.operatingChannel = config.apChannel
if (Build.VERSION.SDK_INT >= 23) RepeaterService.operatingChannel = config.apChannel
}
}

View File

@@ -163,7 +163,7 @@ sealed class TetherManager(protected val parent: TetheringFragment) : Manager(),
override val type get() = VIEW_TYPE_BLUETOOTH
override val isStarted get() = tethering.active == true
override fun onException() = ManageBar.start(parent.requireContext())
override fun onException() = ManageBar.start(parent.context ?: app)
override fun start() = BluetoothTethering.start(this)
override fun stop() {

View File

@@ -105,7 +105,7 @@ class TetheringFragment : Fragment(), ServiceConnection, Toolbar.OnMenuItemClick
}
private fun updateMonitorList(canMonitor: List<String> = emptyList()) {
val item = requireActivity().toolbar.menu.findItem(R.id.monitor) ?: return // assuming no longer foreground
val item = activity?.toolbar?.menu?.findItem(R.id.monitor) ?: return // assuming no longer foreground
item.isNotGone = canMonitor.isNotEmpty()
item.subMenu.apply {
clear()