| Index: trunk/src/content/public/android/java/src/org/chromium/content/browser/ResourceExtractor.java
|
| ===================================================================
|
| --- trunk/src/content/public/android/java/src/org/chromium/content/browser/ResourceExtractor.java (revision 254018)
|
| +++ trunk/src/content/public/android/java/src/org/chromium/content/browser/ResourceExtractor.java (working copy)
|
| @@ -36,7 +36,6 @@
|
| private static final String LOGTAG = "ResourceExtractor";
|
| private static final String LAST_LANGUAGE = "Last language";
|
| private static final String PAK_FILENAMES = "Pak filenames";
|
| - private static final String ICU_DATA_FILENAME = "icudtl.dat";
|
|
|
| private static String[] sMandatoryPaks = null;
|
|
|
| @@ -97,7 +96,6 @@
|
| p.append(currentLanguage);
|
| p.append("(-\\w+)?\\.pak");
|
| }
|
| -
|
| Pattern paksToInstall = Pattern.compile(p.toString());
|
|
|
| AssetManager manager = mContext.getResources().getAssets();
|
| @@ -111,8 +109,7 @@
|
| if (!paksToInstall.matcher(file).matches()) {
|
| continue;
|
| }
|
| - boolean isICUData = file.equals(ICU_DATA_FILENAME);
|
| - File output = new File(isICUData ? mAppDataDir : mOutputDir, file);
|
| + File output = new File(mOutputDir, file);
|
| if (output.exists()) {
|
| continue;
|
| }
|
| @@ -138,12 +135,7 @@
|
| throw new IOException(file + " extracted with 0 length!");
|
| }
|
|
|
| - if (!isICUData) {
|
| - filenames.add(file);
|
| - } else {
|
| - // icudata needs to be accessed by a renderer process.
|
| - output.setReadable(true, false);
|
| - }
|
| + filenames.add(file);
|
| } finally {
|
| try {
|
| if (is != null) {
|
| @@ -231,7 +223,6 @@
|
|
|
| private final Context mContext;
|
| private ExtractTask mExtractTask;
|
| - private final File mAppDataDir;
|
| private final File mOutputDir;
|
|
|
| private static ResourceExtractor sInstance;
|
| @@ -272,7 +263,6 @@
|
|
|
| private ResourceExtractor(Context context) {
|
| mContext = context;
|
| - mAppDataDir = getAppDataDirFromContext(mContext);
|
| mOutputDir = getOutputDirFromContext(mContext);
|
| }
|
|
|
| @@ -313,32 +303,17 @@
|
| mExtractTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
| }
|
|
|
| - public static File getAppDataDirFromContext(Context context) {
|
| - return new File(PathUtils.getDataDirectory(context.getApplicationContext()));
|
| - }
|
| -
|
| public static File getOutputDirFromContext(Context context) {
|
| - return new File(getAppDataDirFromContext(context), "paks");
|
| + return new File(PathUtils.getDataDirectory(context.getApplicationContext()), "paks");
|
| }
|
|
|
| - /**
|
| - * Pak files (UI strings and other resources) should be updated along with
|
| - * Chrome. A version mismatch can lead to a rather broken user experience.
|
| - * The ICU data (icudtl.dat) is less version-sensitive, but still can
|
| - * lead to malfunction/UX misbehavior. So, we regard failing to update them
|
| - * as an error.
|
| - */
|
| public static void deleteFiles(Context context) {
|
| - File icudata = new File(getAppDataDirFromContext(context), ICU_DATA_FILENAME);
|
| - if (icudata.exists() && !icudata.delete()) {
|
| - Log.e(LOGTAG, "Unable to remove the icudata " + icudata.getName());
|
| - }
|
| File dir = getOutputDirFromContext(context);
|
| if (dir.exists()) {
|
| File[] files = dir.listFiles();
|
| for (File file : files) {
|
| if (!file.delete()) {
|
| - Log.e(LOGTAG, "Unable to remove existing resource " + file.getName());
|
| + Log.w(LOGTAG, "Unable to remove existing resource " + file.getName());
|
| }
|
| }
|
| }
|
|
|