[AT&T Samsung Galaxy S II SGH-I777] factoreal:
Similar issue and got phone fixed finally

Have had similar issue as yours. Cable charger was plugged into the phone to be charged at night and was surprised to find that the phone became hot and battery was not charged at the next morning, in fact the battery level got lower than it was before charging.

Notes:

- ROM in use: AOCP version 7.2 (Android 4.4.2)

- Kernel in use: Version 3.0.101 zachariah@Linux-Box #3

Here are some tests done and the observations after getting a charger with a slot to place the removed battery for charging:

1. Charging via USB cable connected to PC:

- With the phone turned on, battery charging icon is only displayed after some wiggling at the charging port. The phone got charged further to 100% when the initial remaining battery level is 90%. However, when the initial battery level was less than 50%, the battery level continued dropping ALTHOUGH the battery charging icon was displayed.

- With the phone turned off, battery charging icon is only displayed after some wiggling at the charging port. When the initial battery level was less than 50%, the battery charging icon displayed only a battery level of 1% and the battery level did not increase at all after 15 minutes of charging.

Initially suspected that it was a dead battery issue and bought an i9100 battery, I thought it was a compatible battery at first. With the i9100 battery, I repeated the above tests.

2. Charging via USB cable connected to PC:

- With the phone turned on, battery charging icon is only displayed after some wiggling at the charging port. The phone got charged further to 100% when the initial remaining battery level is 90%. However, when the initial battery level was less than 50%, the battery level continued dropping ALTHOUGH the battery charging icon was displayed.

- With the phone turned off, battery charging icon is NOT displayed but the phone screen flashed continuously, and at times the phone is turned on automatically as the USB charging port is inserted. When the phone is turned on, the charging proceeded as the above sentence.

Upon searching the forum, I found that i777 has a different battery with NFC chip and i9100 battery has reported to cause issues during charging on i777 devices. There was also a Chinese forum which mentioned that the battery compatibility issues should have been overcome in ROM with Android version 4.0 and above.

I then bought a new i777 compatible battery and tested charging via USB cable. The observations are same as the first battery as at 1.

With the battery issues possibility eliminated, I approached a phone technician to examine the phone by telling him that the phone couldn't be charged and the battery level continued dropping even with the battery charging icon displayed. The phone technician then thought that the USB charging port to be the cause of the charging issue and replaced it. The replaced part is the small metal housing where the USB cable is inserted, and is replaced by heating the old metal housing and replacing it with new part by soldering.

The phone could be charged with USB cable as usual after the part replacement and all the batteries are found to be still working fine. Ended up with 2 i777 batteries and a i9100 battery, may be I could continue using this phone for at least another 5 years down the road. ;)