mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-15 18:37:17 +01:00
48 lines
1.8 KiB
Java
48 lines
1.8 KiB
Java
package com.google.protobuf;
|
|
|
|
import com.amazon.alexa.ra.ui.fragments.smartfragment.SmartFragmentEventProcessor;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes8.dex */
|
|
final class ExtensionRegistryFactory {
|
|
static final Class<?> EXTENSION_REGISTRY_CLASS = reflectExtensionRegistry();
|
|
static final String FULL_REGISTRY_CLASS_NAME = "com.google.protobuf.ExtensionRegistry";
|
|
|
|
public static ExtensionRegistryLite create() {
|
|
if (EXTENSION_REGISTRY_CLASS != null) {
|
|
try {
|
|
return invokeSubclassFactory(SmartFragmentEventProcessor.NEW_INSTANCE);
|
|
} catch (Exception unused) {
|
|
}
|
|
}
|
|
return new ExtensionRegistryLite();
|
|
}
|
|
|
|
public static ExtensionRegistryLite createEmpty() {
|
|
if (EXTENSION_REGISTRY_CLASS != null) {
|
|
try {
|
|
return invokeSubclassFactory("getEmptyRegistry");
|
|
} catch (Exception unused) {
|
|
}
|
|
}
|
|
return ExtensionRegistryLite.EMPTY_REGISTRY_LITE;
|
|
}
|
|
|
|
private static final ExtensionRegistryLite invokeSubclassFactory(String str) throws Exception {
|
|
return (ExtensionRegistryLite) EXTENSION_REGISTRY_CLASS.getDeclaredMethod(str, null).invoke(null, null);
|
|
}
|
|
|
|
public static boolean isFullRegistry(ExtensionRegistryLite extensionRegistryLite) {
|
|
Class<?> cls = EXTENSION_REGISTRY_CLASS;
|
|
return cls != null && cls.isAssignableFrom(extensionRegistryLite.getClass());
|
|
}
|
|
|
|
public static Class<?> reflectExtensionRegistry() {
|
|
try {
|
|
ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY_REGISTRY;
|
|
return ExtensionRegistry.class;
|
|
} catch (ClassNotFoundException unused) {
|
|
return null;
|
|
}
|
|
}
|
|
}
|