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,8 +403,13 @@ object Util {
|
||||
fun createWifiLock(tag: String?): WifiLock {
|
||||
val wm =
|
||||
appContext().applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
|
||||
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 {
|
||||
// Try to keep correct aspect ratio of the original image, do not force a square
|
||||
|
Loading…
x
Reference in New Issue
Block a user