Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa70611b authored by android-build-team Robot's avatar android-build-team Robot
Browse files

release-request-4be129b1-3f50-40d3-bbd4-30899b786745-for-git_oc-dr1-release-42...

release-request-4be129b1-3f50-40d3-bbd4-30899b786745-for-git_oc-dr1-release-4273712 snap-temp-L56000000093068720

Change-Id: I17e1756ec06b4ee5a5a3a98c327eec0b1a83d319
parents fb4a3213 9a6afa3a
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.provider.ContactsContract.CommonDataKinds.SipAddress;
import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.Directory;
import android.support.annotation.VisibleForTesting;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
@@ -357,7 +358,8 @@ public class PhoneNumberListAdapter extends ContactEntryListAdapter {
    bindPhoneNumber(view, cursor, directory.isDisplayNumber(), position);
  }

  protected void bindPhoneNumber(
  @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED)
  public void bindPhoneNumber(
      ContactListItemView view, Cursor cursor, boolean displayNumber, int position) {
    CharSequence label = null;
    if (displayNumber && !cursor.isNull(PhoneQuery.PHONE_TYPE)) {
@@ -397,7 +399,8 @@ public class PhoneNumberListAdapter extends ContactEntryListAdapter {
      }
    }

    if (LightbringerComponent.get(mContext).getLightbringer().isReachable(mContext, number)) {
    if (action == ContactListItemView.NONE
        && LightbringerComponent.get(mContext).getLightbringer().isReachable(mContext, number)) {
      action = ContactListItemView.LIGHTBRINGER;
    }

+6 −14
Original line number Diff line number Diff line
@@ -551,12 +551,15 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
  private void bindActionButtons() {
    boolean canPlaceCallToNumber = PhoneNumberHelper.canPlaceCallsTo(number, numberPresentation);

    // Hide the call buttons by default. We then set it to be visible when appropriate below.
    // This saves us having to remember to set it to GONE in multiple places.
    callButtonView.setVisibility(View.GONE);
    videoCallButtonView.setVisibility(View.GONE);

    if (isFullyUndialableVoicemail()) {
      // Sometimes the voicemail server will report the message is from some non phone number
      // source. If the number does not contains any dialable digit treat it as it is from a unknown
      // number, remove all action buttons but still show the voicemail playback layout.
      callButtonView.setVisibility(View.GONE);
      videoCallButtonView.setVisibility(View.GONE);
      detailsButtonView.setVisibility(View.GONE);
      createNewContactButtonView.setVisibility(View.GONE);
      addToExistingContactButtonView.setVisibility(View.GONE);
@@ -582,11 +585,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
    }

    if (canPlaceCallToNumber) {
      // Set up the call button but hide it by default (the primary action is to call so it is
      // redundant). We then set it to be visible when appropriate below. This saves us having to
      // remember to set it to GONE in multiple places.
      callButtonView.setTag(IntentProvider.getReturnCallIntentProvider(number));
      callButtonView.setVisibility(View.GONE);
    }

    if (!TextUtils.isEmpty(voicemailUri) && canPlaceCallToNumber) {
@@ -616,8 +615,6 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
    } else if (lightbringerReady) {
      videoCallButtonView.setTag(IntentProvider.getLightbringerIntentProvider(number));
      videoCallButtonView.setVisibility(View.VISIBLE);
    } else {
      videoCallButtonView.setVisibility(View.GONE);
    }

    // For voicemail calls, show the voicemail playback layout; hide otherwise.
@@ -944,12 +941,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
    String accountLabel = mCallLogCache.getAccountLabel(accountHandle);
    if (!TextUtils.isEmpty(accountLabel)) {
      SimDetails.Builder simDetails = SimDetails.newBuilder().setNetwork(accountLabel);
      int color = mCallLogCache.getAccountColor(accountHandle);
      if (color == PhoneAccount.NO_HIGHLIGHT_COLOR) {
        simDetails.setColor(R.color.secondary_text_color);
      } else {
        simDetails.setColor(color);
      }
      simDetails.setColor(mCallLogCache.getAccountColor(accountHandle));
      contact.setSimDetails(simDetails.build());
    }
    return contact.build();
+1 −3
Original line number Diff line number Diff line
@@ -75,7 +75,6 @@ public class ListsFragment extends Fragment implements OnPageChangeListener, Lis
  private SharedPreferences mPrefs;
  private boolean mHasFetchedVoicemailStatus;
  private boolean mShowVoicemailTabAfterVoicemailStatusIsFetched;
  private VoicemailStatusHelper mVoicemailStatusHelper;
  private final ArrayList<OnPageChangeListener> mOnPageChangeListeners = new ArrayList<>();
  /** The position of the currently selected tab. */
  private int mTabIndex = TAB_INDEX_SPEED_DIAL;
@@ -99,7 +98,6 @@ public class ListsFragment extends Fragment implements OnPageChangeListener, Lis
    LogUtil.d("ListsFragment.onCreate", null);
    Trace.beginSection(TAG + " onCreate");
    super.onCreate(savedInstanceState);
    mVoicemailStatusHelper = new VoicemailStatusHelper();
    mPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
    Trace.endSection();
  }
@@ -294,7 +292,7 @@ public class ListsFragment extends Fragment implements OnPageChangeListener, Lis

    // Update hasActiveVoicemailProvider, which controls the number of tabs displayed.
    boolean hasActiveVoicemailProvider =
        mVoicemailStatusHelper.getNumberActivityVoicemailSources(statusCursor) > 0;
        VoicemailStatusHelper.getNumberActivityVoicemailSources(statusCursor) > 0;
    if (hasActiveVoicemailProvider != mAdapter.hasActiveVoicemailProvider()) {
      mAdapter.setHasActiveVoicemailProvider(hasActiveVoicemailProvider);
      mAdapter.notifyDataSetChanged();
+6 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ import com.android.dialer.constants.Constants;
import com.android.dialer.logging.DialerImpression;
import com.android.dialer.logging.Logger;
import com.android.dialer.phonenumbercache.CallLogQuery;
import com.android.dialer.telecom.TelecomUtil;
import com.android.dialer.util.PermissionsUtil;
import com.google.common.io.ByteStreams;
import java.io.File;
@@ -515,6 +516,11 @@ public class VoicemailPlaybackPresenter
    mView.disableUiElements();
    mIsPrepared = false;

    if (mContext != null && TelecomUtil.isInCall(mContext)) {
      handleError(new IllegalStateException("Cannot play voicemail when call is in progress"));
      return;
    }

    try {
      mMediaPlayer = new MediaPlayer();
      mMediaPlayer.setOnPreparedListener(this);
+4 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.dialer.calldetails;
import android.content.Context;
import android.net.Uri;
import android.support.v7.widget.RecyclerView;
import android.telecom.PhoneAccount;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
@@ -93,7 +94,9 @@ public class CallDetailsHeaderViewHolder extends RecyclerView.ViewHolder
    if (!TextUtils.isEmpty(contact.getSimDetails().getNetwork())) {
      networkView.setVisibility(View.VISIBLE);
      networkView.setText(contact.getSimDetails().getNetwork());
      networkView.setTextColor(context.getResources().getColor(contact.getSimDetails().getColor()));
      if (contact.getSimDetails().getColor() != PhoneAccount.NO_HIGHLIGHT_COLOR) {
        networkView.setTextColor(contact.getSimDetails().getColor());
      }
    }

    if (TextUtils.isEmpty(contact.getNumber())) {
Loading