package ඓ.㸾.K;

import android.app.Application;
import android.database.ContentObserver;
import android.net.Uri;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.provider.Settings;
import java.util.ArrayList;
import java.util.Iterator;
import ῲ.ᨨ.㳳.C1841;

/* renamed from: ඓ.㸾.K.ᕣ  reason: contains not printable characters */
/* compiled from: NavigationBarObserver */
public final class C1374 extends ContentObserver {

    /* renamed from: ʬ  reason: contains not printable characters */
    public Boolean f5236 = false;

    /* renamed from: ῲ  reason: contains not printable characters */
    public Application f5237;

    /* renamed from: K  reason: contains not printable characters */
    public ArrayList<AbstractC1366> f5238;

    /* renamed from: ඓ.㸾.K.ᕣ$ῲ  reason: contains not printable characters */
    /* compiled from: NavigationBarObserver */
    public static class C1375 {

        /* renamed from: K  reason: contains not printable characters */
        public static final C1374 f5239 = new C1374(null);
    }

    public C1374() {
        super(new Handler(Looper.getMainLooper()));
    }

    public void addOnNavigationBarListener(AbstractC1366 r2) {
        if (r2 != null) {
            if (this.f5238 == null) {
                this.f5238 = new ArrayList<>();
            }
            if (!this.f5238.contains(r2)) {
                this.f5238.add(r2);
            }
        }
    }

    public void onChange(boolean z) {
        ArrayList<AbstractC1366> arrayList;
        int i;
        super.onChange(z);
        int i2 = Build.VERSION.SDK_INT;
        Application application = this.f5237;
        if (application != null && application.getContentResolver() != null && (arrayList = this.f5238) != null && !arrayList.isEmpty()) {
            if (C1841.m4746()) {
                i = Settings.Global.getInt(this.f5237.getContentResolver(), "force_fsg_nav_bar", 0);
            } else if (!C1841.m4750()) {
                i = 0;
            } else if (!C1841.m4805()) {
                int i3 = Build.VERSION.SDK_INT;
                i = Settings.Global.getInt(this.f5237.getContentResolver(), "navigationbar_is_min", 0);
            } else {
                i = Settings.System.getInt(this.f5237.getContentResolver(), "navigationbar_is_min", 0);
            }
            Iterator<AbstractC1366> it2 = this.f5238.iterator();
            while (it2.hasNext()) {
                AbstractC1366 next = it2.next();
                boolean z2 = true;
                if (i == 1) {
                    z2 = false;
                }
                ((C1387) next).m3595(z2);
            }
        }
    }

    public void removeOnNavigationBarListener(AbstractC1366 r2) {
        ArrayList<AbstractC1366> arrayList;
        if (r2 != null && (arrayList = this.f5238) != null) {
            arrayList.remove(r2);
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m3570(Application application) {
        this.f5237 = application;
        int i = Build.VERSION.SDK_INT;
        Application application2 = this.f5237;
        if (application2 != null && application2.getContentResolver() != null && !this.f5236.booleanValue()) {
            Uri uri = null;
            if (C1841.m4746()) {
                uri = Settings.Global.getUriFor("force_fsg_nav_bar");
            } else if (C1841.m4750()) {
                if (!C1841.m4805()) {
                    int i2 = Build.VERSION.SDK_INT;
                    uri = Settings.Global.getUriFor("navigationbar_is_min");
                } else {
                    uri = Settings.System.getUriFor("navigationbar_is_min");
                }
            }
            if (uri != null) {
                this.f5237.getContentResolver().registerContentObserver(uri, true, this);
                this.f5236 = true;
            }
        }
    }

    public /* synthetic */ C1374(C1376 k) {
        super(new Handler(Looper.getMainLooper()));
    }

    /* renamed from: K  reason: contains not printable characters */
    public static C1374 m3569() {
        return C1375.f5239;
    }
}
