Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ba5a072 authored by Pranav Madapurmath's avatar Pranav Madapurmath Committed by mse1969
Browse files

Catch IllegalArgumentException when unbinding CallRedirectionServiceConnection

Wrap the `mContext.unbindService` call in a try-catch block to handle `IllegalArgumentException`. This can occur if the service connection isn't registered when the timeout occurs, preventing a crash.

Bug: 438408401
Flag: EXEMPT bug fix
Test: m Telecom
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:615a452b1eb9a1165b6892b715ca9acb39c9fc48)
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:f8423dc9f2f04530b2c3c9fba111a6a826ecd7ac
Merged-In: I9494b1bf209579125b30fb859ad62cd58b5dffd7
Change-Id: I9494b1bf209579125b30fb859ad62cd58b5dffd7
parent 15a8415f
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -136,8 +136,12 @@ public class CallRedirectionProcessor implements CallRedirectionCallback {
            Log.i(this, "notifyTimeout: call redirection has timed out so "
                    + "unbinding the connection");
            if (mConnection != null) {
                try {
                    // We still need to call unbind even if the service disconnected.
                    mContext.unbindService(mConnection);
                } catch (IllegalArgumentException e) {
                    Log.e(this, e, "Error unbinding the connection");
                }
                mConnection = null;
            }
            mService = null;