diff options
Diffstat (limited to 'InCallUI/src/com/android/incallui/CallCardPresenter.java')
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardPresenter.java | 51 |
1 files changed, 5 insertions, 46 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index 762d8688e..3a4c46a60 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -23,7 +23,6 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.graphics.drawable.Drawable; import android.net.Uri; -import android.net.wifi.WifiManager; import android.os.Bundle; import android.telecom.Call.Details; import android.telecom.DisconnectCause; @@ -68,7 +67,6 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> private CallTimer mCallTimer; private Context mContext; - private WifiManager mWifiManager; public static class ContactLookupCallback implements ContactInfoCacheCallback { private final WeakReference<CallCardPresenter> mCallCardPresenter; @@ -109,7 +107,6 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> public void init(Context context, Call call) { mContext = Preconditions.checkNotNull(context); - mWifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE); // Call may be null if disconnect happened already. if (call != null) { @@ -246,7 +243,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> new DisconnectCause(DisconnectCause.UNKNOWN), null, null, - null); + null, + false /* isWifi */); getUi().showHdAudioIndicator(false); } @@ -293,7 +291,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> mPrimary.getDisconnectCause(), getConnectionLabel(), getCallStateIcon(), - getGatewayNumber()); + getGatewayNumber(), + primaryCallCan(Details.CAPABILITY_WIFI)); boolean showHdAudioIndicator = isPrimaryCallActive() && primaryCallCan(Details.CAPABILITY_HIGH_DEF_AUDIO); @@ -599,13 +598,6 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> return statusHints.getLabel().toString(); } - // Assume the SSID of the connection reported by the WifiManager is the name of the wifi - // network used for calling, since currently a phone only connects to a single wifi network. - if (isPrimaryCallActive() && primaryCallCan(Details.CAPABILITY_WIFI) - && mWifiManager.getConnectionInfo() != null) { - return formatWifiSSID(mWifiManager.getConnectionInfo().getSSID()); - } - if (hasOutgoingGatewayCall() && getUi() != null) { // Return the label for the gateway app on outgoing calls. final PackageManager pm = mContext.getPackageManager(); @@ -631,11 +623,6 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> } } - if (primaryCallCan(Details.CAPABILITY_WIFI) && (isPrimaryCallActive() - || (mPrimary != null && mPrimary.getState() == Call.State.INCOMING))) { - return mContext.getResources().getDrawable(R.drawable.ic_signal_wifi_4_bar_18dp); - } - return null; } @@ -741,34 +728,6 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> return photo; } - /** - * Strip quotations off the outside of a Wifi SSID identifier. For example, \"GoogleGuest\" - * becomes GoogleGuest. - * - * TODO: Move into utility class. - * TODO: Add unit tests. - * - * @param ssid The ssid of the wifi network. - */ - private String formatWifiSSID(String ssid) { - if (TextUtils.isEmpty(ssid)) { - return ""; - } - - // Trim quotation if first character. - if (ssid.charAt(0) == '\"') { - ssid = ssid.substring(1); - } - - // Trim quotation if last character. - int lastIndex = ssid.length() - 1; - if (lastIndex >= 0 && ssid.charAt(lastIndex) == '\"') { - ssid = ssid.substring(0, lastIndex); - } - - return ssid; - } - public interface CallCardUi extends Ui { void setVisible(boolean on); void setCallCardVisible(boolean visible); @@ -778,7 +737,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> String providerLabel, boolean isConference); void setCallState(int state, int videoState, int sessionModificationState, DisconnectCause disconnectCause, String connectionLabel, - Drawable connectionIcon, String gatewayNumber); + Drawable connectionIcon, String gatewayNumber, boolean isWifi); void setPrimaryCallElapsedTime(boolean show, long duration); void setPrimaryName(String name, boolean nameIsNumber); void setPrimaryImage(Drawable image); |