diff options
14 files changed, 30 insertions, 10 deletions
diff --git a/InCallUI/res/drawable-hdpi/business_unknown.png b/InCallUI/res/drawable-hdpi/business_unknown.png Binary files differnew file mode 100644 index 000000000..b369939ec --- /dev/null +++ b/InCallUI/res/drawable-hdpi/business_unknown.png diff --git a/InCallUI/res/drawable-hdpi/picture_unknown.png b/InCallUI/res/drawable-hdpi/picture_unknown.png Binary files differindex ba46da151..26d2be16f 100644 --- a/InCallUI/res/drawable-hdpi/picture_unknown.png +++ b/InCallUI/res/drawable-hdpi/picture_unknown.png diff --git a/InCallUI/res/drawable-mdpi/business_unknown.png b/InCallUI/res/drawable-mdpi/business_unknown.png Binary files differnew file mode 100644 index 000000000..eac97a9b7 --- /dev/null +++ b/InCallUI/res/drawable-mdpi/business_unknown.png diff --git a/InCallUI/res/drawable-mdpi/picture_unknown.png b/InCallUI/res/drawable-mdpi/picture_unknown.png Binary files differindex 995df75b3..1ee333caa 100644 --- a/InCallUI/res/drawable-mdpi/picture_unknown.png +++ b/InCallUI/res/drawable-mdpi/picture_unknown.png diff --git a/InCallUI/res/drawable-xhdpi/business_unknown.png b/InCallUI/res/drawable-xhdpi/business_unknown.png Binary files differnew file mode 100644 index 000000000..aa84456e4 --- /dev/null +++ b/InCallUI/res/drawable-xhdpi/business_unknown.png diff --git a/InCallUI/res/drawable-xhdpi/picture_unknown.png b/InCallUI/res/drawable-xhdpi/picture_unknown.png Binary files differindex b4bd3666a..db74fd962 100644 --- a/InCallUI/res/drawable-xhdpi/picture_unknown.png +++ b/InCallUI/res/drawable-xhdpi/picture_unknown.png diff --git a/InCallUI/res/drawable-xxhdpi/business_unknown.png b/InCallUI/res/drawable-xxhdpi/business_unknown.png Binary files differnew file mode 100644 index 000000000..6273bb324 --- /dev/null +++ b/InCallUI/res/drawable-xxhdpi/business_unknown.png diff --git a/InCallUI/res/drawable-xxhdpi/picture_unknown.png b/InCallUI/res/drawable-xxhdpi/picture_unknown.png Binary files differindex 41275930d..38bec2cff 100644 --- a/InCallUI/res/drawable-xxhdpi/picture_unknown.png +++ b/InCallUI/res/drawable-xxhdpi/picture_unknown.png diff --git a/InCallUI/res/values/colors.xml b/InCallUI/res/values/colors.xml index 9d149a472..53d8f527f 100644 --- a/InCallUI/res/values/colors.xml +++ b/InCallUI/res/values/colors.xml @@ -42,5 +42,5 @@ <drawable name="end_call_pressed_state">#ff4e4e</drawable> <!-- Used when the End Call button is disabled --> - <drawable name="end_call_disabled_state">#00000000</drawable> + <drawable name="end_call_disabled_state">#303030</drawable> </resources> diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java index 209869458..b0fdda18c 100644 --- a/InCallUI/src/com/android/incallui/CallButtonFragment.java +++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java @@ -189,12 +189,23 @@ public class CallButtonFragment } @Override - public void setVisible(boolean on) { - if (on) { - getView().setVisibility(View.VISIBLE); - } else { - getView().setVisibility(View.INVISIBLE); + public void setEnabled(boolean isEnabled) { + View view = getView(); + if (view.getVisibility() != View.VISIBLE) { + view.setVisibility(View.VISIBLE); } + + // The main end-call button spanning across the screen. + mEndCallButton.setEnabled(isEnabled); + + // The smaller buttons laid out horizontally just below the end-call button. + mMuteButton.setEnabled(isEnabled); + mAudioButton.setEnabled(isEnabled); + mHoldButton.setEnabled(isEnabled); + mShowDialpadButton.setEnabled(isEnabled); + mMergeButton.setEnabled(isEnabled); + mAddCallButton.setEnabled(isEnabled); + mSwapButton.setEnabled(isEnabled); } @Override diff --git a/InCallUI/src/com/android/incallui/CallButtonPresenter.java b/InCallUI/src/com/android/incallui/CallButtonPresenter.java index 6840a156d..36426302f 100644 --- a/InCallUI/src/com/android/incallui/CallButtonPresenter.java +++ b/InCallUI/src/com/android/incallui/CallButtonPresenter.java @@ -221,14 +221,14 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto return; } - final boolean isVisible = state.isConnectingOrConnected() && + final boolean isEnabled = state.isConnectingOrConnected() && !state.isIncoming() && call != null; - ui.setVisible(isVisible); + ui.setEnabled(isEnabled); Log.d(this, "Updating call UI for call: ", call); - if (isVisible) { + if (isEnabled) { Log.v(this, "Show hold ", call.can(Capabilities.SUPPORT_HOLD)); Log.v(this, "Enable hold", call.can(Capabilities.HOLD)); Log.v(this, "Show merge ", call.can(Capabilities.MERGE_CALLS)); @@ -335,7 +335,7 @@ public class CallButtonPresenter extends Presenter<CallButtonPresenter.CallButto } public interface CallButtonUi extends Ui { - void setVisible(boolean on); + void setEnabled(boolean on); void setMute(boolean on); void enableMute(boolean enabled); void setHold(boolean on); diff --git a/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java b/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java index d0f62d78b..1ba88cbd7 100644 --- a/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java +++ b/InCallUI/src/com/android/incallui/ConferenceManagerPresenter.java @@ -64,6 +64,8 @@ public class ConferenceManagerPresenter Log.v(this, "Number of existing calls is " + String.valueOf(call.getChildCallIds().size())); update(callList); + } else { + getUi().setVisible(false); } } else { getUi().setVisible(false); diff --git a/InCallUI/src/com/android/incallui/ContactInfoCache.java b/InCallUI/src/com/android/incallui/ContactInfoCache.java index 13f8dd00d..4b482cb4c 100644 --- a/InCallUI/src/com/android/incallui/ContactInfoCache.java +++ b/InCallUI/src/com/android/incallui/ContactInfoCache.java @@ -234,6 +234,12 @@ public class ContactInfoCache implements ContactsAsyncHelper.OnImageLoadComplete entry.location = oldEntry.location; } + // If no image and it's a business, switch to using the default business avatar. + if (info.getImageUrl() == null && info.isBusiness()) { + Log.d(TAG, "Business has no image. Using default."); + entry.photo = mContext.getResources().getDrawable(R.drawable.business_unknown); + } + // Add the contact info to the cache. mInfoMap.put(mCallId, entry); sendInfoNotifications(mCallId, entry); diff --git a/InCallUI/src/com/android/incallui/service/PhoneNumberService.java b/InCallUI/src/com/android/incallui/service/PhoneNumberService.java index 942bf422f..24303cdfd 100644 --- a/InCallUI/src/com/android/incallui/service/PhoneNumberService.java +++ b/InCallUI/src/com/android/incallui/service/PhoneNumberService.java @@ -67,5 +67,6 @@ public interface PhoneNumberService { public String getPhoneLabel(); public String getNormalizedNumber(); public String getImageUrl(); + public boolean isBusiness(); } } |