| Index: devil/devil/android/device_utils.py
|
| diff --git a/devil/devil/android/device_utils.py b/devil/devil/android/device_utils.py
|
| index 50f362c3839974e7d296ff08c6cc7669b63b3a85..741ce640143b464d65a22b58b782a5f7a85e44ec 100644
|
| --- a/devil/devil/android/device_utils.py
|
| +++ b/devil/devil/android/device_utils.py
|
| @@ -444,12 +444,18 @@ class DeviceUtils(object):
|
| CommandFailedError if root could not be enabled.
|
| CommandTimeoutError on timeout.
|
| """
|
| - if self.IsUserBuild():
|
| - raise device_errors.CommandFailedError(
|
| - 'Cannot enable root in user builds.', str(self))
|
| if 'needs_su' in self._cache:
|
| del self._cache['needs_su']
|
| - self.adb.Root()
|
| +
|
| + try:
|
| + self.adb.Root()
|
| + except device_errors.AdbCommandFailedError:
|
| + if self.IsUserBuild():
|
| + raise device_errors.CommandFailedError(
|
| + 'Unable to root device with user build.', str(self))
|
| + else:
|
| + raise # Failed probably due to some other reason.
|
| +
|
| self.WaitUntilFullyBooted()
|
|
|
| @decorators.WithTimeoutAndRetriesFromInstance()
|
|
|