[6.7.0]修改接管
This commit is contained in:
@@ -587,35 +587,40 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
|
||||
*/
|
||||
override fun onTakeoverState(state: Int) {
|
||||
Log.i(TAG, "onTakeoverState state=$state")
|
||||
if(state == 1 || state == 2 || state == 3){
|
||||
val activity = AppStateManager.currentActivity()
|
||||
if (activity !is AppCompatActivity) {
|
||||
return
|
||||
}
|
||||
val geocodeSearch = GeocodeSearch(activity)
|
||||
geocodeSearch.setOnGeocodeSearchListener(object: GeocodeSearch.OnGeocodeSearchListener {
|
||||
override fun onRegeocodeSearched(regeocodeResult: RegeocodeResult?, p1: Int) {
|
||||
regeocodeResult?.regeocodeAddress?.formatAddress?.let {
|
||||
address = it
|
||||
if(state == 0 && !shouldRecord){
|
||||
shouldRecord = true
|
||||
}
|
||||
if(shouldRecord){
|
||||
if(state == 1 || state == 2 || state == 3){
|
||||
val activity = AppStateManager.currentActivity()
|
||||
if (activity !is AppCompatActivity) {
|
||||
return
|
||||
}
|
||||
val geocodeSearch = GeocodeSearch(activity)
|
||||
geocodeSearch.setOnGeocodeSearchListener(object: GeocodeSearch.OnGeocodeSearchListener {
|
||||
override fun onRegeocodeSearched(regeocodeResult: RegeocodeResult?, p1: Int) {
|
||||
regeocodeResult?.regeocodeAddress?.formatAddress?.let {
|
||||
address = it
|
||||
}
|
||||
val takeOverRecordInfo = TakeOverRecordInfo(System.currentTimeMillis(),
|
||||
address,level1Id,level2Id,level3Id,
|
||||
level1Name, level2Name, level3Name,
|
||||
BadCaseConfig.lineName,reportNote,
|
||||
reportStatus = false,
|
||||
selectStatus = false
|
||||
)
|
||||
CallerTakeOverManager.insertRecord(activity,takeOverRecordInfo)
|
||||
}
|
||||
val takeOverRecordInfo = TakeOverRecordInfo(System.currentTimeMillis(),
|
||||
address,level1Id,level2Id,level3Id,
|
||||
level1Name, level2Name, level3Name,
|
||||
BadCaseConfig.lineName,reportNote,
|
||||
reportStatus = false,
|
||||
selectStatus = false
|
||||
)
|
||||
CallerTakeOverManager.insertRecord(activity,takeOverRecordInfo)
|
||||
shouldRecord = false
|
||||
}
|
||||
|
||||
override fun onGeocodeSearched(p0: GeocodeResult?, p1: Int) {
|
||||
override fun onGeocodeSearched(p0: GeocodeResult?, p1: Int) {
|
||||
|
||||
}
|
||||
})
|
||||
val latLon = LatLonPoint(CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude, CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude)
|
||||
val q = RegeocodeQuery(latLon,200f,GeocodeSearch.AMAP)
|
||||
geocodeSearch.getFromLocationAsyn(q)
|
||||
}
|
||||
})
|
||||
val latLon = LatLonPoint(CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude, CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude)
|
||||
val q = RegeocodeQuery(latLon,200f,GeocodeSearch.AMAP)
|
||||
geocodeSearch.getFromLocationAsyn(q)
|
||||
shouldRecord = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user