Search in sources :

Example 1 with ConnectedClientFactory

use of com.tencent.wstt.gt.manager.ConnectedClientFactory in project GT by Tencent.

the class ClientConnectGT method initConnectGT.

/**
 * 这个接口暴露到service中,由客户端连接时调用
 * @param pkgName 连接来的客户端的包名
 * @param uid 连接来的客户端的UID,以UID作为连接来客户端的数字key
 * @param pid 连接来的客户端的进程ID,支持多应用后本参数不再需要
 */
public static void initConnectGT(String pkgName, int intKey, int pid) {
    if (!GTApp.getGTRunStatus()) {
        Context gtContext = GTApp.getContext();
        openGTService(gtContext);
    }
    Client client = ClientManager.getInstance().getClient(pkgName);
    if (null == client) {
        ClientFactory cf = new ConnectedClientFactory();
        /*
			 * TODO 批量注册的事情是否挪到这里呢,需要考虑老版本兼容性
			 * 如果挪到这里来,在GTBinder里的register方法就不需要考虑初始化的特殊情况了
			 * 结论:对客户端修改量太大,先按原方式处理
			 */
        client = cf.orderClient(pkgName, intKey, null, null);
    }
}
Also used : Context(android.content.Context) ConnectedClientFactory(com.tencent.wstt.gt.manager.ConnectedClientFactory) ClientFactory(com.tencent.wstt.gt.manager.ClientFactory) ConnectedClientFactory(com.tencent.wstt.gt.manager.ConnectedClientFactory) Client(com.tencent.wstt.gt.manager.Client)

Aggregations

Context (android.content.Context)1 Client (com.tencent.wstt.gt.manager.Client)1 ClientFactory (com.tencent.wstt.gt.manager.ClientFactory)1 ConnectedClientFactory (com.tencent.wstt.gt.manager.ConnectedClientFactory)1