111 lines
4.1 KiB
Java
111 lines
4.1 KiB
Java
package c.i.a.f.i.b;
|
|
|
|
import android.content.ComponentName;
|
|
import android.content.ServiceConnection;
|
|
import android.os.Bundle;
|
|
import android.os.DeadObjectException;
|
|
import android.os.IBinder;
|
|
import android.os.IInterface;
|
|
import android.os.RemoteException;
|
|
import androidx.annotation.MainThread;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import c.i.a.f.e.k.b;
|
|
import c.i.a.f.e.n.a;
|
|
import com.airbnb.lottie.parser.AnimatableValueParser;
|
|
import com.google.android.gms.common.ConnectionResult;
|
|
/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
|
|
public final class k8 implements ServiceConnection, b.a, b.AbstractC0102b {
|
|
public volatile boolean i;
|
|
public volatile r3 j;
|
|
public final /* synthetic */ q7 k;
|
|
|
|
public k8(q7 q7Var) {
|
|
this.k = q7Var;
|
|
}
|
|
|
|
@Override // c.i.a.f.e.k.b.a
|
|
@MainThread
|
|
public final void e(int i) {
|
|
AnimatableValueParser.u("MeasurementServiceConnection.onConnectionSuspended");
|
|
this.k.g().m.a("Service connection suspended");
|
|
this.k.f().v(new o8(this));
|
|
}
|
|
|
|
@Override // c.i.a.f.e.k.b.AbstractC0102b
|
|
@MainThread
|
|
public final void g(@NonNull ConnectionResult connectionResult) {
|
|
AnimatableValueParser.u("MeasurementServiceConnection.onConnectionFailed");
|
|
u4 u4Var = this.k.a;
|
|
q3 q3Var = u4Var.j;
|
|
q3 q3Var2 = (q3Var == null || !q3Var.n()) ? null : u4Var.j;
|
|
if (q3Var2 != null) {
|
|
q3Var2.i.b("Service connection failed", connectionResult);
|
|
}
|
|
synchronized (this) {
|
|
this.i = false;
|
|
this.j = null;
|
|
}
|
|
this.k.f().v(new n8(this));
|
|
}
|
|
|
|
@Override // c.i.a.f.e.k.b.a
|
|
@MainThread
|
|
public final void h(@Nullable Bundle bundle) {
|
|
AnimatableValueParser.u("MeasurementServiceConnection.onConnected");
|
|
synchronized (this) {
|
|
try {
|
|
this.k.f().v(new l8(this, this.j.v()));
|
|
} catch (DeadObjectException | IllegalStateException unused) {
|
|
this.j = null;
|
|
this.i = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.content.ServiceConnection
|
|
@MainThread
|
|
public final void onServiceConnected(ComponentName componentName, IBinder iBinder) {
|
|
AnimatableValueParser.u("MeasurementServiceConnection.onServiceConnected");
|
|
synchronized (this) {
|
|
if (iBinder == null) {
|
|
this.i = false;
|
|
this.k.g().f.a("Service connected with null binder");
|
|
return;
|
|
}
|
|
i3 i3Var = null;
|
|
try {
|
|
String interfaceDescriptor = iBinder.getInterfaceDescriptor();
|
|
if ("com.google.android.gms.measurement.internal.IMeasurementService".equals(interfaceDescriptor)) {
|
|
IInterface queryLocalInterface = iBinder.queryLocalInterface("com.google.android.gms.measurement.internal.IMeasurementService");
|
|
i3Var = queryLocalInterface instanceof i3 ? (i3) queryLocalInterface : new k3(iBinder);
|
|
this.k.g().n.a("Bound to IMeasurementService interface");
|
|
} else {
|
|
this.k.g().f.b("Got binder with a wrong descriptor", interfaceDescriptor);
|
|
}
|
|
} catch (RemoteException unused) {
|
|
this.k.g().f.a("Service connect failed to get IMeasurementService");
|
|
}
|
|
if (i3Var == null) {
|
|
this.i = false;
|
|
try {
|
|
a b = a.b();
|
|
q7 q7Var = this.k;
|
|
b.c(q7Var.a.b, q7Var.f1190c);
|
|
} catch (IllegalArgumentException unused2) {
|
|
}
|
|
} else {
|
|
this.k.f().v(new j8(this, i3Var));
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // android.content.ServiceConnection
|
|
@MainThread
|
|
public final void onServiceDisconnected(ComponentName componentName) {
|
|
AnimatableValueParser.u("MeasurementServiceConnection.onServiceDisconnected");
|
|
this.k.g().m.a("Service disconnected");
|
|
this.k.f().v(new m8(this, componentName));
|
|
}
|
|
}
|