Merge branch 'fix/GHZS-2818' into 'dev'
fix: 【光环助手】神策埋点问题(1) https://jira.shanqu.cc/browse/GHZS-2818 See merge request halo/android/assistant-android!1167
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
package com.gh.ndownload
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import com.gh.gamecenter.core.runOnUiThread
|
||||
import com.lightgame.download.DownloadEntity
|
||||
import java.util.*
|
||||
@ -35,4 +36,20 @@ object NDataChanger : Observable() {
|
||||
}
|
||||
}
|
||||
|
||||
// 修改通知观察者的顺序为 添加观察者的顺序
|
||||
@SuppressLint("DiscouragedPrivateApi")
|
||||
override fun notifyObservers(arg: Any?) {
|
||||
var arrLocal: Array<Any?>
|
||||
|
||||
synchronized(this) {
|
||||
if (!hasChanged()) return
|
||||
|
||||
val obs = Observable::class.java.getDeclaredField("obs")
|
||||
obs.isAccessible = true
|
||||
arrLocal = (obs.get(this) as Vector<*>).toTypedArray()
|
||||
clearChanged()
|
||||
}
|
||||
|
||||
for (i in arrLocal.indices) (arrLocal[i] as Observer).update(this, arg)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user