Dual Sim control

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
V10
Posts: 1
Joined: 15 Sep 2013 09:32

Dual Sim control

Post by V10 » 15 Sep 2013 09:45

Hi.

There is simple code for control dual sim phone in MTK (mediatek) chipsets. Can you add this to Automagic?

1) Enable \ disable radio module on single sim card

java code:

Code: Select all

        Settings.System.putInt(getContentResolver(), "dual_sim_mode_setting", simN);
        Intent localIntent = new Intent("android.intent.action.DUAL_SIM_MODE");
        localIntent.putExtra("mode", simN);
        sendBroadcast(localIntent);
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

shell script (root):
mtk_sim_radio_control.sh

Code: Select all

#!/bin/sh
settings put system dual_sim_mode_setting $1
am broadcast -a android.intent.action.DUAL_SIM_MODE --ei mode $1
run: sh mtk_sim_radio_control.sh simN


2) Select sim card for 3G or disable data radio module
java code:

Code: Select all

        Settings.System.putLong(getContentResolver(), "gprs_connection_sim_setting ", simN);
        Intent localIntent = new Intent("android.intent.action.DATA_DEFAULT_SIM");
        localIntent.putExtra("simid", simN);
        sendBroadcast(localIntent);
Where simN is sim card number, 0 - disable all sim cards data radio module, 1 - use first sim card data radio module, 2 - use second sim card data radio module

shell script (root):
mtk_sim_3g_control.sh

Code: Select all

#!/bin/sh
settings put system gprs_connection_sim_setting $1
am broadcast -a android.intent.action.DATA_DEFAULT_SIM --el simid $1
run: sh mtk_sim_3g_control.sh simN

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Dual Sim control

Post by Martin » 15 Sep 2013 11:22

Hi,

Thanks for the detailed request!
Unfortunately I don't have the time to add device specific actions to Automagic in the near future, I'm concentrating on features that are officially available on Android or on features that are very popular.
Perhaps you could create an automation plugin to control the dual SIM features: Plugin Doc. This would make the functions also available for other automation tools like Tasker, Llama and Locale.

The next version of Automagic adds a new action to modify system settings that helps a little to make such device specific settings available in Automagic without using shell scripts but you will still have to send the broadcast to announce the change in the system.

Regards,
Martin

joaormf
Posts: 2
Joined: 18 Jan 2014 19:26

Re: Dual Sim control

Post by joaormf » 18 Jan 2014 19:27

Hi,

I've made a plugin that uses the Locale/Automagic plugin interface.

It's called "MTK Control", search for it on Play Store.

User avatar
Nerey
Posts: 102
Joined: 07 Mar 2014 16:59

Re: Dual Sim control

Post by Nerey » 09 Jul 2014 10:19

Hi
How to use your plugin?
Sorry for bad english, my native is russian.

joaormf
Posts: 2
Joined: 18 Jan 2014 19:26

Re: Dual Sim control

Post by joaormf » 28 Nov 2014 13:38

Nerey wrote:Hi
How to use your plugin?
Hi,

Go to Google Play store and search for "MTK Control". I have a free version that you can use to check if it's compatible with your phone.

The more advanced features are only available as premium or on the paid version.

Pr0grammer
Posts: 1
Joined: 27 Jul 2015 08:51

Re: Dual Sim control

Post by Pr0grammer » 27 Jul 2015 08:53

i need code to deactivate single sim card phone.
please help me!

Locked