mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-04-16 09:20:37 +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 {
|
||||
val wm =
|
||||
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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user