Quote:
Originally Posted by msdevaf
So, how i can i test in this case . i have checked against all BSTAT_xxx masks related to charging mode.
|
Try something along the lines of:
PHP Code:
if ((status & DeviceInfo.BSTAT_IS_USING_EXTERNAL_POWER) == DeviceInfo.BSTAT_IS_USING_EXTERNAL_POWER) {
...
}
or:
PHP Code:
if ((status & (DeviceInfo.BSTAT_IS_USING_EXTERNAL_POWER | DeviceInfo.BSTAT_CHARGING | Devi ceInfo.BSTAT_AC_CONTACTS)) != 0) {
...
}
Simple
boolean algebra.