diff options
author | Brad Ebinger <breadley@google.com> | 2019-02-14 00:20:11 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-02-14 00:20:11 +0000 |
commit | 0a0131e731b27bba4d026f86c8a16ca745fde2e4 (patch) | |
tree | ee8c8872bf46c03c20e327c4740f9d7c2b891307 | |
parent | d83bf77b806ca8dc246d8ffa64f5fc985202b594 (diff) | |
parent | 9c8d0832c6991564ea302942c108e03f818dee9f (diff) | |
download | ims-0a0131e731b27bba4d026f86c8a16ca745fde2e4.tar.gz |
Merge "Move MmTelFeatureConnection DeathRecipient to the Main Thread"
-rw-r--r-- | src/java/com/android/ims/MmTelFeatureConnection.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/java/com/android/ims/MmTelFeatureConnection.java b/src/java/com/android/ims/MmTelFeatureConnection.java index ea7aad06..12f55ef6 100644 --- a/src/java/com/android/ims/MmTelFeatureConnection.java +++ b/src/java/com/android/ims/MmTelFeatureConnection.java @@ -431,8 +431,15 @@ public class MmTelFeatureConnection { private IImsRegistration mRegistrationBinder; private IImsConfig mConfigBinder; - private IBinder.DeathRecipient mDeathRecipient = () -> { + private final IBinder.DeathRecipient mDeathRecipient = () -> { Log.w(TAG, "DeathRecipient triggered, binder died."); + if (mContext != null && Looper.getMainLooper() != null) { + // Move this signal to the main thread, notifying ImsManager of the Binder + // death on another thread may lead to deadlocks. + mContext.getMainExecutor().execute(this::onRemovedOrDied); + return; + } + // No choice - execute on the current Binder thread. onRemovedOrDied(); }; |