10Q_DECLARE_METATYPE(QList<QGeoSatelliteInfo>)
12#define UPDATE_FROM_COLD_START 2
*60
*1000
17 qRegisterMetaType< QGeoSatelliteInfo >();
18 qRegisterMetaType< QList<QGeoSatelliteInfo> >();
19 androidClassKeyForUpdate = AndroidPositioning::registerPositionInfoSource(
this);
20 androidClassKeyForSingleRequest = AndroidPositioning::registerPositionInfoSource(
this);
22 requestTimer.setSingleShot(
true);
23 QObject::connect(&requestTimer, SIGNAL(timeout()),
24 this, SLOT(requestTimeout()));
31 if (requestTimer.isActive()) {
43 int previousInterval = updateInterval();
46 if (msec == previousInterval)
49 QGeoSatelliteInfoSource::setUpdateInterval(msec);
52 reconfigureRunningSystem();
70 updatesRunning =
true;
72 m_error = QGeoSatelliteInfoSource::NoError;
74 QGeoSatelliteInfoSource::Error error = AndroidPositioning::startSatelliteUpdates(
75 androidClassKeyForUpdate,
false, updateInterval());
76 if (error != QGeoSatelliteInfoSource::NoError) {
77 updatesRunning =
false;
87 updatesRunning =
false;
93 if (requestTimer.isActive())
96 m_error = QGeoSatelliteInfoSource::NoError;
99 setError(QGeoSatelliteInfoSource::UpdateTimeoutError);
106 requestTimer.start(timeout);
111 if (updatesRunning && updateInterval() <= timeout)
114 QGeoSatelliteInfoSource::Error error = AndroidPositioning::startSatelliteUpdates(
115 androidClassKeyForSingleRequest,
true, timeout);
116 if (error != QGeoSatelliteInfoSource::NoError) {
124 const QList<QGeoSatelliteInfo> &satsInUse,
127 if (!isSingleUpdate) {
129 if (requestTimer.isActive())
131 emit QGeoSatelliteInfoSource::satellitesInViewUpdated(satsInView);
132 emit QGeoSatelliteInfoSource::satellitesInUseUpdated(satsInUse);
136 m_satsInView = satsInView;
137 m_satsInUse = satsInUse;
139 if (!m_satsInView.isEmpty() || !m_satsInUse.isEmpty()) {
149 if (m_satsInView.isEmpty() && m_satsInUse.isEmpty()) {
150 setError(QGeoSatelliteInfoSource::UpdateTimeoutError);
154 emit QGeoSatelliteInfoSource::satellitesInViewUpdated(m_satsInView);
155 emit QGeoSatelliteInfoSource::satellitesInUseUpdated(m_satsInUse);
158 m_satsInView.clear();
162
163
164
177 if (m_error != QGeoSatelliteInfoSource::NoError)
178 emit QGeoSatelliteInfoSource::errorOccurred(m_error);
183 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