[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-hal.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-providers-hybris.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,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">HEAD</param>
+ <param name="revision">c9996f0b96718c7f1f30405de9c2e52ec9efeaac</param>
<param name="token"></param>
<param name="debian"></param>
<param name="dumb"></param>
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-hal-0.2.29.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-hal-0.2.29.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-hal-0.2.29.tar.gz/geoclue-providers-hybris.pri
^
|
@@ -33,6 +33,12 @@
system_dbus_conf.files = com.jollamobile.gps.conf
system_dbus_conf.path = /etc/dbus-1/system.d
+systemd_dbus_service.files = geoclue-providers-hybris.service
+systemd_dbus_service.path = /usr/lib/systemd/user
+
+systemd_dbus_service_symlink.path = .
+systemd_dbus_service_symlink.commands = ln -s geoclue-providers-hybris.service ${INSTALL_ROOT}/usr/lib/systemd/user/dbus-org.freedesktop.Geoclue.Providers.Hybris.service
+
geoclue_provider.files = geoclue-hybris.provider
geoclue_provider.path = /usr/share/geoclue-providers
@@ -49,7 +55,8 @@
$${session_dbus_service.files} \
$${system_dbus_service.files} \
$${system_dbus_conf.files} \
+ $${systemd_dbus_service.files} \
$${geoclue_provider.files} \
rpm/geoclue-providers-hybris.spec
-INSTALLS += target session_dbus_service system_dbus_conf geoclue_provider
+INSTALLS += target session_dbus_service system_dbus_conf geoclue_provider systemd_dbus_service systemd_dbus_service_symlink
|
[-]
[+]
|
Added |
_service:tar_git:geoclue-provider-hybris-hal-0.2.29.tar.gz/geoclue-providers-hybris.service
^
|
@@ -0,0 +1,16 @@
+[Unit]
+Description=Geoinformation Service Hybris Provider
+
+[Service]
+Type=dbus
+ExecStart=/usr/libexec/geoclue-hybris
+BusName=org.freedesktop.Geoclue.Providers.Hybris
+#Sandboxing
+Capabilities=
+PrivateTmp=yes
+ProtectHome=yes
+ProtectSystem=full
+
+[Install]
+Alias=dbus-org.freedesktop.Geoclue.Providers.Hybris.service
+
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-hal-0.2.29.tar.gz/hal/hallocationbackend.cpp
^
|
@@ -503,7 +503,9 @@
void HalLocationBackend::gnssDeleteAidingData(HybrisGnssAidingData aidingDataFlags)
{
- Q_UNUSED(aidingDataFlags)
+ if (m_gps) {
+ m_gps->delete_aiding_data(aidingDataFlags);
+ }
}
bool HalLocationBackend::gnssSetPositionMode(HybrisGnssPositionMode mode, HybrisGnssPositionRecurrence recurrence,
@@ -614,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-hal-0.2.29.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-hal-0.2.29.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-hal-0.2.29.tar.gz/hybrisprovider.cpp
^
|
@@ -48,6 +48,12 @@
HybrisProvider *staticProvider = Q_NULLPTR;
+// Some older devices have the GPS week number rollover bug
+// which breaks timestamps so workaround it using a constant offset
+// of 1024 weeks if timestamp is too small
+const HybrisGnssUtcTime GnssWeekRolloverTimestamp = 1554595200000;
+const HybrisGnssUtcTime GnssWeekRolloverTimestampOffset = 619315200000;
+
namespace
{
@@ -148,7 +154,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 +226,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 +247,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 +264,49 @@
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;
+ }
+ ++i;
+ }
+ 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) {
@@ -358,6 +401,13 @@
HYBRIS_GNSS_POSITION_RECURRENCE_PERIODIC, updateInterval,
PreferredAccuracy, PreferredInitialFixTime);
}
+
+ if (options.contains(QStringLiteral("NoCachedAidingData"))
+ && options.value(QStringLiteral("NoCachedAidingData")).toBool()
+ && m_backend) {
+ //GPS_DELETE_ALL = 0xFFFF (almanac, ephemeris, position, time and other cache data)
+ m_backend->gnssDeleteAidingData(0xFFFF);
+ }
}
int HybrisProvider::GetPosition(int ×tamp, double &latitude, double &longitude,
@@ -457,6 +507,11 @@
}
m_currentLocation = location;
+
+ if (m_currentLocation.timestamp() != 0 && m_currentLocation.timestamp() < GnssWeekRolloverTimestamp) {
+ m_currentLocation.setTimestamp(m_currentLocation.timestamp() + GnssWeekRolloverTimestampOffset);
+ }
+
emitLocationChanged();
}
@@ -852,10 +907,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();
+ }
}
}
@@ -986,8 +1044,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-hal-0.2.29.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;
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-hal-0.2.29.tar.gz/main.cpp
^
|
@@ -55,8 +55,8 @@
supplementaryGroups[numberGroups++] = group->gr_gid;
- // remove audio, radio and bluetooth groups to avoid confusion in BSP
- char *groups_to_remove[] = {"bluetooth", "radio", "audio", NULL};
+ // remove nfc, audio, radio and bluetooth groups to avoid confusion in BSP
+ char *groups_to_remove[] = {"bluetooth", "radio", "audio", "nfc", NULL};
int idx = 0;
while (groups_to_remove[idx]) {
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-hal-0.2.29.tar.gz/org.freedesktop.Geoclue.Providers.Hybris.service
^
|
@@ -1,3 +1,4 @@
[D-BUS Service]
Name=org.freedesktop.Geoclue.Providers.Hybris
-Exec=/usr/libexec/geoclue-hybris
+Exec=/bin/false
+SystemdService=dbus-org.freedesktop.Geoclue.Providers.Hybris.service
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-providers-hybris.inc
^
|
@@ -1,7 +1,6 @@
Summary: Geoinformation Service Hybris Provider
-Group: System/Libraries
-URL: https://bitbucket.org/jolla/base-geoclue-providers-hybris
-License: LGPLv2.1
+URL: https://github.com/mer-hybris/geoclue-providers-hybris
+License: LGPLv2
Source: %{name}-%{version}.tar.gz
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5DBus)
@@ -10,6 +9,7 @@
BuildRequires: pkgconfig(qofono-qt5)
BuildRequires: pkgconfig(qofonoext)
BuildRequires: pkgconfig(systemsettings) >= 0.5.5
+BuildRequires: systemd
Requires: connectionagent-qt5 >= 0.9.20
Source100: geoclue-providers-hybris.inc
@@ -37,4 +37,5 @@
%{_sysconfdir}/dbus-1
%{_datadir}/dbus-1
%{_datadir}/geoclue-providers/geoclue-hybris.provider
-
+%{_userunitdir}/geoclue-providers-hybris.service
+%{_userunitdir}/dbus-org.freedesktop.Geoclue.Providers.Hybris.service
|