package F2;

import B2.m;
import android.app.Activity;
import android.content.Context;
import android.graphics.Rect;
import android.view.WindowManager;
import kotlin.jvm.internal.o;

/* JADX INFO: loaded from: classes.dex */
public final class f implements e, g {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final f f1488b = new f();

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final f f1489c = new f();

    @Override // F2.g
    public m b(Activity activity, e densityCompatHelper) {
        o.h(densityCompatHelper, "densityCompatHelper");
        b.f1479a.getClass();
        return new m(new z2.b(a.a().a(activity)), densityCompatHelper.c(activity));
    }

    @Override // F2.e
    public float c(Context context) {
        return ((WindowManager) context.getSystemService(WindowManager.class)).getCurrentWindowMetrics().getDensity();
    }

    @Override // F2.g
    public m d(Context context, e densityCompatHelper) {
        o.h(densityCompatHelper, "densityCompatHelper");
        WindowManager windowManager = context.isUiContext() ? (WindowManager) context.getSystemService(WindowManager.class) : (WindowManager) context.getApplicationContext().getSystemService(WindowManager.class);
        Rect bounds = windowManager.getCurrentWindowMetrics().getBounds();
        o.g(bounds, "getBounds(...)");
        return new m(bounds, windowManager.getCurrentWindowMetrics().getDensity());
    }
}
