kopia lustrzana https://github.com/ge0rg/aprsdroid
location provider improvement, message
rodzic
57396a3868
commit
2784015a80
|
@ -43,6 +43,7 @@
|
|||
<string name="service_once">APRS Service single shot.</string>
|
||||
<string name="service_start">APRS Service started. Updates every %1$d minutes, %2$d km.</string>
|
||||
<string name="service_stop">APRS Service stopped.</string>
|
||||
<string name="service_no_location">You need to enable either GPS or Network Location for APRSdroid to work properly!</string>
|
||||
|
||||
<!-- first run dialog -->
|
||||
<string name="fr_title">Welcome to APRSdroid!</string>
|
||||
|
|
|
@ -264,6 +264,13 @@ class AprsService extends Service with LocationListener {
|
|||
|
||||
override def onProviderDisabled(provider : String) {
|
||||
Log.d(TAG, "onProviderDisabled: " + provider)
|
||||
val netloc_available = locMan.getProviders(true).contains(LocationManager.NETWORK_PROVIDER)
|
||||
val netloc_usable = netloc_available && prefs.getBoolean("netloc", false)
|
||||
if (provider == LocationManager.GPS_PROVIDER &&
|
||||
netloc_usable == false) {
|
||||
// GPS was our last data source, we have to complain!
|
||||
Toast.makeText(this, R.string.service_no_location, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
override def onProviderEnabled(provider : String) {
|
||||
Log.d(TAG, "onProviderEnabled: " + provider)
|
||||
|
|
|
@ -22,7 +22,7 @@ class TcpUploader(service : AprsService, prefs : PrefsWrapper) extends AprsIsUpl
|
|||
val filterdist = prefs.getStringInt("tcp.filterdist", 50)
|
||||
val userfilter = prefs.getString("tcp.filter", "")
|
||||
val lastloc = AprsPacket.formatRangeFilter(
|
||||
service.locMan.getLastKnownLocation(LocationManager.GPS_PROVIDER), filterdist)
|
||||
service.locMan.getLastKnownLocation(LocationManager.PASSIVE_PROVIDER), filterdist)
|
||||
if (filterdist == 0) return " filter %s %s".format(userfilter, lastloc)
|
||||
else return " filter m/%d %s %s".format(filterdist, userfilter, lastloc)
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue