116 lines
5.2 KiB
Java
116 lines
5.2 KiB
Java
package com.discord.widgets.contact_sync;
|
|
|
|
import com.discord.stores.StoreStream;
|
|
import com.discord.utilities.analytics.AnalyticsTracker;
|
|
import com.discord.utilities.time.Clock;
|
|
import com.discord.utilities.time.ClockFactory;
|
|
import d0.t.h0;
|
|
import d0.z.d.m;
|
|
import java.util.Map;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
/* compiled from: ContactSyncAnalytics.kt */
|
|
public final class ContactSyncAnalytics {
|
|
private static final String CONTACT_SYNC_FLOW_KEY = "Contact Sync";
|
|
public static final Companion Companion = new Companion(null);
|
|
private final Clock clock;
|
|
private final boolean isOnboarding;
|
|
private String lastStep;
|
|
private long lastStepTimestamp;
|
|
|
|
/* compiled from: ContactSyncAnalytics.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: com.discord.widgets.contact_sync.ContactSyncAnalytics$Companion */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static /* synthetic */ void trackStart$default(Companion companion, boolean z2, Map map, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
z2 = false;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
map = null;
|
|
}
|
|
companion.trackStart(z2, map);
|
|
}
|
|
|
|
public final void trackStart(boolean z2, Map<String, ? extends Object> map) {
|
|
Map<String, ? extends Object> mutableMap = h0.toMutableMap(map != null ? map : h0.emptyMap());
|
|
mutableMap.put("has_phone_number", Boolean.valueOf(StoreStream.Companion.getUsers().getMe().getPhoneNumber() != null));
|
|
AnalyticsTracker analyticsTracker = AnalyticsTracker.INSTANCE;
|
|
analyticsTracker.relationshipSyncFlow(ContactSyncAnalytics.CONTACT_SYNC_FLOW_KEY, "Flow Initialized", "Landing", 0, false, false, mutableMap);
|
|
if (z2) {
|
|
AnalyticsTracker.newUserOnboarding$default(analyticsTracker, ContactSyncAnalytics.CONTACT_SYNC_FLOW_KEY, "Flow Initialized", "Landing", null, false, 24, null);
|
|
}
|
|
}
|
|
}
|
|
|
|
public ContactSyncAnalytics() {
|
|
this(false, null, 3, null);
|
|
}
|
|
|
|
public ContactSyncAnalytics(boolean z2, Clock clock) {
|
|
m.checkNotNullParameter(clock, "clock");
|
|
this.isOnboarding = z2;
|
|
this.clock = clock;
|
|
this.lastStepTimestamp = clock.currentTimeMillis();
|
|
this.lastStep = "Landing";
|
|
}
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
|
public /* synthetic */ ContactSyncAnalytics(boolean z2, Clock clock, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this((i & 1) != 0 ? false : z2, (i & 2) != 0 ? ClockFactory.get() : clock);
|
|
}
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: com.discord.widgets.contact_sync.ContactSyncAnalytics */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static /* synthetic */ void trackEnd$default(ContactSyncAnalytics contactSyncAnalytics, boolean z2, Map map, int i, Object obj) {
|
|
if ((i & 2) != 0) {
|
|
map = null;
|
|
}
|
|
contactSyncAnalytics.trackEnd(z2, map);
|
|
}
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: com.discord.widgets.contact_sync.ContactSyncAnalytics */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static /* synthetic */ void trackFlowStep$default(ContactSyncAnalytics contactSyncAnalytics, String str, boolean z2, boolean z3, Map map, int i, Object obj) {
|
|
if ((i & 8) != 0) {
|
|
map = null;
|
|
}
|
|
contactSyncAnalytics.trackFlowStep(str, z2, z3, map);
|
|
}
|
|
|
|
public final Clock getClock() {
|
|
return this.clock;
|
|
}
|
|
|
|
public final boolean isOnboarding() {
|
|
return this.isOnboarding;
|
|
}
|
|
|
|
public final void trackEnd(boolean z2, Map<String, ? extends Object> map) {
|
|
long currentTimeMillis = this.clock.currentTimeMillis();
|
|
AnalyticsTracker analyticsTracker = AnalyticsTracker.INSTANCE;
|
|
analyticsTracker.relationshipSyncFlow(CONTACT_SYNC_FLOW_KEY, this.lastStep, "Complete", (int) ((currentTimeMillis - this.lastStepTimestamp) / ((long) 1000)), z2, false, map);
|
|
if (this.isOnboarding) {
|
|
analyticsTracker.newUserOnboarding(CONTACT_SYNC_FLOW_KEY, this.lastStep, "Complete", Long.valueOf(this.lastStepTimestamp), z2);
|
|
}
|
|
}
|
|
|
|
public final void trackFlowStep(String str, boolean z2, boolean z3, Map<String, ? extends Object> map) {
|
|
m.checkNotNullParameter(str, "toStep");
|
|
long currentTimeMillis = this.clock.currentTimeMillis();
|
|
AnalyticsTracker analyticsTracker = AnalyticsTracker.INSTANCE;
|
|
analyticsTracker.relationshipSyncFlow(CONTACT_SYNC_FLOW_KEY, this.lastStep, str, (int) ((currentTimeMillis - this.lastStepTimestamp) / ((long) 1000)), z2, z3, map);
|
|
if (this.isOnboarding) {
|
|
analyticsTracker.newUserOnboarding(CONTACT_SYNC_FLOW_KEY, this.lastStep, str, Long.valueOf(this.lastStepTimestamp), z2);
|
|
}
|
|
this.lastStepTimestamp = currentTimeMillis;
|
|
this.lastStep = str;
|
|
}
|
|
}
|