|
@@ -34,6 +34,7 @@ import com.haochuan.core.http.bean.ApkSettingBean;
|
|
|
import com.haochuan.core.http.bean.ResponseBean;
|
|
|
import com.haochuan.core.util.ELS;
|
|
|
import com.haochuan.core.util.HandlerUtil;
|
|
|
+import com.haochuan.hciptvbasic.util.ELSUtil;
|
|
|
import com.haochuan.hciptvbasic.util.VRUtil;
|
|
|
import com.haochuan.hciptvbasic.webview.PayToJS;
|
|
|
import com.haochuan.hciptvbasic.webview.PlayerToJS;
|
|
@@ -69,57 +70,6 @@ public abstract class BaseWebActivity extends AppCompatActivity {
|
|
|
@Override
|
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
- els = ELS.getInstance(this);
|
|
|
- String uid = "";
|
|
|
- //访问接口确定是否需要上传日志
|
|
|
- if (!TextUtils.isEmpty(uid)) {
|
|
|
- RequestServer.getInstance().getApkSetting(uid, new ResponseListener<ApkSettingBean>() {
|
|
|
- @Override
|
|
|
- public void onSuccess(ApkSettingBean response) {
|
|
|
- Logger.d("getApkSetting:" + response.toString());
|
|
|
- List<ApkSettingBean.DataBean> dataList = response.getData();
|
|
|
- for (ApkSettingBean.DataBean data : dataList) {
|
|
|
- //遍历寻找对应配置
|
|
|
- if ("open_apk_log_status".equals(data.getSetting_name())) {
|
|
|
- if ("1".equals(data.getSetting_value())) {
|
|
|
- Logger.setLogNeedWriteToFile(true);
|
|
|
- els.saveBoolData(ELS.LAST_LOG_SWITCH, true);
|
|
|
- } else {
|
|
|
- els.saveBoolData(ELS.LAST_LOG_SWITCH, false);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onFailure(String code, String message) {
|
|
|
- els.saveBoolData(ELS.LAST_LOG_SWITCH, false);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- //每次启动应用时,检查一下上一次使用是否要上传日志,
|
|
|
- // 因为在应用关闭时上传文件可能导致内存内泄漏或上传失败,所以放在应用启动时上传
|
|
|
- if (els.getBoolData(ELS.LAST_LOG_SWITCH)) {
|
|
|
- String lasLogFileName = els.getStringData(ELS.LOG_FILE_NAME);
|
|
|
- Logger.d("uploadLogFile lasLogFileName:" + lasLogFileName);
|
|
|
- if (!TextUtils.isEmpty(lasLogFileName)) {
|
|
|
- RequestServer.getInstance().uploadLogFile(lasLogFileName,
|
|
|
- new ResponseListener<ResponseBean>() {
|
|
|
- @Override
|
|
|
- public void onSuccess(ResponseBean response) {
|
|
|
- Logger.d("uploadLogFile:" + response.toString());
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onFailure(String code, String message) {
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //初始化日志
|
|
|
- Logger.init(this,getWebView());
|
|
|
|
|
|
webView = new WebView(this);
|
|
|
webView.setBackgroundColor(ContextCompat.getColor(this, android.R.color.transparent));
|
|
@@ -130,6 +80,18 @@ public abstract class BaseWebActivity extends AppCompatActivity {
|
|
|
//初始化播放器和vr
|
|
|
initPlayerAndVr();
|
|
|
|
|
|
+ //初始化els日志记录系统
|
|
|
+ els = ELS.getInstance(this);
|
|
|
+ String uid = "12398658";
|
|
|
+ if(utilToJS != null){
|
|
|
+ uid = utilToJS.getUserName();
|
|
|
+ }
|
|
|
+ Logger.d("uid:" + uid);
|
|
|
+ ELSUtil.Init(this,els,uid);
|
|
|
+
|
|
|
+ //初始化日志
|
|
|
+ Logger.init(this,getWebView());
|
|
|
+
|
|
|
runH5();
|
|
|
}
|
|
|
|