Chosen Solution

I have a Samsung S7 that turns off after 1-5 mins of being on, then displays that the battery is empty. After a few seconds it will display that the battery does have charge. This happens even if the charger is plugged in. Is this a problem with the battery or power IC?

IT could be a faulty battery but it also may be a faulty charging port