-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate FLP as a Location source #220
base: main
Are you sure you want to change the base?
Conversation
@@ -168,6 +192,9 @@ class ExerciseClientManager @Inject constructor( | |||
* cancelled, this flow will unregister the listener. | |||
* [callbackFlow] is used to bridge between a callback-based API and Kotlin flows. | |||
*/ | |||
@OptIn(ExperimentalCoroutinesApi::class) | |||
@SuppressLint("MissingPermission") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worrying to have suppressions. Are there ways to structure without needing a suppression?
requestLocationUpdates(locationRequest, locationListener, Looper.getMainLooper()) // is this the right looper? | ||
awaitClose { removeLocationUpdates(locationListener) } | ||
|
||
Log.d("qqqqqq", "requested location updates") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this won't display, awaitClose{} is blocking. move above?
|
||
override fun onExerciseUpdateReceived(update: ExerciseUpdate) { | ||
|
||
val hasLocation = update.latestMetrics.getData(DataType.LOCATION).isNotEmpty() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably worth some comments why you are working around WHS. Or is this something health-services-client should be doing?
|
||
@SuppressLint("RestrictedApi") | ||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") | ||
fun DataPointContainer.fromLocation(l: Location) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels awkward, ideally would only be in test code.
If you want to leave it, it should have a TODO linking to a tracking bug requesting these APIs be public.
TODO