Loading src/com/android/server/telecom/CallsManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -861,7 +861,8 @@ public class CallsManager extends Call.ListenerBase } mCallLogManager.logCall(incomingCall, Calls.BLOCKED_TYPE, result.shouldShowNotification, result); } else if (result.shouldShowNotification) { } if (result.shouldShowNotification) { Log.i(this, "onCallScreeningCompleted: blocked call, showing notification."); mMissedCallNotifier.showMissedCallNotification( new MissedCallNotifier.CallInfo(incomingCall)); Loading tests/src/com/android/server/telecom/tests/CallsManagerTest.java +21 −0 Original line number Diff line number Diff line Loading @@ -1676,6 +1676,27 @@ public class CallsManagerTest extends TelecomTestCase { new UserHandle(90210))); } /** * Verifies that if a {@link android.telecom.CallScreeningService} app can properly request * notification show for rejected calls. */ @SmallTest @Test public void testCallScreeningServiceRequestShowNotification() { Call callSpy = addSpyCall(CallState.NEW); CallFilteringResult result = new CallFilteringResult.Builder() .setShouldAllowCall(false) .setShouldReject(true) .setCallScreeningComponentName("com.foo/.Blah") .setCallScreeningAppName("Blah") .setShouldAddToCallLog(true) .setShouldShowNotification(true).build(); mCallsManager.onCallFilteringComplete(callSpy, result, false /* timeout */); verify(mMissedCallNotifier).showMissedCallNotification( any(MissedCallNotifier.CallInfo.class)); } private Call addSpyCall() { return addSpyCall(SIM_2_HANDLE, CallState.ACTIVE); } Loading Loading
src/com/android/server/telecom/CallsManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -861,7 +861,8 @@ public class CallsManager extends Call.ListenerBase } mCallLogManager.logCall(incomingCall, Calls.BLOCKED_TYPE, result.shouldShowNotification, result); } else if (result.shouldShowNotification) { } if (result.shouldShowNotification) { Log.i(this, "onCallScreeningCompleted: blocked call, showing notification."); mMissedCallNotifier.showMissedCallNotification( new MissedCallNotifier.CallInfo(incomingCall)); Loading
tests/src/com/android/server/telecom/tests/CallsManagerTest.java +21 −0 Original line number Diff line number Diff line Loading @@ -1676,6 +1676,27 @@ public class CallsManagerTest extends TelecomTestCase { new UserHandle(90210))); } /** * Verifies that if a {@link android.telecom.CallScreeningService} app can properly request * notification show for rejected calls. */ @SmallTest @Test public void testCallScreeningServiceRequestShowNotification() { Call callSpy = addSpyCall(CallState.NEW); CallFilteringResult result = new CallFilteringResult.Builder() .setShouldAllowCall(false) .setShouldReject(true) .setCallScreeningComponentName("com.foo/.Blah") .setCallScreeningAppName("Blah") .setShouldAddToCallLog(true) .setShouldShowNotification(true).build(); mCallsManager.onCallFilteringComplete(callSpy, result, false /* timeout */); verify(mMissedCallNotifier).showMissedCallNotification( any(MissedCallNotifier.CallInfo.class)); } private Call addSpyCall() { return addSpyCall(SIM_2_HANDLE, CallState.ACTIVE); } Loading