diff options
| author | 2015-02-12 17:50:24 +0000 | |
|---|---|---|
| committer | 2015-02-13 12:01:46 +0000 | |
| commit | 5bb57e8543b0da2959a7744ed8aa957d12c635ce (patch) | |
| tree | d20e6cb7c1aa0a3d26b56bb82145471322ab2588 | |
| parent | f129af204cd29801483e12887c5e10032292cc76 (diff) | |
Remove code that sets user.* system properties.
This has been disallowed by the SELinux for several years now,
so can safely be removed. Given that saveLocaleLocked is
simplified quite a bit, we can now inline into its only caller.
bug: 18910417
(cherry picked from commit 70e8f6600de8a2b9cbb17cd919b14a4609fc68bd)
Change-Id: Ib2888ea22ffca6f4b402efd5780f89c924cd1570
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index a4377616c1c5..c4718b8d4071 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -16275,10 +16275,11 @@ public final class ActivityManagerService extends ActivityManagerNative EventLog.writeEvent(EventLogTags.CONFIGURATION_CHANGED, changes); - if (values.locale != null && !initLocale) { - saveLocaleLocked(values.locale, - !values.locale.equals(mConfiguration.locale), - values.userSetLocale); + if (!initLocale && values.locale != null && values.userSetLocale) { + final String languageTag = values.locale.toLanguageTag(); + SystemProperties.set("persist.sys.locale", languageTag); + mHandler.sendMessage(mHandler.obtainMessage(SEND_LOCALE_TO_MOUNT_DAEMON_MSG, + values.locale)); } mConfigurationSeq++; @@ -16385,27 +16386,6 @@ public final class ActivityManagerService extends ActivityManagerNative && config.navigation == Configuration.NAVIGATION_NONAV); } - /** - * Save the locale. You must be inside a synchronized (this) block. - */ - private void saveLocaleLocked(Locale l, boolean isDiff, boolean isPersist) { - final String languageTag = l.toLanguageTag(); - if (isDiff) { - SystemProperties.set("user.locale", languageTag); - - // TODO: Who uses these ? There are no references to these system - // properties in documents or code. Did the author intend to call - // System.setProperty() instead ? Even that wouldn't have any effect. - SystemProperties.set("user.language", l.getLanguage()); - SystemProperties.set("user.region", l.getCountry()); - } - - if (isPersist) { - SystemProperties.set("persist.sys.locale", languageTag); - mHandler.sendMessage(mHandler.obtainMessage(SEND_LOCALE_TO_MOUNT_DAEMON_MSG, l)); - } - } - @Override public boolean shouldUpRecreateTask(IBinder token, String destAffinity) { synchronized (this) { |