[Android] Add gn support for multidex.

BUG=272790

Review URL: https://codereview.chromium.org/1451483002

Cr-Commit-Position: refs/heads/master@{#360943}


CrOS-Libchrome-Original-Commit: e6361975d7f7f4c434dc3380a3824b9d5e323d20
diff --git a/base/android/java/templates/ChromiumMultiDex.template b/base/android/java/templates/ChromiumMultiDex.template
index 18b3c77..5761a45 100644
--- a/base/android/java/templates/ChromiumMultiDex.template
+++ b/base/android/java/templates/ChromiumMultiDex.template
@@ -22,15 +22,21 @@
     private static final String TAG = "base_multidex";
 
     /**
-     *  Installs secondary dexes if possible.
+     *  Installs secondary dexes if possible/necessary.
      *
      *  Isolated processes (e.g. renderer processes) can't load secondary dex files on
      *  K and below, so we don't even try in that case.
      *
+     *  In release builds, this is a no-op because:
+     *    - multidex isn't necessary in release builds because we run proguard there and
+     *      thus aren't threatening to hit the dex limit; and
+     *    - calling MultiDex.install, even in the absence of secondary dexes, causes a
+     *      significant regression in start-up time (crbug.com/525695).
+     *
      *  @param context The application context.
      */
     @VisibleForTesting
-#if defined(CONFIGURATION_NAME_Debug)
+#if defined(MULTIDEX_CONFIGURATION_Debug)
     public static void install(Context context) {
         try {
             // TODO(jbudorick): Back out this version check once support for K & below works.