| | |
| | | private IAYExamListener mCallback; |
| | | //远程服务接口 |
| | | private IRemoteInterface remoteInterface; |
| | | private int BIND_SUCC = 0; |
| | | private int BIND_binderDied = -1; |
| | | |
| | | static SvrManager getInstance() { |
| | | return ourInstance; |
| | | } |
| | |
| | | @Override |
| | | public void binderDied() { |
| | | MyLog.e(TAG,"IBinder.DeathRecipient binderDied"); |
| | | if (mCallback != null){ |
| | | mCallback.bindStatus(BIND_binderDied); |
| | | } |
| | | if (remoteInterface == null){ |
| | | MyLog.e(TAG,"IBinder.DeathRecipient binderDied remoteInterface == null ,return"); |
| | | return; |
| | |
| | | //设置死亡代理 |
| | | service.linkToDeath(mDeathRecipient,0); |
| | | MyLog.i("绑定服务onServiceConnected"); |
| | | if(mCallback!=null){ |
| | | mCallback.bindStatus(BIND_SUCC); |
| | | } |
| | | remoteInterface.registListener(RemoteCallback); |
| | | } catch (RemoteException e) { |
| | | e.printStackTrace(); |