From 319279c8e0e6f00a34e433d4e8f3d0a39335104d Mon Sep 17 00:00:00 2001 From: Josh Hou Date: Wed, 10 May 2023 06:45:27 +0000 Subject: [PATCH] [Panlingual] Add the doc link and remove TODO description 1. Add the doc link for dynamic locales 2. Remove TODO description 3. Disable the debug logs Bug: 248446474 Test: Manual test Change-Id: I1920c87f720ed69e187774d8e32f068113d2757d --- core/java/android/app/LocaleConfig.java | 2 +- core/java/android/app/LocaleManager.java | 11 ++++++----- .../android/server/locales/LocaleManagerService.java | 7 ++----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/core/java/android/app/LocaleConfig.java b/core/java/android/app/LocaleConfig.java index 97cc706fbab66..5031a338520a0 100644 --- a/core/java/android/app/LocaleConfig.java +++ b/core/java/android/app/LocaleConfig.java @@ -161,7 +161,7 @@ public class LocaleConfig implements Parcelable { *

Note: The creation of this LocaleConfig does not automatically mean it will * become the override config for an application. Any LocaleConfig desired to be the override * must be passed into the {@link LocaleManager#setOverrideLocaleConfig(LocaleConfig)}, - * otherwise it will not persist or affect the system’s understanding of app-supported + * otherwise it will not persist or affect the system's understanding of app-supported * resources. * * @param locales the desired locales for a specified application diff --git a/core/java/android/app/LocaleManager.java b/core/java/android/app/LocaleManager.java index bb9a95c03ba5b..e865af789b152 100644 --- a/core/java/android/app/LocaleManager.java +++ b/core/java/android/app/LocaleManager.java @@ -194,18 +194,19 @@ public class LocaleManager { *

Note: Only the app itself with the same user can override its own LocaleConfig. * *

Note: This function takes in a {@link LocaleConfig} which is intended to - * override the original config in the application’s resources. This LocaleConfig will become - * the override config, and stored in a system file for future access. + * override the original config in the application's resources. This LocaleConfig will + * become the override config, and stored in a system file for future access. * *

Note: Using this function, applications can update their list of supported - * locales while running, without an update of the application’s software. + * locales while running, without an update of the application's software. For more + * information, see the section on + * dynamic updates for an app's localeConfig. * *

Applications can remove the override LocaleConfig with a {@code null} object. * * @param localeConfig the desired {@link LocaleConfig} for the calling app. */ - // Add following to last Note: when guide is written: - // For more information, see TODO(b/261528306): add link to guide. @UserHandleAware public void setOverrideLocaleConfig(@Nullable LocaleConfig localeConfig) { try { diff --git a/services/core/java/com/android/server/locales/LocaleManagerService.java b/services/core/java/com/android/server/locales/LocaleManagerService.java index 2d4066144a7f6..d4578dc1f74af 100644 --- a/services/core/java/com/android/server/locales/LocaleManagerService.java +++ b/services/core/java/com/android/server/locales/LocaleManagerService.java @@ -103,8 +103,8 @@ public class LocaleManagerService extends SystemService { private final PackageMonitor mPackageMonitor; private final Object mWriteLock = new Object(); - // TODO(b/262713398): Set to false when stable - public static final boolean DEBUG = true; + + public static final boolean DEBUG = false; public LocaleManagerService(Context context) { super(context); @@ -565,7 +565,6 @@ public class LocaleManagerService extends SystemService { */ public void setOverrideLocaleConfig(@NonNull String appPackageName, @UserIdInt int userId, @Nullable LocaleConfig localeConfig) throws IllegalArgumentException { - // TODO(b/262713398): Remove when stable if (!SystemProperties.getBoolean(PROP_DYNAMIC_LOCALES_CHANGE, true)) { return; } @@ -747,7 +746,6 @@ public class LocaleManagerService extends SystemService { @Nullable public LocaleConfig getOverrideLocaleConfig(@NonNull String appPackageName, @UserIdInt int userId) { - // TODO(b/262713398): Remove when stable if (!SystemProperties.getBoolean(PROP_DYNAMIC_LOCALES_CHANGE, true)) { return null; } @@ -850,7 +848,6 @@ public class LocaleManagerService extends SystemService { @NonNull private File getXmlFileNameForUser(@NonNull String appPackageName, @UserIdInt int userId) { - // TODO(b/262752965): use per-package data directory final File dir = new File(Environment.getDataSystemCeDirectory(userId), LOCALE_CONFIGS); return new File(dir, appPackageName + SUFFIX_FILE_NAME); }