ChargingControl: Don't set deadline if charging control is not enabled

Change-Id: I5e7570184294e8391e4908e449c1bffb07d9410d
This commit is contained in:
Luofan Chen
2023-06-20 19:08:40 +08:00
committed by Michael Bestas
parent 1f36483aa7
commit 3c3140b8e0

View File

@@ -577,15 +577,15 @@ public class ChargingControlController extends LineageHealthFeature {
return;
}
final ChargeTime t = getChargeTime();
if (t != null && t.getTargetTime() == mSavedTargetTime) {
return;
}
long deadline = 0;
if (t == null || mIsControlCancelledOnce) {
final ChargeTime t = getChargeTime();
if (!mConfigEnabled || t == null || mIsControlCancelledOnce) {
deadline = -1;
} else {
if (t.getTargetTime() == mSavedTargetTime) {
return;
}
mSavedTargetTime = t.getTargetTime();
final long targetTime = t.getTargetTime();
final long currentTime = System.currentTimeMillis();