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

Commit ffd525d8 authored by linyuh's avatar linyuh Committed by Copybara-Service
Browse files

Delete AppCompatConstants

Test: Existing tests
PiperOrigin-RevId: 197681266
Change-Id: I27fdda1d5c252993795b6eb860663c8cab0d363c
parent a40a9ef5
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.dialer.app.calllog;

import android.content.Context;
import android.database.Cursor;
import android.provider.CallLog.Calls;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.telephony.PhoneNumberUtils;
@@ -26,7 +27,6 @@ import android.text.format.Time;
import com.android.contacts.common.util.DateUtils;
import com.android.dialer.calllogutils.CallbackActionHelper;
import com.android.dialer.calllogutils.CallbackActionHelper.CallbackAction;
import com.android.dialer.compat.AppCompatConstants;
import com.android.dialer.compat.telephony.TelephonyManagerCompat;
import com.android.dialer.inject.ApplicationContext;
import com.android.dialer.phonenumbercache.CallLogQuery;
@@ -267,18 +267,15 @@ public class CallLogGroupBuilder {
  }

  private boolean areBothNotVoicemail(int callType, int groupCallType) {
    return callType != AppCompatConstants.CALLS_VOICEMAIL_TYPE
        && groupCallType != AppCompatConstants.CALLS_VOICEMAIL_TYPE;
    return callType != Calls.VOICEMAIL_TYPE && groupCallType != Calls.VOICEMAIL_TYPE;
  }

  private boolean areBothNotBlocked(int callType, int groupCallType) {
    return callType != AppCompatConstants.CALLS_BLOCKED_TYPE
        && groupCallType != AppCompatConstants.CALLS_BLOCKED_TYPE;
    return callType != Calls.BLOCKED_TYPE && groupCallType != Calls.BLOCKED_TYPE;
  }

  private boolean areBothBlocked(int callType, int groupCallType) {
    return callType == AppCompatConstants.CALLS_BLOCKED_TYPE
        && groupCallType == AppCompatConstants.CALLS_BLOCKED_TYPE;
    return callType == Calls.BLOCKED_TYPE && groupCallType == Calls.BLOCKED_TYPE;
  }

  private boolean meetsAssistedDialingGroupingCriteria(int groupFeatures, int callFeatures) {
+3 −4
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import com.android.dialer.app.calllog.calllogcache.CallLogCache;
import com.android.dialer.calllogutils.PhoneCallDetails;
import com.android.dialer.common.Assert;
import com.android.dialer.common.LogUtil;
import com.android.dialer.compat.AppCompatConstants;

/** Helper class to fill in the views of a call log entry. */
/* package */ class CallLogListItemHelper {
@@ -224,15 +223,15 @@ import com.android.dialer.compat.AppCompatConstants;
    int lastCallType = getLastCallType(callTypes);
    int stringID;

    if (lastCallType == AppCompatConstants.CALLS_MISSED_TYPE) {
    if (lastCallType == Calls.MISSED_TYPE) {
      //Message: Missed call from <NameOrNumber>, <TypeOrLocation>, <TimeOfCall>,
      //<PhoneAccount>.
      stringID = R.string.description_incoming_missed_call;
    } else if (lastCallType == AppCompatConstants.CALLS_INCOMING_TYPE) {
    } else if (lastCallType == Calls.INCOMING_TYPE) {
      //Message: Answered call from <NameOrNumber>, <TypeOrLocation>, <TimeOfCall>,
      //<PhoneAccount>.
      stringID = R.string.description_incoming_answered_call;
    } else if (lastCallType == AppCompatConstants.CALLS_VOICEMAIL_TYPE) {
    } else if (lastCallType == Calls.VOICEMAIL_TYPE) {
      //Message: (Unread) [V/v]oicemail from <NameOrNumber>, <TypeOrLocation>, <TimeOfCall>,
      //<PhoneAccount>.
      stringID =
+7 −8
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import com.android.dialer.calllogutils.CallLogDurations;
import com.android.dialer.calllogutils.CallTypeHelper;
import com.android.dialer.calllogutils.CallTypeIconsView;
import com.android.dialer.common.LogUtil;
import com.android.dialer.compat.AppCompatConstants;
import com.android.dialer.enrichedcall.historyquery.proto.HistoryResult;
import com.android.dialer.enrichedcall.historyquery.proto.HistoryResult.Type;
import com.android.dialer.glidephotomanager.PhotoInfo;
@@ -217,14 +216,14 @@ public class CallDetailsEntryViewHolder extends ViewHolder {

  private static @ColorInt int getColorForCallType(Context context, int callType) {
    switch (callType) {
      case AppCompatConstants.CALLS_OUTGOING_TYPE:
      case AppCompatConstants.CALLS_VOICEMAIL_TYPE:
      case AppCompatConstants.CALLS_BLOCKED_TYPE:
      case AppCompatConstants.CALLS_INCOMING_TYPE:
      case AppCompatConstants.CALLS_ANSWERED_EXTERNALLY_TYPE:
      case AppCompatConstants.CALLS_REJECTED_TYPE:
      case Calls.OUTGOING_TYPE:
      case Calls.VOICEMAIL_TYPE:
      case Calls.BLOCKED_TYPE:
      case Calls.INCOMING_TYPE:
      case Calls.ANSWERED_EXTERNALLY_TYPE:
      case Calls.REJECTED_TYPE:
        return ContextCompat.getColor(context, R.color.dialer_secondary_text_color);
      case AppCompatConstants.CALLS_MISSED_TYPE:
      case Calls.MISSED_TYPE:
      default:
        // It is possible for users to end up with calls with unknown call types in their
        // call history, possibly due to 3rd party call log implementations (e.g. to
+6 −7
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ import com.android.dialer.calllogutils.CallLogRowActions;
import com.android.dialer.calllogutils.PhoneAccountUtils;
import com.android.dialer.calllogutils.PhotoInfoBuilder;
import com.android.dialer.common.concurrent.DialerExecutorComponent;
import com.android.dialer.compat.AppCompatConstants;
import com.android.dialer.compat.telephony.TelephonyManagerCompat;
import com.android.dialer.oem.MotorolaUtils;
import com.android.dialer.phonenumberutil.PhoneNumberHelper;
@@ -201,19 +200,19 @@ final class NewCallLogViewHolder extends RecyclerView.ViewHolder {
  private void setCallTypeIcon(CoalescedRow row) {
    @DrawableRes int resId;
    switch (row.getCallType()) {
      case AppCompatConstants.CALLS_INCOMING_TYPE:
      case AppCompatConstants.CALLS_ANSWERED_EXTERNALLY_TYPE:
      case Calls.INCOMING_TYPE:
      case Calls.ANSWERED_EXTERNALLY_TYPE:
        resId = R.drawable.quantum_ic_call_received_vd_theme_24;
        break;
      case AppCompatConstants.CALLS_OUTGOING_TYPE:
      case Calls.OUTGOING_TYPE:
        resId = R.drawable.quantum_ic_call_made_vd_theme_24;
        break;
      case AppCompatConstants.CALLS_MISSED_TYPE:
      case Calls.MISSED_TYPE:
        resId = R.drawable.quantum_ic_call_missed_vd_theme_24;
        break;
      case AppCompatConstants.CALLS_VOICEMAIL_TYPE:
      case Calls.VOICEMAIL_TYPE:
        throw new IllegalStateException("Voicemails not expected in call log");
      case AppCompatConstants.CALLS_BLOCKED_TYPE:
      case Calls.BLOCKED_TYPE:
        resId = R.drawable.quantum_ic_block_vd_theme_24;
        break;
      default:
+12 −12
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
package com.android.dialer.calllogutils;

import android.content.res.Resources;
import com.android.dialer.compat.AppCompatConstants;
import android.provider.CallLog.Calls;
import com.android.dialer.duo.Duo;

/** Helper class to perform operations related to call types. */
@@ -87,17 +87,17 @@ public class CallTypeHelper {
  }

  public static boolean isMissedCallType(int callType) {
    return (callType != AppCompatConstants.CALLS_INCOMING_TYPE
        && callType != AppCompatConstants.CALLS_OUTGOING_TYPE
        && callType != AppCompatConstants.CALLS_VOICEMAIL_TYPE
        && callType != AppCompatConstants.CALLS_ANSWERED_EXTERNALLY_TYPE);
    return (callType != Calls.INCOMING_TYPE
        && callType != Calls.OUTGOING_TYPE
        && callType != Calls.VOICEMAIL_TYPE
        && callType != Calls.ANSWERED_EXTERNALLY_TYPE);
  }

  /** Returns the text used to represent the given call type. */
  public CharSequence getCallTypeText(
      int callType, boolean isVideoCall, boolean isPulledCall, boolean isDuoCall) {
    switch (callType) {
      case AppCompatConstants.CALLS_INCOMING_TYPE:
      case Calls.INCOMING_TYPE:
        if (isVideoCall) {
          if (isPulledCall) {
            return incomingVideoPulledName;
@@ -115,7 +115,7 @@ public class CallTypeHelper {
          }
        }

      case AppCompatConstants.CALLS_OUTGOING_TYPE:
      case Calls.OUTGOING_TYPE:
        if (isVideoCall) {
          if (isPulledCall) {
            return outgoingVideoPulledName;
@@ -133,23 +133,23 @@ public class CallTypeHelper {
          }
        }

      case AppCompatConstants.CALLS_MISSED_TYPE:
      case Calls.MISSED_TYPE:
        if (isVideoCall) {
          return missedVideoName;
        } else {
          return missedName;
        }

      case AppCompatConstants.CALLS_VOICEMAIL_TYPE:
      case Calls.VOICEMAIL_TYPE:
        return voicemailName;

      case AppCompatConstants.CALLS_REJECTED_TYPE:
      case Calls.REJECTED_TYPE:
        return rejectedName;

      case AppCompatConstants.CALLS_BLOCKED_TYPE:
      case Calls.BLOCKED_TYPE:
        return blockedName;

      case AppCompatConstants.CALLS_ANSWERED_EXTERNALLY_TYPE:
      case Calls.ANSWERED_EXTERNALLY_TYPE:
        return answeredElsewhereName;

      default:
Loading