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

Unified Diff: build/android/provision_devices.py

Issue 333933003: [Android] Switch to DeviceUtils version of RunShellCommand. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 6 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/host_heartbeat.py ('k') | build/android/pylib/android_commands.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/provision_devices.py
diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py
index ea6d807d5c3b1e922770cbb4d65bccd5c6d4452c..859fcbbe1ee207f1e3da26d2ce79cda92539624b 100755
--- a/build/android/provision_devices.py
+++ b/build/android/provision_devices.py
@@ -84,8 +84,9 @@ def _ConfigureLocalProperties(device):
constants.DEVICE_LOCAL_PROPERTIES_PATH,
'\n'.join(local_props))
# Android will not respect the local props file if it is world writable.
- device.old_interface.RunShellCommandWithSU(
- 'chmod 644 %s' % constants.DEVICE_LOCAL_PROPERTIES_PATH)
+ device.RunShellCommand(
+ 'chmod 644 %s' % constants.DEVICE_LOCAL_PROPERTIES_PATH,
+ root=True)
# LOCAL_PROPERTIES_PATH = '/data/local.prop'
@@ -105,23 +106,23 @@ def WipeDeviceData(device):
device_authorized = device.old_interface.FileExistsOnDevice(
constants.ADB_KEYS_FILE)
if device_authorized:
- adb_keys = device.old_interface.RunShellCommandWithSU(
- 'cat %s' % constants.ADB_KEYS_FILE)
- device.old_interface.RunShellCommandWithSU('wipe data')
+ adb_keys = device.RunShellCommand('cat %s' % constants.ADB_KEYS_FILE,
+ root=True)
+ device.RunShellCommand('wipe data', root=True)
if device_authorized:
path_list = constants.ADB_KEYS_FILE.split('/')
dir_path = '/'.join(path_list[:len(path_list)-1])
- device.old_interface.RunShellCommandWithSU('mkdir -p %s' % dir_path)
- device.old_interface.RunShellCommand('echo %s > %s' %
- (adb_keys[0], constants.ADB_KEYS_FILE))
+ device.RunShellCommand('mkdir -p %s' % dir_path, root=True)
+ device.RunShellCommand('echo %s > %s' %
+ (adb_keys[0], constants.ADB_KEYS_FILE))
for adb_key in adb_keys[1:]:
- device.old_interface.RunShellCommand(
+ device.RunShellCommand(
'echo %s >> %s' % (adb_key, constants.ADB_KEYS_FILE))
def ProvisionDevices(options):
# TODO(jbudorick): Parallelize provisioning of all attached devices after
- # swithcing from AndroidCommands.
+ # switching from AndroidCommands.
if options.device is not None:
devices = [options.device]
else:
@@ -134,7 +135,7 @@ def ProvisionDevices(options):
device.old_interface.EnableAdbRoot()
WipeDeviceData(device)
try:
- device_utils.DeviceUtils.parallel(devices).old_interface.Reboot(True)
+ device_utils.DeviceUtils.parallel(devices).Reboot(True)
except errors.DeviceUnresponsiveError:
pass
for device_serial in devices:
@@ -173,7 +174,7 @@ def ProvisionDevices(options):
battery_info.get('level', 0))
time.sleep(60)
battery_info = device.old_interface.GetBatteryInfo()
- device.old_interface.RunShellCommandWithSU('date -u %f' % time.time())
+ device.RunShellCommand('date -u %f' % time.time(), root=True)
try:
device_utils.DeviceUtils.parallel(devices).Reboot(True)
except errors.DeviceUnresponsiveError:
« no previous file with comments | « build/android/host_heartbeat.py ('k') | build/android/pylib/android_commands.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698