diff options
author | Andrew Lee <anwlee@google.com> | 2015-03-10 15:51:34 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-03-10 16:53:59 -0700 |
commit | bec041f1aa6654ff1071194bdb04ef6429109e4f (patch) | |
tree | e5f2f2fb13ae1dab23d9cb29bb4c9ee6f48a675c | |
parent | 8cdac35f2aa80d1732dfc5fdaee1a21035a1bfcb (diff) |
Indicate wifi for incoming calls.
This is done in the call card by showing the wifi icon.
This is done in the notification, by change the subtext.
For international calls in particular, this helps users understand
how accepting a phone call will affect the cost of their call.
Change-Id: Ifebd9f9cc8598b7fe5b693673b27a485f7ecdf0f
-rw-r--r-- | InCallUI/res/values/strings.xml | 11 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardPresenter.java | 3 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/StatusBarNotifier.java | 16 |
3 files changed, 21 insertions, 9 deletions
diff --git a/InCallUI/res/values/strings.xml b/InCallUI/res/values/strings.xml index e8cc64c10..45851f950 100644 --- a/InCallUI/res/values/strings.xml +++ b/InCallUI/res/values/strings.xml @@ -141,13 +141,18 @@ <!-- Missed call notification message used for a single missed call, including the caller-id info from the missed call --> <string name="notification_missedCallTicker">Missed call from <xliff:g id="missed_call_from">%s</xliff:g></string> - <!-- The "label" of the in-call Notification for an ongoing call, used - as the format string for a Chronometer widget. [CHAR LIMIT=60] --> + <!-- The "label" of the in-call Notification for an ongoing call. [CHAR LIMIT=60] --> <string name="notification_ongoing_call">Ongoing call</string> + <!-- The "label" of the in-call Notification for an ongoing call, which is being made over + wi-fi. [CHAR LIMIT=60] --> + <string name="notification_ongoing_call_wifi">Ongoing wi-fi call</string> <!-- The "label" of the in-call Notification for a call that's on hold --> <string name="notification_on_hold">On hold</string> - <!-- The "label" of the in-call Notification for an incoming ringing call --> + <!-- The "label" of the in-call Notification for an incoming ringing call. [CHAR LIMIT=60] --> <string name="notification_incoming_call">Incoming call</string> + <!-- The "label" of the in-call Notification for an incoming ringing call, + which is being made over wi-fi. [CHAR LIMIT=60] --> + <string name="notification_incoming_call_wifi">Incoming wi-fi call</string> <!-- The "label" of the in-call Notification for an incoming ringing video call. --> <string name="notification_incoming_video_call">Incoming video call</string> <!-- The "label" of the in-call Notification for upgrading an existing call to a video call. --> diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index 47e4328b7..3944bf62f 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -632,7 +632,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> } } - if (isPrimaryCallActive() && primaryCallCan(Details.CAPABILITY_WIFI)) { + 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); } diff --git a/InCallUI/src/com/android/incallui/StatusBarNotifier.java b/InCallUI/src/com/android/incallui/StatusBarNotifier.java index 99392d9fd..4a0216061 100644 --- a/InCallUI/src/com/android/incallui/StatusBarNotifier.java +++ b/InCallUI/src/com/android/incallui/StatusBarNotifier.java @@ -30,6 +30,7 @@ import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.os.Handler; import android.os.Message; +import android.telecom.Call.Details; import android.telecom.PhoneAccount; import android.text.BidiFormatter; import android.text.TextDirectionHeuristics; @@ -388,8 +389,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener { * Returns the main string to use in the notification. */ private String getContentTitle(ContactCacheEntry contactInfo, Call call) { - if (call.isConferenceCall() - && !call.can(android.telecom.Call.Details.CAPABILITY_GENERIC_CONFERENCE)) { + if (call.isConferenceCall() && !call.can(Details.CAPABILITY_GENERIC_CONFERENCE)) { return mContext.getResources().getString(R.string.card_title_conf_call); } if (TextUtils.isEmpty(contactInfo.name)) { @@ -416,8 +416,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener { */ private Bitmap getLargeIconToDisplay(ContactCacheEntry contactInfo, Call call) { Bitmap largeIcon = null; - if (call.isConferenceCall() - && !call.can(android.telecom.Call.Details.CAPABILITY_GENERIC_CONFERENCE)) { + if (call.isConferenceCall() && !call.can(Details.CAPABILITY_GENERIC_CONFERENCE)) { largeIcon = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.img_conference); } @@ -461,9 +460,16 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener { */ private int getContentString(Call call) { int resId = R.string.notification_ongoing_call; + if (call.can(Details.CAPABILITY_WIFI)) { + resId = R.string.notification_ongoing_call_wifi; + } if (call.getState() == Call.State.INCOMING || call.getState() == Call.State.CALL_WAITING) { - resId = R.string.notification_incoming_call; + if (call.can(Details.CAPABILITY_WIFI)) { + resId = R.string.notification_incoming_call_wifi; + } else { + resId = R.string.notification_incoming_call; + } } else if (call.getState() == Call.State.ONHOLD) { resId = R.string.notification_on_hold; } else if (Call.State.isDialing(call.getState())) { |