# ActiveStatus

建议使用 WMPFDeviceApi.isDeviceActivated 接口.

判断设备是否激活,建议激活前调用该接口检查,避免重复激活耗时

# 调用参数

无参数

# 返回参数

属性 说明
isActive 设备是否激活

# 示例代码

val request = WMPFActiveStatusRequest().apply {
    this.baseRequest = WMPFBaseRequestHelper.checked()
}

val result =
    WMPFIPCInvoker.invokeAsync<IPCInvokerTask_ActiveStatus, WMPFActiveStatusRequest, WMPFActiveStatusResponse>(
        request,
        IPCInvokerTask_ActiveStatus::class.java,
        object : IPCInvokeCallbackEx<WMPFActiveStatusResponse> {
            override fun onBridgeNotFound() {
                it.onError(Exception("bridge not found"))
            }

            override fun onCallback(response: WMPFActiveStatusResponse) {
                if (isSuccess(response)) {
                    it.onSuccess(response)
                } else {
                    it.onError(TaskErrorException(createTaskError(response)))
                }
            }

            override fun onCaughtInvokeException(exception: java.lang.Exception?) {
                if (exception != null) {
                    it.onError(exception)
                } else {
                    it.onError(java.lang.Exception("null"))
                }
            }
        })

if (!result) {
    it.onError(Exception("invoke activeStatus fail"))
}