package com.gh.gamecenter.sensorsdata.provider

import android.app.Application
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.ISensorsProvider
import com.gh.gamecenter.sensorsdata.SensorsHelper
import org.json.JSONObject

@Route(path = RouteConsts.provider.sensors, name = "SensorsHelper暴露服务")
class SensorsProviderImpl : ISensorsProvider {
    override fun init(application: Application, channel: String) {
        SensorsHelper.init(application, channel)
    }

    override fun init(context: Context?) {
        // Do nothing
    }

    override fun login(loginId: String) {
        SensorsHelper.login(loginId)
    }

    override fun logout(loginId: String) {
        SensorsHelper.logout(loginId)
    }

    override fun setGid(gid: String) {
        SensorsHelper.setGid(gid)
    }

    override fun trackEvent(eventName: String, vararg kv: String) {
        SensorsHelper.trackEvent(eventName, *kv)
    }

    override fun trackEvent(eventName: String, jsonObject: JSONObject) {
        SensorsHelper.trackEvent(eventName, jsonObject)
    }

    override fun profileSet(key: String, value: String) {
        SensorsHelper.profileSet(key, value)
    }
}