This commit is contained in:
@ -15,9 +15,14 @@ import com.tencent.vasdolly.helper.ChannelReaderUtil
|
||||
|
||||
class FlavorProviderImp : IFlavorProvider {
|
||||
|
||||
private var isInit = false
|
||||
|
||||
private val pendingEvent = arrayListOf<String>()
|
||||
|
||||
override fun init(application: Application, activity: Activity, activateRatio: Int) {
|
||||
SMHelper.init(application, getChannelStr(application))
|
||||
|
||||
isInit = true
|
||||
if (HaloApp.getInstance().isBrandNewInstall) {
|
||||
logEvent("EVENT_ACTIVE")
|
||||
SPUtils.setLong("TIME_OF_BRAND_NEW_INSTALL", System.currentTimeMillis() / 1000)
|
||||
@ -31,6 +36,8 @@ class FlavorProviderImp : IFlavorProvider {
|
||||
SPUtils.setBoolean("SHOULD_SEND_RETENTION_EVENT", false)
|
||||
}
|
||||
}
|
||||
pendingEvent.forEach(SMHelper::onEvent)
|
||||
pendingEvent.clear()
|
||||
}
|
||||
|
||||
override fun getChannelStr(application: Application): String {
|
||||
@ -43,7 +50,11 @@ class FlavorProviderImp : IFlavorProvider {
|
||||
}
|
||||
|
||||
override fun logEvent(content: String) {
|
||||
SMHelper.onEvent(content)
|
||||
if (isInit) {
|
||||
SMHelper.onEvent(content)
|
||||
} else {
|
||||
pendingEvent.add(content)
|
||||
}
|
||||
}
|
||||
|
||||
override fun logCoreEvent() {
|
||||
|
||||
Reference in New Issue
Block a user