lizhanwei
2020-07-25 6060b1e0c4a3cd4396eabc25634aaff45959e360
lib/src/main/java/com/anyun/exam/lib/SvrManager.java
@@ -28,6 +28,9 @@
    private IAYExamListener mCallback;
    //远程服务接口
    private IRemoteInterface remoteInterface;
    private int BIND_SUCC = 0;
    private int BIND_binderDied = -1;
    static SvrManager getInstance() {
        return ourInstance;
    }
@@ -49,6 +52,9 @@
        @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;
@@ -98,6 +104,9 @@
                //设置死亡代理
                service.linkToDeath(mDeathRecipient,0);
                MyLog.i("绑定服务onServiceConnected");
                if(mCallback!=null){
                    mCallback.bindStatus(BIND_SUCC);
                }
                remoteInterface.registListener(RemoteCallback);
            } catch (RemoteException e) {
                e.printStackTrace();