From b2c9c057bb1254d34bd5ef96109651becc33e0d9 Mon Sep 17 00:00:00 2001 From: lizhanwei <Dana_Lee1016@126.com> Date: 星期二, 07 七月 2020 13:06:21 +0800 Subject: [PATCH] 修改死亡监听,当远程接口为空时返回,不会空则重新绑定service --- lib/src/main/java/com/anyun/exam/lib/SvrManager.java | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/src/main/java/com/anyun/exam/lib/SvrManager.java b/lib/src/main/java/com/anyun/exam/lib/SvrManager.java index 25b8c6b..042fe64 100644 --- a/lib/src/main/java/com/anyun/exam/lib/SvrManager.java +++ b/lib/src/main/java/com/anyun/exam/lib/SvrManager.java @@ -7,7 +7,6 @@ import android.os.IBinder; import android.os.RemoteException; import android.text.TextUtils; -import android.util.Log; import java.util.LinkedList; @@ -50,8 +49,8 @@ @Override public void binderDied() { MyLog.e(TAG,"IBinder.DeathRecipient binderDied"); - if (remoteInterface != null){ - MyLog.e(TAG,"IBinder.DeathRecipient binderDied remoteInterface != null ,return"); + if (remoteInterface == null){ + MyLog.e(TAG,"IBinder.DeathRecipient binderDied remoteInterface == null ,return"); return; } remoteInterface.asBinder().unlinkToDeath(mDeathRecipient,0); @@ -98,7 +97,7 @@ try { //璁剧疆姝讳骸浠g悊 service.linkToDeath(mDeathRecipient,0); - + MyLog.i("缁戝畾鏈嶅姟onServiceConnected"); remoteInterface.registListener(RemoteCallback); } catch (RemoteException e) { e.printStackTrace(); @@ -107,7 +106,7 @@ @Override public void onServiceDisconnected(ComponentName name) { - + MyLog.i("缁戝畾鏈嶅姟澶辫触onServiceDisconnected"); } -- Gitblit v1.8.0