Add WFC StatusHints for Conferences.

Bug: 20160799
Change-Id: Ica8b91364a3ad2402e2afc959d8ce258ce4b0cd7
diff --git a/src/com/android/services/telephony/ImsConference.java b/src/com/android/services/telephony/ImsConference.java
index 02a569f..e7a02ec 100644
--- a/src/com/android/services/telephony/ImsConference.java
+++ b/src/com/android/services/telephony/ImsConference.java
@@ -16,22 +16,26 @@
 
 package com.android.services.telephony;
 
+import android.content.ComponentName;
+import android.content.Context;
 import android.net.Uri;
+import android.telecom.Conference.Listener;
 import android.telecom.Conference;
 import android.telecom.ConferenceParticipant;
+import android.telecom.Connection.VideoProvider;
 import android.telecom.Connection;
 import android.telecom.DisconnectCause;
 import android.telecom.Log;
 import android.telecom.PhoneAccountHandle;
+import android.telecom.StatusHints;
 import android.telecom.VideoProfile;
-import android.telecom.Conference.Listener;
-import android.telecom.Connection.VideoProvider;
 
 import com.android.internal.telephony.Call;
 import com.android.internal.telephony.CallStateException;
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.imsphone.ImsPhoneConnection;
 import com.android.phone.PhoneUtils;
+import com.android.phone.R;
 
 import java.util.ArrayList;
 import java.util.HashSet;
@@ -171,6 +175,12 @@
             int capabilites = ImsConference.this.getConnectionCapabilities();
             setConnectionCapabilities(applyVideoCapabilities(capabilites, connectionCapabilities));
         }
+
+        @Override
+        public void onStatusHintsChanged(Connection c, StatusHints statusHints) {
+            Log.v(this, "onStatusHintsChanged");
+            updateStatusHints();
+        }
     };
 
     /**
@@ -464,6 +474,7 @@
         mConferenceHost.addConnectionListener(mConferenceHostListener);
         mConferenceHost.addTelephonyConnectionListener(mTelephonyConnectionListener);
         setState(mConferenceHost.getState());
+        updateStatusHints();
     }
 
     /**
@@ -625,6 +636,8 @@
             setDisconnected(new DisconnectCause(DisconnectCause.OTHER));
             destroy();
         }
+
+        updateStatusHints();
     }
 
     /**
@@ -662,6 +675,27 @@
         }
     }
 
+    private void updateStatusHints() {
+        if (mConferenceHost == null) {
+            setStatusHints(null);
+            return;
+        }
+
+        if (mConferenceHost.isWifi()) {
+            Phone phone = mConferenceHost.getPhone();
+            if (phone != null) {
+                Context context = phone.getContext();
+                setStatusHints(new StatusHints(
+                        new ComponentName(context, TelephonyConnectionService.class),
+                        context.getString(R.string.status_hint_label_wifi_call),
+                        R.drawable.ic_signal_wifi_4_bar_24dp,
+                        null /* extras */));
+            }
+        } else {
+            setStatusHints(null);
+        }
+    }
+
     /**
      * Builds a string representation of the {@link ImsConference}.
      *
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index de5720c..d72192d 100644
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -867,6 +867,13 @@
     }
 
     /**
+     * Whether the call is using wifi.
+     */
+    boolean isWifi() {
+        return mIsWifi;
+    }
+
+    /**
      * Sets the current call audio quality. Used during rebuild of the capabilities
      * to set or unset the {@link Connection#CAPABILITY_HIGH_DEF_AUDIO} capability.
      *