Squash all commits

Update Alert Logic

* by default appium doesn't interact with alerts
* set autoAcceptAlerts to true to have appium accept alerts

actually allow removeApp to work with selendroid (fix #1686 for real)

Fix for installing/removing app on device when a .app path is used.

cleanup app state before a test too (rewrite of #1732)
cc @dandoveralba @bootstraponline

fix autoAcceptAlerts undefined issue (cc @dandoveralba)

Use correct suffix (.zip or .apk) when downloading app from a url.

md5calculator (used in lib/devices/android/android-common.js)
can only handle files that end in .ipa or .apk, not .zip.
Currently urls that end in .apk are downloaded as appium-app.zip

Support Latest SDK

android-4.4 created by default on latest SDK installation

Refactored tests to use wd promise-chain api

support selendroid 4.4/19 better

fix selendroid app launch issues
require a dot for a relative activity, otherwise we consider it a full one

Fix issue #1713: Change killProc signal from SIGKILL to SIGTERM.

kill chromedriver before starting new chromedriver

add bitdeli tracking

switch values at assertEquals statements, to reflect the correct meaning

Implementing mobile:background command for Android and Selendroid

Replay commit 1c6b495cd2f3fbbb8622a9fb43f3e50aa79ab82e

Remove debug log

Tidy up spaces according to pull request review

Fixed indentation according to Appium project style guide (2 spaces indent)

Fixed error management in background method

Add an argument to ADB.startApp in order to choose whether to stop the app prior to starting it

Refactored mobile:background method for Android: using ADB.startApp rather than directly issuing am start command to ADB shell, do not return to callback until app is back to foreground

Mimick the launcher start intent for the app when starting it

The Android launcher uses the following settings to start apps:
- MAIN action
- LAUNCHER category
- FLAG_ACTIVITY_NEW_TASK
- FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
Without those settings there were discrepancies between Selendroid and
Android when trying to bring the app back to foreground: it would not
bring back the existing Activity stack but create new activities

Add retry argument to startApp

Missing space

Removed remaining conflict markup

Merge branch 'master' of https://github.com/appium/appium into background-android2

Fix lint error (replace tab with spaces)

Fix android multiple devices: android/android-common.js

native instruments configurable as capabilities

Support full-reset for selendroid

Replay commit ad9c73a3c45cfa8352dac2e5b7943a19b615b14b

Mimick the launcher start intent for the app when starting it

The Android launcher uses the following settings to start apps:
- MAIN action
- LAUNCHER category
- FLAG_ACTIVITY_NEW_TASK
- FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
Without those settings there were discrepancies between Selendroid and
Android when trying to bring the app back to foreground: it would not
bring back the existing Activity stack but create new activities

Add retry argument to startApp

Missing space

Removed remaining conflict markup

Merge branch 'master' of https://github.com/appium/appium into background-android2

Fix lint error (replace tab with spaces)

Return accessibilityHint as element's attribute 'hint'

windows compat fix in android binary finding logic (attempt to fix #1759)