adb: put legacy shell: service back in.
ddmlib does not use the ADB client, but instead connects directly to
the adb server. This breaks some of the assumptions I previously made
when enabling the shell protocol.
To fix this, the adb server now defaults to no protocol for the
standalone command, and the shell protocol must be explicitly requested
by the client. For example:
shell:echo foo -- no shell protocol
shell,v2:echo foo -- shell protocol
As long as I was touching the shell service arguments I also changed
them to no longer duplicate the command-line arguments. This allows
more flexibility to change the adb client CLI if necessary and makes
the code more readable.
Bug: http://b/24148636
Change-Id: I28d5ae578cf18cbe79347dc89cea1750ff4571a8
diff --git a/adb/transport.cpp b/adb/transport.cpp
index 2a2fac7..501a39a 100644
--- a/adb/transport.cpp
+++ b/adb/transport.cpp
@@ -808,6 +808,11 @@
return FeatureSet(names.begin(), names.end());
}
+bool CanUseFeature(const FeatureSet& feature_set, const std::string& feature) {
+ return feature_set.count(feature) > 0 &&
+ supported_features().count(feature) > 0;
+}
+
bool atransport::has_feature(const std::string& feature) const {
return features_.count(feature) > 0;
}
@@ -816,10 +821,6 @@
features_ = StringToFeatureSet(features_string);
}
-bool atransport::CanUseFeature(const std::string& feature) const {
- return has_feature(feature) && supported_features().count(feature) > 0;
-}
-
void atransport::AddDisconnect(adisconnect* disconnect) {
disconnects_.push_back(disconnect);
}