| | |
| | | |
| | | @Override |
| | | public void SendCmd(int cmd, String value) throws RemoteException { |
| | | |
| | | MainProcMsgEntry(cmd, value); |
| | | } |
| | | }; |
| | | @Nullable |
| | |
| | | Log.i(TAG,"onCreate()"); |
| | | speaker = new Speaker(getApplicationContext()); |
| | | |
| | | // startNative(); |
| | | new Thread(new Worker()).start(); |
| | | } |
| | | |
| | | private class Worker implements Runnable{ |
| | | |
| | | @Override |
| | | public void run() { |
| | | while (!mIsServiceDestroyed.get()){ |
| | | try { |
| | | Thread.sleep(1000); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | onMessageArrived(msgId, String.format("消息ID:%d,请注意查收",msgId++)); |
| | | } |
| | | |
| | | } |
| | | startNative(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | } |
| | | mListenerList.finishBroadcast(); |
| | | } |
| | | |
| | | public void SendMsgToMainProc(int cmd, String value) { |
| | | Log.d(TAG, "SendMsgToMainProc cmd = " + String.format("%04X", cmd) + " json = " + value); |
| | | if (!mIsServiceDestroyed.get()){ |
| | | onMessageArrived(cmd, value); |
| | | } |
| | | } |
| | | |
| | | public String javaGetImei() { |
| | |
| | | } |
| | | |
| | | public native void startNative(); |
| | | public native void MainProcMsgEntry(int cmd, String value); |
| | | } |