From 4aee00f85eca7b64c0e9557930cf2a101fab5c22 Mon Sep 17 00:00:00 2001 From: Pratyush More Date: Mon, 28 Mar 2022 16:59:41 +0000 Subject: [PATCH] Enhance Javadoc for LocaleManager#setApplicationLocales. This is being done in response to developer feedback. See the attached bug for more info. Bug: 226407732 Test: Javadoc change Change-Id: I4e15e75db695eec650836da17074b1a2aae0fd5d --- core/java/android/app/LocaleManager.java | 28 ++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/core/java/android/app/LocaleManager.java b/core/java/android/app/LocaleManager.java index efe9e35d4c64a..794c6946f7a86 100644 --- a/core/java/android/app/LocaleManager.java +++ b/core/java/android/app/LocaleManager.java @@ -54,8 +54,18 @@ public class LocaleManager { * *

Pass a {@link LocaleList#getEmptyLocaleList()} to reset to the system locale. * - *

Note: The set locales are persisted; they are backed up if the user has enabled - * Backup & Restore. + *

Note: Changes to app locales will result in a configuration change (and potentially + * an Activity lifecycle event) being applied to the calling application. For more information, + * see the section on + * handling configuration changes. The set locales are persisted; they are backed up if the + * user has enabled Backup & Restore. + * + *

Note: Users' locale preferences are passed to applications by creating a union of + * any app-specific locales and system locales, with the app-specific locales appearing first. + * Language resources are then chosen per usual (as described in the section on + * locale resolution). * * @param locales the desired locales for the calling app. */ @@ -69,8 +79,18 @@ public class LocaleManager { * *

Pass a {@link LocaleList#getEmptyLocaleList()} to reset to the system locale. * - *

Note: The set locales are persisted; they are backed up if the user has enabled - * Backup & Restore. + *

Note: Changes to app locales will result in a configuration change (and potentially + * an Activity lifecycle event) being applied to the specified application. For more + * information, see the section on + * handling configuration changes. The set locales are persisted; they are backed up if the + * user has enabled Backup & Restore. + * + *

Note: Users' locale preferences are passed to applications by creating a union of + * any app-specific locales and system locales, with the app-specific locales appearing first. + * Language resources are then chosen per usual (as described in the section on + * locale resolution). * * @param appPackageName the package name of the app for which to set the locales. * @param locales the desired locales for the specified app.