aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Ebinger <breadley@google.com>2016-11-15 11:32:43 -0800
committerBrad Ebinger <breadley@google.com>2016-11-15 13:16:23 -0800
commit75f96a40e73bbf262287b64f7ba79f058adac472 (patch)
tree1767235b8903192857a7b3be6522ec56d2cd9f1f
parent40b0e247a4a79e83f10b6410025ef1d7cc537692 (diff)
downloadtelephony-75f96a40e73bbf262287b64f7ba79f058adac472.tar.gz
Only get WiFi status based on RAT extras
We used to set the WiFi Connection property based on the the provisioning status of the phone until the RAT extra was set from the modem. This is an obsolete method of determining whether or not to set the WiFi property and was causing some calls to be improperly marked as WiFi. Test: Manual Testing Bug: 30964593 Change-Id: I9922ff17ffb704a09e9b2cebeb147a7463b9898b
-rw-r--r--src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java6
-rw-r--r--src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java42
-rw-r--r--tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneConnectionTest.java4
3 files changed, 1 insertions, 51 deletions
diff --git a/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java b/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java
index c5378d1bee..14a44d7a14 100644
--- a/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java
+++ b/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java
@@ -2170,16 +2170,10 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
mPhone.notifyForVideoCapabilityChanged(isVideoCallEnabled());
}
- // TODO: Use the ImsCallSession or ImsCallProfile to tell the initial Wifi state and
- // {@link ImsCallSession.Listener#callSessionHandover} to listen for changes to
- // wifi capability caused by a handover.
if (DBG) log("onFeatureCapabilityChanged: isVolteEnabled=" + isVolteEnabled()
+ ", isVideoCallEnabled=" + isVideoCallEnabled()
+ ", isVowifiEnabled=" + isVowifiEnabled()
+ ", isUtEnabled=" + isUtEnabled());
- for (ImsPhoneConnection connection : mConnections) {
- connection.updateWifiState();
- }
mPhone.onFeatureCapabilityChanged();
diff --git a/src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java b/src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java
index 96ac8773d9..9ed6fea53d 100644
--- a/src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java
+++ b/src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java
@@ -100,16 +100,6 @@ public class ImsPhoneConnection extends Connection implements
*/
private boolean mShouldIgnoreVideoStateChanges = false;
- /**
- * Used to indicate whether the wifi state is based on
- * {@link com.android.ims.ImsConnectionStateListener#
- * onFeatureCapabilityChanged(int, int[], int[])} callbacks, or values received via the
- * {@link ImsCallProfile#EXTRA_CALL_RAT_TYPE} extra. Util we receive a value via the extras,
- * we will use the wifi state based on the {@code onFeatureCapabilityChanged}. Once a value
- * is received via the extras, we will prefer those values going forward.
- */
- private boolean mIsWifiStateFromExtras = false;
-
//***** Event Constants
private static final int EVENT_DTMF_DONE = 1;
private static final int EVENT_PAUSE_DONE = 2;
@@ -179,8 +169,6 @@ public class ImsPhoneConnection extends Connection implements
mCreateTime = System.currentTimeMillis();
mUusInfo = null;
- updateWifiState();
-
// Ensure any extras set on the ImsCallProfile at the start of the call are cached locally
// in the ImsPhoneConnection. This isn't going to inform any listeners (since the original
// connection is not likely to be associated with a TelephonyConnection yet).
@@ -674,13 +662,11 @@ public class ImsPhoneConnection extends Connection implements
}
boolean updateParent = mParent.update(this, imsCall, state);
- boolean updateWifiState = updateWifiState();
boolean updateAddressDisplay = updateAddressDisplay(imsCall);
boolean updateMediaCapabilities = updateMediaCapabilities(imsCall);
boolean updateExtras = updateExtras(imsCall);
- return updateParent || updateWifiState || updateAddressDisplay || updateMediaCapabilities
- || updateExtras;
+ return updateParent || updateAddressDisplay || updateMediaCapabilities || updateExtras;
}
@Override
@@ -879,28 +865,6 @@ public class ImsPhoneConnection extends Connection implements
}
/**
- * Check for a change in the wifi state of the ImsPhoneCallTracker and update the
- * {@link ImsPhoneConnection} with this information.
- *
- * @return Whether the ImsPhoneCallTracker's usage of wifi has been changed.
- */
- public boolean updateWifiState() {
- // If we've received the wifi state via the ImsCallProfile.EXTRA_CALL_RAT_TYPE extra, we
- // will no longer use state updates which are based on the onFeatureCapabilityChanged
- // callback.
- if (mIsWifiStateFromExtras) {
- return false;
- }
-
- Rlog.d(LOG_TAG, "updateWifiState: " + mOwner.isVowifiEnabled());
- if (isWifi() != mOwner.isVowifiEnabled()) {
- setWifi(mOwner.isVowifiEnabled());
- return true;
- }
- return false;
- }
-
- /**
* Updates the wifi state based on the {@link ImsCallProfile#EXTRA_CALL_RAT_TYPE}.
* The call is considered to be a WIFI call if the extra value is
* {@link ServiceState#RIL_RADIO_TECHNOLOGY_IWLAN}.
@@ -911,10 +875,6 @@ public class ImsPhoneConnection extends Connection implements
if (extras.containsKey(ImsCallProfile.EXTRA_CALL_RAT_TYPE) ||
extras.containsKey(ImsCallProfile.EXTRA_CALL_RAT_TYPE_ALT)) {
- // We've received the extra indicating the radio technology, so we will continue to
- // prefer the radio technology received via this extra going forward.
- mIsWifiStateFromExtras = true;
-
ImsCall call = getImsCall();
boolean isWifi = false;
if (call != null) {
diff --git a/tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneConnectionTest.java b/tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneConnectionTest.java
index e6990fd5f6..197c94c2dc 100644
--- a/tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneConnectionTest.java
+++ b/tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneConnectionTest.java
@@ -248,8 +248,6 @@ public class ImsPhoneConnectionTest extends TelephonyTest {
ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN + "");
assertTrue(mConnectionUT.update(mImsCall, Call.State.ACTIVE));
assertTrue(mConnectionUT.isWifi());
- //keep using the wifi state from extra, not update
- assertFalse(mConnectionUT.updateWifiState());
}
@Test
@@ -265,7 +263,5 @@ public class ImsPhoneConnectionTest extends TelephonyTest {
ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN + "");
assertTrue(mConnectionUT.update(mImsCall, Call.State.ACTIVE));
assertTrue(mConnectionUT.isWifi());
- //keep using the wifi state from extra, not update
- assertFalse(mConnectionUT.updateWifiState());
}
}