1

I am using the BATTERY_PLUGGED_AC to get notification whether the phone is plugged in to charger or not.

Its all working nice in some devices, while on others it won't recognize as charging.

can this be due to the fact that the power source is USB when I am charging VIA computer USB port and not a Real AC???

should I also consider BATTERY_PLUGGED_USB???

Thank you!

Himberjack
  • 5,682
  • 18
  • 71
  • 115

1 Answers1

2

The mA output of the AC adapter and the USB power are different, and apparently Android can tell the difference.

See this Stackoverflow post on how to detect which is which. But yes, it looks like using BATTERY_PLUGGED_USB will work.

Community
  • 1
  • 1
tpow
  • 7,600
  • 11
  • 59
  • 84