package com.dafay.demo.aidl.proxy

import com.dafay.demo.aidl.inter.ReceiveListener


object TestServiceProxy : BaseServiceConnect() {

    fun bindService() {
        bindToService()
    }

    fun add(value: Int) {
        if (!isServiceConnected()) {
            return
        }
        return remoteServiceProxy!!.add(value, null)
    }

    fun send(msg: String): Int {
        if (!isServiceConnected()) {
            return -1
        }
        return remoteServiceProxy!!.send(msg)
    }

    fun registerReceiverListener(listener: ReceiveListener?) {
        if (!receiveListeners.contains(listener)) {
            receiveListeners.add(listener)
        }
    }
}
