diff options
author | Andrew Lee <anwlee@google.com> | 2015-03-11 15:49:28 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-03-11 15:49:28 +0000 |
commit | 9dac1a70b4e201c03b0c207aa4c5e88fd37e340b (patch) | |
tree | 8e94107f30a6efaabbff8dac3f395e606aa3b024 | |
parent | 49f2952d06c38b013513f5f9a252b3ac6c546f08 (diff) | |
parent | bec041f1aa6654ff1071194bdb04ef6429109e4f (diff) |
Indicate wifi for incoming calls.
automerge: 6c5be77
* commit '6c5be778579619d055f6d12f381a63568bd8270d':
Indicate wifi for incoming calls.
-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())) { |