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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.base; 5 package org.chromium.base;
6 6
7 import android.annotation.TargetApi;
7 import android.content.Context; 8 import android.content.Context;
8 import android.content.pm.ApplicationInfo; 9 import android.content.pm.ApplicationInfo;
9 import android.content.pm.PackageInfo; 10 import android.content.pm.PackageInfo;
10 import android.content.pm.PackageManager; 11 import android.content.pm.PackageManager;
11 import android.content.pm.PackageManager.NameNotFoundException; 12 import android.content.pm.PackageManager.NameNotFoundException;
12 import android.os.Build; 13 import android.os.Build;
13 import android.text.TextUtils; 14 import android.text.TextUtils;
14 import android.util.Log; 15 import android.util.Log;
15 16
16 /** 17 /**
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 126 }
126 127
127 /** 128 /**
128 * @return Whether the Android build is M or later. 129 * @return Whether the Android build is M or later.
129 */ 130 */
130 public static boolean isMncOrLater() { 131 public static boolean isMncOrLater() {
131 // TODO(bauerb): Update this once the SDK is updated. 132 // TODO(bauerb): Update this once the SDK is updated.
132 return Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1 133 return Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1
133 || TextUtils.equals("MNC", Build.VERSION.CODENAME); 134 || TextUtils.equals("MNC", Build.VERSION.CODENAME);
134 } 135 }
136
137 @TargetApi(Build.VERSION_CODES.LOLLIPOP)
138 @CalledByNative
139 public static boolean hasApkSplits(Context context) {
140 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
141 return false;
142 }
143 ApplicationInfo appInfo = context.getApplicationInfo();
144 return appInfo.splitSourceDirs != null && appInfo.splitSourceDirs.length > 0;
145 }
135 } 146 }
OLDNEW
« 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