Always read ethernet regex

This commit is contained in:
Mygod
2020-05-29 04:48:04 +08:00
parent 84dabae3c8
commit 6e848caa87
2 changed files with 4 additions and 5 deletions

View File

@@ -48,11 +48,9 @@ enum class TetherType {
wimaxRegexs = getRegexs("config_tether_wimax_regexs")
bluetoothRegexs = getRegexs("config_tether_bluetooth_regexs")
ncmRegexs = if (BuildCompat.isAtLeastR()) getRegexs("config_tether_ncm_regexs") else emptyList()
ethernetRegex = if (BuildCompat.isAtLeastR()) {
system.getString(system.getIdentifier("config_ethernet_iface_regex", "string", "android")).run {
if (isEmpty()) null else toPattern()
}
} else null
// available since Android 4.0: https://android.googlesource.com/platform/frameworks/base/+/c96a667162fab44a250503caccb770109a9cb69a
ethernetRegex = system.getString(system.getIdentifier("config_ethernet_iface_regex", "string",
"android")).run { if (isEmpty()) null else toPattern() }
}
/**