system/extras
Revision | c3728ab933091558d3ba1cbdd78c8120849ebfdc (tree) |
---|---|
Zeit | 2019-04-10 05:04:48 |
Autor | Alex Light <allight@goog...> |
Commiter | Alex Light |
Change warning logic in preopt2cachename
We were incorrectly warning when a filename had 8 segments. This is
valid since we can have paths of the form
'/postinstall/product/priv-app/<app>/oat/arm64/<app>.odex' in addition
to those of the form
'/postinstall/priv-app/<app>/oat/arm64/<app>.odex'.
Test: boot, look at logcat
Bug: 123696019
Change-Id: I97c88302a3967e133421244bb132b4e8fd0812a1
(cherry picked from commit 73befcf4495616129ce484e5124e05b85277192e)
@@ -28,16 +28,16 @@ static const char* kOdexCacheSuffix = "@classes.dex"; | ||
28 | 28 | static const char* kVdexCacheSuffix = "@classes.vdex"; |
29 | 29 | static const char* kArtCacheSuffix = "@classes.art"; |
30 | 30 | |
31 | -// Returns the ISA extracted from the file_location. | |
32 | -// file_location is formatted like /system/app/<app_name>/oat/<isa>/<app_name>.{odex,vdex} | |
33 | -// for all functions. We return an empty string "" in error cases. | |
31 | +// Returns the ISA extracted from the file_location. file_location is formatted like | |
32 | +// /system{/product,}/{priv-,}app/<app_name>/oat/<isa>/<app_name>.{odex,vdex} for all functions. We | |
33 | +// return an empty string "" in error cases. | |
34 | 34 | static std::string ExtractISA(const std::string& file_location) { |
35 | 35 | std::vector<std::string> split_file_location = android::base::Split(file_location, "/"); |
36 | 36 | if (split_file_location.size() <= 1) { |
37 | 37 | return ""; |
38 | - } else if (split_file_location.size() != 7) { | |
39 | - LOG(WARNING) << "Unexpected length for file-location. We expected 7 segments but found " | |
40 | - << split_file_location.size(); | |
38 | + } else if (split_file_location.size() != 7 && split_file_location.size() != 8) { | |
39 | + LOG(WARNING) << "Unexpected length for file-location. We expected 7 or 8 segments but found " | |
40 | + << split_file_location.size() << " for " << file_location; | |
41 | 41 | } |
42 | 42 | return split_file_location[split_file_location.size() - 2]; |
43 | 43 | } |