Loading src/com/android/server/telecom/CallsManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -2207,10 +2207,10 @@ public class CallsManager extends Call.ListenerBase // If we're specifically looking for video capable accounts, then include that capability, // otherwise specify no additional capability constraints. When handling the emergency call, // it also needs to find the phone accounts excluded by CAPABILITY_EMERGENCY_CALLS_ONLY. List<PhoneAccountHandle> allAccounts = isEmergency ? mPhoneAccountRegistrar.getAllPhoneAccountHandles(user) : List<PhoneAccountHandle> allAccounts = mPhoneAccountRegistrar.getCallCapablePhoneAccounts(handle.getScheme(), false, user, isVideo ? PhoneAccount.CAPABILITY_VIDEO_CALLING : 0 /* any */); isVideo ? PhoneAccount.CAPABILITY_VIDEO_CALLING : 0 /* any */, isEmergency ? 0 : PhoneAccount.CAPABILITY_EMERGENCY_CALLS_ONLY); // First check the Radio SIM Technology if(mRadioSimVariants == null) { TelephonyManager tm = (TelephonyManager) mContext.getSystemService( Loading src/com/android/server/telecom/PhoneAccountRegistrar.java +3 −3 Original line number Diff line number Diff line Loading @@ -649,7 +649,7 @@ public class PhoneAccountRegistrar { public List<PhoneAccountHandle> getCallCapablePhoneAccounts( String uriScheme, boolean includeDisabledAccounts, UserHandle userHandle) { return getCallCapablePhoneAccounts(uriScheme, includeDisabledAccounts, userHandle, 0 /* capabilities */); 0 /* capabilities */, PhoneAccount.CAPABILITY_EMERGENCY_CALLS_ONLY); } /** Loading @@ -666,10 +666,10 @@ public class PhoneAccountRegistrar { */ public List<PhoneAccountHandle> getCallCapablePhoneAccounts( String uriScheme, boolean includeDisabledAccounts, UserHandle userHandle, int capabilities) { int capabilities, int excludedCapabilities) { return getPhoneAccountHandles( PhoneAccount.CAPABILITY_CALL_PROVIDER | capabilities, PhoneAccount.CAPABILITY_EMERGENCY_CALLS_ONLY /*excludedCapabilities*/, excludedCapabilities /*excludedCapabilities*/, uriScheme, null, includeDisabledAccounts, userHandle); } Loading tests/src/com/android/server/telecom/tests/CallsManagerTest.java +8 −8 Original line number Diff line number Diff line Loading @@ -330,7 +330,7 @@ public class CallsManagerTest extends TelecomTestCase { when(mPhoneAccountRegistrar.getOutgoingPhoneAccountForScheme(any(), any())).thenReturn( SIM_1_HANDLE); when(mPhoneAccountRegistrar.getCallCapablePhoneAccounts(any(), anyBoolean(), any(), anyInt())).thenReturn( any(), anyInt(), anyInt())).thenReturn( new ArrayList<>(Arrays.asList(SIM_1_HANDLE, SIM_2_HANDLE))); List<PhoneAccountHandle> accounts = mCallsManager.findOutgoingCallPhoneAccount( Loading @@ -354,7 +354,7 @@ public class CallsManagerTest extends TelecomTestCase { when(mPhoneAccountRegistrar.getOutgoingPhoneAccountForScheme(any(), any())).thenReturn( null); when(mPhoneAccountRegistrar.getCallCapablePhoneAccounts(any(), anyBoolean(), any(), anyInt())).thenReturn( any(), anyInt(), anyInt())).thenReturn( new ArrayList<>(Arrays.asList(SIM_1_HANDLE, SIM_2_HANDLE))); List<PhoneAccountHandle> accounts = mCallsManager.findOutgoingCallPhoneAccount( Loading @@ -378,7 +378,7 @@ public class CallsManagerTest extends TelecomTestCase { when(mPhoneAccountRegistrar.getOutgoingPhoneAccountForScheme(any(), any())).thenReturn( null); when(mPhoneAccountRegistrar.getCallCapablePhoneAccounts(any(), anyBoolean(), any(), eq(PhoneAccount.CAPABILITY_VIDEO_CALLING))).thenReturn( any(), eq(PhoneAccount.CAPABILITY_VIDEO_CALLING), anyInt())).thenReturn( new ArrayList<>(Arrays.asList(SIM_2_HANDLE))); List<PhoneAccountHandle> accounts = mCallsManager.findOutgoingCallPhoneAccount( Loading @@ -402,11 +402,11 @@ public class CallsManagerTest extends TelecomTestCase { null); // When querying for video capable accounts, return nothing. when(mPhoneAccountRegistrar.getCallCapablePhoneAccounts(any(), anyBoolean(), any(), eq(PhoneAccount.CAPABILITY_VIDEO_CALLING))).thenReturn( any(), eq(PhoneAccount.CAPABILITY_VIDEO_CALLING), anyInt())).thenReturn( Collections.emptyList()); // When querying for non-video capable accounts, return one. when(mPhoneAccountRegistrar.getCallCapablePhoneAccounts(any(), anyBoolean(), any(), eq(0 /* none specified */))).thenReturn( any(), eq(0 /* none specified */), anyInt())).thenReturn( new ArrayList<>(Arrays.asList(SIM_1_HANDLE))); List<PhoneAccountHandle> accounts = mCallsManager.findOutgoingCallPhoneAccount( null /* phoneAcct */, TEST_ADDRESS, true /* isVideo */, false /* isEmergency */, null /* userHandle */) Loading @@ -428,7 +428,7 @@ public class CallsManagerTest extends TelecomTestCase { when(mPhoneAccountRegistrar.getOutgoingPhoneAccountForScheme(any(), any())).thenReturn( null); when(mPhoneAccountRegistrar.getCallCapablePhoneAccounts(any(), anyBoolean(), any(), anyInt())).thenReturn( any(), anyInt(), anyInt())).thenReturn( new ArrayList<>(Arrays.asList(SIM_1_HANDLE, SIM_2_HANDLE))); List<PhoneAccountHandle> accounts = mCallsManager.findOutgoingCallPhoneAccount( Loading @@ -449,7 +449,7 @@ public class CallsManagerTest extends TelecomTestCase { when(mPhoneAccountRegistrar.getOutgoingPhoneAccountForScheme(any(), any())).thenReturn( null); when(mPhoneAccountRegistrar.getCallCapablePhoneAccounts(any(), anyBoolean(), any(), anyInt())).thenReturn( any(), anyInt(), anyInt())).thenReturn( new ArrayList<>(Arrays.asList(SIM_1_HANDLE, SIM_2_HANDLE))); List<PhoneAccountHandle> accounts = mCallsManager.findOutgoingCallPhoneAccount( Loading Loading @@ -1130,7 +1130,7 @@ public class CallsManagerTest extends TelecomTestCase { when(mockTelephonyManager.getMultiSimConfiguration()).thenReturn( TelephonyManager.MultiSimVariants.DSDS); when(mPhoneAccountRegistrar.getCallCapablePhoneAccounts(any(), anyBoolean(), any(), anyInt())).thenReturn( any(), anyInt(), anyInt())).thenReturn( new ArrayList<>(Arrays.asList(SIM_1_HANDLE, SIM_2_HANDLE))); when(mPhoneAccountRegistrar.getSimPhoneAccountsOfCurrentUser()).thenReturn( new ArrayList<>(Arrays.asList(SIM_1_HANDLE, SIM_2_HANDLE))); Loading Loading
src/com/android/server/telecom/CallsManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -2207,10 +2207,10 @@ public class CallsManager extends Call.ListenerBase // If we're specifically looking for video capable accounts, then include that capability, // otherwise specify no additional capability constraints. When handling the emergency call, // it also needs to find the phone accounts excluded by CAPABILITY_EMERGENCY_CALLS_ONLY. List<PhoneAccountHandle> allAccounts = isEmergency ? mPhoneAccountRegistrar.getAllPhoneAccountHandles(user) : List<PhoneAccountHandle> allAccounts = mPhoneAccountRegistrar.getCallCapablePhoneAccounts(handle.getScheme(), false, user, isVideo ? PhoneAccount.CAPABILITY_VIDEO_CALLING : 0 /* any */); isVideo ? PhoneAccount.CAPABILITY_VIDEO_CALLING : 0 /* any */, isEmergency ? 0 : PhoneAccount.CAPABILITY_EMERGENCY_CALLS_ONLY); // First check the Radio SIM Technology if(mRadioSimVariants == null) { TelephonyManager tm = (TelephonyManager) mContext.getSystemService( Loading
src/com/android/server/telecom/PhoneAccountRegistrar.java +3 −3 Original line number Diff line number Diff line Loading @@ -649,7 +649,7 @@ public class PhoneAccountRegistrar { public List<PhoneAccountHandle> getCallCapablePhoneAccounts( String uriScheme, boolean includeDisabledAccounts, UserHandle userHandle) { return getCallCapablePhoneAccounts(uriScheme, includeDisabledAccounts, userHandle, 0 /* capabilities */); 0 /* capabilities */, PhoneAccount.CAPABILITY_EMERGENCY_CALLS_ONLY); } /** Loading @@ -666,10 +666,10 @@ public class PhoneAccountRegistrar { */ public List<PhoneAccountHandle> getCallCapablePhoneAccounts( String uriScheme, boolean includeDisabledAccounts, UserHandle userHandle, int capabilities) { int capabilities, int excludedCapabilities) { return getPhoneAccountHandles( PhoneAccount.CAPABILITY_CALL_PROVIDER | capabilities, PhoneAccount.CAPABILITY_EMERGENCY_CALLS_ONLY /*excludedCapabilities*/, excludedCapabilities /*excludedCapabilities*/, uriScheme, null, includeDisabledAccounts, userHandle); } Loading
tests/src/com/android/server/telecom/tests/CallsManagerTest.java +8 −8 Original line number Diff line number Diff line Loading @@ -330,7 +330,7 @@ public class CallsManagerTest extends TelecomTestCase { when(mPhoneAccountRegistrar.getOutgoingPhoneAccountForScheme(any(), any())).thenReturn( SIM_1_HANDLE); when(mPhoneAccountRegistrar.getCallCapablePhoneAccounts(any(), anyBoolean(), any(), anyInt())).thenReturn( any(), anyInt(), anyInt())).thenReturn( new ArrayList<>(Arrays.asList(SIM_1_HANDLE, SIM_2_HANDLE))); List<PhoneAccountHandle> accounts = mCallsManager.findOutgoingCallPhoneAccount( Loading @@ -354,7 +354,7 @@ public class CallsManagerTest extends TelecomTestCase { when(mPhoneAccountRegistrar.getOutgoingPhoneAccountForScheme(any(), any())).thenReturn( null); when(mPhoneAccountRegistrar.getCallCapablePhoneAccounts(any(), anyBoolean(), any(), anyInt())).thenReturn( any(), anyInt(), anyInt())).thenReturn( new ArrayList<>(Arrays.asList(SIM_1_HANDLE, SIM_2_HANDLE))); List<PhoneAccountHandle> accounts = mCallsManager.findOutgoingCallPhoneAccount( Loading @@ -378,7 +378,7 @@ public class CallsManagerTest extends TelecomTestCase { when(mPhoneAccountRegistrar.getOutgoingPhoneAccountForScheme(any(), any())).thenReturn( null); when(mPhoneAccountRegistrar.getCallCapablePhoneAccounts(any(), anyBoolean(), any(), eq(PhoneAccount.CAPABILITY_VIDEO_CALLING))).thenReturn( any(), eq(PhoneAccount.CAPABILITY_VIDEO_CALLING), anyInt())).thenReturn( new ArrayList<>(Arrays.asList(SIM_2_HANDLE))); List<PhoneAccountHandle> accounts = mCallsManager.findOutgoingCallPhoneAccount( Loading @@ -402,11 +402,11 @@ public class CallsManagerTest extends TelecomTestCase { null); // When querying for video capable accounts, return nothing. when(mPhoneAccountRegistrar.getCallCapablePhoneAccounts(any(), anyBoolean(), any(), eq(PhoneAccount.CAPABILITY_VIDEO_CALLING))).thenReturn( any(), eq(PhoneAccount.CAPABILITY_VIDEO_CALLING), anyInt())).thenReturn( Collections.emptyList()); // When querying for non-video capable accounts, return one. when(mPhoneAccountRegistrar.getCallCapablePhoneAccounts(any(), anyBoolean(), any(), eq(0 /* none specified */))).thenReturn( any(), eq(0 /* none specified */), anyInt())).thenReturn( new ArrayList<>(Arrays.asList(SIM_1_HANDLE))); List<PhoneAccountHandle> accounts = mCallsManager.findOutgoingCallPhoneAccount( null /* phoneAcct */, TEST_ADDRESS, true /* isVideo */, false /* isEmergency */, null /* userHandle */) Loading @@ -428,7 +428,7 @@ public class CallsManagerTest extends TelecomTestCase { when(mPhoneAccountRegistrar.getOutgoingPhoneAccountForScheme(any(), any())).thenReturn( null); when(mPhoneAccountRegistrar.getCallCapablePhoneAccounts(any(), anyBoolean(), any(), anyInt())).thenReturn( any(), anyInt(), anyInt())).thenReturn( new ArrayList<>(Arrays.asList(SIM_1_HANDLE, SIM_2_HANDLE))); List<PhoneAccountHandle> accounts = mCallsManager.findOutgoingCallPhoneAccount( Loading @@ -449,7 +449,7 @@ public class CallsManagerTest extends TelecomTestCase { when(mPhoneAccountRegistrar.getOutgoingPhoneAccountForScheme(any(), any())).thenReturn( null); when(mPhoneAccountRegistrar.getCallCapablePhoneAccounts(any(), anyBoolean(), any(), anyInt())).thenReturn( any(), anyInt(), anyInt())).thenReturn( new ArrayList<>(Arrays.asList(SIM_1_HANDLE, SIM_2_HANDLE))); List<PhoneAccountHandle> accounts = mCallsManager.findOutgoingCallPhoneAccount( Loading Loading @@ -1130,7 +1130,7 @@ public class CallsManagerTest extends TelecomTestCase { when(mockTelephonyManager.getMultiSimConfiguration()).thenReturn( TelephonyManager.MultiSimVariants.DSDS); when(mPhoneAccountRegistrar.getCallCapablePhoneAccounts(any(), anyBoolean(), any(), anyInt())).thenReturn( any(), anyInt(), anyInt())).thenReturn( new ArrayList<>(Arrays.asList(SIM_1_HANDLE, SIM_2_HANDLE))); when(mPhoneAccountRegistrar.getSimPhoneAccountsOfCurrentUser()).thenReturn( new ArrayList<>(Arrays.asList(SIM_1_HANDLE, SIM_2_HANDLE))); Loading