Loading src/com/android/server/telecom/callredirection/CallRedirectionProcessor.java +8 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,14 @@ public class CallRedirectionProcessor implements CallRedirectionCallback { + mServiceType + " call redirection service"); } } Log.i(this, "notifyTimeout: call redirection has timed out so " + "unbinding the connection"); if (mConnection != null) { // We still need to call unbind even if the service disconnected. mContext.unbindService(mConnection); mConnection = null; } mService = null; } private class CallRedirectionServiceConnection implements ServiceConnection { Loading tests/src/com/android/server/telecom/tests/CallRedirectionProcessorTest.java +12 −0 Original line number Diff line number Diff line Loading @@ -219,6 +219,9 @@ public class CallRedirectionProcessorTest extends TelecomTestCase { verify(mCallsManager, times(1)).onCallRedirectionComplete(eq(mCall), any(), eq(mPhoneAccountHandle), eq(null), eq(SPEAKER_PHONE_ON), eq(VIDEO_STATE), eq(false), eq(CallRedirectionProcessor.UI_TYPE_NO_ACTION)); // Verify service was unbound verify(mContext, times(1)). unbindService(any(ServiceConnection.class)); } @Test Loading Loading @@ -247,6 +250,9 @@ public class CallRedirectionProcessorTest extends TelecomTestCase { verify(mCallsManager, times(1)).onCallRedirectionComplete(eq(mCall), any(), eq(mPhoneAccountHandle), eq(null), eq(SPEAKER_PHONE_ON), eq(VIDEO_STATE), eq(true), eq(CallRedirectionProcessor.UI_TYPE_USER_DEFINED_TIMEOUT)); // Verify service was unbound verify(mContext, times(1)). unbindService(any(ServiceConnection.class)); } @Test Loading Loading @@ -278,6 +284,9 @@ public class CallRedirectionProcessorTest extends TelecomTestCase { verify(mCallsManager, times(1)).onCallRedirectionComplete(eq(mCall), any(), eq(mPhoneAccountHandle), eq(null), eq(SPEAKER_PHONE_ON), eq(VIDEO_STATE), eq(true), eq(CallRedirectionProcessor.UI_TYPE_USER_DEFINED_TIMEOUT)); // Verify service was unbound verify(mContext, times(1)). unbindService(any(ServiceConnection.class)); // Wait for another carrier timeout time, but should not expect any carrier service request // is triggered. Loading @@ -287,6 +296,9 @@ public class CallRedirectionProcessorTest extends TelecomTestCase { verify(mCallsManager, times(1)).onCallRedirectionComplete(eq(mCall), any(), eq(mPhoneAccountHandle), eq(null), eq(SPEAKER_PHONE_ON), eq(VIDEO_STATE), eq(true), eq(CallRedirectionProcessor.UI_TYPE_USER_DEFINED_TIMEOUT)); // Verify service was unbound verify(mContext, times(1)). unbindService(any(ServiceConnection.class)); } @Test Loading Loading
src/com/android/server/telecom/callredirection/CallRedirectionProcessor.java +8 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,14 @@ public class CallRedirectionProcessor implements CallRedirectionCallback { + mServiceType + " call redirection service"); } } Log.i(this, "notifyTimeout: call redirection has timed out so " + "unbinding the connection"); if (mConnection != null) { // We still need to call unbind even if the service disconnected. mContext.unbindService(mConnection); mConnection = null; } mService = null; } private class CallRedirectionServiceConnection implements ServiceConnection { Loading
tests/src/com/android/server/telecom/tests/CallRedirectionProcessorTest.java +12 −0 Original line number Diff line number Diff line Loading @@ -219,6 +219,9 @@ public class CallRedirectionProcessorTest extends TelecomTestCase { verify(mCallsManager, times(1)).onCallRedirectionComplete(eq(mCall), any(), eq(mPhoneAccountHandle), eq(null), eq(SPEAKER_PHONE_ON), eq(VIDEO_STATE), eq(false), eq(CallRedirectionProcessor.UI_TYPE_NO_ACTION)); // Verify service was unbound verify(mContext, times(1)). unbindService(any(ServiceConnection.class)); } @Test Loading Loading @@ -247,6 +250,9 @@ public class CallRedirectionProcessorTest extends TelecomTestCase { verify(mCallsManager, times(1)).onCallRedirectionComplete(eq(mCall), any(), eq(mPhoneAccountHandle), eq(null), eq(SPEAKER_PHONE_ON), eq(VIDEO_STATE), eq(true), eq(CallRedirectionProcessor.UI_TYPE_USER_DEFINED_TIMEOUT)); // Verify service was unbound verify(mContext, times(1)). unbindService(any(ServiceConnection.class)); } @Test Loading Loading @@ -278,6 +284,9 @@ public class CallRedirectionProcessorTest extends TelecomTestCase { verify(mCallsManager, times(1)).onCallRedirectionComplete(eq(mCall), any(), eq(mPhoneAccountHandle), eq(null), eq(SPEAKER_PHONE_ON), eq(VIDEO_STATE), eq(true), eq(CallRedirectionProcessor.UI_TYPE_USER_DEFINED_TIMEOUT)); // Verify service was unbound verify(mContext, times(1)). unbindService(any(ServiceConnection.class)); // Wait for another carrier timeout time, but should not expect any carrier service request // is triggered. Loading @@ -287,6 +296,9 @@ public class CallRedirectionProcessorTest extends TelecomTestCase { verify(mCallsManager, times(1)).onCallRedirectionComplete(eq(mCall), any(), eq(mPhoneAccountHandle), eq(null), eq(SPEAKER_PHONE_ON), eq(VIDEO_STATE), eq(true), eq(CallRedirectionProcessor.UI_TYPE_USER_DEFINED_TIMEOUT)); // Verify service was unbound verify(mContext, times(1)). unbindService(any(ServiceConnection.class)); } @Test Loading