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

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

Issue 285143002: [Android] Convert to DeviceUtils versions of IsOnline, HasRoot, and EnableRoot. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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/buildbot/bb_device_status_check.py ('k') | build/android/pylib/device/decorators.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 928bd02f8c2f60ff4c716d5248dc4b86f090b898..8d694c12a67946ab962c07a7eaf6992de90ab9f3 100644
--- a/build/android/gyp/util/build_device.py
+++ b/build/android/gyp/util/build_device.py
@@ -17,6 +17,7 @@ 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_errors
from pylib.device import device_utils
GetAttachedDevices = android_commands.GetAttachedDevices
@@ -57,16 +58,21 @@ def GetConfigurationForDevice(device_id):
device = device_utils.DeviceUtils(device_id)
configuration = None
has_root = False
- is_online = device.old_interface.IsOnline()
+ is_online = device.IsOnline()
if is_online:
cmd = 'ls -l /data/app; getprop ro.build.description'
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()
+ # Disable warning log messages from EnableRoot()
logging.getLogger().disabled = True
- has_root = device.old_interface.EnableAdbRoot()
- logging.getLogger().disabled = False
+ try:
+ device.EnableRoot()
+ has_root = True
+ except device_errors.CommandFailedError:
+ has_root = False
+ finally:
+ logging.getLogger().disabled = False
cmd_output = device.old_interface.RunShellCommand(cmd)
configuration = {
« no previous file with comments | « build/android/buildbot/bb_device_status_check.py ('k') | build/android/pylib/device/decorators.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698