| Index: build/android/gyp/util/build_device.py
|
| diff --git a/build/android/gyp/util/build_device.py b/build/android/gyp/util/build_device.py
|
| index e8446a8a71dc4944382837ab5013a581c679d0f8..b847b8201e1d5b7277af3f250bd652d503010b20 100644
|
| --- a/build/android/gyp/util/build_device.py
|
| +++ b/build/android/gyp/util/build_device.py
|
| @@ -17,8 +17,9 @@ BUILD_ANDROID_DIR = os.path.join(os.path.dirname(__file__), '..', '..')
|
| sys.path.append(BUILD_ANDROID_DIR)
|
|
|
| from pylib import android_commands
|
| +from pylib.device import device_utils
|
|
|
| -GetAttachedDevices = android_commands.GetAttachedDevices
|
| +GetAttachedDevices = android_commands.GetAttachedDevices()
|
|
|
|
|
| class BuildDevice(object):
|
| @@ -26,19 +27,19 @@ class BuildDevice(object):
|
| self.id = configuration['id']
|
| self.description = configuration['description']
|
| self.install_metadata = configuration['install_metadata']
|
| - self.adb = android_commands.AndroidCommands(self.id)
|
| + self.device = device_utils.DeviceUtils(self.id)
|
|
|
| def RunShellCommand(self, *args, **kwargs):
|
| - return self.adb.RunShellCommand(*args, **kwargs)
|
| + return self.device.old_interface.RunShellCommand(*args, **kwargs)
|
|
|
| def PushIfNeeded(self, *args, **kwargs):
|
| - return self.adb.PushIfNeeded(*args, **kwargs)
|
| + return self.device.old_interface.PushIfNeeded(*args, **kwargs)
|
|
|
| def GetSerialNumber(self):
|
| return self.id
|
|
|
| def Install(self, *args, **kwargs):
|
| - return self.adb.Install(*args, **kwargs)
|
| + return self.device.old_interface.Install(*args, **kwargs)
|
|
|
| def GetInstallMetadata(self, apk_package):
|
| """Gets the metadata on the device for the apk_package apk."""
|
| @@ -53,20 +54,20 @@ class BuildDevice(object):
|
|
|
|
|
| def GetConfigurationForDevice(device_id):
|
| - adb = android_commands.AndroidCommands(device_id)
|
| + device = device_utils.DeviceUtils(device_id)
|
| configuration = None
|
| has_root = False
|
| - is_online = adb.IsOnline()
|
| + is_online = device.old_interface.IsOnline()
|
| if is_online:
|
| cmd = 'ls -l /data/app; getprop ro.build.description'
|
| - cmd_output = adb.RunShellCommand(cmd)
|
| + cmd_output = device.old_interface.RunShellCommand(cmd)
|
| has_root = not 'Permission denied' in cmd_output[0]
|
| if not has_root:
|
| # Disable warning log messages from EnableAdbRoot()
|
| logging.getLogger().disabled = True
|
| - has_root = adb.EnableAdbRoot()
|
| + has_root = device.old_interface.EnableAdbRoot()
|
| logging.getLogger().disabled = False
|
| - cmd_output = adb.RunShellCommand(cmd)
|
| + cmd_output = device.old_interface.RunShellCommand(cmd)
|
|
|
| configuration = {
|
| 'id': device_id,
|
|
|