diff options
author | Ricky Wai <rickywai@google.com> | 2019-04-09 21:43:48 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-04-09 21:43:48 +0000 |
commit | 205ca176956f07d00384d2ff192364320bbbb1d3 (patch) | |
tree | 4163e6a80ad5b9646b303de0db672e1e83b9df53 /tests | |
parent | f1a141982f7e3b459d5b2f7c79bd88ce8ca6b08f (diff) | |
parent | e4966c68bb6049ca7fbdfa4599a9e8213ae1dd38 (diff) | |
download | android_packages_services_Telecomm-205ca176956f07d00384d2ff192364320bbbb1d3.tar.gz android_packages_services_Telecomm-205ca176956f07d00384d2ff192364320bbbb1d3.tar.bz2 android_packages_services_Telecomm-205ca176956f07d00384d2ff192364320bbbb1d3.zip |
Merge "Allow InCallServiceImpl to start background activity" into qt-dev
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/server/telecom/tests/InCallControllerTests.java | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/tests/src/com/android/server/telecom/tests/InCallControllerTests.java b/tests/src/com/android/server/telecom/tests/InCallControllerTests.java index af2f9b6a..bbefae36 100644 --- a/tests/src/com/android/server/telecom/tests/InCallControllerTests.java +++ b/tests/src/com/android/server/telecom/tests/InCallControllerTests.java @@ -187,7 +187,8 @@ public class InCallControllerTests extends TelecomTestCase { verify(mMockContext).bindServiceAsUser( bindIntentCaptor.capture(), any(ServiceConnection.class), - eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE), + eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE + | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS), eq(UserHandle.CURRENT)); Intent bindIntent = bindIntentCaptor.getValue(); @@ -221,7 +222,8 @@ public class InCallControllerTests extends TelecomTestCase { verify(mMockContext).bindServiceAsUser( bindIntentCaptor.capture(), any(ServiceConnection.class), - eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE), + eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE + | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS), eq(UserHandle.CURRENT)); Intent bindIntent = bindIntentCaptor.getValue(); @@ -272,7 +274,8 @@ public class InCallControllerTests extends TelecomTestCase { verify(mMockContext, times(1)).bindServiceAsUser( bindIntentCaptor.capture(), any(ServiceConnection.class), - eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE), + eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE + | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS), eq(UserHandle.CURRENT)); Intent bindIntent = bindIntentCaptor.getValue(); @@ -302,7 +305,8 @@ public class InCallControllerTests extends TelecomTestCase { when(mDefaultDialerCache.getDefaultDialerApplication(CURRENT_USER_ID)) .thenReturn(DEF_PKG); when(mMockContext.bindServiceAsUser(any(Intent.class), any(ServiceConnection.class), - eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE), + eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE + | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS), eq(UserHandle.CURRENT))).thenReturn(true); when(mTimeoutsAdapter.getEmergencyCallbackWindowMillis(any(ContentResolver.class))) .thenReturn(300_000L); @@ -329,7 +333,8 @@ public class InCallControllerTests extends TelecomTestCase { verify(mMockContext, times(1)).bindServiceAsUser( bindIntentCaptor.capture(), any(ServiceConnection.class), - eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE), + eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE + | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS), eq(UserHandle.CURRENT)); Intent bindIntent = bindIntentCaptor.getValue(); @@ -398,7 +403,8 @@ public class InCallControllerTests extends TelecomTestCase { verify(mMockContext, times(1)).bindServiceAsUser( bindIntentCaptor.capture(), serviceConnectionCaptor.capture(), - eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE), + eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE + | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS), eq(UserHandle.CURRENT)); Intent bindIntent = bindIntentCaptor.getValue(); @@ -430,7 +436,8 @@ public class InCallControllerTests extends TelecomTestCase { verify(mMockContext, times(2)).bindServiceAsUser( bindIntentCaptor2.capture(), any(ServiceConnection.class), - eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE), + eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE + | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS), eq(UserHandle.CURRENT)); bindIntent = bindIntentCaptor2.getValue(); @@ -466,7 +473,8 @@ public class InCallControllerTests extends TelecomTestCase { verify(mMockContext, times(1)).bindServiceAsUser( bindIntentCaptor.capture(), any(ServiceConnection.class), - eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE), + eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE + | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS), eq(UserHandle.CURRENT)); Intent bindIntent = bindIntentCaptor.getValue(); @@ -504,7 +512,8 @@ public class InCallControllerTests extends TelecomTestCase { verify(mMockContext, times(1)).bindServiceAsUser( bindIntentCaptor.capture(), serviceConnectionCaptor.capture(), - eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE), + eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE + | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS), eq(UserHandle.CURRENT)); // Pretend that the call has gone away. @@ -568,7 +577,8 @@ public class InCallControllerTests extends TelecomTestCase { verify(mMockContext, times(3)).bindServiceAsUser( bindIntentCaptor.capture(), any(ServiceConnection.class), - eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE), + eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE + | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS), eq(UserHandle.CURRENT)); // Verify bind dialer Intent bindIntent = bindIntentCaptor.getAllValues().get(0); @@ -620,7 +630,8 @@ public class InCallControllerTests extends TelecomTestCase { verify(mMockContext, times(1)).bindServiceAsUser( bindIntentCaptor.capture(), any(ServiceConnection.class), - eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE), + eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE + | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS), eq(UserHandle.CURRENT)); // Verify bind car mode ui assertEquals(1, bindIntentCaptor.getAllValues().size()); @@ -663,7 +674,8 @@ public class InCallControllerTests extends TelecomTestCase { verify(mMockContext, times(1)).bindServiceAsUser( bindIntentCaptor.capture(), any(ServiceConnection.class), - eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE), + eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE + | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS), eq(UserHandle.CURRENT)); // Verify bind to default package, instead of the invalid car mode ui. assertEquals(1, bindIntentCaptor.getAllValues().size()); @@ -702,7 +714,8 @@ public class InCallControllerTests extends TelecomTestCase { verify(mMockContext, times(1)).bindServiceAsUser( bindIntentCaptor.capture(), serviceConnectionCaptor.capture(), - eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE), + eq(Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE + | Context.BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS), eq(UserHandle.CURRENT)); CompletableFuture<Boolean> bindTimeout = mInCallController.getBindingFuture(); |