9Q_DECLARE_METATYPE(QList<QGeoSatelliteInfo>)
11#define UPDATE_FROM_COLD_START 2
*60
*1000
16 qRegisterMetaType< QGeoSatelliteInfo >();
17 qRegisterMetaType< QList<QGeoSatelliteInfo> >();
18 androidClassKeyForUpdate = AndroidPositioning::registerPositionInfoSource(
this);
19 androidClassKeyForSingleRequest = AndroidPositioning::registerPositionInfoSource(
this);
21 requestTimer.setSingleShot(
true);
22 QObject::connect(&requestTimer, SIGNAL(timeout()),
23 this, SLOT(requestTimeout()));
30 if (requestTimer.isActive()) {
42 int previousInterval = updateInterval();
45 if (msec == previousInterval)
48 QGeoSatelliteInfoSource::setUpdateInterval(msec);
51 reconfigureRunningSystem();
69 updatesRunning =
true;
71 m_error = QGeoSatelliteInfoSource::NoError;
73 QGeoSatelliteInfoSource::Error error = AndroidPositioning::startSatelliteUpdates(
74 androidClassKeyForUpdate,
false, updateInterval());
75 if (error != QGeoSatelliteInfoSource::NoError) {
76 updatesRunning =
false;
86 updatesRunning =
false;
92 if (requestTimer.isActive())
95 m_error = QGeoSatelliteInfoSource::NoError;
98 setError(QGeoSatelliteInfoSource::UpdateTimeoutError);
105 requestTimer.start(timeout);
110 if (updatesRunning && updateInterval() <= timeout)
113 QGeoSatelliteInfoSource::Error error = AndroidPositioning::startSatelliteUpdates(
114 androidClassKeyForSingleRequest,
true, timeout);
115 if (error != QGeoSatelliteInfoSource::NoError) {
123 const QList<QGeoSatelliteInfo> &satsInUse,
126 if (!isSingleUpdate) {
128 if (requestTimer.isActive())
130 emit QGeoSatelliteInfoSource::satellitesInViewUpdated(satsInView);
131 emit QGeoSatelliteInfoSource::satellitesInUseUpdated(satsInUse);
135 m_satsInView = satsInView;
136 m_satsInUse = satsInUse;
138 if (!m_satsInView.isEmpty() || !m_satsInUse.isEmpty()) {
148 if (m_satsInView.isEmpty() && m_satsInUse.isEmpty()) {
149 setError(QGeoSatelliteInfoSource::UpdateTimeoutError);
153 emit QGeoSatelliteInfoSource::satellitesInViewUpdated(m_satsInView);
154 emit QGeoSatelliteInfoSource::satellitesInUseUpdated(m_satsInUse);
157 m_satsInView.clear();
161
162
163
176 if (m_error != QGeoSatelliteInfoSource::NoError)
177 emit QGeoSatelliteInfoSource::errorOccurred(m_error);
182 setError(QGeoSatelliteInfoSource::ClosedError);
void locationProviderDisabled()
void stopUpdates() override
~QGeoSatelliteInfoSourceAndroid()
int minimumUpdateInterval() const override
void processSatelliteUpdate(const QList< QGeoSatelliteInfo > &satsInView, const QList< QGeoSatelliteInfo > &satsInUse, bool isSingleUpdate)
void requestUpdate(int timeout=0) override
void setUpdateInterval(int msec) override
Error error() const override
Returns the last error that occurred.
void stopUpdates(int androidClassKey)
#define UPDATE_FROM_COLD_START