I can not find a solution. The task is to show the activity / dialogue before the call with a choice of sim1 or sim2. What I could implement, but it does not work on all devices.
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + call_phone)); intent.putExtra("com.android.phone.extra.slot", sim); intent.putExtra("slot", sim); intent.putExtra("simSlot", sim); intent.putExtra("simID", sim); intent.putExtra("simId", sim); intent.putExtra("subscription", sim); intent.putExtra("SlotId", sim); intent.putExtra("SLOT_ID", sim); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); I also tried
try { ContentValues val = new ContentValues(); List<Integer> sims = getInsertedSIMIds(context); val.put("value", sims.get(sim)); context.getContentResolver().update(Uri.parse("content://settings/system"), val, "name='voice_call_sim_setting'", null); } catch (Exception e) { Log.e("Error", e.toString()); } there are no results at all.
I think the best implementation is to write to each system outgoing calls in the system default settings of the default (for the call), but I don’t quite understand how to implement it. Any help would be helpful, thanks in advance.
I found another such information, but it also does not work on my device.
/**Where simN is sim card number, 0 - disable all sim cards radio modules, 1 - allow only first sim card radio module, 2 - allow only second sim card radio module, 3 - allow all sim cards radio module */ Settings.System.putInt(getContentResolver(), "dual_sim_mode_setting", 2); Intent localIntent = new Intent("android.intent.action.DUAL_SIM_MODE"); localIntent.putExtra("mode", 2); context.sendBroadcast(localIntent);