Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3176)

Unified Diff: build/android/gyp/util/build_device.py

Issue 221823011: [Android] Change object types from AndroidCommands to DeviceUtils in build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/enable_asserts.py ('k') | build/android/host_heartbeat.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « build/android/enable_asserts.py ('k') | build/android/host_heartbeat.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698