mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 02:38:20 +00:00
Encoding the locale list in systemState so that icons and labels are updated properly
Bug: 70948387 Change-Id: Ia6348ff8c3e035b9d91bb14fb98c751f3f29ab89
This commit is contained in:
@@ -118,8 +118,7 @@ public class IconCache {
|
||||
mIconDpi = inv.fillResIconDpi;
|
||||
mIconDb = new IconDB(context, inv.iconBitmapSize);
|
||||
|
||||
mIconProvider = Utilities.getOverrideObject(
|
||||
IconProvider.class, context, R.string.icon_provider_class);
|
||||
mIconProvider = IconProvider.newInstance(context);
|
||||
mWorkerHandler = new Handler(LauncherModel.getWorkerLooper());
|
||||
|
||||
mLowResOptions = new BitmapFactory.Options();
|
||||
@@ -254,7 +253,7 @@ public class IconCache {
|
||||
// Remove all active icon update tasks.
|
||||
mWorkerHandler.removeCallbacksAndMessages(ICON_UPDATE_TOKEN);
|
||||
|
||||
mIconProvider.updateSystemStateString();
|
||||
mIconProvider.updateSystemStateString(mContext);
|
||||
for (UserHandle user : mUserManager.getUserProfiles()) {
|
||||
// Query for the set of apps
|
||||
final List<LauncherActivityInfo> apps = mLauncherApps.getActivityList(null, user);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.android.launcher3;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.LauncherActivityInfo;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
@@ -8,17 +9,26 @@ import java.util.Locale;
|
||||
|
||||
public class IconProvider {
|
||||
|
||||
private static final boolean DBG = false;
|
||||
private static final String TAG = "IconProvider";
|
||||
|
||||
protected String mSystemState;
|
||||
|
||||
public IconProvider() {
|
||||
updateSystemStateString();
|
||||
public static IconProvider newInstance(Context context) {
|
||||
IconProvider provider = Utilities.getOverrideObject(
|
||||
IconProvider.class, context, R.string.icon_provider_class);
|
||||
provider.updateSystemStateString(context);
|
||||
return provider;
|
||||
}
|
||||
|
||||
public void updateSystemStateString() {
|
||||
mSystemState = Locale.getDefault().toString() + "," + Build.VERSION.SDK_INT;
|
||||
public IconProvider() { }
|
||||
|
||||
public void updateSystemStateString(Context context) {
|
||||
final String locale;
|
||||
if (Utilities.ATLEAST_NOUGAT) {
|
||||
locale = context.getResources().getConfiguration().getLocales().toLanguageTags();
|
||||
} else {
|
||||
locale = Locale.getDefault().toString();
|
||||
}
|
||||
|
||||
mSystemState = locale + "," + Build.VERSION.SDK_INT;
|
||||
}
|
||||
|
||||
public String getIconSystemState(String packageName) {
|
||||
|
||||
Reference in New Issue
Block a user