package V1;
import D2.h;
import android.content.Context;
import android.content.ContextWrapper;
/* JADX INFO: loaded from: classes.dex */
public final class a {
/* JADX INFO: renamed from: a, reason: collision with root package name */
public static final a f2677a = new a();
private a() {
}
public static final Object a(Context context, Class cls) {
Context baseContext;
h.f(cls, "clazz");
while (!cls.isInstance(context)) {
if (!(context instanceof ContextWrapper) || context == (baseContext = ((ContextWrapper) context).getBaseContext())) {
return null;
}
context = baseContext;
}
return context;
}
}
Download file