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

Commit ad2003e0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes I2c82e950,Ibb386e20

* changes:
  Use Dagger to get Duo instance in CallLogListItemViewHolder
  Add input dialog for simulator to use customized number.
parents 02507c0e ec1bab9d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1737,7 +1737,7 @@ public class DialtactsActivity extends TransactionSafeActivity
      Simulator simulator = SimulatorComponent.get(context).getSimulator();
      if (simulator.shouldShow()) {
        simulatorMenuItem.setVisible(true);
        simulatorMenuItem.setActionProvider(simulator.getActionProvider(context));
        simulatorMenuItem.setActionProvider(simulator.getActionProvider(DialtactsActivity.this));
      } else {
        simulatorMenuItem.setVisible(false);
      }
+0 −1
Original line number Diff line number Diff line
@@ -844,7 +844,6 @@ public class CallLogAdapter extends GroupingListAdapter
    // attempt to set the field properly in that case
    viewHolder.isCallComposerCapable = isCallComposerCapable(viewHolder.number);
    viewHolder.setDetailedPhoneDetails(callDetailsEntries);
    viewHolder.duo = getDuo();
    final AsyncTask<Void, Void, Boolean> loadDataTask =
        new AsyncTask<Void, Void, Boolean>() {
          @Override
+3 −2
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ import com.android.dialer.contactphoto.ContactPhotoManager;
import com.android.dialer.dialercontact.DialerContact;
import com.android.dialer.dialercontact.SimDetails;
import com.android.dialer.duo.Duo;
import com.android.dialer.duo.DuoComponent;
import com.android.dialer.duo.DuoConstants;
import com.android.dialer.lettertile.LetterTileDrawable;
import com.android.dialer.lettertile.LetterTileDrawable.ContactType;
@@ -231,7 +232,6 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
  public boolean isSpam;

  public boolean isCallComposerCapable;
  public Duo duo;

  private View.OnClickListener mExpandCollapseListener;
  private final OnActionModeStateChangedListener onActionModeStateChangedListener;
@@ -670,6 +670,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
        videoCallButtonView.setVisibility(View.GONE);
        break;
      case CallbackAction.VOICE:
        Duo duo = DuoComponent.get(mContext).getDuo();
        // For a voice call, set the secondary callback action to be an IMS video call if it is
        // available. Otherwise try to set it as a Duo call.
        if (CallUtil.isVideoEnabled(mContext)
@@ -776,7 +777,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder
  private boolean showDuoPrimaryButton() {
    return accountHandle != null
        && accountHandle.getComponentName().equals(DuoConstants.PHONE_ACCOUNT_COMPONENT_NAME)
        && duo.isReachable(mContext, number);
        && DuoComponent.get(mContext).getDuo().isReachable(mContext, number);
  }

  private static boolean hasDialableChar(CharSequence number) {
+16 −2
Original line number Diff line number Diff line
@@ -16,9 +16,10 @@

package com.android.dialer.simulator;

import android.content.Context;
import android.support.annotation.IntDef;
import android.support.annotation.Nullable;
import android.support.annotation.StringDef;
import android.support.v7.app.AppCompatActivity;
import android.view.ActionProvider;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -28,7 +29,7 @@ import java.util.Objects;
public interface Simulator {
  boolean shouldShow();

  ActionProvider getActionProvider(Context context);
  ActionProvider getActionProvider(AppCompatActivity activity);

  /** The type of conference to emulate. */
  // TODO(a bug): add VoLTE and CDMA conference call
@@ -55,6 +56,19 @@ public interface Simulator {
  static final int ON_NEW_INCOMING_CONNECTION = 2;
  static final int ON_CONFERENCE = 3;

  static final String CALLER_ID_PRESENTATION_TYPE = "caller_id_";

  /** Bundle keys that are used in making fake call. */
  @Retention(RetentionPolicy.SOURCE)
  @StringDef({
    IS_VOLTE,
    PRESENTATION_CHOICE,
  })
  @interface BundleKey {}

  public final String IS_VOLTE = "ISVOLTE";
  public final String PRESENTATION_CHOICE = "PRESENTATIONCHOICE";

  /** Information about a connection event. */
  public static class Event {
    /** The type of connection event. */
+1 −1
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ final class SimulatorConferenceCreator
  private void addConferenceCall(String number, Bundle extras) {
    switch (conferenceType) {
      case Simulator.CONFERENCE_TYPE_VOLTE:
        extras.putBoolean("ISVOLTE", true);
        extras.putBoolean(Simulator.IS_VOLTE, true);
        break;
      default:
        break;
Loading