Commit 945e3cf0 authored by Trevor Perrier's avatar Trevor Perrier Committed by Commit Bot

[Android] Add logging before SplitCompat.installActivity

This CL logs the installed languages before and after
SplitCompat.installActivity.  This will help in understanding when
different language packs become available.

Bug: 1128698
Change-Id: I52d2efbcc870f1b76b766896fd0d22c0d720031f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2461696Reviewed-by: default avatarMegan Jablonski <megjablon@chromium.org>
Commit-Queue: Trevor  Perrier <perrier@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816051}
parent 25d85d5e
...@@ -81,9 +81,10 @@ public class AppLocaleUtils { ...@@ -81,9 +81,10 @@ public class AppLocaleUtils {
if (GlobalAppLocaleController.getInstance().isOverridden() && BundleUtils.isBundle()) { if (GlobalAppLocaleController.getInstance().isOverridden() && BundleUtils.isBundle()) {
Log.i(TAG, "maybeInstallActivitySplit isOverridden: %s isBundle: %s", Log.i(TAG, "maybeInstallActivitySplit isOverridden: %s isBundle: %s",
GlobalAppLocaleController.getInstance().isOverridden(), BundleUtils.isBundle()); GlobalAppLocaleController.getInstance().isOverridden(), BundleUtils.isBundle());
SplitCompat.installActivity(context);
Log.i(TAG, "Override Locale: %s", getAppLanguagePref()); Log.i(TAG, "Override Locale: %s", getAppLanguagePref());
logInstalledLanguages(); logInstalledLanguages(context);
SplitCompat.installActivity(context);
logInstalledLanguages(context);
} }
} }
...@@ -102,17 +103,15 @@ public class AppLocaleUtils { ...@@ -102,17 +103,15 @@ public class AppLocaleUtils {
.build(); .build();
splitInstallManager.startInstall(installRequest); splitInstallManager.startInstall(installRequest);
} }
logInstalledLanguages();
} }
/** /**
* Log list of installed languages * Log list of installed languages for context.
* @param context Context to log installed languages on.
*/ */
private static void logInstalledLanguages() { private static void logInstalledLanguages(Context context) {
if (BundleUtils.isBundle()) { if (BundleUtils.isBundle()) {
SplitInstallManager splitInstallManager = SplitInstallManager splitInstallManager = SplitInstallManagerFactory.create(context);
SplitInstallManagerFactory.create(ContextUtils.getApplicationContext());
Log.i(TAG, "Installed Languages: %s", Log.i(TAG, "Installed Languages: %s",
TextUtils.join(", ", splitInstallManager.getInstalledLanguages())); TextUtils.join(", ", splitInstallManager.getInstalledLanguages()));
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment