Merge "Fix issue "open battery settings, switch locale, apps are still in old locale" into pi-dev" into pi-dev am: 032b0454f8

am: 00bddd986e

Change-Id: Ie15b207e3d75ee862e58be72dc240da9f9d859df
This commit is contained in:
Wenhung Teng
2018-03-27 06:33:29 +00:00
committed by android-build-merger
2 changed files with 25 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ import com.android.settingslib.Utils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Locale;
/**
* Wraps the power usage data of a BatterySipper with information about package name
@@ -55,6 +56,8 @@ public class BatteryEntry {
static final ArrayList<BatteryEntry> mRequestQueue = new ArrayList<BatteryEntry>();
static Handler sHandler;
static Locale sCurrentLocale = null;
static private class NameAndIconLoader extends Thread {
private boolean mAbort = false;
@@ -227,6 +230,13 @@ public class BatteryEntry {
}
void getQuickNameIconForUid(final int uid) {
// Locale sync to system config in Settings
final Locale locale = Locale.getDefault();
if (sCurrentLocale != locale) {
clearUidCache();
sCurrentLocale = locale;
}
final String uidString = Integer.toString(uid);
if (sUidCache.containsKey(uidString)) {
UidToDetail utd = sUidCache.get(uidString);