添加leakcanery
This commit is contained in:
@@ -32,6 +32,7 @@ import com.mogo.service.passport.IMogoTicketCallback;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.LogLevel;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.squareup.leakcanary.LeakCanary;
|
||||
import com.zhidao.boot.persistent.lib.PersistentManager;
|
||||
import com.zhidao.mogo.module.left.panel.LeftPanelConst;
|
||||
import com.zhidao.mogo.tanlu.api.TanluApiConst;
|
||||
@@ -53,6 +54,9 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
public void onCreate() {
|
||||
initDebugConfig();
|
||||
super.onCreate();
|
||||
if ( !shouldInit() ) {
|
||||
return;
|
||||
}
|
||||
// Crash 日志收集
|
||||
final long start = System.currentTimeMillis();
|
||||
CrashSystem crashSystem = CrashSystem.getInstance( this );
|
||||
@@ -94,10 +98,20 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
Intent intent = new Intent( this, MogoMainService.class );
|
||||
startService( intent );
|
||||
}
|
||||
|
||||
LeakCanary.install( this );
|
||||
Log.i( "timer", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldInit() {
|
||||
return !LeakCanary.isInAnalyzerProcess( this );
|
||||
}
|
||||
|
||||
private void initDebugConfig() {
|
||||
if ( !shouldInit() ) {
|
||||
return;
|
||||
}
|
||||
DebugConfig.setNetMode( BuildConfig.NET_ENV );
|
||||
DebugConfig.setDebug( BuildConfig.DEBUG );
|
||||
DebugConfig.setAIType( BuildConfig.AIType );
|
||||
|
||||
Reference in New Issue
Block a user