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

Side by Side Diff: base/android/java/src/org/chromium/base/BuildInfo.java

Issue 1965953002: 🌒 Remove support for split apks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « base/android/build_info.cc ('k') | base/android/java/src/org/chromium/base/PackageUtils.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
8 import android.content.Context; 7 import android.content.Context;
9 import android.content.pm.ApplicationInfo; 8 import android.content.pm.ApplicationInfo;
10 import android.content.pm.PackageInfo; 9 import android.content.pm.PackageInfo;
11 import android.content.pm.PackageManager; 10 import android.content.pm.PackageManager;
12 import android.content.pm.PackageManager.NameNotFoundException; 11 import android.content.pm.PackageManager.NameNotFoundException;
13 import android.os.Build; 12 import android.os.Build;
14 import android.util.Log; 13 import android.util.Log;
15 14
16 import org.chromium.base.annotations.CalledByNative; 15 import org.chromium.base.annotations.CalledByNative;
17 16
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 125
127 @CalledByNative 126 @CalledByNative
128 public static int getSdkInt() { 127 public static int getSdkInt() {
129 return Build.VERSION.SDK_INT; 128 return Build.VERSION.SDK_INT;
130 } 129 }
131 130
132 private static boolean isLanguageSplit(String splitName) { 131 private static boolean isLanguageSplit(String splitName) {
133 // Names look like "config.XX". 132 // Names look like "config.XX".
134 return splitName.length() == 9 && splitName.startsWith("config."); 133 return splitName.length() == 9 && splitName.startsWith("config.");
135 } 134 }
136
137 @TargetApi(Build.VERSION_CODES.LOLLIPOP)
138 @CalledByNative
139 public static boolean hasLanguageApkSplits(Context context) {
140 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
141 return false;
142 }
143 PackageInfo packageInfo = PackageUtils.getOwnPackageInfo(context);
144 if (packageInfo.splitNames != null) {
145 for (int i = 0; i < packageInfo.splitNames.length; ++i) {
146 if (isLanguageSplit(packageInfo.splitNames[i])) {
147 return true;
148 }
149 }
150 }
151 return false;
152 }
153 } 135 }
OLDNEW
« no previous file with comments | « base/android/build_info.cc ('k') | base/android/java/src/org/chromium/base/PackageUtils.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698