From f9672df5ea9872f911eb0011012f829309e11e71 Mon Sep 17 00:00:00 2001 From: Lincoln Ramsay Date: Tue, 20 Dec 2011 11:05:30 +1000 Subject: Implement an API for alwaysOn. Change-Id: If530fed02979ad9c4608f317b718ee449bb25ddc Sanity-Review: Qt Sanity Bot Reviewed-by: Zsolt Simon --- src/sensors/qsensor.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/sensors/qsensor.cpp') diff --git a/src/sensors/qsensor.cpp b/src/sensors/qsensor.cpp index 3982079..9dc11d1 100644 --- a/src/sensors/qsensor.cpp +++ b/src/sensors/qsensor.cpp @@ -340,6 +340,23 @@ bool QSensor::isActive() const return d->active; } +/*! + \property QSensor::alwaysOn + \brief a value to indicate if the sensor should remain running when the screen is off. + + Some platforms have a policy of suspending sensors when the screen turns off. + Setting this property to true will ensure the sensor continues to run. +*/ +void QSensor::setAlwaysOn(bool alwaysOn) +{ + d->alwaysOn = alwaysOn; +} + +bool QSensor::isAlwaysOn() const +{ + return d->alwaysOn; +} + /*! \property QSensor::availableDataRates \brief the data rates that the sensor supports. -- cgit v1.2.1