I understand there are two different flags and they represent whether the device is plugged into AC or USB charging. How does the device know that, and what does it report to the operating system?
I would have thought the OS could not distinguish between the phone plugged into the USB port of a laptop and charging at 500 mA, vs. the phone plugged into a wall charger and charging at 500 mA.
Perhaps the difference is the current the device is charging at? (If so, what is the minimum current for 'AC'? Is the device free to define the cutoff?)
Or is the difference that the device can also communicate data over its cable? That seems like a strange way to distinguish the two.
https://developer.android.com/reference/android/os/BatteryManager
Thanks in advance!