Loading src/com/android/server/telecom/CallLogManager.java +2 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,8 @@ public final class CallLogManager extends CallsManagerListenerBase { type = Calls.MISSED_TYPE; } else if (disconnectCause == DisconnectCause.ANSWERED_ELSEWHERE) { type = Calls.ANSWERED_EXTERNALLY_TYPE; } else if (disconnectCause == DisconnectCause.REJECTED) { type = Calls.REJECTED_TYPE; } else { type = Calls.INCOMING_TYPE; } Loading tests/src/com/android/server/telecom/tests/CallLogManagerTest.java +25 −0 Original line number Diff line number Diff line Loading @@ -288,6 +288,31 @@ public class CallLogManagerTest extends TelecomTestCase { verify(mMissedCallNotifier).showMissedCallNotification(fakeMissedCall); } @MediumTest public void testLogCallDirectionRejected() { when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class))) .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID)); Call fakeMissedCall = makeFakeCall( DisconnectCause.REJECTED, // disconnectCauseCode false, // isConference true, // isIncoming 1L, // creationTimeMillis 1000L, // ageMillis TEL_PHONEHANDLE, // callHandle mDefaultAccountHandle, // phoneAccountHandle NO_VIDEO_STATE, // callVideoState POST_DIAL_STRING, // postDialDigits VIA_NUMBER_STRING, // viaNumber null ); mCallLogManager.onCallStateChanged(fakeMissedCall, CallState.ACTIVE, CallState.DISCONNECTED); ContentValues insertedValues = verifyInsertionWithCapture(CURRENT_USER_ID); assertEquals(insertedValues.getAsInteger(CallLog.Calls.TYPE), Integer.valueOf(Calls.REJECTED_TYPE)); } @MediumTest public void testCreationTimeAndAge() { when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class))) Loading Loading
src/com/android/server/telecom/CallLogManager.java +2 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,8 @@ public final class CallLogManager extends CallsManagerListenerBase { type = Calls.MISSED_TYPE; } else if (disconnectCause == DisconnectCause.ANSWERED_ELSEWHERE) { type = Calls.ANSWERED_EXTERNALLY_TYPE; } else if (disconnectCause == DisconnectCause.REJECTED) { type = Calls.REJECTED_TYPE; } else { type = Calls.INCOMING_TYPE; } Loading
tests/src/com/android/server/telecom/tests/CallLogManagerTest.java +25 −0 Original line number Diff line number Diff line Loading @@ -288,6 +288,31 @@ public class CallLogManagerTest extends TelecomTestCase { verify(mMissedCallNotifier).showMissedCallNotification(fakeMissedCall); } @MediumTest public void testLogCallDirectionRejected() { when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class))) .thenReturn(makeFakePhoneAccount(mDefaultAccountHandle, CURRENT_USER_ID)); Call fakeMissedCall = makeFakeCall( DisconnectCause.REJECTED, // disconnectCauseCode false, // isConference true, // isIncoming 1L, // creationTimeMillis 1000L, // ageMillis TEL_PHONEHANDLE, // callHandle mDefaultAccountHandle, // phoneAccountHandle NO_VIDEO_STATE, // callVideoState POST_DIAL_STRING, // postDialDigits VIA_NUMBER_STRING, // viaNumber null ); mCallLogManager.onCallStateChanged(fakeMissedCall, CallState.ACTIVE, CallState.DISCONNECTED); ContentValues insertedValues = verifyInsertionWithCapture(CURRENT_USER_ID); assertEquals(insertedValues.getAsInteger(CallLog.Calls.TYPE), Integer.valueOf(Calls.REJECTED_TYPE)); } @MediumTest public void testCreationTimeAndAge() { when(mMockPhoneAccountRegistrar.getPhoneAccountUnchecked(any(PhoneAccountHandle.class))) Loading