uiautomator2 icon indicating copy to clipboard operation
uiautomator2 copied to clipboard

切换输入法self.set_fastinput_ime(True) 方法抛异常 "FastInputIME started failed"

Open qugo9955 opened this issue 4 years ago • 1 comments

不同手机切换为FastInputIME 输入法后,获取到的mInputShown属性值有些是false 有些是true,不是统一为true,导致切换输入法self.set_fastinput_ime(True) 方法抛异常 "FastInputIME started failed" 1682、1683行 是不是要调整下?

def wait_fastinput_ime(self, timeout=5.0):
    """ wait FastInputIME is ready
    Args:
        timeout(float): maxium wait time

    Raises:
        EnvironmentError
    """
    if not self.serial:  # maybe simulator eg: genymotion, 海马玩模拟器
        raise EnvironmentError("Android simulator is not supported.")

    deadline = time.time() + timeout
    while time.time() < deadline:
        ime_id, shown = self.current_ime()
        if ime_id != "com.github.uiautomator/.FastInputIME":
            self.set_fastinput_ime(True)
            time.sleep(0.5)
            continue
        if shown:
            return True

image

qugo9955 avatar Feb 20 '21 02:02 qugo9955