alexandroid/decompiled/jadx/sources/com/google/protobuf/RpcUtil.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

60 lines
2.4 KiB
Java

package com.google.protobuf;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* loaded from: classes8.dex */
public final class RpcUtil {
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
public static final class AlreadyCalledException extends RuntimeException {
private static final long serialVersionUID = 5469741279507848266L;
public AlreadyCalledException() {
super("This RpcCallback was already called and cannot be called multiple times.");
}
}
private RpcUtil() {
}
/* JADX INFO: Access modifiers changed from: private */
public static <Type extends Message> Type copyAsType(Type type, Message message) {
return (Type) type.newBuilderForType().mergeFrom(message).build();
}
public static <Type extends Message> RpcCallback<Message> generalizeCallback(final RpcCallback<Type> rpcCallback, final Class<Type> cls, final Type type) {
return new RpcCallback<Message>() { // from class: com.google.protobuf.RpcUtil.1
@Override // com.google.protobuf.RpcCallback
public void run(Message message) {
Message copyAsType;
try {
copyAsType = (Message) cls.cast(message);
} catch (ClassCastException unused) {
copyAsType = RpcUtil.copyAsType(type, message);
}
rpcCallback.run(copyAsType);
}
};
}
public static <ParameterType> RpcCallback<ParameterType> newOneTimeCallback(final RpcCallback<ParameterType> rpcCallback) {
return new RpcCallback<ParameterType>() { // from class: com.google.protobuf.RpcUtil.2
private boolean alreadyCalled = false;
@Override // com.google.protobuf.RpcCallback
public void run(ParameterType parametertype) {
synchronized (this) {
if (this.alreadyCalled) {
throw new AlreadyCalledException();
}
this.alreadyCalled = true;
}
RpcCallback.this.run(parametertype);
}
};
}
/* JADX WARN: Multi-variable type inference failed */
public static <Type extends Message> RpcCallback<Type> specializeCallback(RpcCallback<Message> rpcCallback) {
return rpcCallback;
}
}