Search in sources :

Example 6 with Client

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

the class GTBinder method getGlobalOutPara.

@Override
public String getGlobalOutPara(String key) throws RemoteException {
    Client client = ClientManager.getInstance().getClient(ClientManager.GLOBAL_CLIENT);
    OutPara para = client.getOutPara(key);
    if (para != null) {
        return para.getValue();
    }
    return "";
}
Also used : Client(com.tencent.wstt.gt.manager.Client)

Example 7 with Client

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

the class GTBinder method registerOutPara.

@Override
public void registerOutPara(OutPara para) throws RemoteException {
    Client client = ClientManager.getInstance().getClient(getCallingUid());
    client.register(para);
}
Also used : Client(com.tencent.wstt.gt.manager.Client)

Example 8 with Client

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

the class GTBinder method getOutPara.

@Override
public String getOutPara(String key) throws RemoteException {
    Client client = ClientManager.getInstance().getClient(getCallingUid());
    OutPara para = client.getOutPara(key);
    if (para != null) {
        return para.getValue();
    }
    return "";
}
Also used : Client(com.tencent.wstt.gt.manager.Client)

Example 9 with Client

use of com.tencent.wstt.gt.manager.Client 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)

Example 10 with Client

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

the class GTMemoryDaemonThread method validSingleLimit.

private void validSingleLimit(int curSize, TagTimeEntry tte) {
    if (curSize >= singleLimit && OpUIManager.gw_running) {
        // 停止单项的采集
        Client client = ClientManager.getInstance().getClient(tte.getExkey());
        OutPara op = client.getOutPara(tte.getName());
        if (// 如果已停止采集,则不需要告警
        null != op && op.isMonitor()) {
            op.setMonitor(false);
            // 发消息提示用户,通知
            Message msg = Message.obtain(handler, DaemonHandler.MEM_SINGLE_WARNING_FLAG);
            msg.obj = op;
            handler.sendMessage(msg);
        }
    }
}
Also used : Message(android.os.Message) OutPara(com.tencent.wstt.gt.OutPara) Client(com.tencent.wstt.gt.manager.Client)

Aggregations

Client (com.tencent.wstt.gt.manager.Client)20 OutPara (com.tencent.wstt.gt.OutPara)4 RemoteException (android.os.RemoteException)3 CommonString (com.tencent.wstt.gt.utils.CommonString)2 ArrayList (java.util.ArrayList)2 Context (android.content.Context)1 Message (android.os.Message)1 CpuUtils (com.tencent.wstt.gt.api.utils.CpuUtils)1 NetUtils (com.tencent.wstt.gt.api.utils.NetUtils)1 ClientFactory (com.tencent.wstt.gt.manager.ClientFactory)1 ConnectedClientFactory (com.tencent.wstt.gt.manager.ConnectedClientFactory)1 TagTimeEntry (com.tencent.wstt.gt.ui.model.TagTimeEntry)1 TimeEntry (com.tencent.wstt.gt.ui.model.TimeEntry)1