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

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

Issue 1187433006: Load language .pak files directly from the apk when using splits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@locale-res-or-file
Patch Set: Fix ui_base_unittest failure (allow locale paks to be loaded multiple times) Created 5 years, 6 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
Index: base/android/java/src/org/chromium/base/BuildInfo.java
diff --git a/base/android/java/src/org/chromium/base/BuildInfo.java b/base/android/java/src/org/chromium/base/BuildInfo.java
index ce262f41d2ee4a2dd141c91d794ce8a132d6b202..215ee37452c96b9b550d83f8eb68b9647cd21376 100644
--- a/base/android/java/src/org/chromium/base/BuildInfo.java
+++ b/base/android/java/src/org/chromium/base/BuildInfo.java
@@ -4,6 +4,7 @@
package org.chromium.base;
+import android.annotation.TargetApi;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
@@ -132,4 +133,14 @@ public class BuildInfo {
return Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1
|| TextUtils.equals("MNC", Build.VERSION.CODENAME);
}
+
+ @TargetApi(Build.VERSION_CODES.LOLLIPOP)
+ @CalledByNative
+ public static boolean hasApkSplits(Context context) {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
+ return false;
+ }
+ ApplicationInfo appInfo = context.getApplicationInfo();
+ return appInfo.splitSourceDirs != null && appInfo.splitSourceDirs.length > 0;
+ }
}
« no previous file with comments | « base/android/build_info.cc ('k') | chrome/android/java/src/org/chromium/chrome/browser/ChromeMobileApplication.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698