batteryManager

getIntProperty

BatteryManager

BATTERY_PROPERTY_CAPACITY

else

val

intent

ContextWrapper

applicationContext

).

registerReceiver

null

IntentFilter

Intent

ACTION_BATTERY_CHANGED

))

batteryLevel

intent

!!

getIntExtra

BatteryManager

EXTRA_LEVEL

100

intent

getIntExtra

BatteryManager

EXTRA_SCALE

return

batteryLevel