package com.tencent.wxop.stat; import android.content.Context; import com.tencent.wxop.stat.common.StatLogger; import java.util.Map; /* loaded from: classes.dex */ final class z implements Runnable { final /* synthetic */ String a; final /* synthetic */ com.tencent.wxop.stat.event.c b; final /* synthetic */ Context c; final /* synthetic */ StatSpecifyReportedInfo d; z(String str, com.tencent.wxop.stat.event.c cVar, Context context, StatSpecifyReportedInfo statSpecifyReportedInfo) { this.a = str; this.b = cVar; this.c = context; this.d = statSpecifyReportedInfo; } @Override // java.lang.Runnable public final void run() { StatLogger statLogger; Map map; StatLogger statLogger2; StatLogger statLogger3; try { if (StatServiceImpl.a(this.a)) { statLogger3 = StatServiceImpl.q; statLogger3.error("The event_id of StatService.trackCustomEndEvent() can not be null or empty."); return; } map = StatServiceImpl.e; Long l = (Long) map.remove(this.b); if (l != null) { com.tencent.wxop.stat.event.b bVar = new com.tencent.wxop.stat.event.b(this.c, StatServiceImpl.a(this.c, false, this.d), this.b.a, this.d); bVar.b().c = this.b.c; Long valueOf = Long.valueOf((System.currentTimeMillis() - l.longValue()) / 1000); bVar.a(Long.valueOf(valueOf.longValue() <= 0 ? 1L : valueOf.longValue()).longValue()); new aq(bVar).a(); return; } statLogger2 = StatServiceImpl.q; statLogger2.warn("No start time found for custom event: " + this.b.toString() + ", lost trackCustomBeginKVEvent()?"); } catch (Throwable th) { statLogger = StatServiceImpl.q; statLogger.e(th); StatServiceImpl.a(this.c, th); } } }