[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-binder.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-providers-hybris-binder.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -7,7 +7,7 @@
<service name="tar_git">
<param name="url">https://github.com/mer-hybris/geoclue-providers-hybris.git</param>
<param name="branch">master</param>
- <param name="revision">6eabf977771b22726215f0cb0f2174961a046917</param>
+ <param name="revision">71ef247955044bb54feaded1fc836c29563845b4</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-binder-0.2.26.tar.gz/binder/binderlocationbackend.cpp
^
|
@@ -1156,6 +1156,33 @@
return ret;
}
+int BinderLocationBackend::aGnssSetServer(HybrisAGnssType type, const char* hostname, int port)
+{
+ int status = 0;
+ bool ret = false;
+ GBinderLocalRequest *req;
+ GBinderRemoteReply *reply;
+ GBinderWriter writer;
+
+ req = gbinder_client_new_request(m_clientAGnss);
+
+ gbinder_local_request_init_writer(req, &writer);
+ gbinder_writer_append_int32(&writer, type);
+ gbinder_writer_append_hidl_string(&writer, hostname);
+ gbinder_writer_append_int32(&writer, port);
+ reply = gbinder_client_transact_sync_reply(m_clientAGnss,
+ AGNSS_SET_SERVER, req, &status);
+
+ if (!status) {
+ ret = isReplySuccess(reply);
+ }
+
+ gbinder_local_request_unref(req);
+ gbinder_remote_reply_unref(reply);
+
+ return ret;
+}
+
// AGnssRil
void BinderLocationBackend::aGnssRilInit()
{
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-binder-0.2.26.tar.gz/binder/binderlocationbackend.h
^
|
@@ -66,6 +66,7 @@
bool aGnssDataConnClosed();
bool aGnssDataConnFailed();
bool aGnssDataConnOpen(const QByteArray &apn, const QString &protocol);
+ int aGnssSetServer(HybrisAGnssType type, const char* hostname, int port);
// AGnssRil
void aGnssRilInit();
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-binder-0.2.26.tar.gz/hal/hallocationbackend.cpp
^
|
@@ -616,6 +616,11 @@
return !error;
}
+int HalLocationBackend::aGnssSetServer(HybrisAGnssType type, const char* hostname, int port)
+{
+ return m_agps->set_server(type, hostname, port);
+}
+
// AGnssRil
void HalLocationBackend::aGnssRilInit()
{
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-binder-0.2.26.tar.gz/hal/hallocationbackend.h
^
|
@@ -64,6 +64,7 @@
bool aGnssDataConnClosed();
bool aGnssDataConnFailed();
bool aGnssDataConnOpen(const QByteArray &apn, const QString &protocol);
+ int aGnssSetServer(HybrisAGnssType type, const char* hostname, int port);
// AGnssRil
void aGnssRilInit();
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-binder-0.2.26.tar.gz/hybrislocationbackend.h
^
|
@@ -136,6 +136,7 @@
virtual bool aGnssDataConnClosed() = 0;
virtual bool aGnssDataConnFailed() = 0;
virtual bool aGnssDataConnOpen(const QByteArray &apn, const QString &protocol) = 0;
+ virtual int aGnssSetServer(HybrisAGnssType type, const char* hostname, int port) = 0;
// AGnssRil
virtual void aGnssRilInit() = 0;
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-binder-0.2.26.tar.gz/hybrisprovider.cpp
^
|
@@ -148,7 +148,8 @@
m_networkManager(new NetworkManager(this)), m_cellularTechnology(Q_NULLPTR),
m_ofonoExtModemManager(new QOfonoExtModemManager(this)),
m_connectionManager(new QOfonoConnectionManager(this)), m_connectionContext(Q_NULLPTR), m_ntpSocket(Q_NULLPTR),
- m_agpsEnabled(false), m_agpsOnlineEnabled(false), m_useForcedXtraInject(false)
+ m_agpsEnabled(false), m_agpsOnlineEnabled(false), m_useForcedNtpInject(false), m_useForcedXtraInject(false),
+ m_suplPort(0)
{
if (staticProvider)
qFatal("Only a single instance of HybrisProvider is supported.");
@@ -219,24 +220,13 @@
}
}
- if (m_xtraServers.isEmpty()) {
- QFile gpsConf(QStringLiteral("/system/etc/gps.conf"));
- if (gpsConf.open(QIODevice::ReadOnly)) {
+ m_useForcedNtpInject = settings.value("ntp/NTP_FORCE_INJECT", "").toBool();
- while (!gpsConf.atEnd()) {
- const QByteArray line = gpsConf.readLine().trimmed();
- if (line.startsWith('#'))
- continue;
-
- const QList<QByteArray> split = line.split('=');
- if (split.length() != 2)
- continue;
-
- const QByteArray key = split.at(0).trimmed();
- if (key == "XTRA_SERVER_1" || key == "XTRA_SERVER_2" || key == "XTRA_SERVER_3")
- m_xtraServers.enqueue(QUrl::fromEncoded(split.at(1).trimmed()));
- }
- }
+ m_suplHost = settings.value("supl/SUPL_HOST", QString()).toString();
+ m_suplPort = settings.value("supl/SUPL_PORT", "").toInt();
+
+ if (m_xtraServers.isEmpty() || m_suplHost.isEmpty() || m_suplPort == 0) {
+ loadDefaultsFromConfigurationFile();
}
m_backend = getLocationBackend();
@@ -251,6 +241,10 @@
m_backend->aGnssRilInit();
m_backend->gnssXtraInit();
m_backend->gnssDebugInit();
+
+ // Set SUPL server if provided
+ if (!m_suplHost.isEmpty() && m_suplPort != 0)
+ m_backend->aGnssSetServer(HYBRIS_AGNSS_TYPE_SUPL, m_suplHost.toLatin1().constData(), m_suplPort);
}
HybrisProvider::~HybrisProvider()
@@ -264,6 +258,48 @@
staticProvider = 0;
}
+void HybrisProvider::loadDefaultsFromConfigurationFile()
+{
+ QFile gpsConf;
+ bool parseXtraServers = false;
+ const char *paths[] = {"/vendor/etc/gps.conf", "/system/etc/gps.conf", NULL};
+ int i = 0;
+ while (paths[i] != NULL) {
+ gpsConf.setFileName(paths[i]);
+ if (gpsConf.open(QIODevice::ReadOnly)) {
+ break;
+ }
+ }
+ if (!gpsConf.isOpen()) {
+ return;
+ }
+ if (m_xtraServers.isEmpty()) {
+ parseXtraServers = true;
+ }
+
+ while (!gpsConf.atEnd()) {
+ const QByteArray line = gpsConf.readLine().trimmed();
+ if (line.startsWith('#'))
+ continue;
+
+ const QList<QByteArray> split = line.split('=');
+ if (split.length() != 2)
+ continue;
+
+ const QByteArray key = split.at(0).trimmed();
+ if (parseXtraServers) {
+ if (key == "XTRA_SERVER_1" || key == "XTRA_SERVER_2" || key == "XTRA_SERVER_3")
+ m_xtraServers.enqueue(QUrl::fromEncoded(split.at(1).trimmed()));
+ }
+ if (m_suplHost.isEmpty() && key == "SUPL_HOST") {
+ m_suplHost = split.at(1).trimmed();
+ }
+ if (m_suplPort == 0 && key == "SUPL_PORT") {
+ m_suplPort = split.at(1).trimmed().toInt();
+ }
+ }
+}
+
void HybrisProvider::setLocationSettings(LocationSettings *settings)
{
if (!m_locationSettings) {
@@ -859,10 +895,13 @@
void HybrisProvider::stateChanged(const QString &state)
{
- if (state == "online") {
- if (m_gpsStarted && m_useForcedXtraInject) {
+ if (state == "online" && m_gpsStarted) {
+ if (m_useForcedXtraInject) {
gnssXtraDownloadRequest();
}
+ if (m_useForcedNtpInject) {
+ injectUtcTime();
+ }
}
}
@@ -993,8 +1032,13 @@
m_gpsStarted = true;
- if (m_useForcedXtraInject && m_networkManager->state() == "online") {
- gnssXtraDownloadRequest();
+ if (m_networkManager->state() == "online") {
+ if (m_useForcedXtraInject) {
+ gnssXtraDownloadRequest();
+ }
+ if (m_useForcedNtpInject) {
+ injectUtcTime();
+ }
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-binder-0.2.26.tar.gz/hybrisprovider.h
^
|
@@ -156,6 +156,8 @@
void cellularConnected(bool connected);
private:
+ void loadDefaultsFromConfigurationFile();
+
void emitLocationChanged();
void emitSatelliteChanged();
void startPositioningIfNeeded();
@@ -236,9 +238,13 @@
bool m_agpsEnabled;
bool m_agpsOnlineEnabled;
+ bool m_useForcedNtpInject;
bool m_useForcedXtraInject;
QString m_xtraUserAgent;
double m_magneticVariation;
+
+ QString m_suplHost;
+ int m_suplPort;
};
extern HybrisProvider *staticProvider;
|