Loading java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -279,7 +279,7 @@ public class PhoneCallDetailsHelper return; } if (PhoneNumberUtils.isEmergencyNumber(details.number.toString())) { if (PhoneNumberUtils.isEmergencyNumber(details.displayNumber)) { views.nameView.setText(R.string.emergency_number); views.nameView.setTextDirection(View.TEXT_DIRECTION_INHERIT); return; Loading java/com/android/dialer/calllog/database/Coalescer.java +20 −15 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.dialer.calllog.database; import android.content.ContentValues; import android.database.Cursor; import android.database.MatrixCursor; import android.provider.CallLog.Calls; import android.support.annotation.NonNull; import android.support.annotation.WorkerThread; import android.telecom.PhoneAccountHandle; Loading Loading @@ -151,7 +152,6 @@ public class Coalescer { TelecomUtil.composePhoneAccountHandle( row2.getAsString(AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME), row2.getAsString(AnnotatedCallLog.PHONE_ACCOUNT_ID)); if (!Objects.equals(phoneAccount1, phoneAccount2)) { return false; } Loading @@ -161,7 +161,7 @@ public class Coalescer { return false; } if (!meetsAssistedDialingCriteria(row1, row2)) { if (!meetsCallFeatureCriteria(row1, row2)) { return false; } Loading @@ -185,20 +185,25 @@ public class Coalescer { } /** * Returns a boolean indicating whether or not FEATURES_ASSISTED_DIALING is mutually exclusive * between two rows. * Returns true if column {@link AnnotatedCallLog#FEATURES} of the two given rows indicate that * they can be coalesced. */ private static boolean meetsAssistedDialingCriteria(ContentValues row1, ContentValues row2) { int row1Assisted = row1.getAsInteger(AnnotatedCallLog.FEATURES) & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING; int row2Assisted = row2.getAsInteger(AnnotatedCallLog.FEATURES) & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING; // FEATURES_ASSISTED_DIALING should not be combined with calls that are // !FEATURES_ASSISTED_DIALING return row1Assisted == row2Assisted; private static boolean meetsCallFeatureCriteria(ContentValues row1, ContentValues row2) { int row1Features = row1.getAsInteger(AnnotatedCallLog.FEATURES); int row2Features = row2.getAsInteger(AnnotatedCallLog.FEATURES); // A row with FEATURES_ASSISTED_DIALING should not be combined with one without it. if ((row1Features & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING) != (row2Features & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING)) { return false; } // A video call should not be combined with one that is not a video call. if ((row1Features & Calls.FEATURES_VIDEO) != (row2Features & Calls.FEATURES_VIDEO)) { return false; } return true; } /** Loading java/com/android/dialer/calllog/ui/menu/Modules.java +10 −2 Original line number Diff line number Diff line Loading @@ -27,8 +27,10 @@ import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.calllog.model.CoalescedRow; import com.android.dialer.calllogutils.CallLogEntryText; import com.android.dialer.calllogutils.NumberAttributesConverter; import com.android.dialer.duo.DuoConstants; import com.android.dialer.glidephotomanager.PhotoInfo; import com.android.dialer.historyitemactions.DividerModule; import com.android.dialer.historyitemactions.DuoCallModule; import com.android.dialer.historyitemactions.HistoryItemActionModule; import com.android.dialer.historyitemactions.IntentModule; import com.android.dialer.historyitemactions.SharedModules; Loading Loading @@ -134,8 +136,14 @@ final class Modules { // Add a video item if (1) the call log entry is for a video call, and (2) the call is not spam. if ((row.getFeatures() & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO && !row.getNumberAttributes().getIsSpam()) { boolean isDuoCall = DuoConstants.PHONE_ACCOUNT_COMPONENT_NAME .flattenToString() .equals(row.getPhoneAccountComponentName()); modules.add( IntentModule.newVideoCallModule( isDuoCall ? new DuoCallModule(context, normalizedNumber, CallInitiationType.Type.CALL_LOG) : IntentModule.newCarrierVideoCallModule( context, normalizedNumber, phoneAccountHandle, CallInitiationType.Type.CALL_LOG)); } Loading java/com/android/dialer/calllogutils/res/values/strings.xml +2 −2 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ <!-- String to be displayed to indicate in the call log that a call just now occurred. --> <string name="just_now">Just now</string> <!-- Text to show in call log for a carrier video call. [CHAR LIMIT=30] --> <!-- Text to show in call log for a carrier video call. [CHAR LIMIT=31] --> <string name="new_call_log_carrier_video">Carrier video</string> <!-- Text to show in call log for a duo video call. [CHAR LIMIT=30] --> Loading java/com/android/dialer/constants/ActivityRequestCodes.java +3 −3 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.dialer.constants; import com.android.dialer.duo.Duo; /** * Class containing {@link android.app.Activity#onActivityResult(int, int, android.content.Intent)} * request codes. Loading @@ -32,7 +30,9 @@ public final class ActivityRequestCodes { /** Request code for {@link com.android.dialer.callcomposer.CallComposerActivity} intent. */ public static final int DIALTACTS_CALL_COMPOSER = 2; /** Request code for {@link Duo#getIntent(android.content.Context, String)}. */ /** * Request code for {@link com.android.dialer.duo.Duo#getIntent(android.content.Context, String)}. */ public static final int DIALTACTS_DUO = 3; /** Request code for {@link com.android.dialer.calldetails.OldCallDetailsActivity} intent. */ Loading Loading
java/com/android/dialer/app/calllog/PhoneCallDetailsHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -279,7 +279,7 @@ public class PhoneCallDetailsHelper return; } if (PhoneNumberUtils.isEmergencyNumber(details.number.toString())) { if (PhoneNumberUtils.isEmergencyNumber(details.displayNumber)) { views.nameView.setText(R.string.emergency_number); views.nameView.setTextDirection(View.TEXT_DIRECTION_INHERIT); return; Loading
java/com/android/dialer/calllog/database/Coalescer.java +20 −15 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.dialer.calllog.database; import android.content.ContentValues; import android.database.Cursor; import android.database.MatrixCursor; import android.provider.CallLog.Calls; import android.support.annotation.NonNull; import android.support.annotation.WorkerThread; import android.telecom.PhoneAccountHandle; Loading Loading @@ -151,7 +152,6 @@ public class Coalescer { TelecomUtil.composePhoneAccountHandle( row2.getAsString(AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME), row2.getAsString(AnnotatedCallLog.PHONE_ACCOUNT_ID)); if (!Objects.equals(phoneAccount1, phoneAccount2)) { return false; } Loading @@ -161,7 +161,7 @@ public class Coalescer { return false; } if (!meetsAssistedDialingCriteria(row1, row2)) { if (!meetsCallFeatureCriteria(row1, row2)) { return false; } Loading @@ -185,20 +185,25 @@ public class Coalescer { } /** * Returns a boolean indicating whether or not FEATURES_ASSISTED_DIALING is mutually exclusive * between two rows. * Returns true if column {@link AnnotatedCallLog#FEATURES} of the two given rows indicate that * they can be coalesced. */ private static boolean meetsAssistedDialingCriteria(ContentValues row1, ContentValues row2) { int row1Assisted = row1.getAsInteger(AnnotatedCallLog.FEATURES) & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING; int row2Assisted = row2.getAsInteger(AnnotatedCallLog.FEATURES) & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING; // FEATURES_ASSISTED_DIALING should not be combined with calls that are // !FEATURES_ASSISTED_DIALING return row1Assisted == row2Assisted; private static boolean meetsCallFeatureCriteria(ContentValues row1, ContentValues row2) { int row1Features = row1.getAsInteger(AnnotatedCallLog.FEATURES); int row2Features = row2.getAsInteger(AnnotatedCallLog.FEATURES); // A row with FEATURES_ASSISTED_DIALING should not be combined with one without it. if ((row1Features & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING) != (row2Features & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING)) { return false; } // A video call should not be combined with one that is not a video call. if ((row1Features & Calls.FEATURES_VIDEO) != (row2Features & Calls.FEATURES_VIDEO)) { return false; } return true; } /** Loading
java/com/android/dialer/calllog/ui/menu/Modules.java +10 −2 Original line number Diff line number Diff line Loading @@ -27,8 +27,10 @@ import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.calllog.model.CoalescedRow; import com.android.dialer.calllogutils.CallLogEntryText; import com.android.dialer.calllogutils.NumberAttributesConverter; import com.android.dialer.duo.DuoConstants; import com.android.dialer.glidephotomanager.PhotoInfo; import com.android.dialer.historyitemactions.DividerModule; import com.android.dialer.historyitemactions.DuoCallModule; import com.android.dialer.historyitemactions.HistoryItemActionModule; import com.android.dialer.historyitemactions.IntentModule; import com.android.dialer.historyitemactions.SharedModules; Loading Loading @@ -134,8 +136,14 @@ final class Modules { // Add a video item if (1) the call log entry is for a video call, and (2) the call is not spam. if ((row.getFeatures() & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO && !row.getNumberAttributes().getIsSpam()) { boolean isDuoCall = DuoConstants.PHONE_ACCOUNT_COMPONENT_NAME .flattenToString() .equals(row.getPhoneAccountComponentName()); modules.add( IntentModule.newVideoCallModule( isDuoCall ? new DuoCallModule(context, normalizedNumber, CallInitiationType.Type.CALL_LOG) : IntentModule.newCarrierVideoCallModule( context, normalizedNumber, phoneAccountHandle, CallInitiationType.Type.CALL_LOG)); } Loading
java/com/android/dialer/calllogutils/res/values/strings.xml +2 −2 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ <!-- String to be displayed to indicate in the call log that a call just now occurred. --> <string name="just_now">Just now</string> <!-- Text to show in call log for a carrier video call. [CHAR LIMIT=30] --> <!-- Text to show in call log for a carrier video call. [CHAR LIMIT=31] --> <string name="new_call_log_carrier_video">Carrier video</string> <!-- Text to show in call log for a duo video call. [CHAR LIMIT=30] --> Loading
java/com/android/dialer/constants/ActivityRequestCodes.java +3 −3 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.dialer.constants; import com.android.dialer.duo.Duo; /** * Class containing {@link android.app.Activity#onActivityResult(int, int, android.content.Intent)} * request codes. Loading @@ -32,7 +30,9 @@ public final class ActivityRequestCodes { /** Request code for {@link com.android.dialer.callcomposer.CallComposerActivity} intent. */ public static final int DIALTACTS_CALL_COMPOSER = 2; /** Request code for {@link Duo#getIntent(android.content.Context, String)}. */ /** * Request code for {@link com.android.dialer.duo.Duo#getIntent(android.content.Context, String)}. */ public static final int DIALTACTS_DUO = 3; /** Request code for {@link com.android.dialer.calldetails.OldCallDetailsActivity} intent. */ Loading