Android-x86
Fork
Spenden

  • R/O
  • HTTP
  • SSH
  • HTTPS

system-extras: Commit

system/extras


Commit MetaInfo

Revisionc3728ab933091558d3ba1cbdd78c8120849ebfdc (tree)
Zeit2019-04-10 05:04:48
AutorAlex Light <allight@goog...>
CommiterAlex Light

Log Message

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)

Ändern Zusammenfassung

Diff

--- a/preopt2cachename/preopt2cachename.cpp
+++ b/preopt2cachename/preopt2cachename.cpp
@@ -28,16 +28,16 @@ static const char* kOdexCacheSuffix = "@classes.dex";
2828 static const char* kVdexCacheSuffix = "@classes.vdex";
2929 static const char* kArtCacheSuffix = "@classes.art";
3030
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.
3434 static std::string ExtractISA(const std::string& file_location) {
3535 std::vector<std::string> split_file_location = android::base::Split(file_location, "/");
3636 if (split_file_location.size() <= 1) {
3737 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;
4141 }
4242 return split_file_location[split_file_location.size() - 2];
4343 }
Show on old repository browser