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

Commit b79f845a authored by Libin.Tang@motorola.com's avatar Libin.Tang@motorola.com Committed by Pavel Zhamaitsiak
Browse files

Add an API to access the CDMAPhone/GSMPhone call tracker state for DCTracker to check

As concurrent voice/data is not supported for all RATs, the DCTracker checks
the default phone's call state through getState API as one of the conditions
to set up data call.
For device supports VOLTE, the default phone's getState reflects the
default phone(CDMAPhone/GSMPhone) and IMS phone call state.
So the data call can't set up if the VOLTE call is in progress.
As IMSPhone call state should not impact the data call setup, this CL is
to add an API to access the CDMAPhone/GSMPhone call tracker state for
DCTracker to check.

Bug: 19090488
Change-Id: I96bb29f80d81fa6b39e2e05f1d7f47a72244ed9b
parent 64eb9271
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -285,7 +285,7 @@ public abstract class CallTracker extends Handler {
    public abstract void unregisterForVoiceCallStarted(Handler h);
    public abstract void registerForVoiceCallEnded(Handler h, int what, Object obj);
    public abstract void unregisterForVoiceCallEnded(Handler h);

    public abstract PhoneConstants.State getState();
    protected abstract void log(String msg);

    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+4 −0
Original line number Diff line number Diff line
@@ -1205,4 +1205,8 @@ public final class CdmaCallTracker extends CallTracker {
        pw.println(" mState=" + mState);
        pw.println(" mIsEcmTimerCanceled=" + mIsEcmTimerCanceled);
    }
    @Override
    public PhoneConstants.State getState() {
        return mState;
    }
}
+7 −4
Original line number Diff line number Diff line
@@ -718,11 +718,14 @@ public final class DcTracker extends DcTrackerBase {
        }
        int dataSub = SubscriptionManager.getDefaultDataSubId();
        boolean defaultDataSelected = SubscriptionManager.isValidSubscriptionId(dataSub);

        PhoneConstants.State state = PhoneConstants.State.IDLE;
        if (mPhone.getCallTracker() != null) {
            state = mPhone.getCallTracker().getState();
        }
        boolean allowed =
                    (attachedState || mAutoAttachOnCreation) &&
                    recordsLoaded &&
                    (mPhone.getState() == PhoneConstants.State.IDLE ||
                    (state == PhoneConstants.State.IDLE ||
                     mPhone.getServiceStateTracker().isConcurrentVoiceAndDataAllowed()) &&
                    internalDataEnabled &&
                    defaultDataSelected &&
@@ -736,9 +739,9 @@ public final class DcTracker extends DcTrackerBase {
                reason += " - Attached= " + attachedState;
            }
            if (!recordsLoaded) reason += " - SIM not loaded";
            if (mPhone.getState() != PhoneConstants.State.IDLE &&
            if (state != PhoneConstants.State.IDLE &&
                    !mPhone.getServiceStateTracker().isConcurrentVoiceAndDataAllowed()) {
                reason += " - PhoneState= " + mPhone.getState();
                reason += " - PhoneState= " + state;
                reason += " - Concurrent voice and data not allowed";
            }
            if (!internalDataEnabled) reason += " - mInternalDataEnabled= false";
+4 −0
Original line number Diff line number Diff line
@@ -987,4 +987,8 @@ public final class GsmCallTracker extends CallTracker {
        pw.println(" mDesiredMute=" + mDesiredMute);
        pw.println(" mState=" + mState);
    }
    @Override
    public PhoneConstants.State getState() {
        return mState;
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -1431,4 +1431,8 @@ public final class ImsPhoneCallTracker extends CallTracker {
    public boolean isVtEnabled() {
        return mIsVtEnabled;
    }
    @Override
    public PhoneConstants.State getState() {
        return mState;
    }
}