Move art to use dalvik names for .oat files

Change-Id: Ia383c0a0847684a513cab7db44b4ecf8fe05e1c3
diff --git a/src/utils.cc b/src/utils.cc
index bb83802..723be92 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -1208,6 +1208,10 @@
     LOG(FATAL) << "Expected path in location to be absolute: "<< location;
   }
   std::string cache_file(location, 1); // skip leading slash
+  if (!IsValidDexFilename(location)) {
+    cache_file += "/";
+    cache_file += DexFile::kClassesDex;
+  }
   std::replace(cache_file.begin(), cache_file.end(), '/', '@');
   return dalvik_cache + "/" + cache_file;
 }
@@ -1225,7 +1229,9 @@
 }
 
 bool IsValidOatFilename(const std::string& filename) {
-  return EndsWith(filename, ".oat");
+  return (EndsWith(filename, ".odex") ||
+          EndsWith(filename, ".oat") ||
+          EndsWith(filename, DexFile::kClassesDex));
 }
 
 }  // namespace art