com.eg.agent.android.instrumentation.crash.Instrumentation Maven / Gradle / Ivy
The newest version!
package com.eg.agent.android.instrumentation.crash;
import android.os.Looper;
import com.eg.agent.android.logging.EGAgentLog;
import com.eg.agent.android.logging.EGAgentLogManager;
import com.eg.agent.android.BaseAndroidAgent;
import com.eg.agent.android.EGAgentConfig;
import com.eg.google.gson.Gson;
/*
* Crash report Api call
* */
public class Instrumentation {
// private static String useSsl = EGAgentConfig.useSsl ? "https://" : "http://";
static Gson gson = new Gson();
private static BaseAndroidAgent androidAgentimpl = BaseAndroidAgent.getInstance();
// private static final EGAgentConfig agentConfiguration = androidAgentimpl.getAgentConfiguration();
static String dev_info = gson.toJson(androidAgentimpl.getDeviceInformation());
private final EGAgentLog log = EGAgentLogManager.getAgentLog();
public Instrumentation() {
Thread.UncaughtExceptionHandler mDefaultHandler = Thread
.getDefaultUncaughtExceptionHandler();
//Thread.setDefaultUncaughtExceptionHandler(new EgUnHandledExceptionHandler(true, mDefaultHandler));
Thread.setDefaultUncaughtExceptionHandler(new EgExceptionHandler(true,mDefaultHandler));
}
public boolean isUIThread() {
return Looper.getMainLooper().getThread() == Thread.currentThread();
}
}