summaryrefslogtreecommitdiffstats
path: root/adb/transport.cpp
diff options
context:
space:
mode:
authorDavid Pursell <dpursell@google.com>2015-09-25 13:04:21 -0700
committerDavid Pursell <dpursell@google.com>2015-09-25 13:10:17 -0700
commitd2b588e23901538f4b459a71fefdac6fc2748f7e (patch)
tree9bb9524fafe904a16187c5eb8c42b8d663544cfc /adb/transport.cpp
parentfca4821e05f1d4684185b559d177ffde6937bf61 (diff)
downloadcore-d2b588e23901538f4b459a71fefdac6fc2748f7e.tar.gz
core-d2b588e23901538f4b459a71fefdac6fc2748f7e.tar.bz2
core-d2b588e23901538f4b459a71fefdac6fc2748f7e.zip
adb: fix adbd feature parsing for no features.
Previously the transport features list was only overwritten if a new feature list was found. However, adbd can reuse the same atransport object even if the adb server is killed and restarted, so the feature list was not cleared properly if the newly started adb server didn't provide one. This CL fixes the bug by clearing the transport features list whenever a connection banner is parsed. Bug: http://b/24405971 Change-Id: Ia6ee6c9a46a621534681f6d4d7df77156b885eb9
Diffstat (limited to 'adb/transport.cpp')
-rw-r--r--adb/transport.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/adb/transport.cpp b/adb/transport.cpp
index ffbb10798..6ebb9c728 100644
--- a/adb/transport.cpp
+++ b/adb/transport.cpp
@@ -796,6 +796,10 @@ std::string FeatureSetToString(const FeatureSet& features) {
}
FeatureSet StringToFeatureSet(const std::string& features_string) {
+ if (features_string.empty()) {
+ return FeatureSet();
+ }
+
auto names = android::base::Split(features_string,
{kFeatureStringDelimiter});
return FeatureSet(names.begin(), names.end());