diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetherManager.kt b/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetherManager.kt index 597f9ff9..db80c986 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetherManager.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/manage/TetherManager.kt @@ -165,23 +165,25 @@ sealed class TetherManager(protected val parent: TetheringFragment) : Manager(), override val title get() = parent.getString(R.string.tethering_manage_wifi) override val tetherType get() = TetherType.WIFI override val type get() = VIEW_TYPE_WIFI - override val text get() = listOfNotNull(failureReason?.let { WifiApManager.failureReasonLookup(it) }, + override val text get() = listOfNotNull(failureReason?.let { WifiApManager.failureReasonLookup(it) }, baseError, if (frequency != 0 || bandwidth != WifiApManager.CHANNEL_WIDTH_INVALID) { - "$frequency MHz, channel ${SoftApConfigurationCompat.frequencyToChannel(frequency)}, width " + - WifiApManager.channelWidthLookup(bandwidth, true) + parent.getString(R.string.tethering_manage_wifi_info, frequency, + SoftApConfigurationCompat.frequencyToChannel(frequency), + WifiApManager.channelWidthLookup(bandwidth, true)) } else null, capability?.let { (maxSupportedClients, supportedFeatures) -> - "${numClients ?: "?"}/$maxSupportedClients clients connected\nSupported features: " + sequence { + app.getString(R.string.tethering_manage_wifi_capabilities, numClients ?: "?", + maxSupportedClients, sequence { var features = supportedFeatures - if (features == 0L) yield("None") else while (features != 0L) { + if (features == 0L) yield(parent.getString(R.string.tethering_manage_wifi_no_features)) + else while (features != 0L) { @OptIn(ExperimentalStdlibApi::class) val bit = features.takeLowestOneBit() yield(WifiApManager.featureLookup(bit, true)) features = features and bit.inv() } - }.joinToString() - }, - baseError).joinToString("\n") + }.joinToString()) + }).joinToString("\n") override fun start() = TetheringManager.startTethering(TetheringManager.TETHERING_WIFI, true, this) override fun stop() = TetheringManager.stopTethering(TetheringManager.TETHERING_WIFI, this::onException) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/TetherType.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/TetherType.kt index c32a9299..05320aa7 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/TetherType.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/TetherType.kt @@ -44,7 +44,7 @@ enum class TetherType(@DrawableRes val icon: Int) { private fun Pair.getRegexs(name: String) = second.getIdentifier(name, "array", first).let { if (it == 0) { - Timber.i("$name is empty") + if (name == "config_tether_wigig_regexs") Timber.i("$name is empty") else Timber.w(Exception(name)) emptyList() } else second.getStringArray(it).filterNotNull().map { it.toPattern() } } diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApDialogFragment.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApDialogFragment.kt index 458cfe40..2d4a9b84 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApDialogFragment.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/wifi/WifiApDialogFragment.kt @@ -148,7 +148,8 @@ class WifiApDialogFragment : AlertDialogFragment= 30) { - dialogView.timeoutWrapper.helperText = "Default timeout: ${TetherTimeoutMonitor.defaultTimeout}ms" + dialogView.timeoutWrapper.helperText = getString(R.string.wifi_hotspot_timeout_default, + TetherTimeoutMonitor.defaultTimeout) if (!arg.readOnly) dialogView.timeout.addTextChangedListener(this@WifiApDialogFragment) } else dialogView.timeoutWrapper.isGone = true if (Build.VERSION.SDK_INT >= 23 || arg.p2pMode) dialogView.band.apply { diff --git a/mobile/src/main/res/layout/dialog_wifi_ap.xml b/mobile/src/main/res/layout/dialog_wifi_ap.xml index eb472a03..27ce539e 100644 --- a/mobile/src/main/res/layout/dialog_wifi_ap.xml +++ b/mobile/src/main/res/layout/dialog_wifi_ap.xml @@ -99,13 +99,13 @@ android:layout_height="wrap_content" android:layout_marginTop="8dip" style="@style/wifi_item_label" - android:text="Turn off hotspot automatically when no devices are connected"/> + android:text="@string/wifi_hotspot_auto_off"/> + android:hint="@string/wifi_advanced_mac_address_title"> Ethernet tethering USB tethering (NCM) WiGig tethering + %1$d MHz, channel %2$d, width %3$s + %1$s/%2$d clients connected\nSupported features: %3$s + None " (connecting)" " (reachable)" @@ -104,8 +108,9 @@ Start repeater on boot Repeater safe mode Makes no changes to your system configuration but might - not work with short SSIDs. - Short SSIDs might require turning off safe mode. + not work with short network names. + Short network names might require turning off safe + mode. Keep Wi\u2011Fi alive System default On @@ -169,11 +174,15 @@ Security Password The password must have at least 8 characters. + Turn off hotspot automatically when no devices are connected + Inactive timeout + Default timeout: %dms AP Band Auto 2.4 GHz Band 5.0 GHz Band 6.0 GHz Band + MAC address Hidden network Save