opt
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user