package defpackage;

import android.content.Context;
import android.content.IntentFilter;
import android.location.Location;
import android.location.LocationManager;
import android.os.PowerManager;
import java.util.Calendar;

/* JADX INFO: renamed from: ˊᵙᵤ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C1369 extends AbstractC2787 {

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final /* synthetic */ int f5658 = 0;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public final Object f5659;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final /* synthetic */ LayoutInflaterFactory2C5168 f5660;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C1369(LayoutInflaterFactory2C5168 layoutInflaterFactory2C5168, Context context) {
        super(layoutInflaterFactory2C5168);
        this.f5660 = layoutInflaterFactory2C5168;
        this.f5659 = (PowerManager) context.getApplicationContext().getSystemService("power");
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C1369(LayoutInflaterFactory2C5168 layoutInflaterFactory2C5168, C2994 c2994) {
        super(layoutInflaterFactory2C5168);
        this.f5660 = layoutInflaterFactory2C5168;
        this.f5659 = c2994;
    }

    /* JADX WARN: Removed duplicated region for block: B:14:0x003d  */
    @Override // defpackage.AbstractC2787
    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final int mo3912() {
        boolean z;
        long j;
        int i = this.f5658;
        Object obj = this.f5659;
        switch (i) {
            case 0:
                if (!((PowerManager) obj).isPowerSaveMode()) {
                    break;
                }
                break;
            default:
                C2994 c2994 = (C2994) obj;
                C1589 c1589 = (C1589) c2994.f11536;
                LocationManager locationManager = (LocationManager) c2994.f11534;
                if (c1589.f6385 > System.currentTimeMillis()) {
                    z = c1589.f6386;
                } else {
                    Context context = (Context) c2994.f11535;
                    Location lastKnownLocation = null;
                    if (ᵷᵸˁ.ːˏᵟᵯ(context, "android.permission.ACCESS_COARSE_LOCATION") == 0) {
                        Location lastKnownLocation2 = locationManager.isProviderEnabled("network") ? locationManager.getLastKnownLocation("network") : null;
                        if (ᵷᵸˁ.ːˏᵟᵯ(context, "android.permission.ACCESS_FINE_LOCATION") == 0) {
                            try {
                                if (locationManager.isProviderEnabled("gps")) {
                                    lastKnownLocation = locationManager.getLastKnownLocation("gps");
                                }
                                break;
                            } catch (Exception unused) {
                            }
                        }
                        if (lastKnownLocation == null || lastKnownLocation2 == null ? lastKnownLocation != null : lastKnownLocation.getTime() > lastKnownLocation2.getTime()) {
                            lastKnownLocation2 = lastKnownLocation;
                        }
                        if (lastKnownLocation2 != null) {
                            long jCurrentTimeMillis = System.currentTimeMillis();
                            if (C2744.f10549 == null) {
                                C2744.f10549 = new C2744();
                            }
                            C2744 c2744 = C2744.f10549;
                            c2744.m6640(lastKnownLocation2.getLatitude(), lastKnownLocation2.getLongitude(), jCurrentTimeMillis - 86400000);
                            c2744.m6640(lastKnownLocation2.getLatitude(), lastKnownLocation2.getLongitude(), jCurrentTimeMillis);
                            z = c2744.f10553 == 1;
                            long j2 = c2744.f10551;
                            long j3 = c2744.f10550;
                            c2744.m6640(lastKnownLocation2.getLatitude(), lastKnownLocation2.getLongitude(), jCurrentTimeMillis + 86400000);
                            long j4 = c2744.f10551;
                            if (j2 == -1 || j3 == -1) {
                                j = jCurrentTimeMillis + 43200000;
                            } else {
                                if (jCurrentTimeMillis > j3) {
                                    j2 = j4;
                                } else if (jCurrentTimeMillis > j2) {
                                    j2 = j3;
                                }
                                j = j2 + 60000;
                            }
                            c1589.f6386 = z;
                            c1589.f6385 = j;
                        } else {
                            int i2 = Calendar.getInstance().get(11);
                            if (i2 < 6 || i2 >= 22) {
                                z = true;
                            }
                        }
                        break;
                    }
                }
                if (!z) {
                    break;
                }
                break;
        }
        return 1;
    }

    @Override // defpackage.AbstractC2787
    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public final void mo3913() {
        int i = this.f5658;
        LayoutInflaterFactory2C5168 layoutInflaterFactory2C5168 = this.f5660;
        switch (i) {
            case 0:
                layoutInflaterFactory2C5168.m10687(true, true);
                break;
            default:
                layoutInflaterFactory2C5168.m10687(true, true);
                break;
        }
    }

    @Override // defpackage.AbstractC2787
    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final IntentFilter mo3914() {
        switch (this.f5658) {
            case 0:
                IntentFilter intentFilter = new IntentFilter();
                intentFilter.addAction("android.os.action.POWER_SAVE_MODE_CHANGED");
                return intentFilter;
            default:
                IntentFilter intentFilter2 = new IntentFilter();
                intentFilter2.addAction("android.intent.action.TIME_SET");
                intentFilter2.addAction("android.intent.action.TIMEZONE_CHANGED");
                intentFilter2.addAction("android.intent.action.TIME_TICK");
                return intentFilter2;
        }
    }
}
