This commit is contained in:
wangcongtao
2020-06-05 12:19:13 +08:00
parent 075ca7d3a9
commit 44ec5cdcfe
15 changed files with 317 additions and 79 deletions

View File

@@ -0,0 +1,48 @@
package com.mogo.module.common.map;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.utils.AppUtils;
import com.mogo.utils.logger.Logger;
public
/**
* @author congtaowang
* @since 2020/6/5
* <p>
* 自定义导航功能拦截器
*/
class CustomNaviInterrupter implements Interrupter {
private static final String TAG = "CustomNaviInterrupter";
private static volatile CustomNaviInterrupter sInstance;
private CustomNaviInterrupter() {
}
public static CustomNaviInterrupter getInstance() {
if ( sInstance == null ) {
synchronized ( CustomNaviInterrupter.class ) {
if ( sInstance == null ) {
sInstance = new CustomNaviInterrupter();
}
}
}
return sInstance;
}
public synchronized void release() {
sInstance = null;
}
@Override
public boolean interrupt() {
if ( AppUtils.isAppInstalled( AbsMogoApplication.getApp(), "com.autonavi.amapauto" )
|| DebugConfig.isUseCustomNavi() ) {
Logger.d( TAG, "do not use custom map function." );
return true;
}
return false;
}
}