From patchwork Thu Aug 23 06:14:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 144880 Delivered-To: patch@linaro.org Received: by 2002:a2e:164a:0:0:0:0:0 with SMTP id 10-v6csp736197ljw; Wed, 22 Aug 2018 23:14:42 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzelmBHhv8/YcGo9Vokrkya2lWgDQ/Zd8MmEA7NRsRlbX+Y3F9lWIgNpF82tCWV9S/sDSTy X-Received: by 2002:a37:bf82:: with SMTP id p124-v6mr52785864qkf.46.1535004882501; Wed, 22 Aug 2018 23:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535004882; cv=none; d=google.com; s=arc-20160816; b=zVJPOiSbZTu+/B8VRlJLOZILifWeBu1mt7jOGQp9ypJLfBkWewcSQYqiVrf+Rz3YC9 oDAHkcyIMbcelGAaWnEIfL8NXkCtmlPMY6bS8GUT6gMauB5v/AvTBB3JFCnCyFLLGwxS Wy9B06ZFoNNh2eJ5oLHf3qvPWHuxULIEqG7I592a1X4a76Fy+LZzDViELWhvIOAdXkiU wvgMZWo+82fQvVKoV0d5JYQpMi1ZPJBIzsdjMS5YJNnLGzmXeMq04sbR+8Eu7gj7c+W5 3Wyb4ONDi8D9HSyFF6Cg3tdxwqdI1rAziqeXY/WgDqWuf87lLKvzKr9SUiI+Db1samO/ fTSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=79jB4s3p04Zv95y6LOwzeAPefHWlNvBq/NDXCrEBIuE=; b=QZju4lkFSNI4NXAOg2WNeWwDeyh8WkyekwPQy4GxVAn2gW8CIn01wceoSDxyasPcyq IjAMVIatkxA1T0krcNueVPWMADqk5zrDz7VxeDPTfWXiAeozoeV17DI7NVnRuBhacBcJ nRB63pBHdSoDjHXPy5iuF03f+aOxOp/feQ3GHz62MOhPT/yHJl8Rk9Hd9F5kMBr+/2Jp Mhzd3MCjvUgFj8M4k0MH+JCRVx22FVNDZaCJZjj9/BIFoT9OO9JWCaz8qnmQnOPJ22A3 rEaSpWG41B+WZ33HP94QkxKNWHMD9Q2qSzPkWNEZSil51swRW7QSvC5QA3EgVARzV8/+ SY0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=GOfbTWz8; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id i43-v6si3310908qtf.22.2018.08.22.23.14.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Aug 2018 23:14:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=GOfbTWz8; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8C5DC210FCF7E; Wed, 22 Aug 2018 23:14:41 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::444; helo=mail-pf1-x444.google.com; envelope-from=haojian.zhuang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9C41F210EE4E7 for ; Wed, 22 Aug 2018 23:14:40 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id j26-v6so2151619pfi.10 for ; Wed, 22 Aug 2018 23:14:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=NyLj0UK9KwEM0Fmiv13Qj7YFn44upUEEjSF1Bn8IEtY=; b=GOfbTWz81b9IIUm8X0+TZcsuIK8conMfuyV/PZ/3uOt0PHPmVTi6rOwTUhkvxIpQJz 0hVYisloHgG5VGWlwI6Cr6Fp9OFHZet9JDkbUUIEC7sDccGbGH5TQltSFIaFslfK1ZfT ej1q5hN90DDqD4YH9+ICtJPoMhRC/9NIsVIBs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=NyLj0UK9KwEM0Fmiv13Qj7YFn44upUEEjSF1Bn8IEtY=; b=SsbJo4XFWXipAF853LVBDeIq37omZ9utv8SF5tDkhDhZmmbkAyilFFSAeGo9cKu+vm aNDLxAiUoZD6MPaOtC4OKs+NAsDrjLYZN/xvYzJ/eQDHQNqUX0hLrmPbsjjQ7Fkpra4b K7gn7mkZwNdeckgm5t7GkxVHfWXRKf+twCBQgnv+iAT7YlpNGwftjDHBOrLeWU64TcXV jL8W5EitWXffh6VFtyFo1jiPGtj9fmFzsGHzSGSZYq80sqNN3xwk7nU/sGp2CkY37V3O 4aTX5cxHKSjnS3x5kxorMno/8G+QOyIlhqslEFB3dKcTrPyzFLGXIG4khQJCFCF/pobR 2qXA== X-Gm-Message-State: APzg51Bkl9XW2647qmWRM0i8zMJsSRdOX6syD37V4M4chHYzJqOmEVj7 vBYk2yL8Tj/IDXw2w/OBAbVGbgmb/3CcUg== X-Received: by 2002:a63:4c46:: with SMTP id m6-v6mr4408204pgl.156.1535004879409; Wed, 22 Aug 2018 23:14:39 -0700 (PDT) Received: from localhost.localdomain ([64.64.108.80]) by smtp.gmail.com with ESMTPSA id x2-v6sm6245436pfi.166.2018.08.22.23.14.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Aug 2018 23:14:38 -0700 (PDT) From: Haojian Zhuang To: edk2-devel@lists.01.org Date: Thu, 23 Aug 2018 14:14:33 +0800 Message-Id: <1535004873-24208-1-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [edk2] [PATCH v1 1/1] EmbeddedPkg/AndroidFastbootApp: only use ENTER or SPACE to exit X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Since hotkey 'f' is used to start AndroidFastbootApp. If user press 'f' key too long, it may be recognized pressing 'f' key multiple times. Then AndroidFastbootApp exists since it delcares any key press could make it exit. So only use ENTER or SPACE key to exit AndroidFastbootApp. Cc: Leif Lindholm Cc: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Ard Biesheuvel diff --git a/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c b/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c index c5e8a7e34af2..c1ed94f92b6f 100644 --- a/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c +++ b/EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.c @@ -426,6 +426,7 @@ FastbootAppEntryPoint ( EFI_EVENT WaitEventArray[2]; UINTN EventIndex; EFI_SIMPLE_TEXT_INPUT_PROTOCOL *TextIn; + EFI_INPUT_KEY Key; mDataBuffer = NULL; @@ -508,12 +509,21 @@ FastbootAppEntryPoint ( // Talk to the user mTextOut->OutputString (mTextOut, - L"Android Fastboot mode - version " ANDROID_FASTBOOT_VERSION ". Press any key to quit.\r\n"); + L"Android Fastboot mode - version " ANDROID_FASTBOOT_VERSION ". Press RETURN or SPACE key to quit.\r\n"); // Quit when the user presses any key, or mFinishedEvent is signalled WaitEventArray[0] = mFinishedEvent; WaitEventArray[1] = TextIn->WaitForKey; - gBS->WaitForEvent (2, WaitEventArray, &EventIndex); + while (1) { + gBS->WaitForEvent (2, WaitEventArray, &EventIndex); + Status = TextIn->ReadKeyStroke (gST->ConIn, &Key); + if (Key.ScanCode == SCAN_NULL) { + if ((Key.UnicodeChar == CHAR_CARRIAGE_RETURN) || + (Key.UnicodeChar == L' ')) { + break; + } + } + } mTransport->Stop (); if (EFI_ERROR (Status)) {