diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-01-03 00:26:27 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-01-03 00:26:27 +0000 |
commit | 31586c7946fdc1a238d64bba07fbab9b0c4ea872 (patch) | |
tree | f0efa377c0700684e580d7b311db55546ba892d8 /java/com/android/dialer/app | |
parent | 663f58a4489ab0f0af9f4911dec106716eed7e30 (diff) | |
parent | ab8794fbffbb485f806fb89cb769e4a8933635f8 (diff) |
Merge changes Ie672d371,I73d130bd
* changes:
Fix accessibility bugs with transcription rating UI
Add assisted dialing indicators to the old call log.
Diffstat (limited to 'java/com/android/dialer/app')
4 files changed, 25 insertions, 7 deletions
diff --git a/java/com/android/dialer/app/calllog/CallLogGroupBuilder.java b/java/com/android/dialer/app/calllog/CallLogGroupBuilder.java index 4c0c63408..4a0d78d57 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.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.phonenumbercache.CallLogQuery; import com.android.dialer.phonenumberutil.PhoneNumberHelper; import java.util.Objects; @@ -114,7 +115,7 @@ public class CallLogGroupBuilder { String numberPostDialDigits; String numberViaNumbers; int callType; - int features; + int callFeatures; String accountComponentName; String accountId; int callbackAction; @@ -129,11 +130,11 @@ public class CallLogGroupBuilder { 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 @@ public class CallLogGroupBuilder { // (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 @@ public class CallLogGroupBuilder { 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 @@ public class CallLogGroupBuilder { && 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 fa1f7ab2c..e23d92c2e 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.app.calllog.calllogcache.CallLogCache; 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 @@ public class PhoneCallDetailsHelper (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 75c8fe6e2..a24552ba4 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 2d47eaf94..b275cecd1 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> |