summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alex Light <allight@google.com> 2018-01-27 00:21:08 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2018-01-27 00:21:08 +0000
commit9220335a2cc121afce989e8196ee93b54db9c834 (patch)
tree2eba9449f6587eeb31c6144dbab4cfc082cec6e9
parentb3019b96ef948f06a54def34f9872500b752259c (diff)
parent49a5b9d0a59c3ec6c171d15f781a8e38b70352df (diff)
Merge changes I6d1231e5,I89559cc6
* changes: Revert^2 "Change default dalvik.vm.jdwp-provider to adbconnection" Refactor jdwp_provider to make it easier to change the default
-rw-r--r--cmdline/cmdline_parser_test.cc2
-rw-r--r--cmdline/cmdline_types.h7
-rw-r--r--runtime/jdwp_provider.h3
3 files changed, 8 insertions, 4 deletions
diff --git a/cmdline/cmdline_parser_test.cc b/cmdline/cmdline_parser_test.cc
index 5d672061df..1e79fdff1b 100644
--- a/cmdline/cmdline_parser_test.cc
+++ b/cmdline/cmdline_parser_test.cc
@@ -375,7 +375,7 @@ TEST_F(CmdlineParserTest, TestJdwpProviderEmpty) {
TEST_F(CmdlineParserTest, TestJdwpProviderDefault) {
const char* opt_args = "-XjdwpProvider:default";
- EXPECT_SINGLE_PARSE_VALUE(JdwpProvider::kInternal, opt_args, M::JdwpProvider);
+ EXPECT_SINGLE_PARSE_VALUE(JdwpProvider::kDefaultJdwpProvider, opt_args, M::JdwpProvider);
} // TEST_F
TEST_F(CmdlineParserTest, TestJdwpProviderInternal) {
diff --git a/cmdline/cmdline_types.h b/cmdline/cmdline_types.h
index d0d6bfd3ce..c8be69d922 100644
--- a/cmdline/cmdline_types.h
+++ b/cmdline/cmdline_types.h
@@ -76,9 +76,10 @@ struct CmdlineType<JdwpProvider> : CmdlineTypeParser<JdwpProvider> {
"Example: -XjdwpProvider:none to disable JDWP\n"
"Example: -XjdwpProvider:internal for internal jdwp implementation\n"
"Example: -XjdwpProvider:adbconnection for adb connection mediated jdwp implementation\n"
- "Example: -XjdwpProvider:default for the default jdwp implementation"
- " (currently internal)\n");
- } else if (option == "internal" || option == "default") {
+ "Example: -XjdwpProvider:default for the default jdwp implementation\n");
+ } else if (option == "default") {
+ return Result::Success(JdwpProvider::kDefaultJdwpProvider);
+ } else if (option == "internal") {
return Result::Success(JdwpProvider::kInternal);
} else if (option == "adbconnection") {
return Result::Success(JdwpProvider::kAdbConnection);
diff --git a/runtime/jdwp_provider.h b/runtime/jdwp_provider.h
index b62e10b4f8..698fdc086d 100644
--- a/runtime/jdwp_provider.h
+++ b/runtime/jdwp_provider.h
@@ -28,6 +28,9 @@ enum class JdwpProvider {
kNone,
kInternal,
kAdbConnection,
+
+ // The current default provider
+ kDefaultJdwpProvider = kAdbConnection,
};
std::ostream& operator<<(std::ostream& os, const JdwpProvider& rhs);