[android] Fixed compass throttling

This commit is contained in:
Dmitry Donskoy 2018-09-17 11:17:57 +03:00 committed by Aleksandr Zatsepin
parent 48deff91e5
commit 0bc08177fc

View file

@ -44,13 +44,12 @@ class SensorHelper implements SensorEventListener
}
SensorType type = SensorType.get(event);
if (type == SensorType.TYPE_MAGNETIC_FIELD)
addRateLimitMessage();
if (!mHandler.hasMessages(MARKER) || type != SensorType.TYPE_MAGNETIC_FIELD)
{
notifyImmediately(event);
}
if (type == SensorType.TYPE_MAGNETIC_FIELD && !mHandler.hasMessages(MARKER))
addRateLimitMessage();
}
private void addRateLimitMessage()