package com.google.android.gms.measurement.internal; import android.content.ServiceConnection; import android.net.Uri; import android.os.Bundle; import com.google.android.gms.common.stats.ConnectionTracker; /* loaded from: classes.dex */ final class zzbl implements Runnable { private final /* synthetic */ com.google.android.gms.internal.measurement.zzu a; private final /* synthetic */ ServiceConnection b; private final /* synthetic */ zzbk c; zzbl(zzbk zzbkVar, com.google.android.gms.internal.measurement.zzu zzuVar, ServiceConnection serviceConnection) { this.c = zzbkVar; this.a = zzuVar; this.b = serviceConnection; } @Override // java.lang.Runnable public final void run() { String str; zzbk zzbkVar = this.c; zzbj zzbjVar = zzbkVar.b; str = zzbkVar.a; com.google.android.gms.internal.measurement.zzu zzuVar = this.a; ServiceConnection serviceConnection = this.b; Bundle a = zzbjVar.a(str, zzuVar); zzbjVar.a.a().f(); if (a != null) { long j = a.getLong("install_begin_timestamp_seconds", 0L) * 1000; if (j == 0) { zzbjVar.a.e().t().a("Service response is missing Install Referrer install timestamp"); } else { String string = a.getString("install_referrer"); if (string == null || string.isEmpty()) { zzbjVar.a.e().t().a("No referrer defined in install referrer response"); } else { zzbjVar.a.e().B().a("InstallReferrer API result", string); zzfy s = zzbjVar.a.s(); String valueOf = String.valueOf(string); Bundle a2 = s.a(Uri.parse(valueOf.length() != 0 ? "?".concat(valueOf) : new String("?"))); if (a2 == null) { zzbjVar.a.e().t().a("No campaign params defined in install referrer result"); } else { String string2 = a2.getString("medium"); if ((string2 == null || "(not set)".equalsIgnoreCase(string2) || "organic".equalsIgnoreCase(string2)) ? false : true) { long j2 = a.getLong("referrer_click_timestamp_seconds", 0L) * 1000; if (j2 == 0) { zzbjVar.a.e().t().a("Install Referrer is missing click timestamp for ad campaign"); } else { a2.putLong("click_timestamp", j2); } } if (j == zzbjVar.a.t().k.a()) { zzbjVar.a.c(); zzbjVar.a.e().B().a("Campaign has already been logged"); } else { zzbjVar.a.t().k.a(j); zzbjVar.a.c(); zzbjVar.a.e().B().a("Logging Install Referrer campaign from sdk with ", "referrer API"); a2.putString("_cis", "referrer API"); zzbjVar.a.k().b("auto", "_cmp", a2); } } } } } if (serviceConnection != null) { ConnectionTracker.a().a(zzbjVar.a.b(), serviceConnection); } } }