Index: mojo/runner/android/apk/src/org/chromium/mojo/shell/ShellMain.java |
diff --git a/mojo/runner/android/apk/src/org/chromium/mojo/shell/ShellMain.java b/mojo/runner/android/apk/src/org/chromium/mojo/shell/ShellMain.java |
index 46af7465ca152e7074d376cfad5115a2ab511bbe..4af0974752189458820a133dea7b574a183adcb9 100644 |
--- a/mojo/runner/android/apk/src/org/chromium/mojo/shell/ShellMain.java |
+++ b/mojo/runner/android/apk/src/org/chromium/mojo/shell/ShellMain.java |
@@ -27,7 +27,8 @@ import java.util.List; |
public class ShellMain { |
private static final String TAG = "ShellMain"; |
- // Directory where applications bundled with the shell will be extracted. |
+ // Directory where applications cached with the shell will be extracted. |
+ // TODO(sky): rename this to CACHED_APP_DIRECTORY. |
private static final String LOCAL_APP_DIRECTORY = "local_apps"; |
// The mojo_shell library is also an executable run in forked processes when running |
// multi-process. |
@@ -72,9 +73,13 @@ public class ShellMain { |
if (sInitialized) return; |
File localAppsDir = getLocalAppsDir(applicationContext); |
try { |
+ final File timestamp = |
+ FileHelper.prepareDirectoryForAssets(applicationContext, localAppsDir); |
for (String assetPath : getAssetsList(applicationContext)) { |
- FileHelper.extractFromAssets(applicationContext, assetPath, localAppsDir, false); |
+ FileHelper.extractFromAssets( |
+ applicationContext, assetPath, localAppsDir, FileHelper.FileType.PERMANENT); |
} |
+ FileHelper.createTimestampIfNecessary(timestamp); |
File mojoShell = new File(applicationContext.getApplicationInfo().nativeLibraryDir, |
MOJO_SHELL_EXECUTABLE); |
@@ -111,7 +116,7 @@ public class ShellMain { |
nativeAddApplicationURL(url); |
} |
- private static File getLocalAppsDir(Context context) { |
+ static File getLocalAppsDir(Context context) { |
return context.getDir(LOCAL_APP_DIRECTORY, Context.MODE_PRIVATE); |
} |
@@ -128,7 +133,7 @@ public class ShellMain { |
* Initializes the native system. This API should be called only once per process. |
**/ |
private static native void nativeInit(Context context, String mojoShellPath, |
- String[] parameters, String bundledAppsDirectory, String tmpDir); |
+ String[] parameters, String cachedAppsDirectory, String tmpDir); |
private static native boolean nativeStart(); |