package d.b.c;

import android.content.Context;
import android.location.Location;
import android.location.LocationManager;
import android.util.Log;

/* JADX INFO: loaded from: classes.dex */
public class r {
    public static r a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Context f1632b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final LocationManager f1633c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final a f1634d = new a();

    public static class a {
        public boolean a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public long f1635b;
    }

    public r(Context context, LocationManager locationManager) {
        this.f1632b = context;
        this.f1633c = locationManager;
    }

    public final Location a(String str) {
        try {
            if (this.f1633c.isProviderEnabled(str)) {
                return this.f1633c.getLastKnownLocation(str);
            }
            return null;
        } catch (Exception e2) {
            Log.d("TwilightManager", "Failed to get last known location", e2);
            return null;
        }
    }
}
