Adding new feature to adb "abb".
It will allow clients to detect if abb is supported.
Test: manual
BUG: 111621042
Change-Id: Ifddabe49214882a6c6ad898c7e2a0f5cc92458d8
diff --git a/adb/client/commandline.cpp b/adb/client/commandline.cpp
index 9bc42e1..e963e3d 100644
--- a/adb/client/commandline.cpp
+++ b/adb/client/commandline.cpp
@@ -762,6 +762,17 @@
}
static int adb_abb(int argc, const char** argv) {
+ FeatureSet features;
+ std::string error_message;
+ if (!adb_get_feature_set(&features, &error_message)) {
+ fprintf(stderr, "error: %s\n", error_message.c_str());
+ return 1;
+ }
+
+ if (!CanUseFeature(features, kFeatureAbb)) {
+ error_exit("abb is not supported by the device");
+ }
+
// Defaults.
constexpr char escape_char = '~'; // -e
constexpr bool use_shell_protocol = true;