package androidx.core.text; import android.os.Build; import android.text.TextUtils; import java.util.Locale; /* loaded from: classes.dex */ public final class TextUtilsCompat { private static final Locale a = new Locale("", ""); private static int a(Locale locale) { byte directionality = Character.getDirectionality(locale.getDisplayName(locale).charAt(0)); return (directionality == 1 || directionality == 2) ? 1 : 0; } public static int b(Locale locale) { if (Build.VERSION.SDK_INT >= 17) { return TextUtils.getLayoutDirectionFromLocale(locale); } if (locale == null || locale.equals(a)) { return 0; } String b = ICUCompat.b(locale); return b == null ? a(locale) : (b.equalsIgnoreCase("Arab") || b.equalsIgnoreCase("Hebr")) ? 1 : 0; } }