Loading play-services-location/core/provider/src/main/kotlin/org/microg/gms/location/network/NetworkLocationService.kt +4 −2 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ class NetworkLocationService : LifecycleService(), WifiDetailsCallback, CellDeta private val cache by lazy { LocationCacheDatabase(this) } private val movingWifiHelper by lazy { MovingWifiHelper(this) } private val settings by lazy { LocationSettings(this) } private val wifiScanCache = LruCache<String?, Location>(100) private val wifiScanCache = LruCache<String, Location>(100) private var lastHighPowerScanRealtime = 0L private var lastLowPowerScanRealtime = 0L Loading Loading @@ -98,6 +98,8 @@ class NetworkLocationService : LifecycleService(), WifiDetailsCallback, CellDeta ) } } catch (e: SecurityException) { Log.d(TAG, "GPS location retriever not initialized due to lack of permission") } catch (e: Exception) { Log.d(TAG, "GPS location retriever not initialized", e) } } Loading Loading @@ -439,7 +441,7 @@ class NetworkLocationService : LifecycleService(), WifiDetailsCallback, CellDeta } } private operator fun <K, V> LruCache<K, V>.set(key: K, value: V) { private operator fun <K : Any, V : Any> LruCache<K, V>.set(key: K, value: V) { put(key, value) } Loading play-services-location/core/src/main/kotlin/org/microg/gms/location/ui/LocationPreferencesFragment.kt +6 −3 Original line number Diff line number Diff line Loading @@ -5,9 +5,10 @@ package org.microg.gms.location.ui import android.annotation.SuppressLint import android.location.LocationManager import android.os.Build.VERSION.SDK_INT import android.os.Bundle import androidx.core.content.getSystemService import androidx.core.os.bundleOf import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.findNavController Loading Loading @@ -90,8 +91,10 @@ class LocationPreferencesFragment : PreferenceFragmentCompat() { networkProviderCategory.isVisible = requireContext().hasNetworkLocationServiceBuiltIn() wifiMls.isVisible = requireContext().hasMozillaLocationServiceSupport() cellMls.isVisible = requireContext().hasMozillaLocationServiceSupport() wifiLearning.isVisible = SDK_INT >= 17 cellLearning.isVisible = SDK_INT >= 17 wifiLearning.isVisible = SDK_INT >= 17 && requireContext().getSystemService<LocationManager>()?.allProviders.orEmpty().contains(LocationManager.GPS_PROVIDER) cellLearning.isVisible = SDK_INT >= 17 && requireContext().getSystemService<LocationManager>()?.allProviders.orEmpty().contains(LocationManager.GPS_PROVIDER) } override fun onResume() { Loading Loading
play-services-location/core/provider/src/main/kotlin/org/microg/gms/location/network/NetworkLocationService.kt +4 −2 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ class NetworkLocationService : LifecycleService(), WifiDetailsCallback, CellDeta private val cache by lazy { LocationCacheDatabase(this) } private val movingWifiHelper by lazy { MovingWifiHelper(this) } private val settings by lazy { LocationSettings(this) } private val wifiScanCache = LruCache<String?, Location>(100) private val wifiScanCache = LruCache<String, Location>(100) private var lastHighPowerScanRealtime = 0L private var lastLowPowerScanRealtime = 0L Loading Loading @@ -98,6 +98,8 @@ class NetworkLocationService : LifecycleService(), WifiDetailsCallback, CellDeta ) } } catch (e: SecurityException) { Log.d(TAG, "GPS location retriever not initialized due to lack of permission") } catch (e: Exception) { Log.d(TAG, "GPS location retriever not initialized", e) } } Loading Loading @@ -439,7 +441,7 @@ class NetworkLocationService : LifecycleService(), WifiDetailsCallback, CellDeta } } private operator fun <K, V> LruCache<K, V>.set(key: K, value: V) { private operator fun <K : Any, V : Any> LruCache<K, V>.set(key: K, value: V) { put(key, value) } Loading
play-services-location/core/src/main/kotlin/org/microg/gms/location/ui/LocationPreferencesFragment.kt +6 −3 Original line number Diff line number Diff line Loading @@ -5,9 +5,10 @@ package org.microg.gms.location.ui import android.annotation.SuppressLint import android.location.LocationManager import android.os.Build.VERSION.SDK_INT import android.os.Bundle import androidx.core.content.getSystemService import androidx.core.os.bundleOf import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.findNavController Loading Loading @@ -90,8 +91,10 @@ class LocationPreferencesFragment : PreferenceFragmentCompat() { networkProviderCategory.isVisible = requireContext().hasNetworkLocationServiceBuiltIn() wifiMls.isVisible = requireContext().hasMozillaLocationServiceSupport() cellMls.isVisible = requireContext().hasMozillaLocationServiceSupport() wifiLearning.isVisible = SDK_INT >= 17 cellLearning.isVisible = SDK_INT >= 17 wifiLearning.isVisible = SDK_INT >= 17 && requireContext().getSystemService<LocationManager>()?.allProviders.orEmpty().contains(LocationManager.GPS_PROVIDER) cellLearning.isVisible = SDK_INT >= 17 && requireContext().getSystemService<LocationManager>()?.allProviders.orEmpty().contains(LocationManager.GPS_PROVIDER) } override fun onResume() { Loading