Fixed indentation
Fixed ping method

Do not look for exact match in stdout
Reset uiautomatorRestartOnExit flag after we've disabled data connection
Refactor UI Automator exit handler and add a flag to completely ignore UI Automator exit

When we disconnect the network (via either disabling 3G or enabling
Flight Mode), the official Android emulator loses the ADB connection.
However, sometimes the UI Automator exit handler is not called until
the next attempt to send an ADB command. So we introduce a flag to tell
the UI automator exit handler to do nothing, i.e. neither restart UI
Automator nor uninstall the app, we take care of ADB and UI automator
reconnection before sending the next ADB command
Refactor toggleSetting code and handle ADB reconnection

Refactored the toggleSetting code in order to separate the code common
to both Android subplatforms, and code specific to either platforms
(UIAutomator and Selendroid)
Made sure UI Automator restart is handled in the toggleSetting code and
not in the UI Automator exit handler
Selendroid method for handling ADB disconnection in Emulator when turning network connection off
Right keyevent combination to position the focus on Airplane Mode checkbox for API <= 15

On Android 4.1+ (API 16+) there's a "Parent" button in the
AIRPLANE_MODE_SETTINGS Activity's ActionBar, whereas on earlier
versions there's no "Parent" button, so we need to take this into
account when performing the key sequence to position the focus on the
Airplane Mode checkbox
Generic mechanism to let each "toggle" method provide the sequence of key to position the focus

Each "toggle" mobile method may require a different sequence of keys in
order to position the focus within the corresponding Settings Activity.
Now this sequence is dynamically provided by each "toggle" method
mobile: toggleWiFi implementation
Remove blank line
mobile: toggleLocationServices implementation

When toggling LocationServices ON there's a dialog asking for user
confirmation, so we introduce a mechanism that lokks for this dialog
and acknowledge it, but if the dialog doesn't show up we proceed to
exit the settings activity