health: Don't turn on charging control if not plugged in
Also cancel a possibly existing charging control notification. Previously charging control was turned on when settings were changed and on system start even if no charger was plugged in, thus possibly showing the charging control notification. Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/8610 Change-Id: I78c47f026aa47ac756cc6eca12157ea58bda58fd
This commit is contained in:
@@ -412,8 +412,9 @@ public class ChargingControlController extends LineageHealthFeature {
|
||||
}
|
||||
|
||||
protected void updateChargeControl() {
|
||||
if (!isEnabled() || mIsControlCancelledOnce) {
|
||||
if (!isEnabled() || mIsControlCancelledOnce || !mIsPowerConnected) {
|
||||
mCurrentProvider.disable();
|
||||
mChargingNotification.cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user