mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-06-06 02:23:05 +03:00
Address wifi deprecation
This commit is contained in:
parent
4d1c7464b9
commit
e8bf5a38b7
@ -403,7 +403,12 @@ object Util {
|
|||||||
fun createWifiLock(tag: String?): WifiLock {
|
fun createWifiLock(tag: String?): WifiLock {
|
||||||
val wm =
|
val wm =
|
||||||
appContext().applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
|
appContext().applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
|
||||||
return wm.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, tag)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||||
|
return wm.createWifiLock(WifiManager.WIFI_MODE_FULL_LOW_LATENCY, tag)
|
||||||
|
} else {
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
|
return wm.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, tag)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getScaledHeight(height: Double, width: Double, newWidth: Int): Int {
|
fun getScaledHeight(height: Double, width: Double, newWidth: Int): Int {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user