mirror of
https://github.com/ARM-software/devlib.git
synced 2025-02-07 05:30:44 +00:00
android: add support for forced adb root
When rebooting a platform the internal connection state becomes different from _connected_as_root, which was set before reboot. Add the possibility to force adb root if you've rebooted or know to have done something that would result in the platform having a different connection state than the one of _connected_as_root. Signed-off-by: Ionela Voinescu <ionela.voinescu@arm.com>
This commit is contained in:
parent
b7ac9e7edc
commit
66eaf15cdc
@ -1040,9 +1040,9 @@ class AndroidTarget(Target):
|
|||||||
def adb_reboot_bootloader(self, timeout=30):
|
def adb_reboot_bootloader(self, timeout=30):
|
||||||
adb_command(self.adb_name, 'reboot-bootloader', timeout)
|
adb_command(self.adb_name, 'reboot-bootloader', timeout)
|
||||||
|
|
||||||
def adb_root(self, enable=True):
|
def adb_root(self, enable=True, force=False):
|
||||||
if enable:
|
if enable:
|
||||||
if self._connected_as_root:
|
if self._connected_as_root and not force:
|
||||||
return
|
return
|
||||||
adb_command(self.adb_name, 'root', timeout=30)
|
adb_command(self.adb_name, 'root', timeout=30)
|
||||||
self._connected_as_root = True
|
self._connected_as_root = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user