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

Commit d2c4a554 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Notify video capability to listeners in certain new scenarios"

parents 80797594 d903d58a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -209,6 +209,10 @@ public abstract class PhoneBase extends Handler implements Phone {
    int mCallRingDelay;
    public boolean mIsTheCurrentActivePhone = true;
    boolean mIsVoiceCapable = true;

    // Variable to cache the video capabilitity. In some cases, we lose this info and are unable
    // to recover from the state. So, we cache it and notify listeners when they register.
    private boolean mIsVideoCapable = false;
    protected UiccController mUiccController = null;
    public AtomicReference<IccRecords> mIccRecords = new AtomicReference<IccRecords>();
    public SmsStorageMonitor mSmsStorageMonitor;
@@ -754,6 +758,9 @@ public abstract class PhoneBase extends Handler implements Phone {
        checkCorrectThread(h);

        mVideoCapabilityChangedRegistrants.addUnique(h, what, obj);

        // Notify any registrants of the cached video capability as soon as they register.
        notifyForVideoCapabilityChanged(mIsVideoCapable);
    }

    // Inherited documentation suffices.
@@ -1763,6 +1770,9 @@ public abstract class PhoneBase extends Handler implements Phone {
     * Notify registrants if phone is video capable.
     */
    public void notifyForVideoCapabilityChanged(boolean isVideoCallCapable) {
        // Cache the current video capability so that we don't lose the information.
        mIsVideoCapable = isVideoCallCapable;

        AsyncResult ar = new AsyncResult(null, isVideoCallCapable, null);
        mVideoCapabilityChangedRegistrants.notifyRegistrants(ar);
    }
+10 −0
Original line number Diff line number Diff line
@@ -127,6 +127,10 @@ public class ImsPhone extends ImsPhoneBase {

    private final RegistrantList mSilentRedialRegistrants = new RegistrantList();

    // Variable to cache the video capabilitity. In cases where we delete/re-create the phone
    // this information is getting lost.
    private boolean mIsVideoCapable = false;

    // A runnable which is used to automatically exit from Ecm after a period of time.
    private Runnable mExitEcmRunnable = new Runnable() {
        @Override
@@ -176,6 +180,11 @@ public class ImsPhone extends ImsPhoneBase {
        // synchronization is managed at the PhoneBase scope (which calls this function)
        mDefaultPhone = parentPhone;
        mPhoneId = mDefaultPhone.getPhoneId();

        // When the parent phone is updated, we need to notify listeners of the cached video
        // capability.
        Rlog.d(LOG_TAG, "updateParentPhone - Notify video capability changed " + mIsVideoCapable);
        notifyForVideoCapabilityChanged(mIsVideoCapable);
    }

    @Override
@@ -469,6 +478,7 @@ public class ImsPhone extends ImsPhoneBase {
    }

    public void notifyForVideoCapabilityChanged(boolean isVideoCapable) {
        mIsVideoCapable = isVideoCapable;
        mDefaultPhone.notifyForVideoCapabilityChanged(isVideoCapable);
    }