Conversation
src/main/kotlin/io/ionic/libs/iongeolocationlib/controller/IONGLOCSensorHandler.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/io/ionic/libs/iongeolocationlib/controller/IONGLOCController.kt
Show resolved
Hide resolved
| } | ||
|
|
||
| awaitClose { | ||
| sensorHandler.stop() |
There was a problem hiding this comment.
Hmm how about if a user sets multiple watches?
Would think this call would make more sense inside clearWatch when watchLocationHandlers is empty. But I guess then there's the case of the app closing, we'll want to unregister the listener as well?
There was a problem hiding this comment.
Since sensorHandler tracks the watcherCount internally, it safely handles multiple watches. Tying it to awaitClose is a safer bet so we don't accidentally leak the sensor listeners if the app closes or the flow gets cancelled unexpectedly. If we relied solely on clearWatch, we would risk memory leaks whenever the user forgets to explicitly clear the watch
There was a problem hiding this comment.
Okay, that's fair, but we're not calling sensorHandler.stop() on clearWatch, perhaps we should, or you don't think it's needed?
src/main/kotlin/io/ionic/libs/iongeolocationlib/controller/IONGLOCSensorHandler.kt
Show resolved
Hide resolved
src/main/kotlin/io/ionic/libs/iongeolocationlib/controller/IONGLOCController.kt
Show resolved
Hide resolved
src/main/kotlin/io/ionic/libs/iongeolocationlib/controller/IONGLOCSensorHandler.kt
Show resolved
Hide resolved
src/main/kotlin/io/ionic/libs/iongeolocationlib/controller/helper/IONGLOCExtensions.kt
Show resolved
Hide resolved
src/main/kotlin/io/ionic/libs/iongeolocationlib/controller/IONGLOCSensorHandler.kt
Show resolved
Hide resolved
src/test/java/io/ionic/libs/iongeolocationlib/controller/IONGLOCControllerTest.kt
Show resolved
Hide resolved
addWatch
OS-pedrogustavobilro
left a comment
There was a problem hiding this comment.
A few more comments, also I don't think you addressed / replied to all the above ones (I resolved the ones that are done)
Description
This PR adds support for
heading,magneticHeading,trueHeading,headingAccuracy, andcourseContext
https://outsystemsrd.atlassian.net/browse/RMET-4897
Type of changes
Tests
Tested on Pixel 8 Pro with Capacitor example app, ODC sample app, and O11 sample app