Blackberry: Prevent spurious calls to dataAvailable() when stopped
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>
Mon, 4 Mar 2013 09:28:45 +0000 (10:28 +0100)
committerThomas McGuire <thomas.mcguire@kdab.com>
Mon, 11 Mar 2013 08:44:51 +0000 (09:44 +0100)
commit59a72f830b56a490e61e10336a69f7fc30505d3d
tree0b4c169397ba5f7c4950020d67dbb96d15dd148f
parent4d18883db196e771057e67b7deed4c2a09511a62
Blackberry: Prevent spurious calls to dataAvailable() when stopped

Explicitly disable the socket notifier and drain the device file
to avoid dataAvailable() being called spuriously.

This fixes high CPU usage that occurred in some circumstances after
stopping the sensor.

Many thanks to Dmytro Mishchenko for reporting and helping to
track down the problem.

This is a backport of
QtSensors commit 3a9e30eb6229a6212150dbc1a3627246d51c8be2

Change-Id: I013fe5cff0c83cf39d21d2b84605a2007abb9bf5
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
plugins/sensors/blackberry/bbsensorbackend.cpp