[Android] Add an action to check/record attached devices

When doing a gyp_managed_install, we install APKs to the attached
device. Currently this can fail in many ways (no device attached,
multiple devices attached, device offline, device doesn't have root,
etc.). In addition, we need to detect changes to the attached device
(particularly when the device is switched, when an APK is
 uninstalled/updated).

The current approach is to check all this information in the action
interacting with the device. This means that when there is some
problem we print the same warning messages for every APK that is built,
and, in some cases, multiple times for each APK. Also, we have to run
every install/push action every build because we detect changes to the
attached device in that action.

This change creates a new build action, "get device configurations".
This action inspects the attached devices, filters out offline devices,
filters out devices without root, and then writes a configuration
file with the id+metadata for the first non-filtered device. This
configuration is then used by each of the build steps that interacts
with the device. This consolidates all the device checking to a single
place, and the build actions don't need to do any checking. In
addition, to detect changes in the attached device, we only need to run
this single action every build and the install/push actions will only
change when the device/metadata changes.

Also, with this change we can now gracefully handle the case where
multiple devices are attached (currently just write the configuration
for the first valid device and install to that one).

Review URL: https://chromiumcodereview.appspot.com/16831013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209582 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: 014d1ff14a94667827f6f59341a9394896f51d10
1 file changed
tree: c3d82c605fb205040f63956ca830efd2bd6a7ac7
  1. base/
  2. build/
  3. dbus/
  4. ipc/
  5. testing/
  6. third_party/