package p138.p176.p177.p242.p246.p249;

import android.content.ComponentName;
import android.content.Context;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.os.Message;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import p138.p176.p177.p242.p246.p249.AbstractC4269;
import p138.p176.p177.p242.p246.p252.C4306;

/* JADX INFO: renamed from: ދ.ހ.֏.ހ.ހ.ފ.ޗ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class ServiceConnectionC4292 implements ServiceConnection {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final Set<ServiceConnection> f13578 = new HashSet();

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public int f13579 = 2;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public boolean f13580;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public IBinder f13581;

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public final AbstractC4269.C4270 f13582;

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public ComponentName f13583;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final /* synthetic */ C4291 f13584;

    public ServiceConnectionC4292(C4291 c4291, AbstractC4269.C4270 c4270) {
        this.f13584 = c4291;
        this.f13582 = c4270;
    }

    @Override // android.content.ServiceConnection
    public final void onServiceConnected(ComponentName componentName, IBinder iBinder) {
        synchronized (this.f13584.f13572) {
            this.f13584.f13574.removeMessages(1, this.f13582);
            this.f13581 = iBinder;
            this.f13583 = componentName;
            Iterator<ServiceConnection> it = this.f13578.iterator();
            while (it.hasNext()) {
                it.next().onServiceConnected(componentName, iBinder);
            }
            this.f13579 = 1;
        }
    }

    @Override // android.content.ServiceConnection
    public final void onServiceDisconnected(ComponentName componentName) {
        synchronized (this.f13584.f13572) {
            this.f13584.f13574.removeMessages(1, this.f13582);
            this.f13581 = null;
            this.f13583 = componentName;
            Iterator<ServiceConnection> it = this.f13578.iterator();
            while (it.hasNext()) {
                it.next().onServiceDisconnected(componentName);
            }
            this.f13579 = 2;
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m6964(String str) {
        this.f13579 = 3;
        C4291 c4291 = this.f13584;
        boolean zM7208 = c4291.f13575.m7208(c4291.f13573, this.f13582.m6956(), this, this.f13582.f13552);
        this.f13580 = zM7208;
        if (zM7208) {
            Message messageObtainMessage = this.f13584.f13574.obtainMessage(1, this.f13582);
            C4291 c42912 = this.f13584;
            c42912.f13574.sendMessageDelayed(messageObtainMessage, c42912.f13577);
            return;
        }
        this.f13579 = 2;
        try {
            C4306 c4306 = this.f13584.f13575;
            Context context = this.f13584.f13573;
            if (c4306 == null) {
                throw null;
            }
            context.unbindService(this);
        } catch (IllegalArgumentException unused) {
        }
    }
}
