Fix location tracking (#691)

* Fix location tracking.

* Fix requesting accurate location.
This commit is contained in:
Justin Bassett 2020-08-01 20:49:10 -04:00 committed by GitHub
parent b2fd541c9c
commit 46661d4518
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -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)
}

View file

@ -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)