Add dummy charger control for SDK

This commit is contained in:
Matti Viljanen 2020-03-21 12:32:50 +02:00
parent 9148540c96
commit bfd9c62dcf
No known key found for this signature in database
GPG key ID: CF32A1495158F888
2 changed files with 6 additions and 1 deletions

View file

@ -37,7 +37,11 @@ Battery::Battery(Settings* newSettings, QObject* parent) : QObject(parent)
// ENABLE/DISABLE CHARGING
if(QHostInfo::localHostName().contains("SailfishEmul")) {
qInfo() << "Sailfish SDK detected";
qInfo() << "Charger control feature disabled";
qInfo() << "Using dummy control file";
filename = QStandardPaths::writableLocation(QStandardPaths::TempLocation)+"/charging_enabled_dummy";
chargingEnabledFile = new QFile(filename, this);
enableChargingValue = 1;
disableChargingValue = 0;
}
else {
// e.g. for Sony Xperia XA2

View file

@ -21,6 +21,7 @@
#include <QObject>
#include <QString>
#include <QFile>
#include <QStandardPaths>
#include <QHostInfo>
#include <QDebug>
#include "settings.h"