Skip to content

Commit

Permalink
判空处理
Browse files Browse the repository at this point in the history
  • Loading branch information
ccj659 committed Oct 16, 2018
1 parent 9017602 commit 89b7837
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

注1:**代码已经经过线上项目验证, 横向Google统计对比,统计数据无丢失,性能稳定.**

注2:**可修改数据库连接`EDBHelper`,作为`Java服务端埋点统计`使用.**
注2:**可修改数据库连接`EDBHelper`,作为`Java服务端埋点统计`使用.**



Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.ccj.client.android.analytics;

import android.content.Context;

import com.ccj.client.android.analytics.utils.EDeviceUtils;

import java.util.List;
Expand All @@ -21,9 +23,13 @@ protected static synchronized void pushEvent() {
ELogger.logError(EConstant.TAG, "timer schedule pushEvent is start-->" + cut_point_date);
ELogger.logWrite(EConstant.TAG, " timer schedule pushEvent run on thread-->"+Thread.currentThread().getName());


Context context =JJEventManager.getContext();
if (context==null){
ELogger.logWrite(EConstant.TAG, " JJEventManager.getContext() 为空,返回");
return;
}
//1.判断网络状况是否良好
if (!EDeviceUtils.isNetworkConnected(JJEventManager.getContext())) {
if (!EDeviceUtils.isNetworkConnected(context)) {
ELogger.logWrite(EConstant.TAG, " timer schedule 判断网络状况是否良好,网络未连接,返回");

return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ public static String getProcessName(Context cxt, int pid) {
* @return
*/
public static String getUserAgent(Context context) {
if (context==null){
return "";
}

//V6.0以后添加smzdmapp这部分后缀
String result = "smzdm_android_V%s rv:%s (%s;Android%s;%s)smzdmapp";
String result = "app_jj";
try {
String packageName = context.getPackageName();
String versionName = context.getPackageManager().getPackageInfo(
Expand Down

0 comments on commit 89b7837

Please sign in to comment.