Store odex files in oat/<isa>/ directory.
Previously odex files were stored alongside the dex location as:
dex location: /foo/bar/base.apk
odex location: /foo/bar/<isa>/base.odex
This changes where odex files are stored, adding an "oat" directory:
dex location: /foo/bar/base.apk
odex location: /foo/bar/oat/<isa>/base.odex
See also the corresponding change in platform/build and
platform/frameworks/native.
Bug: 19550105
Change-Id: I4c6be4f0c41ff175904846db8e360c4af815b265
diff --git a/runtime/oat_file_assistant.cc b/runtime/oat_file_assistant.cc
index 9a17b01..d92f59b 100644
--- a/runtime/oat_file_assistant.cc
+++ b/runtime/oat_file_assistant.cc
@@ -737,18 +737,19 @@
CHECK(error_msg != nullptr);
// The odex file name is formed by replacing the dex_location extension with
- // .odex and inserting an isa directory. For example:
+ // .odex and inserting an oat/<isa> directory. For example:
// location = /foo/bar/baz.jar
- // odex_location = /foo/bar/<isa>/baz.odex
+ // odex_location = /foo/bar/oat/<isa>/baz.odex
- // Find the directory portion of the dex location and add the isa directory.
+ // Find the directory portion of the dex location and add the oat/<isa>
+ // directory.
size_t pos = location.rfind('/');
if (pos == std::string::npos) {
*error_msg = "Dex location " + location + " has no directory.";
return false;
}
std::string dir = location.substr(0, pos+1);
- dir += std::string(GetInstructionSetString(isa));
+ dir += "oat/" + std::string(GetInstructionSetString(isa));
// Find the file portion of the dex location.
std::string file;