what-the-bank/sources/androidx/emoji2/text/EmojiCompatInitializer.java

170 lines
5.3 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package androidx.emoji2.text;
import android.content.Context;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import androidx.emoji2.text.EmojiCompatInitializer;
import androidx.lifecycle.DefaultLifecycleObserver;
import androidx.lifecycle.ProcessLifecycleInitializer;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ThreadPoolExecutor;
import o.C16349neT;
import o.C6313cPD;
import o.GOe;
import o.InterfaceC16541pFg;
import o.LWt;
import o.Lfp;
import o.WoW;
import o.kem;
import o.qYK;
import o.wdQ;
/* loaded from: classes.dex */
public class EmojiCompatInitializer implements qYK<Boolean> {
@Override // o.qYK
/* renamed from: d, reason: merged with bridge method [inline-methods] */
public Boolean c(Context context) {
C16349neT.b(new LWm(context));
e(context);
return Boolean.TRUE;
}
void e(Context context) {
wdQ lifecycle = ((InterfaceC16541pFg) C6313cPD.c(context).a(ProcessLifecycleInitializer.class)).getLifecycle();
lifecycle.e(new DefaultLifecycleObserver(this, lifecycle) { // from class: androidx.emoji2.text.EmojiCompatInitializer.1
final EmojiCompatInitializer b;
final wdQ d;
{
this.b = this;
this.d = lifecycle;
}
@Override // androidx.lifecycle.DefaultLifecycleObserver, o.InterfaceC15806ikR
public void onResume(InterfaceC16541pFg interfaceC16541pFg) {
this.b.b();
this.d.a(this);
}
});
}
void b() {
Handler handler;
if (Build.VERSION.SDK_INT < 28) {
handler = new Handler(Looper.getMainLooper());
} else {
handler = Handler.createAsync(Looper.getMainLooper());
}
handler.postDelayed(new RVV(), 500L);
}
@Override // o.qYK
public List<Class<? extends qYK<?>>> e() {
return Collections.singletonList(ProcessLifecycleInitializer.class);
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes.dex */
public static class RVV implements Runnable {
RVV() {
}
@Override // java.lang.Runnable
public void run() {
try {
Lfp.b("EmojiCompat.EmojiCompatInitializer.run");
if (C16349neT.b()) {
C16349neT.e().j();
}
} finally {
Lfp.c();
}
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes.dex */
public static class LWm extends C16349neT.HBt {
protected LWm(Context context) {
super(new HBt(context));
a(1);
}
}
/* loaded from: classes.dex */
public static class HBt implements C16349neT.ojQ {
private final Context b;
HBt(Context context) {
this.b = context.getApplicationContext();
}
@Override // o.C16349neT.ojQ
public void e(final C16349neT.ZqN zqN) {
final ThreadPoolExecutor c = GOe.c("EmojiCompatInitializer");
c.execute(new Runnable(this, zqN, c) { // from class: o.SMs
public final EmojiCompatInitializer.HBt a;
public final ThreadPoolExecutor c;
public final C16349neT.ZqN e;
@Override // java.lang.Runnable
public final void run() {
this.a.c(this.e, this.c);
}
{
this.a = this;
this.e = zqN;
this.c = c;
}
});
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: d, reason: merged with bridge method [inline-methods] */
public void c(C16349neT.ZqN zqN, ThreadPoolExecutor threadPoolExecutor) {
try {
LWt e = WoW.e(this.b);
if (e == null) {
throw new RuntimeException("EmojiCompat font provider not available on this device.");
}
e.b(threadPoolExecutor);
e.a().e(new C16349neT.ZqN(this, zqN, threadPoolExecutor) { // from class: androidx.emoji2.text.EmojiCompatInitializer.HBt.2
final ThreadPoolExecutor a;
final C16349neT.ZqN b;
final HBt e;
{
this.e = this;
this.b = zqN;
this.a = threadPoolExecutor;
}
@Override // o.C16349neT.ZqN
public void c(kem kemVar) {
try {
this.b.c(kemVar);
} finally {
this.a.shutdown();
}
}
@Override // o.C16349neT.ZqN
public void d(Throwable th) {
try {
this.b.d(th);
} finally {
this.a.shutdown();
}
}
});
} catch (Throwable th) {
zqN.d(th);
threadPoolExecutor.shutdown();
}
}
}
}