in apps/sasquatch/src/main/java/com/microsoft/appcenter/sasquatch/activities/EventActivity.java [191:246]
public void send(View view) {
AnalyticsTransmissionTarget target = getSelectedTarget();
PersistenceFlag persistenceFlag = PersistenceFlag.values()[mPersistenceFlagSpinner.getSelectedItemPosition()];
int flags = getFlags(persistenceFlag);
String name = mName.getText().toString();
Map<String, String> properties = null;
EventProperties typedProperties = null;
if (mProperties.size() > 0) {
if (onlyStringProperties()) {
properties = readStringProperties();
} else {
typedProperties = new EventProperties();
for (TypedPropertyFragment fragment : mProperties) {
fragment.set(typedProperties);
}
}
}
/* First item is always empty as it's default value which means either AppCenter, one collector or both. */
for (int i = 0; i < getNumberOfLogs(); i++) {
boolean useExplicitFlags = persistenceFlag != PersistenceFlag.DEFAULT;
if (target == null) {
if (properties != null) {
if (useExplicitFlags) {
Analytics.trackEvent(name, properties, flags);
} else {
Analytics.trackEvent(name, properties);
}
} else if (typedProperties != null || useExplicitFlags) {
if (useExplicitFlags) {
Analytics.trackEvent(name, typedProperties, flags);
} else {
Analytics.trackEvent(name, typedProperties);
}
} else {
Analytics.trackEvent(name);
}
} else {
if (properties != null) {
if (useExplicitFlags) {
target.trackEvent(name, properties, flags);
} else {
target.trackEvent(name, properties);
}
} else if (typedProperties != null || useExplicitFlags) {
if (useExplicitFlags) {
target.trackEvent(name, typedProperties, flags);
} else {
target.trackEvent(name, typedProperties);
}
} else {
target.trackEvent(name);
}
}
}
}