[3.2.0][Fix]解决首次安装Tts不播报的问题
原因: 先分发数据且没缓存,而后才去监听,没有收到sn相关的事件
This commit is contained in:
@@ -6,10 +6,25 @@ import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
object CallerCloudListenerManager : CallerBase<IMoGoCloudListener>() {
|
||||
|
||||
@Volatile
|
||||
private var token: String? = null
|
||||
|
||||
@Volatile
|
||||
private var sn: String? = null
|
||||
|
||||
override fun doSomeAfterAddListener(tag: String, listener: IMoGoCloudListener) {
|
||||
super.doSomeAfterAddListener(tag, listener)
|
||||
if (!token.isNullOrEmpty() && !sn.isNullOrEmpty()) {
|
||||
listener.tokenGot(token!!, sn!!)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分发获取到的设备sn
|
||||
*/
|
||||
fun invokeCloudTokenGot(token: String, sn: String) {
|
||||
this.token = token
|
||||
this.sn = sn
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.tokenGot(token, sn)
|
||||
|
||||
Reference in New Issue
Block a user