dya2 / android-scripting

Automatically exported from code.google.com/p/android-scripting
0 stars 0 forks source link

beanshell getBatteryLevel returns -1 when battery level is 100% #402

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. when battery level is 100% getBatteryLevel returns -1.

What is the expected output? What do you see instead?
Expected output: 100.

What version of the product are you using? On what operating system?
HTC Legend, Android 2.1, Beanshell 2.0b4, beanshell_for_android_r0-1.apk

Please provide any additional information below.

Original issue reported on code.google.com by andrea.i...@gmail.com on 18 Aug 2010 at 7:08

GoogleCodeExporter commented 9 years ago
Update. I have 2 scripts. In the first one (droid_batteryGetLevel.bsh) 
batteryGetLevel works always as expected. In the second script 
(droid_speakBatteryLevel.bsh) batteryGetLevel returns always -1.

...and sorry, in the Issue I wrote "getBatteryLevel" instead of 
batteryGetLevel...

Original comment by andrea.i...@gmail.com on 19 Aug 2010 at 12:01

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by Alexey.R...@gmail.com on 19 Aug 2010 at 12:21

GoogleCodeExporter commented 9 years ago
We've changed the API to reflect the asynchronous aspect of these calls. You'll 
now need to start by calling batteryStartMonitoring(). You can wait for the 
first battery update by calling waitForEvent("battery");

Original comment by damonkoh...@gmail.com on 22 Aug 2010 at 10:55