Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(802)

Unified Diff: base/android/java/src/org/chromium/base/ResourceExtractor.java

Issue 2396073002: Store only locale paks rather than all assets within BuildConfig.java (Closed)
Patch Set: remove unused constant Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/android/java/templates/BuildConfig.template » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/ResourceExtractor.java
diff --git a/base/android/java/src/org/chromium/base/ResourceExtractor.java b/base/android/java/src/org/chromium/base/ResourceExtractor.java
index 9e7adf29d2e39f58cda629a21cf74332b120884c..6de87fe3e18d383f616e46d256bbc06b95692918 100644
--- a/base/android/java/src/org/chromium/base/ResourceExtractor.java
+++ b/base/android/java/src/org/chromium/base/ResourceExtractor.java
@@ -172,23 +172,14 @@ public class ResourceExtractor {
return sInstance;
}
- private static boolean isPakFileForLanguage(String pakFileName, String language) {
- if (pakFileName.length() <= language.length() || !pakFileName.startsWith(language)) {
- return false;
- }
- char c = pakFileName.charAt(language.length());
- return c == '.' || c == '-';
- }
-
private static String[] detectFilesToExtract() {
String language = LocaleUtils.getLanguage(Locale.getDefault());
// Currenty (Oct 2016), this array can be as big as 4 entries, so using a capacity
// that allows a bit of growth, but is still in the right ballpark..
ArrayList<String> activeLocalePakFiles = new ArrayList<String>(6);
- for (String pakFileName : BuildConfig.COMPRESSED_ASSETS) {
- if (isPakFileForLanguage(pakFileName, language)
- || isPakFileForLanguage(pakFileName, FALLBACK_LOCALE)) {
- activeLocalePakFiles.add(pakFileName);
+ for (String locale : BuildConfig.COMPRESSED_LOCALES) {
+ if (locale.startsWith(language)) {
+ activeLocalePakFiles.add(locale + ".pak");
}
}
return activeLocalePakFiles.toArray(new String[activeLocalePakFiles.size()]);
« no previous file with comments | « no previous file | base/android/java/templates/BuildConfig.template » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698