package com.google.android.gms.internal.vision; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; /* JADX INFO: Access modifiers changed from: package-private */ /* loaded from: classes2.dex */ public final class zzhs { private static final zzhs zzzw = new zzhs(); private final zzhx zzzx; private final ConcurrentMap, zzhw> zzzy = new ConcurrentHashMap(); public final zzhw zzf(Class cls) { zzga.zza(cls, "messageType"); zzhw zzhwVar = (zzhw) this.zzzy.get(cls); if (zzhwVar != null) { return zzhwVar; } zzhw zze = this.zzzx.zze(cls); zzga.zza(cls, "messageType"); zzga.zza(zze, "schema"); zzhw zzhwVar2 = (zzhw) this.zzzy.putIfAbsent(cls, zze); return zzhwVar2 != null ? zzhwVar2 : zze; } public final zzhw zzs(T t) { return zzf(t.getClass()); } private zzhs() { String[] strArr = {"com.google.protobuf.AndroidProto3SchemaFactory"}; zzhx zzhxVar = null; for (int i = 0; i <= 0; i++) { zzhxVar = zzr(strArr[0]); if (zzhxVar != null) { break; } } this.zzzx = zzhxVar == null ? new zzgu() : zzhxVar; } private static zzhx zzr(String str) { try { return (zzhx) Class.forName(str).getConstructor(new Class[0]).newInstance(new Object[0]); } catch (Throwable unused) { return null; } } public static zzhs zzgl() { return zzzw; } }