public int getApplyableNightMode()
    {
        long v3_0;
        boolean v1_0 = this.mTwilightManager;
        int v2_0 = v1_0.mTwilightState;
        int v7 = 0;
        int v8 = 1;
        if (v2_0.nextUpdate <= System.currentTimeMillis()) {
            v3_0 = 0;
        } else {
            v3_0 = 1;
        }
        boolean v1_1;
        if (v3_0 == 0) {
            long v3_7;
            long v4_1 = 0;
            if (androidx.core.content.PermissionChecker.checkSelfPermission(v1_0.mContext, android.permission.ACCESS_COARSE_LOCATION) != 0) {
                v3_7 = 0;
            } else {
                v3_7 = v1_0.getLastKnownLocationForProvider(network);
            }
            if (androidx.core.content.PermissionChecker.checkSelfPermission(v1_0.mContext, android.permission.ACCESS_FINE_LOCATION) == 0) {
                v4_1 = v1_0.getLastKnownLocationForProvider(gps);
            }
            if ((v4_1 == 0) || (v3_7 == 0)) {
                if (v4_1 != 0) {
                    v3_7 = v4_1;
                }
            } else {
                if (v4_1.getTime() > v3_7.getTime()) {
                }
            }
            if (v3_7 == 0) {
                android.util.Log.i(TwilightManager, Could not get last known location. This is probably because the app does not have any location permissions. Falling back to hardcoded sunrise/sunset values.);
                boolean v1_4 = java.util.Calendar.getInstance().get(11);
                if ((v1_4 < 6) || (v1_4 >= 22)) {
                    v7 = 1;
                }
                v1_1 = v7;
            } else {
                boolean v1_5 = v1_0.mTwilightState;
                long v4_3 = System.currentTimeMillis();
                if (androidx.appcompat.app.TwilightCalculator.sInstance == null) {
                    androidx.appcompat.app.TwilightCalculator.sInstance = new androidx.appcompat.app.TwilightCalculator();
                }
                androidx.appcompat.app.TwilightCalculator v6_4 = androidx.appcompat.app.TwilightCalculator.sInstance;
                long v9_4 = v6_4;
                v9_4.calculateTwilight((v4_3 - 86400000), v3_7.getLatitude(), v3_7.getLongitude());
                v9_4.calculateTwilight(v4_3, v3_7.getLatitude(), v3_7.getLongitude());
                if (v6_4.state == 1) {
                    v7 = 1;
                }
                long v9_1;
                long v20 = v6_4.sunset;
                long v16_2 = v6_4.sunrise;
                v6_4.calculateTwilight((v4_3 + 86400000), v3_7.getLatitude(), v3_7.getLongitude());
                if ((v16_2 != -1) && (v20 != -1)) {
                    long v9_0;
                    if (v4_3 <= v20) {
                        if (v4_3 <= v16_2) {
                            v9_0 = (v16_2 + 0);
                        } else {
                            v9_0 = (v20 + 0);
                        }
                    } else {
                        v9_0 = (v6_4.sunrise + 0);
                    }
                    v9_1 = (v9_0 + 60000);
                } else {
                    v9_1 = (43200000 + v4_3);
                }
                v1_5.isNight = v7;
                v1_5.nextUpdate = v9_1;
                v1_1 = v2_0.isNight;
            }
        } else {
            v1_1 = v2_0.isNight;
        }
        if (v1_1) {
            v8 = 2;
        }
        return v8;
    }