Merge branch 'emulator' into dev_4.4.0
# Conflicts: # app/src/main/java/com/gh/common/util/EntranceUtils.java # app/src/main/java/com/gh/common/util/LogUtils.java # app/src/main/java/com/gh/gamecenter/adapter/viewholder/DetailViewHolder.java # app/src/main/java/com/halo/assistant/HaloApp.java # app/src/main/res/values/colors.xml
This commit is contained in:
@ -522,7 +522,7 @@ public class LogUtils {
|
||||
.subscribe(new EmptyResponse<>());
|
||||
}
|
||||
|
||||
private static void uploadCommunity(JSONObject object) {
|
||||
public static JSONObject getMetaObject() {
|
||||
Meta meta = MetaUtil.INSTANCE.getMeta();
|
||||
JSONObject metaObject = new JSONObject();
|
||||
try {
|
||||
@ -540,8 +540,15 @@ public class LogUtils {
|
||||
metaObject.put("os", meta.getOs());
|
||||
metaObject.put("userId", meta.getUserId());
|
||||
|
||||
object.put("meta", metaObject);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return metaObject;
|
||||
}
|
||||
|
||||
private static void uploadCommunity(JSONObject object) {
|
||||
try {
|
||||
object.put("meta", getMetaObject());
|
||||
object.put("timestamp", System.currentTimeMillis() / 1000);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
@ -577,4 +584,30 @@ public class LogUtils {
|
||||
}
|
||||
uploadCommunity(object);
|
||||
}
|
||||
|
||||
|
||||
public static void uploadSimulatorDownload(String event, String simulatorId, String simulatorName, String gameId, String location, String downloadType) {
|
||||
JSONObject object = new JSONObject();
|
||||
JSONObject payload = new JSONObject();
|
||||
try {
|
||||
object.put("event", event);// 取值有[开始, 完成] [simulator_download, simulator_download_complete]
|
||||
object.put("id", simulatorId);//事件标识,同一次下载开始和完成取同一个值,可以通过这个id来查找同一次的下载任务
|
||||
object.put("meta", getMetaObject());
|
||||
object.put("timestamp", System.currentTimeMillis() / 1000);
|
||||
|
||||
payload.put("simulator_id", simulatorId);
|
||||
payload.put("simulator_name", simulatorName);
|
||||
payload.put("location", location);//启动《具体的游戏名称》/模拟器游戏/模拟器游戏-模拟器管理
|
||||
payload.put("game_id", gameId);//如果是 启动《游戏名称》 这种方式, 记录这个游戏具体的游戏ID
|
||||
payload.put("download_type", downloadType);// update/download 下载类型(更新/下载)
|
||||
object.put("payload", payload);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
Utils.log("LogUtils->" + object.toString());
|
||||
}
|
||||
LoghubUtils.log(object, "event", false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user