mirror of
https://github.com/home-assistant/android
synced 2024-10-15 12:32:54 +00:00
Fix location tracking (#691)
* Fix location tracking. * Fix requesting accurate location.
This commit is contained in:
parent
b2fd541c9c
commit
46661d4518
|
@ -146,7 +146,7 @@ class LocationBroadcastReceiver : LocationBroadcastReceiverBase() {
|
|||
}
|
||||
|
||||
private fun getLocationUpdateIntent(context: Context, isGeofence: Boolean): PendingIntent {
|
||||
val intent = Intent(context, LocationBroadcastReceiverBase::class.java)
|
||||
val intent = Intent(context, LocationBroadcastReceiver::class.java)
|
||||
intent.action = if (isGeofence) ACTION_PROCESS_GEO else ACTION_PROCESS_LOCATION
|
||||
return PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ import androidx.core.text.HtmlCompat
|
|||
import com.google.firebase.messaging.FirebaseMessagingService
|
||||
import com.google.firebase.messaging.RemoteMessage
|
||||
import io.homeassistant.companion.android.R
|
||||
import io.homeassistant.companion.android.background.LocationBroadcastReceiver
|
||||
import io.homeassistant.companion.android.background.LocationBroadcastReceiverBase
|
||||
import io.homeassistant.companion.android.common.dagger.GraphComponentAccessor
|
||||
import io.homeassistant.companion.android.domain.authentication.AuthenticationUseCase
|
||||
|
@ -106,7 +107,7 @@ class MessagingService : FirebaseMessagingService() {
|
|||
}
|
||||
|
||||
private fun requestAccurateLocationUpdate() {
|
||||
val intent = Intent(this, LocationBroadcastReceiverBase::class.java)
|
||||
val intent = Intent(this, LocationBroadcastReceiver::class.java)
|
||||
intent.action = LocationBroadcastReceiverBase.ACTION_REQUEST_ACCURATE_LOCATION_UPDATE
|
||||
|
||||
sendBroadcast(intent)
|
||||
|
|
Loading…
Reference in a new issue