summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2017-12-12 12:03:04 -0800
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-12-13 21:48:00 +0000
commitd1418798048a23cdf1336699f7c81ba077728be5 (patch)
tree352445566227357219fd53aa45b11ed0c5af82c1
parent38a95a9cd6cf4829f7b6d3362e83e49a053b731e (diff)
downloadart-d1418798048a23cdf1336699f7c81ba077728be5.tar.gz
ART: Reinstate secondary-image-patching exit
Do not attempt imageless running with a stale secondary image. Instead prune the cache and exit, relying on init restarting the process. The combined image checksum is not written down into the boot image itself, only into apps. This should really be fixed. Follow-up to commit a463b6a920a2a0bf14f9cca20a561b412b9349d1. (cherry picked from commit 8d8a005ae3ae355dee88b3cb1351b93a070d4209) Bug: 30832951 Bug: 69428309 Bug: 70213235 Bug: 70498154 Test: m test-art-host Merged-In: I27ab3384ce4ffd93efb00a2e216cb839fe4357d5 Change-Id: I27ab3384ce4ffd93efb00a2e216cb839fe4357d5 (cherry picked from commit 8187e0baaa634151a070dfbf6f933e1f529d7ef6)
-rw-r--r--runtime/gc/space/image_space.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc
index fe0d35f455..3aab4c6bba 100644
--- a/runtime/gc/space/image_space.cc
+++ b/runtime/gc/space/image_space.cc
@@ -1574,7 +1574,9 @@ std::unique_ptr<ImageSpace> ImageSpace::CreateBootImage(const char* image_locati
if (!Runtime::Current()->IsImageDex2OatEnabled()) {
local_error_msg = "Patching disabled.";
} else if (secondary_image) {
- local_error_msg = "Cannot patch a secondary image.";
+ // We really want a working image. Prune and restart.
+ PruneDalvikCache(image_isa);
+ _exit(1);
} else if (ImageCreationAllowed(is_global_cache, image_isa, &local_error_msg)) {
bool patch_success =
RelocateImage(image_location, cache_filename.c_str(), image_isa, &local_error_msg);