Revert "Make adbconnection start automatically for debuggable apps (on target)"
This reverts commit 5af3f503f3ad5a24dc1acac3070f7dcda4b6593d.
Reason for revert: Breaks target tests
Bug: 109505014
Change-Id: I43877a11c615637a152954e0c0d0b2b0f18bcc9e
Test: none
diff --git a/cmdline/cmdline_parser_test.cc b/cmdline/cmdline_parser_test.cc
index a52e163..235a2aa 100644
--- a/cmdline/cmdline_parser_test.cc
+++ b/cmdline/cmdline_parser_test.cc
@@ -371,7 +371,7 @@
*/
TEST_F(CmdlineParserTest, TestJdwpProviderEmpty) {
{
- EXPECT_SINGLE_PARSE_DEFAULT_VALUE(JdwpProvider::kUnset, "", M::JdwpProvider);
+ EXPECT_SINGLE_PARSE_DEFAULT_VALUE(JdwpProvider::kNone, "", M::JdwpProvider);
}
} // TEST_F
diff --git a/runtime/jdwp_provider.h b/runtime/jdwp_provider.h
index c4f1989..698fdc0 100644
--- a/runtime/jdwp_provider.h
+++ b/runtime/jdwp_provider.h
@@ -19,7 +19,6 @@
#include <ios>
-#include "base/globals.h"
#include "base/macros.h"
#include "base/logging.h"
@@ -27,33 +26,13 @@
enum class JdwpProvider {
kNone,
- // Special value only used to denote that no explicit choice has been made by the user. This
- // should not be used and one should always call CanonicalizeJdwpProvider which will remove this
- // value before using a JdwpProvider value.
- kUnset,
kInternal,
kAdbConnection,
- // The current default provider. Used if you run -XjdwpProvider:default
+ // The current default provider
kDefaultJdwpProvider = kAdbConnection,
-
- // What we should use as provider with no options and debuggable. On host we always want to be
- // none since there is no adbd on host.
- kUnsetDebuggable = kIsTargetBuild ? kDefaultJdwpProvider : kNone,
- // What we should use as provider with no options and non-debuggable
- kUnsetNonDebuggable = kNone,
};
-inline JdwpProvider CanonicalizeJdwpProvider(JdwpProvider p, bool debuggable) {
- if (p != JdwpProvider::kUnset) {
- return p;
- }
- if (debuggable) {
- return JdwpProvider::kUnsetDebuggable;
- }
- return JdwpProvider::kUnsetNonDebuggable;
-}
-
std::ostream& operator<<(std::ostream& os, const JdwpProvider& rhs);
} // namespace art
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 64aab01..1402749 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -1270,8 +1270,7 @@
dump_gc_performance_on_shutdown_ = runtime_options.Exists(Opt::DumpGCPerformanceOnShutdown);
jdwp_options_ = runtime_options.GetOrDefault(Opt::JdwpOptions);
- jdwp_provider_ = CanonicalizeJdwpProvider(runtime_options.GetOrDefault(Opt::JdwpProvider),
- IsJavaDebuggable());
+ jdwp_provider_ = runtime_options.GetOrDefault(Opt::JdwpProvider);
switch (jdwp_provider_) {
case JdwpProvider::kNone: {
VLOG(jdwp) << "Disabling all JDWP support.";
@@ -1305,11 +1304,6 @@
constexpr const char* plugin_name = kIsDebugBuild ? "libadbconnectiond.so"
: "libadbconnection.so";
plugins_.push_back(Plugin::Create(plugin_name));
- break;
- }
- case JdwpProvider::kUnset: {
- LOG(FATAL) << "Illegal jdwp provider " << jdwp_provider_ << " was not filtered out!";
- break;
}
}
callbacks_->AddThreadLifecycleCallback(Dbg::GetThreadLifecycleCallback());
diff --git a/runtime/runtime_options.def b/runtime/runtime_options.def
index 3f9a322..e647423 100644
--- a/runtime/runtime_options.def
+++ b/runtime/runtime_options.def
@@ -44,7 +44,7 @@
RUNTIME_OPTIONS_KEY (Unit, CheckJni)
RUNTIME_OPTIONS_KEY (Unit, JniOptsForceCopy)
RUNTIME_OPTIONS_KEY (std::string, JdwpOptions, "")
-RUNTIME_OPTIONS_KEY (JdwpProvider, JdwpProvider, JdwpProvider::kUnset)
+RUNTIME_OPTIONS_KEY (JdwpProvider, JdwpProvider, JdwpProvider::kNone)
RUNTIME_OPTIONS_KEY (MemoryKiB, MemoryMaximumSize, gc::Heap::kDefaultMaximumSize) // -Xmx
RUNTIME_OPTIONS_KEY (MemoryKiB, MemoryInitialSize, gc::Heap::kDefaultInitialSize) // -Xms
RUNTIME_OPTIONS_KEY (MemoryKiB, HeapGrowthLimit) // Default is 0 for unlimited