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

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

release-request-c1e89bbc-a9dd-4c96-8532-caeb99fb86d6-for-git_oc-dr1-release-42...

release-request-c1e89bbc-a9dd-4c96-8532-caeb99fb86d6-for-git_oc-dr1-release-4229604 snap-temp-L39800000087367876

Change-Id: I0243bb362d0102b5bf1ca8a8ed978252b09e0055
parents a5338d22 ff2ad7ff
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@ RES_DIRS := \
	$(BASE_DIR)/incallui/telecomeventui/res \
	$(BASE_DIR)/incallui/video/impl/res \
	$(BASE_DIR)/incallui/video/protocol/res \
	$(BASE_DIR)/voicemail/impl/configui/res \
	$(BASE_DIR)/voicemail/impl/res \


@@ -178,6 +179,7 @@ DIALER_MANIFEST_FILES += \
	$(BASE_DIR)/incallui/video/impl/AndroidManifest.xml \
	$(BASE_DIR)/incallui/video/protocol/AndroidManifest.xml \
	$(BASE_DIR)/voicemail/AndroidManifest.xml \
	$(BASE_DIR)/voicemail/impl/configui/AndroidManifest.xml \
	$(BASE_DIR)/voicemail/impl/AndroidManifest.xml \


@@ -257,6 +259,7 @@ LOCAL_AAPT_FLAGS := \
	--extra-packages com.android.incallui.video.impl \
	--extra-packages com.android.phone.common \
	--extra-packages com.android.voicemail \
	--extra-packages com.android.voicemail.impl.configui \
	--extra-packages com.android.voicemail.impl \
	--extra-packages com.android.voicemail.impl.fetch \
	--extra-packages com.android.voicemail.impl.settings \
+1 −1
Original line number Diff line number Diff line
@@ -6,5 +6,5 @@
        android:tint="?attr/colorControlNormal">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M14,16.5h-4L10,15L3,15v4c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2v-4h-7v1.5zM20,6h-3.5L16.5,4.5L15,3L9,3L7.5,4.55L7.5,6L4,6c-1.1,0 -2,0.9 -2,2v4c0,1.1 0.9,2 2,2h6v-1.5h4L14,14h6c1.1,0 2,-0.9 2,-2L22,8c0,-1.1 -0.9,-2 -2,-2zM15,6L9,6L9,4.5h6L15,6z"/>
        android:pathData="M20,6h-4L16,4c0,-1.11 -0.89,-2 -2,-2h-4c-1.11,0 -2,0.89 -2,2v2L4,6c-1.11,0 -1.99,0.89 -1.99,2L2,19c0,1.11 0.89,2 2,2h16c1.11,0 2,-0.89 2,-2L22,8c0,-1.11 -0.89,-2 -2,-2zM12,15c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM14,6h-4L10,4h4v2z"/>
</vector>
+5 −0
Original line number Diff line number Diff line
@@ -35,6 +35,11 @@ public class TelecomManagerCompat {
  public static final String EXTRA_HANDOVER_VIDEO_STATE =
      "android.telecom.extra.HANDOVER_VIDEO_STATE";

  // This is a hidden constant in android.telecom.DisconnectCause. Telecom sets this as a disconnect
  // reason if it wants us to prompt the user that the video call is not available.
  // TODO: Reference it to constant in android.telecom.DisconnectCause.
  public static final String REASON_IMS_ACCESS_BLOCKED = "REASON_IMS_ACCESS_BLOCKED";

  /**
   * Returns the current SIM call manager. Apps must be prepared for this method to return null,
   * indicating that there currently exists no registered SIM call manager.
+56 −66
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import android.support.annotation.Nullable;
import android.telecom.TelecomManager;
import android.text.TextUtils;
import com.android.contacts.common.R;
import com.android.contacts.common.lettertiles.LetterTileDrawable.ContactType;
import com.android.dialer.common.Assert;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -88,24 +87,24 @@ public class LetterTileDrawable extends Drawable {
  private static final float VECTOR_ICON_SCALE = 0.7f;

  /** Reusable components to avoid new allocations */
  private static final Paint sPaint = new Paint();
  private final Paint mPaint = new Paint();

  private final Rect mRect = new Rect();
  private final char[] mFirstChar = new char[1];

  private static final Rect sRect = new Rect();
  private static final char[] sFirstChar = new char[1];
  /** Letter tile */
  private static TypedArray sColors;

  private static int sSpamColor;
  private static int sDefaultColor;
  private static int sTileFontColor;
  private static float sLetterToTileRatio;
  private static Drawable sDefaultPersonAvatar;
  private static Drawable sDefaultBusinessAvatar;
  private static Drawable sDefaultVoicemailAvatar;
  private static Drawable sDefaultSpamAvatar;
  private static Drawable sDefaultConferenceAvatar;

  private final Paint mPaint;
  @NonNull private final TypedArray mColors;

  private final int mSpamColor;
  private final int mDefaultColor;
  private final int mTileFontColor;
  private final float mLetterToTileRatio;
  @NonNull private final Drawable mDefaultPersonAvatar;
  @NonNull private final Drawable mDefaultBusinessAvatar;
  @NonNull private final Drawable mDefaultVoicemailAvatar;
  @NonNull private final Drawable mDefaultSpamAvatar;
  @NonNull private final Drawable mDefaultConferenceAvatar;

  @ContactType private int mContactType = TYPE_DEFAULT;
  private float mScale = 1.0f;
  private float mOffset = 0.0f;
@@ -117,33 +116,25 @@ public class LetterTileDrawable extends Drawable {
  private String mDisplayName;

  public LetterTileDrawable(final Resources res) {
    if (sColors == null) {
      sColors = res.obtainTypedArray(R.array.letter_tile_colors);
      sSpamColor = res.getColor(R.color.spam_contact_background);
      sDefaultColor = res.getColor(R.color.letter_tile_default_color);
      sTileFontColor = res.getColor(R.color.letter_tile_font_color);
      sLetterToTileRatio = res.getFraction(R.dimen.letter_to_tile_ratio, 1, 1);
      sDefaultPersonAvatar =
    mColors = res.obtainTypedArray(R.array.letter_tile_colors);
    mSpamColor = res.getColor(R.color.spam_contact_background);
    mDefaultColor = res.getColor(R.color.letter_tile_default_color);
    mTileFontColor = res.getColor(R.color.letter_tile_font_color);
    mLetterToTileRatio = res.getFraction(R.dimen.letter_to_tile_ratio, 1, 1);
    mDefaultPersonAvatar =
        res.getDrawable(R.drawable.product_logo_avatar_anonymous_white_color_120, null);
      Assert.isNotNull(sDefaultPersonAvatar, "sDefaultPersonAvatar is null");
      sDefaultBusinessAvatar = res.getDrawable(R.drawable.quantum_ic_business_vd_theme_24, null);
      Assert.isNotNull(sDefaultBusinessAvatar, "sDefaultBusinessAvatar is null");
      sDefaultVoicemailAvatar = res.getDrawable(R.drawable.quantum_ic_voicemail_vd_theme_24, null);
      Assert.isNotNull(sDefaultVoicemailAvatar, "sDefaultVoicemailAvatar is null");
      sDefaultSpamAvatar = res.getDrawable(R.drawable.quantum_ic_report_vd_theme_24, null);
      Assert.isNotNull(sDefaultSpamAvatar, "sDefaultSpamAvatar is null");
      sDefaultConferenceAvatar = res.getDrawable(R.drawable.quantum_ic_group_vd_theme_24, null);
      Assert.isNotNull(sDefaultConferenceAvatar, "sDefaultConferenceAvatar is null");

      sPaint.setTypeface(
    mDefaultBusinessAvatar = res.getDrawable(R.drawable.quantum_ic_business_vd_theme_24, null);
    mDefaultVoicemailAvatar = res.getDrawable(R.drawable.quantum_ic_voicemail_vd_theme_24, null);
    mDefaultSpamAvatar = res.getDrawable(R.drawable.quantum_ic_report_vd_theme_24, null);
    mDefaultConferenceAvatar = res.getDrawable(R.drawable.quantum_ic_group_vd_theme_24, null);

    mPaint.setTypeface(
        Typeface.create(res.getString(R.string.letter_tile_letter_font_family), Typeface.NORMAL));
      sPaint.setTextAlign(Align.CENTER);
      sPaint.setAntiAlias(true);
    }
    mPaint = new Paint();
    mPaint.setTextAlign(Align.CENTER);
    mPaint.setAntiAlias(true);
    mPaint.setFilterBitmap(true);
    mPaint.setDither(true);
    mColor = sDefaultColor;
    mColor = mDefaultColor;
  }

  private Rect getScaledBounds(float scale, float offset) {
@@ -165,20 +156,20 @@ public class LetterTileDrawable extends Drawable {
    switch (contactType) {
      case TYPE_BUSINESS:
        mScale = VECTOR_ICON_SCALE;
        return sDefaultBusinessAvatar;
        return mDefaultBusinessAvatar;
      case TYPE_VOICEMAIL:
        mScale = VECTOR_ICON_SCALE;
        return sDefaultVoicemailAvatar;
        return mDefaultVoicemailAvatar;
      case TYPE_SPAM:
        mScale = VECTOR_ICON_SCALE;
        return sDefaultSpamAvatar;
        return mDefaultSpamAvatar;
      case TYPE_CONFERENCE:
        mScale = VECTOR_ICON_SCALE;
        return sDefaultConferenceAvatar;
        return mDefaultConferenceAvatar;
      case TYPE_PERSON:
      case TYPE_GENERIC_AVATAR:
      default:
        return sDefaultPersonAvatar;
        return mDefaultPersonAvatar;
    }
  }

@@ -206,39 +197,38 @@ public class LetterTileDrawable extends Drawable {

  private void drawLetterTile(final Canvas canvas) {
    // Draw background color.
    sPaint.setColor(mColor);
    sPaint.setAlpha(mPaint.getAlpha());
    mPaint.setColor(mColor);

    final Rect bounds = getBounds();
    final int minDimension = Math.min(bounds.width(), bounds.height());

    if (mIsCircle) {
      canvas.drawCircle(bounds.centerX(), bounds.centerY(), minDimension / 2, sPaint);
      canvas.drawCircle(bounds.centerX(), bounds.centerY(), minDimension / 2, mPaint);
    } else {
      canvas.drawRect(bounds, sPaint);
      canvas.drawRect(bounds, mPaint);
    }

    // Draw letter/digit only if the first character is an english letter or there's a override
    if (mLetter != null) {
      // Draw letter or digit.
      sFirstChar[0] = mLetter;
      mFirstChar[0] = mLetter;

      // Scale text by canvas bounds and user selected scaling factor
      sPaint.setTextSize(mScale * sLetterToTileRatio * minDimension);
      sPaint.getTextBounds(sFirstChar, 0, 1, sRect);
      sPaint.setTypeface(Typeface.create("sans-serif", Typeface.NORMAL));
      sPaint.setColor(sTileFontColor);
      sPaint.setAlpha(ALPHA);
      mPaint.setTextSize(mScale * mLetterToTileRatio * minDimension);
      mPaint.getTextBounds(mFirstChar, 0, 1, mRect);
      mPaint.setTypeface(Typeface.create("sans-serif", Typeface.NORMAL));
      mPaint.setColor(mTileFontColor);
      mPaint.setAlpha(ALPHA);

      // Draw the letter in the canvas, vertically shifted up or down by the user-defined
      // offset
      canvas.drawText(
          sFirstChar,
          mFirstChar,
          0,
          1,
          bounds.centerX(),
          bounds.centerY() + mOffset * bounds.height() - sRect.exactCenterY(),
          sPaint);
          bounds.centerY() + mOffset * bounds.height() - mRect.exactCenterY(),
          mPaint);
    } else {
      // Draw the default image if there is no letter/digit to be drawn
      Drawable drawable = getDrawableForContactType(mContactType);
@@ -248,7 +238,7 @@ public class LetterTileDrawable extends Drawable {
      }

      drawable.setBounds(getScaledBounds(mScale, mOffset));
      drawable.setAlpha(drawable == sDefaultSpamAvatar ? SPAM_ALPHA : ALPHA);
      drawable.setAlpha(drawable == mDefaultSpamAvatar ? SPAM_ALPHA : ALPHA);
      drawable.draw(canvas);
    }
  }
@@ -265,20 +255,20 @@ public class LetterTileDrawable extends Drawable {
  /** Returns a deterministic color based on the provided contact identifier string. */
  private int pickColor(final String identifier) {
    if (mContactType == TYPE_SPAM) {
      return sSpamColor;
      return mSpamColor;
    }

    if (mContactType == TYPE_VOICEMAIL
        || mContactType == TYPE_BUSINESS
        || TextUtils.isEmpty(identifier)) {
      return sDefaultColor;
      return mDefaultColor;
    }

    // String.hashCode() implementation is not supposed to change across java versions, so
    // this should guarantee the same email address always maps to the same color.
    // The email should already have been normalized by the ContactRequest.
    final int color = Math.abs(identifier.hashCode()) % sColors.length();
    return sColors.getColor(color, sDefaultColor);
    final int color = Math.abs(identifier.hashCode()) % mColors.length();
    return mColors.getColor(color, mDefaultColor);
  }

  @Override
@@ -354,7 +344,7 @@ public class LetterTileDrawable extends Drawable {
    return this;
  }

  public LetterTileDrawable setContactType(@ContactType int contactType) {
  private LetterTileDrawable setContactType(@ContactType int contactType) {
    mContactType = contactType;
    return this;
  }
+37 −33
Original line number Diff line number Diff line
40:10695 Android Annotations Support Library
10770:10695 Android Compat Support Library
21501:10695 Android Core UI Support Library
32235:10691 Android Core Utils Support Library
42961:10695 Android Design Support Library
53694:10695 Android Fragments Support Library
64426:10695 Android Graphics Support Library
75162:10691 Android Media Compat Support Library
85892:10691 Android Transition Support Library
96621:10695 Android Compatibility Library v13
107353:10695 Android Compatibility Library v4
118085:10695 Android Compatibility Library v7
128796:16013 Android SDK
144828:11358 Android Common
156196:4771 Glide
160982:11358 Guava JDK5
172358:12847 jibercsclient
185224:10173 libphonenumber
195416:10699 shortcutbadger
206126:11358 Volley
217495:18982 mime4j
236493:11358 Google Auto
247862:11358 Dagger
259236:11357 Error Prone
270604:11358 J2ObjC
281984:11359 Apache Commons IO
293355:11358 JSR 250
304725:1602 JSR 305
306339:11365 JSR 330
317738:12847 carrierservices
317738:12847 rcsclientlib
330614:11358 material_components
330614:11358 lib
341987:11362 Guava JDK7
10754:11358 Android Common
22147:10695 Android Compat Support Library
32880:10695 Android Compatibility Library v13
43612:10695 Android Compatibility Library v4
54344:10695 Android Compatibility Library v7
65075:10695 Android Core UI Support Library
75809:10691 Android Core Utils Support Library
86535:10695 Android Design Support Library
97276:10695 Android Dynamic Animation Support Library
108009:10695 Android Fragments Support Library
118741:10695 Android Graphics Support Library
129477:10691 Android Media Compat Support Library
140207:10691 Android Transition Support Library
150920:11359 Apache Commons IO
162290:11358 Dagger
173664:11357 Error Prone
185037:11358 Google Auto
196410:11358 Guava JDK5
207783:11362 Guava JDK7
219156:11358 J2ObjC
230526:11358 JSR 250
241896:11365 JSR 330
253297:11358 Material Components for Android
264666:11358 OkHttp
276033:11358 Okio
287402:11358 Volley
298780:12847 carrierservices
311636:10402 gRPC
322058:11358 instrumentation
333434:12847 jibercsclient
346300:10173 libphonenumber
356484:18982 mime4j
375485:10699 shortcutbadger
386200:16013 Android SDK
402232:1096 Animal Sniffer
403338:4771 Glide
408121:1602 JSR 305
Loading