[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris.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">50a238aa0c73c50b6e8b4a30eaadc32d187475d3</param>
<param name="token"></param>
<param name="debian"></param>
<param name="dumb"></param>
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-0.2.21.tar.gz/binder/binderlocationbackend.cpp
^
|
@@ -133,6 +133,9 @@
* Implementation
*==========================================================================*/
+namespace
+{
+
HybrisApnIpType fromContextProtocol(const QString &protocol)
{
if (protocol == QLatin1String("ip"))
@@ -221,6 +224,8 @@
parseRmc(nmea);
}
+const double MpsToKnots = 1.943844;
+
static GBinderLocalReply *geoclue_binder_gnss_callback(
GBinderLocalObject *obj,
GBinderRemoteRequest *req,
@@ -256,7 +261,7 @@
loc.setAltitude(location->altitudeMeters);
if (location->gnssLocationFlags & HYBRIS_GNSS_LOCATION_HAS_SPEED)
- loc.setSpeed(location->speedMetersPerSec);
+ loc.setSpeed(location->speedMetersPerSec * MpsToKnots);
if (location->gnssLocationFlags & HYBRIS_GNSS_LOCATION_HAS_BEARING)
loc.setDirection(location->bearingDegrees);
@@ -300,7 +305,7 @@
for (int i = 0; i < svStatus->numSvs; ++i) {
SatelliteInfo satInfo;
- GnssSvInfo svInfo = svStatus->gnssSvList.data[i];
+ GnssSvInfo svInfo = svStatus->gnssSvList[i];
satInfo.setSnr(svInfo.cN0Dbhz);
satInfo.setElevation(svInfo.elevationDegrees);
satInfo.setAzimuth(svInfo.azimuthDegrees);
@@ -320,7 +325,7 @@
satellites.append(satInfo);
if (svInfo.svFlag & HYBRIS_GNSS_SV_FLAGS_USED_IN_FIX)
- usedPrns.append(svInfo.svid);
+ usedPrns.append(prn);
}
QMetaObject::invokeMethod(staticProvider, "setSatellite", Qt::QueuedConnection,
@@ -449,7 +454,7 @@
const AGnssStatusIpV6 *status = geoclue_binder_gnss_decode_struct
(AGnssStatusIpV6, &reader);
- ipv6.setAddress(status->ipV6Addr.data);
+ ipv6.setAddress(status->ipV6Addr);
QMetaObject::invokeMethod(staticProvider, "agpsStatus", Qt::QueuedConnection,
Q_ARG(qint16, status->type), Q_ARG(quint16, status->status),
@@ -549,6 +554,7 @@
self->dropGnss();
}
+}
/*==========================================================================*
* Backend class
@@ -576,12 +582,20 @@
gbinder_local_object_drop(m_callbackGnss);
m_callbackGnss = Q_NULLPTR;
}
+ if (m_clientGnss) {
+ gbinder_client_unref(m_clientGnss);
+ m_clientGnss = Q_NULLPTR;
+ }
if (m_remoteGnss) {
gbinder_remote_object_remove_handler(m_remoteGnss, m_death_id);
gbinder_remote_object_unref(m_remoteGnss);
m_death_id = 0;
m_remoteGnss = Q_NULLPTR;
}
+ if (m_clientGnssDebug) {
+ gbinder_client_unref(m_clientGnssDebug);
+ m_clientGnssDebug = Q_NULLPTR;
+ }
if (m_remoteGnssDebug) {
gbinder_remote_object_unref(m_remoteGnssDebug);
m_remoteGnssDebug = Q_NULLPTR;
@@ -590,6 +604,10 @@
gbinder_local_object_drop(m_callbackGnssNi);
m_callbackGnssNi = Q_NULLPTR;
}
+ if (m_clientGnssNi) {
+ gbinder_client_unref(m_clientGnssNi);
+ m_clientGnssNi = Q_NULLPTR;
+ }
if (m_remoteGnssNi) {
gbinder_remote_object_unref(m_remoteGnssNi);
m_remoteGnssNi = Q_NULLPTR;
@@ -598,6 +616,10 @@
gbinder_local_object_drop(m_callbackGnssXtra);
m_callbackGnssXtra = Q_NULLPTR;
}
+ if (m_clientGnssXtra) {
+ gbinder_client_unref(m_clientGnssXtra);
+ m_clientGnssXtra = Q_NULLPTR;
+ }
if (m_remoteGnssXtra) {
gbinder_remote_object_unref(m_remoteGnssXtra);
m_remoteGnssXtra = Q_NULLPTR;
@@ -606,6 +628,10 @@
gbinder_local_object_drop(m_callbackAGnss);
m_callbackAGnss = Q_NULLPTR;
}
+ if (m_clientAGnss) {
+ gbinder_client_unref(m_clientAGnss);
+ m_clientAGnss = Q_NULLPTR;
+ }
if (m_remoteAGnss) {
gbinder_remote_object_unref(m_remoteAGnss);
m_remoteAGnss = Q_NULLPTR;
@@ -614,10 +640,22 @@
gbinder_local_object_drop(m_callbackAGnssRil);
m_callbackAGnssRil = Q_NULLPTR;
}
+ if (m_clientAGnssRil) {
+ gbinder_client_unref(m_clientAGnssRil);
+ m_clientAGnssRil = Q_NULLPTR;
+ }
if (m_remoteAGnssRil) {
gbinder_remote_object_unref(m_remoteAGnssRil);
m_remoteAGnssRil = Q_NULLPTR;
}
+ if (m_sm) {
+ gbinder_servicemanager_unref(m_sm);
+ m_sm = Q_NULLPTR;
+ }
+ if (m_fqname) {
+ g_free(m_fqname);
+ m_fqname = Q_NULLPTR;
+ }
}
bool BinderLocationBackend::isReplySuccess(GBinderRemoteReply *reply)
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-0.2.21.tar.gz/binder/gnss-binder-types.h
^
|
@@ -18,29 +18,6 @@
#define ALIGNED(x) __attribute__ ((aligned(x)))
-typedef struct hidl_string {
- union {
- guint64 value;
- const char *str;
- } data;
- guint32 len;
- guint8 owns_buffer;
-} ALIGNED(4) HidlString;
-
-typedef struct hidl_vector {
- union {
- guint64 value;
- const void *ptr;
- } data;
- guint32 count;
- guint8 owns_buffer;
-} ALIGNED(4) HidlVector;
-
-template<typename T, size_t SIZE1>
-struct HidlArray {
- T data[SIZE1];
-};
-
typedef struct geoclue_binder_gnss GeoclueBinderGnss;
typedef enum gnss_max {
@@ -108,7 +85,7 @@
typedef struct gnss_sv_status {
gint32 numSvs ALIGNED(4);
- HidlArray<GnssSvInfo, 64> gnssSvList ALIGNED(4);
+ GnssSvInfo gnssSvList[64] ALIGNED(4);
} ALIGNED(4) GnssSvStatus;
G_STATIC_ASSERT(sizeof(GnssSvStatus) == 1540);
@@ -136,17 +113,17 @@
};
typedef struct agnss_status_ip_v4 {
- AGnssType type ALIGNED(1);
- AGnssStatusValue status ALIGNED(1);
- gint32 ipV4Addr ALIGNED(4);
+ AGnssType type ALIGNED(1);
+ AGnssStatusValue status ALIGNED(1);
+ gint32 ipV4Addr ALIGNED(4);
} ALIGNED(4) AGnssStatusIpV4;
G_STATIC_ASSERT(sizeof(AGnssStatusIpV4) == 8);
typedef struct agnss_status_ip_v6 {
- AGnssType type ALIGNED(1);
- AGnssStatusValue status ALIGNED(1);
- HidlArray<uint8_t, 16> ipV6Addr ALIGNED(1);
+ AGnssType type ALIGNED(1);
+ AGnssStatusValue status ALIGNED(1);
+ uint8_t ipV6Addr[16] ALIGNED(1);
} ALIGNED(1) AGnssStatusIpV6;
G_STATIC_ASSERT(sizeof(AGnssStatusIpV6) == 18);
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-0.2.21.tar.gz/hal/hallocationbackend.cpp
^
|
@@ -40,7 +40,7 @@
namespace
{
-const double KnotsToMps = 0.514444;
+const double MpsToKnots = 1.943844;
void locationCallback(GpsLocation *location)
{
@@ -57,7 +57,7 @@
loc.setAltitude(location->altitude);
if (location->flags & GPS_LOCATION_HAS_SPEED)
- loc.setSpeed(location->speed / KnotsToMps);
+ loc.setSpeed(location->speed * MpsToKnots);
if (location->flags & GPS_LOCATION_HAS_BEARING)
loc.setDirection(location->bearing);
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-provider-hybris-0.2.21.tar.gz/hybrisprovider.cpp
^
|
@@ -61,6 +61,7 @@
const QString LocationSettingsDir = QStringLiteral("/etc/location/");
const QString LocationSettingsFile = QStringLiteral("/etc/location/location.conf");
const QString LocationSettingsEnabledKey = QStringLiteral("location/enabled");
+const QString LocationSettingsAllowedDataSourcesGpsKey = QStringLiteral("allowed_data_sources/gps");
const QString LocationSettingsGpsEnabledKey = QStringLiteral("location/gps/enabled");
const QString LocationSettingsAgpsEnabledKey = QStringLiteral("location/%1/enabled");
const QString LocationSettingsAgpsOnlineEnabledKey = QStringLiteral("location/%1/online_enabled");
@@ -285,6 +286,8 @@
m_locationSettings = settings;
connect(m_locationSettings, &LocationSettings::locationEnabledChanged,
this, &HybrisProvider::locationEnabledChanged);
+ connect(m_locationSettings, &LocationSettings::allowedDataSourcesChanged,
+ this, &HybrisProvider::locationEnabledChanged);
connect(m_locationSettings, &LocationSettings::gpsEnabledChanged,
this, &HybrisProvider::locationEnabledChanged);
connect(m_locationSettings, &LocationSettings::gpsFlightModeChanged,
@@ -1055,11 +1058,12 @@
m_agpsOnlineEnabled = (m_locationSettings->hereAvailable() && m_locationSettings->hereState() == LocationSettings::OnlineAGpsEnabled)
|| (m_locationSettings->mlsAvailable() && m_locationSettings->mlsOnlineState() == LocationSettings::OnlineAGpsEnabled);
- // enable GPS positioning if location and the GPS are enabled, and the GPS is not in flight mode.
+ // enable GPS positioning if location and the GPS are enabled, and the GPS is not in flight mode - if it is allowed by MDM.
return m_locationSettings->locationEnabled()
&& m_locationSettings->gpsAvailable()
&& m_locationSettings->gpsEnabled()
- && !m_locationSettings->gpsFlightMode();
+ && !m_locationSettings->gpsFlightMode()
+ && (m_locationSettings->allowedDataSources() & LocationSettings::GpsData);
}
quint32 HybrisProvider::minimumRequestedUpdateInterval() const
|
[-]
[+]
|
Changed |
_service:tar_git:geoclue-providers-hybris.inc
^
|
@@ -12,7 +12,7 @@
BuildRequires: pkgconfig(connman-qt5) >= 1.0.68
BuildRequires: pkgconfig(qofono-qt5)
BuildRequires: pkgconfig(qofonoext)
-BuildRequires: pkgconfig(systemsettings)
+BuildRequires: pkgconfig(systemsettings) >= 0.5.5
Requires: connectionagent-qt5 >= 0.9.20
Source100: geoclue-providers-hybris.inc
|