修改进程间接口,统一为foo(int, string)
| | |
| | | } |
| | | |
| | | @Override |
| | | public void callBackMsg(String json) { |
| | | public void callBackMsg(int cmd, String json) { |
| | | MyLog.d(TAG, "收到==" + json); |
| | | CEventCenter.dispatchEvent("train",0,0,json); |
| | | } |
| | |
| | | * Demonstrates some basic types that you can use as parameters |
| | | * and return values in AIDL. |
| | | */ |
| | | void onMessageArrived(String json); |
| | | void onMessageArrived(int cmd, String json); |
| | | } |
| | |
| | | void registListener(IListenerInterface i); |
| | | void unRegistListener(IListenerInterface i); |
| | | void add(); |
| | | void SendCmd(int cmd, String value); |
| | | } |
| | |
| | | static Polygon theTurn90Map; |
| | | static Polygon theSSMap; |
| | | |
| | | #define CAR_COORD_STORE_SIZE 11 |
| | | #define CAR_COORD_STORE_SIZE 10 |
| | | |
| | | struct car_coord_ { |
| | | uint32_t uptime; |
| | |
| | | * All Rights Saved! Chongqing AnYun Tech co. LTD |
| | | */ |
| | | public interface IAYExamListener { |
| | | void callBackMsg(String json); |
| | | void callBackMsg(int cmd, String json); |
| | | } |
| | |
| | | Log.i(TAG,"客户端调用服务端方法"); |
| | | } |
| | | |
| | | @Override |
| | | public void SendCmd(int cmd, String value) throws RemoteException { |
| | | |
| | | } |
| | | }; |
| | | @Nullable |
| | | @Override |
| | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | onMessageArrived(String.format("消息ID:%d,请注意查收",msgId++)); |
| | | onMessageArrived(msgId, String.format("消息ID:%d,请注意查收",msgId++)); |
| | | } |
| | | |
| | | } |
| | |
| | | mIsServiceDestroyed.set(true); |
| | | } |
| | | |
| | | private void onMessageArrived(String json){ |
| | | private void onMessageArrived(int cmd, String json){ |
| | | int N = mListenerList.getRegisteredCallbackCount(); |
| | | |
| | | Log.d(TAG, "getRegisteredCallbackCount = " + N); |
| | | mListenerList.beginBroadcast(); |
| | | |
| | | for (int i = 0; i < N; i++) { |
| | | |
| | | mListener = mListenerList.getBroadcastItem(i); |
| | | if (mListener != null){ |
| | | try { |
| | | mListener.onMessageArrived(json); |
| | | mListener.onMessageArrived(cmd, json); |
| | | } catch (RemoteException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | */ |
| | | IListenerInterface RemoteCallback = new IListenerInterface.Stub(){ |
| | | @Override |
| | | public void onMessageArrived(String json) throws RemoteException { |
| | | public void onMessageArrived(int cmd, String json) throws RemoteException { |
| | | |
| | | if (mCallback != null){ |
| | | mCallback.callBackMsg(json); |
| | | mCallback.callBackMsg(cmd, json); |
| | | } |
| | | } |
| | | |