diff options
Diffstat (limited to 'src')
4 files changed, 18 insertions, 14 deletions
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index ae20e4943..ca07fbaca 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -214,7 +214,8 @@ public class CallLogAdapter extends GroupingListAdapter // Only expand if actions are not already expanded, because triggering the expand // function on clicks causes the action views to lose the focus indicator. CallLogListItemViewHolder viewHolder = (CallLogListItemViewHolder) host.getTag(); - if (mCurrentlyExpandedPosition != viewHolder.getAdapterPosition()) { + if (mVoicemailPlaybackPresenter == null && + mCurrentlyExpandedPosition != viewHolder.getAdapterPosition()) { expandViewHolderActions((CallLogListItemViewHolder) host.getTag()); } } diff --git a/src/com/android/dialer/calllog/CallLogListItemHelper.java b/src/com/android/dialer/calllog/CallLogListItemHelper.java index 84d036487..57a83e603 100644 --- a/src/com/android/dialer/calllog/CallLogListItemHelper.java +++ b/src/com/android/dialer/calllog/CallLogListItemHelper.java @@ -164,7 +164,6 @@ import com.android.dialer.R; */ public CharSequence getCallDescription(PhoneCallDetails details) { int lastCallType = getLastCallType(details.callTypes); - boolean isVoiceMail = lastCallType == Calls.VOICEMAIL_TYPE; // Get the name or number of the caller. final CharSequence nameOrNumber = getNameOrNumber(details); @@ -177,11 +176,6 @@ import com.android.dialer.R; SpannableStringBuilder callDescription = new SpannableStringBuilder(); - // Prepend the voicemail indication. - if (isVoiceMail) { - callDescription.append(mResources.getString(R.string.description_new_voicemail)); - } - // Add number of calls if more than one. if (details.callTypes.length > 1) { callDescription.append(mResources.getString(R.string.description_num_calls, @@ -193,7 +187,7 @@ import com.android.dialer.R; callDescription.append(mResources.getString(R.string.description_video_call)); } - int stringID = getCallDescriptionStringID(details.callTypes); + int stringID = getCallDescriptionStringID(details.callTypes, details.isRead); String accountLabel = mTelecomCallLogCache.getAccountLabel(details.accountHandle); // Use chosen string resource to build up the message. @@ -217,15 +211,16 @@ import com.android.dialer.R; /** * Determine the appropriate string ID to describe a call for accessibility purposes. * - * @param details Call details. + * @param callTypes The type of call corresponding to this entry or multiple if this entry + * represents multiple calls grouped together. + * @param isRead If the entry is a voicemail, {@code true} if the voicemail is read. * @return String resource ID to use. */ - public int getCallDescriptionStringID(int[] callTypes) { + public int getCallDescriptionStringID(int[] callTypes, boolean isRead) { int lastCallType = getLastCallType(callTypes); int stringID; - if (lastCallType == AppCompatConstants.CALLS_VOICEMAIL_TYPE - || lastCallType == AppCompatConstants.CALLS_MISSED_TYPE) { + if (lastCallType == AppCompatConstants.CALLS_MISSED_TYPE) { //Message: Missed call from <NameOrNumber>, <TypeOrLocation>, <TimeOfCall>, //<PhoneAccount>. stringID = R.string.description_incoming_missed_call; @@ -233,6 +228,11 @@ import com.android.dialer.R; //Message: Answered call from <NameOrNumber>, <TypeOrLocation>, <TimeOfCall>, //<PhoneAccount>. stringID = R.string.description_incoming_answered_call; + } else if (lastCallType == AppCompatConstants.CALLS_VOICEMAIL_TYPE) { + //Message: (Unread) [V/v]oicemail from <NameOrNumber>, <TypeOrLocation>, <TimeOfCall>, + //<PhoneAccount>. + stringID = isRead ? R.string.description_read_voicemail + : R.string.description_unread_voicemail; } else { //Message: Call to <NameOrNumber>, <TypeOrLocation>, <TimeOfCall>, <PhoneAccount>. stringID = R.string.description_outgoing_call; diff --git a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java index fd649bc7a..1bc44108d 100644 --- a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java +++ b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java @@ -398,6 +398,9 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder // Treat as voicemail list item; show play button if not expanded. if (!isExpanded) { primaryActionButtonView.setImageResource(R.drawable.ic_play_arrow_24dp); + primaryActionButtonView.setContentDescription(TextUtils.expandTemplate( + mContext.getString(R.string.description_voicemail_action), + nameOrNumber)); primaryActionButtonView.setVisibility(View.VISIBLE); } else { primaryActionButtonView.setVisibility(View.GONE); diff --git a/src/com/android/dialer/list/ListsFragment.java b/src/com/android/dialer/list/ListsFragment.java index c80ab4274..934792cdd 100644 --- a/src/com/android/dialer/list/ListsFragment.java +++ b/src/com/android/dialer/list/ListsFragment.java @@ -313,7 +313,7 @@ public class ListsFragment extends Fragment if (hasActiveVoicemailProvider != mHasActiveVoicemailProvider) { mHasActiveVoicemailProvider = hasActiveVoicemailProvider; mViewPagerAdapter.notifyDataSetChanged(); - mViewPagerTabs.setViewPager(mViewPager); + mViewPagerTabs.updateTab(TAB_INDEX_VOICEMAIL); mPrefs.edit() .putBoolean(PREF_KEY_HAS_ACTIVE_VOICEMAIL_PROVIDER, hasActiveVoicemailProvider) @@ -344,7 +344,7 @@ public class ListsFragment extends Fragment } mViewPagerTabs.setUnreadCount(count, TAB_INDEX_VOICEMAIL); - mViewPagerTabs.setViewPager(mViewPager); + mViewPagerTabs.updateTab(TAB_INDEX_VOICEMAIL); } @Override |