正在查看: Petal Maps v4.7.0.310001 应用的 OperationReportUtils.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Petal Maps v4.7.0.310001 应用的 OperationReportUtils.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.huawei.hiassistant.platform.base.report;
import android.content.Context;
import android.os.LocaleList;
import android.text.TextUtils;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException;
import com.huawei.hiai.nlu.sdk.NLUConstants;
import com.huawei.hiai.pdk.bigreport.BigReportKeyValue;
import com.huawei.hiai.pdk.dataservice.DataServiceConstants;
import com.huawei.hiassistant.platform.base.bean.InteractionIdInfo;
import com.huawei.hiassistant.platform.base.bean.NlpRecognizeInfo;
import com.huawei.hiassistant.platform.base.bean.VoiceContact;
import com.huawei.hiassistant.platform.base.bean.recognize.VoiceKitMessage;
import com.huawei.hiassistant.platform.base.bean.util.GsonUtils;
import com.huawei.hiassistant.platform.base.fullduplex.FullDuplex;
import com.huawei.hiassistant.platform.base.module.ModuleInstanceFactory;
import com.huawei.hiassistant.platform.base.northinterface.recognize.RecognizerIntent;
import com.huawei.hiassistant.platform.base.report.OperationReportUtils;
import com.huawei.hiassistant.platform.base.report.fault.DefaultFaultReporter;
import com.huawei.hiassistant.platform.base.report.fault.FaultEventReportConstants;
import com.huawei.hiassistant.platform.base.util.BusinessFlowId;
import com.huawei.hiassistant.platform.base.util.ContactUtils;
import com.huawei.hiassistant.platform.base.util.DeviceUtil;
import com.huawei.hiassistant.platform.base.util.IAssistantConfig;
import com.huawei.hiassistant.platform.base.util.KitLog;
import com.huawei.hiassistant.platform.base.util.NetworkUtil;
import com.huawei.hiassistant.platform.base.util.OperationReportConstants;
import com.huawei.hiassistant.platform.base.util.PackageUtil;
import com.huawei.hms.framework.common.hianalytics.CrashHianalyticsData;
import com.huawei.hms.framework.common.hianalytics.WiseOpenHianalyticsData;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
public class OperationReportUtils {
private static final String AND = "&";
public static final int DEF_HASH_MAP_SIZE = 16;
private static final String TAG = "OperationReportUtils";
private static final Map<String, String> TASK_TYPE_MAP;
private static final long TIME_OUT = 8000;
private OperationReportConstants.ActiveInteractionRequestRecord activeInteractionRequestRecord;
private String appId;
private OperationReportConstants.BusinessFlowRecognizeRecord businessFlowRecognizeRecord;
private OperationReportConstants.ChatModeReportRecord chatModeReportRecord;
private OperationReportConstants.ContactUploadInfoRecord contactUploadInfoRecord;
private OperationReportConstants.DelayTimeRecord delayTimeRecord;
private String deviceType;
private OperationReportConstants.DsRegisterRecord dsRegisterRecord;
private OperationReportConstants.GrsInfoRecord grsInfoRecord;
private OperationReportConstants.IntentionExecuteRecord intentionExecuteRecord;
private OperationReportConstants.InterruptRecord interruptRecord;
private OperationReportConstants.KitLifeCycleRecord kitLifeCycleRecord;
private OperationReportConstants.MultiIntentRecord multiIntentRecord;
private OperationReportConstants.NetworkChecker90006 networkChecker90006;
private OperationReportConstants.NetworkStatusCollection networkStatusCollection;
private OperationReportConstants.OperationNluIntentionCollect operationNluIntentionCollect;
private OperationReportConstants.ProviderExecuteRecord providerExecuteRecord;
private OperationReportConstants.RecognizerSwitchCollection90005 recognizerSwitchCollection90005;
private OperationReportConstants.RecordTypeRecord recordTypeRecord;
private OperationReportConstants.SkillDistributionRecord skillDistributionRecord;
private int startUpMode;
private OperationReportConstants.SwitchToHiaiCollection90007 switchToHiaiCollection90007;
private OperationReportConstants.TimeOutRecord timeOutRecord;
private OperationReportConstants.TtsRecord ttsRecord;
private OperationReportConstants.WebSocketLifeCycleRecord webSocketLifeCycleRecord;
public static class SingletonHolder {
private static final OperationReportUtils INSTANCE = new OperationReportUtils();
private SingletonHolder() {
}
}
static {
HashMap hashMap = new HashMap(4);
TASK_TYPE_MAP = hashMap;
hashMap.put("MULTITURN", "1");
hashMap.put("CARRYON", "2");
hashMap.put("FOLLOWUP", "3");
hashMap.put("NEW", "4");
}
private void addNetworkCheckCostInfo(LinkedHashMap<String, String> linkedHashMap) {
List<Integer> networkCheckCostList = this.networkChecker90006.getNetworkCheckCostList();
int size = networkCheckCostList != null ? networkCheckCostList.size() : 0;
for (int i = 1; i <= size; i++) {
linkedHashMap.put("R" + i, String.valueOf(networkCheckCostList.get(i - 1)));
}
for (int i2 = size + 1; i2 <= 20; i2++) {
linkedHashMap.put("R" + i2, String.valueOf(-2));
}
}
private String buildStr(List<String> list) {
if (list.size() == 0) {
return "";
}
StringBuilder sb = new StringBuilder();
Iterator<String> it = list.iterator();
while (it.hasNext()) {
sb.append(it.next());
sb.append("|");
}
return sb.substring(0, sb.length() - 1);
}
private void convertValidNluMaintenance() {
if (this.operationNluIntentionCollect.getRunTime() > 60000 || this.operationNluIntentionCollect.getRunTime() < 0) {
this.operationNluIntentionCollect.setRunTime(0L);
this.operationNluIntentionCollect.setAsrErrorCode(OperationReportConstants.ASR_ERROR_CODE_UNKNOW);
}
if (this.operationNluIntentionCollect.getVoiceStreamTime() > 60000 || this.operationNluIntentionCollect.getVoiceStreamTime() < 0) {
this.operationNluIntentionCollect.setVoiceStreamTime(0L);
this.operationNluIntentionCollect.setAsrErrorCode(OperationReportConstants.ASR_ERROR_CODE_UNKNOW);
}
if (this.operationNluIntentionCollect.getLastWordCost() > 60000 || this.operationNluIntentionCollect.getLastWordCost() < 0) {
this.operationNluIntentionCollect.setLastWordCost(0L);
this.operationNluIntentionCollect.setAsrErrorCode(OperationReportConstants.ASR_ERROR_CODE_UNKNOW);
}
if (this.operationNluIntentionCollect.getFirstWordCost() > 60000 || this.operationNluIntentionCollect.getFirstWordCost() < 0) {
this.operationNluIntentionCollect.setFirstWordCost(0L);
this.operationNluIntentionCollect.setAsrErrorCode(OperationReportConstants.ASR_ERROR_CODE_UNKNOW);
}
}
private String generateFullDuplexState(LinkedHashMap<String, String> linkedHashMap) {
try {
return FullDuplex.stateManager().getCurrentState(InteractionIdInfo.build(linkedHashMap.get("session"), Short.parseShort(linkedHashMap.get("interaction")))) == FullDuplex.State.NONE ? "1" : "0";
} catch (NumberFormatException unused) {
KitLog.error(TAG, "parseShort error");
return "-1";
}
}
public static OperationReportUtils getInstance() {
return SingletonHolder.INSTANCE;
}
private String getNetworkStatusInfo() {
this.networkStatusCollection.setTranslocationId(DeviceUtil.getDevF(IAssistantConfig.getInstance().getAppContext()) + "&" + BusinessFlowId.getInstance().getSessionId() + "&" + ((int) BusinessFlowId.getInstance().getInteractionId()));
this.networkStatusCollection.setNetType(NetworkUtil.getNetworkType(IAssistantConfig.getInstance().getAppContext()));
this.networkStatusCollection.setRsrp(ModuleInstanceFactory.Commander.networkCheckProvider().getRsrp());
this.networkStatusCollection.setNetQoeData(ModuleInstanceFactory.Commander.networkCheckProvider().getNetworkQoeInfo());
this.networkStatusCollection.setNetCheckResult(ModuleInstanceFactory.Commander.networkCheckProvider().isHiVoiceAvailable() ? 1 : 0);
String json = GsonUtils.toJson(this.networkStatusCollection);
this.networkStatusCollection.reset();
return json;
}
private boolean isInValidTimeRecord(long j, long j2) {
return j == 0 || j2 == 0 || j2 < j;
}
public static boolean lambda$reportCallFault$0(NlpRecognizeInfo nlpRecognizeInfo) {
return TextUtils.equals(nlpRecognizeInfo.getIntentName(), "CALL");
}
public static String lambda$reportCallFault$1(NlpRecognizeInfo nlpRecognizeInfo) {
boolean z = false;
String str = "";
for (JsonObject jsonObject : nlpRecognizeInfo.getSlots()) {
if (jsonObject != null) {
String asString = jsonObject.get("name").getAsString();
JsonArray asJsonArray = jsonObject.getAsJsonArray("origValue");
if (TextUtils.equals(asString, "contact") && asJsonArray != null && asJsonArray.size() > 0) {
str = asJsonArray.get(0).getAsString();
} else if (TextUtils.equals(asString, "matchResult.contact")) {
z = true;
} else {
KitLog.debug(TAG, "othe type:{}", jsonObject.get("name").getAsString());
}
}
}
return (TextUtils.isEmpty(str) || z) ? "" : str;
}
public static boolean lambda$reportCallFault$2(String str) {
return !TextUtils.isEmpty(str);
}
public void lambda$reportCallFault$3(String str) {
Context appContext = IAssistantConfig.getInstance().getAppContext();
List<VoiceContact> contactByDisplayName = ContactUtils.getContactByDisplayName(appContext, str);
if (contactByDisplayName == null || contactByDisplayName.isEmpty()) {
return;
}
DefaultFaultReporter.getInstance().getFaultRecord().setErrorCode(OperationReportConstants.CONTACT_NOT_FOUND_ERROR).setDescription("contact exist on phone").setAppVersion(PackageUtil.getAppVersionByCache(appContext)).setAppPkgName(appContext.getPackageName());
DefaultFaultReporter.getInstance().reportFault(FaultEventReportConstants.MAKE_CALL_ERROR);
this.operationNluIntentionCollect.setAppErrorCode(OperationReportConstants.CONTACT_NOT_FOUND_ERROR);
}
public static String parseDevicesListToReport(String str) {
JsonArray asJsonArray;
if (TextUtils.isEmpty(str)) {
KitLog.info(TAG, "parseDevicesListToReport devicesListFormDis is empty");
return "";
}
try {
asJsonArray = new JsonParser().parse(str).getAsJsonObject().getAsJsonArray("deviceList");
} catch (IllegalStateException unused) {
KitLog.error(TAG, "deviceList not a jsonObject");
} catch (JsonSyntaxException unused2) {
KitLog.error(TAG, "device type is wrong");
}
if (asJsonArray == null) {
return "";
}
Iterator it = asJsonArray.iterator();
while (it.hasNext()) {
JsonObject asJsonObject = ((JsonElement) it.next()).getAsJsonObject();
if (asJsonObject != null && asJsonObject.has("distanceType")) {
return TextUtils.equals(asJsonObject.get("distanceType").getAsString(), "local") ? asJsonObject.get("devType").getAsString() : "";
}
}
return "";
}
private void reportBusinessFlowRecognizeRecord() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
linkedHashMap.put("deviceId", DeviceUtil.getReporterUdid());
}
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put("dialog", this.businessFlowRecognizeRecord.getDialogId());
linkedHashMap.put("interaction", this.businessFlowRecognizeRecord.getTurnId());
linkedHashMap.put("domain", this.businessFlowRecognizeRecord.getDomainId());
linkedHashMap.put("subDomain", this.businessFlowRecognizeRecord.getSubDomainId());
linkedHashMap.put("intent", this.businessFlowRecognizeRecord.getIntentId());
linkedHashMap.put("asr", this.businessFlowRecognizeRecord.getAsrResult());
linkedHashMap.put("nlp", this.businessFlowRecognizeRecord.getNlpResult());
linkedHashMap.put("isFinished", this.businessFlowRecognizeRecord.getFinished());
linkedHashMap.put("directive", this.businessFlowRecognizeRecord.getDirectives());
linkedHashMap.put("taskType", this.businessFlowRecognizeRecord.getTaskType());
linkedHashMap.put("missSlot", this.businessFlowRecognizeRecord.getMissSlot());
linkedHashMap.put("slotType", this.businessFlowRecognizeRecord.getFilledSlots());
linkedHashMap.put("slotLowLevel", this.businessFlowRecognizeRecord.getSlotLowLevel());
linkedHashMap.put("totalSlot", this.businessFlowRecognizeRecord.getTotalSlot());
linkedHashMap.put(BigReportKeyValue.KEY_DETAIL_RESULT, this.businessFlowRecognizeRecord.getDetailResult());
linkedHashMap.put("isChangeDomain", String.valueOf(this.businessFlowRecognizeRecord.isChangeDomain()));
linkedHashMap.put("deviceType", this.deviceType);
linkedHashMap.put("netType", String.valueOf(NetworkUtil.getNetworkState(IAssistantConfig.getInstance().getAppContext())));
linkedHashMap.put("oda", this.businessFlowRecognizeRecord.getOda());
linkedHashMap.put("modeStates", this.businessFlowRecognizeRecord.getModeStates());
linkedHashMap.put("nluProvider", this.businessFlowRecognizeRecord.getNluProvider());
linkedHashMap.put("intentName", this.businessFlowRecognizeRecord.getIntentName());
linkedHashMap.put("intentLevel", this.businessFlowRecognizeRecord.getIntentLevel());
linkedHashMap.put("nluIntentId", this.businessFlowRecognizeRecord.getNluIntentId());
linkedHashMap.put("nluIntentName", this.businessFlowRecognizeRecord.getNluIntentName());
linkedHashMap.put("finalNluIntentId", this.businessFlowRecognizeRecord.getFinalNluIntentId());
linkedHashMap.put("finalNluIntentName", this.businessFlowRecognizeRecord.getFinalNluIntentName());
linkedHashMap.put("skillTriggerWord", this.businessFlowRecognizeRecord.getSkillTriggerWord());
linkedHashMap.put("subError", this.businessFlowRecognizeRecord.getSubError());
linkedHashMap.put("skillId", this.businessFlowRecognizeRecord.getSkillId());
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, true, OperationReportConstants.BUSSINESS_FLOW_RECOGNIZE_STATISTIC_OBJECT, linkedHashMap);
if (!DeviceUtil.isOversea()) {
ReportFactory.getReporter("maintenance").reportEvent(0, true, OperationReportConstants.BUSSINESS_FLOW_RECOGNIZE_STATISTIC_OBJECT, linkedHashMap);
}
this.businessFlowRecognizeRecord.reset();
}
private void reportNluMaintenance() {
LinkedHashMap linkedHashMap = new LinkedHashMap();
linkedHashMap.put("deviceType", String.valueOf(DeviceUtil.getDeviceName()));
linkedHashMap.put("appLanguage", IAssistantConfig.getCurrentVoiceLang());
linkedHashMap.put("systemLanguage", LocaleList.getDefault().get(0) == null ? "" : LocaleList.getDefault().get(0).getLanguage());
linkedHashMap.put(BigReportKeyValue.KEY_SERVER_URL, this.operationNluIntentionCollect.getAsServerUrl());
linkedHashMap.put("startTime", String.valueOf(this.operationNluIntentionCollect.getSpeechStartTime()));
linkedHashMap.put("endTime", String.valueOf(this.operationNluIntentionCollect.getSpeechEndTime()));
linkedHashMap.put("firstWordCost", String.valueOf(this.operationNluIntentionCollect.getFirstWordCost()));
linkedHashMap.put("lastWordCost", String.valueOf(this.operationNluIntentionCollect.getLastWordCost() >= 0 ? this.operationNluIntentionCollect.getLastWordCost() : 0L));
linkedHashMap.put("asrErrorCode", String.valueOf(this.operationNluIntentionCollect.getAsrErrorCode()));
linkedHashMap.put("voiceStreamTime", String.valueOf(this.operationNluIntentionCollect.getVoiceStreamTime()));
linkedHashMap.put("uploadVoiceSize", String.valueOf(this.operationNluIntentionCollect.getUploadVoiceSize()));
linkedHashMap.put(BigReportKeyValue.KEY_RUN_TIME, String.valueOf(this.operationNluIntentionCollect.getRunTime()));
linkedHashMap.put("domain", this.operationNluIntentionCollect.getNluDomainId());
linkedHashMap.put("intent", this.operationNluIntentionCollect.getNluIntent());
linkedHashMap.put("nluErrorCode", String.valueOf(this.operationNluIntentionCollect.getNluErrorCode()));
linkedHashMap.put("detailResults", this.operationNluIntentionCollect.getDetailResults());
linkedHashMap.put("reqType", this.operationNluIntentionCollect.getReqType());
linkedHashMap.put("appErrorCode", String.valueOf(this.operationNluIntentionCollect.getAppErrorCode()));
linkedHashMap.put("translocationId", this.operationNluIntentionCollect.getTranslocationId());
linkedHashMap.put("netProt", this.operationNluIntentionCollect.getNetProtocol());
linkedHashMap.put("startUpMode", String.valueOf(this.startUpMode));
linkedHashMap.put("sessionId", this.operationNluIntentionCollect.getSessionId());
linkedHashMap.put("interactionId", String.valueOf((int) this.operationNluIntentionCollect.getInteractionId()));
ReportFactory.getReporter("maintenance").reportEvent(1, false, OperationReportConstants.EVENT_MAINTENANCE_VOICEKIT_NLU, linkedHashMap);
this.operationNluIntentionCollect.reset();
}
private void resetTime() {
this.operationNluIntentionCollect.setSpeechStartTime(0L);
this.operationNluIntentionCollect.setSpeechEndTime(0L);
this.operationNluIntentionCollect.setFirstWordCost(0L);
this.operationNluIntentionCollect.setLastWordCost(0L);
this.operationNluIntentionCollect.setVoiceStreamTime(0L);
this.operationNluIntentionCollect.setFirstAsrRepliedTime(0L);
this.operationNluIntentionCollect.setLastAsrRepliedTime(0L);
this.operationNluIntentionCollect.setUploadVoiceSize(0L);
}
private void uploadData90005() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
linkedHashMap.put("deviceType", this.recognizerSwitchCollection90005.getDeviceType());
linkedHashMap.put("translocationId", this.recognizerSwitchCollection90005.getTranslocationId());
linkedHashMap.put("app", this.recognizerSwitchCollection90005.getApp());
linkedHashMap.put("session", this.recognizerSwitchCollection90005.getSession());
linkedHashMap.put("interaction", String.valueOf((int) this.recognizerSwitchCollection90005.getInteraction()));
linkedHashMap.put("lastNetCheckTime", String.valueOf(this.recognizerSwitchCollection90005.getLastNetCheckTime()));
linkedHashMap.put("lastNetCheckRes", this.recognizerSwitchCollection90005.getLastNetCheckRes());
linkedHashMap.put("curTimestamp", String.valueOf(this.recognizerSwitchCollection90005.getCurTimestamp()));
linkedHashMap.put("last5NetCheckDetail", this.recognizerSwitchCollection90005.getLast5NetCheckDetail());
if (DeviceUtil.isOversea()) {
return;
}
ReportFactory.getReporter("maintenance").reportEvent(1, false, OperationReportConstants.EVENT_MAINTENANCE_SWITCH_RECOGNIZER, linkedHashMap);
}
private void uploadData90006() {
LinkedHashMap<String, String> linkedHashMap = new LinkedHashMap<>(16);
linkedHashMap.put("deviceType", this.networkChecker90006.getDeviceType());
linkedHashMap.put("translocationId", this.networkChecker90006.getTranslocationId());
linkedHashMap.put("app", this.networkChecker90006.getApp());
linkedHashMap.put("session", this.networkChecker90006.getSessionId());
linkedHashMap.put("interaction", String.valueOf((int) this.networkChecker90006.getInteractionId()));
linkedHashMap.put("startCondition", this.networkChecker90006.getStartCondition());
linkedHashMap.put("result", this.networkChecker90006.getAllResult());
linkedHashMap.put("failCount", String.valueOf(this.networkChecker90006.getFailedCount()));
linkedHashMap.put("maxContinousFailCount", String.valueOf(this.networkChecker90006.getMaxContinuousFailedCount()));
addNetworkCheckCostInfo(linkedHashMap);
if (DeviceUtil.isOversea()) {
return;
}
ReportFactory.getReporter("maintenance").reportEvent(1, false, OperationReportConstants.EVENT_MAINTENANCE_NET_CHECKER_RESULT, linkedHashMap);
}
private void uploadData90007() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
linkedHashMap.put("deviceType", this.switchToHiaiCollection90007.getDeviceType());
linkedHashMap.put("translocationId", this.switchToHiaiCollection90007.getTranslocationId());
linkedHashMap.put("app", this.switchToHiaiCollection90007.getApp());
linkedHashMap.put("session", this.switchToHiaiCollection90007.getSession());
linkedHashMap.put("interaction", String.valueOf((int) this.switchToHiaiCollection90007.getInteraction()));
linkedHashMap.put("lastNetCheckTime", String.valueOf(this.switchToHiaiCollection90007.getLastNetCheckTime()));
linkedHashMap.put("lastNetCheckRes", this.switchToHiaiCollection90007.getLastNetCheckRes());
linkedHashMap.put("curTimestamp", String.valueOf(this.switchToHiaiCollection90007.getCurTimestamp()));
linkedHashMap.put("recognizeType", this.switchToHiaiCollection90007.getRecognizeType());
linkedHashMap.put("netType", this.switchToHiaiCollection90007.getNetType());
linkedHashMap.put("errorCode", String.valueOf(this.switchToHiaiCollection90007.getErrorCode()));
linkedHashMap.put("initalNetworkState", String.valueOf(this.switchToHiaiCollection90007.isInitalNetworkState()));
linkedHashMap.put("retry", String.valueOf(this.switchToHiaiCollection90007.isRetry()));
if (!DeviceUtil.isOversea()) {
ReportFactory.getReporter("maintenance").reportEvent(1, false, OperationReportConstants.EVENT_MAINTENANCE_SWITCH_TO_HIAI, linkedHashMap);
ReportFactory.getReporter("maintenance").reportEvent(0, false, OperationReportConstants.HIAI_NET_AVAILABLE_STATISTIC_OBJECT, linkedHashMap);
}
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.HIAI_NET_AVAILABLE_STATISTIC_OBJECT, linkedHashMap);
}
public OperationReportConstants.ActiveInteractionRequestRecord getActiveInteractionRequestRecord() {
return this.activeInteractionRequestRecord;
}
public String getAppId() {
return this.appId;
}
public OperationReportConstants.BusinessFlowRecognizeRecord getBusinessFlowRecognizeRecord() {
return this.businessFlowRecognizeRecord;
}
public OperationReportConstants.ChatModeReportRecord getChatModeReportRecord() {
return this.chatModeReportRecord;
}
public OperationReportConstants.ContactUploadInfoRecord getContactUploadInfoRecord() {
return this.contactUploadInfoRecord;
}
public OperationReportConstants.DelayTimeRecord getDelayTimeRecord() {
return this.delayTimeRecord;
}
public String getDeviceType() {
return this.deviceType;
}
public OperationReportConstants.DsRegisterRecord getDsRegisterRecord() {
return this.dsRegisterRecord;
}
public OperationReportConstants.GrsInfoRecord getGrsInfoRecord() {
return this.grsInfoRecord;
}
public OperationReportConstants.IntentionExecuteRecord getIntentionExecuteRecord() {
return this.intentionExecuteRecord;
}
public OperationReportConstants.InterruptRecord getInterruptRecord() {
return this.interruptRecord;
}
public OperationReportConstants.KitLifeCycleRecord getKitLifeCycleRecord() {
return this.kitLifeCycleRecord;
}
public OperationReportConstants.MultiIntentRecord getMultiIntentRecord() {
return this.multiIntentRecord;
}
public OperationReportConstants.NetworkChecker90006 getNetworkChecker90006() {
return this.networkChecker90006;
}
public OperationReportConstants.NetworkStatusCollection getNetworkStatusCollection() {
return this.networkStatusCollection;
}
public OperationReportConstants.OperationNluIntentionCollect getOperationNluIntentionCollect() {
return this.operationNluIntentionCollect;
}
public OperationReportConstants.ProviderExecuteRecord getProviderExecuteRecord() {
return this.providerExecuteRecord;
}
public OperationReportConstants.RecognizerSwitchCollection90005 getRecognizerSwitchCollection90005() {
return this.recognizerSwitchCollection90005;
}
public OperationReportConstants.RecordTypeRecord getRecordTypeRecord() {
return this.recordTypeRecord;
}
public OperationReportConstants.SkillDistributionRecord getSkillDistributionRecord() {
return this.skillDistributionRecord;
}
public OperationReportConstants.SwitchToHiaiCollection90007 getSwitchToHiaiCollection90007() {
return this.switchToHiaiCollection90007;
}
public OperationReportConstants.TimeOutRecord getTimeOutRecord() {
return this.timeOutRecord;
}
public OperationReportConstants.TtsRecord getTtsRecord() {
return this.ttsRecord;
}
public OperationReportConstants.WebSocketLifeCycleRecord getWebSocketLifeCycleRecord() {
return this.webSocketLifeCycleRecord;
}
public void reportActiveInteractionRequestRecord() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
}
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put("dialog", String.valueOf(BusinessFlowId.getInstance().getDialogId()));
linkedHashMap.put("interaction", String.valueOf((int) BusinessFlowId.getInstance().getInteractionId()));
linkedHashMap.put("event", this.activeInteractionRequestRecord.getEvent());
linkedHashMap.put("type", this.activeInteractionRequestRecord.getType());
linkedHashMap.put("ruleId", this.activeInteractionRequestRecord.getRuleId());
linkedHashMap.put("ruleName", this.activeInteractionRequestRecord.getRuleName());
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.ACTIVE_VOICE_INTERACTION_EVENT_OPERATION_POINT, linkedHashMap);
if (!DeviceUtil.isOversea()) {
ReportFactory.getReporter("maintenance").reportEvent(0, false, OperationReportConstants.ACTIVE_VOICE_INTERACTION_EVENT_OPERATION_POINT, linkedHashMap);
}
this.activeInteractionRequestRecord.reset();
}
public void reportCallFault(VoiceKitMessage voiceKitMessage) {
KitLog.debug(TAG, "reportCallFault", new Object[0]);
voiceKitMessage.getNluRecognizer().filter(new Predicate() {
@Override
public final boolean test(Object obj) {
boolean lambda$reportCallFault$0;
lambda$reportCallFault$0 = OperationReportUtils.lambda$reportCallFault$0((NlpRecognizeInfo) obj);
return lambda$reportCallFault$0;
}
}).map(new Function() {
@Override
public final Object apply(Object obj) {
String lambda$reportCallFault$1;
lambda$reportCallFault$1 = OperationReportUtils.lambda$reportCallFault$1((NlpRecognizeInfo) obj);
return lambda$reportCallFault$1;
}
}).filter(new Predicate() {
@Override
public final boolean test(Object obj) {
boolean lambda$reportCallFault$2;
lambda$reportCallFault$2 = OperationReportUtils.lambda$reportCallFault$2((String) obj);
return lambda$reportCallFault$2;
}
}).ifPresent(new Consumer() {
@Override
public final void accept(Object obj) {
OperationReportUtils.this.lambda$reportCallFault$3((String) obj);
}
});
}
public void reportChatModeRecord() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (TextUtils.isEmpty(this.chatModeReportRecord.getAbility()) || TextUtils.isEmpty(this.chatModeReportRecord.getDialogId())) {
KitLog.warn(TAG, "invalid chat report");
this.chatModeReportRecord.reset();
return;
}
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
}
linkedHashMap.put("session", this.chatModeReportRecord.getSessionId());
linkedHashMap.put("dialog", this.chatModeReportRecord.getDialogId());
linkedHashMap.put("interaction", this.chatModeReportRecord.getInteractionId());
linkedHashMap.put("cpname", this.chatModeReportRecord.getCpName());
linkedHashMap.put("ability", this.chatModeReportRecord.getAbility());
linkedHashMap.put("abtestInfo", this.chatModeReportRecord.getAbtestInfo());
ReportFactory.getReporter("maintenance").reportEvent(0, false, 522, linkedHashMap);
this.chatModeReportRecord.reset();
}
public void reportContactUploadInfo() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
linkedHashMap.put("deviceId", DeviceUtil.getReporterUdid());
}
linkedHashMap.put("dialog", String.valueOf(BusinessFlowId.getInstance().getDialogId()));
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put("interaction", String.valueOf((int) BusinessFlowId.getInstance().getInteractionId()));
linkedHashMap.put("contactNum", String.valueOf(this.contactUploadInfoRecord.getContactNum()));
linkedHashMap.put("uploadNum", String.valueOf(this.contactUploadInfoRecord.getUploadNum()));
linkedHashMap.put("result", this.contactUploadInfoRecord.getResult());
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.OPERATION_REPORT_EVENTID_CONTACT, linkedHashMap);
if (!DeviceUtil.isOversea()) {
ReportFactory.getReporter("maintenance").reportEvent(0, false, OperationReportConstants.OPERATION_REPORT_EVENTID_CONTACT, linkedHashMap);
}
this.contactUploadInfoRecord.reset();
}
public void reportCoordinationDecisionResult(OperationReportConstants.CoordinationDecisionInfoRecord coordinationDecisionInfoRecord) {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
}
linkedHashMap.put("session", coordinationDecisionInfoRecord.getSession().getSessionId());
linkedHashMap.put("dialog", String.valueOf(coordinationDecisionInfoRecord.getSession().getDialogId()));
linkedHashMap.put("interaction", String.valueOf((int) coordinationDecisionInfoRecord.getSession().getInteractionId()));
linkedHashMap.put("messageId", coordinationDecisionInfoRecord.getSession().getMessageId());
linkedHashMap.put("audioStreamId", coordinationDecisionInfoRecord.getSession().getAudioStreamId());
linkedHashMap.put("domain", coordinationDecisionInfoRecord.getDomainId());
linkedHashMap.put("subDomain", coordinationDecisionInfoRecord.getSubDomainId());
linkedHashMap.put("intent", coordinationDecisionInfoRecord.getIntentId());
linkedHashMap.put("result", coordinationDecisionInfoRecord.getDecisionResult());
linkedHashMap.put("decisionTime", coordinationDecisionInfoRecord.getDecisionTime());
linkedHashMap.put("decisionType", coordinationDecisionInfoRecord.getDecisionType());
linkedHashMap.put("hiaiStatus", coordinationDecisionInfoRecord.getHiaiStatus());
linkedHashMap.put("hiaiResultTime", coordinationDecisionInfoRecord.getHiaiResultTime());
linkedHashMap.put("cloudStatus", coordinationDecisionInfoRecord.getCloudStatus());
linkedHashMap.put("cloudResultTime", coordinationDecisionInfoRecord.getCloudResultTime());
linkedHashMap.put("hiaiIntentId", coordinationDecisionInfoRecord.getHiaiIntentId());
linkedHashMap.put("cloudIntentId", coordinationDecisionInfoRecord.getCloudIntentId());
linkedHashMap.put("unmatchType", coordinationDecisionInfoRecord.getUnmatchType());
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.COORDINATION_DECISION_RESULT_STATISTIC_OBJECT, linkedHashMap);
if (DeviceUtil.isOversea()) {
return;
}
ReportFactory.getReporter("maintenance").reportEvent(0, false, OperationReportConstants.COORDINATION_DECISION_RESULT_STATISTIC_OBJECT, linkedHashMap);
}
public void reportDataUpstream(String str, String str2) {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
}
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put("dialog", String.valueOf(BusinessFlowId.getInstance().getDialogId()));
linkedHashMap.put("interaction", String.valueOf((int) BusinessFlowId.getInstance().getInteractionId()));
linkedHashMap.put("deviceType", this.deviceType);
linkedHashMap.put("netType", String.valueOf(NetworkUtil.getNetworkState(IAssistantConfig.getInstance().getAppContext())));
linkedHashMap.put("oda", str);
linkedHashMap.put("type", str2);
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.DATA_UPSTREAM_STATISTIC_OBJECT, linkedHashMap);
if (DeviceUtil.isOversea()) {
return;
}
ReportFactory.getReporter("maintenance").reportEvent(0, false, OperationReportConstants.DATA_UPSTREAM_STATISTIC_OBJECT, linkedHashMap);
}
public void reportDelayTimeRecord() {
if ("-1".equals(this.delayTimeRecord.getInteraction())) {
this.delayTimeRecord.reset();
return;
}
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
linkedHashMap.put("deviceId", DeviceUtil.getReporterUdid());
}
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put("interaction", this.delayTimeRecord.getInteraction());
linkedHashMap.put("T1", this.delayTimeRecord.getRecordStartTime() == 0 ? "-1" : String.valueOf(this.delayTimeRecord.getRecordStartTime()));
linkedHashMap.put("T2", this.delayTimeRecord.getSpeechStartTime() == 0 ? "-1" : String.valueOf(this.delayTimeRecord.getSpeechStartTime() - this.delayTimeRecord.getRecordStartTime()));
linkedHashMap.put("T3", this.delayTimeRecord.getFirstAsrTime() == 0 ? "-1" : String.valueOf(this.delayTimeRecord.getFirstAsrTime() - this.delayTimeRecord.getRecordStartTime()));
linkedHashMap.put("T4", this.delayTimeRecord.getSpeechEndTime() == 0 ? "-1" : String.valueOf(this.delayTimeRecord.getSpeechEndTime() - this.delayTimeRecord.getRecordStartTime()));
linkedHashMap.put("T5", this.delayTimeRecord.getLastAsrTime() == 0 ? "-1" : String.valueOf(this.delayTimeRecord.getLastAsrTime() - this.delayTimeRecord.getRecordStartTime()));
linkedHashMap.put("T6", this.delayTimeRecord.getRecordEndTime() == 0 ? "-1" : String.valueOf(this.delayTimeRecord.getRecordEndTime() - this.delayTimeRecord.getRecordStartTime()));
linkedHashMap.put("T7", this.delayTimeRecord.getIntentionExecuteStartTime() == 0 ? "-1" : String.valueOf(this.delayTimeRecord.getIntentionExecuteStartTime() - this.delayTimeRecord.getRecordStartTime()));
linkedHashMap.put("T8", this.delayTimeRecord.getTtsStartTime() == 0 ? "-1" : String.valueOf(this.delayTimeRecord.getTtsStartTime() - this.delayTimeRecord.getRecordStartTime()));
linkedHashMap.put("T9", this.delayTimeRecord.getTtsEndTime() == 0 ? "-1" : String.valueOf(this.delayTimeRecord.getTtsEndTime() - this.delayTimeRecord.getRecordStartTime()));
linkedHashMap.put("T10", this.delayTimeRecord.getIntentionExecuteEndTime() == 0 ? "-1" : String.valueOf(this.delayTimeRecord.getIntentionExecuteEndTime() - this.delayTimeRecord.getRecordStartTime()));
linkedHashMap.put("T11", this.delayTimeRecord.getCancelRecognizeTime() == 0 ? "-1" : String.valueOf(this.delayTimeRecord.getCancelRecognizeTime() - this.delayTimeRecord.getRecordStartTime()));
linkedHashMap.put("T12", this.delayTimeRecord.getCancelTtsTime() != 0 ? String.valueOf(this.delayTimeRecord.getCancelTtsTime() - this.delayTimeRecord.getRecordStartTime()) : "-1");
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.DELAY_TIME_STATISTIC_OBJECT, linkedHashMap);
if (!DeviceUtil.isOversea()) {
ReportFactory.getReporter("maintenance").reportEvent(0, false, OperationReportConstants.DELAY_TIME_STATISTIC_OBJECT, linkedHashMap);
}
this.delayTimeRecord.reset();
}
public void reportDirectiveExecuteResult(String str, int i) {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
}
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put("dialog", String.valueOf(BusinessFlowId.getInstance().getDialogId()));
linkedHashMap.put("interaction", String.valueOf((int) BusinessFlowId.getInstance().getInteractionId()));
linkedHashMap.put("directive", str);
linkedHashMap.put("result", String.valueOf(i));
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.DIRECTIVE_EXECUTE_STATISTIC_OBJECT, linkedHashMap);
if (DeviceUtil.isOversea()) {
return;
}
ReportFactory.getReporter("maintenance").reportEvent(0, false, OperationReportConstants.DIRECTIVE_EXECUTE_STATISTIC_OBJECT, linkedHashMap);
}
public void reportDirectivesReceived() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
}
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put("dialog", this.businessFlowRecognizeRecord.getDialogId());
linkedHashMap.put("interaction", this.businessFlowRecognizeRecord.getTurnId());
linkedHashMap.put("deviceType", this.deviceType);
linkedHashMap.put("netType", String.valueOf(NetworkUtil.getNetworkState(IAssistantConfig.getInstance().getAppContext())));
linkedHashMap.put("oda", this.businessFlowRecognizeRecord.getOda());
linkedHashMap.put("directives", this.businessFlowRecognizeRecord.getDirectives());
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.DIRECTIVES_DELIVERY_STATISTIC_OBJECT, linkedHashMap);
if (DeviceUtil.isOversea()) {
return;
}
ReportFactory.getReporter("maintenance").reportEvent(0, false, OperationReportConstants.DIRECTIVES_DELIVERY_STATISTIC_OBJECT, linkedHashMap);
}
public void reportDsRegisterInfo() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.kitLifeCycleRecord.getApp());
}
linkedHashMap.put("dialog", String.valueOf(BusinessFlowId.getInstance().getDialogId()));
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put("interaction", String.valueOf((int) BusinessFlowId.getInstance().getInteractionId()));
linkedHashMap.put(FaultEventReportConstants.APP_PACKAGE_NAME, this.kitLifeCycleRecord.getAppPkgName());
linkedHashMap.put("appPkgVersion", this.kitLifeCycleRecord.getAppPkgVersion());
linkedHashMap.put("voiceKitSdkVersion", this.kitLifeCycleRecord.getVoiceKitSdkVersion());
linkedHashMap.put("receiver", this.dsRegisterRecord.getReceiver());
linkedHashMap.put("interfacename", this.dsRegisterRecord.getInterfaceName());
linkedHashMap.put("retErrCode", Integer.valueOf(this.dsRegisterRecord.getRetErrCode()));
linkedHashMap.put(NLUConstants.NLP_REQ_TIMESTAMP, Long.valueOf(this.dsRegisterRecord.getTimestamp()));
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.DS_REGISTER_OPERATION_POINT, linkedHashMap);
if (!DeviceUtil.isOversea()) {
ReportFactory.getReporter("maintenance").reportEvent(0, false, OperationReportConstants.DS_REGISTER_OPERATION_POINT, linkedHashMap);
}
this.dsRegisterRecord.reset();
}
public void reportEndRecord() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
}
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put("dialog", String.valueOf(BusinessFlowId.getInstance().getDialogId()));
linkedHashMap.put("interaction", String.valueOf((int) BusinessFlowId.getInstance().getInteractionId()));
linkedHashMap.put("deviceType", this.deviceType);
linkedHashMap.put("count", String.valueOf(this.recordTypeRecord.getCount()));
linkedHashMap.put("endType", this.recordTypeRecord.getEndType());
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.END_RECORD_STATISTIC_OBJECT, linkedHashMap);
if (!DeviceUtil.isOversea()) {
ReportFactory.getReporter("maintenance").reportEvent(0, false, OperationReportConstants.END_RECORD_STATISTIC_OBJECT, linkedHashMap);
}
this.recordTypeRecord.setCount(0);
}
public void reportGetAuthCodeEvent(long j, String str) {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
}
linkedHashMap.put(CrashHianalyticsData.TIME, String.valueOf(j));
linkedHashMap.put("errorCode", str);
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, 2022, linkedHashMap);
if (DeviceUtil.isOversea()) {
return;
}
ReportFactory.getReporter("maintenance").reportEvent(0, false, 2022, linkedHashMap);
}
public void reportGrsInfo() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
linkedHashMap.put("deviceType", String.valueOf(DeviceUtil.getDeviceName()));
linkedHashMap.put("startTime", String.valueOf(this.grsInfoRecord.getStartTime()));
linkedHashMap.put("endTime", String.valueOf(this.grsInfoRecord.getEndTime()));
linkedHashMap.put(BigReportKeyValue.KEY_RUN_TIME, String.valueOf(this.grsInfoRecord.getRunTime()));
linkedHashMap.put("result", String.valueOf(this.grsInfoRecord.getResult()));
linkedHashMap.put(BigReportKeyValue.KEY_DETAIL_RESULT, String.valueOf(this.grsInfoRecord.getDetailResult()));
ReportFactory.getReporter("maintenance").reportEvent(1, false, OperationReportConstants.GET_GRS_INFO, linkedHashMap);
this.grsInfoRecord.reset();
}
public void reportIntentionExecuteRecord() {
LinkedHashMap<String, String> linkedHashMap = new LinkedHashMap<>(16);
if ("".equals(this.intentionExecuteRecord.getDialogId())) {
this.intentionExecuteRecord.reset(false);
return;
}
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
linkedHashMap.put("deviceId", DeviceUtil.getReporterUdid());
}
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put("dialog", this.intentionExecuteRecord.getDialogId());
linkedHashMap.put("interaction", this.intentionExecuteRecord.getInteractionId());
linkedHashMap.put("startTime", this.intentionExecuteRecord.getStartTime());
linkedHashMap.put("endTime", this.intentionExecuteRecord.getEndTime());
linkedHashMap.put("domain", this.intentionExecuteRecord.getDomain());
linkedHashMap.put("subDomain", this.intentionExecuteRecord.getSubDomain());
linkedHashMap.put("intent", this.intentionExecuteRecord.getIntent());
linkedHashMap.put("result", this.intentionExecuteRecord.getResult());
linkedHashMap.put("accomplish", this.intentionExecuteRecord.getAccomplish());
linkedHashMap.put("count", this.intentionExecuteRecord.getCount());
linkedHashMap.put("netType", this.intentionExecuteRecord.getNetType());
linkedHashMap.put("recognizer", this.intentionExecuteRecord.getRecognizer());
linkedHashMap.put("deviceType", this.deviceType);
linkedHashMap.put("fullDuplex", generateFullDuplexState(linkedHashMap));
linkedHashMap.put("language", IAssistantConfig.getCurrentVoiceLang());
linkedHashMap.put(BigReportKeyValue.KEY_PUSH_MESSAGE_FROM, this.intentionExecuteRecord.getSourceType());
linkedHashMap.put(RecognizerIntent.EXT_SPEECH_ACCENT, this.intentionExecuteRecord.getSpeechAccent());
linkedHashMap.put("modeStates", this.intentionExecuteRecord.getModeStates());
linkedHashMap.put("intentName", this.intentionExecuteRecord.getIntentName());
linkedHashMap.put("nluIntentId", this.intentionExecuteRecord.getNluIntentId());
linkedHashMap.put("nluIntentName", this.intentionExecuteRecord.getNluIntentName());
linkedHashMap.put("finalNluIntentId", this.intentionExecuteRecord.getFinalNluIntentId());
linkedHashMap.put("finalNluIntentName", this.intentionExecuteRecord.getFinalNluIntentName());
linkedHashMap.put("skillTriggerWord", this.intentionExecuteRecord.getSkillTriggerWord());
linkedHashMap.put("subError", this.intentionExecuteRecord.getSubError());
linkedHashMap.put("skillId", this.intentionExecuteRecord.getSkillId());
linkedHashMap.put("firstRoundIntentId", this.intentionExecuteRecord.getFirstRoundIntentId());
linkedHashMap.put("isChangeDomain", String.valueOf(this.intentionExecuteRecord.isChangeDomain()));
linkedHashMap.put("searchSources", this.intentionExecuteRecord.getSearchSources());
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.INTENTION_EXECUTION_STATISTIC_OBJECT, linkedHashMap);
if (!DeviceUtil.isOversea()) {
ReportFactory.getReporter("maintenance").reportEvent(0, true, OperationReportConstants.INTENTION_EXECUTION_STATISTIC_OBJECT, linkedHashMap);
}
this.intentionExecuteRecord.reset(false);
}
public void reportInterruptRecord() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
linkedHashMap.put("deviceId", DeviceUtil.getReporterUdid());
}
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put("dialog", this.interruptRecord.getDialogId());
linkedHashMap.put("interaction", this.interruptRecord.getInteraction());
linkedHashMap.put("breakDiag", this.interruptRecord.getBreakDiag());
linkedHashMap.put("startTime", this.interruptRecord.getStartTime());
linkedHashMap.put("resultTime", this.interruptRecord.getResultTime());
linkedHashMap.put("breakResult", this.interruptRecord.getBreakResult());
linkedHashMap.put("errorCode", this.interruptRecord.getErrorCode());
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.INTERRUPT_STATISTIC_OBJECT, linkedHashMap);
if (!DeviceUtil.isOversea()) {
ReportFactory.getReporter("maintenance").reportEvent(0, false, OperationReportConstants.INTERRUPT_STATISTIC_OBJECT, linkedHashMap);
}
this.interruptRecord.reset();
}
public void reportKitLifeCycleRecord() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.kitLifeCycleRecord.getApp());
linkedHashMap.put("deviceId", DeviceUtil.getReporterUdid());
}
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put(CrashHianalyticsData.TIME, String.valueOf(this.kitLifeCycleRecord.getEndTime() - this.kitLifeCycleRecord.getStartTime()));
linkedHashMap.put("deviceType", this.deviceType);
linkedHashMap.put(FaultEventReportConstants.APP_PACKAGE_NAME, this.kitLifeCycleRecord.getAppPkgName());
linkedHashMap.put("appPkgVersion", this.kitLifeCycleRecord.getAppPkgVersion());
linkedHashMap.put("voiceKitSdkVersion", this.kitLifeCycleRecord.getVoiceKitSdkVersion());
linkedHashMap.put(DataServiceConstants.IDS_RESULT_DESCRIP_RESULT_ERROR, this.kitLifeCycleRecord.getError());
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, 2020, linkedHashMap);
if (!DeviceUtil.isOversea()) {
ReportFactory.getReporter("maintenance").reportEvent(0, false, 2020, linkedHashMap);
}
this.kitLifeCycleRecord.reset();
}
public void reportMultiIntentRecord() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
}
linkedHashMap.put("session", this.multiIntentRecord.getSession());
linkedHashMap.put("dialog", this.multiIntentRecord.getDialog());
linkedHashMap.put("interaction", this.multiIntentRecord.getInteraction());
linkedHashMap.put("totalIndex", this.multiIntentRecord.getTotalIndex());
linkedHashMap.put("multiIntentInfo", this.multiIntentRecord.getMultiIntentInfo());
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.MULTI_INTENT_OPERATION_POINT, linkedHashMap);
if (!DeviceUtil.isOversea()) {
ReportFactory.getReporter("maintenance").reportEvent(0, false, OperationReportConstants.MULTI_INTENT_OPERATION_POINT, linkedHashMap);
}
this.multiIntentRecord.reset();
}
public void reportNetworkChecker90006() {
this.networkChecker90006.setDeviceType(this.deviceType);
String sessionId = BusinessFlowId.getInstance().getSessionId();
short interactionId = BusinessFlowId.getInstance().getInteractionId();
this.networkChecker90006.setTranslocationId(DeviceUtil.getDevF(IAssistantConfig.getInstance().getAppContext()) + "&" + sessionId + "&" + ((int) interactionId));
this.networkChecker90006.setSessionId(sessionId);
this.networkChecker90006.setInteractionId(interactionId);
if (!DeviceUtil.isOversea()) {
this.networkChecker90006.setApp(this.appId);
}
uploadData90006();
this.networkChecker90006.reset();
}
public void reportNluMaintenanceData(VoiceKitMessage voiceKitMessage) {
if (voiceKitMessage == null) {
KitLog.warn(TAG, "reportNluMaintenanceData failed, voiceResponse is null.");
return;
}
String str = DeviceUtil.getDevF(IAssistantConfig.getInstance().getAppContext()) + "&" + BusinessFlowId.getInstance().getSessionId() + "&" + ((int) BusinessFlowId.getInstance().getInteractionId());
this.operationNluIntentionCollect.setSessionId(BusinessFlowId.getInstance().getSessionId());
this.operationNluIntentionCollect.setInteractionId(BusinessFlowId.getInstance().getInteractionId());
this.operationNluIntentionCollect.setTranslocationId(str);
this.operationNluIntentionCollect.setNluErrorCode(voiceKitMessage.getOriErrorCode());
this.operationNluIntentionCollect.setNluDomainId(voiceKitMessage.getDomainId());
this.operationNluIntentionCollect.setNluIntent(voiceKitMessage.getIntentId());
this.operationNluIntentionCollect.setRunTime(System.currentTimeMillis() - getInstance().getOperationNluIntentionCollect().getSpeechEndTime());
this.operationNluIntentionCollect.setDetailResults(getNetworkStatusInfo());
this.operationNluIntentionCollect.setNetProtocol(voiceKitMessage.getNetProtocol());
if (TextUtils.equals(this.operationNluIntentionCollect.getReqType(), "voice")) {
if (this.operationNluIntentionCollect.getFirstAsrRepliedTime() == 0 || this.operationNluIntentionCollect.getSpeechEndTime() == 0 || this.operationNluIntentionCollect.getLastAsrRepliedTime() == 0) {
this.operationNluIntentionCollect.setAsrErrorCode(OperationReportConstants.ASR_ERROR_CODE_TIMEOUT);
}
OperationReportConstants.OperationNluIntentionCollect operationNluIntentionCollect = this.operationNluIntentionCollect;
operationNluIntentionCollect.setFirstWordCost(isInValidTimeRecord(operationNluIntentionCollect.getSpeechStartTime(), this.operationNluIntentionCollect.getFirstAsrRepliedTime()) ? 0L : this.operationNluIntentionCollect.getFirstAsrRepliedTime() - this.operationNluIntentionCollect.getSpeechStartTime());
OperationReportConstants.OperationNluIntentionCollect operationNluIntentionCollect2 = this.operationNluIntentionCollect;
operationNluIntentionCollect2.setLastWordCost(isInValidTimeRecord(operationNluIntentionCollect2.getSpeechEndTime(), this.operationNluIntentionCollect.getLastAsrRepliedTime()) ? 0L : this.operationNluIntentionCollect.getLastAsrRepliedTime() - this.operationNluIntentionCollect.getSpeechEndTime());
OperationReportConstants.OperationNluIntentionCollect operationNluIntentionCollect3 = this.operationNluIntentionCollect;
operationNluIntentionCollect3.setVoiceStreamTime(isInValidTimeRecord(operationNluIntentionCollect3.getSpeechStartTime(), this.operationNluIntentionCollect.getSpeechEndTime()) ? 0L : this.operationNluIntentionCollect.getSpeechEndTime() - this.operationNluIntentionCollect.getSpeechStartTime());
OperationReportConstants.OperationNluIntentionCollect operationNluIntentionCollect4 = this.operationNluIntentionCollect;
operationNluIntentionCollect4.setRunTime(operationNluIntentionCollect4.getSpeechEndTime() != 0 ? this.operationNluIntentionCollect.getRunTime() : 0L);
} else {
resetTime();
}
convertValidNluMaintenance();
reportNluMaintenance();
}
public void reportProviderExecuteRecord() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
}
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put("dialog", String.valueOf(BusinessFlowId.getInstance().getDialogId()));
linkedHashMap.put("intentName", this.providerExecuteRecord.getIntentName());
linkedHashMap.put("errorCode", this.providerExecuteRecord.getErrorCode());
linkedHashMap.put("errorSource", this.providerExecuteRecord.getErrorSource());
linkedHashMap.put("targetDevice", this.providerExecuteRecord.getTargetDevice());
linkedHashMap.put("targetScreenLocation", this.providerExecuteRecord.getTargetScreenLocation());
linkedHashMap.put(WiseOpenHianalyticsData.UNION_COSTTIME, String.valueOf(this.providerExecuteRecord.getEndTime() - this.providerExecuteRecord.getStartTime()));
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.PROVIDER_EXECUTE_OPERATION_POINT, linkedHashMap);
if (!DeviceUtil.isOversea()) {
ReportFactory.getReporter("maintenance").reportEvent(0, false, OperationReportConstants.PROVIDER_EXECUTE_OPERATION_POINT, linkedHashMap);
}
this.providerExecuteRecord.reset();
}
public void reportRecordTypeRecord() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
linkedHashMap.put("deviceId", DeviceUtil.getReporterUdid());
}
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put("interaction", String.valueOf((int) BusinessFlowId.getInstance().getInteractionId()));
linkedHashMap.put(RecognizerIntent.RECORD_TYPE, this.recordTypeRecord.getRecordType());
linkedHashMap.put("type", this.recordTypeRecord.getEndType());
linkedHashMap.put("deviceType", this.deviceType);
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, 2023, linkedHashMap);
if (DeviceUtil.isOversea()) {
return;
}
ReportFactory.getReporter("maintenance").reportEvent(0, false, 2023, linkedHashMap);
}
public void reportSkillDistributionRecord() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
linkedHashMap.put("deviceId", DeviceUtil.getReporterUdid());
}
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put("dialog", String.valueOf(BusinessFlowId.getInstance().getDialogId()));
linkedHashMap.put("type", this.skillDistributionRecord.getType());
linkedHashMap.put("fromDevType", this.skillDistributionRecord.getFromDevType());
linkedHashMap.put("destDevType", this.skillDistributionRecord.getDestDevType());
linkedHashMap.put("distance", this.skillDistributionRecord.getDistance());
linkedHashMap.put("result", this.skillDistributionRecord.getResult());
linkedHashMap.put("delay", this.skillDistributionRecord.getDelay());
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.SKILL_DISTRIBUTION_STATISTIC_OBJECT, linkedHashMap);
if (!DeviceUtil.isOversea()) {
ReportFactory.getReporter("maintenance").reportEvent(0, false, OperationReportConstants.SKILL_DISTRIBUTION_STATISTIC_OBJECT, linkedHashMap);
}
this.skillDistributionRecord.reset();
}
public void reportStartRecord() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
}
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put("dialog", String.valueOf(BusinessFlowId.getInstance().getDialogId()));
linkedHashMap.put("interaction", String.valueOf((int) BusinessFlowId.getInstance().getInteractionId()));
linkedHashMap.put("deviceType", this.deviceType);
linkedHashMap.put("startType", this.recordTypeRecord.getRecordType());
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.START_RECORD_STATISTIC_OBJECT, linkedHashMap);
if (DeviceUtil.isOversea()) {
return;
}
ReportFactory.getReporter("maintenance").reportEvent(0, false, OperationReportConstants.START_RECORD_STATISTIC_OBJECT, linkedHashMap);
}
public void reportSwitchRecognizerEvent() {
this.recognizerSwitchCollection90005.setDeviceType(this.deviceType);
String sessionId = BusinessFlowId.getInstance().getSessionId();
short interactionId = BusinessFlowId.getInstance().getInteractionId();
this.recognizerSwitchCollection90005.setTranslocationId(DeviceUtil.getDevF(IAssistantConfig.getInstance().getAppContext()) + "&" + sessionId + "&" + ((int) interactionId));
this.recognizerSwitchCollection90005.setSession(sessionId);
this.recognizerSwitchCollection90005.setInteraction(interactionId);
if (!DeviceUtil.isOversea()) {
this.recognizerSwitchCollection90005.setApp(this.appId);
}
this.recognizerSwitchCollection90005.setCurTimestamp(System.currentTimeMillis());
this.recognizerSwitchCollection90005.updateLast5NetCheckDetail();
uploadData90005();
this.recognizerSwitchCollection90005.reset();
}
public void reportSwitchToHiaiEvent() {
this.switchToHiaiCollection90007.setDeviceType(this.deviceType);
String sessionId = BusinessFlowId.getInstance().getSessionId();
short interactionId = BusinessFlowId.getInstance().getInteractionId();
this.switchToHiaiCollection90007.setTranslocationId(DeviceUtil.getDevF(IAssistantConfig.getInstance().getAppContext()) + "&" + sessionId + "&" + ((int) interactionId));
this.switchToHiaiCollection90007.setSession(sessionId);
this.switchToHiaiCollection90007.setInteraction(interactionId);
if (!DeviceUtil.isOversea()) {
this.switchToHiaiCollection90007.setApp(this.appId);
}
this.switchToHiaiCollection90007.setCurTimestamp(System.currentTimeMillis());
this.switchToHiaiCollection90007.setNetType(String.valueOf(NetworkUtil.getNetworkType(IAssistantConfig.getInstance().getAppContext())));
uploadData90007();
this.switchToHiaiCollection90007.reset();
}
public void reportTimeOutRecord() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
linkedHashMap.put("deviceId", DeviceUtil.getReporterUdid());
}
linkedHashMap.put("dialog", String.valueOf(BusinessFlowId.getInstance().getDialogId()));
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put("interaction", String.valueOf((int) BusinessFlowId.getInstance().getInteractionId()));
linkedHashMap.put("tips", this.timeOutRecord.getTips());
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.TIMEOUT_STATISTIC_OBJECT, linkedHashMap);
if (!DeviceUtil.isOversea()) {
ReportFactory.getReporter("maintenance").reportEvent(0, false, OperationReportConstants.TIMEOUT_STATISTIC_OBJECT, linkedHashMap);
}
this.timeOutRecord.reset();
}
public void reportTtsRecord() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
linkedHashMap.put("deviceId", DeviceUtil.getReporterUdid());
}
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put("dialog", this.ttsRecord.getDialogId());
linkedHashMap.put("interaction", this.ttsRecord.getInteraction());
linkedHashMap.put("delayTime", isInValidTimeRecord(this.ttsRecord.getTtsCommandStartTime(), this.ttsRecord.getTtsBroadCastStartTime()) ? "0" : String.valueOf(this.ttsRecord.getTtsBroadCastStartTime() - this.ttsRecord.getTtsCommandStartTime()));
linkedHashMap.put("ttsTime", isInValidTimeRecord(this.ttsRecord.getTtsBroadCastStartTime(), this.ttsRecord.getTtsBroadCastEndTime()) ? "0" : String.valueOf(this.ttsRecord.getTtsBroadCastEndTime() - this.ttsRecord.getTtsBroadCastStartTime()));
linkedHashMap.put("isTtsFinished", this.ttsRecord.getIsTtsFinished());
linkedHashMap.put("textLength", this.ttsRecord.getTextLength());
linkedHashMap.put("errorCode", this.ttsRecord.getErrorCode());
linkedHashMap.put("voice", String.valueOf(((long) this.ttsRecord.getToneColor()) > 1000000 ? 10 : this.ttsRecord.getToneColor()));
linkedHashMap.put("speakTextHash", this.ttsRecord.getSpeakTextHash());
linkedHashMap.put("displayTextHash", this.ttsRecord.getDisplayTextHash());
linkedHashMap.put("deviceType", this.deviceType);
linkedHashMap.put("oda", this.ttsRecord.getOda());
linkedHashMap.put("tts", this.ttsRecord.getTts());
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, OperationReportConstants.TTS_STATISTIC_OBJECT, linkedHashMap);
if (!DeviceUtil.isOversea()) {
ReportFactory.getReporter("maintenance").reportEvent(0, true, OperationReportConstants.TTS_STATISTIC_OBJECT, linkedHashMap);
}
this.ttsRecord.reset();
}
public void reportVoiceKitRelease(String str) {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
}
linkedHashMap.put("session", BusinessFlowId.getInstance().getSessionId());
linkedHashMap.put(DataServiceConstants.IDS_RESULT_DESCRIP_RESULT_ERROR, str);
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, 3002, linkedHashMap);
if (DeviceUtil.isOversea()) {
return;
}
ReportFactory.getReporter("maintenance").reportEvent(0, false, 3002, linkedHashMap);
}
public void reportWebSocketLifeCycleRecord() {
LinkedHashMap linkedHashMap = new LinkedHashMap(16);
if (!DeviceUtil.isOversea()) {
linkedHashMap.put("app", this.appId);
linkedHashMap.put("deviceId", DeviceUtil.getReporterUdid());
}
linkedHashMap.put("linkedChainTimestamp", String.valueOf(this.webSocketLifeCycleRecord.getLinkedChainTimestamp()));
linkedHashMap.put("brokenChainTimestamp", String.valueOf(this.webSocketLifeCycleRecord.getBrokenChainTimestamp()));
linkedHashMap.put("resultCode", String.valueOf(this.webSocketLifeCycleRecord.getResultCode()));
ReportFactory.getReporter(OperationReportConstants.OPERATION).reportEvent(0, false, 2021, linkedHashMap);
if (!DeviceUtil.isOversea()) {
ReportFactory.getReporter("maintenance").reportEvent(0, false, 2021, linkedHashMap);
}
this.webSocketLifeCycleRecord.reset();
}
public void reset() {
this.intentionExecuteRecord.reset(true);
}
public void setAppId(String str) {
this.appId = str;
}
public void setDeviceType(String str) {
this.deviceType = str;
}
public void setStartUpMode(int i) {
this.startUpMode = i;
}
private OperationReportUtils() {
this.appId = "";
this.deviceType = "";
this.grsInfoRecord = new OperationReportConstants.GrsInfoRecord();
this.operationNluIntentionCollect = new OperationReportConstants.OperationNluIntentionCollect();
this.networkStatusCollection = new OperationReportConstants.NetworkStatusCollection();
this.recognizerSwitchCollection90005 = new OperationReportConstants.RecognizerSwitchCollection90005();
this.networkChecker90006 = new OperationReportConstants.NetworkChecker90006();
this.switchToHiaiCollection90007 = new OperationReportConstants.SwitchToHiaiCollection90007();
this.businessFlowRecognizeRecord = new OperationReportConstants.BusinessFlowRecognizeRecord();
this.ttsRecord = new OperationReportConstants.TtsRecord();
this.intentionExecuteRecord = new OperationReportConstants.IntentionExecuteRecord();
this.chatModeReportRecord = new OperationReportConstants.ChatModeReportRecord();
this.delayTimeRecord = new OperationReportConstants.DelayTimeRecord();
this.kitLifeCycleRecord = new OperationReportConstants.KitLifeCycleRecord();
this.webSocketLifeCycleRecord = new OperationReportConstants.WebSocketLifeCycleRecord();
this.recordTypeRecord = new OperationReportConstants.RecordTypeRecord();
this.interruptRecord = new OperationReportConstants.InterruptRecord();
this.skillDistributionRecord = new OperationReportConstants.SkillDistributionRecord();
this.timeOutRecord = new OperationReportConstants.TimeOutRecord();
this.contactUploadInfoRecord = new OperationReportConstants.ContactUploadInfoRecord();
this.providerExecuteRecord = new OperationReportConstants.ProviderExecuteRecord();
this.multiIntentRecord = new OperationReportConstants.MultiIntentRecord();
this.dsRegisterRecord = new OperationReportConstants.DsRegisterRecord();
this.activeInteractionRequestRecord = new OperationReportConstants.ActiveInteractionRequestRecord();
}
public void reportBusinessFlowRecognizeRecord(VoiceKitMessage voiceKitMessage, boolean z, List<String> list) {
if (voiceKitMessage == null) {
KitLog.error(TAG, "voiceResponse is null.");
return;
}
OperationReportConstants.BusinessFlowRecognizeRecord directives = this.businessFlowRecognizeRecord.setDialogId(String.valueOf(voiceKitMessage.getSession().getDialogId())).setTurnId(String.valueOf((int) voiceKitMessage.getSession().getInteractionId())).setDomainId(voiceKitMessage.getDomainId()).setSubDomainId(voiceKitMessage.getSubDomainId()).setIntentId(voiceKitMessage.getIntentId()).setAsrResult("".equals(voiceKitMessage.getAsrInfo()) ? "0" : "1").setNlpResult("".equals(voiceKitMessage.getSubDomainId()) ? "0" : "1").setFinished(z ? "1" : "0").setDirectives(buildStr(list));
Map<String, String> map = TASK_TYPE_MAP;
directives.setTaskType(map.get(voiceKitMessage.getTaskType()) != null ? map.get(voiceKitMessage.getTaskType()) : "").setMissSlot(buildStr(voiceKitMessage.getMissSlots())).setFilledSlots(buildStr(voiceKitMessage.getSlotsType())).setSlotLowLevel(buildStr(voiceKitMessage.getSlotLowLevel())).setTotalSlot(String.valueOf(voiceKitMessage.getTotalSlots())).setDetailResult(String.valueOf(voiceKitMessage.getOriErrorCode())).setIsChangeDomain(voiceKitMessage.isChangeDomain()).setOda(String.valueOf(voiceKitMessage.getResultSourceType())).setModeStates(voiceKitMessage.getModeStates()).setNluProvider(voiceKitMessage.getNluProvider()).setIntentName(voiceKitMessage.getIntentName()).setNluIntentId(voiceKitMessage.getNluIntentId()).setNluIntentName(voiceKitMessage.getNluIntentName()).setIntentLevel(voiceKitMessage.getNluIntentLevel()).setFinalNluIntentId(voiceKitMessage.getFinalNluIntentId()).setFinalNluIntentName(voiceKitMessage.getFinalNluIntentName()).setSkillTriggerWord(voiceKitMessage.getSkillTriggerWordStr()).setSkillId(voiceKitMessage.getSkillId()).setSubError(voiceKitMessage.getSubErrorCode());
reportDirectivesReceived();
reportBusinessFlowRecognizeRecord();
}
}