From 543d3d24bdfcdcae94f6c63331ba77c00842d489 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Tue, 22 Apr 2014 09:19:39 -0700 Subject: [PATCH] Stop using Configuration.setLocale The call for method Configuration.setLocale that is introduce by If60877b29b should be remove to be compatible with API 14 and later. Bug: 14239862 Change-Id: I3815c2b56bd9c655b8bde6f93143adf3ff08c35d --- .../inputmethod/latin/utils/RunInLocale.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/utils/RunInLocale.java b/java/src/com/android/inputmethod/latin/utils/RunInLocale.java index 3c632bbc3..1ea16e6ef 100644 --- a/java/src/com/android/inputmethod/latin/utils/RunInLocale.java +++ b/java/src/com/android/inputmethod/latin/utils/RunInLocale.java @@ -35,18 +35,18 @@ public abstract class RunInLocale { */ public T runInLocale(final Resources res, final Locale newLocale) { synchronized (sLockForRunInLocale) { - final Configuration savedConf = res.getConfiguration(); - if (newLocale == null || newLocale.equals(savedConf.locale)) { + final Configuration conf = res.getConfiguration(); + if (newLocale == null || newLocale.equals(conf.locale)) { return job(res); } - final Configuration newConf = new Configuration(); - newConf.setTo(savedConf); - newConf.setLocale(newLocale); + final Locale savedLocale = conf.locale; try { - res.updateConfiguration(newConf, null); + conf.locale = newLocale; + res.updateConfiguration(conf, null); return job(res); } finally { - res.updateConfiguration(savedConf, null); + conf.locale = savedLocale; + res.updateConfiguration(conf, null); } } }