Warn if restoring charger status fails at exit

This commit is contained in:
Matti Viljanen 2020-06-12 14:32:25 +03:00
parent 0cb9551c3a
commit fa5b0cd9e7
No known key found for this signature in database
GPG key ID: CF32A1495158F888
2 changed files with 6 additions and 4 deletions

View file

@ -218,7 +218,9 @@ void Battery::shutdown() {
notifyTimer->stop();
qDebug() << "Notification stopped";
}
setChargingEnabled(true);
chargingEnabledFile->setPermissions(originalPerms);
qDebug() << "Charger control file permissions restored.";
if(!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.";
}
}

View file

@ -46,7 +46,7 @@ public:
QString getState();
bool getChargingEnabled();
void setChargingEnabled(bool);
bool setChargingEnabled(bool);
public slots:
void updateData();