From 0aff894dd280a628b12b9c300a335b54905f06a4 Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Fri, 9 Apr 2021 23:34:06 +0300 Subject: [PATCH] Don't enable charging on exit when running on emulator --- service/src/battery.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/service/src/battery.cpp b/service/src/battery.cpp index 145d3f3..10299b6 100644 --- a/service/src/battery.cpp +++ b/service/src/battery.cpp @@ -254,7 +254,8 @@ void Battery::shutdown() { lowNotifyTimer->stop(); qDebug() << "Low battery notification stopped"; } - if(!setChargingEnabled(true)) { + // ENABLE/DISABLE CHARGING + if(!QHostInfo::localHostName().contains("SailfishEmul") && !setChargingEnabled(true)) { qWarning() << "ERROR! Could not restore charger status! Your device" << endl << "may not start until reboot! If that doesn't help," << endl << "uninstall Battery Buddy and reboot your device.";