diff options
author | 2017-11-14 02:54:59 +0000 | |
---|---|---|
committer | 2017-11-14 02:54:59 +0000 | |
commit | f7f5732e2c33677ef701194f5051805762e99fe8 (patch) | |
tree | e2633031b3dfebe7b0fe4c4c93e382ad5fae76f4 | |
parent | 62893396bdbea6986c5a468d9a854cd58f34ce1e (diff) | |
parent | d35451d76b6bdc960881f1325f8b06c2d41e287e (diff) |
Merge "Create secondary dex profiles relative to the provided dex path"
-rw-r--r-- | core/java/android/app/DexLoadReporter.java | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/core/java/android/app/DexLoadReporter.java b/core/java/android/app/DexLoadReporter.java index d15dd6d71f94..01c045b2d816 100644 --- a/core/java/android/app/DexLoadReporter.java +++ b/core/java/android/app/DexLoadReporter.java @@ -19,7 +19,6 @@ package android.app; import android.os.FileUtils; import android.os.RemoteException; import android.os.SystemProperties; -import android.system.ErrnoException; import android.util.Slog; import com.android.internal.annotations.GuardedBy; @@ -27,8 +26,6 @@ import com.android.internal.annotations.GuardedBy; import dalvik.system.BaseDexClassLoader; import dalvik.system.VMRuntime; -import libcore.io.Libcore; - import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -156,23 +153,12 @@ import java.util.Set; return; } - File realDexPath; - try { - // Secondary dex profiles are stored in the oat directory, next to the real dex file - // and have the same name with 'cur.prof' appended. We use the realpath because that - // is what installd is using when processing the dex file. - // NOTE: Keep in sync with installd. - realDexPath = new File(Libcore.os.realpath(dexPath)); - } catch (ErrnoException ex) { - Slog.e(TAG, "Failed to get the real path of secondary dex " + dexPath - + ":" + ex.getMessage()); - // Do not continue with registration if we could not retrieve the real path. - return; - } - + // Secondary dex profiles are stored in the oat directory, next to dex file + // and have the same name with 'cur.prof' appended. // NOTE: Keep this in sync with installd expectations. - File secondaryProfileDir = new File(realDexPath.getParent(), "oat"); - File secondaryProfile = new File(secondaryProfileDir, realDexPath.getName() + ".cur.prof"); + File dexPathFile = new File(dexPath); + File secondaryProfileDir = new File(dexPathFile.getParent(), "oat"); + File secondaryProfile = new File(secondaryProfileDir, dexPathFile.getName() + ".cur.prof"); // Create the profile if not already there. // Returns true if the file was created, false if the file already exists. |