diff --git a/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BusFragment.java b/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BusFragment.java index 081d51b701..22d3235faf 100644 --- a/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BusFragment.java +++ b/OCH/bus/driver/src/main/java/com/mogo/och/bus/fragment/BusFragment.java @@ -24,6 +24,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant; +import com.mogo.eagle.core.utilcode.util.ActivityUtils; import com.mogo.eagle.core.utilcode.util.ToastUtils; import com.mogo.map.overlay.IMoGoOverlayManager; import com.mogo.map.overlay.core.Level; @@ -529,7 +530,7 @@ public class BusFragment extends BaseBusTabFragment } if ((int)mSwitchLine.getTag() == 0){//切换路线 Intent intent = new Intent(getContext(), BusSwitchLineActivity.class); - startActivity(intent); + ActivityUtils.startActivity(intent); }else {//结束任务 OCHCommitDialog.Builder builder = new OCHCommitDialog.Builder(); OCHCommitDialog closeLineConfirmDialog = builder diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/auditionmanager/Audition.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/auditionmanager/Audition.kt new file mode 100644 index 0000000000..02f1512a90 --- /dev/null +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/auditionmanager/Audition.kt @@ -0,0 +1,155 @@ +package com.mogo.och.common.module.manager.auditionmanager + +import android.media.AudioManager +import android.media.MediaPlayer +import android.os.Handler +import android.os.HandlerThread +import android.os.Message +import android.text.TextUtils + +//播放试听 +object Audition: MediaPlayer.OnPreparedListener, + MediaPlayer.OnCompletionListener, MediaPlayer.OnSeekCompleteListener { + private val TAG = "Audition" + var mediaPlayer: MediaPlayer? = null + var oldPath: String? = null + private var listener: OnAuditionListener? = null + private val handler: Handler + + interface OnAuditionListener { + fun onAuditionCompletion(path: String?) + fun onSeekCompletion(currentPlay: Long) + fun onCurrentPosition(currentPlay: Long, duration: Long) + } + + fun registerOnAuditionListener(listener: OnAuditionListener?) { + this.listener = listener + } + + fun unregisterOnAuditionListener() { + listener = null + } + + init { + val frequentThread = HandlerThread("frequent_drawer") + frequentThread.start() + handler = object : Handler(frequentThread.looper) { + override fun handleMessage(msg: Message) { + super.handleMessage(msg) + if (msg.what == 0) { + if (mediaPlayer != null && listener != null) { + val currentPosition = mediaPlayer!!.currentPosition + val duration = mediaPlayer!!.duration + listener!!.onCurrentPosition(currentPosition.toLong(), duration.toLong()) + } + sendEmptyMessageDelayed(0, 500) + } + } + } + } + + val isPlaying: Boolean + get() = mediaPlayer != null && mediaPlayer!!.isPlaying + + fun play(path: String) { + if (TextUtils.equals(oldPath, path)) { + return + } + oldPath = path + if (mediaPlayer != null) { + mediaPlayer!!.release() + mediaPlayer = null + } + if (mediaPlayer == null) { + mediaPlayer = MediaPlayer() + mediaPlayer!!.setAudioStreamType(AudioManager.STREAM_MUSIC) + mediaPlayer!!.setOnPreparedListener(this) + mediaPlayer!!.setOnCompletionListener(this) + mediaPlayer!!.setOnSeekCompleteListener(this) + } + try { + mediaPlayer!!.setDataSource(path) + } catch (e: Exception) { + e.printStackTrace() + } + mediaPlayer!!.prepareAsync() + } + + fun stop() { + oldPath = null + if (mediaPlayer != null) { + mediaPlayer!!.stop() + mediaPlayer!!.reset() + } + } + + fun pause() { + if (mediaPlayer != null && mediaPlayer!!.isPlaying) { + mediaPlayer!!.pause() + } + } + + fun toggle(path: String):Boolean { + if (mediaPlayer != null) { + if(TextUtils.equals(oldPath, path)) { + if (mediaPlayer!!.isPlaying) { + mediaPlayer!!.pause() + return false + } else { + mediaPlayer!!.start() + return true + } + }else{ + play(path) + return true + } + }else{ + play(path) + return true + } + } + + fun start():Boolean { + if (mediaPlayer != null) { + mediaPlayer!!.start() + return true + } + return false + } + + fun playOrStop(path: String): Boolean { + return if (!TextUtils.equals(oldPath, path)) { + play(path) + true + } else { + stop() + false + } + } + + fun onDestroy() { + stop() + mediaPlayer = null + } + + override fun onPrepared(mp: MediaPlayer) { + mp.start() + if (listener != null) { + listener!!.onCurrentPosition(mp.currentPosition.toLong(), mp.duration.toLong()) + } + handler.sendEmptyMessageDelayed(0, 500) + } + + override fun onCompletion(mp: MediaPlayer) { + if (listener != null) { + listener!!.onAuditionCompletion(oldPath) + } + oldPath = null + } + + override fun onSeekComplete(mp: MediaPlayer) { + if (listener != null) { + listener!!.onSeekCompletion(mp.currentPosition.toLong()) + } + } +} diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/auditionmanager/AuditionCacheManager.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/auditionmanager/AuditionCacheManager.kt new file mode 100644 index 0000000000..15dc2810cb --- /dev/null +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/auditionmanager/AuditionCacheManager.kt @@ -0,0 +1,257 @@ +package com.mogo.och.common.module.manager.auditionmanager + +import android.media.MediaExtractor +import android.media.MediaFormat +import android.net.Uri +import android.os.Environment +import android.text.TextUtils +import com.google.gson.reflect.TypeToken +import com.mogo.commons.AbsMogoApplication +import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.utilcode.download.DownloadUtils +import com.mogo.eagle.core.utilcode.download.callback.IDownloadListener +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OCHCOMMON +import com.mogo.eagle.core.utilcode.util.GsonUtils +import com.mogo.eagle.core.utilcode.util.ThreadUtils +import com.mogo.eagle.core.utilcode.util.Utils +import com.mogo.och.common.module.manager.orderlogmanager.OchChainLogManager +import com.mogo.och.common.module.manager.orderlogmanager.OchChainLogManager.EVENT_KEY_INFE_WITH_MUSIC +import com.mogo.och.common.module.utils.FileUtils +import com.mogo.och.common.module.wigets.media.MediaPlayLogger +import rx.Single +import java.io.File +import java.io.FileOutputStream +import java.io.IOException +import java.io.OutputStream +import com.mogo.eagle.core.utilcode.util.FileUtils as FileHelper + + +object AuditionCacheManager { + + private var dataChangeListener:DataChangeListener?=null + private val context = AbsMogoApplication.getApp() + private const val TAG = "AuditionCacheManager" + + init { + createFileCacheDir() + } + + // 命名规则 缓存文件夹/md5.后缀名 + private fun getMusicDataByLocationConfig() { + ThreadUtils.getIoPool().execute { + val localAdDataList = mutableListOf() + try { + val datas: MusicDataList = GsonUtils.fromJson( + FunctionBuildConfig.musicUrlConfig, object : TypeToken() {}.type + ) + localAdDataList.addAll(datas.musics) + } catch (e: Exception) { + e.printStackTrace() + } + localAdDataList.forEach { + if (isLocalCacheFileExists(it)) { + // 存在 + val locationPath = getCacheFileFullPathByUrl(it) + val fileMD5 = FileHelper.getFileMD5ToString(locationPath) + if(fileMD5==it.md5){// 文件存在切md5一致 + it.path = locationPath + val duration = getDuration(locationPath) + it.duration = duration + dataChangeListener?.addOneData(it) + CallerLogger.d(M_OCHCOMMON+ TAG,"文件已下载添加播放列表中") + addTag("文件已下载添加播放列表中:${it}") + }else{ + // 删除缓存 + FileHelper.delete(locationPath) + if(it.isCloud()) { + // 去下载 + downloadFile(it) + addTag("缓存已下载但md5对应不上:${it}") + }else{ + copyRaw2Music(it.songUrl,locationPath) + it.path = locationPath + val duration = getDuration(locationPath) + it.duration = duration + dataChangeListener?.addOneData(it) + } + } + }else{ + if(it.isCloud()) { + // 不存在 + downloadFile(it) + addTag("第一次下载:${it}") + }else{ + val locationPath = getCacheFileFullPathByUrl(it) + copyRaw2Music(it.songUrl,locationPath) + it.path = locationPath + val duration = getDuration(locationPath) + it.duration = duration + dataChangeListener?.addOneData(it) + } + + } + } + } + } + + + /** + * 创建media缓存文件夹目录(优先放SD卡) + */ + private fun createFileCacheDir(): Boolean { + val cacheDirPath = getFileCacheDir() + MediaPlayLogger.printInfoLog("createFileCacheDir, dirPath=$cacheDirPath") + return FileHelper.createFileDir(cacheDirPath) + } + + + /** + * 获取本地缓存文件的文件全路径 + */ + private fun getFileCacheDir(): String { + // 有些手机需要通过自定义目录 + val relativePath = "mogo" + File.separator + "music" + File.separator + val cacheDir = File(Environment.getExternalStorageDirectory(), relativePath) + if (FileHelper.createOrExistsDir(cacheDir)) { + return cacheDir.absolutePath + } + + return FileUtils.getCacheDirectory(context, "") + relativePath + } + + /** + * 获取文件缓存的缓存path, 文件名以base64编码避免 中文命名,重复文件名的影响 + */ + private fun getCacheFileFullPathByUrl(musicData: MusicData): String { + return getFileCacheDir() +File.separator+ getCacheFileName(musicData) + } + + /** + * 本地是否已经存在下载完成的文件 + */ + private fun isLocalCacheFileExists(musicData: MusicData): Boolean { + val localVideoCacheFilePath = getCacheFileFullPathByUrl(musicData) + return FileHelper.isFileExists(localVideoCacheFilePath) + } + + /** + * 本地缓存文件的文件名,md5编码避免文件名重复或者特殊字符编码问题 + */ + private fun getCacheFileName(musicData: MusicData): String { + val fileSuffix = FileUtils.getExtension(musicData.songUrl) + if (TextUtils.isEmpty(fileSuffix)) { + return "" + } + return musicData.md5 + FileUtils.EXTENSION_SEPARATOR + fileSuffix + } + + + /** + * 下载文件 + */ + private fun downloadFile(musicData: MusicData) { + val downloadUrl = musicData.songUrl + val downloadDir = getFileCacheDir() + val downloadFileName = getCacheFileName(musicData) + DownloadUtils.downLoad(context, downloadUrl, downloadDir, downloadFileName, object :IDownloadListener{ + override fun onStart(url: String) { + addTag("开始下载:${musicData}") + } + + override fun onProgress(url: String, downloaded: Long, total: Long) { + + } + + override fun onFinished(url: String, path: String) { + val fileMD5 = FileHelper.getFileMD5ToString(path) + if(fileMD5==musicData.md5){// 文件存在切md5一致 + musicData.path = path + dataChangeListener?.addOneData(musicData) + addTag("下载完成切md5对应上:${musicData}") + }else{ + // 下载成功但是下载的文件md5不一致不能使用 + } + } + + override fun onError(url: String, error: String?) { + // 下载失败 + addTag("下载失败:${musicData}") + } + }) + } + + fun addDataChangeListener(dataChangeListener: DataChangeListener) { + this.dataChangeListener = dataChangeListener + getMusicDataByLocationConfig() + } + + public interface DataChangeListener{ + fun addOneData(it: MusicData) + + } + + private fun addTag(logInfo:String){ + OchChainLogManager.writeChainLog(TAG,logInfo,eventID=EVENT_KEY_INFE_WITH_MUSIC) + } + + /** + * 获取mp3音频的总时长 单位:ms + * + * @param mp3FilePath MP3文件路径 + * @return 时长 + */ + fun getDuration(mp3FilePath: String): Long { + if (!com.mogo.eagle.core.utilcode.util.FileUtils.isFileExists(mp3FilePath)) { + return 0 + } + if (!mp3FilePath.endsWith("mp3")) { + return 0 + } + var mex: MediaExtractor? = null + try { + mex = MediaExtractor() + mex.setDataSource(mp3FilePath) + val mf = mex.getTrackFormat(0) + return mf.getLong(MediaFormat.KEY_DURATION) / 1000L + } catch (e: IOException) { + + } finally { + mex?.release() + } + return 0 + } + + + fun copyRaw2Music(url:String,dst:String){ + val path = Uri.parse(url).path + path?.let { + val split = it.split("/") + if(split.size==3&&split.get(1)=="raw"){ + + try { + val fileName = split[2] + val nameAndprex = fileName.split(".") + val resourceId: Int = context.resources.getIdentifier(nameAndprex[0], "raw", context.packageName) + val openRawResource = context.resources.openRawResource(resourceId) + val outputStream: OutputStream = FileOutputStream(dst) + val buffer = ByteArray(1024) + var length: Int + + while (openRawResource.read(buffer).also { length = it } > 0) { + outputStream.write(buffer, 0, length) + } + + outputStream.close() + openRawResource.close() + }catch (e:IOException){ + e.printStackTrace() + } + + } + + } + } + + +} \ No newline at end of file diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/auditionmanager/AuditionManager.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/auditionmanager/AuditionManager.kt new file mode 100644 index 0000000000..2391a389c5 --- /dev/null +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/auditionmanager/AuditionManager.kt @@ -0,0 +1,156 @@ +package com.mogo.och.common.module.manager.auditionmanager + +import com.mogo.och.common.module.manager.distancemamager.IDistanceListener +import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceManager +import java.util.concurrent.ConcurrentHashMap + +object AuditionManager: AuditionCacheManager.DataChangeListener, Audition.OnAuditionListener { + + val musicList = mutableListOf() + + private val dataChangeListeners: ConcurrentHashMap = ConcurrentHashMap() + + init { + AuditionCacheManager.addDataChangeListener(this) + Audition.registerOnAuditionListener(this) + } + + fun addDataChangeListener(tag: String, listener: MusicDataChangeListener) { + if (dataChangeListeners.containsKey(tag)) { + return + } + dataChangeListeners[tag] = listener + } + + fun removeDataChangeListener(tag: String){ + dataChangeListeners.remove(tag) + } + + + private fun getMusicDataByState(state:PlayState):Pair?{ + musicList.forEachIndexed { index, musicData -> + if(musicData.state==state){ + return Pair(index,musicData) + } + } + return null + } + + fun toggle(musicData: MusicData){ + val toggle = Audition.toggle(musicData.path) + val oldData = resetData() + if(toggle){// 播放 + musicData.state = PlayState.Playing + dataChangeListeners.forEach { + it.value.updateState(oldData,musicData) + } + }else{// 暂停 + musicData.state = PlayState.Pause + dataChangeListeners.forEach { + it.value.updateState(oldData,musicData) + } + } + } + + private fun resetData():MusicData?{ + var tempRusult:MusicData?=null + musicList.forEach { + if(it.state!=PlayState.None){ + tempRusult = it + } + it.state = PlayState.None + } + return tempRusult + } + + override fun addOneData(musicDataNew: MusicData) { + musicList.forEachIndexed { index, musicData -> + if (musicDataNew.id==musicData.id) { + musicList[index] = musicDataNew + return + } + } + musicList.add(musicDataNew) + dataChangeListeners.forEach { + it.value.addOneData(musicDataNew) + } + } + + public interface MusicDataChangeListener{ + fun addOneData(it: MusicData){} + fun updateState(oldData: MusicData?,musicData: MusicData) + fun updatePlayCurrent(currentPlay: Long, duration: Long, second: MusicData){} + fun onMusicCompletion(musicData: MusicData) {} + + } + + /** + * 音乐播放完毕 + */ + override fun onAuditionCompletion(path:String?) { + val oldData = resetData() + if(oldData!=null&&oldData.path==path){ + dataChangeListeners.forEach { + it.value.onMusicCompletion(oldData) + } + }else{ + musicList.forEach {musicData-> + if(musicData.path==path){ + dataChangeListeners.forEach { + it.value.onMusicCompletion(musicData) + } + return + } + } + } + } + + /** + * 拖动跳转完成 + */ + override fun onSeekCompletion(currentPlay: Long) { + + } + + /** + * 当前进度 + */ + override fun onCurrentPosition(currentPlay: Long, duration: Long) { + val musicDataWithIndex = getMusicDataByState(PlayState.Playing) + if (musicDataWithIndex!=null) { + musicDataWithIndex.second.let {musicData-> + dataChangeListeners.forEach { + it.value.updatePlayCurrent(currentPlay,duration,musicData) + } + } + }else{ + musicList.forEachIndexed { index, musicData -> + if(musicData.path==Audition.oldPath){ + dataChangeListeners.forEach { + it.value.updatePlayCurrent(currentPlay,duration,musicData) + } + return + } + } + } + } + + fun getNextMusicData(it: MusicData):MusicData { + val indexOf = musicList.indexOf(it) + if(indexOf== musicList.size-1){ + return musicList.first() + }else{ + return musicList[indexOf+1] + } + } + + fun getPreMusicData(it: MusicData): MusicData { + val indexOf = musicList.indexOf(it) + if(indexOf== 0){ + return musicList.last() + }else{ + return musicList[indexOf-1] + } + } + +} \ No newline at end of file diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/auditionmanager/MusicData.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/auditionmanager/MusicData.kt new file mode 100644 index 0000000000..afb7438d10 --- /dev/null +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/auditionmanager/MusicData.kt @@ -0,0 +1,36 @@ +package com.mogo.och.common.module.manager.auditionmanager + + +data class MusicDataList(val musics: MutableList) + +/** + * 音乐文件 + */ +data class MusicData( + val id: String, + val md5:String, + val songName: String, + val songUrl: String, + val songUrlType: String, + val coverHeadImageUrl: String, + val coverBottomImageUrl: String, + val tag: MutableList, + var duration:Long, + var path: String, + var state: PlayState = PlayState.None +){ + fun isCloud():Boolean{ + return songUrlType=="cloud" + } +} + +/** + * None -> Playing - Pause + * | | + * None None + */ +enum class PlayState { + None, + Playing, + Pause, +} diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/orderlogmanager/OchChainLogManager.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/orderlogmanager/OchChainLogManager.kt index 7e958fea09..1d751d5a7b 100644 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/orderlogmanager/OchChainLogManager.kt +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/orderlogmanager/OchChainLogManager.kt @@ -17,6 +17,7 @@ object OchChainLogManager { const val EVENT_KEY_INFE_WITH_CHANGE = "event_key_och_common_info_and_changeinfo" const val EVENT_KEY_INFE_WITH_TRAJECTORY = "event_key_och_trajectory_info" + const val EVENT_KEY_INFE_WITH_MUSIC = "event_key_och_music_info" /** * @param Info 订单详细信息 diff --git a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/fragment/BusFragment.java b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/fragment/BusFragment.java index db0d3ff439..147795d085 100644 --- a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/fragment/BusFragment.java +++ b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/fragment/BusFragment.java @@ -24,6 +24,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant; +import com.mogo.eagle.core.utilcode.util.ActivityUtils; import com.mogo.eagle.core.utilcode.util.ToastUtils; import com.mogo.map.overlay.IMoGoOverlayManager; import com.mogo.map.overlay.core.Level; @@ -519,7 +520,7 @@ public class BusFragment extends BaseBusTabFragment } if ((int)mSwitchLine.getTag() == 0){//切换路线 Intent intent = new Intent(getContext(), BusSwitchLineActivity.class); - startActivity(intent); + ActivityUtils.startActivity(intent); }else {//结束任务 OCHCommitDialog.Builder builder = new OCHCommitDialog.Builder(); OCHCommitDialog closeLineConfirmDialog = builder diff --git a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java index a95bd0b979..155f370780 100644 --- a/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java +++ b/OCH/shuttle/driver/src/main/java/com/mogo/och/bus/presenter/BusPresenter.java @@ -276,4 +276,8 @@ public class BusPresenter extends Presenter public void onAutopilotDockerInfo(@NonNull String dockerVersion) { } + @Override + public void onSsmReceiveTimeout(boolean isTimeout) { + + } } diff --git a/OCH/sweeper/driver/src/main/java/com/mogo/och/sweeper/cloud/model/SweeperCloudTaskModel.java b/OCH/sweeper/driver/src/main/java/com/mogo/och/sweeper/cloud/model/SweeperCloudTaskModel.java index 8e573daa92..f40b3fbf78 100644 --- a/OCH/sweeper/driver/src/main/java/com/mogo/och/sweeper/cloud/model/SweeperCloudTaskModel.java +++ b/OCH/sweeper/driver/src/main/java/com/mogo/och/sweeper/cloud/model/SweeperCloudTaskModel.java @@ -781,4 +781,9 @@ public class SweeperCloudTaskModel implements IMoGoSweeperFutianCloudTaskListene public void onAutopilotDockerInfo(@NonNull String dockerVersion) { } + + @Override + public void onSsmReceiveTimeout(boolean isTimeout) { + + } } diff --git a/OCH/sweeper/driver/src/main/java/com/mogo/och/sweeper/operate/presenter/SweeperOperatePresenter.java b/OCH/sweeper/driver/src/main/java/com/mogo/och/sweeper/operate/presenter/SweeperOperatePresenter.java index 563e811c56..9759a67aad 100644 --- a/OCH/sweeper/driver/src/main/java/com/mogo/och/sweeper/operate/presenter/SweeperOperatePresenter.java +++ b/OCH/sweeper/driver/src/main/java/com/mogo/och/sweeper/operate/presenter/SweeperOperatePresenter.java @@ -462,4 +462,8 @@ public class SweeperOperatePresenter extends Presenter public void onAutopilotDockerInfo(@NonNull String dockerVersion) { } + @Override + public void onSsmReceiveTimeout(boolean isTimeout) { + + } } diff --git a/OCH/taxi/driver/src/main/java/com/mogo/och/taxi/model/TaxiModel.java b/OCH/taxi/driver/src/main/java/com/mogo/och/taxi/model/TaxiModel.java index ae3054551e..46bfaf17aa 100644 --- a/OCH/taxi/driver/src/main/java/com/mogo/och/taxi/model/TaxiModel.java +++ b/OCH/taxi/driver/src/main/java/com/mogo/och/taxi/model/TaxiModel.java @@ -1210,6 +1210,11 @@ public class TaxiModel { private final IMoGoAutopilotStatusListener mGoAutopilotStatusListener = new IMoGoAutopilotStatusListener() { + @Override + public void onSsmReceiveTimeout(boolean isTimeout) { + + } + @Override public void onAutopilotDockerInfo(@NonNull String dockerVersion) { } diff --git a/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/MusicView.kt b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/MusicView.kt new file mode 100644 index 0000000000..35091e55f0 --- /dev/null +++ b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/MusicView.kt @@ -0,0 +1,95 @@ +package com.mogo.och.taxi.passenger.ui.music + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import android.view.View +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.lifecycle.ViewModelProvider +import androidx.lifecycle.findViewTreeViewModelStoreOwner +import com.mogo.och.common.module.manager.auditionmanager.MusicData +import com.mogo.och.taxi.passenger.R +import com.mogo.och.taxi.passenger.ui.music.list.MusicListView +import kotlinx.android.synthetic.main.taxi_p_music.view.iv_toggle_list_playing +import kotlinx.android.synthetic.main.taxi_p_music.view.mlv_list +import kotlinx.android.synthetic.main.taxi_p_music.view.mpv_playing + +class MusicView : ConstraintLayout, MusicViewModel.IMusicViewCallback, MusicListView.CheckListener { + + private val TAG = "ItineraryView" + + constructor(context: Context) : super(context) + + constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet) + + constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super( + context, + attributeSet, + defStyleAttr + ) + + constructor( + context: Context, + attributeSet: AttributeSet, + defStyleAttr: Int, + defStyleRes: Int + ) : super(context, attributeSet, defStyleAttr, defStyleRes) + + private fun initView() { + LayoutInflater.from(context).inflate(R.layout.taxi_p_music, this, true) + setBackgroundResource(R.drawable.taxt_p_music_bg) + + setListener() + } + + private fun setListener() { + iv_toggle_list_playing.setOnClickListener { + if (mpv_playing.visibility == VISIBLE && mlv_list.visibility == GONE) { + showMusicList() + } else if (mpv_playing.visibility == GONE && mlv_list.visibility == VISIBLE) { + showMusicPlaying() + }else{ + showMusicPlaying() + } + } + mlv_list.setCheckItemListener(this) + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + + val viewModel = findViewTreeViewModelStoreOwner()?.let { + ViewModelProvider(it).get(MusicViewModel::class.java) + } + + viewModel?.setDistanceCallback(this) + } + + + init { + try { + initView() + } catch (e: Exception) { + e.printStackTrace() + } + } + + private fun showMusicList(){ + mpv_playing.visibility = GONE + mlv_list.visibility = View.VISIBLE + iv_toggle_list_playing.setImageResource(R.drawable.taxt_p_go2_playing) + } + private fun showMusicPlaying(){ + mpv_playing.visibility = VISIBLE + mlv_list.visibility = GONE + iv_toggle_list_playing.setImageResource(R.drawable.taxt_p_go2_list) + } + + override fun checkItem(musicData: MusicData) { + mpv_playing.setData(musicData) + // 详情页显示歌曲 + showMusicPlaying() + } + + +} \ No newline at end of file diff --git a/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/MusicViewModel.kt b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/MusicViewModel.kt new file mode 100644 index 0000000000..1e6f8a70a9 --- /dev/null +++ b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/MusicViewModel.kt @@ -0,0 +1,31 @@ +package com.mogo.och.taxi.passenger.ui.music + +import androidx.lifecycle.ViewModel +import com.mogo.och.taxi.passenger.callback.IOCHTaxiPassengerOrderStatusCallback +import com.mogo.och.taxi.passenger.model.TaxiPassengerModel + +class MusicViewModel: ViewModel(), IOCHTaxiPassengerOrderStatusCallback { + + private val TAG = MusicViewModel::class.java.simpleName + + private var viewCallback:IMusicViewCallback?=null + + init { + + } + + fun setDistanceCallback(viewCallback:IMusicViewCallback){ + this.viewCallback = viewCallback + } + + override fun onCleared() { + super.onCleared() + this.viewCallback = null + } + + interface IMusicViewCallback{ + + } + + +} \ No newline at end of file diff --git a/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/list/MusicListItemAdapter.kt b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/list/MusicListItemAdapter.kt new file mode 100644 index 0000000000..21e0350e2e --- /dev/null +++ b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/list/MusicListItemAdapter.kt @@ -0,0 +1,86 @@ +package com.mogo.och.taxi.passenger.ui.music.list + +import android.content.Context +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.ImageView +import android.widget.TextView +import androidx.recyclerview.widget.RecyclerView +import com.mogo.och.common.module.manager.auditionmanager.MusicData +import com.mogo.och.common.module.manager.auditionmanager.PlayState +import com.mogo.och.taxi.passenger.R + +/** + * Created by adityagohad on 06/06/17. + */ +class MusicListItemAdapter( + private val context: Context, + private val dataList: MutableList, + private val clickListener: ClickListener +) : RecyclerView.Adapter() { + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TextVH { + val view: View + val inflater = LayoutInflater.from(context) + view = inflater.inflate(R.layout.taxi_p_music_list_item, parent, false) + return TextVH(view) + } + + override fun onBindViewHolder(holder: TextVH, position: Int) { + val musicData = dataList[holder.bindingAdapterPosition] + + holder.musicName.text = musicData.songName + holder.itemView.setOnClickListener { + clickListener.clickItem(musicData) + } + + if (musicData.state==PlayState.Playing||musicData.state==PlayState.Pause) { + holder.musicPlayState.visibility = View.VISIBLE + }else{ + holder.musicPlayState.visibility = View.GONE + } + } + + override fun getItemCount(): Int { + return dataList.size + } + + fun setNewData(data: MutableList) { + dataList.clear() + dataList.addAll(data) + notifyDataSetChanged() + } + + fun addOneData(musicData: MusicData){ + dataList.add(musicData) + notifyItemInserted(dataList.size) + } + + fun upDateMusicData(oldData: MusicData?,musicData: MusicData) { + dataList.forEachIndexed { index, musicDataIn -> + if (musicDataIn.id==musicData.id) { + musicDataIn.state = musicData.state + notifyItemChanged(index,0) + } + if(oldData?.id==musicDataIn.id){ + notifyItemChanged(index,0) + } + } + } + + inner class TextVH(itemView: View) : RecyclerView.ViewHolder(itemView) { + var musicName: TextView + var musicPlayState: ImageView + + init { + musicName = itemView.findViewById(R.id.tv_song_name) + musicPlayState = itemView.findViewById(R.id.iv_music_playing) + } + } + + interface ClickListener { + fun clickItem(musicData: MusicData) + } + +} \ No newline at end of file diff --git a/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/list/MusicListView.kt b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/list/MusicListView.kt new file mode 100644 index 0000000000..f8cc5d2f3d --- /dev/null +++ b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/list/MusicListView.kt @@ -0,0 +1,87 @@ +package com.mogo.och.taxi.passenger.ui.music.list + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.lifecycle.ViewModelProvider +import androidx.lifecycle.findViewTreeViewModelStoreOwner +import androidx.recyclerview.widget.LinearLayoutManager +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.och.common.module.manager.auditionmanager.MusicData +import com.mogo.och.taxi.passenger.R +import kotlinx.android.synthetic.main.taxi_p_music_list.view.rv_music_list +import me.jessyan.autosize.utils.AutoSizeUtils + +class MusicListView : ConstraintLayout, MusicListViewModel.IMusicListViewCaLillback, + MusicListItemAdapter.ClickListener { + + private val TAG = "ItineraryView" + + constructor(context: Context) : super(context) + + constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet) + + constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr) + + constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes) + + private val dataList = mutableListOf() + private lateinit var lineAdapter:MusicListItemAdapter + private var checkListener:CheckListener?=null + + private fun initView() { + LayoutInflater.from(context).inflate(R.layout.taxi_p_music_list, this, true) + rv_music_list.layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false) + lineAdapter = MusicListItemAdapter(context,dataList,this) + rv_music_list.adapter = lineAdapter + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + + val viewModel = findViewTreeViewModelStoreOwner()?.let { + ViewModelProvider(it).get(MusicListViewModel::class.java) + } + + viewModel?.setDistanceCallback(this) + } + + + init { + try { + initView() + } catch (e: Exception) { + e.printStackTrace() + } + } + + override fun addAllData(data: MutableList) { + lineAdapter.setNewData(data) + } + + override fun addOneData(it: MusicData) { + lineAdapter.addOneData(it) + } + + override fun updateMusicData(oldData: MusicData?,musicData: MusicData) { + lineAdapter.upDateMusicData(oldData,musicData) + CallerLogger.d(TAG,"${Thread.currentThread().name}----更新数据${oldData}-----${musicData}") + } + + override fun clickItem(musicData: MusicData) { + // 通知主页面去显示详情 + this.checkListener?.checkItem(musicData) + } + + fun setCheckItemListener(checkListener:CheckListener) { + this.checkListener = checkListener + } + + interface CheckListener { + fun checkItem(musicData: MusicData) + } + + + +} \ No newline at end of file diff --git a/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/list/MusicListViewModel.kt b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/list/MusicListViewModel.kt new file mode 100644 index 0000000000..4dc9eb31b3 --- /dev/null +++ b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/list/MusicListViewModel.kt @@ -0,0 +1,53 @@ +package com.mogo.och.taxi.passenger.ui.music.list + +import androidx.lifecycle.ViewModel +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.util.UiThreadHandler +import com.mogo.och.common.module.manager.auditionmanager.AuditionManager +import com.mogo.och.common.module.manager.auditionmanager.MusicData +import com.mogo.och.taxi.passenger.callback.IOCHTaxiPassengerOrderStatusCallback + +class MusicListViewModel : ViewModel(), IOCHTaxiPassengerOrderStatusCallback, + AuditionManager.MusicDataChangeListener { + + private val TAG = MusicListViewModel::class.java.simpleName + + private var viewCallback: IMusicListViewCaLillback? = null + + init { + + } + + fun setDistanceCallback(viewCallback: IMusicListViewCaLillback) { + this.viewCallback = viewCallback + viewCallback.addAllData(AuditionManager.musicList) + CallerLogger.d(TAG,"初始化音乐${AuditionManager.musicList.size}") + AuditionManager.addDataChangeListener(TAG,this) + } + + override fun onCleared() { + super.onCleared() + this.viewCallback = null + } + + interface IMusicListViewCaLillback { + fun addAllData(data:MutableList) + fun addOneData(it: MusicData) + fun updateMusicData(oldData: MusicData?,musicData: MusicData) + } + + override fun addOneData(it: MusicData) { + CallerLogger.d(TAG,"添加音乐:${it.songName}--${it.path}") + UiThreadHandler.post({ + this.viewCallback?.addOneData(it) + }, UiThreadHandler.MODE.QUEUE) + } + + override fun updateState(oldData: MusicData?,musicData: MusicData) { + UiThreadHandler.post({ + viewCallback?.updateMusicData(oldData, musicData) + }, UiThreadHandler.MODE.QUEUE) + } + + +} \ No newline at end of file diff --git a/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/playing/MusicPlayingView.kt b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/playing/MusicPlayingView.kt new file mode 100644 index 0000000000..8f0672cf6a --- /dev/null +++ b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/playing/MusicPlayingView.kt @@ -0,0 +1,186 @@ +package com.mogo.och.taxi.passenger.ui.music.playing + +import android.animation.ObjectAnimator +import android.animation.ValueAnimator +import android.content.Context +import android.os.Build +import android.util.AttributeSet +import android.view.LayoutInflater +import android.view.animation.LinearInterpolator +import android.widget.SeekBar +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.lifecycle.ViewModelProvider +import androidx.lifecycle.findViewTreeViewModelStoreOwner +import com.bumptech.glide.Glide +import com.bumptech.glide.request.RequestOptions +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.util.TimeTransformUtils +import com.mogo.och.common.module.manager.auditionmanager.MusicData +import com.mogo.och.common.module.manager.auditionmanager.PlayState +import com.mogo.och.common.module.utils.DateTimeUtil +import com.mogo.och.taxi.passenger.R +import kotlinx.android.synthetic.main.taxi_p_music_playing.view.iv_music_cover +import kotlinx.android.synthetic.main.taxi_p_music_playing.view.iv_music_cover_bg +import kotlinx.android.synthetic.main.taxi_p_music_playing.view.iv_show_next +import kotlinx.android.synthetic.main.taxi_p_music_playing.view.iv_show_pre +import kotlinx.android.synthetic.main.taxi_p_music_playing.view.iv_toggle +import kotlinx.android.synthetic.main.taxi_p_music_playing.view.sb_musuc_progess +import kotlinx.android.synthetic.main.taxi_p_music_playing.view.tv_music_name +import kotlinx.android.synthetic.main.taxi_p_music_playing.view.tv_playing_during +import kotlinx.android.synthetic.main.taxi_p_music_playing.view.tv_playing_time +import kotlinx.android.synthetic.main.taxi_p_music_playing.view.tv_tag + + +class MusicPlayingView : ConstraintLayout, MusicPlayingViewModel.IMusicPlayingViewCallback { + + private val TAG = "ItineraryView" + + constructor(context: Context) : super(context) + + constructor(context: Context, attributeSet: AttributeSet) : super(context, attributeSet) + + constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(context, attributeSet, defStyleAttr) + + constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attributeSet, defStyleAttr, defStyleRes) + + private var viewModel:MusicPlayingViewModel?=null + + private var animator:ObjectAnimator?=null + + private fun initView() { + LayoutInflater.from(context).inflate(R.layout.taxi_p_music_playing, this, true) + + + iv_toggle.setOnClickListener { + viewModel?.toggle() + } + iv_show_pre.setOnClickListener { + viewModel?.showPreMusic() + } + iv_show_next.setOnClickListener { + viewModel?.showNextMusic() + } + sb_musuc_progess.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{ + override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) { + CallerLogger.d(TAG,"progress:${progress}----fromUser:${fromUser}") + } + + override fun onStartTrackingTouch(seekBar: SeekBar?) { + + } + + override fun onStopTrackingTouch(seekBar: SeekBar?) { + + } + + }) + + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + + viewModel = findViewTreeViewModelStoreOwner()?.let { + ViewModelProvider(it).get(MusicPlayingViewModel::class.java) + } + + viewModel?.setDistanceCallback(this) + } + + override fun onVisibilityAggregated(isVisible: Boolean) { + super.onVisibilityAggregated(isVisible) + if(isVisible){ + viewModel?.showData() + } + } + + fun setData(musicData: MusicData) { + viewModel?.setMusicData(musicData) + } + + override fun setViewData(musicData: MusicData){ + tv_music_name.text = musicData.songName + tv_tag.text = musicData.tag.first() + tv_playing_time.text = DateTimeUtil.second2Time(0) + tv_playing_during.text = TimeTransformUtils.stringForTime(musicData.duration.toInt()) + if(musicData.state==PlayState.Playing){ + iv_toggle.setImageResource(R.drawable.taxi_p_music_pause) + startAnimal() + }else{ + iv_toggle.setImageResource(R.drawable.taxi_p_music_play) + endAnimal() + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + sb_musuc_progess.setProgress(0,true) + }else{ + sb_musuc_progess.progress=0.toInt() + } + + Glide.with(context) + .load(musicData.coverHeadImageUrl) + .apply(RequestOptions().placeholder(R.drawable.taxt_p_music_bg_relax_head)) + .into(iv_music_cover) + Glide.with(context) + .load(musicData.coverBottomImageUrl) + .apply(RequestOptions().placeholder(R.drawable.taxt_p_music_bg_relax_bottom)) + .into(iv_music_cover_bg) + } + + private fun startAnimal(){ + animator?.let { + if (!it.isRunning) { + animator?.start() + return + } + } + animator = ObjectAnimator.ofFloat(iv_music_cover, "rotation", 0f, 360f) + iv_music_cover.pivotX = (iv_music_cover.getWidth() / 2).toFloat() + iv_music_cover.pivotY = 166f + animator?.duration = 4000 + animator?.repeatCount = -1 + animator?.repeatMode = ValueAnimator.RESTART + animator?.interpolator = LinearInterpolator() + animator?.start() + } + private fun endAnimal(){ + if(animator!=null){ + animator?.pause() + } + } + + override fun setPlayOrpause(it: MusicData) { + if(it.state==PlayState.Playing){ + iv_toggle.setImageResource(R.drawable.taxi_p_music_pause) + startAnimal() + }else{ + iv_toggle.setImageResource(R.drawable.taxi_p_music_play) + endAnimal() + } + } + + override fun setProgress(currentPlay: Long, duration: Long) { + sb_musuc_progess.max = duration.toInt() + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + sb_musuc_progess.setProgress(currentPlay.toInt(),true) + }else{ + sb_musuc_progess.progress=currentPlay.toInt() + } + tv_playing_time.text = TimeTransformUtils.stringForTime(currentPlay.toInt()) + tv_playing_during.text = TimeTransformUtils.stringForTime(duration.toInt()) + } + + fun listenerPlaying(){ + + } + + + init { + try { + initView() + } catch (e: Exception) { + e.printStackTrace() + } + } + + +} \ No newline at end of file diff --git a/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/playing/MusicPlayingViewModel.kt b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/playing/MusicPlayingViewModel.kt new file mode 100644 index 0000000000..be5adf3e2f --- /dev/null +++ b/OCH/taxi/passenger/src/main/java/com/mogo/och/taxi/passenger/ui/music/playing/MusicPlayingViewModel.kt @@ -0,0 +1,105 @@ +package com.mogo.och.taxi.passenger.ui.music.playing + +import androidx.lifecycle.ViewModel +import com.elegant.utils.UiThreadHandler +import com.mogo.eagle.core.utilcode.util.ThreadUtils +import com.mogo.och.common.module.manager.auditionmanager.AuditionManager +import com.mogo.och.common.module.manager.auditionmanager.MusicData +import com.mogo.och.taxi.passenger.callback.IOCHTaxiPassengerOrderStatusCallback +import com.mogo.och.taxi.passenger.model.TaxiPassengerModel + +class MusicPlayingViewModel : ViewModel(), AuditionManager.MusicDataChangeListener { + + private val TAG = MusicPlayingViewModel::class.java.simpleName + + private var viewCallback: IMusicPlayingViewCallback? = null + + private var checkMusicData:MusicData?=null + + init { + + } + + fun setDistanceCallback(viewCallback: IMusicPlayingViewCallback) { + this.viewCallback = viewCallback + AuditionManager.addDataChangeListener(TAG,this) + } + + override fun onCleared() { + super.onCleared() + this.viewCallback = null + } + + fun setMusicData(musicData: MusicData) { + this.checkMusicData = musicData + this.viewCallback?.setViewData(musicData) + } + + fun showData() { + if(checkMusicData!=null){ + + }else{ + + } + } + + fun toggle() { + checkMusicData?.let { + AuditionManager.toggle(it) + } + } + + fun showPreMusic() { + checkMusicData?.let { + val nextMusicData = AuditionManager.getPreMusicData(it) + setMusicData(nextMusicData) + } + } + + fun showNextMusic() { + checkMusicData?.let { + val nextMusicData = AuditionManager.getNextMusicData(it) + setMusicData(nextMusicData) + } + } + + interface IMusicPlayingViewCallback { + fun setViewData(musicData: MusicData) + fun setPlayOrpause(it: MusicData) + fun setProgress(currentPlay: Long, duration: Long) + } + + override fun updateState(oldData:MusicData?,musicData: MusicData) { + checkMusicData?.let { + if(it.id==musicData.id){ + it.state = musicData.state + UiThreadHandler.post { + viewCallback?.setPlayOrpause(it) + } + } + } + } + override fun updatePlayCurrent(currentPlay: Long, duration: Long, musicData: MusicData){ + checkMusicData?.let { + if(it.id==musicData.id){ + UiThreadHandler.post { + viewCallback?.setProgress(currentPlay, duration) + } + } + } + } + + override fun onMusicCompletion(musicData: MusicData) { + super.onMusicCompletion(musicData) + checkMusicData?.let { + if(it.id==musicData.id){ + it.state = musicData.state + UiThreadHandler.post { + viewCallback?.setPlayOrpause(it) + } + } + } + showNextMusic() + toggle() + } +} \ No newline at end of file diff --git a/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxi_p_music_list_playing.png b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxi_p_music_list_playing.png new file mode 100644 index 0000000000..6a1a124d21 Binary files /dev/null and b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxi_p_music_list_playing.png differ diff --git a/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxi_p_music_next.png b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxi_p_music_next.png new file mode 100644 index 0000000000..8610c57bfc Binary files /dev/null and b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxi_p_music_next.png differ diff --git a/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxi_p_music_pause.png b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxi_p_music_pause.png new file mode 100644 index 0000000000..af55d1099e Binary files /dev/null and b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxi_p_music_pause.png differ diff --git a/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxi_p_music_play.png b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxi_p_music_play.png new file mode 100644 index 0000000000..32db628355 Binary files /dev/null and b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxi_p_music_play.png differ diff --git a/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxi_p_music_pre.png b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxi_p_music_pre.png new file mode 100644 index 0000000000..97f630aecd Binary files /dev/null and b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxi_p_music_pre.png differ diff --git a/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_go2_list.png b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_go2_list.png new file mode 100644 index 0000000000..bf68468f3b Binary files /dev/null and b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_go2_list.png differ diff --git a/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_go2_playing.png b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_go2_playing.png new file mode 100644 index 0000000000..1f10388ed7 Binary files /dev/null and b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_go2_playing.png differ diff --git a/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_music_bg.png b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_music_bg.png new file mode 100644 index 0000000000..77fc369149 Binary files /dev/null and b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_music_bg.png differ diff --git a/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_music_bg_middle.png b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_music_bg_middle.png new file mode 100644 index 0000000000..f8cd31bd4d Binary files /dev/null and b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_music_bg_middle.png differ diff --git a/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_music_bg_relax_bottom.png b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_music_bg_relax_bottom.png new file mode 100644 index 0000000000..32448f1b6f Binary files /dev/null and b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_music_bg_relax_bottom.png differ diff --git a/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_music_bg_relax_head.png b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_music_bg_relax_head.png new file mode 100644 index 0000000000..e3c1fc8039 Binary files /dev/null and b/OCH/taxi/passenger/src/main/res/drawable-nodpi/taxt_p_music_bg_relax_head.png differ diff --git a/OCH/taxi/passenger/src/main/res/drawable/taxt_p_music_seekbar_style.xml b/OCH/taxi/passenger/src/main/res/drawable/taxt_p_music_seekbar_style.xml new file mode 100644 index 0000000000..913d8c9679 --- /dev/null +++ b/OCH/taxi/passenger/src/main/res/drawable/taxt_p_music_seekbar_style.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OCH/taxi/passenger/src/main/res/layout/taxi_p_base_fragment.xml b/OCH/taxi/passenger/src/main/res/layout/taxi_p_base_fragment.xml index 3267295a8f..b750d07ef9 100644 --- a/OCH/taxi/passenger/src/main/res/layout/taxi_p_base_fragment.xml +++ b/OCH/taxi/passenger/src/main/res/layout/taxi_p_base_fragment.xml @@ -4,6 +4,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OCH/taxi/passenger/src/main/res/layout/taxi_p_music_list.xml b/OCH/taxi/passenger/src/main/res/layout/taxi_p_music_list.xml new file mode 100644 index 0000000000..69dd16f3db --- /dev/null +++ b/OCH/taxi/passenger/src/main/res/layout/taxi_p_music_list.xml @@ -0,0 +1,21 @@ + + + + + + + + \ No newline at end of file diff --git a/OCH/taxi/passenger/src/main/res/layout/taxi_p_music_list_item.xml b/OCH/taxi/passenger/src/main/res/layout/taxi_p_music_list_item.xml new file mode 100644 index 0000000000..9c4a899d8f --- /dev/null +++ b/OCH/taxi/passenger/src/main/res/layout/taxi_p_music_list_item.xml @@ -0,0 +1,37 @@ + + + + + + + + + + \ No newline at end of file diff --git a/OCH/taxi/passenger/src/main/res/layout/taxi_p_music_playing.xml b/OCH/taxi/passenger/src/main/res/layout/taxi_p_music_playing.xml new file mode 100644 index 0000000000..260e8bcb29 --- /dev/null +++ b/OCH/taxi/passenger/src/main/res/layout/taxi_p_music_playing.xml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OCH/taxi/passenger/src/main/res/values/colors.xml b/OCH/taxi/passenger/src/main/res/values/colors.xml index 315208e607..79958252ba 100644 --- a/OCH/taxi/passenger/src/main/res/values/colors.xml +++ b/OCH/taxi/passenger/src/main/res/values/colors.xml @@ -39,8 +39,11 @@ #A0B3DA #005D6A8C #5D6A8C + #576887 #995D6A8C #B37E90BF + #488ED0 + #598CFF #464646 diff --git a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFragmentViewModel.kt b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFragmentViewModel.kt index 2d6e900f96..839d5a5bb6 100644 --- a/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFragmentViewModel.kt +++ b/OCH/taxi/unmanned-driver/src/main/java/com/mogo/och/taxi/ui/routing/TaxiRoutingFragmentViewModel.kt @@ -6,6 +6,7 @@ import com.mogo.commons.AbsMogoApplication import com.mogo.commons.module.status.MogoStatusManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant +import com.mogo.eagle.core.utilcode.util.ActivityUtils import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.och.common.module.map.AmapNaviToDestinationModel import com.mogo.och.taxi.base.BaseViewModel @@ -38,7 +39,7 @@ class TaxiRoutingFragmentViewModel : BaseViewModel { DebugView.printInfoMsg("[选择任务] 跳转到选择任务列表") val intent = Intent(mContext, TaxiRoutingChooseLineActivity::class.java) - mContext?.startActivity(intent) + ActivityUtils.startActivity(intent) } is TaxiRoutingUiIntent.ShowRoutingTask -> { diff --git a/app/build.gradle b/app/build.gradle index f32e42f284..cb6369e1e0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -149,25 +149,29 @@ android { buildConfigField 'boolean', 'secure', "true" buildConfigField 'String', 'URLs', "\"${readFileToJson("mogo").replace("\"", "\\\"")}\"" buildConfigField 'String', 'mediaUrlConfig', "\"${readMediaUrlConfigFromJsonFile("mogo").replace("\"", "\\\"")}\"" + buildConfigField 'String', 'musicUrlConfig', "\"${readMusicUrlConfigFromJsonFile("mogo").replace("\"", "\\\"")}\"" } yantai { dimension "project" buildConfigField 'boolean', 'secure', "false" buildConfigField 'String', 'URLs', "\"${readFileToJson("yantai").replace("\"", "\\\"")}\"" buildConfigField 'String', 'mediaUrlConfig', "\"${readMediaUrlConfigFromJsonFile("yantai").replace("\"", "\\\"")}\"" + buildConfigField 'String', 'musicUrlConfig', "\"${readMusicUrlConfigFromJsonFile("yantai").replace("\"", "\\\"")}\"" } dali { dimension "project" - buildConfigField 'boolean', 'secure', "false" + buildConfigField 'boolean', 'secure', "true" buildConfigField 'String', 'URLs', "\"${readFileToJson("dali").replace("\"", "\\\"")}\"" buildConfigField 'String', 'mediaUrlConfig', "\"${readMediaUrlConfigFromJsonFile("dali").replace("\"", "\\\"")}\"" + buildConfigField 'String', 'musicUrlConfig', "\"${readMusicUrlConfigFromJsonFile("dali").replace("\"", "\\\"")}\"" } saas { dimension "project" buildConfigField 'boolean', 'secure', "true" buildConfigField 'String', 'URLs', "\"${readFileToJson("saas").replace("\"", "\\\"")}\"" buildConfigField 'String', 'mediaUrlConfig', "\"${readMediaUrlConfigFromJsonFile("saas").replace("\"", "\\\"")}\"" + buildConfigField 'String', 'musicUrlConfig', "\"${readMusicUrlConfigFromJsonFile("saas").replace("\"", "\\\"")}\"" } // 配置网络环境,QA、线上、演示 qa { @@ -426,6 +430,36 @@ Object readMediaUrlConfigFromJsonFile(env){ return null } +/** + * 读取各车型宣传视频本地配置 + * @param env + * @return + */ +Object readMusicUrlConfigFromJsonFile(env){ + try { + // 加载config.json 文件 + File file = new File("${rootDir}/app/config/MusicUrlConfig.json") + def jsonSlurper = new JsonSlurper() + // 解析json + def config = jsonSlurper.parse(file) + def flavorNames = variantVehicleName() + def jsonOutput = new JsonOutput() + def getKey = flavorNames + config.get(env).each {key, value -> + // 匹配flavor对应的 json + if(flavorNames.toLowerCase().contains(key)){ + getKey = key + return true + } + } + return jsonOutput.toJson(config.get(env).get(getKey)) + } catch (IOException e) { + e.printStackTrace() + } + return null +} + + def variantVehicleName() { if(gradle.startParameter.taskNames.size()>0) { for (String taskName : gradle.startParameter.taskNames) { diff --git a/app/config/MusicUrlConfig.json b/app/config/MusicUrlConfig.json index a56df21125..0908ccd73c 100644 --- a/app/config/MusicUrlConfig.json +++ b/app/config/MusicUrlConfig.json @@ -1,93 +1,123 @@ { "mogo": { - "taxiunmannedpassengerochdfhq": { + "taxipassengerochdfhq": { "musics": [ { + "id": "1", + "md5": "C24399007B8DBAAEAA6EF448A25393CE", "songName": "钢琴曲", "songUrl": "android.resource://com.mogo.launcher.f/raw/piano_music.mp3", "songUrlType": "local", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523261936/relax.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_05.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_05.png", "tag": [ "放松" ] }, { + "id": "2", + "md5": "ECA45497D915E0B933E45B5A5411B30E", "songName": "唯美的梦", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523329643/beautiful_dream.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523261936/relax.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718271475/taxt_p_music_head_04.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718199388/taxt_p_music_bottom_04.png", "tag": [ "放松" ] }, { + "id": "3", + "md5": "8FA0DE702443CD05BCA6DB1B7E6BE036", "songName": "有趣的时光", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523382842/fun_times.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523427472/lively.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718256470/taxt_p_music_head_03.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718184532/taxt_p_music_bottom_03.png", "tag": [ "欢快" ] }, { + "id": "4", + "md5": "FB1EF41BC69216AAA90323F3FBABDDDF", "songName": "游乐场", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523484705/playground_fun.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523427472/lively.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718241926/taxt_p_music_head_02.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718167794/taxt_p_music_bottom_02.png", "tag": [ "欢快" ] }, { + "id": "5", + "md5": "B721B4FBAE2D472F875A3A539135337A", "songName": "鼓舞我", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523537118/uplift_me.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523566881/dynamic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718228949/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718149545/taxt_p_music_bottom_01.png", "tag": [ "动感" ] }, { + "id": "6", + "md5": "836B99E70B7BC5C2283D602DF60F45F2", "songName": "假日乐趣", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523604653/summer_fun.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523566881/dynamic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718228949/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718149545/taxt_p_music_bottom_01.png", "tag": [ "动感" ] }, { + "id": "7", + "md5": "6B0B9FEF15B0FC8F1A1EAB6793DE5C02", "songName": "伟大梦想", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523656707/dreaming_big.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523695133/romantic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718228949/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718149545/taxt_p_music_bottom_01.png", "tag": [ "浪漫" ] }, { + "id": "8", + "md5": "3E8EE95E9E838709601D8BB8E2CC6B2A", "songName": "钢琴映像", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523740974/piano_reflections.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523695133/romantic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718241926/taxt_p_music_head_02.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718167794/taxt_p_music_bottom_02.png", "tag": [ "浪漫" ] }, { + "id": "9", + "md5": "59D695BB96DF67DBC0F5B064D727DA4A", "songName": "宁静的景色", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523785714/serene_view.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523814937/quiet.png", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718271475/taxt_p_music_head_04.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718199388/taxt_p_music_bottom_04.png", "tag": [ "静谧" ] }, { + "id": "10", + "md5": "1FBFA6AB04AA76168FDFDAFB0E189F4D", "songName": "困倦小猫", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523857450/sleepy_cat.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523814937/quiet.png", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718228949/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718149545/taxt_p_music_bottom_01.png", "tag": [ "静谧" ] @@ -97,91 +127,121 @@ "charterpassengerochm1": { "musics": [ { + "id": "1", + "md5": "C24399007B8DBAAEAA6EF448A25393CE", "songName": "钢琴曲", "songUrl": "android.resource://com.mogo.launcher.f/raw/piano_music.mp3", "songUrlType": "local", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523261936/relax.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_05.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_05.png", "tag": [ "放松" ] }, { + "id": "2", + "md5": "ECA45497D915E0B933E45B5A5411B30E", "songName": "唯美的梦", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523329643/beautiful_dream.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523261936/relax.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_04.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_04.png", "tag": [ "放松" ] }, { + "id": "3", + "md5": "8FA0DE702443CD05BCA6DB1B7E6BE036", "songName": "有趣的时光", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523382842/fun_times.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523427472/lively.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_03.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_03.png", "tag": [ "欢快" ] }, { + "id": "4", + "md5": "FB1EF41BC69216AAA90323F3FBABDDDF", "songName": "游乐场", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523484705/playground_fun.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523427472/lively.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_02.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_02.png", "tag": [ "欢快" ] }, { + "id": "5", + "md5": "B721B4FBAE2D472F875A3A539135337A", "songName": "鼓舞我", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523537118/uplift_me.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523566881/dynamic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "动感" ] }, { + "id": "6", + "md5": "836B99E70B7BC5C2283D602DF60F45F2", "songName": "假日乐趣", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523604653/summer_fun.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523566881/dynamic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "动感" ] }, { + "id": "7", + "md5": "6B0B9FEF15B0FC8F1A1EAB6793DE5C02", "songName": "伟大梦想", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523656707/dreaming_big.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523695133/romantic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "浪漫" ] }, { + "id": "8", + "md5": "3E8EE95E9E838709601D8BB8E2CC6B2A", "songName": "钢琴映像", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523740974/piano_reflections.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523695133/romantic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_02.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_02.png", "tag": [ "浪漫" ] }, { + "id": "9", + "md5": "59D695BB96DF67DBC0F5B064D727DA4A", "songName": "宁静的景色", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523785714/serene_view.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523814937/quiet.png", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_04.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_04.png", "tag": [ "静谧" ] }, { + "id": "10", + "md5": "1FBFA6AB04AA76168FDFDAFB0E189F4D", "songName": "困倦小猫", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523857450/sleepy_cat.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523814937/quiet.png", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "静谧" ] @@ -190,188 +250,124 @@ } }, "dali": { - "taxiunmannedpassengerochdfhq": { - "musics": [ - { - "songName": "钢琴曲", - "songUrl": "android.resource://com.mogo.launcher.f/raw/piano_music.mp3", - "songUrlType": "local", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523261936/relax.jpg", - "tag": [ - "放松" - ] - }, - { - "songName": "唯美的梦", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523329643/beautiful_dream.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523261936/relax.jpg", - "tag": [ - "放松" - ] - }, - { - "songName": "有趣的时光", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523382842/fun_times.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523427472/lively.jpg", - "tag": [ - "欢快" - ] - }, - { - "songName": "游乐场", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523484705/playground_fun.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523427472/lively.jpg", - "tag": [ - "欢快" - ] - }, - { - "songName": "鼓舞我", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523537118/uplift_me.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523566881/dynamic.jpg", - "tag": [ - "动感" - ] - }, - { - "songName": "假日乐趣", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523604653/summer_fun.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523566881/dynamic.jpg", - "tag": [ - "动感" - ] - }, - { - "songName": "伟大梦想", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523656707/dreaming_big.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523695133/romantic.jpg", - "tag": [ - "浪漫" - ] - }, - { - "songName": "钢琴映像", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523740974/piano_reflections.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523695133/romantic.jpg", - "tag": [ - "浪漫" - ] - }, - { - "songName": "宁静的景色", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523785714/serene_view.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523814937/quiet.png", - "tag": [ - "静谧" - ] - }, - { - "songName": "困倦小猫", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523857450/sleepy_cat.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523814937/quiet.png", - "tag": [ - "静谧" - ] - } - ] - }, "charterpassengerochm1": { "musics": [ { + "id": "1", + "md5": "C24399007B8DBAAEAA6EF448A25393CE", "songName": "钢琴曲", "songUrl": "android.resource://com.mogo.launcher.f/raw/piano_music.mp3", "songUrlType": "local", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523261936/relax.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_05.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_05.png", "tag": [ "放松" ] }, { + "id": "2", + "md5": "ECA45497D915E0B933E45B5A5411B30E", "songName": "唯美的梦", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523329643/beautiful_dream.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523261936/relax.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_04.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_04.png", "tag": [ "放松" ] }, { + "id": "3", + "md5": "8FA0DE702443CD05BCA6DB1B7E6BE036", "songName": "有趣的时光", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523382842/fun_times.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523427472/lively.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_03.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_03.png", "tag": [ "欢快" ] }, { + "id": "4", + "md5": "FB1EF41BC69216AAA90323F3FBABDDDF", "songName": "游乐场", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523484705/playground_fun.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523427472/lively.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_02.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_02.png", "tag": [ "欢快" ] }, { + "id": "5", + "md5": "B721B4FBAE2D472F875A3A539135337A", "songName": "鼓舞我", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523537118/uplift_me.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523566881/dynamic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "动感" ] }, { + "id": "6", + "md5": "836B99E70B7BC5C2283D602DF60F45F2", "songName": "假日乐趣", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523604653/summer_fun.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523566881/dynamic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "动感" ] }, { + "id": "7", + "md5": "6B0B9FEF15B0FC8F1A1EAB6793DE5C02", "songName": "伟大梦想", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523656707/dreaming_big.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523695133/romantic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "浪漫" ] }, { + "id": "8", + "md5": "3E8EE95E9E838709601D8BB8E2CC6B2A", "songName": "钢琴映像", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523740974/piano_reflections.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523695133/romantic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_02.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_02.png", "tag": [ "浪漫" ] }, { + "id": "9", + "md5": "59D695BB96DF67DBC0F5B064D727DA4A", "songName": "宁静的景色", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523785714/serene_view.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523814937/quiet.png", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_04.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_04.png", "tag": [ "静谧" ] }, { + "id": "10", + "md5": "1FBFA6AB04AA76168FDFDAFB0E189F4D", "songName": "困倦小猫", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523857450/sleepy_cat.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523814937/quiet.png", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "静谧" ] @@ -380,188 +376,124 @@ } }, "yantai": { - "taxiunmannedpassengerochdfhq": { - "musics": [ - { - "songName": "钢琴曲", - "songUrl": "android.resource://com.mogo.launcher.f/raw/piano_music.mp3", - "songUrlType": "local", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523261936/relax.jpg", - "tag": [ - "放松" - ] - }, - { - "songName": "唯美的梦", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523329643/beautiful_dream.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523261936/relax.jpg", - "tag": [ - "放松" - ] - }, - { - "songName": "有趣的时光", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523382842/fun_times.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523427472/lively.jpg", - "tag": [ - "欢快" - ] - }, - { - "songName": "游乐场", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523484705/playground_fun.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523427472/lively.jpg", - "tag": [ - "欢快" - ] - }, - { - "songName": "鼓舞我", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523537118/uplift_me.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523566881/dynamic.jpg", - "tag": [ - "动感" - ] - }, - { - "songName": "假日乐趣", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523604653/summer_fun.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523566881/dynamic.jpg", - "tag": [ - "动感" - ] - }, - { - "songName": "伟大梦想", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523656707/dreaming_big.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523695133/romantic.jpg", - "tag": [ - "浪漫" - ] - }, - { - "songName": "钢琴映像", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523740974/piano_reflections.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523695133/romantic.jpg", - "tag": [ - "浪漫" - ] - }, - { - "songName": "宁静的景色", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523785714/serene_view.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523814937/quiet.png", - "tag": [ - "静谧" - ] - }, - { - "songName": "困倦小猫", - "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523857450/sleepy_cat.mp3", - "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523814937/quiet.png", - "tag": [ - "静谧" - ] - } - ] - }, "charterpassengerochm1": { "musics": [ { + "id": "1", + "md5": "C24399007B8DBAAEAA6EF448A25393CE", "songName": "钢琴曲", "songUrl": "android.resource://com.mogo.launcher.f/raw/piano_music.mp3", "songUrlType": "local", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523261936/relax.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_05.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_05.png", "tag": [ "放松" ] }, { + "id": "2", + "md5": "ECA45497D915E0B933E45B5A5411B30E", "songName": "唯美的梦", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523329643/beautiful_dream.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523261936/relax.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_04.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_04.png", "tag": [ "放松" ] }, { + "id": "3", + "md5": "8FA0DE702443CD05BCA6DB1B7E6BE036", "songName": "有趣的时光", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523382842/fun_times.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523427472/lively.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_03.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_03.png", "tag": [ "欢快" ] }, { + "id": "4", + "md5": "FB1EF41BC69216AAA90323F3FBABDDDF", "songName": "游乐场", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523484705/playground_fun.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523427472/lively.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_02.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_02.png", "tag": [ "欢快" ] }, { + "id": "5", + "md5": "B721B4FBAE2D472F875A3A539135337A", "songName": "鼓舞我", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523537118/uplift_me.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523566881/dynamic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "动感" ] }, { + "id": "6", + "md5": "836B99E70B7BC5C2283D602DF60F45F2", "songName": "假日乐趣", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523604653/summer_fun.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523566881/dynamic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "动感" ] }, { + "id": "7", + "md5": "6B0B9FEF15B0FC8F1A1EAB6793DE5C02", "songName": "伟大梦想", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523656707/dreaming_big.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523695133/romantic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "浪漫" ] }, { + "id": "8", + "md5": "3E8EE95E9E838709601D8BB8E2CC6B2A", "songName": "钢琴映像", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523740974/piano_reflections.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523695133/romantic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_02.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_02.png", "tag": [ "浪漫" ] }, { + "id": "9", + "md5": "59D695BB96DF67DBC0F5B064D727DA4A", "songName": "宁静的景色", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523785714/serene_view.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523814937/quiet.png", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_04.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_04.png", "tag": [ "静谧" ] }, { + "id": "10", + "md5": "1FBFA6AB04AA76168FDFDAFB0E189F4D", "songName": "困倦小猫", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523857450/sleepy_cat.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523814937/quiet.png", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "静谧" ] @@ -569,95 +501,125 @@ ] } }, - "sass": { + "saas": { "taxiunmannedpassengerochdfhq": { "musics": [ { + "id": "1", + "md5": "C24399007B8DBAAEAA6EF448A25393CE", "songName": "钢琴曲", "songUrl": "android.resource://com.mogo.launcher.f/raw/piano_music.mp3", "songUrlType": "local", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523261936/relax.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_05.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_05.png", "tag": [ "放松" ] }, { + "id": "2", + "md5": "ECA45497D915E0B933E45B5A5411B30E", "songName": "唯美的梦", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523329643/beautiful_dream.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523261936/relax.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_04.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_04.png", "tag": [ "放松" ] }, { + "id": "3", + "md5": "8FA0DE702443CD05BCA6DB1B7E6BE036", "songName": "有趣的时光", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523382842/fun_times.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523427472/lively.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_03.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_03.png", "tag": [ "欢快" ] }, { + "id": "4", + "md5": "FB1EF41BC69216AAA90323F3FBABDDDF", "songName": "游乐场", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523484705/playground_fun.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523427472/lively.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_02.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_02.png", "tag": [ "欢快" ] }, { + "id": "5", + "md5": "B721B4FBAE2D472F875A3A539135337A", "songName": "鼓舞我", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523537118/uplift_me.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523566881/dynamic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "动感" ] }, { + "id": "6", + "md5": "836B99E70B7BC5C2283D602DF60F45F2", "songName": "假日乐趣", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523604653/summer_fun.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523566881/dynamic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "动感" ] }, { + "id": "7", + "md5": "6B0B9FEF15B0FC8F1A1EAB6793DE5C02", "songName": "伟大梦想", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523656707/dreaming_big.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523695133/romantic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "浪漫" ] }, { + "id": "8", + "md5": "3E8EE95E9E838709601D8BB8E2CC6B2A", "songName": "钢琴映像", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523740974/piano_reflections.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523695133/romantic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_02.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_02.png", "tag": [ "浪漫" ] }, { + "id": "9", + "md5": "59D695BB96DF67DBC0F5B064D727DA4A", "songName": "宁静的景色", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523785714/serene_view.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523814937/quiet.png", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_04.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_04.png", "tag": [ "静谧" ] }, { + "id": "10", + "md5": "1FBFA6AB04AA76168FDFDAFB0E189F4D", "songName": "困倦小猫", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523857450/sleepy_cat.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523814937/quiet.png", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "静谧" ] @@ -667,91 +629,121 @@ "charterpassengerochm1": { "musics": [ { + "id": "1", + "md5": "C24399007B8DBAAEAA6EF448A25393CE", "songName": "钢琴曲", "songUrl": "android.resource://com.mogo.launcher.f/raw/piano_music.mp3", "songUrlType": "local", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523261936/relax.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_05.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_05.png", "tag": [ "放松" ] }, { + "id": "2", + "md5": "ECA45497D915E0B933E45B5A5411B30E", "songName": "唯美的梦", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523329643/beautiful_dream.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523261936/relax.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_04.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_04.png", "tag": [ "放松" ] }, { + "id": "3", + "md5": "8FA0DE702443CD05BCA6DB1B7E6BE036", "songName": "有趣的时光", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523382842/fun_times.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523427472/lively.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_03.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_03.png", "tag": [ "欢快" ] }, { + "id": "4", + "md5": "FB1EF41BC69216AAA90323F3FBABDDDF", "songName": "游乐场", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523484705/playground_fun.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523427472/lively.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_02.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_02.png", "tag": [ "欢快" ] }, { + "id": "5", + "md5": "B721B4FBAE2D472F875A3A539135337A", "songName": "鼓舞我", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523537118/uplift_me.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523566881/dynamic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "动感" ] }, { + "id": "6", + "md5": "836B99E70B7BC5C2283D602DF60F45F2", "songName": "假日乐趣", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523604653/summer_fun.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523566881/dynamic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "动感" ] }, { + "id": "7", + "md5": "6B0B9FEF15B0FC8F1A1EAB6793DE5C02", "songName": "伟大梦想", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523656707/dreaming_big.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523695133/romantic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "浪漫" ] }, { + "id": "8", + "md5": "3E8EE95E9E838709601D8BB8E2CC6B2A", "songName": "钢琴映像", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523740974/piano_reflections.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523695133/romantic.jpg", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_02.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_02.png", "tag": [ "浪漫" ] }, { + "id": "9", + "md5": "59D695BB96DF67DBC0F5B064D727DA4A", "songName": "宁静的景色", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523785714/serene_view.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523814937/quiet.png", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_04.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_04.png", "tag": [ "静谧" ] }, { + "id": "10", + "md5": "1FBFA6AB04AA76168FDFDAFB0E189F4D", "songName": "困倦小猫", "songUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523857450/sleepy_cat.mp3", "songUrlType": "cloud", - "coverImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709523814937/quiet.png", + "coverHeadImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718285436/taxt_p_music_head_01.png", + "coverBottomImageUrl": "https://img.zhidaohulian.com/fileServer/online_car_hailing/1709718213773/taxt_p_music_bottom_01.png", "tag": [ "静谧" ] diff --git a/app/src/main/java/com/mogo/launcher/startup/ConfigStartUp.kt b/app/src/main/java/com/mogo/launcher/startup/ConfigStartUp.kt index 6d0db996c1..6c1f1e6e8b 100644 --- a/app/src/main/java/com/mogo/launcher/startup/ConfigStartUp.kt +++ b/app/src/main/java/com/mogo/launcher/startup/ConfigStartUp.kt @@ -48,6 +48,7 @@ object ConfigStartUp { FunctionBuildConfig.unableLaunchAutopilotGear = BuildConfig.UNABLE_LAUNCH_AUTOPILOT_GEAR // 各车型宣传视频本地配置json FunctionBuildConfig.mediaUrlConfig = BuildConfig.mediaUrlConfig + FunctionBuildConfig.musicUrlConfig = BuildConfig.musicUrlConfig //是否支持Patch升级 FunctionBuildConfig.isSupportPatchUpgrade = BuildConfig.IS_SUPPORT_PATCH_UPGRADE diff --git a/config.gradle b/config.gradle index 40adc07322..5c2dafe205 100644 --- a/config.gradle +++ b/config.gradle @@ -225,13 +225,13 @@ ext { btrace : "com.bytedance.btrace:rhea-core:2.0.0", mofang_runtime : "com.mogo.eagle.core.mofang:runtime:2.0.11", - log_runtime : "com.mogo.eagle.core.log.record:runtime:1.0.30", + log_runtime : "com.mogo.eagle.core.log.record:runtime:1.0.50", // 安全证书 passport_secret : "com.zhidaoauto:sdk-java:1.0.6-SNAPSHOT", // 主线程卡顿监测 - block_detector : "com.mogo.eagle.core.block:runtime:20.0.5", + block_detector : "com.mogo.eagle.core.block:runtime:20.0.10", //======================== google auto-service =============== google_auto_service : "com.google.auto.service:auto-service:1.0-rc7", diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/DataCenterProvider.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/DataCenterProvider.kt index 2d6a69a955..c6d9ffe435 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/DataCenterProvider.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/DataCenterProvider.kt @@ -15,10 +15,12 @@ class DataCenterProvider: IDataCenterProvider { override val functionName: String get() = "DataCenterProvider" + private var mContext:Context? = null + override fun init(context: Context?) { MoGoLocationDispatcher.initListener() - - context?.let { + mContext = context + mContext?.let { CallerMsgBoxManager.queryAllMessages(it) TrafficLightDispatcher.INSTANCE.initServer(it) SpeedLimitDispatcher.INSTANCE.initLimit(it) diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt index 6a67044de7..397d1222c0 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt @@ -135,13 +135,19 @@ object DataManager { MsgBoxType.VOICE -> { CallerMsgBoxListenerManager.invokeListener(MsgCategory.VOICE_INFO, msg) } - MsgBoxType.OBU, MsgBoxType.NOTICE, MsgBoxType.OPERATION, MsgBoxType.AUTOPILOT -> { + MsgBoxType.AUTOPILOT -> {// 不存数据库 + CallerMsgBoxListenerManager.invokeListener(MsgCategory.NOTICE, msg) + } + MsgBoxType.SSMINFO -> {// 不存数据库 + CallerMsgBoxListenerManager.invokeListener(MsgCategory.SYS_INFO, msg) + } + MsgBoxType.OBU, MsgBoxType.NOTICE, MsgBoxType.OPERATION -> { synchronized(this) { notifyList.add(msg) } CallerMsgBoxListenerManager.invokeListener(MsgCategory.NOTICE, msg) } - MsgBoxType.REPORT, MsgBoxType.SSMINFO -> { + MsgBoxType.REPORT -> { synchronized(this) { sysInfoList.add(msg) } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/DevaToolsProvider.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/DevaToolsProvider.kt index 827aa6b940..f823bf758a 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/DevaToolsProvider.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/DevaToolsProvider.kt @@ -39,6 +39,7 @@ import com.tencent.matrix.trace.config.TraceConfig import com.zhjt.mogo_core_function_devatools.apm.* import com.mogo.eagle.core.function.api.upgrade.* import com.mogo.weak.network.SdtManager +import com.zhjt.mogo_core_function_devatools.adas.PowerOffManager import com.zhjt.mogo_core_function_devatools.badcase.BadCaseManager import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig import com.zhjt.mogo_core_function_devatools.binding.* @@ -305,6 +306,63 @@ class DevaToolsProvider : IDevaToolsProvider { BadCaseManager.showBadCaseManagerWindow(context) } + /** + * 启动调用SSM停服命令超时检测 + */ + override fun startCommandWaitCountDown() { + PowerOffManager.startCommandWaitCountDown() + } + + /** + * 停止调用SSM停服命令超时检测 + */ + override fun stopCommandWaitCountDown() { + PowerOffManager.stopCommandWaitCountDown() + } + + /** + * 开始车辆下电等待倒计时 + */ + override fun startPowerDownCountDown() { + PowerOffManager.startPowerDownCountDown() + } + + /** + * 结束车辆下电等待倒计时 + */ + override fun stopPowerDownCountDown() { + PowerOffManager.stopPowerDownCountDown() + } + + /** + * 状态按钮变更倒计时 + */ + override fun statusChangeCountDown(isSuccess: Boolean) { + PowerOffManager.statusChangeCountDown(isSuccess) + } + + /** + * 结束状态按钮变更倒计时 + */ + override fun stopStatusCountDown() { + PowerOffManager.stopStatusCountDown() + } + + /** + * 设置停服状态 + */ + override fun setPowerOffStatus(status: Int) { + PowerOffManager.setPowerOffStatus(status) + } + + /** + * 获取停服状态 + */ + override fun getPowerOffStatus(): Int { + return PowerOffManager.getPowerOffStatus() + } + + override fun showReportListWindow(context: Context, isShow: Boolean) { iPCReportManager.showReportListWindow(context, isShow) } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/adas/PowerOffManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/adas/PowerOffManager.kt new file mode 100644 index 0000000000..a75bb2dc7c --- /dev/null +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/adas/PowerOffManager.kt @@ -0,0 +1,119 @@ +package com.zhjt.mogo_core_function_devatools.adas + +import android.os.CountDownTimer +import com.mogo.eagle.core.function.call.devatools.CallerPowerOffManager + +/** + * 停止域控服务管理类 + */ +object PowerOffManager { + + private var commandWaitCountDownTimer: CountDownTimer ?= null + private var powerDownCountDownTimer: CountDownTimer ?= null + private var statusChangeCountDownTimer: CountDownTimer ?= null + private var powerDownNum = 60 + /** + * 停止域控服务状态 + * 0:准备停服 1:停服命令下发成功 2:停服命令下发失败 3:停服命令下发超时 + * 4:停服中 5:停服成功 6:停服成功不可点击 + */ + private var powerOffStatus: Int = 0 + + /** + * 启动调用SSM停服命令超时检测 + */ + fun startCommandWaitCountDown(){ + commandWaitCountDownTimer = object: CountDownTimer(10000,10000){ + override fun onTick(millisUntilFinished: Long) { + + } + + override fun onFinish() { + CallerPowerOffManager.invokeCommandTimeout() + } + } + commandWaitCountDownTimer?.start() + } + + /** + * 停止调用SSM停服命令超时检测 + */ + fun stopCommandWaitCountDown(){ + if(commandWaitCountDownTimer != null){ + commandWaitCountDownTimer?.cancel() + commandWaitCountDownTimer = null + } + } + + /** + * 开始车辆下电等待倒计时 + */ + fun startPowerDownCountDown(){ + powerDownNum = 60 + powerDownCountDownTimer = object: CountDownTimer(60000,1000){ + override fun onTick(millisUntilFinished: Long) { + if(powerDownNum > 0){ + CallerPowerOffManager.invokePowerDownTick(powerDownNum--) + } + } + + override fun onFinish() { + powerDownNum = 0 + CallerPowerOffManager.invokePowerDownFinish() + } + } + powerDownCountDownTimer?.start() + } + + /** + * 结束车辆下电等待倒计时 + */ + fun stopPowerDownCountDown(){ + if(powerDownCountDownTimer != null){ + powerDownCountDownTimer?.cancel() + powerDownCountDownTimer = null + } + } + + /** + * 状态按钮变更倒计时 + */ + fun statusChangeCountDown(isSuccess: Boolean){ + statusChangeCountDownTimer = object: CountDownTimer(1000,1000){ + override fun onTick(millisUntilFinished: Long) { + + } + + override fun onFinish() { + CallerPowerOffManager.invokeStatusChange(isSuccess) + } + } + statusChangeCountDownTimer?.start() + } + + /** + * 结束状态按钮变更倒计时 + */ + fun stopStatusCountDown(){ + if(statusChangeCountDownTimer != null){ + statusChangeCountDownTimer?.cancel() + statusChangeCountDownTimer = null + } + } + + /** + * 设置停服状态 + */ + fun setPowerOffStatus(status: Int){ + powerOffStatus = status + } + + /** + * 获取停服状态 + */ + fun getPowerOffStatus(): Int{ + return powerOffStatus + } + + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/apm/ApmEnvProviderImpl.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/apm/ApmEnvProviderImpl.kt index 1eb915f91b..6043c1839b 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/apm/ApmEnvProviderImpl.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/apm/ApmEnvProviderImpl.kt @@ -123,7 +123,9 @@ class ApmEnvProviderImpl: IApmEnvProvider, CoroutineScope { launch(Dispatchers.Main) { Toast.makeText(Utils.getApp(), "发现系统环境不一致,正在重启...", Toast.LENGTH_SHORT).show() delay(50) - Utils.getApp().startActivity(Utils.getApp().packageManager.getLaunchIntentForPackage(Utils.getApp().packageName)) + Utils.getApp().packageManager.getLaunchIntentForPackage(Utils.getApp().packageName)?.also { + ActivityUtils.startActivity(it) + } Process.killProcess(Process.myPid()) } } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/block/MoGoBlockProviderImpl.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/block/MoGoBlockProviderImpl.kt index 29cda0e9c1..c6cbba0c37 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/block/MoGoBlockProviderImpl.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/block/MoGoBlockProviderImpl.kt @@ -47,30 +47,7 @@ internal class MoGoBlockProviderImpl: IMoGoBlockProvider, IBlockListener { Log.d("BLOCK", "--- onBlockReport ---: ${info.frames.size}") val map = mutableMapOf>() map["frames"] = info.frames.map { "$it" } - BlockDetector.recorder().dump(object: OnDumpListener { - override fun OnDumped(data: Map>) { - map["history"] = data[0] ?: emptyList() - map["pending"] = data[1] ?: emptyList() - val cpu = CallerDevaToolsManager.usage()?.dump() - if (!cpu.isNullOrEmpty()) { - val mainThreadUsage = cpu.remove("MainThreadUsage") - val processUsage = cpu.remove("ProcessUsage") - if (mainThreadUsage != null && processUsage != null) { - map["cpu"] = ArrayList().also { - it.add("main-thread: ${ "%.2f".format(mainThreadUsage * 1.0f * 100 / processUsage) }% ($mainThreadUsage, $processUsage)") - for (e in cpu.entries.sortedByDescending { e -> e.value }) { - it.add("${e.key}: ${ "%.2f".format(e.value * 1.0f * 100 / processUsage) }% (${e.value}, $processUsage)") - } - } - } - } - try { - VLogUtils.w("BLOCK", GsonUtils.toJson(map)) - } catch (t: Throwable) { - t.printStackTrace() - } - } - }) + dump(map) } override fun monitor(window: Window) { @@ -102,4 +79,33 @@ internal class MoGoBlockProviderImpl: IMoGoBlockProvider, IBlockListener { override fun recorder(): IMessageRecorder { return BlockDetector.recorder() } + + override fun dump(extra: Map>?) { + val map = mutableMapOf>() + extra?.takeIf { it.isNotEmpty() }?.also { map.putAll(it) } + BlockDetector.recorder().dump(object: OnDumpListener { + override fun OnDumped(data: Map>) { + map["history"] = data[0] ?: emptyList() + map["pending"] = data[1] ?: emptyList() + val cpu = CallerDevaToolsManager.usage()?.dump() + if (!cpu.isNullOrEmpty()) { + val mainThreadUsage = cpu.remove("MainThreadUsage") + val processUsage = cpu.remove("ProcessUsage") + if (mainThreadUsage != null && processUsage != null) { + map["cpu"] = ArrayList().also { + it.add("main-thread: ${ "%.2f".format(mainThreadUsage * 1.0f * 100 / processUsage) }% ($mainThreadUsage, $processUsage)") + for (e in cpu.entries.sortedByDescending { e -> e.value }) { + it.add("${e.key}: ${ "%.2f".format(e.value * 1.0f * 100 / processUsage) }% (${e.value}, $processUsage)") + } + } + } + } + try { + VLogUtils.w("BLOCK", GsonUtils.toJson(map)) + } catch (t: Throwable) { + t.printStackTrace() + } + } + }) + } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/block/observer/AnrLogcatObserver.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/block/observer/AnrLogcatObserver.kt new file mode 100644 index 0000000000..f87f3e1838 --- /dev/null +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/block/observer/AnrLogcatObserver.kt @@ -0,0 +1,11 @@ +package com.zhjt.mogo_core_function_devatools.block.observer + +import com.mogo.core.log.record.config.checker.ILogcatChecker +import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager + +class AnrLogcatObserver: ILogcatChecker.ILogcatCheckObserver { + + override fun onGet() { + CallerDevaToolsManager.block()?.dump() + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/env/EnvChangeManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/env/EnvChangeManager.kt index 43ce0a6e01..06c4e48840 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/env/EnvChangeManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/env/EnvChangeManager.kt @@ -7,6 +7,7 @@ import com.mogo.commons.debug.DebugConfig import com.mogo.eagle.core.data.EnvConfig import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager import com.mogo.commons.storage.SharedPrefsMgr +import com.mogo.eagle.core.utilcode.util.ActivityUtils import com.mogo.eagle.core.utilcode.util.Utils @@ -85,7 +86,9 @@ object EnvChangeManager { } private fun restartApp() { - Utils.getApp().startActivity(Utils.getApp().packageManager.getLaunchIntentForPackage(Utils.getApp().packageName)) + Utils.getApp().packageManager.getLaunchIntentForPackage(Utils.getApp().packageName)?.also { + ActivityUtils.startActivity(it) + } Process.killProcess(Process.myPid()) } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/logcat/MoGoLogRecordProviderImpl.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/logcat/MoGoLogRecordProviderImpl.kt index 6dbe5d527d..b63c0a8d85 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/logcat/MoGoLogRecordProviderImpl.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/logcat/MoGoLogRecordProviderImpl.kt @@ -10,12 +10,12 @@ import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager import com.mogo.commons.AbsMogoApplication import com.mogo.core.log.record.* import com.mogo.core.log.record.config.* -import com.mogo.core.log.record.config.crash.* import com.mogo.core.log.record.config.state.IStateProvider import com.mogo.core.log.record.model.UploadError import com.mogo.eagle.core.data.app.AppConfigInfo import com.mogo.eagle.core.function.api.devatools.logcat.* import com.zhidao.loglib.bean.RemoteLogPushContent +import com.zhjt.mogo_core_function_devatools.logcat.checker.AnrLogChecker import com.zhjt.mogo_core_function_devatools.logcat.config.LogRecordConfig import com.zhjt.mogo_core_function_devatools.logcat.uploader.* import kotlinx.coroutines.* @@ -99,17 +99,12 @@ internal class MoGoLogRecordProviderImpl: IMoGoLogRecordProvider, itx["协议版本号"] = AppConfigInfo.protocolVersionNumber itx["${divider}-7"] = divider itx["角色"] = AppConfigInfo.role - } } }) - .crashConfig(CrashConfig.Builder() - .enabled(false) - .crashDir(File(context.getExternalFilesDir(null), "logcat/crash")) - .javaCrash(true) - .anr(true) - .nativeCrash(true) - .build()) + .ignoreTags(" OpenGLRenderer") + .systemTags(" ActivityManager") + .checker(AnrLogChecker()) .uploader(LogRecordUploader())) scope.launch { try { diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/logcat/checker/AnrLogChecker.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/logcat/checker/AnrLogChecker.kt new file mode 100644 index 0000000000..50c3473caf --- /dev/null +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/logcat/checker/AnrLogChecker.kt @@ -0,0 +1,24 @@ +package com.zhjt.mogo_core_function_devatools.logcat.checker + +import com.mogo.core.log.record.config.checker.ILogcatChecker +import com.zhjt.mogo_core_function_devatools.block.observer.AnrLogcatObserver +import okio.ByteString.Companion.encodeUtf8 +import okio.Source +import okio.buffer + +class AnrLogChecker: ILogcatChecker { + + companion object { + private const val TAG = "AnrLogChecker" + } + + private val anrByteString by lazy { "ANR in com.mogo.launcher.f".encodeUtf8() } + + override fun check(data: Source): Boolean { + return data.buffer().indexOf(anrByteString) >= 0 + } + + override fun observer(): ILogcatChecker.ILogcatCheckObserver { + return AnrLogcatObserver() + } +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt index 86dc79f4ec..fc6ab08a14 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt @@ -43,6 +43,9 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A private val report: Int = 4 private val summary: Int = 5 private val fm: Int = 6 + private val ssm: Int = 7 + private val autopilot: Int = 8 + private val none: Int = 9 private var changeViewListener: ChangeViewListener?=null @@ -91,6 +94,14 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_fm,parent,false) return BubbleFmHolder(view) } + ssm -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_ssm,parent,false) + return BubbleSsmHolder(view) + } + autopilot -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_autopilot,parent,false) + return BubbleAutopilotHolder(view) + } else -> { val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_v2x,parent,false) return BubbleV2XHolder(view) @@ -262,6 +273,24 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A } } } + //SSM连接消息 + is BubbleSsmHolder ->{ + data?.let { + val ssmMsg = it[position].msgBoxBean.bean as SSMMsg + holder.tvSsmTitle.text = ssmMsg.title + holder.tvSsmContent.text= ssmMsg.content + holder.tvSsmTime.text = TimeUtils.millis2String(ssmMsg.timestamp,getHourMinFormat()) + } + } + //域控制器连接消息 + is BubbleAutopilotHolder ->{ + data?.let { + val autopilotMsg = it[position].msgBoxBean.bean as AutopilotMsg + holder.tvAutopilotTitle.text = autopilotMsg.title + holder.tvAutopilotContent.text = autopilotMsg.content + holder.tvAutopilotTime.text = TimeUtils.millis2String(autopilotMsg.timestamp,getHourMinFormat()) + } + } } val msgBoxBean: MsgBoxCountDownBean = data!![position] @@ -311,7 +340,11 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A summary }else if(data!![position].msgBoxBean.type == MsgBoxType.FMINFO){ fm - } else{ + }else if(data!![position].msgBoxBean.type == MsgBoxType.SSMINFO){ + ssm + }else if(data!![position].msgBoxBean.type == MsgBoxType.AUTOPILOT){ + autopilot + } else { v2x } } @@ -378,6 +411,22 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A var tvBubbleFmTime: TextView = itemView.findViewById(R.id.tvBubbleFmTime) } + //SSM连接消息 + class BubbleSsmHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var ivSsmImage: ImageView = itemView.findViewById(R.id.ivSsmImage) + var tvSsmTitle: TextView = itemView.findViewById(R.id.tvSsmTitle) + var tvSsmTime: TextView = itemView.findViewById(R.id.tvSsmTime) + var tvSsmContent: TextView = itemView.findViewById(R.id.tvSsmContent) + } + + //域控制器连接状态消息 + class BubbleAutopilotHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var ivAutopilotImage: ImageView = itemView.findViewById(R.id.ivAutopilotImage) + var tvAutopilotTitle: TextView = itemView.findViewById(R.id.tvAutopilotTitle) + var tvAutopilotTime: TextView = itemView.findViewById(R.id.tvAutopilotTime) + var tvAutopilotContent: TextView = itemView.findViewById(R.id.tvAutopilotContent) + } + fun setChangeListener(listener: ChangeViewListener){ changeViewListener = listener } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt index c269c4dd0f..a665a8dd12 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt @@ -45,7 +45,12 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : private val fm: Int = 4 //FM信息 private val report: Int = 5 //系统信息 private val record: Int = 6 //录包 - private val summary: Int = 8 + private val summary: Int = 8 //汇总消息 + private val ssm: Int = 9 //SSM连接消息 + private val autopilot = 20 //工控机连接消息 + + private val none = -1 + //Error private val RESULT_AUTOPILOT_DISABLE = "RESULT_AUTOPILOT_DISABLE" @@ -116,6 +121,16 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : .inflate(R.layout.item_msg_box_summary, parent, false) return MsgBoxSummary(view) } + ssm -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_msg_box_ssm,parent,false) + return MsgBoxSsm(view) + } + autopilot -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_msg_box_autopilot,parent,false) + return MsgBoxAutopilot(view) + } else -> { val view = LayoutInflater.from(parent.context) .inflate(R.layout.item_msg_box_v2x, parent, false) @@ -648,6 +663,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : } } } + //汇总消息 is MsgBoxSummary -> { data?.let { val summaryMsg = it[position].bean as V2XMsg @@ -656,6 +672,24 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : holder.tvSummaryContent.text = summaryMsg.content } } + //SSM连接状态消息 + is MsgBoxSsm -> { + data?.let { + val ssmMsg = it[position].bean as SSMMsg + holder.tvSsmTitle.text = ssmMsg.title + holder.tvSsmContent.text = ssmMsg.content + holder.tvSsmTime.text = TimeUtils.millis2String(ssmMsg.timestamp,getHourMinFormat()) + } + } + //域控制器连接状态消息 + is MsgBoxAutopilot ->{ + data?.let { + val autopilotMsg = it[position].bean as AutopilotMsg + holder.tvAutopilotTitle.text = autopilotMsg.title + holder.tvAutopilotContent.text = autopilotMsg.content + holder.tvAutopilotTime.text = TimeUtils.millis2String(autopilotMsg.timestamp,getHourMinFormat()) + } + } } } @@ -692,9 +726,14 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : record } else if(data!![position].type == MsgBoxType.FMINFO){ fm - } - else { + } else if(data!![position].type == MsgBoxType.SSMINFO){ + ssm + } else if(data!![position].type == MsgBoxType.AUTOPILOT){ + autopilot + } else if(data!![position].type == MsgBoxType.V2X || data!![position].type == MsgBoxType.OBU){ v2x + } else { + none } } @@ -791,5 +830,20 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : var tvSummaryTime: TextView = itemView.findViewById(R.id.tvSummaryTime) } + //SSM连接状态 + class MsgBoxSsm(itemView: View) : RecyclerView.ViewHolder(itemView){ + var ivSsmImage: ImageView = itemView.findViewById(R.id.ivSsmImage) + var tvSsmTitle: TextView = itemView.findViewById(R.id.tvSsmTitle) + var tvSsmTime: TextView = itemView.findViewById(R.id.tvSsmTime) + var tvSsmContent: TextView = itemView.findViewById(R.id.tvSsmContent) + } + + //域控制器连接状态 + class MsgBoxAutopilot(itemView: View) : RecyclerView.ViewHolder(itemView){ + var ivAutopilotImage: ImageView = itemView.findViewById(R.id.ivAutopilotImage) + var tvAutopilotTitle: TextView = itemView.findViewById(R.id.tvAutopilotTitle) + var tvAutopilotTime: TextView = itemView.findViewById(R.id.tvAutopilotTime) + var tvAutopilotContent: TextView = itemView.findViewById(R.id.tvAutopilotContent) + } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 4cd0e2358b..ca5e052b96 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -2168,7 +2168,7 @@ internal class DebugSettingView @JvmOverloads constructor( Intent(Intent.ACTION_MAIN).apply { addCategory(Intent.CATEGORY_HOME) flags = Intent.FLAG_ACTIVITY_NEW_TASK - context.startActivity(this) + ActivityUtils.startActivity(this) Process.killProcess(Process.myPid()) exitProcess(0) } @@ -2247,8 +2247,9 @@ internal class DebugSettingView @JvmOverloads constructor( } private fun restartApp() { - Utils.getApp() - .startActivity(Utils.getApp().packageManager.getLaunchIntentForPackage(Utils.getApp().packageName)) + Utils.getApp().packageManager.getLaunchIntentForPackage(Utils.getApp().packageName)?.also { + ActivityUtils.startActivity(it) + } Process.killProcess(Process.myPid()) } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt index 1c4f93d462..797cadd2d6 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt @@ -24,6 +24,7 @@ import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.ui.utils.KeyBoardUtil import com.mogo.eagle.core.function.msgbox.MsgBoxConfig import com.mogo.eagle.core.utilcode.kotlin.onClick +import com.mogo.eagle.core.utilcode.util.ActivityUtils import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.zhjt.service_biz.BizConfig @@ -263,7 +264,7 @@ internal class AutoPilotAndCheckView @JvmOverloads constructor( Intent(Intent.ACTION_MAIN).apply { addCategory(Intent.CATEGORY_HOME) flags = Intent.FLAG_ACTIVITY_NEW_TASK - context.startActivity(this) + ActivityUtils.startActivity(this) Process.killProcess(Process.myPid()) exitProcess(0) } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/CheckSystemView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/CheckSystemView.kt index 7feec03b76..4c5ea24b0d 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/CheckSystemView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/CheckSystemView.kt @@ -1,37 +1,64 @@ package com.mogo.eagle.core.function.hmi.ui.widget +import android.animation.ObjectAnimator +import android.animation.ValueAnimator import android.content.Context import android.util.AttributeSet -import android.view.Gravity import android.view.LayoutInflater import android.view.View +import android.view.animation.LinearInterpolator import androidx.constraintlayout.widget.ConstraintLayout -import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI +import androidx.core.content.ContextCompat +import com.mogo.commons.voice.AIAssist +import com.mogo.eagle.core.data.enums.EventTypeEnumNew +import com.mogo.eagle.core.data.msgbox.MsgBoxBean +import com.mogo.eagle.core.data.msgbox.MsgBoxType +import com.mogo.eagle.core.data.msgbox.V2XMsg import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener +import com.mogo.eagle.core.function.api.autopilot.IMoGoReceiveReceivedAckListener +import com.mogo.eagle.core.function.api.devatools.IPowerOffListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.function.call.autopilot.CallerReceiveReceivedAckListenerManager +import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager +import com.mogo.eagle.core.function.call.devatools.CallerPowerOffManager +import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager.saveMsgBox import com.mogo.eagle.core.function.hmi.R -import com.mogo.eagle.core.function.hmi.notification.WarningFloat import com.mogo.eagle.core.function.hmi.ui.tools.DockerRebootDialog +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI import com.mogo.eagle.core.utilcode.util.ThreadUtils import com.mogo.eagle.core.utilcode.util.ToastUtils +import com.zhjt.mogo.adas.common.MessageType import com.zhjt.mogo.adas.data.AdasConstants +import com.zhjt.mogo.adas.data.bean.ReceivedAck import kotlinx.android.synthetic.main.view_check_system.view.* + class CheckSystemView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 -) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener { +) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener, + IPowerOffListener, IMoGoReceiveReceivedAckListener { companion object { const val TAG = "CheckSystemView" } + //重启系统对话框 private var dockerRebootDialog: DockerRebootDialog? = null - private var downloadStatus: String = "" //下载状态 - private var upgradeStatus: String = "" //升级状态 + private var connectStatus: Boolean = false //与工控机的连接状态 + private var isExecutingPowerOff: Boolean = false //是否正在下发一键停服命令 + private var isPowerOffCountDown: Boolean = false //一键停服是否处于1分钟倒计时 + private var powerOffMsgId: Long = -1 //一键停服命令下发Id + private var progressAnimator: ObjectAnimator ?= null //一键停服命令倒计时 + /** + * 停止域控服务状态 + * 0:准备停服 1:停服命令下发中 2:停服命令下发成功 3:停服命令下发失败 + * 4:停服命令下发超时 5:停服中 6:停服成功 7:停服成功不可点击 + */ + private var powerOffStatus: Int = 0 init { LayoutInflater.from(context).inflate(R.layout.view_check_system, this, true) @@ -39,85 +66,386 @@ class CheckSystemView @JvmOverloads constructor( } private fun initView() { + //一键停服 viewCheckShutDown.setOnClickListener { - //dialog -// showSystemOperationWindow() + powerOff() } + tvCheckShutDown.setOnClickListener { + powerOff() + } + //重启系统 viewCheckReboot.setOnClickListener { - //dialog - if (dockerRebootDialog == null) { - dockerRebootDialog = DockerRebootDialog(context) - dockerRebootDialog?.setClickListener(object : DockerRebootDialog.ClickListener { - override fun confirm() { - if (CallerAutoPilotStatusListenerManager.getState() == 2) { - //当前处于自动驾驶状态,不可进行重启,Toast提示 - ToastUtils.showShort("请先退出自动驾驶状态") - } - -// else if (AdUpgradeStateHelper.showCannotReboot( -// downloadStatus, -// upgradeStatus -// ) -// ) { -// //当工控机处于下载或者升级状态,需要先进行升级 -// ToastUtils.showShort("请先完成新自动驾驶系统的下载/升级") -// } - - else { - //确认重启 - CallerLogger.d("$M_HMI$TAG", "reboot confirm") - CallerAutoPilotControlManager.sendIpcReboot() - ToastUtils.showLong("重启命令已发送") - } - } - - override fun cancel() { - //取消重启 - CallerLogger.d("$M_HMI$TAG", "reboot cancel") - } - - }) - } - dockerRebootDialog?.showUpgradeDialog() + showRebootDialog() + } + tvCheckReboot.setOnClickListener { + showRebootDialog() + } + CallerDevaToolsManager.getPowerOffStatus()?.let { + powerOffStatus = it + } + when(powerOffStatus){ + //准备停服 + 0->{ + viewCheckShutDown.setImageDrawable( + ContextCompat.getDrawable( + context, + R.drawable.icon_shut_down + ) + ) + viewCheckShutDown.isClickable = true + } + //停服命令下发中 + 1->{ + isExecutingPowerOff = true + } + //停服命令下发成功 + 2->{ + viewProgressBackground.visibility = View.VISIBLE + viewProgress.visibility = View.VISIBLE + tvCountDown.visibility = View.VISIBLE + tvCountDownUnit.visibility = View.VISIBLE + //开始旋转动画 + if(progressAnimator == null){ + progressAnimator = ObjectAnimator.ofFloat(viewProgress,"rotation", 0f, 360f) + } + progressAnimator?.interpolator = LinearInterpolator() + progressAnimator?.repeatCount = ValueAnimator.INFINITE //无限循环 + progressAnimator?.duration = 6000 //设置持续时间 + progressAnimator?.startDelay = 0 + progressAnimator?.start() + //一键停服倒计时中 + isPowerOffCountDown = true + } + //停服命令下发失败 + 3->{ + viewCheckShutDown.setImageDrawable( + ContextCompat.getDrawable( + context, + R.drawable.icon_shut_down_fail + ) + ) + } + //停服命令下发超时 + 4->{ + //将图标改为失败 + viewCheckShutDown.setImageDrawable( + ContextCompat.getDrawable( + context, + R.drawable.icon_shut_down_fail + ) + ) + } + //停服中 + 5->{ + isPowerOffCountDown = true + viewCheckShutDown.setImageDrawable( + ContextCompat.getDrawable( + context, + R.drawable.icon_shut_down_background + ) + ) + viewProgressBackground.visibility = View.VISIBLE + viewProgress.visibility = View.VISIBLE + tvCountDown.visibility = View.VISIBLE + tvCountDownUnit.visibility = View.VISIBLE + //开始旋转动画 + if(progressAnimator == null){ + progressAnimator = ObjectAnimator.ofFloat(viewProgress,"rotation", 0f, 360f) + } + progressAnimator?.interpolator = LinearInterpolator() + progressAnimator?.repeatCount = ValueAnimator.INFINITE //无限循环 + progressAnimator?.duration = 6000 //设置持续时间 + progressAnimator?.startDelay = 0 + progressAnimator?.start() + } + //停服成功 + 6->{ + //停止一键停服进度属性动画 + progressAnimator?.cancel() + //隐藏一键停服进度视图 + viewProgressBackground.visibility = View.GONE + viewProgress.visibility = View.GONE + tvCountDown.visibility = View.GONE + tvCountDownUnit.visibility = View.GONE + //一键停服命令倒计时结束,变为成功状态,并且发送1s倒计时 + viewCheckShutDown.setImageDrawable( + ContextCompat.getDrawable( + context, + R.drawable.icon_shut_down_success + ) + ) + isPowerOffCountDown = false + } + //停服成功不可点击 + 7->{ + //将倒计时内容隐藏 + viewProgressBackground.visibility = View.GONE + viewProgress.visibility = View.GONE + tvCountDown.visibility = View.GONE + tvCountDownUnit.visibility = View.GONE + //停服成功,将按钮置为不可点击状态 + viewCheckShutDown.setImageDrawable( + ContextCompat.getDrawable( + context, + R.drawable.icon_shut_down_complete + ) + ) + viewCheckShutDown.isClickable = false + isPowerOffCountDown = false + } } } - fun setAdUpgradeStatus(downloadStatus: String, upgradeStatus: String) { - this.downloadStatus = downloadStatus - this.upgradeStatus = upgradeStatus + /** + * 一键停服 + */ + private fun powerOff() { + if (!connectStatus) { + ToastUtils.showShort("尚未连接工控机,无法下发一键停服命令") + return + } + if (isExecutingPowerOff) { + //一键停服命令下发执行中 + ToastUtils.showShort("一键停服命令下发中,请勿重复点击") + return + } + if (isPowerOffCountDown) { + //系统停服中 + ToastUtils.showShort("系统停服中,请勿重复点击") + return + } + //将是否正在下发一键停服命令标签改为true + isExecutingPowerOff = true + CallerDevaToolsManager.setPowerOffStatus(1) + //系统命令请求 关机 + powerOffMsgId = CallerAutoPilotControlManager.sendIpcPowerOff() + //开始执行10秒等待倒计时 + CallerDevaToolsManager.startCommandWaitCountDown() } - private fun showSystemOperationWindow(view: View) { - WarningFloat.with(context).setGravity(Gravity.CENTER).setLayout(view) - .setImmersionStatusBar(true).show() + /** + * 展示系统重启确认窗 + */ + private fun showRebootDialog() { + if (!connectStatus) { + ToastUtils.showShort("尚未连接工控机,无法重启系统") + return + } + //dialog + if (dockerRebootDialog == null) { + dockerRebootDialog = DockerRebootDialog(context) + dockerRebootDialog?.setClickListener(object : DockerRebootDialog.ClickListener { + override fun confirm() { + if (CallerAutoPilotStatusListenerManager.getState() == 2) { + //当前处于自动驾驶状态,不可进行重启,Toast提示 + ToastUtils.showShort("请先退出自动驾驶状态") + } else { + //确认重启 + CallerLogger.d("$M_HMI$TAG", "reboot confirm") + CallerAutoPilotControlManager.sendIpcReboot() + ToastUtils.showLong("重启命令已发送") + } + } + + override fun cancel() { + //取消重启 + CallerLogger.d("$M_HMI$TAG", "reboot cancel") + } + + }) + } + dockerRebootDialog?.showUpgradeDialog() } override fun onAttachedToWindow() { super.onAttachedToWindow() CallerAutoPilotStatusListenerManager.addListener(TAG, this) + CallerPowerOffManager.addListener(TAG, this) + CallerReceiveReceivedAckListenerManager.addListener(TAG, this) } override fun onDetachedFromWindow() { super.onDetachedFromWindow() CallerAutoPilotStatusListenerManager.removeListener(TAG) + CallerPowerOffManager.removeListener(TAG) + CallerReceiveReceivedAckListenerManager.removeListener(TAG) } - override fun onAutopilotIpcConnectStatusChanged(status: AdasConstants.IpcConnectionStatus, reason: String?) { + override fun onAutopilotIpcConnectStatusChanged( + status: AdasConstants.IpcConnectionStatus, + reason: String? + ) { super.onAutopilotIpcConnectStatusChanged(status, reason) ThreadUtils.runOnUiThread { - setViewStatus(status == AdasConstants.IpcConnectionStatus.CONNECTED) + setViewStatus(status == AdasConstants.IpcConnectionStatus.CONNECTED) } } - private fun setViewStatus(connectInfo:Boolean) { - if (connectInfo) { - viewCheckShutDown.requestFocus() + private fun setViewStatus(connectInfo: Boolean) { + connectStatus = connectInfo + //下发一键停服命令后又和域控重新连接 + if((powerOffStatus == 6 || powerOffStatus == 7) && connectStatus){ + CallerDevaToolsManager.setPowerOffStatus(0) + viewCheckShutDown.setImageDrawable( + ContextCompat.getDrawable( + context, + R.drawable.icon_shut_down + ) + ) viewCheckShutDown.isClickable = true - viewCheckReboot.requestFocus() - viewCheckReboot.isClickable = true - } else { + } + } + + /** + * 一键停服调用SSM停服命令超时 + */ + override fun commandTimeout() { + //停止命令超时倒计时 + CallerDevaToolsManager.stopCommandWaitCountDown() + /** + * 如果点击一键停服按钮10秒后,是否正在执行命令的标签仍为true,代表域控未返回执行结果 + * 此时应该将按钮状态短暂置为失败,之后再置为常态,并将此标签置为false + */ + if (isExecutingPowerOff) { + //更改标签状态 + isExecutingPowerOff = false + CallerDevaToolsManager.setPowerOffStatus(4) + //将图标改为失败 + viewCheckShutDown.setImageDrawable( + ContextCompat.getDrawable( + context, + R.drawable.icon_shut_down_fail + ) + ) + //执行1秒倒计时命令 + CallerDevaToolsManager.statusChangeCountDown(false) + } + } + + /** + * 一键停服车辆下电等待倒计时 + */ + override fun powerDownTick(second: Int) { + tvCountDown.text = second.toString() + CallerDevaToolsManager.setPowerOffStatus(5) + } + + /** + * 一键停服车辆下电等待倒计时结束 + */ + override fun powerDownFinish() { + CallerDevaToolsManager.setPowerOffStatus(6) + //停止一键停服进度属性动画 + progressAnimator?.cancel() + //隐藏一键停服进度视图 + viewProgressBackground.visibility = View.GONE + viewProgress.visibility = View.GONE + tvCountDown.visibility = View.GONE + tvCountDownUnit.visibility = View.GONE + //一键停服命令倒计时结束,变为成功状态,并且发送1s倒计时 + viewCheckShutDown.setImageDrawable( + ContextCompat.getDrawable( + context, + R.drawable.icon_shut_down_success + ) + ) + isPowerOffCountDown = false + //执行1秒倒计时命令 + CallerDevaToolsManager.statusChangeCountDown(true) + } + + /** + * 一键停服状态按钮变更通知 + */ + override fun statusChange(isSuccess: Boolean) { + CallerDevaToolsManager.stopStatusCountDown() + if (isSuccess) { + //将倒计时内容隐藏 + viewProgressBackground.visibility = View.GONE + viewProgress.visibility = View.GONE + tvCountDown.visibility = View.GONE + tvCountDownUnit.visibility = View.GONE + //停服成功,将按钮置为不可点击状态 + viewCheckShutDown.setImageDrawable( + ContextCompat.getDrawable( + context, + R.drawable.icon_shut_down_complete + ) + ) viewCheckShutDown.isClickable = false - viewCheckReboot.isClickable = false + CallerDevaToolsManager.setPowerOffStatus(7) + } else { + //停服命令下发失败,将按钮置为常态,可点击 + viewCheckShutDown.setImageDrawable( + ContextCompat.getDrawable( + context, + R.drawable.icon_shut_down + ) + ) + viewCheckShutDown.isClickable = true + } + } + + /** + * 命令下发回执 + */ + override fun onReceiveReceivedAck(receivedAck: ReceivedAck) { + ThreadUtils.runOnUiThread { + if (receivedAck.messageType == MessageType.TYPE_SEND_SYSTEM_CMD_REQ && receivedAck.msgId == powerOffMsgId) { + isExecutingPowerOff = false + //停止命令超时倒计时 + CallerDevaToolsManager.stopCommandWaitCountDown() + if ( receivedAck.status == ReceivedAck.Status.NORMAL) { + //一键停服命令回执成功,则正常进入停服阶段中,1分钟倒计时,并且TTS和消息盒子提示 + CallerDevaToolsManager.setPowerOffStatus(2) + AIAssist.getInstance(context).speakTTSVoice("请等待1分钟再执行车辆下电") + saveMsgBox( + MsgBoxBean( + MsgBoxType.V2X, V2XMsg( + EventTypeEnumNew.TYPE_POWER_OFF_TIP.poiType, + EventTypeEnumNew.TYPE_POWER_OFF_TIP.content, + EventTypeEnumNew.TYPE_POWER_OFF_TIP.tts + ) + ) + ) + + viewCheckShutDown.setImageDrawable( + ContextCompat.getDrawable( + context, + R.drawable.icon_shut_down_background + ) + ) + viewProgressBackground.visibility = View.VISIBLE + viewProgress.visibility = View.VISIBLE + tvCountDown.visibility = View.VISIBLE + tvCountDownUnit.visibility = View.VISIBLE + //开始旋转动画 + if(progressAnimator == null){ + progressAnimator = ObjectAnimator.ofFloat(viewProgress,"rotation", 0f, 360f) + } + progressAnimator?.interpolator = LinearInterpolator() + progressAnimator?.repeatCount = ValueAnimator.INFINITE //无限循环 + progressAnimator?.duration = 6000 //设置持续时间 + progressAnimator?.startDelay = 0 + progressAnimator?.start() + //开始60S倒计时 + CallerDevaToolsManager.startPowerDownCountDown() + //一键停服倒计时中 + isPowerOffCountDown = true + } else { + //一键停服命令回执失败,则走失败流程 + CallerDevaToolsManager.setPowerOffStatus(3) + viewCheckShutDown.setImageDrawable( + ContextCompat.getDrawable( + context, + R.drawable.icon_shut_down_fail + ) + ) + //执行1秒倒计时命令 + CallerDevaToolsManager.statusChangeCountDown(false) + } + } + } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/check_shut_down.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/check_shut_down.png deleted file mode 100644 index 2e2017cb27..0000000000 Binary files a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/check_shut_down.png and /dev/null differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down.png new file mode 100644 index 0000000000..ffea12238b Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_background.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_background.png new file mode 100644 index 0000000000..b813f39700 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_background.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_complete.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_complete.png new file mode 100644 index 0000000000..20ae14d398 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_complete.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_fail.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_fail.png new file mode 100644 index 0000000000..6b778922cc Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_fail.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_progress.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_progress.png new file mode 100644 index 0000000000..fa9ca7fbcb Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_progress.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_progress_background.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_progress_background.png new file mode 100644 index 0000000000..b2d8f0af9b Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_progress_background.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_success.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_success.png new file mode 100644 index 0000000000..3389605387 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_shut_down_success.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_autopilot.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_autopilot.xml new file mode 100644 index 0000000000..8718a6c212 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_autopilot.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_ssm.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_ssm.xml new file mode 100644 index 0000000000..fb4d2d14fc --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_ssm.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_autopilot.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_autopilot.xml new file mode 100644 index 0000000000..9f0199eb80 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_autopilot.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_ssm.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_ssm.xml new file mode 100644 index 0000000000..5aa40ef9ba --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_ssm.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_check_system.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_check_system.xml index 75bb525735..e5a5d715a5 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_check_system.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_check_system.xml @@ -7,50 +7,96 @@ + android:contentDescription="@string/check_system_shut_down" /> + + + + + + + + + app:layout_constraintLeft_toLeftOf="@id/viewCheckShutDown" + app:layout_constraintRight_toRightOf="@id/viewCheckShutDown" + /> + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintLeft_toRightOf="@id/viewCheckShutDown" + android:contentDescription="@string/check_system_reboot" /> diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml index 226ea8081a..4af209bad3 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml @@ -28,7 +28,7 @@ 车速设置 账户信息 系统运行 - 关机 + 一键停服 重启系统 重启提示 是否重启自动驾驶系统? diff --git a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt index c2bd6f5d02..5132cd337a 100644 --- a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt +++ b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt @@ -21,8 +21,6 @@ import com.mogo.commons.storage.SharedPrefsMgr import com.mogo.commons.utils.MogoAnalyticUtils import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_CLOUD_INIT -import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_CLOUD_PASSPORT_AUTH_FAILED -import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_CLOUD_PASSPORT_AUTH_OK import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_CLOUD_PASSPORT_TOKEN import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_CLOUD_RECONNECT import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_HTTP_DNS_ERROR_REASON @@ -30,12 +28,12 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_SOURCE_ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_STATUS import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener +import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager +import com.mogo.eagle.core.function.call.cloud.CallerCloudCertManager import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager -import com.mogo.eagle.core.function.startup.stageone.secret.IPassportSecret -import com.mogo.eagle.core.function.startup.stageone.secret.PassPortSecret import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAIN import com.mogo.eagle.core.utilcode.util.AppUtils @@ -47,7 +45,7 @@ import com.rousetime.android_startup.AndroidStartup import com.zhjt.service.chain.ChainLog import kotlin.properties.Delegates -class HttpDnsStartUp : AndroidStartup() { +class HttpDnsStartUp : AndroidStartup(), IMoGoCloudListener { companion object { private const val TAG = "HttpDnsStartUp" @@ -108,6 +106,8 @@ class HttpDnsStartUp : AndroidStartup() { } private fun preparePassportEnvironment() { + //监听cert文件下载 + CallerCloudListenerManager.addListener(TAG,this) // 设置网络环境:HTTP_DNS_ENV_QA、HTTP_DNS_ENV_RELEASE、HTTP_DNS_ENV_DEV when (DebugConfig.getNetMode()) { DebugConfig.NET_MODE_DEV -> clientConfig.netMode = @@ -229,8 +229,8 @@ class HttpDnsStartUp : AndroidStartup() { if (!gotToken) { CallerLogger.d("$M_MAIN$TAG", "onTokenGot token : $token , sn :$sn") CallerCloudListenerManager.invokeCloudTokenGot(token, sn) - // 异步初始化NetConfig - asyncInit(sn) + // 开启cert download && 异步初始化NetConfig + asyncInit() startSocketService(sn) // 开启每5s/次定位上报 uploadLocPerFiveSecond() @@ -248,7 +248,11 @@ class HttpDnsStartUp : AndroidStartup() { /** * 异步初始化 */ - private fun asyncInit(sn: String) { + private fun asyncInit() { + // cert file下载 + CallerCloudCertManager.certFileDownLoad{ + logError(getPrReason("PassPortSecret-onFailed , $it")) + } ThreadPoolService.execute { // 初始化网络配置 NetConfigUtils.init() @@ -259,65 +263,13 @@ class HttpDnsStartUp : AndroidStartup() { mStartParams["app_flavor"] = DebugConfig.getProductFlavor() mStartParams["app_identity_mode"] = FunctionBuildConfig.appIdentityMode MogoAnalyticUtils.track("app_start_time", mStartParams) + } + } - if (FunctionBuildConfig.isSecure) { - context?.let { - val authStatus = - SharedPrefsMgr.getInstance() - .getBoolean("securityKeyStatus-${DebugConfig.getNetMode()}", false) - if (authStatus) { - // clientConfig设置auth值,并带入header - clientConfig.authPubKey = SharedPrefsMgr.getInstance() - .getString("securityKey-${DebugConfig.getNetMode()}", "") - return@let - } - // 安全校验 - try { - PassPortSecret.getInstance().init(sn, it.filesDir.path, object : - IPassportSecret { - - @ChainLog( - linkChainLog = CHAIN_TYPE_STATUS, - linkCode = CHAIN_SOURCE_CLOUD, - nodeAliasCode = CHAIN_CODE_CLOUD_PASSPORT_AUTH_OK, - paramIndexes = [0,1] - ) - override fun onSuccess(securityKey: String, rootKey: String) { - CallerLogger.d( - "$M_MAIN$TAG", - "onSuccess securityKey:$securityKey , thread:${Thread.currentThread().name}" - ) - clientConfig.securityKey = securityKey - SharedPrefsMgr.getInstance() - .putString( - "securityKey-${DebugConfig.getNetMode()}", - securityKey - ) - SharedPrefsMgr.getInstance() - .putBoolean("securityKeyStatus-${DebugConfig.getNetMode()}", true) - CallerCloudListenerManager.invokeCloudCrtFile(securityKey, rootKey) - } - - @ChainLog( - linkChainLog = CHAIN_TYPE_STATUS, - linkCode = CHAIN_SOURCE_CLOUD, - nodeAliasCode = CHAIN_CODE_CLOUD_PASSPORT_AUTH_FAILED, - paramIndexes = [0, 1] - ) - override fun onFailed(errorCode: Int, errorMsg: String) { - logError( - getPrReason( - "PassPortSecret-onFailed , errorCode:$errorCode,errorMsg:$errorMsg" - ) - ) - } - }) - } catch (e: Exception) { - e.printStackTrace() - } - } - } - + override fun authCrtFile(device: String, root: String) { + super.authCrtFile(device, root) + handler.post { + clientConfig.securityKey = device } } diff --git a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/secret/CertFileManager.kt b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/secret/CertFileManager.kt new file mode 100644 index 0000000000..37ea05c4a3 --- /dev/null +++ b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/secret/CertFileManager.kt @@ -0,0 +1,114 @@ +package com.mogo.eagle.core.function.startup.stageone.secret + +import android.content.Context +import com.alibaba.android.arouter.facade.annotation.Route +import com.mogo.commons.debug.DebugConfig +import com.mogo.commons.storage.SharedPrefsMgr +import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.data.constants.MogoServicePaths +import com.mogo.eagle.core.data.deva.chain.ChainConstant +import com.mogo.eagle.core.function.api.cloud.IMoGoCertProvider +import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant +import com.mogo.eagle.core.utilcode.util.ThreadPoolService +import com.zhjt.service.chain.ChainLog +import java.util.concurrent.atomic.AtomicBoolean + +@Route(path = MogoServicePaths.PATH_CERT_DOWN_LOAD_PROVIDER) +class CertFileManager : IMoGoCertProvider { + + private var context: Context? = null + private val securityKeyTAG = "securityKey-${DebugConfig.getNetMode()}" + private val securityRootTAG = "securityRoot-${DebugConfig.getNetMode()}" + private val securityKeyStatus = "securityKeyStatus-${DebugConfig.getNetMode()}" + private val certStatus = AtomicBoolean(false) + + @Volatile + private var deviceCrtFile: String? = null + + @Volatile + private var rootCrtFile: String? = null + + companion object { + private const val TAG = "CertFileManager" + } + + override fun init(context: Context?) { + this.context = context + } + + override fun certificateDownLoad(onError: ((String) -> Unit)?) { + if (FunctionBuildConfig.isSecure) { + context?.let { + val authStatus = SharedPrefsMgr.getInstance().getBoolean(securityKeyStatus, false) + if (authStatus) { + deviceCrtFile = SharedPrefsMgr.getInstance().getString(securityKeyTAG, "") + rootCrtFile = SharedPrefsMgr.getInstance().getString(securityRootTAG, "") + CallerCloudListenerManager.invokeCloudCrtFile(deviceCrtFile!!, rootCrtFile!!) + return@let + } + if (certStatus.get()) { + onError?.invoke("正在下载证书,请稍后再试") + return@let + } + // 安全校验 + try { + ThreadPoolService.execute { + PassPortSecret.getInstance() + .init(SharedPrefsMgr.getInstance().sn, it.filesDir.path, object : + IPassportSecret { + + @ChainLog( + linkChainLog = ChainConstant.CHAIN_TYPE_STATUS, + linkCode = ChainConstant.CHAIN_SOURCE_CLOUD, + nodeAliasCode = ChainConstant.CHAIN_CODE_CLOUD_PASSPORT_AUTH_OK, + paramIndexes = [0, 1] + ) + override fun onSuccess(securityKey: String, rootKey: String) { + CallerLogger.d( + "${SceneConstant.M_D_C}$TAG", + "onSuccess securityKey:$securityKey , thread:${Thread.currentThread().name}" + ) + certStatus.set(true) + deviceCrtFile = securityKey + rootCrtFile = rootKey + SharedPrefsMgr.getInstance().putString(securityKeyTAG, securityKey) + SharedPrefsMgr.getInstance().putString(securityRootTAG, rootKey) + SharedPrefsMgr.getInstance().putBoolean(securityKeyStatus, true) + CallerCloudListenerManager.invokeCloudCrtFile( + securityKey, + rootKey + ) + } + + @ChainLog( + linkChainLog = ChainConstant.CHAIN_TYPE_STATUS, + linkCode = ChainConstant.CHAIN_SOURCE_CLOUD, + nodeAliasCode = ChainConstant.CHAIN_CODE_CLOUD_PASSPORT_AUTH_FAILED, + paramIndexes = [0, 1] + ) + override fun onFailed(errorCode: Int, errorMsg: String) { + CallerLogger.d("${SceneConstant.M_D_C}$TAG", "onFailed code:$errorCode, msg:$errorMsg") + certStatus.set(true) + onError?.invoke("证书下载失败, code:$errorCode, msg:$errorMsg") + } + }) + } + } catch (e: Exception) { + e.printStackTrace() + } + } + } else { + onError?.invoke("当前环境id:${FunctionBuildConfig.urlJson.secureProductId} 不支持密钥下载") + } + } + + override fun getDeviceCrtF(): String? { + return deviceCrtFile?:SharedPrefsMgr.getInstance().getString(securityKeyTAG, "") + } + + override fun getRootCrtF(): String? { + return rootCrtFile?:SharedPrefsMgr.getInstance().getString(securityRootTAG, "") + } +} \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt index 77412a2db3..8adf15a6c3 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/FunctionBuildConfig.kt @@ -127,6 +127,14 @@ object FunctionBuildConfig { @JvmField var mediaUrlConfig = "" + /** + * 各车型宣传音频本地配置 + * 广告json + */ + @Volatile + @JvmField + var musicUrlConfig = "" + /** * 配置连接工控机的IP地址 diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java index 00f24f1610..b1460e7ea7 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/constants/MogoServicePaths.java @@ -97,6 +97,8 @@ public class MogoServicePaths { @Keep public static final String PATH_DATA_CENTER_MODULE = "/data_center/api"; + @Keep + public static final String PATH_CERT_DOWN_LOAD_PROVIDER = "/cert_file/api"; @Keep public static final String PATH_VISUAL_ANGLE = "/map/angle_change"; diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt index c029e44e6d..d8b7412870 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt @@ -590,6 +590,13 @@ enum class EventTypeEnumNew( "详情%s" ), + TYPE_POWER_OFF_TIP("POWER_OFF_TIP", + "一键停服", + "请等待1分钟再执行车辆下电", + R.drawable.icon_warning_take_over, + "请等待1分钟再执行车辆下电", + "请等待1分钟再执行车辆下电"), + TYPE_VIP_IDENTIFICATION_PASS("20022", "VIP通行", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行,已为您变为绿灯", "VIP车辆优先通行,已为您变为绿灯"), TYPE_VIP_IDENTIFICATION_EXTEND("20023", "VIP通行", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行,已为您延长绿灯", "VIP车辆优先通行,已为您延长绿灯"), TYPE_VIP_ERROR_IDENTIFICATION("20024", "VIP通行", "", R.drawable.icon_warning_v2x_vip_turn_light, "请求失败,", "请求失败,稍后重试"), @@ -947,6 +954,10 @@ enum class EventTypeEnumNew( TYPE_DEVICE_STATUS_ABNORMAL.poiType ->{ TYPE_DEVICE_STATUS_ABNORMAL.poiTypeStr } + //一键停服 + TYPE_POWER_OFF_TIP.poiType ->{ + TYPE_POWER_OFF_TIP.poiTypeStr + } //机动车 TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType ->{ TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiTypeStr @@ -1266,6 +1277,10 @@ enum class EventTypeEnumNew( TYPE_DEVICE_STATUS_ABNORMAL.poiType->{ R.drawable.icon_default } + //一键停服 + TYPE_POWER_OFF_TIP.poiType->{ + R.drawable.icon_warning_take_over + } //机动车 TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType -> { R.drawable.icon_warning_v2x_motorcycle_collision diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCertProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCertProvider.kt new file mode 100644 index 0000000000..fbd266d3df --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCertProvider.kt @@ -0,0 +1,11 @@ +package com.mogo.eagle.core.function.api.cloud + +import com.alibaba.android.arouter.facade.template.IProvider + +interface IMoGoCertProvider:IProvider { + fun certificateDownLoad(onError: ((String) -> Unit)? = null) + + fun getDeviceCrtF():String? + + fun getRootCrtF(): String? +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCloudListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCloudListener.kt index c57446b7a2..d82f858588 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCloudListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/cloud/IMoGoCloudListener.kt @@ -3,7 +3,7 @@ package com.mogo.eagle.core.function.api.cloud import com.mogo.eagle.core.data.v2x.V2XEvent interface IMoGoCloudListener{ - + //单独线程 fun authCrtFile(device:String, root:String){} fun tokenGot(token: String, sn: String){} diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/IDevaToolsProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/IDevaToolsProvider.kt index 16f2b6358d..d211d737bd 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/IDevaToolsProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/IDevaToolsProvider.kt @@ -128,6 +128,46 @@ interface IDevaToolsProvider : IProvider { */ fun showBadCaseManagerView(context: Context) + /** + * 启动调用SSM停服命令超时检测 + */ + fun startCommandWaitCountDown() + + /** + * 停止调用SSM停服命令超时检测 + */ + fun stopCommandWaitCountDown() + + /** + * 开始车辆下电等待倒计时 + */ + fun startPowerDownCountDown() + + /** + * 结束车辆下电等待倒计时 + */ + fun stopPowerDownCountDown() + + /** + * 状态按钮变更倒计时 + */ + fun statusChangeCountDown(isSuccess: Boolean) + + /** + * 结束状态按钮变更倒计时 + */ + fun stopStatusCountDown() + + /** + * 设置停服状态 + */ + fun setPowerOffStatus(status: Int) + + /** + * 获取停服状态 + */ + fun getPowerOffStatus(): Int + /** * 工控机异常上报列表 */ diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/IPowerOffListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/IPowerOffListener.kt new file mode 100644 index 0000000000..fe1a0fae2c --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/IPowerOffListener.kt @@ -0,0 +1,25 @@ +package com.mogo.eagle.core.function.api.devatools + +interface IPowerOffListener { + + /** + * 调用SSM停服命令超时 + */ + fun commandTimeout() + + /** + * 车辆下电等待倒计时 + */ + fun powerDownTick(second: Int) + + /** + * 车辆下电等待倒计时结束 + */ + fun powerDownFinish() + + /** + * 状态按钮变更通知 + */ + fun statusChange(isSuccess: Boolean) + +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/block/IMoGoBlockProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/block/IMoGoBlockProvider.kt index ebd2cfe599..2763a36cb5 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/block/IMoGoBlockProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/block/IMoGoBlockProvider.kt @@ -25,4 +25,6 @@ interface IMoGoBlockProvider { fun stop() fun recorder(): IMessageRecorder + + fun dump(extra: Map>? = null) } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt index 1b982b7bb5..a3197239f6 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt @@ -2,8 +2,13 @@ package com.mogo.eagle.core.function.call.autopilot import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo +import com.mogo.eagle.core.data.msgbox.AutopilotMsg +import com.mogo.eagle.core.data.msgbox.MsgBoxBean +import com.mogo.eagle.core.data.msgbox.MsgBoxType +import com.mogo.eagle.core.data.msgbox.SSMMsg import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.call.base.CallerBase +import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.function.call.trace.CallerTrace import com.mogo.eagle.core.utilcode.util.GsonUtils import com.zhjt.mogo.adas.data.AdasConstants @@ -212,6 +217,14 @@ object CallerAutoPilotStatusListenerManager : CallerBase { + CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.AUTOPILOT, AutopilotMsg(0, "连接异常", "域控未连接或主动断开连接", System.currentTimeMillis()))) + } + AdasConstants.IpcConnectionStatus.CONNECT_EXCEPTION -> { + CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.AUTOPILOT, AutopilotMsg(0, "连接异常", "域控连接异常:$reason", System.currentTimeMillis()))) + } + } } /** @@ -224,6 +237,11 @@ object CallerAutoPilotStatusListenerManager : CallerBase() { - /** - * 金旅M1 - */ fun invokeReceiveReceivedAck(receivedAck: ReceivedAck) { M_LISTENERS.forEach { val listener = it.value diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudCertManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudCertManager.kt new file mode 100644 index 0000000000..10b0c25e07 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudCertManager.kt @@ -0,0 +1,26 @@ +package com.mogo.eagle.core.function.call.cloud + +import com.mogo.eagle.core.data.constants.MogoServicePaths +import com.mogo.eagle.core.function.api.cloud.IMoGoCertProvider +import com.mogo.eagle.core.function.call.base.CallerBase + +object CallerCloudCertManager { + + private val certProviderApi: IMoGoCertProvider + get() = CallerBase.getApiInstance( + IMoGoCertProvider::class.java, + MogoServicePaths.PATH_CERT_DOWN_LOAD_PROVIDER + ) + + fun certFileDownLoad(onError: ((String) -> Unit)? = null) { + certProviderApi.certificateDownLoad(onError) + } + + fun getDeviceCrtF(): String? { + return certProviderApi.getDeviceCrtF() + } + + fun getRootCrtF(): String? { + return certProviderApi.getRootCrtF() + } +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudListenerManager.kt index 8dfd069548..2a38dfc1ce 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/cloud/CallerCloudListenerManager.kt @@ -12,12 +12,6 @@ object CallerCloudListenerManager : CallerBase() { @Volatile private var sn: String? = null - @Volatile - private var deviceCrtFile: String? = null - - @Volatile - private var rootCrtFile: String? = null - override fun doSomeAfterAddListener(tag: String, listener: IMoGoCloudListener) { super.doSomeAfterAddListener(tag, listener) if (!token.isNullOrEmpty() && !sn.isNullOrEmpty()) { @@ -25,17 +19,7 @@ object CallerCloudListenerManager : CallerBase() { } } - fun getRootCrtF(): String? { - return rootCrtFile - } - - fun getDeviceCrtF(): String? { - return deviceCrtFile - } - fun invokeCloudCrtFile(deviceCrtFile: String, rootCrtFile: String) { - this.deviceCrtFile = deviceCrtFile - this.rootCrtFile = rootCrtFile M_LISTENERS.forEach { val listener = it.value listener.authCrtFile(deviceCrtFile, rootCrtFile) diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerDevaToolsManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerDevaToolsManager.kt index c5522e6937..b8d30fed0c 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerDevaToolsManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerDevaToolsManager.kt @@ -170,6 +170,62 @@ object CallerDevaToolsManager { devaToolsProviderApi?.showBadCaseManagerView(context) } + /** + * 启动调用SSM停服命令超时检测 + */ + fun startCommandWaitCountDown(){ + devaToolsProviderApi?.startCommandWaitCountDown() + } + + /** + * 停止调用SSM停服命令超时检测 + */ + fun stopCommandWaitCountDown(){ + devaToolsProviderApi?.stopCommandWaitCountDown() + } + + /** + * 开始车辆下电等待倒计时 + */ + fun startPowerDownCountDown(){ + devaToolsProviderApi?.startPowerDownCountDown() + } + + /** + * 结束车辆下电等待倒计时 + */ + fun stopPowerDownCountDown(){ + devaToolsProviderApi?.stopPowerDownCountDown() + } + + /** + * 状态按钮变更倒计时 + */ + fun statusChangeCountDown(isSuccess: Boolean){ + devaToolsProviderApi?.statusChangeCountDown(isSuccess) + } + + /** + * 结束状态按钮变更倒计时 + */ + fun stopStatusCountDown(){ + devaToolsProviderApi?.stopStatusCountDown() + } + + /** + * 设置停服状态 + */ + fun setPowerOffStatus(status: Int){ + devaToolsProviderApi?.setPowerOffStatus(status) + } + + /** + * 获取停服状态 + */ + fun getPowerOffStatus(): Int? { + return devaToolsProviderApi?.getPowerOffStatus() + } + /** * 工控机异常上报列表 */ diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerPowerOffManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerPowerOffManager.kt new file mode 100644 index 0000000000..7551fcfe1b --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerPowerOffManager.kt @@ -0,0 +1,48 @@ +package com.mogo.eagle.core.function.call.devatools + +import com.mogo.eagle.core.function.api.devatools.IPowerOffListener +import com.mogo.eagle.core.function.call.base.CallerBase + +object CallerPowerOffManager : CallerBase() { + + /** + * 一键停服调用SSM停服命令超时 + */ + fun invokeCommandTimeout(){ + M_LISTENERS.forEach{ + val listener = it.value + listener.commandTimeout() + } + } + + /** + * 一键停服车辆下电等待倒计时 + */ + fun invokePowerDownTick(second: Int){ + M_LISTENERS.forEach{ + val listener = it.value + listener.powerDownTick(second) + } + } + + /** + * 一键停服车辆下电等待倒计时结束 + */ + fun invokePowerDownFinish(){ + M_LISTENERS.forEach{ + val listener = it.value + listener.powerDownFinish() + } + } + + /** + * 一键停服状态按钮变更通知 + */ + fun invokeStatusChange(isSuccess: Boolean){ + M_LISTENERS.forEach{ + val listener = it.value + listener.statusChange(isSuccess) + } + } + +} \ No newline at end of file diff --git a/core/mogo-core-res/src/main/res/values/dimens.xml b/core/mogo-core-res/src/main/res/values/dimens.xml index 1cd0ceedec..213bcd185e 100644 --- a/core/mogo-core-res/src/main/res/values/dimens.xml +++ b/core/mogo-core-res/src/main/res/values/dimens.xml @@ -8,6 +8,7 @@ -30dp -27dp -20dp + -17dp -12dp -10dp -8dp diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/download/DownloadUtils.kt b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/download/DownloadUtils.kt index b5a8e8f1a7..c4891e5acd 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/download/DownloadUtils.kt +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/download/DownloadUtils.kt @@ -56,4 +56,32 @@ object DownloadUtils { } .launchIn(scope) } + fun downLoadNoUi(ctx: Context?, url: String, savePath: String, fileName: String, listener: IDownloadListener?) { // FileBean fileBean = new FileBean(0, savePath, fileName, url, 0); + val context = ctx ?: Utils.getApp() ?: throw AssertionError("context must not be null.") + if (!Downloader.hasInit()) { + Downloader.init(context) + Downloader.setLoggable(BuildConfig.DEBUG) + } + Downloader.setNetStatePoller(poller) + Downloader.download(url, File(savePath, fileName)) + .onEach { + when(it) { + is DownloadStart -> + UiThreadHandler.post { listener?.onStart(url) } + is Downloading -> { + UiThreadHandler.post { listener?.onProgress(url, it.downloaded, it.total) } + } + is DownloadSuccess -> { + UiThreadHandler.post { listener?.onFinished(url, it.path)} + } + is DownloadFailed -> { + UiThreadHandler.post { listener?.onError(url, it.msg) } + } + } + } + .filter { + it.isComplete() + } + .launchIn(scope) + } } \ No newline at end of file diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/permissions/BackgrounderPermission.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/permissions/BackgrounderPermission.java index 58113394fd..1aaadd3995 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/permissions/BackgrounderPermission.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/mogo/permissions/BackgrounderPermission.java @@ -12,6 +12,8 @@ import android.util.Log; import androidx.annotation.RequiresApi; +import com.mogo.eagle.core.utilcode.util.ActivityUtils; + /** * 长时间后台运行权限检查 @@ -41,8 +43,7 @@ public class BackgrounderPermission { public void showPermissionLongBackgroundRunningDialog(Context context) { Intent intent = new Intent(context, PermissionLongBackgroundRunningDialog.class); - context.startActivity(intent); - + ActivityUtils.startActivity(intent); } void onBackgrounderPermission(boolean isBackgrounderPermission) { diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/ApkInstaller.kt b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/ApkInstaller.kt index 9f62ba5619..2590f8023f 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/ApkInstaller.kt +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/ApkInstaller.kt @@ -54,7 +54,7 @@ class ApkInstaller { val intent = Intent(context, InstallApkSessionApi::class.java) intent.putExtra("APK_FILE_PATH", apkFile.absolutePath) block?.also { InstallApkSessionApi.listener = it } - context.startActivity(intent) + ActivityUtils.startActivity(intent) } } @@ -161,7 +161,9 @@ class InstallApkSessionApi: AppCompatActivity() { Log.i(TAG, "--- InstallApkSessionApi -- confirm --") // This test app isn't privileged, so the user has to confirm the install. val confirmIntent = extras[Intent.EXTRA_INTENT] as? Intent - startActivity(confirmIntent) + confirmIntent?.also { + ActivityUtils.startActivity(it) + } finish() } STATUS_SUCCESS -> { diff --git a/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/data/bean/ReceivedAck.java b/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/data/bean/ReceivedAck.java index 65d5a3b263..100b438df3 100644 --- a/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/data/bean/ReceivedAck.java +++ b/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/data/bean/ReceivedAck.java @@ -125,19 +125,7 @@ public class ReceivedAck { this.receivedAck = receivedAck; } - /** - * 确认是否收到回执 - * - * @param msgId 下发的消息id - * @return 是否收到回执 - */ - public boolean isReceiptReceived(long msgId) { - Log.i("ReceivedAck", "消息=" + msgId + " 结果=" + toString()); - if (status == Status.NORMAL) { - return this.msgId == msgId; - } - return false; - } + @Override public String toString() { diff --git a/libraries/mogo-adas-data/src/main/proto/traffic_light.proto b/libraries/mogo-adas-data/src/main/proto/traffic_light.proto index 0a49cd52b1..f223586122 100644 --- a/libraries/mogo-adas-data/src/main/proto/traffic_light.proto +++ b/libraries/mogo-adas-data/src/main/proto/traffic_light.proto @@ -17,6 +17,7 @@ enum LightState { STATE_YELLOW = 2; STATE_GREEN = 3; STATE_FLASH = 4;//闪烁 + STATE_OFF_FUSION = 5; } message TrafficLight { @@ -24,6 +25,7 @@ message TrafficLight { optional LightType type = 2 [default = TYPE_DEFAULT];//灯所处的车道类型 optional LightState state = 3 [default = STATE_OFF];//灯态 optional float duration = 4; // seconds since the last state changed + optional LightState next_state = 5 [default = STATE_OFF_FUSION]; } //触发方式:120m以内会有信号,但远的时候可能不准,越近越准 @@ -35,4 +37,7 @@ message TrafficLights { optional TrafficLight left = 3;//左转灯 optional TrafficLight right = 4;//右转灯 optional TrafficLight u_turn = 5;//掉头灯 + + optional bool shield = 6 [default = false];//wheather the traffic lights are shield + optional uint32 source = 7 [default = 0]; // 0: vehicle, 1:V2I, 2: V2N } \ No newline at end of file