Loading src/java/com/android/internal/telephony/imsphone/ImsPhone.java +25 −1 Original line number Diff line number Diff line Loading @@ -1582,7 +1582,31 @@ public class ImsPhone extends ImsPhoneBase { new SilentRedialParam(mLastDialString, cause, dialArgs), null); if (ar != null) { // There is a race condition that can happen in some cases: // (Main thread) dial start // (Binder Thread) onCallSessionFailed // (Binder Thread) schedule a redial for CS on the main thread // (Main Thread) dial finish // (Main Thread) schedule to associate ImsPhoneConnection with // GsmConnection on the main thread // If scheduling the CS redial occurs before the command to schedule the // ImsPhoneConnection to be associated with the GsmConnection, the CS redial will occur // before GsmConnection has had callbacks to ImsPhone correctly updated. This will cause // Callbacks back to GsmCdmaPhone to never be set up correctly and we will lose track of // the instance. // Instead, schedule this redial to happen on the main thread, so that we know dial has // finished before scheduling a redial: // (Main thread) dial start // (Binder Thread) onCallSessionFailed -> move notify registrants to main thread // (Main Thread) dial finish // (Main Thread) schedule on main thread to associate ImsPhoneConnection with // GsmConnection // (Main Thread) schedule a redial for CS mContext.getMainExecutor().execute(() -> { logd("initiateSilentRedial: notifying registrants, isEmergency=" + isEmergency + ", eccCategory=" + eccCategory); mSilentRedialRegistrants.notifyRegistrants(ar); }); } } Loading Loading
src/java/com/android/internal/telephony/imsphone/ImsPhone.java +25 −1 Original line number Diff line number Diff line Loading @@ -1582,7 +1582,31 @@ public class ImsPhone extends ImsPhoneBase { new SilentRedialParam(mLastDialString, cause, dialArgs), null); if (ar != null) { // There is a race condition that can happen in some cases: // (Main thread) dial start // (Binder Thread) onCallSessionFailed // (Binder Thread) schedule a redial for CS on the main thread // (Main Thread) dial finish // (Main Thread) schedule to associate ImsPhoneConnection with // GsmConnection on the main thread // If scheduling the CS redial occurs before the command to schedule the // ImsPhoneConnection to be associated with the GsmConnection, the CS redial will occur // before GsmConnection has had callbacks to ImsPhone correctly updated. This will cause // Callbacks back to GsmCdmaPhone to never be set up correctly and we will lose track of // the instance. // Instead, schedule this redial to happen on the main thread, so that we know dial has // finished before scheduling a redial: // (Main thread) dial start // (Binder Thread) onCallSessionFailed -> move notify registrants to main thread // (Main Thread) dial finish // (Main Thread) schedule on main thread to associate ImsPhoneConnection with // GsmConnection // (Main Thread) schedule a redial for CS mContext.getMainExecutor().execute(() -> { logd("initiateSilentRedial: notifying registrants, isEmergency=" + isEmergency + ", eccCategory=" + eccCategory); mSilentRedialRegistrants.notifyRegistrants(ar); }); } } Loading