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

Unverified Commit 1fba670c authored by ExactExampl's avatar ExactExampl Committed by LuK1337
Browse files

Conditionally revert "Block Binder thread until incoming call process completes"



* Legacy IMS packages handling incoming calls in such a way that
  a blocked binder thread won`t allow to complete call setup,
  thus we have half dead incoming calls with unattached call session
  (caller can hear dialing tone whereas recipient got nothing)

This conditionally reverts commit 75c3dc9b.

[lostark13: Forward port to Android 14]

Co-Authored-By: default avatarLostark13 <tushar9915@gmail.com>
Change-Id: I55a8f3bbca4a2b9a6bc7511e9fe2d0884a8818e5
parent 6454a2a0
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ import android.os.Registrant;
import android.os.RegistrantList;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.sysprop.TelephonyProperties;
@@ -389,7 +390,17 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        @Nullable
        public IImsCallSessionListener onIncomingCall(
                @NonNull IImsCallSession c, @Nullable String callId, @Nullable Bundle extras) {
            final boolean shouldBlockBinderThreadOnIncomingCalls = SystemProperties.getBoolean(
                    "ro.telephony.block_binder_thread_on_incoming_calls", true);
            if (shouldBlockBinderThreadOnIncomingCalls) {
                return executeAndWaitForReturn(()-> processIncomingCall(c, callId, extras));
            } else {
                // for legacy IMS we want to avoid blocking the binder thread, otherwise
                // we end up with half dead incoming calls with unattached call session
                TelephonyUtils.runWithCleanCallingIdentity(()-> processIncomingCall(
                        c, callId, extras), mExecutor);
                return null;
            }
        }

        @Override