alexandroid/decompiled/jadx/sources/com/google/android/gms/common/BlockingServiceConnection.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

58 lines
2.2 KiB
Java

package com.google.android.gms.common;
import android.content.ComponentName;
import android.content.ServiceConnection;
import android.os.IBinder;
import androidx.annotation.NonNull;
import com.google.android.gms.common.annotation.KeepForSdk;
import com.google.android.gms.common.internal.Preconditions;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import rx.Single$$ExternalSyntheticBUOutline0;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
@KeepForSdk
/* loaded from: classes7.dex */
public class BlockingServiceConnection implements ServiceConnection {
boolean zza = false;
private final BlockingQueue zzb = new LinkedBlockingQueue();
@NonNull
@KeepForSdk
public IBinder getService() throws InterruptedException {
Preconditions.checkNotMainThread("BlockingServiceConnection.getService() called on main thread");
if (this.zza) {
Single$$ExternalSyntheticBUOutline0.m$2("Cannot call get on this connection more than once");
return null;
}
this.zza = true;
return (IBinder) this.zzb.take();
}
@NonNull
@KeepForSdk
public IBinder getServiceWithTimeout(long j, @NonNull TimeUnit timeUnit) throws InterruptedException, TimeoutException {
Preconditions.checkNotMainThread("BlockingServiceConnection.getServiceWithTimeout() called on main thread");
if (this.zza) {
Single$$ExternalSyntheticBUOutline0.m$2("Cannot call get on this connection more than once");
return null;
}
this.zza = true;
IBinder iBinder = (IBinder) this.zzb.poll(j, timeUnit);
if (iBinder != null) {
return iBinder;
}
throw new TimeoutException("Timed out waiting for the service connection");
}
@Override // android.content.ServiceConnection
public final void onServiceConnected(@NonNull ComponentName componentName, @NonNull IBinder iBinder) {
this.zzb.add(iBinder);
}
@Override // android.content.ServiceConnection
public final void onServiceDisconnected(@NonNull ComponentName componentName) {
}
}