AndroidBatteryInfo getState() doesn't return updated charging battery

So Hi everyone , I have problem. I use Sdk android emulator Pixel API 30 and I try set power AC by command(java):

So my emulator reacted to it by battery icon (I can see how it change from charging to not charging).
But when I try check it by AndroidBatteryInfo.BatteryState getState() it always return value from setting of emulator (three dots at the right menu bar at emulator: Extended controls -> Battery -> Battery status). Even when emulator battery icon displays that it charging if “Battery status” set as NOT_CHARGING or anything else, then getState() return value from “Battery status”.

Maybe there is some other methods with which I can check battery charging. Because my main goal is to test method setPowerAC.