I have a dual sim android phone. I am using this code to make a call:
private void callBack(String phone, Context context) {
Intent callIntent = new
final Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumberOrUssd));
final int simSlotIndex = 1; //Second sim slot
try {
final Method getSubIdMethod = SubscriptionManager.class.getDeclaredMethod("getSubId", int.class);
getSubIdMethod.setAccessible(true);
final long subIdForSlot = ((long[]) getSubIdMethod.invoke(SubscriptionManager.class, simSlotIndex))[0];
final ComponentName componentName = new ComponentName("com.android.phone", "com.android.services.telephony.TelephonyConnectionService");
final PhoneAccountHandle phoneAccountHandle = new PhoneAccountHandle(componentName, String.valueOf(subIdForSlot));
intent.putExtra("android.telecom.extra.PHONE_ACCOUNT_HANDLE", phoneAccountHandle);
} catch (Exception e) {
e.printStackTrace();
}
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
Work on dual-sim Asus Fonepad 7 Android 5.0