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

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

Issue 1227793002: Change BuildInfo.hasApkSplits -> BuildInfo.hasLanguageApkSplits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 215ee37452c96b9b550d83f8eb68b9647cd21376..c6d248d4a3c59353365a95167e163296c23f900a 100644
--- a/base/android/java/src/org/chromium/base/BuildInfo.java
+++ b/base/android/java/src/org/chromium/base/BuildInfo.java
@@ -134,13 +134,25 @@ public class BuildInfo {
|| TextUtils.equals("MNC", Build.VERSION.CODENAME);
}
+ private static boolean isLanguageSplit(String splitName) {
+ // Names look like "config.XX".
+ return splitName.length() == 9 && splitName.startsWith("config.");
Yaron 2015/07/08 21:31:22 we control the split name, don't we? can we make i
agrieve 2015/07/09 00:11:30 Yeah, I don't love this either, but we don't contr
+ }
+
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@CalledByNative
- public static boolean hasApkSplits(Context context) {
+ public static boolean hasLanguageApkSplits(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;
+ PackageInfo packageInfo = PackageUtils.getOwnPackageInfo(context);
+ if (packageInfo.splitNames != null) {
+ for (int i = 0; i < packageInfo.splitNames.length; ++i) {
+ if (isLanguageSplit(packageInfo.splitNames[i])) {
+ return true;
+ }
+ }
+ }
+ return false;
}
}
« no previous file with comments | « base/android/build_info.cc ('k') | chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698