Android WebView地理位置仅适用于Wifi打开/始终扫描

Android WebView地理位置仅适用于Wifi打开/始终扫描,android,android-webview,android-location,google-geolocation,Android,Android Webview,Android Location,Google Geolocation,我正在尝试启用WebView以使用移动数据(3g/lte)获取位置,但仅当我使用WiFi/启用WiFi扫描时才会收到位置 以下是使用移动数据时系统打印的位置请求日志: LocationManagerService: requestLocationUpdates: uid=11294, pid=17340, provider=fused, package=com.my.package listener= android.location.ILocationListener$Stub$Proxy@

我正在尝试启用WebView以使用移动数据(3g/lte)获取位置,但仅当我使用WiFi/启用WiFi扫描时才会收到位置

以下是使用移动数据时系统打印的位置请求日志:


LocationManagerService: requestLocationUpdates: uid=11294, pid=17340, provider=fused, package=com.my.package listener= android.location.ILocationListener$Stub$Proxy@713f86 intent= null
由于某些原因,从未收到位置,而WebView处于查找位置状态

如果Wifi已打开或启用,即使在关闭的情况下也可以始终扫描,则它在Wifi或移动数据上都可以非常快速地工作


LocationManagerService: requestLocationUpdates: uid=10014, pid=3464, provider=gps, package=com.google.android.gms listener= android.location.ILocationListener$Stub$Proxy@6f09c54 intent= null
只有在请求GPS提供商的情况下,单独使用Fused无法工作


Relevant granted permissions:
uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"
uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"
我的网络视图设置:


mWebView.settings.domStorageEnabled = true
mWebView.settings.builtInZoomControls = true
mWebView.settings.loadWithOverviewMode = true
mWebView.settings.useWideViewPort = true
mWebView.settings.displayZoomControls = false
mWebView.settings.mediaPlaybackRequiresUserGesture = false
mWebView.settings.setAppCacheEnabled(true)
mWebView.settings.databaseEnabled = true
mWebView.settings.domStorageEnabled = true
mWebView.settings.javaScriptEnabled = true
mWebView.settings.allowContentAccess = true
mWebView.settings.javaScriptCanOpenWindowsAutomatically = true
mWebView.settings.setGeolocationEnabled(true)
mWebView.settings.setGeolocationDatabasePath(context.filesDir.path)
ChromeClient:


mWebView.webChromeClient = object : WebChromeClient() {

            override fun onGeolocationPermissionsShowPrompt(origin: String?, callback: GeolocationPermissions.Callback) {
                super.onGeolocationPermissionsShowPrompt(origin, callback)

                OLog.i(tag(), "Requesting location")
                callback.invoke(origin, true, true)
            }
        }