aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2021-01-16 00:10:19 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2021-01-16 00:10:19 +0000
commit216c2cbf20bd852ea4cd9d433c7c0cc6af1bd7cd (patch)
treec58723b991307b562761f1159992367bb494dd68
parent1f4ed41acdf7fa0fc78ed0d42d37461afa722078 (diff)
parent5970b0c1dbfe13bac7ad098b3fed4d095c26f672 (diff)
downloadims-android11-d2-release.tar.gz
Change-Id: I9274b5b814c96645cb0ca7d0628fd352bca4b7a2
-rw-r--r--src/java/com/android/ims/FeatureConnection.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/java/com/android/ims/FeatureConnection.java b/src/java/com/android/ims/FeatureConnection.java
index f6668b53..97736b95 100644
--- a/src/java/com/android/ims/FeatureConnection.java
+++ b/src/java/com/android/ims/FeatureConnection.java
@@ -34,6 +34,8 @@ import com.android.internal.telephony.util.HandlerExecutor;
import java.util.concurrent.Executor;
+import java.util.NoSuchElementException;
+
/**
* Base class of MmTelFeatureConnection and RcsFeatureConnection.
*/
@@ -102,7 +104,8 @@ public abstract class FeatureConnection {
mBinder.linkToDeath(mDeathRecipient, 0);
}
} catch (RemoteException e) {
- // No need to do anything if the binder is already dead.
+ Log.w(TAG, "setBinder: linkToDeath on already dead Binder, setting null");
+ mBinder = null;
}
}
}
@@ -127,8 +130,12 @@ public abstract class FeatureConnection {
if (mIsAvailable) {
mIsAvailable = false;
mRegistrationBinder = null;
- if (mBinder != null) {
- mBinder.unlinkToDeath(mDeathRecipient, 0);
+ try {
+ if (mBinder != null) {
+ mBinder.unlinkToDeath(mDeathRecipient, 0);
+ }
+ } catch (NoSuchElementException e) {
+ Log.w(TAG, "onRemovedOrDied: unlinkToDeath called on unlinked Binder.");
}
if (mStatusCallback != null) {
Log.d(TAG, "onRemovedOrDied: notifyUnavailable");