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

Commit 68d7118d authored by Tyler Gunn's avatar Tyler Gunn Committed by android-build-merger
Browse files

Remove one time sending of handover from wifi to LTE connection event.

am: 2d996aa6

Change-Id: I7ddab85cc9d84b5c1978340913ca0023060278c3
parents bee3496b 2d996aa6
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -82,13 +82,6 @@ public class TelephonyTester {
    private static final String ACTION_TEST_HANDOVER_FAIL =
            "com.android.internal.telephony.TestHandoverFail";

    /**
     * Test-only intent used to reset the shared preference associated with
     * {@link android.telephony.CarrierConfigManager#KEY_NOTIFY_VT_HANDOVER_TO_WIFI_FAILURE_BOOL}.
     */
    private static final String ACTION_RESET_HANDOVER_NOTICE =
            "com.android.internal.telephony.ResetHandoverNotice";

    private static List<ImsExternalCallState> mImsExternalCallStates = null;

    private Phone mPhone;
@@ -115,10 +108,6 @@ public class TelephonyTester {
            } else if (action.equals(ACTION_TEST_HANDOVER_FAIL)) {
                log("handle handover fail test intent");
                handleHandoverFailedIntent();
            } else if (action.equals(ACTION_RESET_HANDOVER_NOTICE)) {
                SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
                sp.edit().putBoolean(ImsPhoneCallTracker.NOTIFIED_HANDOVER_TO_LTE_KEY, false)
                        .commit();
            } else {
                if (DBG) log("onReceive: unknown action=" + action);
            }
@@ -142,7 +131,6 @@ public class TelephonyTester {
                filter.addAction(ACTION_TEST_CONFERENCE_EVENT_PACKAGE);
                filter.addAction(ACTION_TEST_DIALOG_EVENT_PACKAGE);
                filter.addAction(ACTION_TEST_HANDOVER_FAIL);
                filter.addAction(ACTION_RESET_HANDOVER_NOTICE);
                mImsExternalCallStates = new ArrayList<ImsExternalCallState>();
            }

+6 −33
Original line number Diff line number Diff line
@@ -1892,21 +1892,14 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                    srcAccessTech == ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN &&
                            targetAccessTech != ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN;
            if (mNotifyHandoverVideoFromWifiToLTE && isHandoverFromWifi && imsCall.isVideoCall()) {
                if (!hasNotifiedHandoverVideoFromWifiToLTE() ) {
                log("onCallHandover :: notifying of WIFI to LTE handover.");
                ImsPhoneConnection conn = findConnection(imsCall);
                if (conn != null) {
                    conn.onConnectionEvent(
                                TelephonyManager.EVENT_HANDOVER_VIDEO_FROM_WIFI_TO_LTE,
                                null);
                        setNotifiedHandoverVideoFromWifiToLTE(true);
                            TelephonyManager.EVENT_HANDOVER_VIDEO_FROM_WIFI_TO_LTE, null);
                } else {
                    loge("onCallHandover :: failed to notify of handover; connection is null.");
                }

                } else {
                    log("onCallHandover :: already notified of WIFI to LTE handover.");
                }
            }

            mEventLog.writeOnImsCallHandover(imsCall.getCallSession(),
@@ -2751,24 +2744,4 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
    public boolean isCarrierDowngradeOfVtCallSupported() {
        return mSupportDowngradeVtToAudio;
    }

    /**
     * @return {@code true} if the user has been previously notified of a video call which has been
     *      handed over from WIFI to LTE, {@code false} otherwise.
     */
    private boolean hasNotifiedHandoverVideoFromWifiToLTE() {
        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mPhone.getContext());
        return sp.getBoolean(NOTIFIED_HANDOVER_TO_LTE_KEY, false);
    }

    /**
     * Sets whether the user has been notified of the fact a video call has been handed over from
     * WIFI to LTE.  Saved to shared preferences.
     *
     * @param notified {@code true} if the user has been notified, {@code false} otherwise.
     */
    private void setNotifiedHandoverVideoFromWifiToLTE(boolean notified) {
        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mPhone.getContext());
        sp.edit().putBoolean(NOTIFIED_HANDOVER_TO_LTE_KEY, notified).commit();
    }
}