Unless a device is supplied with an adaptor incapable of powering it and charging at the same time, it is extremely unlikely that the battery will be used while the adaptor is providing power. Further, modern devices typically employ a combination charge controller chip and circuitry which independently controls battery charging and in some cases offers soft power control activated by a momentary contact pushbutton rather than a traditional on-off switch. The charge controller typically controls the connection between the external power jack and the battery for charging as well as the connections between both the battery and power jack and the device being controlled.
Back in ye olden days(say back when microcontrollers were mask programmed and you probably only had one in your family microwave or Beta VCR, maybe one in your car, and modems were king, cellphones lunch pail sized, e-ink not yet a gleam in a designer's eye and I in my youthful exuberance played "pin the tail on the dinosaur..." or at least Caves of Karkhan on an Apple ][+) a relatively cheap diode was inserted between the battery and the circuit, and the external power was connected after the diode before a traditional on-off switch which then connected to the circuit load. The polarity of the diode prevented the backflow of current to the battery so charging did not occur, and as long as the voltage of the power coming in exceeded the voltage of the battery minus the voltage drop of the diode no battery power was consumed. Nice cheap trick, but it did not allow for charging rechargeable batteries, however it was a handy way to build a device that could be powered by "dry cells" or primary non-rechargeables without switching or requiring users to remember to remove the batteries lest they be overcharged and do messy, icky, leaky things...
|