It's not possible to check the DCIN power status through software. Anyhow, in the Arduino Expansion Board and the Mini-Breakout Board, the DCIN pin is tied to VSYS. So, regardless of the method you use to power the Edison module, the VSYS should be powered and consequently the DCIN too.
You have to use a battery-charging chip anyway.
Some of them have an output signal indicating that USB power is connected to the power input pin.
Here is the POK signal on Maxim chips.
Power-OK Monitor. POK is an open- drain output that pulls low when a valid charging source is detected at IN.
Otherwise, there was a program that could get the current charge level and voltage of the connected battery. When the level is below 100%, it is powered by the battery.