summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Josh Gao <jmgao@google.com> 2019-12-11 14:22:38 -0800
committer Josh Gao <jmgao@google.com> 2020-01-02 12:33:43 -0800
commitbb927a13b4fa39401494a8e157cb5bf79275ca36 (patch)
tree81e44201ae0b5ba1da0bcec554fc9b56ab519af1
parentd17f197e1ce86c0289c4f803374c6fc0d9c3e261 (diff)
adbd_auth: dispatch pending prompts on success.
If we have multiple queued auth requests, we need to dispatch our pending prompts on success as well as failure. Test: `mux off; mux a; mux off; mux` to switch, then tapped allow twice Change-Id: I14ce2a1c43fbd9af45397c9fb778a0e145ceabba
-rw-r--r--libs/adbd_auth/adbd_auth.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/adbd_auth/adbd_auth.cpp b/libs/adbd_auth/adbd_auth.cpp
index 64791098ee..a9c23110c9 100644
--- a/libs/adbd_auth/adbd_auth.cpp
+++ b/libs/adbd_auth/adbd_auth.cpp
@@ -178,6 +178,10 @@ public:
this->callbacks_.key_authorized(arg, id);
this->dispatched_prompt_ = std::nullopt;
+
+ // We need to dispatch pending prompts here upon success as well,
+ // since we might have multiple queued prompts.
+ DispatchPendingPrompt();
} else if (packet[0] == 'N' && packet[1] == 'O') {
CHECK_EQ(2UL, packet.length());
// TODO: Do we want a callback if the key is denied?