Don't generate an image for debuggable apps.

Boot image classes can be redefined, so we should not generate
an image.

Test: test.py
Bug: 276611504
Change-Id: Ia48297ef9be137068225e801d6a33abca603c38f
diff --git a/runtime/startup_completed_task.cc b/runtime/startup_completed_task.cc
index b82ab57..649124e 100644
--- a/runtime/startup_completed_task.cc
+++ b/runtime/startup_completed_task.cc
@@ -66,8 +66,10 @@
     return;
   }
 
-  // Maybe generate a runtime app image.
-  {
+  // Maybe generate a runtime app image. If the runtime is debuggable, boot
+  // classpath classes can be dynamically changed, so don't bother generating an
+  // image.
+  if (!runtime->IsJavaDebuggable()) {
     std::string compiler_filter;
     std::string compilation_reason;
     runtime->GetAppInfo()->GetPrimaryApkOptimizationStatus(&compiler_filter, &compilation_reason);