Merge changes Ie672d371,I73d130bd

* changes:
  Fix accessibility bugs with transcription rating UI
  Add assisted dialing indicators to the old call log.
diff --git a/assets/quantum/res/drawable-hdpi/quantum_ic_language_white_24.png b/assets/quantum/res/drawable-hdpi/quantum_ic_language_white_24.png
new file mode 100644
index 0000000..b7c8248
--- /dev/null
+++ b/assets/quantum/res/drawable-hdpi/quantum_ic_language_white_24.png
Binary files differ
diff --git a/assets/quantum/res/drawable-mdpi/quantum_ic_language_white_24.png b/assets/quantum/res/drawable-mdpi/quantum_ic_language_white_24.png
new file mode 100644
index 0000000..0bc7dfd
--- /dev/null
+++ b/assets/quantum/res/drawable-mdpi/quantum_ic_language_white_24.png
Binary files differ
diff --git a/assets/quantum/res/drawable-xhdpi/quantum_ic_language_white_24.png b/assets/quantum/res/drawable-xhdpi/quantum_ic_language_white_24.png
new file mode 100644
index 0000000..eeaab46
--- /dev/null
+++ b/assets/quantum/res/drawable-xhdpi/quantum_ic_language_white_24.png
Binary files differ
diff --git a/assets/quantum/res/drawable-xxhdpi/quantum_ic_language_white_24.png b/assets/quantum/res/drawable-xxhdpi/quantum_ic_language_white_24.png
new file mode 100644
index 0000000..d4b5518
--- /dev/null
+++ b/assets/quantum/res/drawable-xxhdpi/quantum_ic_language_white_24.png
Binary files differ
diff --git a/assets/quantum/res/drawable-xxxhdpi/quantum_ic_language_white_24.png b/assets/quantum/res/drawable-xxxhdpi/quantum_ic_language_white_24.png
new file mode 100644
index 0000000..a576ac7
--- /dev/null
+++ b/assets/quantum/res/drawable-xxxhdpi/quantum_ic_language_white_24.png
Binary files differ
diff --git a/java/com/android/dialer/app/calllog/CallLogGroupBuilder.java b/java/com/android/dialer/app/calllog/CallLogGroupBuilder.java
index 4c0c634..4a0d78d 100644
--- a/java/com/android/dialer/app/calllog/CallLogGroupBuilder.java
+++ b/java/com/android/dialer/app/calllog/CallLogGroupBuilder.java
@@ -28,6 +28,7 @@
 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.phonenumbercache.CallLogQuery;
 import com.android.dialer.phonenumberutil.PhoneNumberHelper;
 import java.util.Objects;
@@ -114,7 +115,7 @@
     String numberPostDialDigits;
     String numberViaNumbers;
     int callType;
-    int features;
+    int callFeatures;
     String accountComponentName;
     String accountId;
     int callbackAction;
@@ -129,11 +130,11 @@
       numberViaNumbers =
           (VERSION.SDK_INT >= VERSION_CODES.N) ? cursor.getString(CallLogQuery.VIA_NUMBER) : "";
       callType = cursor.getInt(CallLogQuery.CALL_TYPE);
-      features = cursor.getInt(CallLogQuery.FEATURES);
+      callFeatures = cursor.getInt(CallLogQuery.FEATURES);
       accountComponentName = cursor.getString(CallLogQuery.ACCOUNT_COMPONENT_NAME);
       accountId = cursor.getString(CallLogQuery.ACCOUNT_ID);
       callbackAction =
-          CallbackActionHelper.getCallbackAction(number, features, accountComponentName);
+          CallbackActionHelper.getCallbackAction(number, callFeatures, accountComponentName);
 
       final boolean isSameNumber = equalNumbers(groupNumber, number);
       final boolean isSamePostDialDigits = groupPostDialDigits.equals(numberPostDialDigits);
@@ -146,14 +147,15 @@
       // (1) Calls with the same number, account, and callback action should be in the same group;
       // (2) Never group voice mails; and
       // (3) Only group blocked calls with other blocked calls.
+      // (4) Only group calls that were assisted dialed with other calls that were assisted dialed.
       if (isSameNumber
           && isSameAccount
           && isSamePostDialDigits
           && isSameViaNumbers
           && isSameCallbackAction
           && areBothNotVoicemail(callType, groupCallType)
-          && (areBothNotBlocked(callType, groupCallType)
-              || areBothBlocked(callType, groupCallType))) {
+          && (areBothNotBlocked(callType, groupCallType) || areBothBlocked(callType, groupCallType))
+          && meetsAssistedDialingGroupingCriteria(groupFeatures, callFeatures)) {
         // Increment the size of the group to include the current call, but do not create
         // the group until finding a call that does not match.
         groupSize++;
@@ -177,6 +179,7 @@
         groupAccountComponentName = accountComponentName;
         groupAccountId = accountId;
         groupCallbackAction = callbackAction;
+        groupFeatures = callFeatures;
       }
 
       // Save the callback action and the day group associated with the current call.
@@ -280,6 +283,13 @@
         && groupCallType == AppCompatConstants.CALLS_BLOCKED_TYPE;
   }
 
+  private boolean meetsAssistedDialingGroupingCriteria(int groupFeatures, int callFeatures) {
+    int groupAssisted = (groupFeatures & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING);
+    int callAssisted = (callFeatures & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING);
+
+    return groupAssisted == callAssisted;
+  }
+
   public interface GroupCreator {
 
     /**
diff --git a/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java b/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java
index fa1f7ab..e23d92c 100644
--- a/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java
+++ b/java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java
@@ -37,6 +37,7 @@
 import com.android.dialer.calllogutils.PhoneCallDetails;
 import com.android.dialer.common.LogUtil;
 import com.android.dialer.compat.android.provider.VoicemailCompat;
+import com.android.dialer.compat.telephony.TelephonyManagerCompat;
 import com.android.dialer.logging.ContactSource;
 import com.android.dialer.oem.MotorolaUtils;
 import com.android.dialer.phonenumberutil.PhoneNumberHelper;
@@ -101,6 +102,9 @@
         (details.features & Calls.FEATURES_HD_CALL) == Calls.FEATURES_HD_CALL);
     views.callTypeIcons.setShowWifi(
         MotorolaUtils.shouldShowWifiIconInCallLog(context, details.features));
+    views.callTypeIcons.setShowAssistedDialed(
+        (details.features & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING)
+            == TelephonyManagerCompat.FEATURES_ASSISTED_DIALING);
     views.callTypeIcons.requestLayout();
     views.callTypeIcons.setVisibility(View.VISIBLE);
 
diff --git a/java/com/android/dialer/app/res/layout/call_log_list_item.xml b/java/com/android/dialer/app/res/layout/call_log_list_item.xml
index 75c8fe6..a24552b 100644
--- a/java/com/android/dialer/app/res/layout/call_log_list_item.xml
+++ b/java/com/android/dialer/app/res/layout/call_log_list_item.xml
@@ -194,6 +194,7 @@
                   android:layout_height="wrap_content"
                   android:layout_weight="1"
                   android:gravity="start"
+                  android:focusable="true"
                   android:text="@string/voicemail_transcription_rating"/>
 
               <TextView
@@ -202,6 +203,7 @@
                   android:layout_width="wrap_content"
                   android:layout_height="wrap_content"
                   android:gravity="end"
+                  android:focusable="true"
                   android:text="@string/voicemail_transcription_rating_good"/>
 
               <TextView
@@ -210,6 +212,7 @@
                   android:layout_width="wrap_content"
                   android:layout_height="wrap_content"
                   android:gravity="end"
+                  android:focusable="true"
                   android:text="@string/voicemail_transcription_rating_separator"/>
 
               <TextView
@@ -218,6 +221,7 @@
                   android:layout_width="wrap_content"
                   android:layout_height="wrap_content"
                   android:gravity="end"
+                  android:focusable="true"
                   android:text="@string/voicemail_transcription_rating_bad"/>
 
             </LinearLayout>
diff --git a/java/com/android/dialer/app/res/values/styles.xml b/java/com/android/dialer/app/res/values/styles.xml
index 2d47eaf..b275cec 100644
--- a/java/com/android/dialer/app/res/values/styles.xml
+++ b/java/com/android/dialer/app/res/values/styles.xml
@@ -265,8 +265,8 @@
     <item name="android:textSize">@dimen/call_log_voicemail_transcription_text_size</item>
     <item name="android:paddingTop">8dp</item>
     <item name="android:paddingBottom">8dp</item>
-    <item name="android:paddingLeft">4dp</item>
-    <item name="android:paddingRight">4dp</item>
+    <item name="android:paddingLeft">12dp</item>
+    <item name="android:paddingRight">12dp</item>
     <item name="android:minHeight">48dp</item>
   </style>
 </resources>
diff --git a/java/com/android/dialer/calllogutils/CallTypeIconsView.java b/java/com/android/dialer/calllogutils/CallTypeIconsView.java
index c7840c5..3d2b561 100644
--- a/java/com/android/dialer/calllogutils/CallTypeIconsView.java
+++ b/java/com/android/dialer/calllogutils/CallTypeIconsView.java
@@ -49,6 +49,7 @@
   private boolean showVideo;
   private boolean showHd;
   private boolean showWifi;
+  private boolean showAssistedDialed;
   private int width;
   private int height;
 
@@ -132,6 +133,19 @@
     }
   }
 
+  public boolean isAssistedDialedShown() {
+    return showAssistedDialed;
+  }
+
+  public void setShowAssistedDialed(boolean showAssistedDialed) {
+    this.showAssistedDialed = showAssistedDialed;
+    if (showAssistedDialed) {
+      width += resources.assistedDialedCall.getIntrinsicWidth() + resources.iconMargin;
+      height = Math.max(height, resources.assistedDialedCall.getIntrinsicHeight());
+      invalidate();
+    }
+  }
+
   public int getCount() {
     return callTypes.size();
   }
@@ -174,7 +188,8 @@
     int left = 0;
     // If we are using large icons, we should only show one icon (video, hd or call type) with
     // priority give to HD or Video. So we skip the call type icon if we plan to show them.
-    if (!useLargeIcons || !(showHd || showVideo || showWifi)) {
+
+    if (!useLargeIcons || !(showHd || showVideo || showWifi || showAssistedDialed)) {
       for (Integer callType : callTypes) {
         final Drawable drawable = getCallTypeDrawable(callType);
         final int right = left + drawable.getIntrinsicWidth();
@@ -196,6 +211,10 @@
     if (showWifi) {
       left = addDrawable(canvas, resources.wifiCall, left) + resources.iconMargin;
     }
+    // If showing assisted dial call icon, draw it scaled appropriately.
+    if (showAssistedDialed) {
+      left = addDrawable(canvas, resources.assistedDialedCall, left) + resources.iconMargin;
+    }
   }
 
   private int addDrawable(Canvas canvas, Drawable drawable, int left) {
@@ -231,6 +250,9 @@
     // Drawable representing a WiFi call.
     final Drawable wifiCall;
 
+    // Drawable representing an assisted dialed call.
+    final Drawable assistedDialedCall;
+
     /** The margin to use for icons. */
     final int iconMargin;
 
@@ -290,6 +312,12 @@
       wifiCall = drawable.mutate();
       wifiCall.setColorFilter(r.getColor(R.color.icon_color_grey), PorterDuff.Mode.MULTIPLY);
 
+      iconId = R.drawable.quantum_ic_language_white_24;
+      drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId);
+      assistedDialedCall = drawable.mutate();
+      assistedDialedCall.setColorFilter(
+          r.getColor(R.color.icon_color_grey), PorterDuff.Mode.MULTIPLY);
+
       iconMargin = largeIcons ? 0 : r.getDimensionPixelSize(R.dimen.call_log_icon_margin);
     }