package com.lanyun.wanglaotou.util

class VPNManager {
    private var mstartCallbacks : StartCallbacks? = null

    companion object {
        private var instance: VPNManager? = null
            get() {
                if (field == null) {
                    field = VPNManager()
                }
                return field
            }
        @Synchronized
        fun get(): VPNManager{
            return instance!!
        }
    }

    fun setStartCallbacks(startCallbacks : StartCallbacks){
        if (mstartCallbacks == null){
            mstartCallbacks = startCallbacks
        }
    }

    fun startVpn(){
        mstartCallbacks?.start()
    }
    fun stopVpn(){
        mstartCallbacks?.stop()
    }
    fun road(){
        mstartCallbacks?.road()
    }

    fun delteCallBascks(){
        if (mstartCallbacks != null){
            mstartCallbacks = null
        }
    }
}