1. 车聊聊电话和音乐浮窗的互斥

2. 添加模块资源释放回调
This commit is contained in:
wangcongtao
2020-09-24 16:59:17 +08:00
parent 87bc02aeda
commit d33741db28
13 changed files with 139 additions and 32 deletions

View File

@@ -100,4 +100,9 @@ public class MogoServiceProvider implements IMogoModuleProvider {
MogoServices.getInstance().init( AbsMogoApplication.getApp() );
}, 5_000L );
}
@Override
public void onDestroy() {
MogoServices.getInstance().destroy();
}
}

View File

@@ -20,6 +20,7 @@ import com.mogo.commons.network.SubscribeImpl;
import com.mogo.commons.storage.SpStorage;
import com.mogo.commons.voice.AIAssist;
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
import com.mogo.map.IDestroyable;
import com.mogo.map.MogoLatLng;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.location.IMogoLocationListener;
@@ -95,7 +96,8 @@ public class MogoServices implements IMogoMapListener,
IMogoAimlessModeListener,
IMogoVoiceCmdCallBack,
FragmentStackTransactionListener,
IMogoCarLocationChangedListener2 {
IMogoCarLocationChangedListener2,
IDestroyable {
private boolean mInternalUnWakeupRegisterStatus = false;
@@ -1021,4 +1023,9 @@ public class MogoServices implements IMogoMapListener,
}
}
@Override
public void destroy() {
Logger.d( TAG, "MogoServices do nothings." );
}
}

View File

@@ -189,12 +189,15 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
// 在线车辆点击使用infoWindow
if ( TextUtils.equals( mogoMarker.getOwner(), ModuleNames.CARD_TYPE_USER_DATA ) ) {
if ( !mogoMarker.isDestroyed() ) {
try {
MarkerOnlineCar onlineCar = ( MarkerOnlineCar ) ( ( MarkerShowEntity ) mogoMarker.getObject() ).getBindObj();
CallChatApi.getInstance().showUserWindow( mContext, onlineCar );
} catch ( Exception e ) {
Logger.e( TAG, e, "openMarker" );
}
mogoMarker.setInfoWindowAdapter( UserDataMarkerInfoWindowAdapter.getInstance( mContext ) );
mogoMarker.showInfoWindow();
Logger.d( TAG, "打开info window" );
// try {
// MarkerOnlineCar onlineCar = ( MarkerOnlineCar ) ( ( MarkerShowEntity ) mogoMarker.getObject() ).getBindObj();
// CallChatApi.getInstance().showUserWindow( mContext, onlineCar );
// } catch ( Exception e ) {
// Logger.e( TAG, e, "openMarker" );
// }
}
} else {
Object object = mogoMarker.getObject();
@@ -225,7 +228,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
}
// 在线车辆点击使用infoWindow
if ( TextUtils.equals( mogoMarker.getOwner(), ModuleNames.CARD_TYPE_USER_DATA ) ) {
// mogoMarker.hideInfoWindow();
mogoMarker.hideInfoWindow();
Logger.d( TAG, "关闭info window" );
} else {
Object object = mogoMarker.getObject();