mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +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:
@@ -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