Switch network mode to 2G/3G/4G/(5G)/WIFI

Post your questions and help other users.

Moderator: Martin

stefanprivat
Posts: 24
Joined: 28 Jan 2019 12:42

Switch network mode to 2G/3G/4G/(5G)/WIFI

Post by stefanprivat » 02 Mar 2019 14:08

Hi all

Search for a solution to switch automatic the network mode from/to 2G/3G/4G/(5G in future)/WIFI to proceed calls/sms in the specific network mode.
Found the action "switch mobile network mode", saw also, that root access to device is needed and that it not will work with every terminal.

My question therefore:
Does anyone have experiences with Moto C/G and Samsung Galaxy S8 regarding switching this network mode with Automagic?

Maybe a workaround possible without rooted devices?

If rooted device really is needed, did anyone already tests with Moto C/G and Samsung Galaxy S8 regarding switching this network mode with Automagic?

Thank you for your help!

BR Stefan

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Switch network mode to 2G/3G/4G/(5G)/WIFI

Post by Desmanto » 02 Mar 2019 17:27

You can try Action Set System Setting, require adb in PC to grant automagic write secure setting permission, only once. No root required.

I try to switch the network mode from GSM to WCDMA (3G), the changes happen in [Global] preferred_network_mode2 : 1 >>> 2
1 denotes GSM, 2 denotes WCDMA and many other value you need to try out.

I try this on my phone, Redmi Note 5, RR 7.0.0, Pie 9.0, it still works to switch the network mode. But I don't know if it will work on other phone. You have to try it out.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

stefanprivat
Posts: 24
Joined: 28 Jan 2019 12:42

Re: Switch network mode to 2G/3G/4G/(5G)/WIFI

Post by stefanprivat » 03 Mar 2019 19:59

Hi Desmanto

Thank you very much for the tips above!
Tried near whole day to solve this problem, unfortunately without success.
Tried with a Samsung Galaxy S7 and a Wiko.
Means, I could set correct via adb the suggested permissions.
But the processed action "preferred networkmode2" did no changes in the phones regarding the network mode.
Tried all possible values (also with google table search for all values regarding this preferred networkmode), also a reboot after change (action) did not help.

Found several apps to change the network mode manually in the phone (but need this to have automatic)
Finally I ask me now, if maybe Automagic4Android is able to control/interact such an app and if it is possible
to switch the network mode on this way.

Until now, I checked not, if it maybe will work, when I root the devices.

Best regards

Stefan

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: Switch network mode to 2G/3G/4G/(5G)/WIFI

Post by anuraag » 03 Mar 2019 21:45

@stefanprivat
If your phone isn't dual sim then your phone will not have "preferred networkmode2" value. Instead it will have "preferred networkmode" value only. On dual sim phone there is 3 setting need to change preferred_network_mode, preferred_network_mode1, preferred_network_mode2

Try this flow to detect which setting are changed when you switch network mode. Note down values before and after from debug dialog.

Edit: I have tried to change preferred_network_mode using Automagic (set System setting) on my dual sim Moto g5 plus android 8.1. Its working.

Edit2: For my Samsung A7(2017) android 8.0 dual sim its preferred_network_mode, preferred_network_mode6, preferred_network_mode7
Attachments
flow_Capture_system_setting_20190305_134342.xml
(2.05 KiB) Downloaded 1000 times
Last edited by anuraag on 05 Mar 2019 08:14, edited 1 time in total.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Switch network mode to 2G/3G/4G/(5G)/WIFI

Post by Desmanto » 04 Mar 2019 05:38

@stefanprivat : The key value can be different across different device, have to test it out. I am typing the flow sharing for Secure Setting flow yesterday, but can't finish it yet. As my bad habit, I always want to be perfect, covering all detail before posting it here. One part of the flow is to help you finding which key value correspond to the network mode. Let see if I can manage to post it tonight. I always want to share it already since last year.

Other method if this set system setting doesn't work, you can use Control UI to interact with the UI. But the downside is the UI distraction during the control. viewtopic.php?f=6&t=7320
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

stefanprivat
Posts: 24
Joined: 28 Jan 2019 12:42

Re: Switch network mode to 2G/3G/4G/(5G)/WIFI

Post by stefanprivat » 04 Mar 2019 07:18

@Desmanto

Thank you again for your greatful help!
I can/will check your flow and tips this evening and will come back with logs/results.

Best regards Stefan

stefanprivat
Posts: 24
Joined: 28 Jan 2019 12:42

Re: Switch network mode to 2G/3G/4G/(5G)/WIFI

Post by stefanprivat » 04 Mar 2019 21:09

@anuraag
Thank you for the help.
Tested today with the flow "capture system setting" from you.
Unfortunately after and before switching network mode, I got exactly same result, also when I switch the network mode manually in the menu.
Tried also already yesterday only with the setting "preferred_network_mode" (for the Galaxy S7) and only on the dual sim Wiko with all the 3 preferred_network_mode /preferred_network_mode1/preferred_network_mode2.

@Desmanto
Thank you for the help.
Yes, would be great if you can share the flow for Secure Setting.
Regarding your tip concerning using UI: tried this today, works well, switching of the network mode is possible, except after switching,
I cannot close the menu Dialog "mobile network". Tried several menus from overlay help, without success.
Tried/found several hints here in forum like: Action: close system Dialogs or via UI back back…
Also with home button, I only get the opened menu "mobile network" in background. How do I have to exit/close complete this menu?

Best regards and againg: THANK YOU VERY MUCH FOR THE GREAT HELP HERE IN THIS FORUM!!!

Stefan

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: Switch network mode to 2G/3G/4G/(5G)/WIFI

Post by anuraag » 05 Mar 2019 00:07

@stefanprivat
Can you do following?
1) Delete previous flow shared by me.
1) Re-download flow from my above post. Enable capture system setting flow.
2) Switch network mode from your system setting.
3) Post output from file "/storage/emulated/0/system_setting.txt"

stefanprivat
Posts: 24
Joined: 28 Jan 2019 12:42

Re: Switch network mode to 2G/3G/4G/(5G)/WIFI

Post by stefanprivat » 05 Mar 2019 08:28

@anuraag

Ah, now I understand the capture setting function.
(processed yesterday only manually the start of that flow after change networ kmode, sorry for the confusion)

Therefore I can now report follows:
When I change in the phone menu manually the network mode, following will be reported:
From 4G/3G/2G to 3G:
old setting: 9
setting: 2
setting_name: preferred_network_mode
trigger: System Setting Changed: Global*


From 3G to 4G/3G/2G:
old setting: 2
setting: 3
setting_name: preferred_network_mode
trigger: System Setting Changed: Global*

So, I tried exact same now with proceeding my flow.
I got exactly same output reported as above, bot when I control afterwars the network mode settings in menu, nothing changed, means, still old mode (even it was reported by the capture setting flow).

Tried also in flow with setting System (System Setting Changed: System*) instead of Global (System Setting Changed: Global*)
Same issue.

Regarding permissions: I am sure, that I have set days before several times via adb the ".............android.permission.WRITE_SECURE_SETTINGS" without getting an error

Additional remark: when I then try to process a second time the same flow (with same setting like 9 or 2) to change the mode, the capture setting flows reports nothing.
So I assume, that something will be changed in system when flow the first time will be processed, but finally not activated in phone/GUI.
But also in upper status view from the phone, there is still the same icon visible after flow was processed (4G or 3G or H+)

Best regards

Stefan

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: Switch network mode to 2G/3G/4G/(5G)/WIFI

Post by anuraag » 05 Mar 2019 09:48

@stefanprivat
You are doing something wrong here. Is it possible to share your flow?
stefanprivat wrote: From 4G/3G/2G to 3G:
old setting: 9
setting: 2
setting_name: preferred_network_mode
trigger: System Setting Changed: Global*


From 3G to 4G/3G/2G:
old setting: 2
setting: 3
setting_name: preferred_network_mode
trigger: System Setting Changed: Global*
Did you mistype here new value for 3G to 4G/3G/2G? It should be 9.

Edit: created a flow based on value you have posted. Test it on same device. You have to open last action and enable "I have verified the setting I know what I'm doing".
Attachments
flow_Change_Network_mode_20190305_152852.xml
(2.61 KiB) Downloaded 1035 times

Post Reply