package androidx.core.view; import android.R; import android.os.Build; import android.view.View; import android.view.Window; import android.view.WindowInsetsController; import android.view.inputmethod.InputMethodManager; import com.google.android.gms.internal.common.zzd; import o.DFj; import org.bouncycastle.asn1.cmp.PKIFailureInfo; /* loaded from: classes.dex */ public final class WindowInsetsControllerCompat { private final HBt b; @Deprecated private WindowInsetsControllerCompat(WindowInsetsController windowInsetsController) { this.b = new Sts(windowInsetsController, this); } public WindowInsetsControllerCompat(Window window, View view) { if (Build.VERSION.SDK_INT >= 30) { this.b = new Sts(window, this); } else { this.b = new LWm(window, view); } } @Deprecated public static WindowInsetsControllerCompat tK_(WindowInsetsController windowInsetsController) { return new WindowInsetsControllerCompat(windowInsetsController); } public final void e(int i) { this.b.d(i); } public final void b(int i) { this.b.e(i); } public final boolean a() { return this.b.c(); } public final void e(boolean z) { this.b.a(z); } public final void d(boolean z) { this.b.d(z); } /* loaded from: classes.dex */ static class HBt { public void a(boolean z) { } public boolean c() { return false; } void d(int i) { } public void d(boolean z) { } void e(int i) { } HBt() { } } /* loaded from: classes.dex */ public static class IeS extends HBt { protected final Window b; private final View e; IeS(Window window, View view) { this.b = window; this.e = view; } @Override // androidx.core.view.WindowInsetsControllerCompat.HBt void d(int i) { for (int i2 = 1; i2 <= 256; i2 <<= 1) { if ((i & i2) != 0) { h(i2); } } } private void h(int i) { if (i == 1) { a(4); g(1024); return; } if (i == 2) { a(2); return; } if (i == 8) { final View view = this.e; if (view.isInEditMode() || view.onCheckIsTextEditor()) { view.requestFocus(); } else { view = this.b.getCurrentFocus(); } if (view == null) { view = this.b.findViewById(R.id.content); } if (view == null || !view.hasWindowFocus()) { return; } view.post(new Runnable(view) { // from class: o.Fqj public final View d; @Override // java.lang.Runnable public final void run() { ((InputMethodManager) r0.getContext().getSystemService("input_method")).showSoftInput(this.d, 0); } { this.d = view; } }); } } @Override // androidx.core.view.WindowInsetsControllerCompat.HBt void e(int i) { for (int i2 = 1; i2 <= 256; i2 <<= 1) { if ((i & i2) != 0) { j(i2); } } } private void j(int i) { if (i == 1) { c(4); } else if (i == 2) { c(2); } else if (i == 8) { ((InputMethodManager) this.b.getContext().getSystemService("input_method")).hideSoftInputFromWindow(this.b.getDecorView().getWindowToken(), 0); } } protected void c(int i) { View decorView = this.b.getDecorView(); decorView.setSystemUiVisibility(i | decorView.getSystemUiVisibility()); } protected void a(int i) { View decorView = this.b.getDecorView(); decorView.setSystemUiVisibility((~i) & decorView.getSystemUiVisibility()); } protected void b(int i) { this.b.addFlags(i); } protected void g(int i) { this.b.clearFlags(i); } } /* loaded from: classes.dex */ static class RVV extends IeS { RVV(Window window, View view) { super(window, view); } @Override // androidx.core.view.WindowInsetsControllerCompat.HBt public boolean c() { return (this.b.getDecorView().getSystemUiVisibility() & 8192) != 0; } @Override // androidx.core.view.WindowInsetsControllerCompat.HBt public void a(boolean z) { if (z) { g(zzd.zza); b(PKIFailureInfo.systemUnavail); c(8192); return; } a(8192); } } /* loaded from: classes.dex */ static class LWm extends RVV { LWm(Window window, View view) { super(window, view); } @Override // androidx.core.view.WindowInsetsControllerCompat.HBt public void d(boolean z) { if (z) { g(134217728); b(PKIFailureInfo.systemUnavail); c(16); return; } a(16); } } /* loaded from: classes.dex */ static class Sts extends HBt { final WindowInsetsControllerCompat a; protected Window b; private final DFj d; final WindowInsetsController e; Sts(Window window, WindowInsetsControllerCompat windowInsetsControllerCompat) { this(window.getInsetsController(), windowInsetsControllerCompat); this.b = window; } Sts(WindowInsetsController windowInsetsController, WindowInsetsControllerCompat windowInsetsControllerCompat) { this.d = new DFj<>(); this.e = windowInsetsController; this.a = windowInsetsControllerCompat; } @Override // androidx.core.view.WindowInsetsControllerCompat.HBt void d(int i) { if (this.b != null && (i & 8) != 0 && Build.VERSION.SDK_INT < 32) { ((InputMethodManager) this.b.getContext().getSystemService("input_method")).isActive(); } this.e.show(i); } @Override // androidx.core.view.WindowInsetsControllerCompat.HBt void e(int i) { this.e.hide(i); } @Override // androidx.core.view.WindowInsetsControllerCompat.HBt public boolean c() { return (this.e.getSystemBarsAppearance() & 8) != 0; } @Override // androidx.core.view.WindowInsetsControllerCompat.HBt public void a(boolean z) { if (z) { if (this.b != null) { b(8192); } this.e.setSystemBarsAppearance(8, 8); } else { if (this.b != null) { a(8192); } this.e.setSystemBarsAppearance(0, 8); } } @Override // androidx.core.view.WindowInsetsControllerCompat.HBt public void d(boolean z) { if (z) { if (this.b != null) { b(16); } this.e.setSystemBarsAppearance(16, 16); } else { if (this.b != null) { a(16); } this.e.setSystemBarsAppearance(0, 16); } } protected void a(int i) { View decorView = this.b.getDecorView(); decorView.setSystemUiVisibility((~i) & decorView.getSystemUiVisibility()); } protected void b(int i) { View decorView = this.b.getDecorView(); decorView.setSystemUiVisibility(i | decorView.getSystemUiVisibility()); } } }