package d2;

import n1.f;
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;

/* JADX INFO: compiled from: CoroutineContext.kt */
/* JADX INFO: loaded from: classes.dex */
@IgnoreJRERequirement
public final class z extends n1.a implements m1<String> {

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static final a f4540f = new a(null);

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private final long f4541e;

    /* JADX INFO: compiled from: CoroutineContext.kt */
    public static final class a implements f.c<z> {
        private a() {
        }

        public /* synthetic */ a(w1.e eVar) {
            this();
        }
    }

    public final long d() {
        return this.f4541e;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        return (obj instanceof z) && this.f4541e == ((z) obj).f4541e;
    }

    @Override // d2.m1
    /* JADX INFO: renamed from: g, reason: merged with bridge method [inline-methods] */
    public void o(n1.f fVar, String str) {
        Thread.currentThread().setName(str);
    }

    public int hashCode() {
        return Long.hashCode(this.f4541e);
    }

    @Override // d2.m1
    /* JADX INFO: renamed from: i, reason: merged with bridge method [inline-methods] */
    public String l(n1.f fVar) {
        String strD;
        a0 a0Var = (a0) fVar.get(a0.f4463f);
        String str = "coroutine";
        if (a0Var != null && (strD = a0Var.d()) != null) {
            str = strD;
        }
        Thread threadCurrentThread = Thread.currentThread();
        String name = threadCurrentThread.getName();
        int iQ = c2.m.q(name, " @", 0, false, 6, null);
        if (iQ < 0) {
            iQ = name.length();
        }
        StringBuilder sb = new StringBuilder(str.length() + iQ + 10);
        String strSubstring = name.substring(0, iQ);
        w1.g.d(strSubstring, "this as java.lang.String…ing(startIndex, endIndex)");
        sb.append(strSubstring);
        sb.append(" @");
        sb.append(str);
        sb.append('#');
        sb.append(d());
        String string = sb.toString();
        w1.g.d(string, "StringBuilder(capacity).…builderAction).toString()");
        threadCurrentThread.setName(string);
        return name;
    }

    public String toString() {
        return "CoroutineId(" + this.f4541e + ')';
    }
}
