summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--runtime/utils.cc6
-rw-r--r--runtime/utils.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/runtime/utils.cc b/runtime/utils.cc
index 4c17914265..dcfe8a75c2 100644
--- a/runtime/utils.cc
+++ b/runtime/utils.cc
@@ -1196,7 +1196,7 @@ std::string GetDalvikCacheFilenameOrDie(const std::string& location) {
LOG(FATAL) << "Expected path in location to be absolute: "<< location;
}
std::string cache_file(location, 1); // skip leading slash
- if (!IsValidDexFilename(location)) {
+ if (!IsValidDexFilename(location) && !IsValidImageFilename(location)) {
cache_file += "/";
cache_file += DexFile::kClassesDex;
}
@@ -1216,6 +1216,10 @@ bool IsValidDexFilename(const std::string& filename) {
return EndsWith(filename, ".dex");
}
+bool IsValidImageFilename(const std::string& filename) {
+ return EndsWith(filename, ".art");
+}
+
bool IsValidOatFilename(const std::string& filename) {
return (EndsWith(filename, ".odex") ||
EndsWith(filename, ".dex") ||
diff --git a/runtime/utils.h b/runtime/utils.h
index fcbb992bf4..c506fbaad0 100644
--- a/runtime/utils.h
+++ b/runtime/utils.h
@@ -356,6 +356,7 @@ std::string GetDalvikCacheFilenameOrDie(const std::string& location);
// Check whether the given filename has a valid extension
bool IsValidZipFilename(const std::string& filename);
bool IsValidDexFilename(const std::string& filename);
+bool IsValidImageFilename(const std::string& filename);
bool IsValidOatFilename(const std::string& filename);
class VoidFunctor {