From 044486f8b41b9ae7bdfad838be79ec5b2782fed5 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Tue, 8 Jul 2014 07:43:27 +1000 Subject: [sensorfw] need to run init after sensord has been restarted This ensures things are setup and work properly. Change-Id: I23c8b53e760d49695c5ae207eed77a2e7d2be3a4 Reviewed-by: Alex Blasche --- src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp') diff --git a/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp b/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp index 4207735b..6855158e 100644 --- a/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp +++ b/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp @@ -83,3 +83,10 @@ void SensorfwIrProximitySensor::init() m_initDone = false; initSensor(m_initDone); } + +void SensorfwIrProximitySensor::start() +{ + if (reinitIsNeeded) + init(); + SensorfwSensorBase::start(); +} -- cgit v1.2.3 From 9f377d1fa286817a17a5e5de3786a2d73aeaa822 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Mon, 7 Jul 2014 16:58:22 +1000 Subject: Series of crash fixes from Mer, squashed 1)tracing plugin loading 2)m_remoteSensorManager can be nullptr But it seems it does not solve incorrect initialization in the case manager interface is nullptr: init() for different sensors does not check initDone 3)split initSensor() to template function and function most of initSensor() does not depend on template param, so it is better to split it -> less code should be generated 4)do not use sensor manager if it is invalid 5)correct class members initialization order 6)assert sensor interface is not null From what I saw according to logic it should not happen so using Q_ASSERT for better maintainability 7)check local interface pointer in SensorfwTapSensor::start() Signed-off-by: Denis Zalevskiy Change-Id: I5c1bf3999ad2268c0dba9b3fe511d999c2e63fd9 Reviewed-by: Alex Blasche --- src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp') diff --git a/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp b/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp index 6855158e..145276e3 100644 --- a/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp +++ b/src/plugins/sensors/sensorfw/sensorfwirproximitysensor.cpp @@ -67,6 +67,7 @@ void SensorfwIrProximitySensor::slotDataAvailable(const Proximity& proximity) bool SensorfwIrProximitySensor::doConnect() { + Q_ASSERT(m_sensorInterface); return QObject::connect(m_sensorInterface, SIGNAL(reflectanceDataAvailable(Proximity)), this, SLOT(slotDataAvailable(Proximity))); } -- cgit v1.2.3