Loading java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java +124 −95 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.common.concurrent.Annotations.BackgroundExecutor; import com.android.dialer.compat.android.provider.VoicemailCompat; import com.android.dialer.duo.DuoConstants; import com.android.dialer.inject.ApplicationContext; import com.android.dialer.phonenumberproto.DialerPhoneNumberUtil; import com.android.dialer.storage.Unencrypted; Loading Loading @@ -277,12 +278,16 @@ public class SystemCallLogDataSource implements CallLogDataSource { return; } if (!cursor.moveToFirst()) { LogUtil.i("SystemCallLogDataSource.handleInsertsAndUpdates", "no entries to insert/update"); return; } LogUtil.i( "SystemCallLogDataSource.handleInsertsAndUpdates", "found %d entries to insert/update", cursor.getCount()); if (cursor.moveToFirst()) { int idColumn = cursor.getColumnIndexOrThrow(Calls._ID); int dateColumn = cursor.getColumnIndexOrThrow(Calls.DATE); int lastModifiedColumn = cursor.getColumnIndexOrThrow(Calls.LAST_MODIFIED); Loading Loading @@ -335,6 +340,11 @@ public class SystemCallLogDataSource implements CallLogDataSource { int features = cursor.getInt(featuresColumn); String postDialDigits = cursor.getString(postDialDigitsColumn); // Exclude Duo audio calls. if (isDuoAudioCall(phoneAccountComponentName, features)) { continue; } ContentValues contentValues = new ContentValues(); contentValues.put(AnnotatedCallLog.TIMESTAMP, date); Loading @@ -360,8 +370,7 @@ public class SystemCallLogDataSource implements CallLogDataSource { contentValues.put(AnnotatedCallLog.IS_READ, isRead); contentValues.put(AnnotatedCallLog.NEW, isNew); contentValues.put(AnnotatedCallLog.GEOCODED_LOCATION, geocodedLocation); contentValues.put( AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME, phoneAccountComponentName); contentValues.put(AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME, phoneAccountComponentName); contentValues.put(AnnotatedCallLog.PHONE_ACCOUNT_ID, phoneAccountId); populatePhoneAccountLabelAndColor( appContext, contentValues, phoneAccountComponentName, phoneAccountId); Loading @@ -378,10 +387,30 @@ public class SystemCallLogDataSource implements CallLogDataSource { mutations.insert(id, contentValues); } } while (cursor.moveToNext()); } // else no new results, do nothing. } } /** * Returns true if the phone account component name and the features belong to a Duo audio call. * * <p>Characteristics of a Duo audio call are as follows. * * <ul> * <li>The phone account component name is {@link DuoConstants#PHONE_ACCOUNT_COMPONENT_NAME}; * and * <li>The features don't include {@link Calls#FEATURES_VIDEO}. * </ul> * * <p>It is the caller's responsibility to ensure the phone account component name and the * features come from the same call log entry. */ private static boolean isDuoAudioCall(@Nullable String phoneAccountComponentName, int features) { return DuoConstants.PHONE_ACCOUNT_COMPONENT_NAME .flattenToString() .equals(phoneAccountComponentName) && ((features & Calls.FEATURES_VIDEO) != Calls.FEATURES_VIDEO); } private void setTranscriptionState(Cursor cursor, ContentValues contentValues) { if (VERSION.SDK_INT >= VERSION_CODES.O) { int transcriptionStateColumn = Loading Loading
java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java +124 −95 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.common.concurrent.Annotations.BackgroundExecutor; import com.android.dialer.compat.android.provider.VoicemailCompat; import com.android.dialer.duo.DuoConstants; import com.android.dialer.inject.ApplicationContext; import com.android.dialer.phonenumberproto.DialerPhoneNumberUtil; import com.android.dialer.storage.Unencrypted; Loading Loading @@ -277,12 +278,16 @@ public class SystemCallLogDataSource implements CallLogDataSource { return; } if (!cursor.moveToFirst()) { LogUtil.i("SystemCallLogDataSource.handleInsertsAndUpdates", "no entries to insert/update"); return; } LogUtil.i( "SystemCallLogDataSource.handleInsertsAndUpdates", "found %d entries to insert/update", cursor.getCount()); if (cursor.moveToFirst()) { int idColumn = cursor.getColumnIndexOrThrow(Calls._ID); int dateColumn = cursor.getColumnIndexOrThrow(Calls.DATE); int lastModifiedColumn = cursor.getColumnIndexOrThrow(Calls.LAST_MODIFIED); Loading Loading @@ -335,6 +340,11 @@ public class SystemCallLogDataSource implements CallLogDataSource { int features = cursor.getInt(featuresColumn); String postDialDigits = cursor.getString(postDialDigitsColumn); // Exclude Duo audio calls. if (isDuoAudioCall(phoneAccountComponentName, features)) { continue; } ContentValues contentValues = new ContentValues(); contentValues.put(AnnotatedCallLog.TIMESTAMP, date); Loading @@ -360,8 +370,7 @@ public class SystemCallLogDataSource implements CallLogDataSource { contentValues.put(AnnotatedCallLog.IS_READ, isRead); contentValues.put(AnnotatedCallLog.NEW, isNew); contentValues.put(AnnotatedCallLog.GEOCODED_LOCATION, geocodedLocation); contentValues.put( AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME, phoneAccountComponentName); contentValues.put(AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME, phoneAccountComponentName); contentValues.put(AnnotatedCallLog.PHONE_ACCOUNT_ID, phoneAccountId); populatePhoneAccountLabelAndColor( appContext, contentValues, phoneAccountComponentName, phoneAccountId); Loading @@ -378,10 +387,30 @@ public class SystemCallLogDataSource implements CallLogDataSource { mutations.insert(id, contentValues); } } while (cursor.moveToNext()); } // else no new results, do nothing. } } /** * Returns true if the phone account component name and the features belong to a Duo audio call. * * <p>Characteristics of a Duo audio call are as follows. * * <ul> * <li>The phone account component name is {@link DuoConstants#PHONE_ACCOUNT_COMPONENT_NAME}; * and * <li>The features don't include {@link Calls#FEATURES_VIDEO}. * </ul> * * <p>It is the caller's responsibility to ensure the phone account component name and the * features come from the same call log entry. */ private static boolean isDuoAudioCall(@Nullable String phoneAccountComponentName, int features) { return DuoConstants.PHONE_ACCOUNT_COMPONENT_NAME .flattenToString() .equals(phoneAccountComponentName) && ((features & Calls.FEATURES_VIDEO) != Calls.FEATURES_VIDEO); } private void setTranscriptionState(Cursor cursor, ContentValues contentValues) { if (VERSION.SDK_INT >= VERSION_CODES.O) { int transcriptionStateColumn = Loading