6#include <QGeoPositionInfo>
23 parseParameters(parameters);
30 &QGeoPositionInfoSourceAndroid::requestTimeout);
34 &QGeoPositionInfoSourceAndroid::regularUpdatesTimeout);
42 m_requestTimer.
stop();
55 if (msec == previousInterval)
61 reconfigureRunningSystem();
83 reconfigureRunningSystem();
98 return m_useAltitudeConverter;
101void QGeoPositionInfoSourceAndroid::setError(
Error error)
108void QGeoPositionInfoSourceAndroid::parseParameters(
const QVariantMap ¶meters)
125 updatesRunning =
true;
128 m_regularUpdatesErrorRaised =
false;
131 updatesRunning =
false;
143 updatesRunning =
false;
144 m_regularUpdatesTimer.
stop();
174 m_requestTimer.
stop();
183 m_requestTimer.
stop();
186 m_regularUpdatesErrorRaised =
false;
198 queuedSingleUpdates.
append(pInfo);
206 if (queuedSingleUpdates.
size() == maxPossibleUpdates) {
207 m_requestTimer.
stop();
214 if (updatesRunning && !m_regularUpdatesErrorRaised) {
215 m_regularUpdatesErrorRaised =
true;
227void QGeoPositionInfoSourceAndroid::requestTimeout()
232 if (queuedSingleUpdates.
isEmpty()) {
239 const qint64 timeDelta = best.timestamp().secsTo(
info.timestamp());
240 if (abs(timeDelta) > 20)
241 return timeDelta > 0;
259 queuedSingleUpdates.
end(), byAccuracy);
260 queuedSingleUpdates.
clear();
264void QGeoPositionInfoSourceAndroid::regularUpdatesTimeout()
266 if (!m_regularUpdatesErrorRaised) {
269 m_regularUpdatesErrorRaised =
true;
279void QGeoPositionInfoSourceAndroid::reconfigureRunningSystem()
static JNINativeMethod methods[]
static qint64 currentMSecsSinceEpoch() noexcept
QGeoPositionInfoSourceAndroid(const QVariantMap ¶meters, QObject *parent=0)
bool useAltitudeConverter() const
virtual void stopUpdates() override
QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly=false) const override
Returns an update containing the last known position, or a null update if none is available.
void processSinglePositionUpdate(const QGeoPositionInfo &pInfo)
virtual void startUpdates() override
void locationProvidersChanged()
~QGeoPositionInfoSourceAndroid()
virtual void requestUpdate(int timeout=0) override
void processPositionUpdate(const QGeoPositionInfo &pInfo)
void setPreferredPositioningMethods(PositioningMethods methods) override
void setUpdateInterval(int msec) override
int minimumUpdateInterval() const override
Error error() const override
Returns the type of error that last occurred.
PositioningMethods supportedPositioningMethods() const override
Returns the positioning methods available to this source.
void locationProviderDisabled()
int updateInterval
This property holds the requested interval in milliseconds between each update.
void positionUpdated(const QGeoPositionInfo &update)
If startUpdates() or requestUpdate() is called, this signal is emitted when an update becomes availab...
void errorOccurred(QGeoPositionInfoSource::Error)
This signal is emitted after an error occurred.
virtual void setPreferredPositioningMethods(PositioningMethods methods)
void supportedPositioningMethodsChanged()
This signal is emitted when the supported positioning methods changed.
Error
The Error enumeration represents the errors which can occur.
virtual void setUpdateInterval(int msec)
PositioningMethods preferredPositioningMethods
Sets the preferred positioning methods for this source.
qsizetype size() const noexcept
bool isEmpty() const noexcept
void append(parameter_type t)
T value(const Key &key, const T &defaultValue=T()) const
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void setSingleShot(bool singleShot)
void start(int msec)
Starts or restarts the timer with a timeout interval of msec milliseconds.
bool isActive() const
Returns true if the timer is running (pending); otherwise returns false.
void stop()
Stops the timer.
void timeout(QPrivateSignal)
This signal is emitted when the timer times out.
bool toBool() const
Returns the variant as a bool if the variant has userType() Bool.
void unregisterPositionInfoSource(int key)
int registerPositionInfoSource(QObject *obj)
QGeoPositionInfoSource::Error requestUpdate(int androidClassKey, int timeout)
QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly, bool useAltitudeConverter)
QGeoPositionInfoSource::Error startUpdates(int androidClassKey)
QGeoPositionInfoSource::PositioningMethods availableProviders()
void stopUpdates(int androidClassKey)
DBusConnection const char DBusError * error
static constexpr int kUpdateFromColdStart
static constexpr int kRegularUpdatesTimerInterval
static constexpr auto kUseAltitudeConverter
GLbitfield GLuint64 timeout
[4]