dya2 / android-scripting

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

toggling wifi state from beanshell #401

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. (start with wifi off)
2. jsonWifiState = droid.call( "toggleWifiState" ); 
3. bWifiState = jsonWifiState.getBoolean( "result" );
4.(bWifiState is true)
5. jsonWifiState = droid.call( "checkWifiState" );  // I want to be sure...
6. bWifiState = jsonWifiState.getBoolean( "result" );
7.(bWifiState is true, again)
8. (An asynchronous system dialog appears: "Could not connect to wifi: retry or 
cancel?")
9. (press cancel)
10. (wifi connection is still off!)

What is the expected output? What do you see instead?
It is expected that toggleWifiState and checkWifiState return either after the 
connection is established, or after the connection couldn't establish.
I see instead that wifi connection is on before the system completed the 
connection.

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 6:55

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 55b5f0f410.

Original comment by damonkoh...@gmail.com on 11 Nov 2010 at 10:04

GoogleCodeExporter commented 9 years ago
Changing the wifi state is asynchronous. You can busy loop in your script and 
wait for it to be enabled if necessary. Previously, contrary to the 
documentation, the checkWifiState() API would return true even if wifi was not 
fully enabled but only being enabled. This is no longer the case.

Original comment by damonkoh...@gmail.com on 11 Nov 2010 at 10:06