From d2fda4ab69205fc672c02141f9b62c1958f73ace Mon Sep 17 00:00:00 2001 From: Nancy Chen Date: Tue, 20 Oct 2015 17:12:01 -0700 Subject: 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 --- InCallUI/src/com/android/incallui/CallCardPresenter.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'InCallUI/src/com/android/incallui/CallCardPresenter.java') 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 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 mInCallContactInteractions.setBusinessInfo( mPrimaryContactInfo.locationAddress, - mDistanceHelper.calculateDistance(mPrimaryContactInfo.locationAddress)); + mDistanceHelper.calculateDistance(mPrimaryContactInfo.locationAddress), + mPrimaryContactInfo.openingHours); getUi().setContactContextContent(mInCallContactInteractions.getListAdapter()); getUi().showContactContext(mPrimary.getState() != State.INCOMING); } -- cgit v1.2.3