summaryrefslogtreecommitdiff
path: root/InCallUI/src/com/android/incallui/CallCardPresenter.java
diff options
context:
space:
mode:
authorNancy Chen <nancychen@google.com>2015-10-20 17:12:01 -0700
committerNancy Chen <nancychen@google.com>2015-10-21 18:03:37 -0700
commitd2fda4ab69205fc672c02141f9b62c1958f73ace (patch)
treeff3cdd32f5bb937cb04f69fa12f146594ea04d31 /InCallUI/src/com/android/incallui/CallCardPresenter.java
parent3867a0ac286d0c9cc457b81e9db5d36019e786e4 (diff)
Add hours of operation info to incall business context.
Display hours of operation information if it is available. If hours of operation are available, also determine whether it is currently open or closed. Display in the InCallUI when making a business call. Also add tests to make sure that the business context object is constructed correctly. Bug: 23351559 Change-Id: Ic2846e54e15ade37ccf0b916651cc3388da3cc23
Diffstat (limited to 'InCallUI/src/com/android/incallui/CallCardPresenter.java')
-rw-r--r--InCallUI/src/com/android/incallui/CallCardPresenter.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java
index aa022f448..e7d6f0c3e 100644
--- a/InCallUI/src/com/android/incallui/CallCardPresenter.java
+++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java
@@ -595,8 +595,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
private void updateContactInteractions() {
if (mPrimary != null && mPrimaryContactInfo != null
- && mPrimaryContactInfo.locationAddress != null) {
-
+ && (mPrimaryContactInfo.locationAddress != null
+ || mPrimaryContactInfo.openingHours != null)) {
// TODO: This is hardcoded to "isBusiness" because functionality to differentiate
// between business and personal has not yet been added.
if (setInCallContactInteractionsType(true /* isBusiness */)) {
@@ -606,7 +606,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
mInCallContactInteractions.setBusinessInfo(
mPrimaryContactInfo.locationAddress,
- mDistanceHelper.calculateDistance(mPrimaryContactInfo.locationAddress));
+ mDistanceHelper.calculateDistance(mPrimaryContactInfo.locationAddress),
+ mPrimaryContactInfo.openingHours);
getUi().setContactContextContent(mInCallContactInteractions.getListAdapter());
getUi().showContactContext(mPrimary.getState() != State.INCOMING);
}