Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import org.javarosa.core.services.Logger;

import java.util.Date;
import java.util.Objects;

import javax.annotation.Nullable;

import androidx.navigation.NavController;
import androidx.navigation.NavDestination;
Expand All @@ -35,8 +36,6 @@
import static org.commcare.google.services.analytics.AnalyticsParamValue.VIDEO_USAGE_OTHER;
import static org.commcare.google.services.analytics.AnalyticsParamValue.VIDEO_USAGE_PARTIAL;

import javax.annotation.Nullable;

/**
* Created by amstone326 on 10/13/17.
*/
Expand Down Expand Up @@ -67,7 +66,7 @@ private static void reportEvent(String eventName, String[] paramKeys, String[] p
b.putString(paramKeys[i], paramVals[i]);
}
reportEvent(eventName, b);
} catch(Exception e) {
} catch (Exception e) {
Logger.exception("Error logging analytics event", e);
}
}
Expand All @@ -84,7 +83,7 @@ private static void reportEvent(String eventName, Bundle params) {

private static void setUserProperties(FirebaseAnalytics analyticsInstance) {
String deviceId = ReportingUtils.getDeviceId();
if(deviceId.length() > MAX_USER_PROPERTY_VALUE_LENGTH) {
if (deviceId.length() > MAX_USER_PROPERTY_VALUE_LENGTH) {
deviceId = deviceId.substring(deviceId.length() - MAX_USER_PROPERTY_VALUE_LENGTH);
}
analyticsInstance.setUserProperty(CCAnalyticsParam.DEVICE_ID, deviceId);
Expand Down Expand Up @@ -394,8 +393,8 @@ public static void reportCorruptAppState() {
}

/**
* Report when an RSA key is successfully retrieved from the keystore. This is to assess how many devices
* are using RSA keys, to then plan the deprecation of the RsaKeyStoreHandler.
* Report when an RSA key is successfully retrieved from the keystore. This is to assess how many devices
* are using RSA keys, to then plan the deprecation of the RsaKeyStoreHandler.
*/
public static void reportRsaKeyUse() {
reportEvent(CCAnalyticsEvent.COMMON_COMMCARE_EVENT,
Expand Down Expand Up @@ -431,6 +430,10 @@ public static void reportPersonalIdHeartbeatIntegritySubmission(String requestId
}

public static void reportPersonalIdIntegritySubmission(String trigger, String requestId, String responseCode) {
if (responseCode == null || responseCode.equals("null")) {
Logger.exception("Integrity Check", new Exception("Null response code in integrity check: " + responseCode));
}

Bundle b = new Bundle();
b.putString(CCAnalyticsParam.REQUEST_ID, requestId);
b.putString(CCAnalyticsParam.TRIGGER, trigger);
Expand Down Expand Up @@ -497,8 +500,8 @@ public static void reportCccApiClaimJob(boolean success) {
public static void reportCccApiDeliveryProgress(boolean success, @Nullable String deliveryInfo) {
Bundle b = new Bundle();
b.putLong(CCAnalyticsParam.PARAM_API_SUCCESS, success ? 1 : 0);
if (deliveryInfo != null){
b.putString(CCAnalyticsParam.PARAM_API_SUCCESS_DELIVERY_INFO,deliveryInfo);
if (deliveryInfo != null) {
b.putString(CCAnalyticsParam.PARAM_API_SUCCESS_DELIVERY_INFO, deliveryInfo);
}
reportEvent(CCAnalyticsEvent.CCC_API_DELIVERY_PROGRESS, b);
}
Expand Down Expand Up @@ -537,14 +540,15 @@ public static void reportLoginClicks() {
reportEvent(CCAnalyticsEvent.LOGIN_CLICK);
}

public static void reportPersonalIDContinueClicked(String screenName,@Nullable String info) {
public static void reportPersonalIDContinueClicked(String screenName, @Nullable String info) {
Bundle params = new Bundle();
params.putString(FirebaseAnalytics.Param.SCREEN_NAME, screenName);
if (info != null) {
params.putString(CCAnalyticsParam.PERSONAL_ID_CONTINUE_CLICKED_INFO,info);
params.putString(CCAnalyticsParam.PERSONAL_ID_CONTINUE_CLICKED_INFO, info);
}
reportEvent(CCAnalyticsEvent.PERSONAL_ID_CONTINUE_CLICKED, params);
}

public static void reportPersonalIDMessageSent() {
reportEvent(CCAnalyticsEvent.PERSONAL_ID_MESSAGE_SENT);
}
Expand Down
Loading