[2.10.0] bus-p 优化bus乘客屏查询司机端出车/收车状态失败后再次延迟查询
This commit is contained in:
@@ -44,5 +44,7 @@ class BusPassengerConst {
|
||||
|
||||
// 订单总里程
|
||||
const val BUS_SP_KEY_ORDER_SUM_DIS = "BUS_SP_KEY_ORDER_SUM_DIS"
|
||||
|
||||
const val QUERY_BUS_P_STATION_DELAY = 5 * 1000L
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.location.Location;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -56,6 +58,7 @@ import mogo_msg.MogoReportMsg;
|
||||
import system_master.SystemStatusInfo;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
|
||||
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.QUERY_BUS_P_STATION_DELAY;
|
||||
import static com.mogo.och.bus.passenger.constant.BusPassengerConst.STATION_STATUS_STOPPED;
|
||||
|
||||
/**
|
||||
@@ -88,6 +91,18 @@ public class BusPassengerModel {
|
||||
private int mNextStationIndex = 0;// 要到达站的index
|
||||
private List<LatLng> mTwoStationsRouts = new ArrayList<>();
|
||||
|
||||
private static final int MSG_QUERY_BUS_P_STATION = 1001;
|
||||
private final Handler handler = new Handler(new Handler.Callback() {
|
||||
@Override
|
||||
public boolean handleMessage(Message msg) {
|
||||
if ( msg.what == MSG_QUERY_BUS_P_STATION ) {
|
||||
queryDriverOperationStatus();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
private BusPassengerModel() {
|
||||
}
|
||||
|
||||
@@ -106,6 +121,10 @@ public class BusPassengerModel {
|
||||
this.mRouteLineInfoCallback = callback;
|
||||
}
|
||||
|
||||
private void queryDriverOperationDelay() {
|
||||
handler.sendEmptyMessageDelayed( MSG_QUERY_BUS_P_STATION, QUERY_BUS_P_STATION_DELAY );
|
||||
}
|
||||
|
||||
private void queryDriverOperationStatus() {
|
||||
BusPassengerServiceManager.getInstance().queryDriverOperationStatus(mContext
|
||||
, new BusPassengerServiceCallback<BusPassengerOperationStatusResponse>() {
|
||||
@@ -121,7 +140,8 @@ public class BusPassengerModel {
|
||||
|
||||
@Override
|
||||
public void onFail(int code, String msg) {
|
||||
queryDriverOperationStatus();
|
||||
//延迟3s再次查询
|
||||
queryDriverOperationDelay();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user