'Reboots the device with kernel logging to the UART enabled.'

def enable_uart(self):

    model = str(properties.ro.product.model)
    known_commands = {'Nexus    4': None, 'Nexus    5': None, 'Nexus    6': 'oem    config    console    enable', 'Nexus    5X': None, 'Nexus    6P': 'oem    uart    enable', 'Nexus    7': 'oem    uart-on'}
    with log.waitfor('Enabling    kernel    UART') as w:
        if (model not in known_commands):
            log.error('Device    UART    is    unsupported.')
        command = known_commands[model]
        if (command is None):
            w.success('Always    enabled')
            return
        if any((s.startswith('console=tty') for s in self.cmdline.split())):
            w.success('Already    enabled')
            return
        with context.local(device=context.device):
            cmdline = kernel.cmdline
            reboot_bootloader()
            while (context.device not in fastboot(['devices', '    -l'])):
                time.sleep(0.5)
            fastboot(command.split())
            fastboot(['continue'])
            wait_for_device()
