My battery is not charging on Ubuntu 18.04 while in use

I have an old HP laptop which I switched it from Windows 10 to Ubuntu 18.04. I started to notice that while the laptop is on, the battery won’t charge but it is indeed detected. For example, whatever the charge percentage of the battery it will never go up (nor down) while the charger is plugged. I ran the following command to see the status of the battery

johan@johanpc:~$   acpi -V 

and this was the result:

Battery 0: Unknown, 0% Battery 0: design capacity 2673 mAh, last full capacity 2673 mAh = 100% Adapter 0: on-line Thermal 0: ok, 0.0 degrees C Thermal 0: trip point 0 switches to mode critical at temperature 127.0 degrees C Thermal 1: ok, 32.0 degrees C Thermal 1: trip point 0 switches to mode critical at temperature 110.0 degrees C Thermal 1: trip point 1 switches to mode hot at temperature 89.0 degrees C Thermal 1: trip point 2 switches to mode passive at temperature 88.0 degrees C Cooling 0: soc_dts0 no state information available Cooling 1: INT3400 Thermal no state information available Cooling 2: Processor 0 of 10 Cooling 3: intel_powerclamp no state information available Cooling 4: B0DB no state information available Cooling 5: soc_dts1 no state information available Cooling 6: Processor 0 of 10 Cooling 7: STR1 no state information available 

I have read many tutorials but it seems to be that there is no fix for this error / glitch.

However, the laptop does charge while is off, only. On Windows it charged normally so I know it’s not a hardware issue.

Thank you for your help.