am 183fe800: Small cleanup of RunInLocale
* commit '183fe8003163702a0ba9487d6fde2a7c025ab91a': Small cleanup of RunInLocalemain
commit
c6ee9e692c
|
@ -180,14 +180,15 @@ public final class LocaleUtils {
|
|||
synchronized (sLockForRunInLocale) {
|
||||
final Configuration conf = res.getConfiguration();
|
||||
final Locale oldLocale = conf.locale;
|
||||
final boolean needsChange = (newLocale != null && !newLocale.equals(oldLocale));
|
||||
try {
|
||||
if (newLocale != null && !newLocale.equals(oldLocale)) {
|
||||
if (needsChange) {
|
||||
conf.locale = newLocale;
|
||||
res.updateConfiguration(conf, null);
|
||||
}
|
||||
return job(res);
|
||||
} finally {
|
||||
if (newLocale != null && !newLocale.equals(oldLocale)) {
|
||||
if (needsChange) {
|
||||
conf.locale = oldLocale;
|
||||
res.updateConfiguration(conf, null);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue