novid20org / novid20-android-sdk

NOVID20 Android SDK Source Code
https://novid20.org
GNU General Public License v3.0
36 stars 3 forks source link

Race condition in activity dependent discovery management #6

Open michaelroland opened 4 years ago

michaelroland commented 4 years ago

If the SDK detects an activity transition to STILL (device not moving) it starts a disable delay timeout (10 minutes) before it actually disables discovery (stopDetectionDelayed()). If the device then transitions to another state (e.g. walking), it issues an immediate startDetection() command. If that happens before the 10 minute timeout is over, the delay timeout (handled by a seperate thread) will still continue to run and will disable discovery once expired, even if the user still walking around.

Example 1 (no problem)

Example 2 (malfunction)