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

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

Issue 2837123003: Revert of [Android] Enable multidex for release builds of chrome_public_test_apk. (Closed)
Patch Set: Created 3 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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.multidex; 5 package org.chromium.base.multidex;
6 6
7 import android.app.ActivityManager; 7 import android.app.ActivityManager;
8 import android.app.ActivityManager.RunningAppProcessInfo; 8 import android.app.ActivityManager.RunningAppProcessInfo;
9 import android.content.Context; 9 import android.content.Context;
10 import android.content.pm.ApplicationInfo; 10 import android.content.pm.ApplicationInfo;
11 import android.content.pm.PackageManager; 11 import android.content.pm.PackageManager;
12 import android.os.Build; 12 import android.os.Build;
13 import android.support.multidex.MultiDex; 13 import android.support.multidex.MultiDex;
14 14
15 import org.chromium.base.BuildConfig;
15 import org.chromium.base.Log; 16 import org.chromium.base.Log;
16 import org.chromium.base.VisibleForTesting; 17 import org.chromium.base.VisibleForTesting;
17 18
18 import java.lang.reflect.InvocationTargetException; 19 import java.lang.reflect.InvocationTargetException;
19 import java.lang.reflect.Method; 20 import java.lang.reflect.Method;
20 21
21 /** 22 /**
22 * Performs multidex installation for non-isolated processes. 23 * Performs multidex installation for non-isolated processes.
23 */ 24 */
24 public class ChromiumMultiDexInstaller { 25 public class ChromiumMultiDexInstaller {
(...skipping 15 matching lines...) Expand all
40 * In release builds of app apks (as opposed to test apks), this is a no-op because: 41 * In release builds of app apks (as opposed to test apks), this is a no-op because:
41 * - multidex isn't necessary in release builds because we run proguard t here and 42 * - multidex isn't necessary in release builds because we run proguard t here and
42 * thus aren't threatening to hit the dex limit; and 43 * thus aren't threatening to hit the dex limit; and
43 * - calling MultiDex.install, even in the absence of secondary dexes, ca uses a 44 * - calling MultiDex.install, even in the absence of secondary dexes, ca uses a
44 * significant regression in start-up time (crbug.com/525695). 45 * significant regression in start-up time (crbug.com/525695).
45 * 46 *
46 * @param context The application context. 47 * @param context The application context.
47 */ 48 */
48 @VisibleForTesting 49 @VisibleForTesting
49 public static void install(Context context) { 50 public static void install(Context context) {
51 if (!BuildConfig.isMultidexEnabled()) return;
52
50 // TODO(jbudorick): Back out this version check once support for K & bel ow works. 53 // TODO(jbudorick): Back out this version check once support for K & bel ow works.
51 // http://crbug.com/512357 54 // http://crbug.com/512357
52 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP 55 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP
53 && !shouldInstallMultiDex(context)) { 56 && !shouldInstallMultiDex(context)) {
54 Log.i(TAG, "Skipping multidex installation: not needed for process." ); 57 Log.i(TAG, "Skipping multidex installation: not needed for process." );
55 } else { 58 } else {
56 MultiDex.install(context); 59 MultiDex.install(context);
57 Log.i(TAG, "Completed multidex installation."); 60 Log.i(TAG, "Completed multidex installation.");
58 } 61 }
59 } 62 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 ApplicationInfo appInfo = packageManager.getApplicationInfo(context. getPackageName(), 106 ApplicationInfo appInfo = packageManager.getApplicationInfo(context. getPackageName(),
104 PackageManager.GET_META_DATA); 107 PackageManager.GET_META_DATA);
105 if (appInfo == null || appInfo.metaData == null) return true; 108 if (appInfo == null || appInfo.metaData == null) return true;
106 return !appInfo.metaData.getBoolean(currentProcessName + IGNORE_MULT IDEX_KEY, false); 109 return !appInfo.metaData.getBoolean(currentProcessName + IGNORE_MULT IDEX_KEY, false);
107 } catch (PackageManager.NameNotFoundException e) { 110 } catch (PackageManager.NameNotFoundException e) {
108 return true; 111 return true;
109 } 112 }
110 } 113 }
111 114
112 } 115 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698