From 4963dfe61295e1eed947956c689a70a34526997c Mon Sep 17 00:00:00 2001 From: Seigo Nonaka Date: Thu, 31 Mar 2016 20:50:21 +0900 Subject: [PATCH] Fix incorrect boot time locale. To show the localized message, MountManager keeps the last set locale string in the crypto header and set it at the very early boot stage. However by my change[1], the locale information is stored in Settings not in ICU. It is not available before decrypting the data directory. So, when ActivityManagerService obtains the configuration by Settings.System.getConfiguration, the locale set by MountManager will be overwritten by empty locale list, then always English message is shown as the result of fallback. To fix this issue, need to call updatePersistentConfiguration instead of updtaeConfiguration to write the configuration value to the Settings. Calling updatePersistentConfiguration is safe since this value won't be used after boot. [1] If57e13cc4179ff6299c71b4ab030f9d856748dea Bug: 27507829 Change-Id: Icdffd88d41fc134b6f9b4cd1bc4c77db655b1477 --- services/core/java/com/android/server/MountService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java index 994e1d0dbfd91..c9722a5282ccc 100644 --- a/services/core/java/com/android/server/MountService.java +++ b/services/core/java/com/android/server/MountService.java @@ -1010,7 +1010,7 @@ class MountService extends IMountService.Stub Configuration config = new Configuration(); config.setLocale(locale); try { - ActivityManagerNative.getDefault().updateConfiguration(config); + ActivityManagerNative.getDefault().updatePersistentConfiguration(config); } catch (RemoteException e) { Slog.e(TAG, "Error setting system locale from mount service", e); }