diff options
| author | 2016-02-22 11:41:59 +0000 | |
|---|---|---|
| committer | 2016-02-22 11:42:02 +0000 | |
| commit | 30eb5b30e7bf88fbd3397cb56cda854293ae9c4d (patch) | |
| tree | f37929d1a0d01752ee3387a1f420fc3a0d97d29c | |
| parent | 280c5b2155feae857ad514dff81adbfe73e398e9 (diff) | |
| parent | d96d2ddc23736070b2e47eae1629d210a16bc1c7 (diff) | |
Merge "Change the location of profile files." into nyc-dev
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 04883a961286..02b94de92509 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -4774,6 +4774,12 @@ public final class ActivityThread { } } + // Keep in sync with installd (frameworks/native/cmds/installd/commands.cpp). + private static File getPrimaryProfileFile(String packageName) { + return new File("/data/misc/profiles/cur/" + UserHandle.myUserId() + + "/" + packageName + "/primary.prof"); + } + private static void setupJitProfileSupport(LoadedApk loadedApk, File cacheDir) { if (!SystemProperties.getBoolean("dalvik.vm.usejitprofiles", false)) { return; @@ -4793,10 +4799,7 @@ public final class ActivityThread { return; } - // Add an extension to the file name to better reveal its intended use. - // Keep in sync with BackgroundDexOptService. - final String profileExtension = ".prof"; - final File profileFile = new File(cacheDir, loadedApk.mPackageName + profileExtension); + final File profileFile = getPrimaryProfileFile(loadedApk.mPackageName); if (!profileFile.exists()) { FileDescriptor fd = null; try { @@ -4805,7 +4808,7 @@ public final class ActivityThread { Os.fchmod(fd, permissions); Os.fchown(fd, appInfo.uid, appInfo.uid); } catch (ErrnoException e) { - Log.w(TAG, "Unable to create jit profile file " + profileFile, e); + Log.v(TAG, "Unable to create jit profile file " + profileFile, e); try { Os.unlink(profileFile.getAbsolutePath()); } catch (ErrnoException unlinkErr) { |